Преглед на файлове

ltb2020年11月11日16:06:07
完成更多设置

老狐\25396 преди 4 години
родител
ревизия
17ccf2a361
променени са 4 файла, в които са добавени 197 реда и са изтрити 113 реда
  1. 1 1
      pages.json
  2. 5 2
      pages/index/index.vue
  3. 6 0
      pages/information/information.vue
  4. 185 110
      pages/service/more.vue

+ 1 - 1
pages.json

xqd
@@ -196,7 +196,7 @@
 		"current": 0, //当前激活的模式(list 的索引项)
 		"list": [{
 			"name": "test", //模式名称
-			"path": "pages/login/login", //启动页面,必选
+			"path": "pages/service/setservice", //启动页面,必选
 			"query": "" //启动参数,在页面的onLoad函数里面得到
 		}]
 	}

+ 5 - 2
pages/index/index.vue

xqd xqd
@@ -353,7 +353,9 @@
 						}
 					})
 					return false;
-				};
+				}else{
+					return true
+				}
 			},
 
 			// 跳转服务设置
@@ -419,7 +421,8 @@
 				if(this.judgerenzheng()){
 				uni.navigateTo({
 					url: '/pages/information/information'
-				})}
+				})
+				}
 			},
 			//点击未认证
 			gorz() {

+ 6 - 0
pages/information/information.vue

xqd
@@ -102,6 +102,12 @@
 						uni.switchTab({
 							url:'/pages/index/index'
 						})
+					}else{
+						uni.showToast({
+						    title: '修改失败,请稍后重试',
+							icon:'none',
+						    duration: 2000
+						});
 					}
 					return false;
 				},

+ 185 - 110
pages/service/more.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -12,11 +12,11 @@
 				<!-- 左 -->
 				<view class="left">
 					<view class="t1">基础价格<text style="font-size: 24rpx;color: #666666;margin-left: 10rpx;">(元)</text></view>
-		 			<view class="t2">基础价格为包含十分钟的起步价</view>
+					<view class="t2">基础价格为包含十分钟的起步价</view>
 				</view>
 				<!-- 右 -->
 				<view class="right">
-					<u-input v-model="telePhone.Basics" type="text" :border="true" placeholder="请输入金额" />
+					<u-input v-model="form.is_phone.base_price" type="digit" :border="true" placeholder="请输入金额" />
 				</view>
 			</view>
 			<!-- 步进价格 -->
@@ -28,7 +28,7 @@
 				</view>
 				<!-- 右 -->
 				<view class="right">
-					<u-input v-model="telePhone.additional" type="text" :border="true" placeholder="请输入金额" />
+					<u-input v-model="form.is_phone.step_price" type="digit" :border="true" placeholder="请输入金额" />
 				</view>
 			</view>
 			<!-- 服务时间 -->
@@ -124,7 +124,7 @@
 				</view>
 				<!-- 右 -->
 				<view class="right">
-					<u-input v-model="telePhone.peopleNum" type="text" :border="true" placeholder="请输入人次" />
+					<u-input v-model="form.is_phone.person" type="digit" :border="true" placeholder="请输入人次" />
 				</view>
 			</view>
 		</view>
@@ -146,7 +146,7 @@
 				</view>
 				<!-- 右 -->
 				<view class="right">
-					<u-input v-model="imgText.Basics" type="text" :border="true" placeholder="请输入金额" />
+					<u-input v-model="form.is_chat.base_price" type="digit" :border="true" placeholder="请输入金额" />
 				</view>
 			</view>
 			<!-- 服务时间 -->
@@ -242,7 +242,7 @@
 				</view>
 				<!-- 右 -->
 				<view class="right">
-					<u-input v-model="imgText.peopleNum" type="text" :border="true" placeholder="请输入人次" />
+					<u-input v-model="form.is_chat.person" type="digit" :border="true" placeholder="请输入人次" />
 				</view>
 			</view>
 		</view>
@@ -264,7 +264,7 @@
 				</view>
 				<!-- 右 -->
 				<view class="right">
-					<u-input v-model="mz.Basics" type="text" :border="true" placeholder="请输入金额" />
+					<u-input v-model="form.is_appoint[0].base_price" type="digit" :border="true" placeholder="请输入金额" />
 				</view>
 			</view>
 			<!-- 服务时间 -->
@@ -450,7 +450,7 @@
 				</view>
 				<!-- 右 -->
 				<view class="right">
