Просмотр исходного кода

提交了,希望告一段落

ltb2539 5 лет назад
Родитель
Сommit
09056230c1

+ 0 - 3
App.vue

xqd
@@ -1,8 +1,5 @@
 <script>
 	export default {
-		globalData: {
-			login: false
-		},
 		onLaunch: function() {
 			console.log('App Launch')
 		},

+ 42 - 92
pages/conversation/conversation.vue

xqd xqd xqd xqd
@@ -90,68 +90,55 @@
 			}
 		},
 		onShow() {
-			if (getApp().globalData.login) {
-				var i = 0;
-				while (i < 3) {
-					console.log('我是i', i);
-					if (typeof getApp().globalData.imService == 'undefined') {
-						let res = uni.getStorageSync('user');
-						getApp().globalData.imService = new IMService();
-						let loginResult = getApp().globalData.imService.login({
-							uuid: res.data.flag,
-							name: res.data.name,
-							avatar: res.data.avatar
-						});
-						if (loginResult) {
-							//连接IM
-							getApp().globalData.imService.connectIM();
-						}
-					} else {
-						break;
+			var i = 0;
+			while (i < 3) {
+				console.log('我是i', i);
+				if (typeof getApp().globalData.imService == 'undefined') {
+					let res = uni.getStorageSync('user');
+					getApp().globalData.imService = new IMService();
+					let loginResult = getApp().globalData.imService.login({
+						uuid: res.data.flag,
+						name: res.data.name,
+						avatar: res.data.avatar
+					});
+					if (loginResult) {
+						//连接IM
+						getApp().globalData.imService.connectIM();
 					}
-					i++;
+				} else {
+					break;
 				}
-
-				this.imService = getApp().globalData.imService;
-				this.imService.onConversationsUpdate = (conversations) => {
-					this.conversations = conversations;
-					this.setUnreadAmount();
-				};
-				var promise = this.imService.latestConversations();
-				promise.then(res => {
-					this.conversations = res.content;
-					console.log("conversations load successfully")
-					this.setUnreadAmount();
-					uni.hideLoading();
-				}).catch(e => {
-					console.log(e)
-				});
-				this.getcnversationList()
-			} else {
-				uni.showModal({
-					title: "提示",
-					content: "尚未登录,请前往登录",
-					confirmText: "去登录",
-					showCancel: false,
-					success() {
-						uni.navigateTo({
-							url: "../login/login"
-						})
-					}
-				})
+				i++;
 			}
 
+			this.imService = getApp().globalData.imService;
+			this.imService.onConversationsUpdate = (conversations) => {
+				this.conversations = conversations;
+				this.setUnreadAmount();
+			};
+			var promise = this.imService.latestConversations();
+			promise.then(res => {
+				this.conversations = res.content;
+				console.log("conversations load successfully")
+				this.setUnreadAmount();
+				uni.hideLoading();
+			}).catch(e => {
+				console.log(e)
+			});
+			this.getcnversationList()
 			// this.listPhone=[]
 
 		},
 		onLoad() {
 			this.getLists()
+			// console.log(this.imService.sendPrivateTextMessage())
+			// console.log(this.imService.getFrindList())
+
 		},
 		mounted() {},
 
 		data() {
 			return {
-				then: 0,
 				//控制聊天列表和通话记录
 				//false为通话记录,true为聊天列表
 				qiehuan: true,
@@ -168,44 +155,7 @@
 			}
 		},
 		methods: {
-			// 医生信息
-			getDocterInfo: async function() {
-				let res = await this.$request.post("doctor/doctorInfor", {}, false);
-				this.then = res.data.is_then
-				if (res.data.is_then != 1) {
-					uni.showModal({
-						title: "提示",
-						content: "请您先认证",
-						confirmText: "去认证",
-						showCancel: true,
-						success: function(res) {
-							if (res.confirm) {
-								uni.navigateTo({
-									url: '/pages/login/doctorRenzheng'
-								})
-							} else if (res.cancel) {
-								console.log('用户点击取消');
-							}
-						}
-					})
-				}
-			},
-			//通话列表
 			getLists: async function() {
-				if (!getApp().globalData.login) {
-					uni.showModal({
-						title: "提示",
-						content: "尚未登录,请前往登录",
-						confirmText: "去登录",
-						showCancel: false,
-						success() {
-							uni.navigateTo({
-								url: "../login/login"
-							})
-							return false
-						}
-					})
-				}
 				let res = await this.$request.post("Doctor/user_call");
 				if (res.status == 0) {
 					if (res.data.length != 0) {
@@ -217,7 +167,7 @@
 								name: data[i].user.nickname, //名字
 								remark: data[i].user.remark, //备注
 								date: data[i].user.dates, //日期
-								id: data[i].user.id
+								id:data[i].user.id
 								// id: data[i].user.id, //日期
 							})
 						}
@@ -270,16 +220,16 @@
 					url: urls
 				})
 			},
-			call(img, name, id, remark) {
+			call(img, name,id,remark) {
 				let callObject = {
-					img: img + '',
-					name: name + '',
-					id: id,
-					remark: remark
+					img: img+'',
+					name: name+'',
+					id:id,
+					remark:remark
 				}
 				// console.log(callObject)
 				uni.navigateTo({
-					url: 'call?callObject=' + JSON.stringify(callObject), //跳转页面不能传对象,只能转为字符串
+					url: 'call?callObject=' +  JSON.stringify(callObject),//跳转页面不能传对象,只能转为字符串
 				})
 			},
 			getcnversationList: async function() {

+ 85 - 48
pages/index/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -6,9 +6,14 @@
 			</view>
 			<view class="pr pt20" style="z-index:2">
 				<view class="plr15">
+
+
 					<!-- 登录切换 -->
-					<view v-if="true" class="m-bg-white bdr4 pb20 header-box" style="border-radius: 32rpx;">
-						<view class="plr20 pt20 m-dpflex m-justify-start " style="margin-bottom: 20rpx;">
+					<view class="m-bg-white bdr4 pb20 header-box" style="border-radius: 32rpx;">
+
+
+						<!-- 登录的时候,信息卡片显示 -->
+						<view class="plr20 pt20 m-dpflex m-justify-start " style="margin-bottom: 20rpx;" v-if="hasLogin">
 							<view>
 								<image binderror="_binderror" mode="scaleToFill" :src="src" style="width: 100rpx;height: 100rpx;border-radius: 50%;"></image>
 
@@ -19,12 +24,9 @@
 									<view v-if="hasLogin&&docterInfo.is_then!='1'" style="border-radius:30rpx ;font-size: 20rpx;padding: 10rpx 20rpx;background-color: #EEAA3F;color: #FFFFFF;position: relative;">未认证</view>
 									<view v-else-if="hasLogin&&docterInfo.is_then!='2'" style="border-radius:30rpx ;font-size: 20rpx;padding: 10rpx 20rpx;background-color: #84BB43;color: #FFFFFF;position: relative;">已认证</view>
 								</view>
-								<view style="color:#666666 ;font-size:22rpx;" v-if="hasLogin">
+								<view style="color:#666666 ;font-size:22rpx;">
 									{{docterInfo.sign}}
 								</view>
-								<view v-else @click="judgerenzheng" style="color: #007AFF;">
-									前去登录
-								</view>
 							</view>
 							<view class="pr tr m-flex" style="height: 100%;">
 								<navigator hoverClass="none">
@@ -32,10 +34,21 @@
 									 @click="grxx"></image>
 								</navigator>
 							</view>
-
 						</view>
+						<!-- 没登录显示 -->
+						<view v-else class="flex align-center justify-center" style="width: 100%;height: 200rpx;">
+							<view>
+								<view class="flex justify-center" style="margin-bottom: 10rpx;">
+									<image binderror="_binderror" mode="scaleToFill" :src="src" style="width: 100rpx;height: 100rpx;border-radius: 50%;"></image>
+								</view>
+								<view @click="judgerenzheng" style="color: #007AFF;font-size: 24rpx;">
+									立即登录 / 注册
+								</view>
+							</view>
+						</view>
+
 						<!-- 标签 -->
-						<view style="height: 60rpx;padding-left: 40rpx;padding-right: 40rpx;display: flex;">
+						<view style="height: 60rpx;padding-left: 40rpx;padding-right: 40rpx;display: flex;" v-if="hasLogin">
 							<view v-for="item,index in doctorlabel" :key="index">
 								<u-tag :show="index<4" style="margin-left: 10rpx;" :text="item.label_name" bg-color="#E5F5FF" color="#0B73B9"
 								 border-color="#ffffff" shape="circle " size="mini" />
@@ -52,15 +65,15 @@
 							</view>
 							<view bindtap="" class="m-flex tl f14 m-ycenter">
 								<view class="m-gray-big f20 fb">{{docterInfo.eva_num}}</view>
-								<view class="m-gray-letter mt5 f12">评价</view>
+								<view class="m-gray-letter mt5 f12">用户评价</view>
 							</view>
 							<view bindtap="" class="m-flex tl f14 m-ycenter">
 								<view class="m-gray-big f20 fb">{{docterInfo.score}}</view>
-								<view class="m-gray-letter mt5 f12">评分</view>
+								<view class="m-gray-letter mt5 f12">医生评分</view>
 							</view>
 						</view>
 					</view>
-					<view v-else class="m-bg-white bdr4 pb20 header-box" style="border-radius: 32rpx;">
+					<!-- <view v-else class="m-bg-white bdr4 pb20 header-box" style="border-radius: 32rpx;">
 						<view class="plr20 pt20 m-dpflex m-justify-start m-align-center">
 							<image binderror="_binderror" mode="scaleToFill" :src="nosrc" style="width: 60px;height: 60px;border-radius: 50%;"></image>
 							<view class="">
@@ -82,14 +95,14 @@
 							</view>
 							<view bindtap="" class="m-flex tl f14 m-ycenter">
 								<view class="m-gray-big f20 fb">0</view>
-								<view class="m-gray-letter mt5 f12">评价(张)</view>
+								<view class="m-gray-letter mt5 f12">用户评价</view>
 							</view>
 							<view bindtap="" class="m-flex tl f14 m-ycenter">
 								<view class="m-gray-big f20 fb">5.0</view>
-								<view class="m-gray-letter mt5 f12">评分</view>
+								<view class="m-gray-letter mt5 f12">医生评分</view>
 							</view>
 						</view>
-					</view>
+					</view> -->
 				</view>
 			</view>
 			<view class="padding-lr">
@@ -139,12 +152,12 @@
 				</view>
 			</view>
 			<view class="tltleStyle">
-				<view class="flex justify-between">
+				<view class="flex justify-between" v-if="hasLogin">
 					<u-section title="通知" font-size="40" :show-line="false" :bold="true" :right="false"></u-section>
 					<u-button size="mini" @click="allread" shape="circle">全部已读</u-button>
 				</view>
 			</view>
-			<view class="padding-lr">
+			<view class="padding-lr" v-if="hasLogin">
 				<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">
@@ -187,7 +200,7 @@
 			</view>
 			<view class="cu-tabbar-height"></view>
 		</view>
-		<view class="lianxiwomen" @click="lxwm">
+		<view class="lianxiwomen" @click="lxwm" v-if="hasLogin">
 			<view class="">
 				联系
 			</view>
@@ -273,8 +286,8 @@
 			this.getDocterMessage();
 
 			this.getStatus();
-			console.log('hasLogin',this.hasLogin)
-			getApp().globalData.text = this.hasLogin
+			console.log('hasLogin', this.hasLogin)
+			this.getlogin()
 		},
 		mounted() {
 
@@ -301,12 +314,13 @@
 					this.docterInfo.service_days = res.data.service_days;
 					this.docterInfo.service_persons = res.data.service_persons;
 					this.setPassword()
+
 					console.log('医生信息', res.data)
 				}
 			},
 			// 跳到新增密码
 			setPassword() {
-				if (this.password != '' || this.password != null) {
+				if (this.password == '' || this.password == null) {
 					uni.showModal({
 						content: '您未设置密码,为了保证账户安全,建议前去设置密码',
 						confirmText: '前去设置',
@@ -321,6 +335,20 @@
 					})
 				}
 			},
+			//判断有没有登录,然后执行
+			getlogin() {
+				// getApp().globalData.login = this.hasLogin
+				if (!this.hasLogin) {
+					console.log("没有登录,屏蔽会话")
+					uni.hideTabBar({
+						animation: false
+					})
+				} else {
+					uni.showTabBar({
+						animation: true
+					})
+				}
+			},
 			//通知数据
 			getDocterMessage: async function() {
 
@@ -427,7 +455,7 @@
 			 * @param {Object} e
 			 */
 			navt(e) {
-
+				console.log("点击了订单", e)
 				this.readTong(e.id);
 				e.status = 2;
 				// 1.确认接单通知 2.订单逾期通知 3.订单完成通知 4.评价通知 5.服务包通知 
@@ -444,9 +472,15 @@
 							title: '错误!'
 						})
 					}
-					uni.navigateTo({
-						url: '/pages/zixun/xiangqing?data=' + id
-					})
+					if (e.order_type == 3) {
+						uni.navigateTo({
+							url: '/pages/menzhen/menzhenxq?data=' + id
+						})
+					} else {
+						uni.navigateTo({
+							url: '/pages/zixun/xiangqing?data=' + id
+						})
+					}
 				} else if (e.type == 2) {
 					// 2.订单逾期通知 跳转订单详情
 					id = e.relation_id
@@ -457,9 +491,15 @@
 							title: '错误!'
 						})
 					}
