Browse Source

Merge branch 'master' of http://82.156.35.112:3000/qiubinghui/zhywpt-sp

* 'master' of http://82.156.35.112:3000/qiubinghui/zhywpt-sp:
  修复基本信息认证&多次登录弹窗问题
master
bjfight 1 week ago
parent
commit
b9a18811d2
3 changed files with 573 additions and 539 deletions
  1. 20
    16
      pages/user/user.vue
  2. 37
    7
      subpackage/personal-center/real-name-authentication.vue
  3. 516
    516
      utils/network/request.js

+ 20
- 16
pages/user/user.vue View File

<view class="nickname">登录/注册</view> <view class="nickname">登录/注册</view>
</view> </view>
<view v-else class="name"> <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>
<view class="user-id"> <view class="user-id">
<view class="phone">{{state.accountInfoVo.mobile}}</view> <view class="phone">{{state.accountInfoVo.mobile}}</view>
state.data.opId = getItem(StorageKeys.OpenId); state.data.opId = getItem(StorageKeys.OpenId);
console.log("state.data.opId", state.data.opId) console.log("state.data.opId", state.data.opId)
mobile.value = getItem("mobile"); 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) => { const carDetails = (vehicleId) => {
uni.navigateTo({ uni.navigateTo({
console.log("state.data.opId", state.data.opId) console.log("state.data.opId", state.data.opId)
if (state.data.opId) { if (state.data.opId) {
getUserInfo(); getUserInfo();
getAuthInfo();
} }
state.customerObj = getItem('customerObj') 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 getUserInfo = () => {
const options = { const options = {
type: 2, type: 2,

+ 37
- 7
subpackage/personal-center/real-name-authentication.vue View File

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


onLoad((option : any) => { onLoad((option : any) => {

console.log("option", option) 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) => { onPageScroll((e) => {
console.log("event.replace(screeningStr, '')", event.replace(screeningStr, ''), event, state.form.userName) console.log("event.replace(screeningStr, '')", event.replace(screeningStr, ''), event, state.form.userName)
} }
const takePhotoMode = (index) => { const takePhotoMode = (index) => {
if (isSM.value) {
return;
}
console.log("index", index) console.log("index", index)
state.isTakePhotoModeShow = true state.isTakePhotoModeShow = true
state.choiceIndex = index state.choiceIndex = index

+ 516
- 516
utils/network/request.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save