Kaynağa Gözat

修复若干bug

yanjie 4 yıl önce
ebeveyn
işleme
b3cfbc0b8c

+ 60 - 54
components/GoEasyAudioPlayer/GoEasyAudioPlayer.vue

xqd
@@ -1,63 +1,69 @@
 <template>
-    <div class="goeasy-audio-player" @click="playAudio">
-        <div class="audio-facade" :style="{width:Math.ceil(duration)*7 + 50 + 'px'}">
-            <div class="audio-facade-bg" :class="{'play-icon':play}"> </div>
-            <div>{{Math.ceil(duration) || 1}}</div>
-        </div>
-    </div>
+	<div class="goeasy-audio-player" @click="playAudio">
+		<div class="audio-facade" :style="{width:Math.ceil(duration)*7 + 50 + 'px'}">
+			<div class="audio-facade-bg" :class="{'play-icon':play}"> </div>
+			<div>{{Math.ceil(duration) || 1}}</div>
+		</div>
+	</div>
 </template>
 
 <script>
-    const innerAudioContext = uni.createInnerAudioContext();
-    export default {
-        name: "GoEasyAudioPlayer",
-        props : ['src', 'duration'],
-        data () {
-            return {
-                play : false
-            }
-        },
-        methods : {
-            playAudio () {
-                this.play = true;
-                innerAudioContext.src = this.src;
-                innerAudioContext.play();
-                setTimeout(() => {
-                    this.play = false;
-                }, this.duration*1000)
-            }
-        }
-    }
+	const innerAudioContext = uni.createInnerAudioContext();
+	export default {
+		name: "GoEasyAudioPlayer",
+		props: ['src', 'duration'],
+		data() {
+			return {
+				play: false
+			}
+		},
+		methods: {
+			playAudio() {
+				wx.setInnerAudioOption({
+					obeyMuteSwitch: false
+				})
+				this.play = true;
+				innerAudioContext.src = this.src;
+				innerAudioContext.play();
+				setTimeout(() => {
+					this.play = false;
+				}, this.duration * 1000)
+			}
+		}
+	}
 </script>
 
 <style scoped>
-    .goeasy-audio-player{
-        margin-top: 12rpx;
-        -webkit-tap-highlight-color:rgba(0,0,0,0);
-    }
-    .audio-facade{
-        min-width: 20rpx;
-        padding: 6rpx 10rpx;
-        height: 72rpx;
-        background: #618DFF;
-        font-size: 24rpx;
-        border-radius: 14rpx;
-        color: #ffffff;
-        display: flex;
+	.goeasy-audio-player {
+		margin-top: 12rpx;
+		-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+	}
+
+	.audio-facade {
+		min-width: 20rpx;
+		padding: 6rpx 10rpx;
+		height: 72rpx;
+		background: #618DFF;
+		font-size: 24rpx;
+		border-radius: 14rpx;
+		color: #ffffff;
+		display: flex;
 		align-items: center;
-    }
-    .audio-facade-bg{
-        background: url("./images/voice.png") no-repeat center;
-        background-size: 30rpx;
-        width: 40rpx;
+	}
+
+	.audio-facade-bg {
+		background: url("./images/voice.png") no-repeat center;
+		background-size: 30rpx;
+		width: 40rpx;
 		height: 100%;
-    }
-    .audio-facade-bg.play-icon{
-        background: url("./images/play.gif") no-repeat center;
-        background-size: 30rpx;
-        -moz-transform:rotate(180deg);
-        -webkit-transform:rotate(180deg);
-        -o-transform:rotate(180deg);
-        transform:rotate(180deg);
-    }
-</style>
+	}
+
+	.audio-facade-bg.play-icon {
+		background: url("./images/play.gif") no-repeat center;
+		background-size: 30rpx;
+		-moz-transform: rotate(180deg);
+		-webkit-transform: rotate(180deg);
+		-o-transform: rotate(180deg);
+		transform: rotate(180deg);
+	}
+</style>

