刘远航 hace 4 años
padre
commit
ebd4270eb8

+ 50 - 0
common/goeasyimutil.js

xqd
@@ -135,6 +135,56 @@ function removePrivatePendingMessage(imService, friendId, message) {
 		pendingMessages.splice(pendingMessageIndex, 1);
 	}
 }
+
+IMService.prototype.getFrindList = function(){
+	var promise = im.latestConversations();
+	    promise.then(function(result) {
+			console.log('ress:',result);
+	        //会话列表结果
+	        // {
+	        //     code: 200,
+	        //     content: {
+	        //         unreadTotal: 15,//未读消息总数
+	        //         conversations: [
+	        //             {
+	        //                 type: 'group', 
+	        //                 groupId: 'group001',
+	        //                 
+	        //                 //群Data信息,来源于发送群消息时候的to.data
+	        //                 data: {"avatar": "group-1.png", "name": "区块链交流群"}, 
+	        //                 unread: 5, //未读消息条数
+	        //                 lastMessage: { //最后一条消息
+	        //                     "type": "text", "timestamp": 1594958217087, "senderId": "3bb179af-bcc5-4fe0-9dac-c05688484649",
+	        //                      
+	        //                      //发送方的Data信息,来源于发送方调用im.connect的时候传入的data
+	        //                     "senderData": '{"avatar":"/www/xxx.png","nickname":"Neo"}',
+	        //                     "payload": {"text": "Hello, GoEasyIM"}
+	        //                 }
+	        //             },
+	        //             {
+	        //                 type: 'private', userId: 'user001',
+	        //                 unread: 10, //未读消息条数
+	        //
+	        //                 //私聊好友Data信息,来源于发送私聊消息时的to.data和发送方im.connect时传入的data
+	        //                 data: '{"avatar":"/www/xxx.png","nickname":"Neo"}', 
+	        //                 lastMessage: {//最后一条消息
+	        //                     "type": "audio", "timestamp": 1594958490234, "senderId": "fdee46b0-4b01-4590-bdba-6586d7617f95",
+	        //
+	        //                      //发送方的Data信息,来源于发送方调用im.connect的时候传入的data
+	        //                     "senderData": '{"avatar":"/www/xxx.png","nickname":"Neo"}',
+	        //                     "payload": {
+	        //                         "name": "20200717120129175.m4a", "contentType": "audio/m4a", "duration": 2.46, "size": 15220,
+	        //                         "url": "https://goeasy-hangzhou.oss-cn-hangzhou.aliyuncs.com/goeasy-im/20200717120129175.m4a"
+	        //                     }
+	        //                 }
+	        //             }
+	        //         ]
+	        //     }
+	        // };
+	    }).catch(function(error) {
+	        console.log("Failed to get the latest conversations, code:" + error.code + " content:" + error.content);
+	    });
+}
 //发送私聊消息
 IMService.prototype.sendPrivateTextMessage = function(friendId, text) {
 	let textMessage = this.im.createTextMessage({

+ 30 - 11
pages/conversation/conversation.vue

xqd xqd xqd xqd xqd
@@ -8,14 +8,14 @@
 		</view>
 		<!-- 这是聊天列表 当值为true时显示-->
 		<view class="cu-list menu-avatar margin-top-xs" v-if="qiehuan == true">
-			<view class="cu-item u-border-bottom" v-for="(item,index) in 5" :key="index" @click="goliaotian">
-				<view class="cu-avatar radius lg" style="background-image:url(https://ossweb-img.qq.com/images/lol/img/champion/Taric.png);">
+			<view class="cu-item u-border-bottom" v-for="(item,index) in list" :key="index" @click="goliaotian">
+				<view class="cu-avatar radius lg" :style="'background-image:url('+item.avatar+');'">
 					<view class="cu-tag badge">10</view>
 				</view>
 				<view class="content">
 					<view class="text-grey">
-						<text class="text-cut">用户昵称</text>
-						<view class="cu-tag round bg-orange sm">备注</view>
+						<text class="text-cut">{{item.nickname}}</text>
+						<view class="cu-tag round bg-orange sm">{{item.remark}}</view>
 					</view>
 					<view class="text-gray text-sm flex">
 						<text class="text-cut">信息发送者:最近一条消息</text>
@@ -28,7 +28,7 @@
 		</view>
 		<!-- 这是通话记录 当值为false1时显示 -->
 		<view class="cu-list menu-avatar margin-top-xs" v-if="qiehuan == false" @click="call">
-			<view class="cu-item u-border-bottom" v-for="(item,index) in 5" :key="index" @click="call">
+			<view class="cu-item u-border-bottom" v-for="(item,index) in listPhone" :key="index" @click="call">
 				<view class="cu-avatar radius lg" style="background-image:url(https://ossweb-img.qq.com/images/lol/img/champion/Taric.png);border-radius: 50%;">
 					<view class="cu-tag badge">10</view>
 				</view>
@@ -44,15 +44,22 @@
 </template>
 
 <script>
+	import {
+		sendMessages
+	} from "../../common/goeasyimutil.js"
+	import GoEasyAudioPlayer from "../../components/GoEasyAudioPlayer/GoEasyAudioPlayer.vue";
+	const recorderManager = uni.getRecorderManager()
 	export default {
 		components: {
-
+			GoEasyAudioPlayer
 		},
 		onLoad() {
-
+		 this.imService = getApp().globalData.imService;
+		 console.log(this.imService.sendPrivateTextMessage())
+		 // console.log(this.imService.getFrindList())
+			
 		},
 		mounted() {
-
 		},
 		onShow() {
 			this.getcnversationList()
@@ -63,10 +70,13 @@
 				//false为通话记录,true为聊天列表
 				qiehuan: true,
 
-				keyword: ""
+				keyword: "",
+				list:[],
+				listPhone:[],
 			}
 		},
 		methods: {
+		 
 			tonghua() {
 				console.log("点击了通话记录");
 				if (this.qiehuan) {
@@ -86,8 +96,17 @@
 				})
 			},
 			getcnversationList: async function() {
-				let res = await this.$request.post("/doctor/getUserListMsg")
-				console.log(res)
+				let res = await this.$request.post("doctor/getUserListMsg")
+				if(res.status==0){
+					if(res.data.length!=0){
+						this.list = res.data;
+				 
+						
+						
+					}
+				}
+				
+				 
 			}
 
 		}

+ 4 - 3
pages/conversation/conversationWindow.vue

xqd
@@ -68,11 +68,12 @@
 			
 			this.imService = getApp().globalData.imService;
 			this.doctorInfo = JSON.parse(op.patient)
+			
 			//对话数据
 			this.friend = {
-				uuid: "member_" + this.doctorInfo.patient_id,
-				name: this.doctorInfo.name,
-				avatar: this.doctorInfo.avatar
+				uuid: "member_" + this.doctorInfo.user_id,
+				name: this.doctorInfo.user_name,
+				avatar: this.doctorInfo.user_avatar
 			};
 			this.currentUser = this.imService.currentUser;
 			let privateMessages = this.imService.getPrivateMessages(this.friend.uuid);

+ 1 - 1
pages/index/index.vue

xqd
@@ -344,7 +344,7 @@
 						content: '请问要删除本条消息吗?',
 						success: async function(res) {
 							if (res.confirm) {
-								let res = await this.$request.post("docterMessage/delDocterMessage", {
+								let res = await that.$request.post("docterMessage/delDocterMessage", {
 									id: that.docterMessageList[index].id
 								});
 							} else if (res.cancel) {

+ 24 - 9
pages/login/login.vue

xqd xqd xqd
@@ -237,14 +237,23 @@
 						store.commit('setJwt', res.data.token);
 						store.commit('setUser', res.data);
 						store.commit('login');
+					
+						uni.removeStorage('verfiyCode')				
+						getApp().globalData.imService = new IMService();
+						let loginResult = getApp().globalData.imService.login({
+							uuid: res.data.data.flag,
+							name: res.data.data.name,
+							avatar: res.data.data.avatar
+						});
+						if (loginResult) {
+							//连接IM
+							getApp().globalData.imService.connectIM();
+						}
 						// 写一个跳转到首页
 						setTimeout(function() {
 							uni.navigateBack({
 								delta: 1
 							})
-							uni.switchTab({
-								url: "../index/index"
-							})
 						}, 2000)
 						return false;
 					} else {
@@ -295,14 +304,22 @@
 								store.commit('setUser', res.data);
 								store.commit('login');
 
+								getApp().globalData.imService = new IMService();
+								let loginResult = getApp().globalData.imService.login({
+									uuid: res.data.data.flag,
+									name: res.data.data.name,
+									avatar: res.data.data.avatar
+								});
+								if (loginResult) {
+									//连接IM
+									getApp().globalData.imService.connectIM();
+								}
 								// 写一个跳转到首页
 								setTimeout(function() {
 									uni.navigateBack({
 										delta: 1
 									})
-									uni.switchTab({
-										url: "../index/index"
-									})
+							
 								}, 2000)
 								return false;
 							} else {
@@ -432,9 +449,7 @@
 							uni.navigateBack({
 								delta: 1
 							})
-							uni.switchTab({
-								url: "../index/index"
-							})
+						
 						}, 2000)
 					}
 				}

+ 6 - 35
pages/patient/patientda.vue

xqd xqd xqd xqd
@@ -76,7 +76,7 @@
 			</view>
 		</view>
 		<!-- 底部按钮 -->
-		<view class="bottomButton">
+		<!-- <view class="bottomButton">
 			<view class="b">
 				<u-button shape="circle" :custom-style="bStyle">电话随访</u-button>
 			</view>
@@ -84,7 +84,7 @@
 				<u-button shape="circle" :custom-style="btStyle" v-if="!guanzhu" @click="gzclick">关注</u-button>
 				<u-button shape="circle" :custom-style="bfStyle" v-else @click="gzclick">已关注</u-button>
 			</view>
-		</view>
+		</view> -->
 	</view>
 
 </template>
@@ -117,39 +117,7 @@
 				id: '', //身份证
 				photo1: '', //证件照
 				photo2: '', //证件照
-				blList: [{
-					zt: '1', //状态 1.进行中 2.已完成
-					time: '2020.10.27. 16:20:33', //时间
-					zl: '1' //种类 1.电话咨询 2.图文咨询 3.门诊预约 4.疫苗接种预约 5.儿保预约
-				}, {
-					zt: '2',
-					time: '2020.10.27. 16:20:33',
-					zl: '2'
-				}, {
-					zt: '1',
-					time: '2020.10.27. 16:20:33',
-					zl: '3'
-				}, {
-					zt: '2',
-					time: '2020.10.27. 16:20:33',
-					zl: '4'
-				}, {
-					zt: '1',
-					time: '2020.10.27. 16:20:33',
-					zl: '5'
-				}, {
-					zt: '2',
-					time: '2020.10.27. 16:20:33',
-					zl: '4'
-				}, {
-					zt: '1',
-					time: '2020.10.27. 16:20:33',
-					zl: '2'
-				}, {
-					zt: '2',
-					time: '2020.10.27. 16:20:33',
-					zl: '1'
-				}],
+				blList: [],
 				guanzhu: false,
 				//底部按钮样式
 				bStyle: {
@@ -196,6 +164,9 @@
 				this.information=res.data.patient.info
 				this.id=res.data.patient.card_number
 				this.blList=res.data.patientOrder
+				
+				this.photo1 = res.data.patient.card_img_url //证件照
+				this.photo2 = res.data.patient.card_back_img_url //证件照
 			}
 		}
 	};

