修复bug以及优化
This commit is contained in:
@@ -11,7 +11,6 @@ export function checkToken(token) {
|
|||||||
})
|
})
|
||||||
return Promise.reject('no token')
|
return Promise.reject('no token')
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
uni.$u.get('/login/checkExpiration', {}, {
|
uni.$u.get('/login/checkExpiration', {}, {
|
||||||
WT: token
|
WT: token
|
||||||
|
|||||||
236
components/floatGuide/floatGuide.vue
Normal file
236
components/floatGuide/floatGuide.vue
Normal file
@@ -0,0 +1,236 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 唯一根节点 → 修复报错 -->
|
||||||
|
<view class="float-guide-wrapper">
|
||||||
|
<!-- 纯JS丝滑悬浮球 -->
|
||||||
|
<view
|
||||||
|
class="float-ball"
|
||||||
|
:style="{
|
||||||
|
left: x + 'px',
|
||||||
|
top: y + 'px',
|
||||||
|
transition: isAnimating ? 'all 0.2s ease-out' : 'none'
|
||||||
|
}"
|
||||||
|
@touchstart="onStart"
|
||||||
|
@touchmove.stop.prevent="onMove"
|
||||||
|
@touchend="onEnd"
|
||||||
|
@click="handleBallClick"
|
||||||
|
>
|
||||||
|
<!-- 展开状态:箭头在左,文字在右 -->
|
||||||
|
<view class="ball-content" v-if="!isFolded">
|
||||||
|
<view class="fold-btn" @click.stop="fold">
|
||||||
|
<text class="fold-icon">›</text>
|
||||||
|
</view>
|
||||||
|
<view class="ball-main">
|
||||||
|
<text class="text">使用教程</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 收起状态 -->
|
||||||
|
<view class="ball-folded" v-else>
|
||||||
|
<text class="text">展开</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 视频弹窗 -->
|
||||||
|
<view class="video-mask" v-if="showVideoPlayer" @click="closeVideo">
|
||||||
|
<view class="video-wrapper" @click.stop>
|
||||||
|
<view class="close-btn" @click="closeVideo">×</view>
|
||||||
|
<video :src="videoSrc" class="guide-video" controls loop show-progress="false"
|
||||||
|
object-fit="contain"></video>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "floatGuide",
|
||||||
|
props: {
|
||||||
|
videoSrc: {
|
||||||
|
type: String,
|
||||||
|
default: "/static/guide.mp4"
|
||||||
|
},
|
||||||
|
initX: {
|
||||||
|
type: Number,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
initY: {
|
||||||
|
type: Number,
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
isFolded: false,
|
||||||
|
showVideoPlayer: false,
|
||||||
|
isAnimating: false,
|
||||||
|
startX: 0,
|
||||||
|
startY: 0,
|
||||||
|
pageWidth: 0,
|
||||||
|
pageHeight: 0
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.initPosition();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initPosition() {
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
this.pageWidth = res.windowWidth;
|
||||||
|
this.pageHeight = res.windowHeight;
|
||||||
|
if (this.initX !== null && this.initY !== null) {
|
||||||
|
this.x = this.initX;
|
||||||
|
this.y = this.initY;
|
||||||
|
} else {
|
||||||
|
this.x = this.pageWidth - 160;
|
||||||
|
this.y = this.pageHeight - 260;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onStart(e) {
|
||||||
|
const tx = e.touches[0].clientX;
|
||||||
|
const ty = e.touches[0].clientY;
|
||||||
|
this.startX = tx - this.x;
|
||||||
|
this.startY = ty - this.y;
|
||||||
|
this.isAnimating = false;
|
||||||
|
},
|
||||||
|
onMove(e) {
|
||||||
|
const tx = e.touches[0].clientX;
|
||||||
|
const ty = e.touches[0].clientY;
|
||||||
|
let newX = tx - this.startX;
|
||||||
|
let newY = ty - this.startY;
|
||||||
|
|
||||||
|
newX = Math.max(10, Math.min(newX, this.pageWidth - 80));
|
||||||
|
newY = Math.max(40, Math.min(newY, this.pageHeight - 100));
|
||||||
|
|
||||||
|
this.x = newX;
|
||||||
|
this.y = newY;
|
||||||
|
},
|
||||||
|
onEnd() {
|
||||||
|
this.isAnimating = true;
|
||||||
|
},
|
||||||
|
handleBallClick() {
|
||||||
|
if (this.isFolded) {
|
||||||
|
this.isFolded = false;
|
||||||
|
} else {
|
||||||
|
this.showVideoPlayer = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fold() {
|
||||||
|
this.isFolded = true;
|
||||||
|
},
|
||||||
|
closeVideo() {
|
||||||
|
this.showVideoPlayer = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.float-guide-wrapper {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.float-ball {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 99999;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 展开样式:箭头左,文字右,正常顺序 */
|
||||||
|
.ball-content {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
background: linear-gradient(90deg, #ff2f31 0%, #ff9379 100%);
|
||||||
|
border-radius: 40rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
box-shadow: 0 6rpx 20rpx rgba(255, 60, 60, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ball-main {
|
||||||
|
padding: 0 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ball-content .text {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-btn {
|
||||||
|
width: 44rpx;
|
||||||
|
height: 44rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: rgba(255, 255, 255, 0.2);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-icon {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ball-folded {
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: linear-gradient(90deg, #ff2f31 0%, #ff9379 100%);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-shadow: 0 6rpx 20rpx rgba(255, 60, 60, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ball-folded .text {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-mask {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.7);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: 999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-wrapper {
|
||||||
|
position: relative;
|
||||||
|
width: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.guide-video {
|
||||||
|
width: 100%;
|
||||||
|
height: 420rpx; /* 必须加高度! */
|
||||||
|
border-radius: 20rpx;
|
||||||
|
background-color: #000; /* 防止加载瞬间闪白 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-btn {
|
||||||
|
position: absolute;
|
||||||
|
top: -88rpx;
|
||||||
|
right: 0;
|
||||||
|
width: 64rpx;
|
||||||
|
height: 64rpx;
|
||||||
|
background: rgba(255, 255, 255, 0.2);
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
|
|
||||||
<!-- 底部导航栏 -->
|
<!-- 底部导航栏 -->
|
||||||
<assetBottomBar v-if="asset.status === '闲置中'" :assetId="assetId" :phone="managerPhone"
|
<assetBottomBar v-if="asset.status === '闲置中'" :assetId="assetId" :phone="managerPhone"
|
||||||
@reserve="showReserve = true" btn-title="预约看资产" shareBtnTitle="分享资产"
|
@reserve="showReservePopup()" btn-title="预约看资产" shareBtnTitle="分享资产"
|
||||||
page-path="/pages-assets/assets/detail/assetsDetail" minicode-api="/pages-assets/assets/detail/assetsDetail"
|
page-path="/pages-assets/assets/detail/assetsDetail" minicode-api="/pages-assets/assets/detail/assetsDetail"
|
||||||
btnColor="#FF2F31" :query="assetId" />
|
btnColor="#FF2F31" :query="assetId" />
|
||||||
</view>
|
</view>
|
||||||
@@ -224,6 +224,10 @@
|
|||||||
// this.navbarStyle.isTransparent = true;
|
// this.navbarStyle.isTransparent = true;
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
|
showReservePopup(){
|
||||||
|
this.$checkToken(this.$getToken());
|
||||||
|
this.showReserve = true
|
||||||
|
},
|
||||||
getRandomColor() {
|
getRandomColor() {
|
||||||
const index = Math.floor(Math.random() * this.tagColors.length)
|
const index = Math.floor(Math.random() * this.tagColors.length)
|
||||||
return this.tagColors[index]
|
return this.tagColors[index]
|
||||||
|
|||||||
@@ -67,6 +67,20 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
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' })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
// 👇 你的方法 1 行没改
|
// 👇 你的方法 1 行没改
|
||||||
statusText(status) {
|
statusText(status) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
@@ -161,6 +175,7 @@
|
|||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$checkToken(this.$getToken())
|
this.$checkToken(this.$getToken())
|
||||||
|
this.checkOaAuth()
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.fetchApplys()
|
this.fetchApplys()
|
||||||
|
|||||||
@@ -80,11 +80,26 @@
|
|||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$checkToken(this.$getToken())
|
this.$checkToken(this.$getToken())
|
||||||
|
this.checkOaAuth()
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.fetchFallback();
|
this.fetchFallback();
|
||||||
},
|
},
|
||||||
methods: {
|
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' })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
navigateToDetail(item) {
|
navigateToDetail(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages-assets/fallback/fallbackDetail?id=" + item.id
|
url: "/pages-assets/fallback/fallbackDetail?id=" + item.id
|
||||||
|
|||||||
@@ -100,6 +100,7 @@
|
|||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$checkToken(this.$getToken())
|
this.$checkToken(this.$getToken())
|
||||||
|
this.checkOaAuth()
|
||||||
},
|
},
|
||||||
// ✅ 删除和 scroll-view 冲突的 onReachBottom
|
// ✅ 删除和 scroll-view 冲突的 onReachBottom
|
||||||
watch: {
|
watch: {
|
||||||
@@ -110,6 +111,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
onTabClick(val) {
|
||||||
this.activeTab = val
|
this.activeTab = val
|
||||||
this.resetAndLoad()
|
this.resetAndLoad()
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$checkToken(this.$getToken())
|
this.$checkToken(this.$getToken())
|
||||||
|
this.checkOaAuth()
|
||||||
},
|
},
|
||||||
// ✅ 删除和 scroll-view 冲突的 onReachBottom
|
// ✅ 删除和 scroll-view 冲突的 onReachBottom
|
||||||
computed: {
|
computed: {
|
||||||
@@ -82,6 +83,20 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
onTabChange(index) {
|
||||||
this.currentTab = index;
|
this.currentTab = index;
|
||||||
this.statusFilter = this.tabList[index].value;
|
this.statusFilter = this.tabList[index].value;
|
||||||
|
|||||||
@@ -73,10 +73,9 @@
|
|||||||
const currentType = this.loginType;
|
const currentType = this.loginType;
|
||||||
|
|
||||||
await this.doLogin({
|
await this.doLogin({
|
||||||
loginCode: loginRes.code,
|
phoneGetCode: e.detail.code,
|
||||||
encryptedData: e.detail.encryptedData,
|
loginCode: loginRes.code,
|
||||||
iv: e.detail.iv,
|
loginType: this.loginType
|
||||||
loginType: currentType
|
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -85,7 +84,10 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
async doLogin(data) {
|
async doLogin(data) {
|
||||||
uni.showLoading({ title: "登录中...", mask: true });
|
uni.showLoading({
|
||||||
|
title: "登录中...",
|
||||||
|
mask: true
|
||||||
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const authRes = await this.$u.post("/login/weChatLogin", data);
|
const authRes = await this.$u.post("/login/weChatLogin", data);
|
||||||
@@ -128,8 +130,16 @@
|
|||||||
"USERTYPE": loginType
|
"USERTYPE": loginType
|
||||||
}).then(obj => {
|
}).then(obj => {
|
||||||
if (obj?.flag) {
|
if (obj?.flag) {
|
||||||
uni.setStorageSync('userInfo', obj.data);
|
console.log("获取用户信息")
|
||||||
this.$u.vuex('vuex_userInfo', obj.data);
|
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();
|
resolve();
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@@ -139,14 +149,18 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
goBack() {
|
goBack() {
|
||||||
uni.navigateBack({ delta: 1 });
|
uni.navigateBack({
|
||||||
|
delta: 1
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
goPrivacy(type) {
|
goPrivacy(type) {
|
||||||
const url = type === "user"
|
const url = type === "user" ?
|
||||||
? "/pages-biz/privacy/userAgreement"
|
"/pages-biz/privacy/userAgreement" :
|
||||||
: "/pages-biz/privacy/privacyPolicy";
|
"/pages-biz/privacy/privacyPolicy";
|
||||||
uni.navigateTo({ url });
|
uni.navigateTo({
|
||||||
|
url
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$checkToken(this.$getToken())
|
this.$checkToken(this.$getToken())
|
||||||
|
this.checkOaAuth()
|
||||||
},
|
},
|
||||||
// ✅ 删除和 scroll-view 冲突的 onReachBottom
|
// ✅ 删除和 scroll-view 冲突的 onReachBottom
|
||||||
computed: {
|
computed: {
|
||||||
@@ -55,6 +56,20 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
goBack() {
|
||||||
const pages = getCurrentPages();
|
const pages = getCurrentPages();
|
||||||
if (pages.length > 1) {
|
if (pages.length > 1) {
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$checkToken(this.$getToken())
|
this.$checkToken(this.$getToken())
|
||||||
|
this.checkOaAuth()
|
||||||
},
|
},
|
||||||
// ✅ 删除和 scroll-view 冲突的 onReachBottom
|
// ✅ 删除和 scroll-view 冲突的 onReachBottom
|
||||||
computed: {
|
computed: {
|
||||||
@@ -48,6 +49,20 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
loadAssets() {
|
||||||
// ✅ 正确判断加载状态
|
// ✅ 正确判断加载状态
|
||||||
if (this.loadStatus !== 'more') return;
|
if (this.loadStatus !== 'more') return;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<view class="mt-30">
|
<view class="mt-30">
|
||||||
<u-cell-group>
|
<u-cell-group>
|
||||||
<u-cell-item :title="getTitle" :arrow="true" hover-class="none" @click="showModel = true">
|
<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-item>
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
</view>
|
</view>
|
||||||
@@ -21,11 +21,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="modal-body">
|
<view class="modal-body">
|
||||||
<input
|
<input v-model="authCode" :placeholder="'请输入' + getTitle" class="modal-input" />
|
||||||
v-model="authCode"
|
|
||||||
:placeholder="'请输入' + getTitle"
|
|
||||||
class="modal-input"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="modal-footer">
|
<view class="modal-footer">
|
||||||
@@ -40,7 +36,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { rsaEncrypt } from "@/common/utils/ras.js"
|
import {
|
||||||
|
rsaEncrypt
|
||||||
|
} from "@/common/utils/ras.js"
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -58,7 +56,7 @@
|
|||||||
orgNo: null
|
orgNo: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onShow() {
|
||||||
this.getUserProfile();
|
this.getUserProfile();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -81,11 +79,17 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (userType === '0' && !this.checkIdCard(input)) {
|
if (userType === '0' && !this.checkIdCard(input)) {
|
||||||
uni.showToast({ title: '身份证格式不正确', icon: 'none' })
|
uni.showToast({
|
||||||
|
title: '身份证格式不正确',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (userType === '1' && !this.checkCreditCode(input)) {
|
if (userType === '1' && !this.checkCreditCode(input)) {
|
||||||
uni.showToast({ title: '社会信用代码格式错误', icon: 'none' })
|
uni.showToast({
|
||||||
|
title: '社会信用代码格式错误',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,15 +99,18 @@
|
|||||||
const res = await this.$u.post('/login/updateVerifyCode', {
|
const res = await this.$u.post('/login/updateVerifyCode', {
|
||||||
userType,
|
userType,
|
||||||
code: userType === '0' ? rsaEncrypt(input) : input
|
code: userType === '0' ? rsaEncrypt(input) : input
|
||||||
}, { WT: token })
|
}, {
|
||||||
|
WT: token
|
||||||
|
})
|
||||||
|
|
||||||
if (res.flag) {
|
if (res.flag && res.data) {
|
||||||
this.$mytip.toast('设置成功')
|
this.$mytip.toast('实名成功')
|
||||||
this.closeModal()
|
this.closeModal()
|
||||||
await this.getUserProfile()
|
setTimeout(() => uni.switchTab({
|
||||||
setTimeout(() => uni.switchTab({ url: '/pages/center/center' }), 1500)
|
url: '/pages/center/center'
|
||||||
|
}), 1500)
|
||||||
} else {
|
} else {
|
||||||
this.$mytip.toast(res.msg || '设置失败')
|
this.$mytip.toast(res.msg || '设置失败,请检查输入的数据或者联系我们的管理员(17371719170)咨询')
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.$mytip.toast('提交失败')
|
this.$mytip.toast('提交失败')
|
||||||
@@ -115,28 +122,37 @@
|
|||||||
if (!idCard || idCard.length !== 18) return idCard
|
if (!idCard || idCard.length !== 18) return idCard
|
||||||
return idCard.replace(/^(\d{6})\d{8}(\d{4})$/, '$1********$2')
|
return idCard.replace(/^(\d{6})\d{8}(\d{4})$/, '$1********$2')
|
||||||
},
|
},
|
||||||
async getUserProfile() {
|
getUserProfile() {
|
||||||
try {
|
const token = this.$getToken()
|
||||||
const token = this.$getToken()
|
let userInfo = uni.getStorageSync('userInfo');
|
||||||
const obj = await this.$u.get('/login/userInfo', {}, { WT: token })
|
console.log("实名时查询用户信息")
|
||||||
if (!obj.data) return
|
let url = `/login/userInfo`;
|
||||||
|
this.$u.get(url, {}, {
|
||||||
|
'WT': this.$getToken(),
|
||||||
|
'USERTYPE': userInfo.userType
|
||||||
|
}).then(obj => {
|
||||||
|
if (!obj?.flag) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const user = obj.data
|
const user = obj.data
|
||||||
this.user = {
|
this.user = {
|
||||||
userType: String(user.userType),
|
userType: user.userType,
|
||||||
oaAuth: user.oaAuth,
|
oaAuth: user.oaAuth,
|
||||||
cusNo: user.cusNo,
|
cusNo: user.cusNo,
|
||||||
userName: user.userName,
|
userName: user.userName,
|
||||||
openId: user.openId
|
openId: user.openId
|
||||||
}
|
}
|
||||||
if (this.user.userType === '0') {
|
if (user.userType === '0') {
|
||||||
this.cardNo = user.cardNo ? this.applyMask(user.cardNo) : null
|
this.cardNo = user.cardNo ? this.applyMask(user.cardNo) : null
|
||||||
this.orgNo = null
|
this.orgNo = null
|
||||||
} else {
|
} else {
|
||||||
this.orgNo = user.orgNo || null
|
this.orgNo = user.orgNo || null
|
||||||
this.cardNo = null
|
this.cardNo = null
|
||||||
}
|
}
|
||||||
uni.setStorageSync('userInfo', this.user)
|
uni.setStorageSync('userInfo', user)
|
||||||
} catch (e) {}
|
})
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -151,42 +167,43 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
/* 页面样式 */
|
/* 页面样式 */
|
||||||
.mt-30 {
|
.mt-30 {
|
||||||
margin-top: 30rpx;
|
margin-top: 30rpx;
|
||||||
}
|
}
|
||||||
.value-text {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ======================
|
.value-text {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ======================
|
||||||
自定义弹窗样式(超美观)
|
自定义弹窗样式(超美观)
|
||||||
========================= */
|
========================= */
|
||||||
.modal-mask {
|
.modal-mask {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background: rgba(0, 0, 0, 0.5);
|
background: rgba(0, 0, 0, 0.5);
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-content {
|
.modal-content {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
width: 82%;
|
width: 82%;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.15);
|
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.15);
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-input {
|
.modal-input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
@@ -194,42 +211,48 @@
|
|||||||
padding: 0 10rpx;
|
padding: 0 10rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
|
||||||
.modal-header {
|
|
||||||
padding: 40rpx 30rpx 20rpx;
|
|
||||||
text-align: center;
|
|
||||||
font-weight: bold;
|
|
||||||
.title {
|
|
||||||
font-size: 34rpx;
|
|
||||||
color: #222;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.modal-body {
|
.modal-header {
|
||||||
padding: 20rpx 40rpx 40rpx;
|
padding: 40rpx 30rpx 20rpx;
|
||||||
}
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
.modal-footer {
|
.title {
|
||||||
display: flex;
|
font-size: 34rpx;
|
||||||
border-top: 1rpx solid #f0f0f0;
|
color: #222;
|
||||||
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;
|
.modal-body {
|
||||||
&.loading {
|
padding: 20rpx 40rpx 40rpx;
|
||||||
opacity: 0.8;
|
}
|
||||||
|
|
||||||
|
.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>
|
</style>
|
||||||
@@ -86,8 +86,23 @@
|
|||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$checkToken(this.$getToken())
|
this.$checkToken(this.$getToken())
|
||||||
|
this.checkOaAuth()
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
loadBills() {
|
||||||
if (this.loadStatus !== 'more') return;
|
if (this.loadStatus !== 'more') return;
|
||||||
this.loadStatus = 'loading';
|
this.loadStatus = 'loading';
|
||||||
|
|||||||
@@ -84,9 +84,24 @@
|
|||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$checkToken(this.$getToken())
|
this.$checkToken(this.$getToken())
|
||||||
|
this.checkOaAuth()
|
||||||
},
|
},
|
||||||
// ❌ 已删除冲突的 onReachBottom
|
// ❌ 已删除冲突的 onReachBottom
|
||||||
methods: {
|
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() {
|
loadBills() {
|
||||||
// ✅ 正确判断状态
|
// ✅ 正确判断状态
|
||||||
if (this.loadStatus !== 'more') return;
|
if (this.loadStatus !== 'more') return;
|
||||||
|
|||||||
@@ -81,9 +81,24 @@
|
|||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$checkToken(this.$getToken())
|
this.$checkToken(this.$getToken())
|
||||||
|
this.checkOaAuth()
|
||||||
},
|
},
|
||||||
// ❌ 已删除冲突的 onReachBottom
|
// ❌ 已删除冲突的 onReachBottom
|
||||||
methods: {
|
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() {
|
loadBills() {
|
||||||
// ✅ 正确判断状态
|
// ✅ 正确判断状态
|
||||||
if (this.loadStatus !== 'more') return;
|
if (this.loadStatus !== 'more') return;
|
||||||
|
|||||||
@@ -129,7 +129,6 @@
|
|||||||
data() {
|
data() {
|
||||||
const life = uni.getStorageSync('lifeData') || {}
|
const life = uni.getStorageSync('lifeData') || {}
|
||||||
return {
|
return {
|
||||||
user:{},
|
|
||||||
bgPath1: '/public/static/center/my-bg.png',
|
bgPath1: '/public/static/center/my-bg.png',
|
||||||
bgPath2: '/public/static/center/my-bg2.png',
|
bgPath2: '/public/static/center/my-bg2.png',
|
||||||
unsignContractNum:0,
|
unsignContractNum:0,
|
||||||
@@ -163,7 +162,10 @@
|
|||||||
},
|
},
|
||||||
staticHost() {
|
staticHost() {
|
||||||
return this.$config.staticUrl
|
return this.$config.staticUrl
|
||||||
}
|
},
|
||||||
|
user() {
|
||||||
|
return uni.getStorageSync('userInfo') || {}
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -177,7 +179,6 @@
|
|||||||
onUnload() {
|
onUnload() {
|
||||||
uni.$off('updateAvatar')
|
uni.$off('updateAvatar')
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$checkToken(this.$getToken())
|
this.$checkToken(this.$getToken())
|
||||||
this.loadUserInfo()
|
this.loadUserInfo()
|
||||||
@@ -193,14 +194,18 @@
|
|||||||
loadUserInfo(){
|
loadUserInfo(){
|
||||||
let userInfo = uni.getStorageSync('userInfo');
|
let userInfo = uni.getStorageSync('userInfo');
|
||||||
if(!userInfo) {
|
if(!userInfo) {
|
||||||
|
console.log("缓存中用户信息为空")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
console.log(userInfo)
|
||||||
|
console.log("查询用户信息")
|
||||||
let url = `/login/userInfo`;
|
let url = `/login/userInfo`;
|
||||||
this.$u.get(url, {}, {
|
this.$u.get(url, {}, {
|
||||||
'WT': this.$getToken(),
|
'WT': this.$getToken(),
|
||||||
'USERTYPE': userInfo.userType
|
'USERTYPE': userInfo.userType
|
||||||
}).then(obj => {
|
}).then(obj => {
|
||||||
if(obj.flag){
|
if(obj.flag){
|
||||||
|
console.log("更新缓存中用户信息")
|
||||||
uni.setStorageSync('userInfo', {
|
uni.setStorageSync('userInfo', {
|
||||||
userType: obj.data.userType,
|
userType: obj.data.userType,
|
||||||
oaAuth: obj.data.oaAuth,
|
oaAuth: obj.data.oaAuth,
|
||||||
@@ -211,7 +216,7 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.user = uni.getStorageSync('userInfo');
|
|
||||||
},
|
},
|
||||||
logout() {
|
logout() {
|
||||||
this.$u.vuex('vuex_token', '');
|
this.$u.vuex('vuex_token', '');
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="index">
|
<view class="index">
|
||||||
<image :src="staticHost + '/public/static/index/index_bg.png'" mode="aspectFill" class="bg"></image>
|
<image :src="staticHost + '/public/static/index/index_bg.png'" mode="aspectFill" class="bg"></image>
|
||||||
|
<float-guide :initX="280" :initY="400" :videoSrc="staticHost + '/public/static/index/guide.mp4'" />
|
||||||
<!-- 搜索栏 -->
|
<!-- 搜索栏 -->
|
||||||
<view class="index-title">
|
<view class="index-title">
|
||||||
伍家国投
|
伍家国投
|
||||||
@@ -106,9 +107,11 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import SearchBar from '../../components/searchBar/SearchBar.vue';
|
import SearchBar from '../../components/searchBar/SearchBar.vue';
|
||||||
|
import floatGuide from '../../components/floatGuide/floatGuide.vue';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
SearchBar
|
SearchBar,
|
||||||
|
floatGuide
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
BIN
static/indexbg2.png
Normal file
BIN
static/indexbg2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Reference in New Issue
Block a user