-					uni.navigateTo({
-						url: '/pages/zixun/xiangqing?data=' + id
-					})
+					if (e.order_type == 3) {
+						uni.navigateTo({
+							url: '/pages/menzhen/menzhenxq?data=' + id
+						})
+					} else {
+						uni.navigateTo({
+							url: '/pages/zixun/xiangqing?data=' + id
+						})
+					}
 				} else if (e.type == 3) {
 					// 2.订单完成通知 跳转订单详情
 					id = e.relation_id
@@ -470,9 +510,15 @@
 							title: '错误!'
 						})
 					}
-					uni.navigateTo({
-						url: '/pages/zixun/xiangqing?data=' + id
-					})
+					if (e.order_type == 3) {
+						uni.navigateTo({
+							url: '/pages/menzhen/menzhenxq?data=' + id
+						})
+					} else {
+						uni.navigateTo({
+							url: '/pages/zixun/xiangqing?data=' + id
+						})
+					}
 				} else if (e.type == 4) {
 					// 4.评价通知 跳转评价详情
 					id = e.relation_id
@@ -581,11 +627,14 @@
 						title: "提示",
 						content: "尚未登录,请前往登录",
 						confirmText: "去登录",
-						showCancel: false,
-						success() {
-							uni.navigateTo({
-								url: "../login/login"
-							})
+						showCancel: true,
+						success(res) {
+							if (res.confirm) {
+								uni.navigateTo({
+									url: "../login/login"
+								})
+							}
+
 						}
 					})
 					return false;
