修复bug以及优化
This commit is contained in:
@@ -100,6 +100,7 @@
|
||||
},
|
||||
onShow() {
|
||||
this.$checkToken(this.$getToken())
|
||||
this.checkOaAuth()
|
||||
},
|
||||
// ✅ 删除和 scroll-view 冲突的 onReachBottom
|
||||
watch: {
|
||||
@@ -110,6 +111,20 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
checkOaAuth() {
|
||||
const userInfo = uni.getStorageSync('userInfo')
|
||||
if (!userInfo || !userInfo.oaAuth) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未实名认证,请先完成实名认证',
|
||||
showCancel: false,
|
||||
confirmText: '去认证',
|
||||
success: () => {
|
||||
uni.redirectTo({ url: '/pages-biz/profile/profile' })
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onTabClick(val) {
|
||||
this.activeTab = val
|
||||
this.resetAndLoad()
|
||||
|
||||
@@ -74,6 +74,7 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
this.$checkToken(this.$getToken())
|
||||
this.checkOaAuth()
|
||||
},
|
||||
// ✅ 删除和 scroll-view 冲突的 onReachBottom
|
||||
computed: {
|
||||
@@ -82,6 +83,20 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
checkOaAuth() {
|
||||
const userInfo = uni.getStorageSync('userInfo')
|
||||
if (!userInfo || !userInfo.oaAuth) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未实名认证,请先完成实名认证',
|
||||
showCancel: false,
|
||||
confirmText: '去认证',
|
||||
success: () => {
|
||||
uni.redirectTo({ url: '/pages-biz/profile/profile' })
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onTabChange(index) {
|
||||
this.currentTab = index;
|
||||
this.statusFilter = this.tabList[index].value;
|
||||
|
||||
@@ -73,10 +73,9 @@
|
||||
const currentType = this.loginType;
|
||||
|
||||
await this.doLogin({
|
||||
loginCode: loginRes.code,
|
||||
encryptedData: e.detail.encryptedData,
|
||||
iv: e.detail.iv,
|
||||
loginType: currentType
|
||||
phoneGetCode: e.detail.code,
|
||||
loginCode: loginRes.code,
|
||||
loginType: this.loginType
|
||||
});
|
||||
|
||||
} catch (err) {
|
||||
@@ -85,7 +84,10 @@
|
||||
},
|
||||
|
||||
async doLogin(data) {
|
||||
uni.showLoading({ title: "登录中...", mask: true });
|
||||
uni.showLoading({
|
||||
title: "登录中...",
|
||||
mask: true
|
||||
});
|
||||
|
||||
try {
|
||||
const authRes = await this.$u.post("/login/weChatLogin", data);
|
||||
@@ -128,8 +130,16 @@
|
||||
"USERTYPE": loginType
|
||||
}).then(obj => {
|
||||
if (obj?.flag) {
|
||||
uni.setStorageSync('userInfo', obj.data);
|
||||
this.$u.vuex('vuex_userInfo', obj.data);
|
||||
console.log("获取用户信息")
|
||||
const userInfoData = {
|
||||
userType: this.loginType,
|
||||
oaAuth: obj.data.oaAuth,
|
||||
cusNo: obj.data.cusNo,
|
||||
userName: obj.data.userName,
|
||||
openId: obj.data.openId,
|
||||
subscribe: obj.data.subscribeMsg
|
||||
}
|
||||
uni.setStorageSync('userInfo',userInfoData )
|
||||
}
|
||||
resolve();
|
||||
}).catch(() => {
|
||||
@@ -139,14 +149,18 @@
|
||||
},
|
||||
|
||||
goBack() {
|
||||
uni.navigateBack({ delta: 1 });
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
},
|
||||
|
||||
goPrivacy(type) {
|
||||
const url = type === "user"
|
||||
? "/pages-biz/privacy/userAgreement"
|
||||
: "/pages-biz/privacy/privacyPolicy";
|
||||
uni.navigateTo({ url });
|
||||
const url = type === "user" ?
|
||||
"/pages-biz/privacy/userAgreement" :
|
||||
"/pages-biz/privacy/privacyPolicy";
|
||||
uni.navigateTo({
|
||||
url
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -47,6 +47,7 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
this.$checkToken(this.$getToken())
|
||||
this.checkOaAuth()
|
||||
},
|
||||
// ✅ 删除和 scroll-view 冲突的 onReachBottom
|
||||
computed: {
|
||||
@@ -55,6 +56,20 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
checkOaAuth() {
|
||||
const userInfo = uni.getStorageSync('userInfo')
|
||||
if (!userInfo || !userInfo.oaAuth) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未实名认证,请先完成实名认证',
|
||||
showCancel: false,
|
||||
confirmText: '去认证',
|
||||
success: () => {
|
||||
uni.redirectTo({ url: '/pages-biz/profile/profile' })
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
goBack() {
|
||||
const pages = getCurrentPages();
|
||||
if (pages.length > 1) {
|
||||
|
||||
@@ -40,6 +40,7 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
this.$checkToken(this.$getToken())
|
||||
this.checkOaAuth()
|
||||
},
|
||||
// ✅ 删除和 scroll-view 冲突的 onReachBottom
|
||||
computed: {
|
||||
@@ -48,6 +49,20 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
checkOaAuth() {
|
||||
const userInfo = uni.getStorageSync('userInfo')
|
||||
if (!userInfo || !userInfo.oaAuth) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未实名认证,请先完成实名认证',
|
||||
showCancel: false,
|
||||
confirmText: '去认证',
|
||||
success: () => {
|
||||
uni.redirectTo({ url: '/pages-biz/profile/profile' })
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
loadAssets() {
|
||||
// ✅ 正确判断加载状态
|
||||
if (this.loadStatus !== 'more') return;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<view class="u-m-20">
|
||||
<u-navbar :is-back="true" title="账号实名信息" :border-bottom="false"></u-navbar>
|
||||
|
||||
|
||||
<view class="mt-30">
|
||||
<u-cell-group>
|
||||
<u-cell-item :title="getTitle" :arrow="true" hover-class="none" @click="showModel = true">
|
||||
<text class="value-text">{{ showValue || '未设置' }}</text>
|
||||
<text class="value-text">{{ showValue || '设置' }}</text>
|
||||
</u-cell-item>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
@@ -19,15 +19,11 @@
|
||||
<view class="modal-header">
|
||||
<text class="title">设置{{ getTitle }}</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="modal-body">
|
||||
<input
|
||||
v-model="authCode"
|
||||
:placeholder="'请输入' + getTitle"
|
||||
class="modal-input"
|
||||
/>
|
||||
<input v-model="authCode" :placeholder="'请输入' + getTitle" class="modal-input" />
|
||||
</view>
|
||||
|
||||
|
||||
<view class="modal-footer">
|
||||
<view class="btn cancel" @click="closeModal">取消</view>
|
||||
<view class="btn confirm" :class="{loading: submitting}" @click="doSubmit">
|
||||
@@ -40,7 +36,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { rsaEncrypt } from "@/common/utils/ras.js"
|
||||
import {
|
||||
rsaEncrypt
|
||||
} from "@/common/utils/ras.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -58,7 +56,7 @@
|
||||
orgNo: null
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
onShow() {
|
||||
this.getUserProfile();
|
||||
},
|
||||
methods: {
|
||||
@@ -81,11 +79,17 @@
|
||||
return
|
||||
}
|
||||
if (userType === '0' && !this.checkIdCard(input)) {
|
||||
uni.showToast({ title: '身份证格式不正确', icon: 'none' })
|
||||
uni.showToast({
|
||||
title: '身份证格式不正确',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (userType === '1' && !this.checkCreditCode(input)) {
|
||||
uni.showToast({ title: '社会信用代码格式错误', icon: 'none' })
|
||||
uni.showToast({
|
||||
title: '社会信用代码格式错误',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -95,15 +99,18 @@
|
||||
const res = await this.$u.post('/login/updateVerifyCode', {
|
||||
userType,
|
||||
code: userType === '0' ? rsaEncrypt(input) : input
|
||||
}, { WT: token })
|
||||
}, {
|
||||
WT: token
|
||||
})
|
||||
|
||||
if (res.flag) {
|
||||
this.$mytip.toast('设置成功')
|
||||
if (res.flag && res.data) {
|
||||
this.$mytip.toast('实名成功')
|
||||
this.closeModal()
|
||||
await this.getUserProfile()
|
||||
setTimeout(() => uni.switchTab({ url: '/pages/center/center' }), 1500)
|
||||
setTimeout(() => uni.switchTab({
|
||||
url: '/pages/center/center'
|
||||
}), 1500)
|
||||
} else {
|
||||
this.$mytip.toast(res.msg || '设置失败')
|
||||
this.$mytip.toast(res.msg || '设置失败,请检查输入的数据或者联系我们的管理员(17371719170)咨询')
|
||||
}
|
||||
} catch (err) {
|
||||
this.$mytip.toast('提交失败')
|
||||
@@ -115,28 +122,37 @@
|
||||
if (!idCard || idCard.length !== 18) return idCard
|
||||
return idCard.replace(/^(\d{6})\d{8}(\d{4})$/, '$1********$2')
|
||||
},
|
||||
async getUserProfile() {
|
||||
try {
|
||||
const token = this.$getToken()
|
||||
const obj = await this.$u.get('/login/userInfo', {}, { WT: token })
|
||||
if (!obj.data) return
|
||||
getUserProfile() {
|
||||
const token = this.$getToken()
|
||||
let userInfo = uni.getStorageSync('userInfo');
|
||||
console.log("实名时查询用户信息")
|
||||
let url = `/login/userInfo`;
|
||||
this.$u.get(url, {}, {
|
||||
'WT': this.$getToken(),
|
||||
'USERTYPE': userInfo.userType
|
||||
}).then(obj => {
|
||||
if (!obj?.flag) {
|
||||
return
|
||||
}
|
||||
const user = obj.data
|
||||
this.user = {
|
||||
userType: String(user.userType),
|
||||
userType: user.userType,
|
||||
oaAuth: user.oaAuth,
|
||||
cusNo: user.cusNo,
|
||||
userName: user.userName,
|
||||
openId: user.openId
|
||||
}
|
||||
if (this.user.userType === '0') {
|
||||
if (user.userType === '0') {
|
||||
this.cardNo = user.cardNo ? this.applyMask(user.cardNo) : null
|
||||
this.orgNo = null
|
||||
} else {
|
||||
this.orgNo = user.orgNo || null
|
||||
this.cardNo = null
|
||||
}
|
||||
uni.setStorageSync('userInfo', this.user)
|
||||
} catch (e) {}
|
||||
uni.setStorageSync('userInfo', user)
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -151,42 +167,43 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/* 页面样式 */
|
||||
.mt-30 {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
.value-text {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
/* 页面样式 */
|
||||
.mt-30 {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
/* ======================
|
||||
.value-text {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* ======================
|
||||
自定义弹窗样式(超美观)
|
||||
========================= */
|
||||
.modal-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
z-index: 999;
|
||||
}
|
||||
.modal-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 82%;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
z-index: 1000;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.15);
|
||||
}
|
||||
.modal-content {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 82%;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
z-index: 1000;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.modal-input {
|
||||
.modal-input {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
font-size: 32rpx;
|
||||
@@ -194,42 +211,48 @@
|
||||
padding: 0 10rpx;
|
||||
box-sizing: border-box;
|
||||
color: #333;
|
||||
}
|
||||
.modal-header {
|
||||
padding: 40rpx 30rpx 20rpx;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
.title {
|
||||
font-size: 34rpx;
|
||||
color: #222;
|
||||
}
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
padding: 20rpx 40rpx 40rpx;
|
||||
}
|
||||
.modal-header {
|
||||
padding: 40rpx 30rpx 20rpx;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
|
||||
.modal-footer {
|
||||
display: flex;
|
||||
border-top: 1rpx solid #f0f0f0;
|
||||
height: 96rpx;
|
||||
.btn {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 30rpx;
|
||||
&.cancel {
|
||||
color: #666;
|
||||
background: #f8f8f8;
|
||||
.title {
|
||||
font-size: 34rpx;
|
||||
color: #222;
|
||||
}
|
||||
&.confirm {
|
||||
color: #fff;
|
||||
background: #EA414A;
|
||||
&.loading {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
padding: 20rpx 40rpx 40rpx;
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
display: flex;
|
||||
border-top: 1rpx solid #f0f0f0;
|
||||
height: 96rpx;
|
||||
|
||||
.btn {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 30rpx;
|
||||
|
||||
&.cancel {
|
||||
color: #666;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
&.confirm {
|
||||
color: #fff;
|
||||
background: #EA414A;
|
||||
|
||||
&.loading {
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -86,8 +86,23 @@
|
||||
},
|
||||
onShow() {
|
||||
this.$checkToken(this.$getToken())
|
||||
this.checkOaAuth()
|
||||
},
|
||||
methods: {
|
||||
checkOaAuth() {
|
||||
const userInfo = uni.getStorageSync('userInfo')
|
||||
if (!userInfo || !userInfo.oaAuth) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未实名认证,请先完成实名认证',
|
||||
showCancel: false,
|
||||
confirmText: '去认证',
|
||||
success: () => {
|
||||
uni.redirectTo({ url: '/pages-biz/profile/profile' })
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
loadBills() {
|
||||
if (this.loadStatus !== 'more') return;
|
||||
this.loadStatus = 'loading';
|
||||
|
||||
@@ -84,9 +84,24 @@
|
||||
},
|
||||
onShow() {
|
||||
this.$checkToken(this.$getToken())
|
||||
this.checkOaAuth()
|
||||
},
|
||||
// ❌ 已删除冲突的 onReachBottom
|
||||
methods: {
|
||||
checkOaAuth() {
|
||||
const userInfo = uni.getStorageSync('userInfo')
|
||||
if (!userInfo || !userInfo.oaAuth) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未实名认证,请先完成实名认证',
|
||||
showCancel: false,
|
||||
confirmText: '去认证',
|
||||
success: () => {
|
||||
uni.redirectTo({ url: '/pages-biz/profile/profile' })
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
loadBills() {
|
||||
// ✅ 正确判断状态
|
||||
if (this.loadStatus !== 'more') return;
|
||||
|
||||
@@ -81,9 +81,24 @@
|
||||
},
|
||||
onShow() {
|
||||
this.$checkToken(this.$getToken())
|
||||
this.checkOaAuth()
|
||||
},
|
||||
// ❌ 已删除冲突的 onReachBottom
|
||||
methods: {
|
||||
checkOaAuth() {
|
||||
const userInfo = uni.getStorageSync('userInfo')
|
||||
if (!userInfo || !userInfo.oaAuth) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未实名认证,请先完成实名认证',
|
||||
showCancel: false,
|
||||
confirmText: '去认证',
|
||||
success: () => {
|
||||
uni.redirectTo({ url: '/pages-biz/profile/profile' })
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
loadBills() {
|
||||
// ✅ 正确判断状态
|
||||
if (this.loadStatus !== 'more') return;
|
||||
|
||||
Reference in New Issue
Block a user