需求变更进行调整

This commit is contained in:
2026-01-30 09:01:38 +08:00
parent 44a4b33502
commit 79a21ff0a5
30 changed files with 1482 additions and 1707 deletions

View File

@@ -1,8 +1,11 @@
<template>
<view class="login-container">
<!-- 顶部状态栏 -->
<view class="status-bar"> <u-icon :name="btn.icon" :color="btn.color || '#333'" :size="btn.size || 40"></u-icon>
</view>
<!-- <view class="status-bar">
<u-icon name="arrow-left" size="40" color="#333" @tap="goBack" class="nav-left"></u-icon>
<u-icon :name="btn.icon" :color="btn.color || '#333'" :size="btn.size || 40"></u-icon>
</view> -->
<customNavbar opacity="0" :show-home="true" :show-back="false" :is-transparent="true" />
<!-- 主体内容区 -->
<view class="content">
@@ -51,7 +54,8 @@
screenWidth: 0,
scale: 1,
loginType: "0",
agreeProtocol: false
agreeProtocol: false,
menuRect: {}
}
},
@@ -62,10 +66,12 @@
this.scale = this.screenWidth / this.designWidth
}
})
const menuRect = wx.getMenuButtonBoundingClientRect()
this.menuRect = menuRect
},
onUnload() {
},
computed: {
// title 样式
@@ -82,6 +88,15 @@
textAlign: 'center'
}
},
navStyle() {
const rect = this.menuRect
if (!rect.top) return {}
return {
paddingTop: rect.top + 'px',
height: rect.height + 'px',
lineHeight: rect.height + 'px'
}
},
staticHost() {
return this.$config.staticUrl
},
@@ -119,7 +134,13 @@
}
this.doLogin(code);
},
goBack() {
uni.switchTab({
url: '/pages/index/index'
})
},
/** 执行登录逻辑 */
async doLogin(phoneGetCode) {
if (!this.agreeProtocol) {
@@ -142,19 +163,17 @@
});
// 调用后端登录接口
const authRes = await this.$u.post(`/login/weChatLogin`, {
phoneGetCode: phoneGetCode,
loginCode: loginRes.code,
loginType: this.loginType
});
// let tempToken = 'asd5646'
const authRes = await this.$u.post(`/login/weChatLogin`, {
phoneGetCode: phoneGetCode,
loginCode: loginRes.code,
loginType: this.loginType
});
// 保存token
let token = authRes.data;
this.$u.vuex('vuex_token', token);
// this.$u.vuex('vuex_token', tempToken);
uni.hideLoading();
this.getUserOtherInfo(this.loginType,token)
this.getUserOtherInfo(this.loginType, token)
// 跳转首页
uni.switchTab({
url: '/pages/index/index'
@@ -172,24 +191,17 @@
'WT': token,
'USERTYPE': loginType
}).then(obj => {
if(obj.flag){
if (obj.flag) {
uni.setStorageSync('userInfo', {
userType: obj.data.userType,
oaAuth: obj.data.oaAuth,
cusNo: obj.data.cusNo,
userName: obj.data.userName,
openId: obj.data.openId
userType: obj.data.userType,
oaAuth: obj.data.oaAuth,
cusNo: obj.data.cusNo,
userName: obj.data.userName,
openId: obj.data.openId,
subscribe: obj.data.subscribeMsg
})
}
});
// let tempUser = {
// userType: '0',
// oaAuth: '1',
// cusNo: 'cus0001',
// openId: '65456asd'
// }
// uni.setStorageSync('userInfo', tempUser)
},
/** 触发手机号选择(子组件 → 父组件) */
showPhoneSelector(phoneList, openid) {
@@ -220,8 +232,18 @@
overflow: hidden;
.status-bar {
margin-top: 7.56%;
display: flex;
flex-direction: row;
margin-top: 11.56%;
height: var(--status-bar-height);
}
.nav-left {
width: 80rpx;
display: flex;
padding-left: 5%;
align-items: center;
}
.content {
@@ -267,8 +289,9 @@
}
.user-type {
display: flex; justify-content: center;
gap: 40rpx;
display: flex;
justify-content: center;
gap: 40rpx;
margin-bottom: 20rpx;
}