+ 35 - 28
pages/patient/patientxq.vue

xqd xqd xqd xqd xqd
@@ -69,13 +69,13 @@
 				<view v-for="(item,index) in tclist" :key="index" style="margin-bottom: 20rpx;">
 					<view class="taocan">
 						<view class="tc_left">
-							{{item.id}}
+							{{item.pack_name}}
 						</view>
 						<view class="tc_right">
 							<view>
-								<view style="margin-bottom: 20rpx;">{{item.fw}}</view>
-								<view style="margin-bottom: 30rpx;">{{item.dd}}</view>
-								<view>有效期:{{item.startTime}}至{{item.endTime}}</view>
+								<view style="margin-bottom: 20rpx;">{{item.pack_intro}}</view>
+								<!-- <view style="margin-bottom: 30rpx;">{{item.dd}}</view> -->
+								<view>有效期:{{item.start_time}}至{{item.end_time}}</view>
 							</view>
 						</view>
 					</view>
@@ -92,12 +92,23 @@
 						<view style="width: 80%;display: flex;color: #666666;align-items:center;">
 							<!-- 小点 -->
 							<view style="height: 12rpx;width: 12rpx;background-color: #666666;border-radius: 50%;margin: 0 10rpx;"></view>
-							<!-- true为已完成 false未完成 -->
-							<text>{{ritem.order_status}}</text>
+							<!-- true为已完成 false未完成 --> 
+							<text v-if="ritem.order_status==1">未支付</text>
+							<text v-else-if="ritem.order_status==2">待接单</text>
+							<text v-else-if="ritem.order_status==3">进行中</text>
+							<text v-else-if="ritem.order_status==4">已完成</text>
+							<text v-else>已取消</text>
 
 						</view>
 						<view style="width: 20%;">
