This commit is contained in:
haomingming
2023-05-09 15:04:05 +08:00
parent 7b9b80be8d
commit 807698b89f
53 changed files with 896 additions and 222 deletions
+33 -5
View File
@@ -1,5 +1,7 @@
import { API } from './../../../utils/network/api'
import Toast from 'tdesign-miniprogram/toast/index';
import { requestSubscribeMessage } from './../../../utils/requestSubscribeUtil';
let api = new API()
const app = getApp()
Page({
@@ -32,7 +34,8 @@ Page({
"5",
"10"
]
}
},
sub_visible: false,
},
onLoad(){
@@ -72,16 +75,41 @@ Page({
console.log(response);
}).then(()=>{
if(detail){
wx.requestSubscribeMessage({
tmplIds: ['G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc'],
success (res) {
console.log(res);//同意授权
let tmplIds = ['G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc']
let sub_promise = requestSubscribeMessage(tmplIds)
sub_promise.then(res => {
console.log("订阅成功")
}).catch(err => {
console.log(err)
let errCode = err.errCode
if(errCode == 20004){
this.setData({
sub_visible: true,
})
}
})
}
}).catch(errors => {console.error(errors);})
},
subcancelDialog(){
this.setData({
sub_visible: false
})
},
subconfirmDialog(){
this.setData({
sub_visible: false
})
wx.openSetting({
success (res) {
console.log(res.authSetting)
}
})
},
putDoctorInquiryConfig(){
//修改医生问诊配置
// let params = {};
+2 -1
View File
@@ -7,6 +7,7 @@
"van-stepper": "@vant/weapp/stepper/index",
"van-switch": "@vant/weapp/switch/index",
"van-button": "@vant/weapp/button/index",
"t-toast": "tdesign-miniprogram/toast/toast"
"t-toast": "tdesign-miniprogram/toast/toast",
"t-dialog": "tdesign-miniprogram/dialog/dialog"
}
}
+13
View File
@@ -51,4 +51,17 @@
</view>
<t-toast id="t-toast" />
<t-dialog
visible="{{ sub_visible }}"
title="温馨提示"
content="您已关闭订阅消息通知,请点击“确认”按钮在设置中打开订阅通知。"
>
<view slot="cancel-btn" class="dialog dialog_cancel_btn" bindtap="subcancelDialog">
取消
</view>
<view slot="confirm-btn" class="dialog dialog_confirm_btn" bindtap="subconfirmDialog">
确定
</view>
</t-dialog>
</view>
+14
View File
@@ -137,4 +137,18 @@ page{
}
.cell_value{
color: #000;
}
.dialog{
width: 50%;
text-align: center;
height: 100rpx;
line-height: 100rpx;
}
.dialog_cancel_btn{
border-top: 1px solid #E9E9E9;
border-right: 1px solid #E9E9E9;
}
.dialog_confirm_btn{
border-top: 1px solid #E9E9E9;
color: #3CC7C0;
}