修改了已知问题

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

View File

@ -1,4 +1,5 @@
const { checkLogin } = require('../../utils/logcheck'); const { checkLogin } = require('../../utils/logcheck');
import {url} from '../../request'
Page({ Page({
@ -12,8 +13,9 @@ Page({
url: '/pages/wodetuandui/wodetuandui', url: '/pages/wodetuandui/wodetuandui',
}) })
}, },
onLoad(options) { onLoad(options) {
checkLogin();
}, },
onReady() { onReady() {
@ -25,7 +27,7 @@ Page({
const userInfo = wx.getStorageSync('usermessage'); const userInfo = wx.getStorageSync('usermessage');
console.log('用户信息:', userInfo); console.log('用户信息:', userInfo);
this.setData({ this.setData({
nickName: userInfo.nickName || '', nickName: userInfo.nickName || '请登录',
phoneNumber: userInfo.phoneNumber || '', phoneNumber: userInfo.phoneNumber || '',
invitationCode: userInfo.invitationCode || '', 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' 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({ wx.navigateTo({
url: '/pages/wodejiedan/wodejiedan', 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() { onHide() {

View File

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

View File

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

View File

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