Explorar o código

编写首页通知的判断和跳转

liuyuanhang %!s(int64=4) %!d(string=hai) anos
pai
achega
d161324996
Modificáronse 2 ficheiros con 174 adicións e 23 borrados
  1. 163 15
      pages/index/index.vue
  2. 11 8
      pages/patient/patientxq.vue

+ 163 - 15
pages/index/index.vue

xqd xqd xqd
@@ -138,19 +138,32 @@
 			</view>
 			<view class="padding-lr">
 				<view v-for="(item,index) in docterMessageList" :key="index" @touchstart.prevent="touchstart(index)"
-				 @touchend.prevent="touchend" class="padding-lr-sm padding-tb-sm bg-white margin-top-sm" style="border-radius: 32rpx;">
+				 @touchend.prevent="touchend" @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">
 						<!-- 1为订单通知 2为系统通知 3为通知类型 -->
-						<image src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/home/ddtz.png" v-if="item.type=='电话订单'||item.type=='图文订单'" style="width: 30rpx;height: 30rpx;"></image>
-						<image src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/home/xttz.png" v-else-if="item.type=='错误'"style="width: 30rpx;height: 30rpx;"></image>
+						<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" style="width: 30rpx;height: 30rpx;"></image>
+						<image src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/home/xttz.png" v-else-if="item.type==4"style="width: 30rpx;height: 30rpx;"></image>
 						<image src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/home/tzlx.png" v-else style="width: 30rpx;height: 30rpx;"></image>
-						<text class="text-lg margin-left-xs" style="margin-right: 20rpx;">{{item.type}}</text>
-						<view v-if="item.status=='未读'" class="flex align-center">
+						<text class="text-lg margin-left-xs" style="margin-right: 20rpx;" v-if="item.type==1">确认接单</text>
+						<text class="text-lg margin-left-xs" style="margin-right: 20rpx;" v-else-if="item.type==2">订单逾期</text>
+						<text class="text-lg margin-left-xs" style="margin-right: 20rpx;" v-else-if="item.type==3">订单完成</text>
+						<text class="text-lg margin-left-xs" style="margin-right: 20rpx;" v-else-if="item.type==4">评价</text>
+						<text class="text-lg margin-left-xs" style="margin-right: 20rpx;" v-else-if="item.type==5">服务包</text>
+						<text class="text-lg margin-left-xs" style="margin-right: 20rpx;" v-else-if="item.type==6">社区通知</text>
+						<text class="text-lg margin-left-xs" style="margin-right: 20rpx;" v-else-if="item.type==7">后台通知</text>
+						<text class="text-lg margin-left-xs" style="margin-right: 20rpx;" v-else-if="item.type==8">认证申请</text>
+						<text class="text-lg margin-left-xs" style="margin-right: 20rpx;" v-else-if="item.type==9">认证结果</text>
+						<text class="text-lg margin-left-xs" style="margin-right: 20rpx;" v-else-if="item.type==10">服务开通</text>
+						<text class="text-lg margin-left-xs" style="margin-right: 20rpx;" v-else-if="item.type==11">服务开通结果</text>
+						<text class="text-lg margin-left-xs" style="margin-right: 20rpx;" v-else-if="item.type==12">提醒排班</text>
+						<text class="text-lg margin-left-xs" style="margin-right: 20rpx;" v-else-if="item.type==13">排班</text>
+						
+						<view v-if="item.status==1" class="flex align-center">
 							<view style="width: 14rpx;height: 14rpx;border-radius: 50%;background-color:#FF4F61 ;"></view>
-							<text class="margin-left-xs" style="font-size: 24rpx;color: #FF4F61;">{{item.status}}</text>
+							<text class="margin-left-xs" style="font-size: 24rpx;color: #FF4F61;">未读</text>
 						</view>
 						<view v-else>
-							<text class="margin-left-xs" style="font-size: 24rpx;color: #747474;">{{item.status}}</text>
+							<text class="margin-left-xs" style="font-size: 24rpx;color: #747474;">已读</text>
 						</view>
 						<text class="flex-sub text-right">{{item.created_at}}</text>
 					</view>
@@ -279,19 +292,17 @@
 					pageSize: 10
 				});
 				if (res.data === null) {
-					// uni.showToast({
-					// 	title: '到底了',
-					// 	duration: 5000,
-					// 	icon: 'none'
-					// })
+					uni.showToast({
+						title: '到底了',
+						duration: 5000,
+						icon: 'none'
+					})
 					return false;
 				}
 				this.docterMessageList = this.docterMessageList.concat(res.data)
-
-
 				// this.docterMessageList = res.data
 				console.log('我是docterMessageList',this.docterMessageList);
-				console.log('我是接口数据',res);
+				console.log('我是接口数据',res.data);
 			},
 			//全部已读
 			allread: async function() {
@@ -339,6 +350,143 @@
 				}.bind(this), 1000);
 			},
 			
