diff --git a/jiuyi2/api/login.js b/jiuyi2/api/login.js index 5f5834a6..3588a223 100644 --- a/jiuyi2/api/login.js +++ b/jiuyi2/api/login.js @@ -47,7 +47,6 @@ const login = { return util.request({ url: '/user/login/resetPassword', data: param.data, - path: param.path, method: 'POST', }) }, diff --git a/jiuyi2/api/mine.js b/jiuyi2/api/mine.js index 1cdbde63..0551f6fd 100644 --- a/jiuyi2/api/mine.js +++ b/jiuyi2/api/mine.js @@ -52,7 +52,23 @@ const mine = { }) }, - // 实名认证 + /** + * 验证盖章后是否实名 + * @param {Object} param + */ + isCertification(param) { + return util.request({ + url: `/user/isCertification`, + query: param.query, + method: 'POST', + load: true, + }) + }, + + /** + * 实名认证 + * @param {Object} param + */ certification(param) { return util.request({ url: `/user/info/certification`, diff --git a/jiuyi2/api/shop.js b/jiuyi2/api/shop.js index 398aec08..0622a2ff 100644 --- a/jiuyi2/api/shop.js +++ b/jiuyi2/api/shop.js @@ -13,6 +13,7 @@ const shop = { method: 'GET', }) }, + /** * 商家缴纳押金 * @param {Object} param @@ -20,6 +21,7 @@ const shop = { depositsPay(param) { return util.request({ url: `/shopify/appDeposits/depositsPay`, + load: true, method: 'POST', }) }, @@ -65,6 +67,7 @@ const shop = { outDepositsPay(param) { return util.request({ url: `/shopify/appDeposits/outDepositsPay`, + load: true, method: 'POST', }) }, diff --git a/jiuyi2/common/js/config.js b/jiuyi2/common/js/config.js index 30280631..9f562d7c 100644 --- a/jiuyi2/common/js/config.js +++ b/jiuyi2/common/js/config.js @@ -5,18 +5,19 @@ const config = { host: 'http://localhost:5173', // #endif // #ifndef H5 - host: 'http://91f.xyz:8080', - // host: 'http://6jv6aq.natappfree.cc ', + // host: 'http://91f.xyz:8080', + // host: 'http://192.168.31.61:8080', + host: 'http://192.168.31.41:8080', // #endif // 支付方式配置 payType: { score: { name: '积分', - img: '/static/score.png', + icon: '/static/score.png', }, balance: { name: '余额', - img: '/static/balance.png', + icon: '/static/balance.png', }, }, // 腾讯im聊天 diff --git a/jiuyi2/common/js/util.js b/jiuyi2/common/js/util.js index 8b12b781..7b5a66a6 100644 --- a/jiuyi2/common/js/util.js +++ b/jiuyi2/common/js/util.js @@ -1477,9 +1477,7 @@ const util = { reslove(rs.data) const userinfo = rs.data // 如果开启了青少年模式 - if (userinfo.teenTime) { - // 青少年模式验证 如果到了限制去锁定页 - } + if (userinfo.teenTime) getTeenMode(userinfo.teenTime) // 提交 store.commit('setState', { key: 'userinfo', @@ -1496,6 +1494,31 @@ const util = { }) }, + // 青少年模式 + getTeenMode(teenTime) { + // 当前时间 + const currentDate = new Date() + // 当前小时 + const currentHour = currentDate.getHours() + // 大于八点 小于22点 当前时间小于设定时间 + const result = currentHour >= 8 && currentHour < 22 && currentDate.valueOf() < new Date(teenTime).valueOf() + + // 锁定 + function lock() { + uni.reLaunch({ + url: '/pages/login/lock' + }) + } + + // 结果 + if (result) { + // 设置定时器 + setTimeout(() => { + lock() + }, parseInt(new Date(teenTime).valueOf() - currentDate.valueOf())) + } else lock() + }, + /** * 验证登录 * @param {Object} cb 回调函数 @@ -1556,7 +1579,7 @@ const util = { // 验证登录 util.isLogin(() => { const userinfo = uni.$store.state.userinfo - if (userinfo.userIdCard) { + if (userinfo.isRealName) { param.success ? param.success(userinfo) : '' return } diff --git a/jiuyi2/components/index/collect.vue b/jiuyi2/components/index/collect.vue index a307e043..4b48f9a9 100644 --- a/jiuyi2/components/index/collect.vue +++ b/jiuyi2/components/index/collect.vue @@ -120,9 +120,10 @@ }, }).then(rs => { if (rs.code == 200) { - detail.value.isCollect = false - detail.value.collect-- - uni.$emit('updateVideo', detail.value) + uni.$emit('updateVideo', { + ...detail.value, + ...rs.data, + }) // 收藏了取消收藏 collectResult.value = false proxy.$refs.result.open() diff --git a/jiuyi2/components/index/fastCollect.vue b/jiuyi2/components/index/fastCollect.vue index 24ff4a19..5ca6ff7c 100644 --- a/jiuyi2/components/index/fastCollect.vue +++ b/jiuyi2/components/index/fastCollect.vue @@ -140,15 +140,16 @@ // 视频id videoId: detail.value.id, // 收藏夹id - collectId: item.id, + folderId: item.id, } }).then(rs => { if (rs.code == 200) { proxy.$refs.fastCollect.close() - detail.value.isCollect = true - detail.value.collect++ - uni.$emit('updateVideo', detail.value) + uni.$emit('updateVideo', { + ...detail.value, + ...rs.data, + }) return } // diff --git a/jiuyi2/components/index/indexVideo.vue b/jiuyi2/components/index/indexVideo.vue index 56ffcc09..d340b574 100644 --- a/jiuyi2/components/index/indexVideo.vue +++ b/jiuyi2/components/index/indexVideo.vue @@ -170,9 +170,6 @@ // tapTimer.value = setTimeout(() => { - // 是否点赞 - const isLike = props.item.isLike - let a = tapList.length tapList.length = 0 @@ -185,7 +182,7 @@ emit('like', { likeType: 0, index: props.index, - isLike: isLike == 0 ? 0 : 1 + isLike: props.item.isLike }) break; case 3: @@ -193,7 +190,7 @@ emit('like', { likeType: 1, index: props.index, - isLike: isLike == 0 ? 3 : 1 + isLike: props.item.isLike }) break; } @@ -558,9 +555,14 @@ @click="handleLike(index, 0, 0)" @longpress="handlePrivateLike(index)" /> - + + + {{ item.likeCount }} + + 点赞 + @@ -581,7 +583,8 @@ v-if="item.isCollect" /> - {{ item.collectCount }} + 收藏 + diff --git a/jiuyi2/components/mine/codeInput.vue b/jiuyi2/components/mine/codeInput.vue index 93006fc1..b1a3455e 100644 --- a/jiuyi2/components/mine/codeInput.vue +++ b/jiuyi2/components/mine/codeInput.vue @@ -24,7 +24,7 @@ diff --git a/jiuyi2/pages.json b/jiuyi2/pages.json index b57568de..05bb9d0a 100644 --- a/jiuyi2/pages.json +++ b/jiuyi2/pages.json @@ -689,33 +689,29 @@ } }, { - "path" : "pages/shop/commodity/history", - "style" : - { - "navigationBarTitleText" : "商品修改历史" + "path": "pages/shop/commodity/history", + "style": { + "navigationBarTitleText": "商品修改历史" } }, { - "path" : "pages/shop/store/order", - "style" : - { - "navigationBarTitleText" : "商家订单", + "path": "pages/shop/store/order", + "style": { + "navigationBarTitleText": "商家订单", "navigationStyle": "custom" } }, { - "path" : "pages/mine/setting/sequence", - "style" : - { - "navigationBarTitleText" : "支付顺序", + "path": "pages/mine/setting/sequence", + "style": { + "navigationBarTitleText": "支付顺序", "navigationBarBackgroundColor": "#fff" } }, { - "path" : "pages/shop/commodity/payment", - "style" : - { - "navigationBarTitleText" : "继续付款", + "path": "pages/shop/commodity/payment", + "style": { + "navigationBarTitleText": "继续付款", "navigationBarBackgroundColor": "#fff" } }, diff --git a/jiuyi2/pages/index/index.nvue b/jiuyi2/pages/index/index.nvue index d14f0498..cb7ed8e5 100644 --- a/jiuyi2/pages/index/index.nvue +++ b/jiuyi2/pages/index/index.nvue @@ -211,6 +211,7 @@ }) onHide(() => { + console.log('onHide', current[tabIndex.value], currentVideoRef) // 暂停视频 if (proxy.$refs[`videoRef${tabIndex.value}`]) { proxy.$refs[`videoRef${tabIndex.value}`][current[tabIndex.value]].pause() @@ -721,19 +722,20 @@ @touchend="onTouchend($event,index)" @loadmore="item.getMoreList"> - + + + {{current[tabIndex]}} + {{index}} + + + + + diff --git a/jiuyi2/pages/login/forget.vue b/jiuyi2/pages/login/forget.vue index 610d50e0..fe6afc17 100644 --- a/jiuyi2/pages/login/forget.vue +++ b/jiuyi2/pages/login/forget.vue @@ -14,54 +14,59 @@ import notice from '@/components/login/notice' // api import api from '@/api/index' + // 加密 + import CryptoJS from 'crypto-js'; // 表单 const form = reactive({ // 设备imei userImei: '', // 手机号 - userPhone: '', + phoneNumber: '', // 密码 - userPassword: '', + password: '', + // 验证码 + verifyCode: '', }) // 确认密码 const rePwd = ref('') - // 验证码 - const cache = ref('') // 阅读 const read = ref(false) // 登录 function handleLogin() { + const data = { + ...form + } // 校验 - if (!form.userPhone) { + if (!data.phoneNumber) { util.alert('请输入手机号') return } - if (!cache.value) { + if (!data.verifyCode) { util.alert('请输入验证码') return } - if (!form.userPassword) { + if (!data.password) { util.alert('请输入密码') return } - if (form.userPassword !== rePwd.value) { + if (data.password !== rePwd.value) { util.alert('两次输入密码不一致') return } + data.password = CryptoJS.MD5(data.password).toString() // 如果imei为空 - if (!form.userImei) { + if (!data.userImei) { const info = uni.getSystemInfoSync() // - form.userImei = info.deviceId + data.userImei = info.deviceId } // 忘记密码找回 api.login.resetPassword({ - data: form, - path: [cache.value], + data, }).then(rs => { if (rs.code == 200) { util.alert({ @@ -94,19 +99,19 @@ 忘记密码 - + - + - + - + diff --git a/jiuyi2/pages/mine/realname.vue b/jiuyi2/pages/mine/realname.vue index 0d4b246e..652b84ba 100644 --- a/jiuyi2/pages/mine/realname.vue +++ b/jiuyi2/pages/mine/realname.vue @@ -43,32 +43,51 @@ }) // 格式化 const format_idCard = computed(() => { - let result = userinfo.value.idCard || '' - if (result) result = result.slice(0, 1) + '*'.repeat(userinfo.value.idCard.length - 2) + result.slice(- + let result = userinfo.value.userIdCard || '' + if (result) result = result.slice(0, 1) + '*'.repeat(userinfo.value.userIdCard.length - 2) + result.slice(- 1) return result }) // 活体检测 function startLive() { - // 调用异步方法 - liveModule.startLive({ - openSound: true, - signKey: 'HISP1YFG44LQ29W0', - }, - result => { - console.log('startLive', result) - if (result.errorCode == 0) { - faceImage.value = result.liveImage - } else if (result.errorCode == 1 && result.errorMessage == '活体检测未通过') { - util.alert({ - title: '系统提示', - content: '检测失败请重试', - showCancel: false + // 验证必填项 + if (!form.idCard) { + util.alert('身份证号不能为空') + return + } + + api.mine.isCertification({ + query: { + userIdCard: form.idCard + } + }).then(rs => { + if (rs.code === 200) { + // 调用异步方法 + liveModule.startLive({ + openSound: true, + signKey: 'HISP1YFG44LQ29W0', + }, + result => { + console.log('startLive', result) + if (result.errorCode == 0) { + faceImage.value = result.liveImage + } else if (result.errorCode == 1 && result.errorMessage == '活体检测未通过') { + util.alert({ + title: '系统提示', + content: '检测失败请重试', + showCancel: false + }) + } + // this.resultText = result.errorMessage; }) - } - // this.resultText = result.errorMessage; + return + } + util.alert({ + content: rs.msg, + showCancel: false, }) + }) } // 实名认证 @@ -125,7 +144,7 @@ - {{userinfo.name}} + {{userinfo.userRealName}} {{format_idCard}} @@ -186,7 +205,7 @@ .key { width: 200rpx; } - + .value { flex: 1; font-size: 28rpx; diff --git a/jiuyi2/pages/mine/setting/secondPwd.vue b/jiuyi2/pages/mine/setting/secondPwd.vue index 3c03542e..35cdacff 100644 --- a/jiuyi2/pages/mine/setting/secondPwd.vue +++ b/jiuyi2/pages/mine/setting/secondPwd.vue @@ -33,7 +33,7 @@ rePwd: '', }) // 当前输入表单键 - const formKey = reactive('pwd') + const formKey = ref('pwd') // 用户信息 const userinfo = computed(() => { let result = store.state.userinfo @@ -56,6 +56,7 @@ util.alert('二级密码不能为空') } mode.value = 'rePwd' + formKey.value = 'rePwd' } // 确认输入密码 @@ -76,6 +77,10 @@ content: '两次输入密码不一致', showCancel: false }) + + // 密码 + form.pwd = '' + form.rePwd = '' mode.value = 'set' return } @@ -139,14 +144,14 @@ * @param {Object} val */ function KeyInfo(val) { - // 如果大于六位 - if (form[formKey.value].length >= 6) return // 判断是否输入的是删除键 if (val.keyCode === 8) { // 删除最后一位 form[formKey.value] = form[formKey.value].slice(0, -1) - // passwordArr.splice(val.index + 1, 1) + return } + // 如果大于六位 + if (form[formKey.value].length >= 6) return // 判断是否输入的是. else if (val.keyCode == 190) { // 输入.无效 @@ -167,7 +172,7 @@ - 下一步 + 下一步 @@ -175,7 +180,7 @@ 请再次输入刚才设置的二级密码 - + 确认 @@ -192,6 +197,7 @@ + diff --git a/jiuyi2/pages/mine/setting/sequence.vue b/jiuyi2/pages/mine/setting/sequence.vue index cb5f01c4..0233a5d0 100644 --- a/jiuyi2/pages/mine/setting/sequence.vue +++ b/jiuyi2/pages/mine/setting/sequence.vue @@ -1,17 +1,5 @@ - - + + \ No newline at end of file diff --git a/jiuyi2/pages/shop/settle.vue b/jiuyi2/pages/shop/settle.vue index 7da00928..ef5ca6b8 100644 --- a/jiuyi2/pages/shop/settle.vue +++ b/jiuyi2/pages/shop/settle.vue @@ -65,7 +65,7 @@ onReady(() => { // 测试缴纳接口 - callPwd('depositsPay') + // callPwd('depositsPay') }) // 获取表单信息 @@ -354,14 +354,19 @@ * @param {Object} key 后续方法key */ function callPwd(key) { - pwdCb.value = { - // 缴纳押金 - 'depositsPay': depositsPay, - // 取消押金并退出商家身份 - 'outDepositsPay': outDepositsPay, - } [key] - // 拉起弹窗 - proxy.$refs.payPwdRef.open() + util.isAuth({ + success: () => { + pwdCb.value = { + // 缴纳押金 + 'depositsPay': depositsPay, + // 取消押金并退出商家身份 + 'outDepositsPay': outDepositsPay, + } [key] + console.log('pwdCb', pwdCb.value) + // 拉起弹窗 + proxy.$refs.payPwdRef.open() + } + }) } // 二级密码验证 @@ -389,7 +394,7 @@