diff --git a/app.json b/app.json index f3f96a0..1216b58 100644 --- a/app.json +++ b/app.json @@ -19,7 +19,8 @@ "pages/projectModule/applyCode/applyCode", "pages/projectModule/userProject/userProject", "pages/loginModule/forgetPwd/forgetPwd", - "pages/personCenter/commissionSetting/commissionSetting" + "pages/personCenter/commissionSetting/commissionSetting", + "pages/personCenter/resetPwd/resetPwd" ], "window": { "navigationBarTextStyle": "black", diff --git a/pages/loginModule/register/register.js b/pages/loginModule/register/register.js index 58400fb..b7b0aeb 100644 --- a/pages/loginModule/register/register.js +++ b/pages/loginModule/register/register.js @@ -51,6 +51,7 @@ Page({ }); }, + // 验证码开始 startCountdown() { this.setData({ sending: true, count: 60 }); const timer = setInterval(() => { diff --git a/pages/personCenter/accountSetting/accountSetting.js b/pages/personCenter/accountSetting/accountSetting.js index bde9c36..b9de5be 100644 --- a/pages/personCenter/accountSetting/accountSetting.js +++ b/pages/personCenter/accountSetting/accountSetting.js @@ -12,6 +12,12 @@ Page({ phoneNumber: "" }, + gotoResetPwd() { + wx.navigateTo({ + url: '/pages/personCenter/resetPwd/resetPwd', + }) + }, + logOut() { wx.request({ url: baseUrl + '/userInfo/mini/logout', diff --git a/pages/personCenter/billingDetails/billingDetails.wxml b/pages/personCenter/billingDetails/billingDetails.wxml index bbf47ec..c57ce70 100644 --- a/pages/personCenter/billingDetails/billingDetails.wxml +++ b/pages/personCenter/billingDetails/billingDetails.wxml @@ -3,14 +3,16 @@ 账单明细 - + 银行卡 - ¥2.00 + ¥{{ item.withdrawnAmount }} 2025-10-20 18:45:15 - 待审核 + {{ withdrawalStatus[0] }} + {{ withdrawalStatus[1] }} + {{ withdrawalStatus[2] }} diff --git a/pages/personCenter/commissionSetting/commissionSetting.wxml b/pages/personCenter/commissionSetting/commissionSetting.wxml index 9a89f87..118fb04 100644 --- a/pages/personCenter/commissionSetting/commissionSetting.wxml +++ b/pages/personCenter/commissionSetting/commissionSetting.wxml @@ -12,28 +12,28 @@ - + - 美团神券包-春季活动 + {{ item.projectName }} - 结算T+2 + 结算T+{{ item.projectSettlementCycle }} 下级单价 @@ -47,13 +47,13 @@ - 3.6元购买 - 0.30/0.30/0.00% + {{ commission.projectDetailName }} + {{ commission.myUnitPrice }}/{{ commission.agentUnitPrice }}/{{ commission.currentCommissionRate }}% - qingcheng + {{ nickName }} - 15214547473 + {{ phoneNumber }} - 邀请码:123445 + 邀请码:{{ invitationCode }} - + 当前金额: - ¥5.00 + ¥{{ currentBalance }} 提现中 - ¥0.00 + ¥{{ withdrawalAmount }} 已提现 - ¥0.00 + ¥{{ withdrawnAmount }} 累计收入 - ¥0.00 + ¥{{ totalIncome }} diff --git a/pages/personCenter/resetPwd/resetPwd.js b/pages/personCenter/resetPwd/resetPwd.js index e8d04cd..c61a722 100644 --- a/pages/personCenter/resetPwd/resetPwd.js +++ b/pages/personCenter/resetPwd/resetPwd.js @@ -1,3 +1,6 @@ +import { baseUrl } from "../../../request"; +import { formatPassword } from "../../../utils/util" + // pages/personCenter/resetPwd/resetPwd.js Page({ @@ -5,14 +8,118 @@ Page({ * 页面的初始数据 */ data: { - + phone: '', // 手机号 + sending: false, // 是否发送验证码 + count: 60, + password: '', // 第一次输入的密码 + currentPwd: '', // 再次确认密码 + verificationCode: '' // 验证码 }, + resetPwd() { + const { phone, verificationCode, password, currentPwd } = this.data; + formatPassword(password,currentPwd); + wx.request({ + url: baseUrl + '/userInfo/mini/in/reset/pwd', + method: 'POST', + header: { + Authorization: wx.getStorageSync('token') + }, + data: { + phoneNumber: phone, + verificationCode: verificationCode, + userPassword: password, + userConfirmPassword: currentPwd + }, + success: res => { + console.log('修改密码--->',res); + if (res.data.code === 1) { + wx.showToast({ + title: '更改密码成功', + icon: 'success' + }) + wx.reLaunch({ + url: '/pages/loginModule/pwdLogin/pwdLogin', + }) + } else { + wx.showModal({ + title: '提示', + content: res.data.message + }) + } + } + }) + }, + + // 获取验证码 + getVerificationCode() { + const { phone } = this.data; + wx.request({ + url: baseUrl + '/userInfo/code/pwd', + method: 'POST', + header: { + Authorization: wx.getStorageSync('token') + }, + data: { + templateString: phone + }, + success: res => { + if (res.data.code === 1) { + wx.showToast({ title: '验证码已发送' }); + this.startCountdown(); + } else { + wx.showToast({ + title: '发送失败', + icon: 'error' + }) + } + } + }) + }, + + // 验证码开始 + startCountdown() { + this.setData({ sending: true, count: 60 }); + const timer = setInterval(() => { + let { count } = this.data; + if (count <= 1) { + clearInterval(timer); + this.setData({ sending: false }); + } else { + this.setData({ count: count - 1 }); + } + }, 1000); + }, + + // 通用输入事件处理函数 + onInput(e) { + const field = e.currentTarget.dataset.field; // 获取字段名 + console.log(field); + const value = e.detail.value; // 获取输入容 + this.setData({ + [field]: value // 动态更新应字段 + }); + }, + /** * 生命周期函数--监听页面加载 */ onLoad(options) { - + // 获取用户信息 —— 用于渲染手机号 + wx.request({ + url: baseUrl + '/userInfo/get/jwt', + method: 'GET', + header: { + Authorization: wx.getStorageSync('token') + }, + success: res => { + if (res.data.code === 1) { + this.setData({ + phone: res.data.data.phoneNumber + }) + } + } + }) }, /** diff --git a/pages/personCenter/resetPwd/resetPwd.wxml b/pages/personCenter/resetPwd/resetPwd.wxml index bb9b943..c71fbe5 100644 --- a/pages/personCenter/resetPwd/resetPwd.wxml +++ b/pages/personCenter/resetPwd/resetPwd.wxml @@ -1,13 +1,33 @@ - 15888610253 + {{ phone }} - - 获取验证码 + + + {{ sending ? count + 's后重发' : '发送验证码' }} + - + - + - 重置密码 + 重置密码 \ No newline at end of file diff --git a/pages/projectModule/userProject/userProject.wxml b/pages/projectModule/userProject/userProject.wxml index 4088f69..0e602e4 100644 --- a/pages/projectModule/userProject/userProject.wxml +++ b/pages/projectModule/userProject/userProject.wxml @@ -1,20 +1,22 @@ - + - 美团省钱包 - 结算T+1 实时数据 + {{ item.projectName }} + 结算T+{{ item.projectSettlementCycle }} 实时数据 @@ -25,7 +27,7 @@ /> 推广码 - + { return n[1] ? n : `0${n}` } -module.exports = { - formatTime +const formatPassword = (pwd , currentPwd) => { + if (pwd === '') { + wx.showToast({ + title: '密码不能为空', + icon: 'error' + }) + return; + } + if (pwd.length < 6) { + wx.showToast({ + title: '密码不能小于6位', + icon: 'error' + }) + return; + } + if (currentPwd === '') { + wx.showToast({ + title: '请输入二次确认密码', + icon: 'error' + }) + return; + } + if (currentPwd !== pwd) { + wx.showToast({ + title: '两次密码不一致', + icon: 'error' + }) + return; + } +} + +module.exports = { + formatTime, + formatPassword }