+			/**
+			 * 通知跳转
+			 * @author Liu Yuanhang
+			 * @param {Object} e
+			 */
+			navt(e){
+				// 1.确认接单通知 2.订单逾期通知 3.订单完成通知 4.评价通知 5.服务包通知 
+				// 6.社区端发送的通知 7.总后台发送的通知,8.认证申请通知,9.认证结果通知,
+				// 10服务开通通知,11。服务开通结果通知,12,提醒排班,13.排班通知
+				let id;
+				if(e.type==1){
+					// 1.确认接单通知 跳转到订单详情
+					id = e.relation_id
+					if(e==0){
+						uni.showToast({
+							icon:'none',
+							duration:2000,
+							title:'错误!'
+						})
+					}	
+					uni.navigateTo({
+						url: '/pages/zixun/xiangqing?data=' + id
+					})
+				}else if(e.type==2){
+					// 2.订单逾期通知 跳转订单详情
+					id = e.relation_id
+					if(e==0){
+						uni.showToast({
+							icon:'none',
+							duration:2000,
+							title:'错误!'
+						})
+					}
+					uni.navigateTo({
+						url: '/pages/zixun/xiangqing?data=' + id
+					})
+				}else if(e.type==3){
+					// 2.订单完成通知 跳转订单详情
+					id = e.relation_id
+					if(e==0){
+						uni.showToast({
+							icon:'none',
+							duration:2000,
+							title:'错误!'
+						})
+					}
+					uni.navigateTo({
+						url: '/pages/zixun/xiangqing?data=' + id
+					})
+				}else if(e.type==4){
+					// 4.评价通知 跳转评价详情
+					id = e.relation_id
+					if(e!=0){
+						uni.showToast({
+							icon:'none',
+							duration:2000,
+							title:'错误!'
+						})
+					}
+				}else if(e.type==5){
+					// 5.服务包通知 点击查看用户详情
+					id = e.relation_id
+					if(e!=0){
+						uni.showToast({
+							icon:'none',
+							duration:2000,
+							title:'错误!'
+						})
+					}
+					uni.navigateTo({
+						url: '/pages/patient/patientxq?id=' + id
+					})
+				}else if(e.type==6){
+					// 6.社区端发送的通知
+					uni.showModal({
+						title: "社区通知",
+						content: e.content,
+						confirmText: "知道了",
+						showCancel: false,
+					})
+				}
+				else if(e.type==7){
+					// 7.总后台发送的通知
+					uni.showModal({
+						title: "后台通知",
+						content: e.content,
+						confirmText: "知道了",
+						showCancel: false,
+					})
+				}else if(e.type==8){
+					// 8.认证申请通知
+					uni.showModal({
+						title: "认证申请",
+						content: e.content,
+						confirmText: "知道了",
+						showCancel: false,
+					})
+				}else if(e.type==9){
+					// 9.认证结果通知,
+					uni.showModal({
+						title: "认证结果",
+						content: e.content,
+						confirmText: "知道了",
+						showCancel: false,
+					})
+				}else if(e.type==10){
+					// 10服务开通通知
+					uni.showModal({
+						title: "服务开通",
+						content: e.content,
+						confirmText: "知道了",
+						showCancel: false,
+					})
+				}else if(e.type==11){
+					// 11。服务开通结果通知
+					uni.showModal({
+						title: "服务开通结果",
+						content: e.content,
+						confirmText: "知道了",
+						showCancel: false,
+					})
+				}else if(e.type==12){
+					// 12,提醒排班 跳转到排班
+					uni.navigateTo({
+						url: '/pages/Scheduling'
+					})
+					
+				}else if(e.type==13){
+					// 13.排班通知 跳转到排班
+					 uni.navigateTo({
+					 	url: '/pages/Scheduling'
+					 })
+				 }
+				
+				console.log(e);
+			},
+			
 			//如果点击模块   需要判断认证
 			judgerenzheng: function(){
 				if (!this.hasLogin) {

+ 11 - 8
pages/patient/patientxq.vue

xqd
@@ -283,14 +283,17 @@
 				let res = await this.$request.post("doctor/userListDetile", {
 					user_id: idXq
 				})
-				let user_arr = res.data.user_arr
-				this.user_id = user_arr.id
-				this.img = user_arr.avatar
-				this.name = user_arr.nickname
-				this.bz = user_arr.remark
-				this.recordlist = res.data.order_arr //历史问诊
-				this.dalist = res.data.patients_arr //患者档案
-				this.getguanzhu(user_arr.id);
+				if(res.status==0){
+					let user_arr = res.data.user_arr
+					this.user_id = user_arr.id
+					this.img = user_arr.avatar
+					this.name = user_arr.nickname
+					this.bz = user_arr.remark
+					this.recordlist = res.data.order_arr //历史问诊
+					this.dalist = res.data.patients_arr //患者档案
+					this.getguanzhu(user_arr.id);
+				}
+				
 			},
 			getguanzhu: async function(id) {
 				let res = await this.$request.post('doctor/getFollows', {