我的页面

This commit is contained in:
yuanteng0011 2025-05-29 09:02:02 +08:00
parent bc4ea87cab
commit fcc9e21a7b
7 changed files with 132 additions and 13 deletions

View File

@ -1,8 +1,8 @@
{
"pages": [
"pages/loginModule/pwdLogin/pwdLogin",
"pages/personCenter/mine/mine",
"pages/personCenter/subCommissionSetting/subCommissionSetting",
"pages/loginModule/pwdLogin/pwdLogin",
"pages/test/testVideo/testVideo",
"pages/personCenter/withdrawal/withdrawal",
"pages/personCenter/withdrawalAccount/withdrawalAccount",

View File

@ -1,18 +1,73 @@
// pages/personCenter/accountSetting/accountSetting.js
const { baseUrl } = require("../../../request");
Page({
/**
* 页面的初始数据
*/
data: {
nickName: "",
userAvatar: "",
phoneNumber: ""
},
logOut() {
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) {
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"
/>
<view class="flex-col items-start flex-1 self-start group_2 ml-8">
<text class="text">user</text>
<text class="font text_2 mt-28">15888610253</text>
<text class="text">{{ nickName }}</text>
<text class="font text_2 mt-28">{{ phoneNumber }}</text>
</view>
</view>
<text class="self-start font_2 text_3 mt-19">平台服务</text>
@ -45,5 +45,5 @@
</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 File

@ -1,4 +1,6 @@
// pages/personCenter/mine/mine.js
const { baseUrl } = require("../../../request");
Page({
/**
@ -6,6 +8,15 @@ Page({
*/
data: {
items: [null],
nickName: "",
userAvatar: "",
phoneNumber: "",
userAccount: "",
invitationCode: "",
currentBalance: "", // 当前余额
withdrawalAmount: "", // 提现中的余额
withdrawnAmount: "", // 已提现的余额
totalIncome:"" // 累计收入
},
myteam(){
wx.navigateTo({
@ -61,7 +72,55 @@ Page({
* 生命周期函数--监听页面加载
*/
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

@ -2,14 +2,14 @@
<view class="flex-col relative section">
<view class="flex-row justify-between items-center group">
<view class="flex-col">
<text class="self-start font text">qingcheng</text>
<text class="self-start font text">{{ nickName }}</text>
<view class="flex-row items-center self-stretch group_2 mt-9">
<image
class="image_3"
src="./images/dianhua.png"
mode="aspectFill"
/>
<text class="font_2 text_2 ml-7">15214547473</text>
<text class="font_2 text_2 ml-7">{{ phoneNumber }}</text>
</view>
<view class="flex-row items-center self-stretch section_2 mt-9">
<image
@ -17,7 +17,7 @@
src="./images/fuzhi.png"
mode="aspectFill"
/>
<text class="font_3 text_3">邀请码:123445</text>
<text class="font_3 text_3">邀请码:{{ invitationCode }}</text>
</view>
</view>
<view class="flex-col items-center" bind:tap="erweima">
@ -33,7 +33,7 @@
<view class="flex-row justify-between items-center group_4">
<view class="group_5">
<text class="font_2 text_6">当前金额:</text>
<text class="text_5">¥5.00</text>
<text class="text_5">¥{{ currentBalance }}</text>
</view>
<view class="flex-row items-center section_3" bind:tap="lijitixian">
<image
@ -46,15 +46,15 @@
<view class="flex-row items-start equal-division section_4">
<view class="flex-col items-center equal-division-item_8">
<text class="font_2 text_8">提现中</text>
<text class="font_4 mt-15">¥0.00</text>
<text class="font_4 mt-15">¥{{ withdrawalAmount }}</text>
</view>
<view class="flex-col items-center group_6 equal-division-item">
<text class="font_2 text_9">已提现</text>
<text class="font_4 mt-15">¥0.00</text>
<text class="font_4 mt-15">¥{{ withdrawnAmount }}</text>
</view>
<view class="flex-col items-center group_7 equal-division-item_8">
<text class="font_2 text_10">累计收入</text>
<text class="font_4 mt-15">¥0.00</text>
<text class="font_4 mt-15">¥{{ totalIncome }}</text>
</view>
</view>
</view>

View File

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

View File

@ -1,6 +1,6 @@
{
"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": {
"compileHotReLoad": true,
"urlCheck": false,