Compare commits

...

2 Commits

Author SHA1 Message Date
9cd484242c Merge remote-tracking branch 'origin/master'
# Conflicts:
#	app.json
#	pages/personCenter/accountSetting/accountSetting.js
#	pages/personCenter/mine/mine.wxml
2025-05-29 09:02:42 +08:00
fcc9e21a7b 我的页面 2025-05-29 09:02:02 +08:00
7 changed files with 128 additions and 15 deletions

View File

@ -1,12 +1,8 @@
{ {
"pages": [ "pages": [
"pages/personCenter/mine/mine",
"pages/projectModule/subSettlement/subSettlement",
"pages/projectModule/settlement/settlement",
"pages/personCenter/resetPwd/resetPwd",
"pages/personCenter/subCommissionSetting/subCommissionSetting",
"pages/personCenter/commissionSetting/commissionSetting",
"pages/loginModule/pwdLogin/pwdLogin", "pages/loginModule/pwdLogin/pwdLogin",
"pages/personCenter/mine/mine",
"pages/personCenter/subCommissionSetting/subCommissionSetting",
"pages/test/testVideo/testVideo", "pages/test/testVideo/testVideo",
"pages/personCenter/withdrawal/withdrawal", "pages/personCenter/withdrawal/withdrawal",
"pages/personCenter/withdrawalAccount/withdrawalAccount", "pages/personCenter/withdrawalAccount/withdrawalAccount",
@ -21,7 +17,8 @@
"pages/loginModule/register/register", "pages/loginModule/register/register",
"pages/projectModule/applyCode/applyCode", "pages/projectModule/applyCode/applyCode",
"pages/projectModule/userProject/userProject", "pages/projectModule/userProject/userProject",
"pages/loginModule/forgetPwd/forgetPwd" "pages/loginModule/forgetPwd/forgetPwd",
"pages/personCenter/commissionSetting/commissionSetting"
], ],
"window": { "window": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",

View File

@ -1,22 +1,73 @@
// pages/personCenter/accountSetting/accountSetting.js // pages/personCenter/accountSetting/accountSetting.js
const { baseUrl } = require("../../../request");
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
nickName: "",
userAvatar: "",
phoneNumber: ""
}, },
gotoResetPwd() {
wx.navigateTo({ logOut() {
url: '/pages/personCenter/resetPwd/resetPwd', wx.request({
url: baseUrl + '/userInfo/mini/logout',
method: 'GET',
header: {
Authorization: wx.getStorageSync('token')
},
success: res => {
if (res.data.code === 1) {
wx.showToast({
title: '退出登录',
icon: 'success'
})
wx.reLaunch({
url: '/pages/loginModule/pwdLogin/pwdLogin',
})
} else {
wx.showToast({
title: res.data.message,
icon: 'error'
})
}
},
fail: () => {
wx.showToast({ title: '网络错误,请重试', icon: 'none' });
}
}) })
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
const token = wx.getStorageSync('token');
// 获取用户信息
wx.request({
url: baseUrl + '/userInfo/get/jwt',
method: 'GET',
header: {
Authorization: token
},
success: res => {
if (res.data.code === 1) {
this.setData({
nickName: res.data.data.nickName,
// TODO 头像未连接
userAvatar: res.data.data.userAvatar,
phoneNumber: res.data.data.phoneNumber,
userAccount: res.data.data.userAccount
})
}
},
fail: () => {
wx.showToast({ title: '网络错误,请重试', icon: 'none' });
}
})
}, },
/** /**

View File

@ -6,8 +6,8 @@
src="./images/logo.png" src="./images/logo.png"
/> />
<view class="flex-col items-start flex-1 self-start group_2 ml-8"> <view class="flex-col items-start flex-1 self-start group_2 ml-8">
<text class="text">user</text> <text class="text">{{ nickName }}</text>
<text class="font text_2 mt-28">15888610253</text> <text class="font text_2 mt-28">{{ phoneNumber }}</text>
</view> </view>
</view> </view>
<text class="self-start font_2 text_3 mt-19">平台服务</text> <text class="self-start font_2 text_3 mt-19">平台服务</text>
@ -45,5 +45,5 @@
</view> </view>
</view> </view>
</view> </view>
<view class="flex-col justify-start items-center text-wrapper"><text class="font_2 text_7">退出登录</text></view> <view class="flex-col justify-start items-center text-wrapper" bind:tap="logOut"><text class="font_2 text_7">退出登录</text></view>
</view> </view>

View File

@ -1,4 +1,6 @@
// pages/personCenter/mine/mine.js // pages/personCenter/mine/mine.js
const { baseUrl } = require("../../../request");
Page({ Page({
/** /**
@ -6,6 +8,15 @@ Page({
*/ */
data: { data: {
items: [null], items: [null],
nickName: "",
userAvatar: "",
phoneNumber: "",
userAccount: "",
invitationCode: "",
currentBalance: "", // 当前余额
withdrawalAmount: "", // 提现中的余额
withdrawnAmount: "", // 已提现的余额
totalIncome:"" // 累计收入
}, },
myteam(){ myteam(){
wx.navigateTo({ wx.navigateTo({
@ -61,7 +72,55 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
const token = wx.getStorageSync('token');
// 获取用户主要信息
wx.request({
url: baseUrl + '/userInfo/get/main/jwt',
method: 'GET',
header: {
Authorization: token
},
success: res => {
if (res.data.code === 1) {
this.setData({
currentBalance: res.data.data.currentBalance, // 当前余额
withdrawalAmount: res.data.data.withdrawalAmount, // 提现中的余额
withdrawnAmount: res.data.data.withdrawnAmount, // 已提现的余额
totalIncome: res.data.data.totalIncome // 累计收入
})
} else {
wx.showToast({
title: '获取个人信息失败',
icon: 'none'
})
}
},
fail: () => {
wx.showToast({ title: '网络错误,请重试', icon: 'none' });
}
})
// 获取用户信息
wx.request({
url: baseUrl + '/userInfo/get/jwt',
method: 'GET',
header: {
Authorization: token
},
success: res => {
if (res.data.code === 1) {
this.setData({
nickName: res.data.data.nickName,
// TODO 头像未连接
userAvatar: res.data.data.userAvatar,
phoneNumber: res.data.data.phoneNumber,
userAccount: res.data.data.userAccount,
invitationCode: res.data.data.invitationCode
})
}
}
})
}, },
/** /**

View File

@ -18,6 +18,7 @@
src="./images/fuzhi.png" src="./images/fuzhi.png"
mode="aspectFill" mode="aspectFill"
/> />
<text class="font_3 text_3">邀请码123445</text>
</view> </view>
</view> </view>
<view class="flex-col items-center" bind:tap="erweima"> <view class="flex-col items-center" bind:tap="erweima">

View File

@ -31,9 +31,14 @@ Page({
Authorization: token // 带上授权头 Authorization: token // 带上授权头
}, },
success: res => { success: res => {
console.log(res.data);
if (res.data.code === 1) { if (res.data.code === 1) {
// 渲染项目数据 // 渲染项目数据
this.setData({ items: res.data.data }); this.setData({ items: res.data.data });
} else if(res.data.code === 40101) {
wx.reLaunch({
url: '/pages/loginModule/pwdLogin/pwdLogin',
})
} else { } else {
wx.showToast({ wx.showToast({
title: res.data.message || '获取项目列表失败', title: res.data.message || '获取项目列表失败',

View File

@ -1,6 +1,6 @@
{ {
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "%E9%9D%92%E6%A9%99", "projectname": "qingcheng-xiaochengxu",
"setting": { "setting": {
"compileHotReLoad": true, "compileHotReLoad": true,
"urlCheck": false, "urlCheck": false,