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

feat:修改选择服务时段、服务人员接口调用

LuoDLeo преди 2 години
родител
ревизия
ff20740545
променени са 6 файла, в които са добавени 80 реда и са изтрити 25 реда
  1. 26 0
      common/js/api.js
  2. 2 2
      common/js/env.js
  3. 23 9
      orderPages/bookService/index.vue
  4. 23 10
      orderPages/serviceTeacher/index.vue
  5. 1 1
      pages/index/index.vue
  6. 5 3
      pages/my/index.vue

+ 26 - 0
common/js/api.js

@@ -615,6 +615,24 @@ export default {
 		})
 	},
 
+	// get请求 根据门店、排班日期查询可用时段
+	getServiceTime(data) {
+		return request({
+			url: '/business/wechat/scheduling/time',
+			method: 'GET',
+			data: data
+		})
+	},
+
+	// get请求 根据门店、排班日期查询可用时段
+	getServicePerson(data) {
+		return request({
+			url: '/business/wechat/scheduling/person',
+			method: 'GET',
+			data: data
+		})
+	},
+
 	// get请求 查询可领取的优惠劵列表
 	getUserDiscountsList(data) {
 		return request({
@@ -659,6 +677,14 @@ export default {
 
 	},
 
+	getImage(id) {
+		return request({
+			url: '/resource/oss/listByIds/' + id,
+			method: 'GET'
+		})
+
+	},
+
 	/**
 	 * 微信静默登录
 	 */

+ 2 - 2
common/js/env.js

@@ -1,8 +1,8 @@
 "use strict";
 
-let baseUrl = `https://jje.admin.xinyuekj.com.cn`
+// let baseUrl = `https://jje.admin.xinyuekj.com.cn`
 // let baseUrl = `http://127.0.0.1:9000`
-// let baseUrl = `http://192.168.1.150:8080`
+let baseUrl = `http://192.168.1.150:8080`
 
 // 变量可自行添加修改
 export default { //存放变量的容器

+ 23 - 9
orderPages/bookService/index.vue

@@ -66,7 +66,7 @@
                     <text>服务人员</text>
                 </view>
                 <view class="flex-row justify-between groupItemContent" @click="chooseServiceTeacher">
-                    <text>{{serviceTeacher.title || '请选择服务人员' }}</text>
+                    <text>{{serviceTeacher.personName || '请选择服务人员' }}</text>
                     <u-icon name="arrow-right" color="#666" size="18"></u-icon>
                 </view>
             </view>
@@ -237,7 +237,7 @@ export default {
         //提交订单
         commitOrder(){
 
-            if (!this.serviceTeacher.id){
+            if (!this.serviceTeacher.personId){
                 uni.$u.toast('请选择服务人员')
                 return
             }
@@ -342,9 +342,9 @@ export default {
               serviceStoreId: this.store.storeId,
               serviceTypeId:this.storeServiceList[this.storeServiceIndex].id,
               serviceDate:this.periodDateList[this.periodDateIndex].label,
-              serviceUserId:this.serviceTeacher.id,
+              serviceUserId:this.serviceTeacher.personId,
               serviceStartTime:this.periodTimeList[this.periodTimeIndex].label,
-              timeRangeId:this.serviceTeacher.id,
+              timeRangeId:this.serviceTeacher.crewPeriodId,
               remark:this.remark
           }).then(res=>{
               this.orderNo=res.data.data.orderNo
@@ -374,11 +374,10 @@ export default {
         //获取预约费用
         getAppointmentPrice(){
             this.$api.getAppointmentPrice({
-                auth: true,
                 storeId: this.store.storeId,
                 date: this.periodDateList[this.periodDateIndex].label,
-                timeRangeId: this.periodTimeList[this.periodTimeIndex].value,
-                servicePersonId:  this.serviceTeacher.id,
+                timeRangeId: this.serviceTeacher.crewPeriodId,
+                servicePersonId: this.serviceTeacher.personId,
                 serviceProjectId:this.storeServiceList[this.storeServiceIndex].id
             }).then(res=>{
                 this.price= res.data.data.price
@@ -391,8 +390,10 @@ export default {
             if (this.periodDateList.length <=0 || this.periodTimeList.length<=0){
                 uni.$u.toast('请选择服务时间')
             }
+          console.log("a->", this.periodTimeIndex)
+            console.log("b->", this.periodTimeList)
             uni.navigateTo({
-                url: '/orderPages/serviceTeacher/index?organization='+this.store.storeId + '&schedulingDate=' +this.periodDateList[this.periodTimeIndex].label + '&periodId='+this.periodTimeList[this.periodTimeIndex].value
+                url: '/orderPages/serviceTeacher/index?organization='+this.store.storeId + '&schedulingDate=' +this.periodDateList[this.periodDateIndex].label + '&time='+this.periodTimeList[this.periodTimeIndex].value
             })
         },
 
@@ -420,6 +421,19 @@ export default {
             })
         },
 
+      //获取门店排班时段
+      getServiceTime(date){
+        this.$api.getServiceTime({
+          storeId: this.store.storeId,
+          date: date
+        }).then(res =>{
+          this.periodTimeList = res.data.data
+          if (this.periodTimeList.length===0){
+            uni.$u.toast('暂无排班时段')
+          }
+        })
+      },
+
         // 查询服务对像信息列表
         listServiceObject(){
             this.$api.listServiceObject(this.reqParm).then((res)=>{
@@ -451,7 +465,7 @@ export default {
         },
         bindPickerChange1(e){
             this.periodDateIndex= e.detail.value
-            this.selectPeriodByDate(this.periodDateList[e.detail.value].label)
+            this.getServiceTime(this.periodDateList[e.detail.value].label)
             console.log(e)
         },
         bindPickerChange2(e){

+ 23 - 10
orderPages/serviceTeacher/index.vue

@@ -7,7 +7,7 @@
 			<view class="h-item-content">
 				<view class="h-title">
 					<view class="name">
-						<text>{{item.title}}</text>
+						<text>{{item.personName}}</text>
 					</view>
 					<!-- <view class="btn">
                         <text>包房</text>
@@ -35,22 +35,22 @@
 		data() {
 			return {
 				reqParm: {
-					auth: true,
-					schedulingDate: null,
-					periodId: null,
-					organization: null, // 所属门店
+          date: null,
+          time: null,
+          storeId: null, // 所属门店
 				},
 				workPersonList: []
 			}
 		},
 		onLoad(option) {
 
-			this.reqParm.schedulingDate = option.schedulingDate;
-			this.reqParm.periodId = option.periodId;
-			this.reqParm.organization = option.organization;
+			this.reqParm.date = option.schedulingDate;
+			this.reqParm.time = option.time;
+			this.reqParm.storeId = option.organization;
 
 			// 查询服务工作人员列表
-			this.serviceWorkPersonList();
+			// this.serviceWorkPersonList();
+			this.getServicePerson();
 		},
 		methods: {
 			// 查询服务工作人员列表
@@ -66,11 +66,24 @@
 					})
 				});
 			},
+      // 查询服务工作人员列表
+      getServicePerson() {
+        this.$api.getServicePerson(this.reqParm).then((res) => {
+          console.log(res)
+          this.workPersonList = res.data.data;
+          this.getImgUrlByOssId(res.data.data)
+        }).catch((err) => {
+          console.log('+++++++++++++err++++++++++++++',err)
+          uni.showToast({
+            title: "操作失败"
+          })
+        });
+      },
 			// 获取图片
 			getImgUrlByOssId(data){
 				for (let i = 0; i < data.length; i++) {
 					if (data[i].facePhoto){
-						this.$api.getImgUrlByOssId(data[i].facePhoto).then(res=>{
+						this.$api.getImage(data[i].facePhoto).then(res=>{
 							data[i].imgUrl = res.data.data[0].url.replace(/^http:/, "https:")
 						});
 					}

+ 1 - 1
pages/index/index.vue

@@ -344,7 +344,7 @@ export default {
     async getImgUrlByBannerOssId(items) {
       for (let i = 0; i < items.length; i++) {
         if (items[i].slideshowId) {
-          this.$api.getImgUrlByOssId({ossId: items[i].slideshowId}).then(res => {
+          this.$api.getImage(items[i].slideshowId).then(res => {
             this.bannerList.push(res.data.data[0].url.replace(/^http:/, "https:"))
           })
         }

+ 5 - 3
pages/my/index.vue

@@ -158,9 +158,11 @@ export default {
 	methods: {
 
 		getImgUrlByOssId(Id){
-			this.$api.getImgUrlByOssId(Id).then(res=>{
-				this.userInfo.selfPhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
-			});
+		  if (Id) {
+        this.$api.getImage(Id).then(res=>{
+          this.userInfo.selfPhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
+        });
+      }
 		},
 		navigateToPage(url){
 			uni.navigateTo({