From 2c99d357f7d8c4bd41fcc95b8fd89adb3c4e8d0f Mon Sep 17 00:00:00 2001 From: zoujiandong <10130823232@qq.com> Date: Mon, 25 Sep 2023 15:23:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B6=88=E6=81=AF=E9=80=9A?= =?UTF-8?q?=E7=9F=A5switch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pages/yishi/myinfo/index.js | 1 + Pages/yishi/myinfo/index.wxml | 2 + Pages/yishi/notify/notify.js | 93 ++++++++++++++++++++++++++++++++++ Pages/yishi/notify/notify.json | 9 ++++ Pages/yishi/notify/notify.wxml | 19 +++++++ Pages/yishi/notify/notify.wxss | 10 ++++ app.json | 3 +- utils/network/api.js | 17 +++++++ 8 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 Pages/yishi/notify/notify.js create mode 100644 Pages/yishi/notify/notify.json create mode 100644 Pages/yishi/notify/notify.wxml create mode 100644 Pages/yishi/notify/notify.wxss diff --git a/Pages/yishi/myinfo/index.js b/Pages/yishi/myinfo/index.js index 308d71f..09763d3 100644 --- a/Pages/yishi/myinfo/index.js +++ b/Pages/yishi/myinfo/index.js @@ -63,6 +63,7 @@ Page({ }) }, go(e){ + console.log(2222) if(this.data.idcard_status != 1){ this.setData({ v_show: true, diff --git a/Pages/yishi/myinfo/index.wxml b/Pages/yishi/myinfo/index.wxml index 20f2995..f2b65cf 100644 --- a/Pages/yishi/myinfo/index.wxml +++ b/Pages/yishi/myinfo/index.wxml @@ -7,6 +7,8 @@ value="{{idcard_status==0?'未认证':idcard_status==1?'已认证':'认证失败'}}" is-link /> + 退出登录 diff --git a/Pages/yishi/notify/notify.js b/Pages/yishi/notify/notify.js new file mode 100644 index 0000000..91460c9 --- /dev/null +++ b/Pages/yishi/notify/notify.js @@ -0,0 +1,93 @@ +// pages/notify/notigy.js +import { API } from './../../../utils/network/api' +let api = new API() +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + navbarData: { + showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示 + title: '消息通知', //导航栏 中间的标题 + }, + checked:true, + }, + onChangeSwitch({ detail }){ + this.setData({ checked: detail }); + this.handleEditConfig(detail); + }, + handleEditConfig(detail){ + let is_accept_im_message_push=detail?1:0; + api.editConfig({is_accept_im_message_push:is_accept_im_message_push}).then(data=>{ + wx.showToast({ + title: '设置成功', + icon:"none" + }) + }) + }, + handleGetConfig(){ + api.getConfig().then(data=>{ + let result=data.data; + this.setData({ + checked:result.is_accept_im_message_push==1?true:false + }) + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.handleGetConfig(); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/Pages/yishi/notify/notify.json b/Pages/yishi/notify/notify.json new file mode 100644 index 0000000..4085181 --- /dev/null +++ b/Pages/yishi/notify/notify.json @@ -0,0 +1,9 @@ +{ + "usingComponents": { + "te-nav-bar": "/commpents/te_navbar", + "van-cell": "@vant/weapp/cell/index", + "van-cell-group": "@vant/weapp/cell-group/index", + "van-switch": "@vant/weapp/switch/index" + }, + "navigationStyle":"custom" +} \ No newline at end of file diff --git a/Pages/yishi/notify/notify.wxml b/Pages/yishi/notify/notify.wxml new file mode 100644 index 0000000..d7c38b7 --- /dev/null +++ b/Pages/yishi/notify/notify.wxml @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/Pages/yishi/notify/notify.wxss b/Pages/yishi/notify/notify.wxss new file mode 100644 index 0000000..1109b94 --- /dev/null +++ b/Pages/yishi/notify/notify.wxss @@ -0,0 +1,10 @@ +/* pages/notify/notigy.wxss */ +.page{ + position: relative; + overflow: hidden; + background: #F2F2F2; +} +.right,.title-class{ + + margin-top: 10rpx; +} diff --git a/app.json b/app.json index 09137e7..11f31d9 100644 --- a/app.json +++ b/app.json @@ -59,7 +59,8 @@ "Pages/yishi/wenzhen_v3/wenzhen", "Pages/agreement_page/index", "Pages/yishi/medince_list/index", - "Pages/yishi/linkPage/linkPage" + "Pages/yishi/linkPage/linkPage", + "Pages/yishi/notify/notify" ], "window": { "navigationBarBackgroundColor": "#ffffff", diff --git a/utils/network/api.js b/utils/network/api.js index a1988a1..a48f620 100644 --- a/utils/network/api.js +++ b/utils/network/api.js @@ -818,7 +818,24 @@ getLastInquiry(params) { } }) } +//获取配置 +getConfig() { + return this.request({ + url: `${this.baseUrl}/user/system`, + method: 'GET' + }) +} +//获取配置 +editConfig(params) { + return this.request({ + url: `${this.baseUrl}/user/system`, + method: 'PUT', + data: { + ...params + } + }) +}