+ 8 - 1
components/datepicker/datepicker.vue

xqd xqd
@@ -16,7 +16,7 @@
 							预约时间:
 						</view>
 						<view class="margin-top-sm">{{itm.start_time_period}} - {{itm.end_time_period}}</view>
-						<view class="margin-top-sm text-blue text-sm">
+						<view :class="itm.can_appoint_num==0?'margin-top-sm text-gray text-sm':'margin-top-sm text-blue text-sm'">
 							可预约号源:{{itm.can_appoint_num}}
 						</view>
 					</u-grid-item>
@@ -69,6 +69,13 @@
 					})
 					return false
 				}
+				if (itm.can_appoint_num == 0) {
+					uni.showToast({
+						title: "已无号源可预约",
+						icon: "none"
+					})
+					return false
+				}
 				if (this.year != "") {
 					itm.year = this.year
 				}

+ 4 - 2
pages.json

xqd xqd
@@ -325,7 +325,8 @@
 				{
 					"path": "my_consulting/my_appointment",
 					"style": {
-						"navigationBarTitleText": "我的预约"
+						"navigationBarTitleText": "我的预约",
+						"enablePullDownRefresh": true
 					}
 				}, {
 					"path": "my_consulting/conversation",
@@ -343,7 +344,8 @@
 				{
 					"path": "my_consulting/my_consulting",
 					"style": {
-						"navigationBarTitleText": "我的咨询"
+						"navigationBarTitleText": "我的咨询",
+						"enablePullDownRefresh": true
 					}
 				},
 				{

+ 1 - 1
pages/archives/add_archives.vue

xqd
@@ -286,7 +286,7 @@
 				let res = await this.$request.post("/api/v1/patient/createPatient", {
 					name: this.name,
 					sex: num,
-					avatar: this.touxiang,
+					avatar: this.touxiang==''?this.imgList[0]:this.touxiang,
 					birthday: this.date,
 					relationship_type: this.guanxiindex,
 					card_type: 1,

+ 24 - 27
pages/childcare/child_care.vue

xqd
@@ -190,46 +190,43 @@
 						this.is_Scheduling = false
 						return false
 					}
-					let nian = res.data.data.map(item => {
-						return {
-							date: item.schedule_date,
-							id: item.id
+					let nian = res.data.data.map((item,index) => {
+						if (item.schedule_period.length != 0) {
+							return {
+								date: item.schedule_date,
+								id: item.id
+							}
 						}
 					})
 					res.data.data.forEach(item => {
-						let time = item.schedule_period.map(itm => {
-							if (item.id == itm.schedule_id) {
-								itm.organization.org_id = itm.organization['id']
-								return {
-									yeardate:itm.schedule_date,
-									schedule_id: itm.schedule_id,
-									can_appoint_num: itm.can_appoint_num,
-									...itm.organization,
-									...itm.time_period
+						if (item.schedule_period.length != 0) {
+							let time = item.schedule_period.map(itm => {
+								if (item.id == itm.schedule_id) {
+									if (itm.time_period != null) {
+										itm.organization.org_id = itm.organization['id']
+										return {
+											yeardate: itm.schedule_date,
+											schedule_id: itm.schedule_id,
+											can_appoint_num: itm.can_appoint_num,
+											...itm.organization,
+											...itm.time_period
+										}
+									}
 								}
-							}
-						})
-						times.push(time)
+							})
+							time = time.filter(item => item !== undefined)
+							times.push(time)
+						}
 					})
 					// time[0].forEach(item => {
 					// 	item.start_time_period = item.start_time_period + '-' + item.end_time_period
 					// })
+					nian = nian.filter(item => item !== undefined)
 					this.multiSelector.push(nian)
-					// time[0].sort((a,b)=> {return a.end_time_period>b.end_time_period?1:-1})
 					times.forEach(item => {
 						item.sort((a, b) => {
 							return a.end_time_period > b.end_time_period ? 1 : -1
 						})
-						// for (let i = item.length - 1; i >= 0; i--) {
-						// 	let arr = item[i].yeardate + " " + item[i].end_time_period;
-						// 	arr = arr.split(/[- :]/)
-						// 	let nndate = Date.parse(new Date(arr[0], arr[1] - 1, arr[2], arr[3], arr[4]));
-						// 	let currentTime = Date.parse(new Date())
-						// 	// console.log(nndate<currentTime,index)
-						// 	if (nndate < currentTime) {
-						// 		item.splice(i, 1)
-						// 	}
-						// }
 					})
 					this.multiSelector.push(times)
 					let arr = this.multiSelector[1][0]

+ 10 - 10
pages/common_tools/my_consulting/consultingInfo.vue

xqd xqd xqd
@@ -41,11 +41,11 @@
 			<view class="text-gray margin-top-xs padding-tb-xs">
 				<text class="text-leftstyle">下单时间:</text><text class="font_style">{{orderInfo.created_at}}</text>
 			</view>
-			<view class="text-gray margin-top-xs padding-tb-xs">
-				<text class="text-leftstyle">结束时间:</text><text class="font_style">{{outtime}}</text>
+			<view class="text-gray margin-top-xs padding-tb-xs" v-if="orderInfo.end_time!=0">
+				<text class="text-leftstyle">结束时间:</text><text class="font_style">{{formatDate(orderInfo.end_time * 1000)}}</text>
 			</view>
 			<view class="text-gray margin-top-xs padding-tb-xs" v-if="orderInfo.product_type==1">
-				<text class="text-leftstyle">咨询时长:</text><text class="font_style">{{parseInt(orderInfo.consult_duration/60)}}分钟</text>
+				<text class="text-leftstyle">咨询时长:</text><text class="font_style">{{orderInfo.consult_duration}}秒</text>
 			</view>
 			<view class="text-gray margin-top-xs padding-tb-xs">
 				<text class="text-leftstyle">咨询患者:</text><text class="font_style">{{orderInfo.order_patient.name}}</text>
@@ -58,7 +58,7 @@
 		<view class="cu-tabbar-height"></view>
 		<view class="cu-bar bg-white tabbar" v-if="orderInfo.order_status==4&&orderInfo.product_type==2" style="position: fixed;bottom: 0;width: 100%;display: flex;justify-content: flex-end;height: 108rpx;">
 			<u-button shape="circle" :custom-style="customStyle" @click="gotochat" :ripple="true">咨询会话</u-button>
-			<u-button shape="circle" :custom-style="customStyle" @click="gotopinjia" :ripple="true">评价</u-button>
+			<u-button shape="circle" :custom-style="customStyle" @click="gotopinjia" :ripple="true">查看评价</u-button>
 			<u-button shape="circle" :custom-style="customStylebtn" @click="gosuggest" :ripple="true">意见单</u-button>
 		</view>
 		<view class="cu-bar bg-white tabbar" v-else-if="orderInfo.order_status==3" style="position: fixed;bottom: 0;width: 100%;">
@@ -114,17 +114,17 @@
 				if (res.status == 0) {
 					this.orderInfo = res.data
 					console.log(this.orderInfo)
-					this.outtime = this.formatDate(this.orderInfo.outtime * 1000)
+					// this.outtime = this.formatDate(this.orderInfo.end_time * 1000)
 				}
 			},
 			gotochat() {
 				if (this.orderInfo.product_type == 1) {
-					if(this.orderInfo.callback_phone == ''){
+					if (this.orderInfo.callback_phone == '') {
 						uni.showModal({
-							title:"提示",
-							content:"回拨需等首次医生拨打后才可回拨",
-							showCancel:false,
-							confirmText:"知道了",
+							title: "提示",
+							content: "回拨需等首次医生拨打后才可回拨",
+							showCancel: false,
+							confirmText: "知道了",
 						})
 						return false
 					}

+ 8 - 1
pages/common_tools/my_consulting/my_appointment.vue

xqd xqd
@@ -29,7 +29,8 @@
 						<text class="text_style" v-for="(itm,idx) in item.docter.label_texts" :key="index">{{itm.label_name}}</text>
 					</view>
 					<view class="textstyle margin-top-xs flex align-center justify-between">
-						<text style="color: #333333;" v-if="item.product_type==3">科室:{{item.docter.office.name||'暂无'}} {{item.docter.qualification.name||'暂无'}}</text>
+						<text style="color: #333333;" v-if="item.product_type==3">科室:{{item.docter.office.name||'暂无'}}
+							{{item.docter.qualification.name||'暂无'}}</text>
 					</view>
 					<view class="textstyle margin-top-xs flex align-center justify-between">
 						<text style="color: #333333;">编号:{{item.order_sn}}</text>
@@ -119,6 +120,12 @@
 				textcontent: ""
 			}
 		},
+		onPullDownRefresh() {
+			this.pageindex = 1
+			this.ordersList = []
+			this.getordersList()
+			uni.stopPullDownRefresh()
+		},
 		methods: {
 			format(t) {
 				let time = new Date(t);

+ 7 - 1
pages/common_tools/my_consulting/my_consulting.vue

xqd xqd
@@ -73,7 +73,7 @@
 
 		},
 		onShow() {
-			console.log(uni.getStorageSync('user').flag,typeof uni.getStorageSync('user').flag)
+			console.log(uni.getStorageSync('user').flag, typeof uni.getStorageSync('user').flag)
 			if (getApp().globalData.imService == null) {
 				let user = uni.getStorageSync('user')
 				getApp().globalData.imService = new IMService();
@@ -157,6 +157,12 @@
 		onReachBottom() {
 			this.getordersList()
 		},
+		onPullDownRefresh() {
+			this.pageindex = 1
+			this.ordersList = []
+			this.getordersList()
+			uni.stopPullDownRefresh()
+		},
 		methods: {
 			evaluate(item, index) {
 				this.showpinjia = true

+ 29 - 19
pages/doctor_related/doctor_info.vue

xqd xqd xqd xqd xqd xqd
@@ -187,7 +187,7 @@
 				isphone: false,
 				istuwen: false,
 				ismenzhen: false,
-				loading: true,
+				loading: false,
 				is_can_appoint: "",
 				dateshow: false,
 				is_date_obsolete: "",
@@ -197,6 +197,7 @@
 		},
 		methods: {
 			getdoctorInfo: async function() {
+				this.loading = true
 				let res = await this.$request.post("/api/v1/docter/docterDetail", {
 					docter_id: this.doctorid,
 					latitude: uni.getStorageSync("latitude"),
@@ -204,7 +205,7 @@
 				})
 				console.log(res)
 				if (res) {
-					this.loading = false;
+					this.loading = false
 				}
 				this.doctor = res
 				this.doctor.is_chat != 0 ? this.istuwen = false : this.istuwen = true
@@ -277,26 +278,36 @@
 
 						let times = []
 						let nian = res.data.data.map(item => {
-							return {
-								date: item.schedule_date,
-								id: item.id
+							if (item.schedule_period.length != 0) {
+								return {
+									date: item.schedule_date,
+									id: item.id
+								}
 							}
 						})
 						res.data.data.forEach(item => {
-							let time = item.schedule_period.map(itm => {
-								if (item.id == itm.schedule_id) {
-									itm.organization.org_id = itm.organization['id']
-									return {
-										yeardate: itm.schedule_date,
-										schedule_id: itm.schedule_id,
-										can_appoint_num: itm.can_appoint_num,
-										...itm.organization,
-										...itm.time_period
+							if (item.schedule_period.length != 0) {
+								let time = item.schedule_period.map(itm => {
+									if (item.id == itm.schedule_id) {
+										if (itm.time_period != null) {
+											itm.organization.org_id = itm.organization['id']
+											return {
+												yeardate: itm.schedule_date,
+												schedule_id: itm.schedule_id,
+												can_appoint_num: itm.can_appoint_num,
+												...itm.organization,
+												...itm.time_period
+											}
+										}
+
 									}
-								}
-							})
-							times.push(time)
+								})
+								time = time.filter(item => item !== undefined)
+								times.push(time)
+							}
+
 						})
+						nian = nian.filter(item => item !== undefined)
 						this.multiSelector.push(nian)
 						times.forEach((item, index) => {
 							item.sort((a, b) => {
@@ -313,7 +324,6 @@
 							// 	}
 							// }
 						})
-						console.log(times)
 						this.multiSelector.push(times)
 						this.daytime = this.multiSelector[0][0].date + " " + this.multiSelector[1][0][0].start_time_period + "-" + this.multiSelector[
 							1][0][0].end_time_period
@@ -337,7 +347,7 @@
 							item.year = nian[0].date
 						})
 						this.$refs.date.rightday = arr
-						console.log(this.multiSelector)
+						
 					}
 				}
 			},

+ 5 - 1
pages/index/message.vue

xqd xqd
@@ -145,7 +145,7 @@
 			gotoliaotian(item) {
 				// this.getNodes()
 				console.log(item)
-				if (item.type == 1 || item.type == 4) {
+				if (item.type == 1 || item.type == 4&&item.product_type == 1||item.type == 4&&item.product_type == 2) {
 					uni.navigateTo({
 						url: "../common_tools/my_consulting/consultingInfo?id=" + item.relation_id
 					})
@@ -170,6 +170,10 @@
 							url: "../common_tools/my_consulting/conversation?doctor=" + JSON.stringify(obj) + "&doctorstatus=" + 3
 						})
 					})
+				}else if(item.type == 1 || item.type == 4&&item.product_type == 3||item.type == 4&&item.product_type == 4||item.type == 4&&item.product_type == 5){
+					uni.navigateTo({
+						url: "../common_tools/my_consulting/my_appointment"
+					})
 				}
 			}
 		}

+ 11 - 1
pages/login/login.vue

xqd xqd
@@ -201,11 +201,21 @@
 							phone: this.phoneData,
 							verify_code: this.verCode
 						}).then(res => {
+							console.log(res)
 							if (res.status == 0) {
 								if (res.data.token) {
 									store.commit('setJwt', res.data.token);
 									store.commit('setUser', res.data);
 									store.commit('login');
+									let loginResult = getApp().globalData.imService.login({
+										flag: "member_" + res.data.id,
+										nickname: res.data.nickname,
+										avatar: res.data.avatar
+									});
+									if (loginResult) {
+										//连接IM
+										getApp().globalData.imService.connectIM();
+									}
 									uni.showToast({
 										title: "登录成功",
 										icon: "none"
@@ -219,7 +229,7 @@
 							} else {
 								uni.showToast({
 									title: res.message,
-									icon:"none"
+									icon: "none"
 								})
 								_this.isRotate = false
 							}

+ 10 - 1
pages/order/payment.vue

xqd
@@ -319,7 +319,16 @@
 				}
 			},
 			collectCoupons(item, index) {
-				
+				let status = item.coupon_type.some((item, index) => {
+					return item.product_type == this.infodata.product_type
+				})
+				if (!status) {
+					uni.showToast({
+						title: "不支持该类型产品",
+						icon: "none"
+					})
+					return false
+				}
 				this.norderAmount = this.infodata.total_amount
 				this.orderAmount = this.infodata.total_amount
 				if (item.type == 1) {

+ 52 - 41
pages/vaccines/vaccines_info.vue

xqd xqd xqd
@@ -191,29 +191,39 @@
 					// this.multiSelector.push(time[0])
 					// console.log(this.multiSelector)
 					let nian = res.data.data.map(item => {
-						return {
-							date: item.schedule_date,
-							id: item.id
+						if (item.schedule_period.length != 0) {
+							return {
+								date: item.schedule_date,
+								id: item.id
+							}
 						}
+
 					})
 					res.data.data.forEach(item => {
-						let time = item.schedule_period.map(itm => {
-							if (item.id == itm.schedule_id) {
-								itm.organization.org_id = itm.organization['id']
-								return {
-									yeardate: itm.schedule_date,
-									schedule_id: itm.schedule_id,
-									can_appoint_num: itm.can_appoint_num,
-									...itm.organization,
-									...itm.time_period
+						if (item.schedule_period.length != 0) {
+							let time = item.schedule_period.map(itm => {
+								if (item.id == itm.schedule_id) {
+									if (itm.time_period != null) {
+										itm.organization.org_id = itm.organization['id']
+										return {
+											yeardate: itm.schedule_date,
+											schedule_id: itm.schedule_id,
+											can_appoint_num: itm.can_appoint_num,
+											...itm.organization,
+											...itm.time_period
+										}
+									}
 								}
-							}
-						})
-						times.push(time)
+							})
+							time = time.filter(item => item !== undefined)
+							times.push(time)
+						}
+
 					})
 					// time[0].forEach(item => {
 					// 	item.start_time_period = item.start_time_period + '-' + item.end_time_period
 					// })
+					nian = nian.filter(item => item !== undefined)
 					this.multiSelector.push(nian)
 					// time[0].sort((a,b)=> {return a.end_time_period>b.end_time_period?1:-1})
 					times.forEach(item => {
@@ -231,6 +241,7 @@
 						// 	}
 						// }
 					})
+					console.log(times)
 					this.multiSelector.push(times)
 					let arr = this.multiSelector[1][0]
 					arr.forEach(item => {
@@ -320,41 +331,41 @@
 				let obj = {
 					product_type: 4,
 					patient_id: this.huanzheID,
-					total_amount: this.yimiaoInfo.price / 100,
+					total_amount: 0,
 					organization_id: this.doctor.id,
 					schedule_date: this.time,
 					time_period_id: this.timehour,
 					vaccine_id: this.yimiaoInfo.id,
 					payment_type: 2
 				}
-				if ((this.yimiaoInfo.price / 100) == 0) {
-					let res = await this.$request.post("/api/v1/order/appointPlaceOrder", {
-						product_type: obj.product_type,
-						patient_id: obj.patient_id,
-						total_amount: obj.total_amount * 100,
-						organization_id: obj.organization_id,
-						schedule_date: obj.schedule_date,
-						time_period_id: obj.time_period_id,
-						vaccine_id: obj.vaccine_id,
-						payment_type: obj.payment_type,
+				// if ((this.yimiaoInfo.price / 100) == 0) {
+				let res = await this.$request.post("/api/v1/order/appointPlaceOrder", {
+					product_type: obj.product_type,
+					patient_id: obj.patient_id,
+					total_amount: 0,
+					organization_id: obj.organization_id,
+					schedule_date: obj.schedule_date,
+					time_period_id: obj.time_period_id,
+					vaccine_id: obj.vaccine_id,
+					payment_type: obj.payment_type,
+				})
+				if (res.status == 0) {
+					uni.showToast({
+						title: "提交成功!",
+						icon: "none",
+						duration: 1000
 					})
-					if (res.status == 0) {
-						uni.showToast({
-							title: "提交成功!",
-							icon: "none",
-							duration: 1000
+					setTimeout(() => {
+						uni.redirectTo({
+							url: "../order/order?type=" + obj.product_type
 						})
-						setTimeout(() => {
-							uni.redirectTo({
-								url: "../order/order?type=" + obj.product_type
-							})
-						}, 1000)
-					}
-				} else {
-					uni.navigateTo({
-						url: "../order/payment?data=" + JSON.stringify(obj)
-					})
+					}, 1000)
 				}
+				// } else {
+				// 	uni.navigateTo({
+				// 		url: "../order/payment?data=" + JSON.stringify(obj)
+				// 	})
+				// }
 			},
 			gotodoctorinfo(id) {
 				uni.navigateTo({