From 15f831700cc516b74a8b76e43a62d97d61ef3b20 Mon Sep 17 00:00:00 2001 From: "yang.huaxiang" Date: Fri, 13 Nov 2020 17:42:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E6=80=A7=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=9A=E6=B7=BB=E5=8A=A0=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=E6=A0=A1=E9=AA=8C=E5=88=9D=E7=89=88=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=20--=E6=8F=90=E4=BA=A4=E4=BA=BA=EF=BC=9A=E9=98=B3?= =?UTF-8?q?=E5=8D=8E=E7=A5=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ebiz/common/common.js | 18 +++++++ src/views/ebiz/sale/List.vue | 88 ++++++++++++++++++++++++++++++++++- 2 files changed, 105 insertions(+), 1 deletion(-) diff --git a/src/api/ebiz/common/common.js b/src/api/ebiz/common/common.js index 95c52828d..7a3037c9f 100644 --- a/src/api/ebiz/common/common.js +++ b/src/api/ebiz/common/common.js @@ -62,3 +62,21 @@ export function wxShare(data) { data }) } + +//验证代理人访问 +export function checkEnterPower(data) { + return request({ + url: getUrl('/customer/agent/checkEnterPower', 1), + method: 'post', + data + }) +} + +// 获取验证码 +export function getAuthCode(data) { + return request({ + url: getUrl('/customer/authcode/loginedSend', 1), + method: 'post', + data + }) +} diff --git a/src/views/ebiz/sale/List.vue b/src/views/ebiz/sale/List.vue index 00a52cf75..713493dd6 100644 --- a/src/views/ebiz/sale/List.vue +++ b/src/views/ebiz/sale/List.vue @@ -142,6 +142,17 @@ 点我新增 + + + +

为确保是您本人操作,短信验证码已发送至您手机号{{ checkModel.mobile }},请您输入验证码以完成后续操作。

+ + + {{ + checkModel.codeDisabled ? `${checkModel.countDown}s后重新获取` : '获取验证码' + }} + +
@@ -149,6 +160,7 @@ import { Search, Tabs, Tab, List, Tag, Sticky, Toast, Dialog } from 'vant' import { orderList, deleteOrderInfo, revokeOrder } from '@/api/ebiz/sale/sale' import { formatRiskList } from '@/assets/js/utils/formatRiskList.js' +import { getAuthCode, checkEnterPower } from '@/api/ebiz/common/common' import dataDictionary from '@/assets/js/utils/data-dictionary' //根据数据字典找到用户等级 export default { @@ -164,6 +176,15 @@ export default { }, data() { return { + checkModel: { + show: false, + authCode: '', + smsId: '', + mobile: localStorage.mobile, + timeId: null, // 计时器ID + countDown: 60, // 倒计时 + codeDisabled: true // 获取验证码按钮是否禁用 + }, searchName: '', active: 'uncommit', //uncommit 表示未提交 commit表示已提交 saleList: [], @@ -192,9 +213,74 @@ export default { }) }, 100) window.appCallBack = this.appCallBack - this.loadMore() }, methods: { + async checkModelEnterValidate() { + let checkModelResult = await checkEnterPower({ operateType: 'isEnter' }) + if (checkModelResult.result == 0) { + if (checkModelResult.enterFlag == '0') { + this.loadMore() + } else { + this.checkModel.show = true + } + } else { + this.$toast(checkModelResult.resultMessage) + } + }, + async checkModelConfirm() { + if (!this.checkModel.codeDisabled) { + return this.$toast('请先获取验证码') + } + if (!this.checkModel.authCode || this.logoutDTO.authCode == '') { + return this.$toast('请输入短信验证码') + } + if (this.checkModel.authCode.length !== 6) { + return this.$toast('验证码格式错误') + } + let that = this + let checkModelResult = await checkEnterPower({ operateType: 'validateSms', smsId: that.checkModel.smsId, code: that.checkModel.authCode }) + if (checkModelResult.result == 0) { + that.loadMore() + } else { + this.codeDisabled = false + window.clearInterval(this.timeId) + this.$toast(checkModelResult.resultMessage) + } + }, + checkModelCancel() { + // 跳转首页 + this.$jump({ + flag: 'home' + }) + }, + checkModelGetCode() { + let data = { + operateType: 'agentValidateEnter', + type: 'H5', + operateCode: this.checkModel.mobile, + system: 'agentApp', + operateCodeType: '0' + } + //获取验证码 + getAuthCode(data).then(res => { + this.codeDisabled = true + if (res.result == 0) { + this.checkModel.smsId = res.sessionId + this.checkModel.smsCode = null + //倒计时 + this.timeId = setInterval(() => { + this.countDown-- + if (this.countDown <= 0) { + window.clearInterval(this.timeId) + this.codeDisabled = false + this.countDown = 60 + } + }, 1000) + } else { + this.$toast(res.resultMessage) + } + }) + }, appCallBack(data) { if (data.trigger == 'left_button_click') { this.$jump({