-							<u-button size="mini" shape="circle">{{ritem.product_type}}</u-button>
+							<u-button size="mini" shape="circle" v-if="ritem.product_type == 1">电话咨询</u-button>
+							<u-button size="mini" shape="circle" v-else-if="ritem.product_type == 2">图文咨询</u-button>
+							<u-button size="mini" shape="circle" v-else-if="ritem.product_type == 3">门诊预约</u-button>
+							<u-button size="mini" shape="circle" v-else-if="ritem.product_type == 4">疫苗接种预约</u-button>
+							<u-button size="mini" shape="circle" v-else-if="ritem.product_type == 5">儿保预约</u-button>
+							<u-button size="mini" shape="circle" v-else-if="ritem.product_type == 6">服务包</u-button>	 
+							<u-button size="mini" shape="circle" v-else>充值</u-button>
+							
 						</view>
 					</view>
 					<u-line color="#EFEFEF" />
@@ -211,25 +222,7 @@
 				bz: '备注备注备注备注',
 				user_id: 0,
 				//已购服务
-				tclist: [{
-					id: '套餐一',
-					fw: '疫苗接种+门诊预约+儿保预约', //服务
-					dd: '成都所有社区医院,十名医生专业团队', //地点
-					startTime: '2020年10月27日09:59:06', //开始时间
-					endTime: '2020年10月27日09:59:12' //结束时间
-				}, {
-					id: '套餐一',
-					fw: '疫苗接种+门诊预约+儿保预约', //服务
-					dd: '成都所有社区医院,十名医生专业团队', //地点
-					startTime: '2020年10月27日10:26:11', //开始时间
-					endTime: '2020年10月27日10:26:15' //结束时间
-				}, {
-					id: '套餐一',
-					fw: '疫苗接种+门诊预约+儿保预约', //服务
-					dd: '成都所有社区医院,十名医生专业团队', //地点
-					startTime: '2020年10月27日10:26:24', //开始时间
-					endTime: '2020年10月27日10:26:27' //结束时间
-				}],
+				tclist: [],
 				//历史问诊
 				recordlist: [],
 				dalist: [],
@@ -295,6 +288,9 @@
 					this.fwb = res.data.nums.fuwu_num;
 					this.dd = res.data.nums.order_num;
 					this.da = res.data.nums.pati_num;
+					
+					// tclist渲染服务包
+					this.tclist = res.data.fuwu_arr
 				}
 				
 			},
@@ -312,14 +308,25 @@
 			},
 			qr(e) {
 				if (this.inputbz != '') {
-					this.formshow = false
+					let res = this.$request.post("doctor/remacks",{
+						'id': this.user_id,
+						'remak': this.inputbz
+					});
+					if(res.status==0){
+						uni.showToast({
+							title:'设置成功!',
+							icon:"none"
+						})
+						this.formshow = false
+					}
+				
 				} else {
 					uni.showToast({
 						title: '请填写备注',
 						icon: 'none'
 					})
 					return false;
-					// let res = this.$request.post()
+					
 				}
 			}
 		}

+ 1 - 1
pages/zixun/zixun.vue

xqd
@@ -78,7 +78,7 @@
 <script>
 	export default {
 		onShow() {
-			this.getLists(this.num,this.value1,this.value2)
+			// this.getLists(this.num,this.value1,this.value2)
 		},
 		onLoad(e) {
 			// 获取列表