@@ -723,19 +772,7 @@
 			},
 			//点击认证中心
 			gorz() {
-				if (!this.hasLogin) {
-					uni.showModal({
-						title: "提示",
-						content: "尚未登录,请前往登录",
-						confirmText: "去登录",
-						showCancel: false,
-						success() {
-							uni.navigateTo({
-								url: "../login/login"
-							})
-						}
-					})
-				} else {
+				if (this.judgerenzheng()) {
 					uni.navigateTo({
 						url: '/pages/login/doctorRenzheng'
 					})

+ 36 - 19
pages/information/modifypassword.vue

xqd xqd
@@ -27,7 +27,8 @@
 		},
 		data() {
 			return {
-				state:0,//判断状态,如果有密码就显示原密码框
+				//0没有有密码 
+				state: 0, //判断状态,如果有密码就显示原密码框
 				//原密码
 				value1: '',
 				//新密码
@@ -38,50 +39,66 @@
 		},
 		methods: {
 			//失去焦点事件
-			blur1({detail}) {
+			blur1({
+				detail
+			}) {
 				console.log(detail.value)
 				this.value1 = detail.value
 			},
-			blur2({detail}) {
+			blur2({
+				detail
+			}) {
 				console.log(detail.value)
 				this.value2 = detail.value
 			},
-			blur3({detail}) {
+			blur3({
+				detail
+			}) {
 				console.log(detail.value)
 				this.value3 = detail.value
 			},
 			//保存按钮
-			bc:async function(e) {
+			bc: async function(e) {
 				console.log(this.value1)
 				console.log(this.value2)
 				console.log(this.value3)
-				if(this.value2!=this.value3){
+				console.log(this.value1.length,this.value2.size,this.value3)
+				if (this.value2 != this.value3) {
 					console.log('密码不相同')
 					uni.showToast({
-						title:'密码不相同',
-						icon:'none'
+						title: '密码不相同',
+						icon: 'none'
+					})
+				} else if(this.value2.length <6){
+					uni.showToast({
+						title: '密码必须为六个字符以上',
+						icon: 'none'
 					})
 				}else{
-					let res = await this.$request.post('doctor/passwordEdit',{'lis':this.value1,'newpassword':this.value3});
-					if(res.status==0){
+					
+					let res = await this.$request.post('doctor/passwordEdit', {
+						'lis':  this.state != 0 ?"123":this.value1,
+						'newpassword': this.value3
+					});
+					if (res.status == 0) {
 						uni.showToast({
-						    title: "修改成功",
-						    duration: 2000,
-							icon:'none'
+							title: "修改成功",
+							duration: 2000,
+							icon: 'none'
 						});
 						uni.switchTab({
 							url: '/pages/index/index'
 						})
-					}else{
+					} else {
 						uni.showToast({
-						    title: res.message,
-						    duration: 2000,
-							icon:'none'
+							title: res.message,
+							duration: 2000,
+							icon: 'none'
 						});
 					}
 				}
-				
-				
+
+
 			}
 		}
 	}

+ 28 - 30
pages/login/login.vue

xqd xqd
@@ -48,40 +48,42 @@
 			<!-- 登录 -->
 			<u-button @click="startReg()" type="primary" shape="circle" :loading="isRotate" :custom-style="customStyle">登录</u-button>
 
+
+
+
 			<view class="flex align-center justify-between" style="margin: 70rpx 0 100rpx 0;">
-				<button :class="" open-type="getUserInfo" style="box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.08);border-radius: 60rpx;border: 0.3rpx solid #dedede;"
-				 @getuserinfo="getinfo">
-					<view :class="rotate_loop" style="font-size: 30rpx;color: #84BB43;">
-						<slot name="text">微信授权一键登录</slot>
-					</view>
-				</button>
-				<button @click="toindex()"  style="width: 45%;font-size: 30rpx;border-radius: 60rpx;box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.08);border: 0.3rpx solid #dedede;color: #7a7a7a;"  :custom-style="customStyle" :class="buttonBorder">暂不登录</button>
-			</view>
-			<!-- <view class="flex align-center justify-between" style="margin: 70rpx 0 100rpx 0;">
-				<u-button open-type="getUserInfo" @getuserInfo="getinfo" shape="circle" style="width: 50%;font-size: 30rpx;color:#84BB43;" :custom-style="customStyle"
-				 hair-line="false">微信授权一键登录</u-button>
-				<u-button @click="toindex()" shape="circle" style="width: 45%;font-size: 30rpx;" hair-line="false">暂不登录</u-button>
-			</view> -->
-			<view class="flex align-center justify-between">
 				<view style="width: 50%;text-align: center;">
 					<text style="text-decoration:underline; color: #666666;" @click="goreg">注册账号</text>
 				</view>
 				<view style="width: 50%;text-align: center;">
-					<text style="text-decoration:underline ; color: #666666;" @click="ispwd">{{ispwdlogin?'验证码':'手机号密码'}}登录</text>
+					<text style="text-decoration:underline ; color: #666666;" @click="ispwdlogin = !ispwdlogin">{{ispwdlogin?'验证码':'手机号密码'}}登录</text>
 				</view>
 			</view>
+
+
+			<view class="flex align-center justify-center" style="margin-top: 100rpx;">
+				<button size="default" :class="" style="box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.08);border-radius: 60rpx;border: 0.3rpx solid #dedede;margin: 0;width: 80%;"
+				 open-type="getUserInfo" @getuserinfo="getinfo" >
+					<view :class="rotate_loop" style="font-size: 28rpx;color: #84BB43;">
+						<slot name="icon">
+							<u-icon name="weixin-fill" style="margin-right: 20rpx;" size="30"></u-icon>
+						</slot>
+						<slot name="text">微信授权一键登录</slot>
+					</view>
+				</button>
+
+			</view>
 		</view>
 		<u-popup v-model="show" mode="center" :mask-close-able="false" border-radius="16">
-		   <view style="width: 500rpx;height: 400rpx;position: relative;" class="flex flex-direction align-center justify-center">
-		    <view class="text-xl text-bold" style="position: absolute;top:30rpx">
-		     提示
-		    </view>
-		    <view class="text-gray margin-top-sm text-lg">
-		     请授权手机号方便注册!
-		    </view>
-		    <button open-type="getPhoneNumber" style="width: 100%;font-size: 32rpx;position: absolute;bottom: 0;"
-		     @getphonenumber="getPhoneNumber">确认授权</button>
-		   </view>
+			<view style="width: 500rpx;height: 400rpx;position: relative;" class="flex flex-direction align-center justify-center">
+				<view class="text-xl text-bold" style="position: absolute;top:30rpx">
+					提示
+				</view>
+				<view class="text-gray margin-top-sm text-lg">
+					请授权手机号方便注册!
+				</view>
+				<button style="width: 100%;font-size: 32rpx;position: absolute;bottom: 0;" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">确认授权</button>
+			</view>
 		</u-popup>
 	</view>
 </template>
@@ -349,11 +351,7 @@
 					_this.isRotate = false
 				}, 3000)
 			},
-			toindex() {
-				uni.switchTab({
-					url: "../index/index"
-				})
-			},
+			
 			goreg() {
 				uni.navigateTo({
 					url: "./reg"

+ 2 - 2
pages/scheduling/month_Scheduling.vue

xqd
@@ -275,9 +275,9 @@
 					for (let x = 0; x < this.monthList.length - this.empty; x++) {
 						this.monthList[x + this.empty].mon = this.schedulingList[x].mon == "0" ? 0 : this.schedulingList[x].mon == this.hospitalID&&this.overdue(x) ?
 							1 : 2
-						this.monthList[x + this.empty].aft = this.schedulingList[x].aft == "0" ? 0 : this.schedulingList[x].aft == this.hospitalID ?
+						this.monthList[x + this.empty].aft = this.schedulingList[x].aft == "0" ? 0 : this.schedulingList[x].aft == this.hospitalID&&this.overdue(x) ?
 							1 : 2
-						this.monthList[x + this.empty].nig = this.schedulingList[x].nig == "0" ? 0 : this.schedulingList[x].nig == this.hospitalID ?
+						this.monthList[x + this.empty].nig = this.schedulingList[x].nig == "0" ? 0 : this.schedulingList[x].nig == this.hospitalID&&this.overdue(x)  ?
 							1 : 2
 					}