浏览代码

修复基本信息认证&多次登录弹窗问题

master
zhangjunfeng 1周前
父节点
当前提交
e9703fe361
共有 3 个文件被更改,包括 61 次插入29 次删除
  1. 20
    16
      pages/user/user.vue
  2. 37
    7
      subpackage/personal-center/real-name-authentication.vue
  3. 4
    6
      utils/network/request.js

+ 20
- 16
pages/user/user.vue 查看文件

@@ -14,7 +14,7 @@
<view class="nickname">登录/注册</view>
</view>
<view v-else class="name">
<view class="nickname">{{state.accountInfoVo.nickName || state.accountInfoVo.userName}}
<view class="nickname">{{state.accountInfoVo.userName || state.accountInfoVo.nickName}}
</view>
<view class="user-id">
<view class="phone">{{state.accountInfoVo.mobile}}</view>
@@ -196,21 +196,7 @@
state.data.opId = getItem(StorageKeys.OpenId);
console.log("state.data.opId", state.data.opId)
mobile.value = getItem("mobile");
const options = {
type: 2,
data: { openId: getItem('openId') },
method: "POST",
showLoading: true,
};
requestNew(getUserMsg, options).then((res) => {
const data = res;
console.log(data, "用户信息"); //|| !data.userNegImgUrl || !data.userPosImgUrl
if (!data.userIdNum || !data.userNegImgUrl || !data.userPosImgUrl) {
isSm.value = true
} else {
isSm.value = false
}
});
getAuthInfo();
});
const carDetails = (vehicleId) => {
uni.navigateTo({
@@ -229,9 +215,27 @@
console.log("state.data.opId", state.data.opId)
if (state.data.opId) {
getUserInfo();
getAuthInfo();
}
state.customerObj = getItem('customerObj')
});
const getAuthInfo = () => {
const options = {
type: 2,
data: { openId: getItem('openId') },
method: "POST",
showLoading: true,
};
requestNew(getUserMsg, options).then((res) => {
const data = res;
console.log(data, "用户信息"); //|| !data.userNegImgUrl || !data.userPosImgUrl
if (!data.userIdNum || !data.userNegImgUrl || !data.userPosImgUrl) {
isSm.value = true
} else {
isSm.value = false
}
});
}
const getUserInfo = () => {
const options = {
type: 2,

+ 37
- 7
subpackage/personal-center/real-name-authentication.vue 查看文件

@@ -46,26 +46,26 @@
<u-form-item label="姓名" :left-icon='`${$imgUrl}issuance/point-form.png`'
:left-icon-style='leftIcon'>
<u-input v-model="state.form.userName" placeholder='请输入姓名' maxlength="20"
@input="replaceInput" inputAlign="right" />
@input="replaceInput" inputAlign="right" :disabled="isSM" />
</u-form-item>
<u-form-item label="身份证号" :left-icon='`${$imgUrl}issuance/point-form.png`'
:left-icon-style='leftIcon'>
<u-input placeholder='请输入身份证' type="idcard" v-model="state.form.idNum" maxlength="18"
inputAlign="right" />
inputAlign="right" :disabled="isSM" />
</u-form-item>
<u-form-item label="地址" :left-icon='`${$imgUrl}issuance/point-form.png`'
:left-icon-style='leftIcon'>
<u-input placeholder='请输入地址' :autoHeight='true' v-model="state.form.address" maxlength="50"
inputAlign="right" />
inputAlign="right" :disabled="isSM" />
</u-form-item>
<u-form-item label="证件类型" :left-icon='`${$imgUrl}issuance/point-form.png`'
:left-icon-style='leftIcon' borderBottom>
<u-input v-model="state.form.idTypeStr" type="select" @click="show1 = true"
input-align='right' />
<u-input v-model="state.form.idTypeStr" type="select" @click="show1 = isSM ? false : true"
input-align='right' :disabled="isSM" />
</u-form-item>
</u-form>
</view>
<view class="action">
<view v-if="!isSM" class="action">
<view class="btn-tip">
如识别信息有误,请手动修改,确认无误后,点击下一步!
</view>
@@ -129,6 +129,7 @@
}
const scrollTop = ref(0)
const show1 = ref(false)
const isSM = ref(true)
const state = reactive({
choiceIndex: 1, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
isTakePhotoModeShow: false, //选择拍照方式是否出来
@@ -197,9 +198,35 @@
};

onLoad((option : any) => {

console.log("option", option)
initInfo();
});
const initInfo = () => {
const options = {};
requestNew(getUserMsg, options).then((res) => {
const data = res;
console.log(data, "认证信息"); //|| !data.userNegImgUrl || !data.userPosImgUrl
if (data.userName && data.userIdNum) {
state.form.address = data.userAddress;
state.form.idNum = data.userIdNum;
state.form.idType = data.userIdType;
const idTypeStrItem = credentialTypeSelect.find(item => item.value === data.userIdType);
state.form.idTypeStr = idTypeStrItem.label;
state.form.userIdImgUrl = data.userPosImgUrl;
state.form.userIdImgUrlName = data.userPosImgUrl;
state.form.userIdBackImgUrl = data.userNegImgUrl;
state.form.userIdBackImgUrlName = data.userNegImgUrl;
state.form.userName = data.userName;
} else {
// 无用户信息则按未认证进行初始化
isSM.value = false
state.form.idType = credentialTypeSelect[0].value
state.form.idTypeStr = credentialTypeSelect[0].label
}
});
}

//监听页面滚动
onPageScroll((e) => {
@@ -220,6 +247,9 @@
console.log("event.replace(screeningStr, '')", event.replace(screeningStr, ''), event, state.form.userName)
}
const takePhotoMode = (index) => {
if (isSM.value) {
return;
}
console.log("index", index)
state.isTakePhotoModeShow = true
state.choiceIndex = index

+ 4
- 6
utils/network/request.js 查看文件

@@ -332,13 +332,8 @@ export function requestNew(code, options = {}, start = false, clie = () => {}) {
//公参
const Common = {
loginSource: getItem("loginSource"),
<<<<<<< HEAD
customerId: getItem("customerObj").customerId,
accessToken: getItem(StorageKeys.Token)
=======
accessToken: getItem(StorageKeys.Token),
customerId: getItem("customerObj").customerId,
>>>>>>> 2bd4fd2288160c9b41c882d376c6debd9051e296
}
console.log('Common',Common, getItem("customerObj"))
// options.url = envs[process.env.NODE_ENV].baseUrl+'/prod' + code
@@ -408,7 +403,10 @@ export function requestNew(code, options = {}, start = false, clie = () => {}) {
showCancel: false,
success: function(res) {
if (res.confirm) {
setItem('IsLogin', false);
setTimeout(() => {
setItem('IsLogin', false);
}, 3000)
uni.navigateTo({
url: `/login/login`,
})

正在加载...
取消
保存