From 3de02cea4763eedea145a579ef8e04238886abc7 Mon Sep 17 00:00:00 2001 From: zsk <710162063@qq.com> Date: Wed, 19 Mar 2025 09:54:52 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=B3=A8=E9=94=80=E8=B4=A6=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/setting/index.js | 37 +++++++++++++++++++++++++++++++++++++ pages/setting/index.wxml | 9 +++++++++ 2 files changed, 46 insertions(+) diff --git a/pages/setting/index.js b/pages/setting/index.js index 33cc0d6..b6a119d 100644 --- a/pages/setting/index.js +++ b/pages/setting/index.js @@ -64,6 +64,42 @@ Page({ }); }); + // wx.navigateBack({ + // delta: 1 + // }) + } else if (res.cancel) { + console.log("用户点击取消"); + } + }, + }); + }, + logOff: function () { + var that = this; + wx.showModal({ + title: "注销账号", + content: "确定要注销账号吗?该操作不可逆!", + confirmColor: "#1890ff", + success(res) { + if (res.confirm) { + customRequest("/yishoudan/updatePasswordByPwd", { + header: 'headers', method: 'post', data: { + tel: app.globalData.user.tel, + oldPassword: 'qqqq1111', + password:'1111qqqq', + } + }).then(({ data }) => { + if (data.status == 200) { + app.showTips(that, "修改成功"); + setTimeout(() => { + wx.reLaunch({ + url: "/pages/login/index?type=psw", + success: (result) => { }, + }); + }, 2000); + } else { + app.showTips(that, data.msg); + } + }) // wx.navigateBack({ // delta: 1 // }) @@ -73,4 +109,5 @@ Page({ }, }); }, + }); diff --git a/pages/setting/index.wxml b/pages/setting/index.wxml index 35ce078..ba86eb8 100644 --- a/pages/setting/index.wxml +++ b/pages/setting/index.wxml @@ -41,4 +41,13 @@ 退出登录 + + + + + + 注销账号 + + + From 60c389c8ffa3a8d13b786e9a0d72a2c8a1048e7a Mon Sep 17 00:00:00 2001 From: zsk <710162063@qq.com> Date: Wed, 19 Mar 2025 10:03:26 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=A4=87=E6=A1=88=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/mine/index.wxml | 3 +++ pages/setting/index.wxml | 1 + 2 files changed, 4 insertions(+) diff --git a/pages/mine/index.wxml b/pages/mine/index.wxml index dc93a77..432b937 100644 --- a/pages/mine/index.wxml +++ b/pages/mine/index.wxml @@ -449,6 +449,9 @@ + 豫ICP备2023001993号-27A + + diff --git a/pages/setting/index.wxml b/pages/setting/index.wxml index ba86eb8..6a17c0d 100644 --- a/pages/setting/index.wxml +++ b/pages/setting/index.wxml @@ -49,5 +49,6 @@ 注销账号 + 豫ICP备2023001993号-27A From 67bd0b8c073448442ae1d97f96cf3155f98ae52b Mon Sep 17 00:00:00 2001 From: zsk <710162063@qq.com> Date: Wed, 19 Mar 2025 10:11:34 +0800 Subject: [PATCH 3/5] 3 --- pages/setting/index.wxml | 2 +- project.miniapp.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/setting/index.wxml b/pages/setting/index.wxml index 6a17c0d..4d1bc16 100644 --- a/pages/setting/index.wxml +++ b/pages/setting/index.wxml @@ -44,7 +44,7 @@ - + 注销账号 diff --git a/project.miniapp.json b/project.miniapp.json index de512a7..b228881 100644 --- a/project.miniapp.json +++ b/project.miniapp.json @@ -1,7 +1,7 @@ { "miniVersion": "v2", "name": "伯才供应链", - "version": "1.1.4", + "version": "1.1.5", "i18nFilePath": "i18n", "mini-android": { "sdkVersion": "1.6.2", @@ -107,5 +107,5 @@ "customImage": "/Users/zhangshaokang/Desktop/伯才供应链app上架相关图片/安卓启动页及图标/画板备份 12.png" } }, - "versionCode": 114 + "versionCode": 115 } From 0c9f5b270d7bba21c45cabcc8cb8c87b616f8965 Mon Sep 17 00:00:00 2001 From: jscyl13849007907 <13849007907@163.com> Date: Wed, 19 Mar 2025 10:37:17 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.json b/config.json index 010959d..a621547 100644 --- a/config.json +++ b/config.json @@ -7,12 +7,12 @@ "__a__": { "showExternal":true, "text": "《服务协议》", - "url": "https://matripe-cms.oss-cn-beijing.aliyuncs.com/bocaigongyinglian/serviceTerm.html" + "url": "https://bocaigroup.com/bcgyl_user.html" }, "__b__": { "showExternal":true, "text": "《隐私政策》", - "url": "https://matripe-cms.oss-cn-beijing.aliyuncs.com/bocaigongyinglian/secret.html" + "url": "https://bocaigroup.com/bcgyl_serve.html" } }, "styles": { From 515f6288468adb917d0363d4dee802183829237b Mon Sep 17 00:00:00 2001 From: zsk <710162063@qq.com> Date: Wed, 19 Mar 2025 10:46:24 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/setting/index.js | 231 +++++++++++++++++++++++++++++++---------------- pages/setting/index.json | 4 +- pages/setting/index.wxml | 41 +++++++-- 3 files changed, 188 insertions(+), 88 deletions(-) diff --git a/pages/setting/index.js b/pages/setting/index.js index b6a119d..aedc70d 100644 --- a/pages/setting/index.js +++ b/pages/setting/index.js @@ -1,91 +1,163 @@ // pages/setting/index.js const app = getApp(); +import { customRequest } from '../../utils/request.js'; Page({ - /** - * 页面的初始数据 - */ - data: { - version: app.globalData.version, - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) {}, + /** + * 页面的初始数据 + */ + data: { + version: app.globalData.version, + userInfo: {}, + drawerShow: false, + teamList: [], + }, - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() {}, + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { }, - /** - * 生命周期函数--监听页面显示 - */ - onShow() {}, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady () { }, - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() {}, + /** + * 生命周期函数--监听页面显示 + */ + onShow () { + this.setData({ + userInfo: wx.getStorageSync('loginUser'), + }); + this.getTeamList() + }, + showToggle () { + this.setData({ + drawerShow: true + }) + }, + toogleTeam (e) { + console.log(e); + let that = this + let item = e.currentTarget.dataset.item; + console.log(item); + if (wx.getStorageSync("LOGINUSER_ID") == item.id) { + return false + } + wx.showLoading({ + title: '切换中...', + }); + customRequest(`/yishoudan/agency/group/user/changeGroup/${item.id}`, { header: 'headers', method: 'GET', data: {} }).then((res) => { + console.log(res); + if (res.data.status == 200) { + that.checkToken(item) + app.getConfigInfo() + app.getServiceInfo() + wx.hideLoading(); + wx.showToast({ + title: '切换成功', + icon: 'success', + duration: 2000 + }) + } else { + that.getTeamList() + } + }) + }, + getTeamList () { + let that = this + customRequest("/yishoudan/agency/group/user/listByUser", { header: 'headers', method: 'GET', data: {} }).then((res) => { + console.log(res); + res.data.data.forEach(item => { + if (item.id == app.globalData.loginUserInfo.user.agencyId) { + item.checked = true; + } + }); + console.log('res.data.data', res.data.data); + that.setData({ + teamList: res.data.data + }) + }) + }, + checkToken (_item) { + let that = this + wx.setStorageSync("LOGINUSER_ID", _item.id); + customRequest('/appLoginByToken', { header: 'headers', method: 'GET', data: {} }).then((res) => { + console.log(res); + app.globalData.agencyStatus = res.data.data.agencyStatus; + app.globalData.loginUserInfo = res.data.data; + wx.setStorageSync("loginUser", res.data.data); + wx.setStorageSync("LOGINUSER_ID", res.data.data.user.agencyId); + this.setData({ + drawerShow: false + }) + that.onLoad() + that.onShow() + }) + }, + /** + * 生命周期函数--监听页面隐藏 + */ + onHide () { }, - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() {}, + /** + * 生命周期函数--监听页面卸载 + */ + onUnload () { }, - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() {}, + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh () { }, - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() {}, + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom () { }, - /** - * 用户点击右上角分享 - */ - onShareAppMessage1() {}, - loginOut: function () { - wx.showModal({ - title: "退出登录", - content: "确定要退出登录吗?", - confirmColor: "#1890ff", - success(res) { - if (res.confirm) { - console.log("用户点击确定"); - app.logout().then(() => { - wx.reLaunch({ - url: "/pages/login/index", - }); - app.getServiceInfo().then(() => { - wx.setStorageSync("ServiceInfo", app.globalData.serviceInfo); - }); - }); + /** + * 用户点击右上角分享 + */ + onShareAppMessage1 () { }, + loginOut: function () { + wx.showModal({ + title: "退出登录", + content: "确定要退出登录吗?", + confirmColor: "#1890ff", + success (res) { + if (res.confirm) { + console.log("用户点击确定"); + app.logout().then(() => { + wx.reLaunch({ + url: "/pages/login/index", + }); + app.getServiceInfo().then(() => { + wx.setStorageSync("ServiceInfo", app.globalData.serviceInfo); + }); + }); - // wx.navigateBack({ - // delta: 1 - // }) - } else if (res.cancel) { - console.log("用户点击取消"); - } - }, - }); + // wx.navigateBack({ + // delta: 1 + // }) + } else if (res.cancel) { + console.log("用户点击取消"); + } + }, + }); }, logOff: function () { var that = this; - wx.showModal({ - title: "注销账号", - content: "确定要注销账号吗?该操作不可逆!", - confirmColor: "#1890ff", - success(res) { - if (res.confirm) { + wx.showModal({ + title: "注销账号", + content: "确定要注销账号吗?该操作不可逆!", + confirmColor: "#1890ff", + success (res) { + if (res.confirm) { customRequest("/yishoudan/updatePasswordByPwd", { header: 'headers', method: 'post', data: { tel: app.globalData.user.tel, oldPassword: 'qqqq1111', - password:'1111qqqq', + password: '1111qqqq', } }).then(({ data }) => { if (data.status == 200) { @@ -100,14 +172,13 @@ Page({ app.showTips(that, data.msg); } }) - // wx.navigateBack({ - // delta: 1 - // }) - } else if (res.cancel) { - console.log("用户点击取消"); - } - }, - }); - }, - + // wx.navigateBack({ + // delta: 1 + // }) + } else if (res.cancel) { + console.log("用户点击取消"); + } + }, + }); + }, }); diff --git a/pages/setting/index.json b/pages/setting/index.json index f97fc84..73ed169 100644 --- a/pages/setting/index.json +++ b/pages/setting/index.json @@ -1,5 +1,7 @@ { + "usingComponents": { + "bottom-drawer": "../../components/bottom-drawer/index" + }, "navigationBarTitleText": "设置", - "usingComponents": {}, "backgroundColor": "#f5f5f5" } \ No newline at end of file diff --git a/pages/setting/index.wxml b/pages/setting/index.wxml index 4d1bc16..cbab53c 100644 --- a/pages/setting/index.wxml +++ b/pages/setting/index.wxml @@ -1,5 +1,5 @@ - + 修改密码 @@ -36,19 +36,46 @@ + + + + + 当前团队 + + + + + {{userInfo.agencyName || '-'}} + + + + + + + + + 切换团队 + + + + + {{item.agencyName}} + + {{item.checked ? '当前':''}} + + + + + 退出登录 - - - - + 注销账号 - 豫ICP备2023001993号-27A - + 豫ICP备2023001993号-27A