-					<u-input v-model="mz.peopleNum" type="text" :border="true" placeholder="请输入人次" />
+					<u-input v-model="form.is_appoint[0].person" type="digit" :border="true" placeholder="请输入人次" />
 				</view>
 			</view>
 		</view>
@@ -473,15 +473,13 @@
 		data() {
 			return {
 				// 控制列表显示:0=电话,1=图文,2=门诊预约
-				showList:[
-					{
-						flag: true
-					}, {
-						flag:true
-					},{
-						flag:true
-					},
-				],
+				showList: [{
+					flag: true
+				}, {
+					flag: true
+				}, {
+					flag: true
+				}, ],
 				hospital: [{
 					name: '熊科医院'
 				}, {
@@ -578,91 +576,180 @@
 					checked: false
 				}],
 
-				/******************需要保存的资料*********************/
-				//电话
-				telePhone: {
-					Basics: '', //基础价格
-					additional: '', //步进
-					peopleNum: '', //服务人次
+				/********************保存的数据****************************/
+				form: {
+					is_chat: {
+						base_price: "0",
+						service_time: "",
+						person: 0,
+						type: "2"
+					},
+					is_phone: {
+						base_price: "0",
+						service_time: "",
+						person: 0,
+						type: "1"
+					},
+					is_appoint: {
+						base_price: "0",
+						type:"3",
+						person: 0,
+						hospitals:[{
+							service_time: "",
+							relation_id: 0
+						},{
+							service_time: "",
+							relation_id: 0
+						}]
+					}
+				}
 
-				},
-				//图文
-				imgText: {
-					Basics: '', //基础价格
-					additional: '', //步进
-					peopleNum: '' //服务人次
-				},
-				//门诊
-				mz: {
-					Basics: '', //基础价格
-					additional: '', //步进
-					peopleNum: '' //服务人次
-				},
 			}
 		},
 		methods: {
+			/*    保存       */
+			bc(e) {
+				/**
+				 * 电话
+				 * */
+				for(let i in this.dh.timeList1){		//遍历选中 保存id
+					if(this.dh.timeList1[i].checked){this.form.is_phone.service_time = this.form.is_phone.service_time+","+this.dh.timeList1[i].id}
+				}
+				for(let i in this.dh.timeList2){		//遍历选中 保存id
+					if(this.dh.timeList2[i].checked){this.form.is_phone.service_time = this.form.is_phone.service_time+","+this.dh.timeList2[i].id}
+				}
+				for(let i in this.dh.timeList3){		//遍历选中 保存id
+					if(this.dh.timeList3[i].checked){this.form.is_phone.service_time = this.form.is_phone.service_time+","+this.dh.timeList3[i].id}
+				}
+				//判断开头第一个是否为逗号,是就删除逗号
+				if(this.form.is_phone.service_time.startsWith(",")){
+					this.form.is_phone.service_time= this.form.is_phone.service_time.substr(1);
+				}
+				/**
+				 * 图文
+				 * */
+				for(let i in this.tw.timeList1){		//遍历选中 保存id
+					if(this.tw.timeList1[i].checked){this.form.is_chat.service_time = this.form.is_chat.service_time+","+this.tw.timeList1[i].id}
+				}
+				for(let i in this.tw.timeList2){		//遍历选中 保存id
+					if(this.tw.timeList2[i].checked){this.form.is_chat.service_time = this.form.is_chat.service_time+","+this.tw.timeList2[i].id}
+				}
+				for(let i in this.tw.timeList3){		//遍历选中 保存id
+					if(this.tw.timeList3[i].checked){this.form.is_chat.service_time = this.form.is_chat.service_time+","+this.tw.timeList3[i].id}
+				}
+				//判断开头第一个是否为逗号,是就删除逗号
+				if(this.form.is_chat.service_time.startsWith(",")){
+					this.form.is_chat.service_time= this.form.is_chat.service_time.substr(1);
+				}
+				/**
+				 * 门诊
+				 * */
+				for(let i in this.mz1.timeList1){		//遍历选中 保存id
+					if(this.mz1.timeList1[i].checked){this.form.is_appoint.hospitals[0].service_time = this.form.is_appoint.hospitals[0].service_time+","+this.mz1.timeList1[i].id}
+				}
+				for(let i in this.mz1.timeList2){		//遍历选中 保存id
+					if(this.mz1.timeList2[i].checked){this.form.is_appoint.hospitals[0].service_time = this.form.is_appoint.hospitals[0].service_time+","+this.mz1.timeList2[i].id}
+				}
+				for(let i in this.mz1.timeList3){		//遍历选中 保存id
+					if(this.mz1.timeList3[i].checked){this.form.is_appoint.hospitals[0].service_time = this.form.is_appoint.hospitals[0].service_time+","+this.mz1.timeList3[i].id}
+				}
+				//判断开头第一个是否为逗号,是就删除逗号
+				if(this.form.is_appoint.hospitals[0].service_time.startsWith(",")){
+					this.form.is_appoint.hospitals[0].service_time= this.form.is_appoint.hospitals[0].service_time.substr(1);
+				}
+				/**
+				 * 门诊
+				 * */
+				for(let i in this.mz2.timeList1){		//遍历选中 保存id
+					if(this.mz2.timeList1[i].checked){this.form.is_appoint.hospitals[1].service_time = this.form.is_appoint.hospitals[1].service_time+","+this.mz2.timeList1[i].id}
+				}
+				for(let i in this.mz2.timeList2){		//遍历选中 保存id
+					if(this.mz2.timeList2[i].checked){this.form.is_appoint.hospitals[1].service_time = this.form.is_appoint.hospitals[1].service_time+","+this.mz2.timeList2[i].id}
+				}
+				for(let i in this.mz2.timeList3){		//遍历选中 保存id
+					if(this.mz2.timeList3[i].checked){this.form.is_appoint.hospitals[1].service_time = this.form.is_appoint.hospitals[1].service_time+","+this.mz2.timeList3[i].id}
+				}
+				//判断开头第一个是否为逗号,是就删除逗号
+				if(this.form.is_appoint.hospitals[1].service_time.startsWith(",")){
+					this.form.is_appoint.hospitals[1].service_time= this.form.is_appoint.hospitals[1].service_time.substr(1);
+				}
+				
+				
+				
+				
+				
+				
+				console.log(this.form)
+				uni.navigateBack({
+					delta: 1
+				})
+			},
 			/**
 			 * @author Liu Yuanhang
 			 * 获取页面显示状态以及数据
 			 */
-			getShows:async function(){
-				let res = await this.$request.post('doctor/getSettingList',{'type':2});
-				if(res.status==0){
-					
+			getShows: async function() {
+				let res = await this.$request.post('doctor/getSettingList', {
+					'type': 2
+				});
+				if (res.status == 0) {
+
 					// 1.控制列表显示,2.渲染数据
 					// this.showList[0].flag = res.data.show.is_phone;
 					// this.showList[1].flag = res.data.show.is_chat;
 					// this.showList[2].flag = res.data.show.is_appoint;
-					
+
 					// 渲染显示的基础价格设置
-					if(res.data.list.phone!=null){
+					if (res.data.list.phone != null) {
 						// 渲染电话的基础数据
-						this.telePhone.Basics = res.data.list.phone.base_price;
-						this.telePhone.additional = res.data.list.phone.step_price;
-						this.telePhone.peopleNum = res.data.list.phone.person;
+						this.form.is_phone.base_price = res.data.list.phone.base_price;
+						this.form.is_phone.step_price = res.data.list.phone.step_price;
+						this.form.is_phone.person = res.data.list.phone.person;
 					}
-					
-					if(res.data.list.chat!=null){
+
+					if (res.data.list.chat != null) {
 						// 渲染图文的基础数据
-						this.imgText.Basics = res.data.list.chat.base_price;
-						this.imgText.additional = res.data.list.chat.step_price;
-						this.imgText.peopleNum = res.data.list.chat.person;
+						this.form.is_chat.base_price = res.data.list.chat.base_price;
+						this.form.is_chat.step_price = res.data.list.chat.step_price;
+						this.form.is_chat.person = res.data.list.chat.person;
 					}
-					
-					if(res.data.list.men!=null){
+
+					if (res.data.list.men != null) {
 						// 渲染门诊预约的基础数据
-						this.mz.Basics = res.data.list.men[0].base_price;
-						this.mz.additional = res.data.list.men[0].step_price;
-						this.mz.peopleNum = res.data.list.men[0].person;
+						this.form.is_appoint.base_price = res.data.list.men.base_price;
+						this.form.is_appoint.step_price = res.data.list.men.step_price;
+						this.form.is_appoint.person = res.data.list.men.person;
 					}
-					
+
 					// 获取医院
-					if(res.data.org!=null){
-						console.log('获取医院',res.data.org)
+					if (res.data.org != null) {
+						console.log('获取医院', res.data.org)
 						this.hospital = res.data.org;
 						this.hospitals = res.data.orgs;
+						
 					}
-					
+
 					/* 渲染时间 */
 					//电话的时间
-					 let dhtime = res.data.times;
+					console.log(res.data.times)
+					let dhtime = JSON.parse(JSON.stringify(res.data.times))
 					this.dh.timeList1 = dhtime.list1;
 					this.dh.timeList2 = dhtime.list2;
 					this.dh.timeList3 = dhtime.list3;
-					
+
 					//图文的时间
-					let twtime = res.data.times;
+					let twtime = JSON.parse(JSON.stringify(res.data.times))
 					this.tw.timeList1 = twtime.list1;
 					this.tw.timeList2 = twtime.list2;
 					this.tw.timeList3 = twtime.list3;
-				
+
 					// 门诊时间
-					let mz1 = res.data.times;
+					let mz1 = JSON.parse(JSON.stringify(res.data.times))
 					this.mz1.timeList1 = mz1.list1;
 					this.mz1.timeList2 = mz1.list2;
 					this.mz1.timeList3 = mz1.list3;
-					
-					let mz2 = res.data.times;
+
+					let mz2 = JSON.parse(JSON.stringify(res.data.times))
 					this.mz2.timeList1 = mz2.list1;
 					this.mz2.timeList2 = mz2.list2;
 					this.mz2.timeList3 = mz2.list3;
@@ -674,39 +761,41 @@
 			 * @author Liu Yuan hang
 			 * @param {Object} e
 			 */
-			reanders(e){
-				uni.showLoading({title: '渲染中',mask:true});
-				let oks,dh1,dh2,dh3,tw1,tw2,tw3;
-			
-				
+			reanders(e) {
+				uni.showLoading({
+					title: '渲染中',
+					mask: true
+				});
+				let oks, dh1, dh2, dh3, tw1, tw2, tw3;
+
 				// 电话
-			 if(e.list.phone!=null){
-				dh1=this.dh.timeList1;
-				dh2=this.dh.timeList2;
-				dh3=this.dh.timeList3;
-				 let phones = e.list.phone.service_time;
-				 console.log('我是电话',phones)
-				 for(let i=0;i<dh1.length;i++){
-					if(phones.indexOf(dh1[i].id)!=-1){
-						dh1[i].checked = true
+				if (e.list.phone != null) {
+					dh1 = this.dh.timeList1;
+					dh2 = this.dh.timeList2;
+					dh3 = this.dh.timeList3;
+					let phones = e.list.phone.service_time;
+					console.log('我是电话', phones)
+					for (let i = 0; i < dh1.length; i++) {
+						if (phones.indexOf(dh1[i].id) != -1) {
+							dh1[i].checked = true
+						}
 					}
-				 }
-				 
-				 for(let i=0;i<dh2.length;i++){
-					if(phones.indexOf(dh2[i].id)!=-1){
-						dh2[i].checked = true
+
+					for (let i = 0; i < dh2.length; i++) {
+						if (phones.indexOf(dh2[i].id) != -1) {
+							dh2[i].checked = true
+						}
 					}
-				 }
-				 
-				 for(let i=0;i<dh3.length;i++){
-					if(phones.indexOf(dh3[i].id)!=-1){
-						dh3[i].checked = true
+
+					for (let i = 0; i < dh3.length; i++) {
+						if (phones.indexOf(dh3[i].id) != -1) {
+							dh3[i].checked = true
+						}
 					}
-				 }
-			 }
-			 
-			 // 图文资讯渲染
-			 // if(e.list.chat!=null){
+				}
+
+				// 图文资讯渲染
+				// if(e.list.chat!=null){
 				// tw1=this.tw.timeList1;
 				// tw2=this.tw.timeList2;
 				// tw3=this.tw.timeList3;
@@ -727,22 +816,8 @@
 				// 		tw3[i].checked = true
 				// 	}
 				//  }
-			 // }
+				// }
 				uni.hideLoading();
-			},
-			bc(e) {
-				console.log('电话' + this.telePhone)
-				console.log('图文' + this.imgText)
-				console.log('门诊' + this.mz)
-				console.log('电话' + this.dhcurrent)
-				console.log('图文' + this.twcurrent)
-				console.log('门诊' + this.mzcurrent),
-				uni.navigateTo({
-					url:'setservice'
-				})
-			},
-			test(e) {
-
 			},
 			dhchange(index) {
 				this.dhcurrent = index