修改了已知问题

This commit is contained in:
Ling53666 2025-05-16 09:58:51 +08:00
parent 7c371623eb
commit 74e97e9052
5 changed files with 116 additions and 32 deletions

View File

@ -155,12 +155,12 @@ submit(){
} catch (e) {
console.error("存储失败", e);
}
setTimeout(() => {
that.setmessage();
that.setmessage(() => {
wx.switchTab({
url: '/pages/jiedan/jiedan',
});
}, 2000);
});
}else{
wx.showToast({
title: res.data.message||res.data.error,
@ -224,7 +224,7 @@ getcode(){
},
// 验证码登录提交
submityanzhengma(){
const _this = this;
const that = this;
const code = this.data.yanzhengcode
if (!/^\d{6}$/.test(code)) {
wx.showToast({
@ -267,12 +267,12 @@ submityanzhengma(){
} catch (e) {
console.error("存储失败", e);
}
setTimeout(() => {
_this.setmessage();
that.setmessage(() => {
wx.switchTab({
url: '/pages/jiedan/jiedan',
});
}, 2000);
});
}else{
wx.showToast({
title: res.data.message||res.data.error,
@ -286,7 +286,7 @@ submityanzhengma(){
}
});
},
setmessage() {
setmessage(callback) {
console.log("diaoyongle ");
const that = this;
wx.getStorage({
@ -315,6 +315,7 @@ setmessage() {
userAvatar: res.data.data.userAvatar
});
console.log("信息存储成功");
if (callback) callback();
} catch (e) {
console.error("信息存储失败", e);
}

View File

@ -1,4 +1,5 @@
const { checkLogin } = require('../../utils/logcheck');
import {url} from '../../request'
Page({
@ -12,8 +13,9 @@ Page({
url: '/pages/wodetuandui/wodetuandui',
})
},
onLoad(options) {
checkLogin();
},
onReady() {
@ -25,7 +27,7 @@ Page({
const userInfo = wx.getStorageSync('usermessage');
console.log('用户信息:', userInfo);
this.setData({
nickName: userInfo.nickName || '',
nickName: userInfo.nickName || '请登录',
phoneNumber: userInfo.phoneNumber || '',
invitationCode: userInfo.invitationCode || '',
userAvatar: userInfo.userAvatar || 'https://tse2-mm.cn.bing.net/th/id/OIP-C.jHUH4s7TQ48X_B-1iozuJgHaHa?w=207&h=207&c=7&r=0&o=5&dpr=1.5&pid=1.7'
@ -38,6 +40,57 @@ Page({
wx.navigateTo({
url: '/pages/wodejiedan/wodejiedan',
})
},
out(){
wx.showModal({
title: '提示',
content: '确定退出登录吗?',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
wx.getStorage({
key: "logmessage",
success(res) {
const userinfo = res.data.Authorization
wx.request({
url: url + '/userInfo/mini/logout',
method: 'GET',
data: {
},
header: {
'content-type': 'application/json',
'Authorization': userinfo
},
success(res) {
console.log('查询成功', res);
if(res.data.code==1){
wx.showToast({
title: "退出成功",
icon:'sucess',
duration:2000
})
}
},
fail(err) {
console.error('请求失败', err);
}
});
}
})
try {
wx.clearStorageSync();
console.log("所有缓存清除成功");
} catch (e) {
console.error("清除缓存失败", e);
}
} else {
console.log('用户点击取消')
}
}
})
},
onHide() {

View File

@ -110,18 +110,17 @@
</view>
</view>
<view class="flex-col section_8">
<view class="flex-row justify-between group_9">
<view class="flex-row items-end self-center">
<view class="flex-row justify-between items-center group_10">
<view class="flex-row items-center">
<image
class="shrink-0 image_7"
src="/image/8d2a546eff17d0f8759f0f3ea91c47bf.png"
class="shrink-0 image_10"
src="/image/4875fbdc868788e873dd606d7418f411.png"
/>
<text class="ml-16 font_2 text_17">账号设置</text>
<text class="ml-4 font_2 text_18">账号设置</text>
</view>
<image
class="self-start image_8 image_9"
class="image_8 image_11"
src="/image/jiatou.png"
mode="aspectFill"
/>
</view>
<view class="flex-row justify-between items-center group_10">
@ -137,17 +136,42 @@
src="/image/jiatou.png"
/>
</view>
<view class="flex-row justify-between items-center group_11" bind:tap="myteam">
<text class="font_4">我的团队</text>
<view class="flex-row justify-between items-center group_10" bind:tap="myteam">
<view class="flex-row items-center">
<image
class="shrink-0 image_10"
src="/image/4875fbdc868788e873dd606d7418f411.png"
/>
<text class="ml-4 font_2 text_18">我的团队</text>
</view>
<image
class="image_8"
class="image_8 image_11"
src="/image/jiatou.png"
/>
</view>
<view class="flex-row justify-between items-center group_11">
<text class="font_2 text_19">项目</text>
<view class="flex-row justify-between items-center group_10">
<view class="flex-row items-center">
<image
class="shrink-0 image_10"
src="/image/4875fbdc868788e873dd606d7418f411.png"
/>
<text class="ml-4 font_2 text_18">项目</text>
</view>
<image
class="image_8"
class="image_8 image_11"
src="/image/jiatou.png"
/>
</view>
<view class="flex-row justify-between items-center group_10" bind:tap="out">
<view class="flex-row items-center">
<image
class="shrink-0 image_10"
src="/image/4875fbdc868788e873dd606d7418f411.png"
/>
<text class="ml-4 font_2 text_18">退出登录</text>
</view>
<image
class="image_8 image_11"
src="/image/jiatou.png"
/>
</view>

View File

@ -44,14 +44,20 @@ Page({
success(res) {
console.log('提交成功', res);
if(res.data.code==1){
wx.showToast({
title: res.data.message,
icon: 'sucess',
duration: 2000
})
wx.navigateBack({
delta: 1
})
wx.showModal({
title: '提示',
content: '成功推广,请在我的推广码中查看',
showCancel: false,
success(res) {
if (res.confirm) {
wx.navigateBack({
delta: 1
})
console.log('用户点击了确定');
}
}
});
}else{
wx.showToast({
title: res.data.message,

View File

@ -8,7 +8,7 @@
</view>
</view>
<view class="bottoma">
<view class="youbuttonm" bind:tap="jiedan">
<view class="youbuttonm" bind:tap="submit">
<text style="color: white;">申请资料报备</text>
</view>
</view>