|
@@ -144,8 +144,8 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="padding-lr">
|
|
<view class="padding-lr">
|
|
- <view v-for="(item,index) in docterMessageList" :key="index" @touchstart.prevent="touchstart(index)"
|
|
|
|
- @touchend.prevent="touchend" @click="navt(item)" class="padding-lr-sm padding-tb-sm bg-white margin-top-sm" style="border-radius: 32rpx;">
|
|
|
|
|
|
+ <view v-for="(item,index) in docterMessageList" :key="index" @longpress="touchstart(index)" @click="navt(item)"
|
|
|
|
+ class="padding-lr-sm padding-tb-sm bg-white margin-top-sm" style="border-radius: 32rpx;">
|
|
<view class="flex justify-start align-center">
|
|
<view class="flex justify-start align-center">
|
|
<!-- 1为订单通知 2为系统通知 3为通知类型 -->
|
|
<!-- 1为订单通知 2为系统通知 3为通知类型 -->
|
|
<image src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/home/ddtz.png" v-if="item.type==1||item.type==2||item.type==3"
|
|
<image src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/home/ddtz.png" v-if="item.type==1||item.type==2||item.type==3"
|
|
@@ -290,7 +290,7 @@
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
getDocterInfo: async function() {
|
|
getDocterInfo: async function() {
|
|
- let res = await this.$request.post("doctor/doctorInfor", {});
|
|
|
|
|
|
+ let res = await this.$request.post("doctor/doctorInfor", {}, false);
|
|
if (res.data.name.length > 5) {
|
|
if (res.data.name.length > 5) {
|
|
this.docterInfo.name = res.data.name.substring(0, 5) + "...";
|
|
this.docterInfo.name = res.data.name.substring(0, 5) + "...";
|
|
} else {
|
|
} else {
|
|
@@ -308,11 +308,10 @@
|
|
console.log('认证', this.docterInfo.is_then)
|
|
console.log('认证', this.docterInfo.is_then)
|
|
},
|
|
},
|
|
getDocterMessage: async function() {
|
|
getDocterMessage: async function() {
|
|
-
|
|
|
|
let res = await this.$request.post("docterMessage/docterMessageList", {
|
|
let res = await this.$request.post("docterMessage/docterMessageList", {
|
|
curPage: this.page,
|
|
curPage: this.page,
|
|
pageSize: 10
|
|
pageSize: 10
|
|
- });
|
|
|
|
|
|
+ }, false);
|
|
if (res.data.length == 0) {
|
|
if (res.data.length == 0) {
|
|
// uni.showToast({
|
|
// uni.showToast({
|
|
// title: '没有更多数据',
|
|
// title: '没有更多数据',
|
|
@@ -333,17 +332,35 @@
|
|
},
|
|
},
|
|
//全部已读
|
|
//全部已读
|
|
allread: async function() {
|
|
allread: async function() {
|
|
- let res = await this.$request.post("docterMessage/okDocterMessage", {});
|
|
|
|
|
|
+ if (this.docterMessageList.length == 0) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "暂无通知",
|
|
|
|
+ icon: "none"
|
|
|
|
+ })
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ if(this.docterMessageList.every((item)=>item.status==1? false: true)){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "暂无未读消息",
|
|
|
|
+ icon: "none"
|
|
|
|
+ })
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ let res = await this.$request.post("docterMessage/okDocterMessage", {}, false);
|
|
console.log(res);
|
|
console.log(res);
|
|
if (res.message == "success") {
|
|
if (res.message == "success") {
|
|
- uni.showToast({
|
|
|
|
- title: '操作完成',
|
|
|
|
- duration: 2000,
|
|
|
|
- icon: 'none'
|
|
|
|
|
|
+ // uni.showToast({
|
|
|
|
+ // title: '操作完成',
|
|
|
|
+ // duration: 2000,
|
|
|
|
+ // icon: 'none'
|
|
|
|
+ // })
|
|
|
|
+ // this.page = 1;
|
|
|
|
+ // this.docterMessageList = [];
|
|
|
|
+ // this.getDocterMessage();
|
|
|
|
+ this.docterMessageList.forEach(item => {
|
|
|
|
+ item.status = 2
|
|
})
|
|
})
|
|
- this.page = 1;
|
|
|
|
- this.docterMessageList = [];
|
|
|
|
- this.getDocterMessage();
|
|
|
|
|
|
+ this.$forceUpdate()
|
|
} else if (res.message == '操作失败!') {
|
|
} else if (res.message == '操作失败!') {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '操作完成',
|
|
title: '操作完成',
|
|
@@ -359,22 +376,26 @@
|
|
//长按删除
|
|
//长按删除
|
|
async touchstart(index) {
|
|
async touchstart(index) {
|
|
let that = this;
|
|
let that = this;
|
|
- clearInterval(this.Loop); //再次清空定时器,防止重复注册定时器
|
|
|
|
- this.Loop = setTimeout(async function() {
|
|
|
|
- uni.showModal({
|
|
|
|
- title: '删除',
|
|
|
|
- content: '请问要删除本条消息吗?',
|
|
|
|
- success: async function(res) {
|
|
|
|
- if (res.confirm) {
|
|
|
|
- let res = await that.$request.post("docterMessage/delDocterMessage", {
|
|
|
|
- id: that.docterMessageList[index].id
|
|
|
|
- });
|
|
|
|
- } else if (res.cancel) {
|
|
|
|
- console.log('用户点击取消');
|
|
|
|
|
|
+ //clearInterval(this.Loop); //再次清空定时器,防止重复注册定时器
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '删除',
|
|
|
|
+ content: '请问要删除本条消息吗?',
|
|
|
|
+ success: async function(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ let res = await that.$request.post("docterMessage/delDocterMessage", {
|
|
|
|
+ id: that.docterMessageList[index].id
|
|
|
|
+ });
|
|
|
|
+ if (res.status == 0) {
|
|
|
|
+ that.docterMessageList.splice(index, 1)
|
|
}
|
|
}
|
|
|
|
+ } else if (res.cancel) {
|
|
|
|
+ console.log('用户点击取消');
|
|
}
|
|
}
|
|
- });
|
|
|
|
- }.bind(this), 3000);
|
|
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ // this.Loop = setTimeout(async function() {
|
|
|
|
+
|
|
|
|
+ // }.bind(this), 3000);
|
|
},
|
|
},
|
|
ellipsis(value) {
|
|
ellipsis(value) {
|
|
if (!value) return ''
|
|
if (!value) return ''
|
|
@@ -491,7 +512,7 @@
|
|
confirmText: "知道了",
|
|
confirmText: "知道了",
|
|
showCancel: false,
|
|
showCancel: false,
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
} else if (e.type == 10) {
|
|
} else if (e.type == 10) {
|
|
// 10服务开通通知
|
|
// 10服务开通通知
|
|
uni.showModal({
|
|
uni.showModal({
|
|
@@ -520,7 +541,7 @@
|
|
url: '/pages/Scheduling'
|
|
url: '/pages/Scheduling'
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- return false;
|
|
|
|
|
|
+ return false;
|
|
console.log(e);
|
|
console.log(e);
|
|
},
|
|
},
|
|
//如果点击模块 需要判断认证
|
|
//如果点击模块 需要判断认证
|
|
@@ -565,7 +586,7 @@
|
|
getStatus: async function() {
|
|
getStatus: async function() {
|
|
let res = await this.$request.post('doctor/getSettingList', {
|
|
let res = await this.$request.post('doctor/getSettingList', {
|
|
'type': 1
|
|
'type': 1
|
|
- });
|
|
|
|
|
|
+ }, false);
|
|
|
|
|
|
if (res.status == 0) {
|
|
if (res.status == 0) {
|
|
this.mzModal = res.data.is_appoint
|
|
this.mzModal = res.data.is_appoint
|