Sfoglia il codice sorgente

修改订单状态

yanjie 4 anni fa
parent
commit
a7eeea352c
3 ha cambiato i file con 78 aggiunte e 62 eliminazioni
  1. 7 7
      common/user.js
  2. 8 0
      pages/menzhen/menzhen.vue
  3. 63 55
      pages/menzhen/menzhenxq.vue

+ 7 - 7
common/user.js

xqd xqd
@@ -79,10 +79,10 @@ function loginByWeixinCode() {
  * 调用微信登录
  */
 function loginByWeixin(userInfo) {
-	console.log('接收到的信息:',userInfo);
+	console.log('接收到的信息:', userInfo);
 	return new Promise(function(resolve, reject) {
 		return login().then((res) => {
-	console.log('接收到then的信息:',res);
+			console.log('接收到then的信息:', res);
 			var code = res.code;
 			//登录远程服务器
 			request.post('common/wxLogin', {
@@ -91,18 +91,18 @@ function loginByWeixin(userInfo) {
 				"nickname": userInfo.nickName,
 				"avatar": userInfo.avatarUrl,
 			}).then(res => {
-				console.log('回调then的信息:',res);
+				console.log('回调then的信息:', res);
 				if (res.status == 0) {
-					
+
 					if (res.data.openid) {
 						// store.commit('setJwt', res.data.token);
 						// store.commit('setUser', res.data);
 						// store.commit('login');
 						resolve(res);
-					}else if(res.data.token){
-						
+					} else if (res.data.token) {
+
 						resolve(res);
-					}else {
+					} else {
 						reject(res);
 					}
 				} else {

+ 8 - 0
pages/menzhen/menzhen.vue

xqd
@@ -34,6 +34,14 @@
 						<view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #ff9294;margin-right: 20rpx;"></view>
 						<view style="color: #ff9294;font-size: 30rpx;font-weight:bold ;">已取消</view>
 					</view>
+					<view style="width: 70%;" v-if="item.zt == 6" class="flex align-center">
+						<view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #ff9294;margin-right: 20rpx;"></view>
+						<view style="color: #ff9294;font-size: 30rpx;font-weight:bold ;">已超时</view>
+					</view>
+					<view style="width: 70%;" v-if="item.zt == 7" class="flex align-center">
+						<view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #ff9294;margin-right: 20rpx;"></view>
+						<view style="color: #ff9294;font-size: 30rpx;font-weight:bold ;">已预约</view>
+					</view>
 				 
 					<view style="width: 30%;" class="flex align-center">
 						<view style="font-size: 28rpx;padding: 8rpx 24rpx;border-radius: 20rpx;background-color: #F6F6F6;">门诊预约</view>

+ 63 - 55
pages/menzhen/menzhenxq.vue

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -7,7 +7,7 @@
 				<view style="width: 25%;">订单号:</view>
 				<view style="width: 50%;">{{orderID}}</view>
 				<view style="width: 25%;" class="flex justify-center">
-					<view class="but" >门诊预约</view>
+					<view class="but">门诊预约</view>
 				</view>
 			</view>
 			<!-- 线 -->
@@ -55,12 +55,14 @@
 				<view class="right" v-else-if="zt==3">进行中</view>
 				<view class="right" v-else-if="zt==4">已完成</view>
 				<view class="right" v-else-if="zt==5">已取消</view>
+				<view class="right" v-else-if="zt==6">已超时</view>
+				<view class="right" v-else-if="zt==7">已预约</view>
 			</view>
 		</view>
 		<u-gap height="30" bg-color="#f6f6f6"></u-gap>
 		<!-- 底部按钮 -->
 		<!-- 当订单状态为未接单  zt==0 -->
-		<view class="bottomButton" v-if="zt <= 2">
+		<view class="bottomButton" v-if="zt == 2">
 			<!-- 左边的首页按钮 -->
 			<view style="width: 20%;" class="flex align-center justify-center">
 				<u-icon name="home" size="50" @click="home"></u-icon>
@@ -81,11 +83,11 @@
 			<!-- 右边的其他按钮 -->
 			<view style="width: 80%;" class="flex justify-end align-center">
 				<view class="b">
-					<u-button shape="circle" :custom-style="btStyle" @click="querenok" >确认完成</u-button>
+					<u-button shape="circle" :custom-style="btStyle" @click="querenok">确认完成</u-button>
 				</view>
 			</view>
 		</view>
-		<view class="bottomButton" v-else-if="zt > 3">
+		<view class="bottomButton" v-else-if="zt > 3&&zt!=7">
 			<!-- 左边的首页按钮 -->
 			<view style="width: 20%;" class="flex align-center justify-center">
 				<u-icon name="home" size="50" @click="home"></u-icon>
@@ -97,8 +99,8 @@
 				</view>
 			</view>
 		</view>
-		
-		
+
+
 	</view>
 </template>
 
@@ -106,25 +108,25 @@
 	export default {
 		onLoad(options) {
 			let ids = options.data;
-			if(ids!=''&&ids!=0){
+			if (ids != '' && ids != 0) {
 				this.xhrId = ids;
 				// 执行渲染
 				this.getInfos(ids);
-				
-			}else{
+
+			} else {
 				uni.showToast({
-					title:'请求错误',
-					icon:'none'
+					title: '请求错误',
+					icon: 'none'
 				})
 			}
-			console.log('详情:',options);
+			console.log('详情:', options);
 		},
 		mounted() {
 
 		},
 		data() {
 			return {
-				xhrId:0,
+				xhrId: 0,
 				// 上部数据
 				orderID: 'ZX202000010', //订单号
 
@@ -132,13 +134,13 @@
 				name: '', //名字
 				age: '', //年龄
 				ID: '', //身份证
-				appointment:'',
+				appointment: '',
 				//下部数据
 				placeTime: '', //下单时间
 				xiadankh: '', //下单客户
 				zt: 0, // 状态 0未履行 1已完成
-				local:'',
-				
+				local: '',
+
 				//下部按钮样式
 				bStyle: {
 					width: '100%',
@@ -155,19 +157,21 @@
 			}
 		},
 		methods: {
-			
+
 			/**
 			 * 详情渲染
 			 * @author Liu Yuanhang
 			 * @param {Object} id
 			 */
-			getInfos:async function(id){
-					// 获取信息
-			  let res = await this.$request.post("patient/orderPatientDetail",{patient_id:id});
-			  if(res.status==0){
-				    let datas = res.data;
-				    this.orderID = datas.order_sn;
-				    this.name = datas.name;
+			getInfos: async function(id) {
+				// 获取信息
+				let res = await this.$request.post("patient/orderPatientDetail", {
+					patient_id: id
+				});
+				if (res.status == 0) {
+					let datas = res.data;
+					this.orderID = datas.order_sn;
+					this.name = datas.name;
 					this.age = datas.numbirthday;
 					this.ID = datas.card_number;
 					this.appointment = datas.appoint_time;
@@ -175,63 +179,67 @@
 					this.xiadankh = datas.nickname;
 					this.zt = datas.order_status;
 					this.local = datas.organization;
-				
-			  }else{
-				  uni.showToast({
-				  	title:res.message,
-				  	duration:3000
-				  })
-				  return false;
-			  }
-			
+
+				} else {
+					uni.showToast({
+						title: res.message,
+						duration: 3000
+					})
+					return false;
+				}
+
 			},
-			
+
 			/**
 			 * 接单
 			 * @author Liu Yuanhang
 			 * @param {Object} e
 			 */
-			queren:async function(e) {
+			queren: async function(e) {
 				this.zt = 3;
-				let res  = await this.$request.post("patient/putOrderPatient",{order_id:this.xhrId});
-				console.log('接单:',res);
-				if(res.status==0){
+				let res = await this.$request.post("patient/putOrderPatient", {
+					order_id: this.xhrId
+				});
+				console.log('接单:', res);
+				if (res.status == 0) {
 					uni.showToast({
-						title:"接单成功!",
-						duration:3000
+						title: "接单成功!",
+						duration: 3000
 					})
-				}else{
+				} else {
 					uni.showToast({
-						title:res.message,
-						duration:3000
+						title: res.message,
+						duration: 3000
 					})
 				}
 			},
-			
+
 			/**
 			 * 门诊预约完成订单
 			 * @author Liu Yuanhang
 			 */
-			querenok:async function(){
+			querenok: async function() {
 				this.zt = 4;
-				let res  = await this.$request.post("patient/mzPatientok",{order_id:this.xhrId});
-				console.log('完成接单:',res);
-				if(res.status==0){
+				let res = await this.$request.post("patient/mzPatientok", {
+					order_id: this.xhrId
+				});
+				console.log('完成接单:', res);
+				if (res.status == 0) {
 					uni.showToast({
-						title:"操作成功!",
-						duration:3000
+						title: "操作成功!",
+						duration: 3000
 					})
-				}else{
+				} else {
 					uni.showToast({
-						title:res.message,
-						duration:3000
+						title: res.message,
+						duration: 3000
 					})
 				}
 				console.log('确认订单完成')
 			},
-			home(e){
+			home(e) {
 				uni.switchTab({
-					url:'/pages/index/index'
+					url: '/pages/index/index'
 				})
 			}
 		}