Explorar o código

refactor:不在默认选择服务对象

zhanghui %!s(int64=2) %!d(string=hai) anos
pai
achega
f3f881929e

+ 1 - 1
myPages/ServiceObjectManagement/index.vue

@@ -6,7 +6,7 @@
         <view class="service-object-list" >
           <view v-for="(item,index) in serviceObjectList" class="store-content" :key="index">
             <view class="store-img">
-              <image  :src="item.facePhotoUrl || '/static/logo.png'" mode=""></image>
+              <image  :src="item.facePhotoUrl || '/static/logo.png'" mode="center"></image>
             </view>
             <view class="content">
               <view class="title-price">

+ 7 - 5
myPages/serviceObjectFaceAuth/index.vue

@@ -10,7 +10,7 @@
       <view class="h-item-row">
         <view @click="uploadImg()" class="h-item">
           <view v-if="!facePhotoUrl" class="h-content">
-            <image src="/static/me/u01.png" mode=""></image>
+            <image src="/static/me/u01.png" mode="center"></image>
             <view class="h-text">
               <text>添加人脸影像</text>
             </view>
@@ -94,11 +94,13 @@
               url: '/myPages/serviceObjectAllInfo/index?data='+ JSON.stringify(serviceObject),
             })
           } else { // 人脸存在
-            res.opType = "1";
-            res.facePhotoUrl = res.facePhoto;
-            res.facePhotos = that.parms.facePhotos;
+            let serviceObject =  res.data.data
+
+            serviceObject.opType = "1";
+            serviceObject.facePhotoUrl =  that.facePhotoUrl;
+            serviceObject.facePhoto = that.reqParm.facePath;
             uni.navigateTo({
-              url: '/myPages/serviceObjectInfo/index?data=' + JSON.stringify(res),
+              url: '/myPages/serviceObjectInfo/index?data=' + JSON.stringify(serviceObject),
             })
           }
         }).catch(() =>{

+ 25 - 15
myPages/serviceObjectInfo/index.vue

@@ -151,27 +151,36 @@
                 if(this.userInfo.opType == '1'){ // 绑定
                     // 保存数据
                     this.$api.bindServiceObject(this.userInfo).then((res)=>{
+                        if (res.data.code === 500){
+                            uni.showToast({
+                                title: res.data.msg
+                            })
+                        }else {
+                            uni.showToast({
+                                title: "绑定成功"
+                            })
+                        }
                         // 去服务对象列表页
-                        uni.navigateTo({
-                            url: '/myPages/ServiceObjectManagement/index',
-                        })
-                    }).catch(() =>{
-                        uni.showToast({
-                            title: "操作失败"
-                        })
-                    });
+                        setTimeout(()=>{
+                            uni.navigateTo({
+                                url: '/myPages/ServiceObjectManagement/index',
+                            })
+                        },3000)
+                    })
                 }else if(this.userInfo.opType == '2'){ // 修改
                     // 修改数据
                     this.$api.updateServiceObject(this.userInfo).then((res)=>{
-                        // 去服务对象列表页
-                        uni.navigateTo({
-                            url: '/myPages/ServiceObjectManagement/index',
-                        })
-                    }).catch(() =>{
                         uni.showToast({
-                            title: "操作失败"
+                            title: "修改成功"
                         })
-                    });
+                        // 去服务对象列表页
+                        setTimeout(()=>{
+                            uni.navigateTo({
+                                url: '/myPages/ServiceObjectManagement/index',
+                            })
+                        },3000)
+
+                    })
                 }
             },
             //头像上传
@@ -190,6 +199,7 @@
                                 'Authorization': 'Bearer ' + uni.getStorageInfo('accessToken'),
                             },
                             success: (uploadFileRes) => {
+                                console.log('uploadFileRes=>',uploadFileRes)
                                 let res = JSON.parse(uploadFileRes.data)
                                 that.userInfo.facePhotoUrl = res.data.url.replace(/^http:/, "https:");
                                 that.userInfo.facePhoto = res.data.ossId

+ 476 - 475
orderPages/bookService/index.vue

@@ -1,524 +1,525 @@
 <template>
-  <view class="page">
-    <view class="flex-col group">
-      <view class="flex-col justify-around groupItem">
-        <view class="groupItemKey">
-          <text>服务对象</text>
-        </view>
-        <view class="flex-row justify-between groupItemContent" @click="getServiceObject">
-          <text>{{ serviceObject.nickName || '请选择对象' }}</text>
-          <u-icon name="arrow-right" color="#666" size="18"></u-icon>
-        </view>
-      </view>
-
-      <view class="flex-col justify-around groupItem">
-        <view class="groupItemKey">
-          <text>服务类别</text>
-        </view>
-        <picker @change="bindPickerChange" mode='selector' range-key="typeName" :value="storeServiceIndex"
-                :range="storeServiceList">
-          <view class="flex-row justify-between groupItemContent">
-            <text>{{ storeServiceList[storeServiceIndex].typeName || '请选择服务类别' }}</text>
-            <u-icon name="arrow-right" color="#666" size="18"></u-icon>
-          </view>
-        </picker>
-      </view>
-    </view>
-
-
-    <view class="flex-col group marginTop">
+    <view class="page">
+        <view class="flex-col group">
+            <view class="flex-col justify-around groupItem">
+                <view class="groupItemKey">
+                    <text>服务对象</text>
+                </view>
+                <view class="flex-row justify-between groupItemContent" @click="getServiceObject">
+                    <text>{{serviceObject.nickName || '请选择对象' }}</text>
+                    <u-icon name="arrow-right" color="#666" size="18"></u-icon>
+                </view>
+            </view>
 
-      <view class="flex-row ">
-        <view class="hint">
-          <text>!</text>
-        </view>
-        <view class="hintCentent">
-          <text>需提前一天起预约,取消订单服务需服务前一天取消</text>
+            <view class="flex-col justify-around groupItem">
+                <view class="groupItemKey">
+                    <text>服务类别</text>
+                </view>
+                <picker  @change="bindPickerChange" mode='selector'  range-key="typeName" :value="storeServiceIndex" :range="storeServiceList">
+                    <view class="flex-row justify-between groupItemContent">
+                        <text>{{storeServiceList[storeServiceIndex].typeName || '请选择服务类别' }}</text>
+                        <u-icon name="arrow-right" color="#666" size="18"></u-icon>
+                    </view>
+                </picker>
+            </view>
         </view>
-      </view>
 
-      <view class="flex-col justify-around groupItem">
-        <view class="groupItemKey">
-          <text>服务日期</text>
-        </view>
-        <picker @change="bindPickerChange1" mode='selector' range-key="label" :value="periodDateIndex"
-                :range="periodDateList">
-          <view class="flex-row justify-between groupItemContent">
-            <text>{{ periodDateList[periodDateIndex].label || '请选择服务日期' }}</text>
-            <u-icon name="arrow-right" color="#666" size="18"></u-icon>
-          </view>
-        </picker>
-      </view>
-
-      <view class="flex-col justify-around groupItem">
-
-        <view class="groupItemKey">
-          <text>服务时段</text>
-        </view>
-        <picker @change="bindPickerChange2" mode='selector' range-key="label" :value="periodTimeIndex"
-                :range="periodTimeList">
-          <view class="flex-row justify-between groupItemContent">
-            <text>{{ periodTimeList[periodTimeIndex].label || '服务时段' }}</text>
-            <u-icon name="arrow-right" color="#666" size="18"></u-icon>
-          </view>
-        </picker>
-      </view>
-
-      <view class="flex-col justify-around groupItem">
-        <view class="groupItemKey">
-          <text>服务人员</text>
-        </view>
-        <view class="flex-row justify-between groupItemContent" @click="chooseServiceTeacher">
-          <text>{{ serviceTeacher.personName || '请选择服务人员' }}</text>
-          <u-icon name="arrow-right" color="#666" size="18"></u-icon>
-        </view>
-      </view>
 
+        <view class="flex-col group marginTop">
 
-    </view>
-    <view class="flex-col group marginTop">
-      <view class="groupItemKey">
-        <text>服务定制</text>
-      </view>
-      <view class="textareaView">
-        <textarea v-model="remark" placeholder-style="color:#999999;fontSize:28rpx" placeholder="如有其它特殊需求,请在此输入您的需求"/>
-      </view>
-    </view>
+            <view class="flex-row ">
+                <view class="hint">
+                    <text>!</text>
+                </view>
+                <view class="hintCentent">
+                    <text>需提前一天起预约,取消订单服务需服务前一天取消</text>
+                </view>
+            </view>
 
-    <view :style="{'height':'236rpx'}"></view>
+            <view class="flex-col justify-around groupItem">
+                <view class="groupItemKey">
+                    <text>服务日期</text>
+                </view>
+                <picker  @change="bindPickerChange1" mode='selector'  range-key="label" :value="periodDateIndex" :range="periodDateList">
+                    <view class="flex-row justify-between groupItemContent">
+                        <text>{{periodDateList[periodDateIndex].label || '请选择服务日期' }}</text>
+                        <u-icon name="arrow-right" color="#666" size="18"></u-icon>
+                    </view>
+                </picker>
+            </view>
 
-    <view class="flex-col  group2 ">
-      <view class="btnTitle">
-        <text>提交订单之前需支付预约服务费用</text>
-      </view>
-      <view class="btn flex-row justify-between">
-        <view>
-          <text class="title">待支付</text>
-          <text class="num">¥{{ price }}</text>
-        </view>
-        <view class="btnRight" @click="commitOrder">
-          <text>提交</text>
-        </view>
-      </view>
-    </view>
+            <view class="flex-col justify-around groupItem">
+
+                <view class="groupItemKey">
+                    <text>服务时段</text>
+                </view>
+                <picker  @change="bindPickerChange2" mode='selector'  range-key="label" :value="periodTimeIndex" :range="periodTimeList">
+                    <view class="flex-row justify-between groupItemContent">
+                        <text>{{periodTimeList[periodTimeIndex].label || '服务时段' }}</text>
+                        <u-icon name="arrow-right" color="#666" size="18"></u-icon>
+                    </view>
+                </picker>
+            </view>
 
-    <uni-popup ref="passwordPopup">
-      <view class="passwordView flex-col">
-        <view class="h-pay-title flex-row justify-center">
-          <text>请输入交易密码</text>
-        </view>
-        <view class="h-tab-bar flex-row justify-center">
-          <u-code-input v-model="password" mode="box" dot></u-code-input>
-        </view>
-        <view class="flex-row justify-center">
-          <view class="h-operate-btn flex-row justify-center" @click="balancePay">
-            <text>确定</text>
-          </view>
-        </view>
-      </view>
-    </uni-popup>
+            <view class="flex-col justify-around groupItem">
+                <view class="groupItemKey">
+                    <text>服务人员</text>
+                </view>
+                <view class="flex-row justify-between groupItemContent" @click="chooseServiceTeacher">
+                    <text>{{serviceTeacher.personName || '请选择服务人员' }}</text>
+                    <u-icon name="arrow-right" color="#666" size="18"></u-icon>
+                </view>
+            </view>
 
-    <uni-popup ref="popup" type="bottom">
 
-      <view class=" payView">
-        <view class="flex-row justify-between">
-          <text class="payType">请选择支付方式</text>
-          <image class="x" src="/static/common/ox.png" @click="closePayPopup"></image>
-        </view>
-        <view class="payTitle">
-          <text>选择微信支付或余额支付</text>
         </view>
-        <view class="payItem flex-row justify-between" @click="payItem(1)">
-          <view class="flex-row">
-            <u-icon name="/static/me/u701.png" color="#38db38" size="36"></u-icon>
-            <view class="payName flex-col justify-center">
-              <text>余额支付</text>
-              <text class="balance">可以余额¥{{ userInfo.balance || 0 }}</text>
+        <view class="flex-col group marginTop">
+            <view class="groupItemKey">
+                <text>服务定制</text>
             </view>
-          </view>
-
-          <view class="flex-col justify-center">
-            <view v-if="curServiceTab === 1">
-              <u-icon name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
+            <view class="textareaView">
+                <textarea v-model="remark" placeholder-style="color:#999999;fontSize:28rpx" placeholder="如有其它特殊需求,请在此输入您的需求"/>
             </view>
-            <view v-else>
-              <u-icon name="/static/order/ud9.png" color="green" size="25"></u-icon>
-            </view>
-          </view>
-
         </view>
 
-        <view class="payItem flex-row justify-between" @click="payItem(2)">
-          <view class="flex-row">
-            <u-icon name="weixin-circle-fill" color="#38db38" size="36"></u-icon>
-            <view class="payName flex-col justify-center">
-              <text>微信支付</text>
-            </view>
-          </view>
-          <view class="flex-col justify-center">
-            <view v-if="curServiceTab === 2">
-              <u-icon name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
+        <view :style="{'height':'236rpx'}"></view>
+
+        <view class="flex-col  group2 ">
+            <view class="btnTitle">
+                <text>提交订单之前需支付预约服务费用</text>
             </view>
-            <view v-else>
-              <u-icon name="/static/order/ud9.png" color="green" size="25"></u-icon>
+            <view class="btn flex-row justify-between">
+                <view>
+                    <text class="title">待支付</text>
+                    <text class="num">¥{{price}}</text>
+                </view>
+                <view class="btnRight" @click="commitOrder">
+                    <text>提交</text>
+                </view>
             </view>
-          </view>
         </view>
 
-        <view class="commitBtn" @click="commonGeneralOrder">
-          <text>确定</text>
-        </view>
+        <uni-popup ref="passwordPopup">
+            <view class="passwordView flex-col">
+                <view class="h-pay-title flex-row justify-center">
+                    <text>请输入交易密码</text>
+                </view>
+                <view class="h-tab-bar flex-row justify-center">
+                    <u-code-input  v-model="password" mode="box" dot></u-code-input>
+                </view>
+                <view class="flex-row justify-center">
+                    <view class="h-operate-btn flex-row justify-center" @click="balancePay">
+                        <text>确定</text>
+                    </view>
+                </view>
+            </view>
+        </uni-popup>
+
+        <uni-popup ref="popup" type="bottom">
+
+            <view class=" payView">
+                <view class="flex-row justify-between">
+                    <text class="payType">请选择支付方式</text>
+                    <image class="x" src="/static/common/ox.png" @click="closePayPopup"></image>
+                </view>
+                <view class="payTitle">
+                    <text>选择微信支付或余额支付</text>
+                </view>
+
+
+                <view class="payItem flex-row justify-between" @click="payItem(1)">
+                    <view class="flex-row">
+                        <u-icon name="/static/me/u701.png" color="#38db38" size="36"></u-icon>
+                        <view class="payName flex-col justify-center">
+                            <text>余额支付</text>
+                            <text class="balance">可以余额¥{{userInfo.balance || 0}}</text>
+                        </view>
+                    </view>
+
+                    <view class="flex-col justify-center">
+                        <view v-if="curServiceTab === 1" >
+                            <u-icon name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
+                        </view>
+                        <view v-else>
+                            <u-icon name="/static/order/ud9.png" color="green" size="25"></u-icon>
+                        </view>
+                    </view>
+
+                </view>
+
+                <view class="payItem flex-row justify-between" @click="payItem(2)">
+                    <view class="flex-row">
+                        <u-icon name="weixin-circle-fill" color="#38db38" size="36"></u-icon>
+                        <view class="payName flex-col justify-center">
+                            <text>微信支付</text>
+                        </view>
+                    </view>
+                    <view class="flex-col justify-center">
+                        <view v-if="curServiceTab === 2" >
+                            <u-icon name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
+                        </view>
+                        <view v-else>
+                            <u-icon name="/static/order/ud9.png" color="green" size="25"></u-icon>
+                        </view>
+                    </view>
+                </view>
+
+                <view class="commitBtn" @click="commonGeneralOrder">
+                    <text>确定</text>
+                </view>
 
-      </view>
+            </view>
 
-    </uni-popup>
+        </uni-popup>
 
-  </view>
+    </view>
 </template>
 
 <script>
 
 export default {
 
-  data() {
-    return {
-      password: '',
-      remark: '',
-      userInfo: {},
-      curServiceTab: 1,
-      //服务门店
-      store: {},
-      //服务对象
-      serviceObject: {},
-      //服务技师
-      serviceTeacher: {},
-      //服务类型
-      storeServiceList: [],
-      storeServiceIndex: 0,
-      //服务时间
-      periodDateList: [],
-      periodDateIndex: 0,
-      //服务时段
-      periodTimeList: [],
-      periodTimeIndex: 0,
-      //预约费用
-      price: '0',
-      //订单编号
-      orderNo: '',
-      subOrderNo: ''
-
-    }
-  },
-  onLoad() {
-    this.listServiceObject()
-    this.store = uni.getStorageSync('storeInfo')
-    this.userInfo = uni.getStorageSync('userInfo')
-    // this.storeAllServiceList()
-    this.category()
-    this.selectDate()
-  },
-
-  onShow() {
-    // 服务对象
-    uni.$off()
-    uni.$on('selectedServiceObject', this.selectedServiceObject);
-    uni.$on('selectedServiceTeacher', this.selectedServiceTeacher);
-
-  },
-
-  methods: {
-
-    payItem(num) {
-      if (this.userInfo.balance < this.price) {
-        return
-      }
-      this.curServiceTab = num
-    },
+    data() {
+        return {
+            password:'',
+            remark:'',
+            userInfo:{},
+            curServiceTab:1,
+            //服务门店
+            store:{},
+            //服务对象
+            serviceObject:{},
+            //服务技师
+            serviceTeacher:{},
+            //服务类型
+            storeServiceList:[],
+            storeServiceIndex:0,
+            //服务时间
+            periodDateList:[],
+            periodDateIndex:0,
+            //服务时段
+            periodTimeList:[],
+            periodTimeIndex:0,
+            //预约费用
+            price:'0',
+            //订单编号
+            orderNo:'',
+            subOrderNo:''
 
-    //提交订单
-    commitOrder() {
-
-      if (!this.serviceTeacher.personId) {
-        uni.$u.toast('请选择服务人员')
-        return
-      }
-      if (this.price > 0) {
-        this.$refs.popup.open()
-        if (this.userInfo.balance < this.price) {
-          this.curServiceTab = 2
         }
-      } else {
-        this.commonGeneralOrder()
-      }
-
     },
+    onLoad() {
+        // this.listServiceObject()
+        this.store = uni.getStorageSync('storeInfo')
+        this.userInfo = uni.getStorageSync('userInfo')
+        // this.storeAllServiceList()
+        this.category()
+        this.selectDate()
+    },
+
+    onShow(){
+        // 服务对象
+        uni.$off()
+        uni.$on('selectedServiceObject', this.selectedServiceObject);
+        uni.$on('selectedServiceTeacher', this.selectedServiceTeacher);
 
-    closePayPopup() {
-      this.$refs.popup.close()
     },
 
-    wechatPay() {
-      let that = this;
-      // 发起微信支付
-      this.$api.wechatPay({
-        orderNo: this.subOrderNo
-      }).then((res) => {
-        var param = res.data.data;
-        uni.requestPayment({
-          appId: param.appid,
-          timeStamp: param.timestamp + "",
-          nonceStr: param.noncestr,
-          package: "prepay_id=" + param.prepayid,
-          signType: "RSA",
-          paySign: param.sign,
-          success: res => {
-            uni.showToast({
-              title: '支付成功!'
+    methods: {
+
+        payItem(num){
+            if (this.userInfo.balance < this.price){
+                return
+            }
+            this.curServiceTab = num
+        },
+
+        //提交订单
+        commitOrder(){
+
+            if(this.serviceObject){
+                uni.$u.toast('请选择服务对象')
+                return
+            }
+
+            if (!this.serviceTeacher.personId){
+                uni.$u.toast('请选择服务人员')
+                return
+            }
+            if (this.price > 0){
+                this.$refs.popup.open()
+                if (this.userInfo.balance < this.price){
+                    this.curServiceTab=2
+                }
+            }else {
+                this.commonGeneralOrder()
+            }
+
+        },
+
+        closePayPopup(){
+            this.$refs.popup.close()
+        },
+
+        wechatPay(){
+            let that = this;
+            // 发起微信支付
+            this.$api.wechatPay({
+                orderNo:this.subOrderNo
+            }).then((res)=>{
+                var param = res.data.data;
+                uni.requestPayment({
+                    appId: param.appid,
+                    timeStamp: param.timestamp+"",
+                    nonceStr: param.noncestr,
+                    package: "prepay_id="+param.prepayid,
+                    signType: "RSA",
+                    paySign: param.sign,
+                    success: res => {
+                        uni.showToast({
+                            title: '支付成功!'
+                        });
+                        setTimeout(res=>{
+                            uni.switchTab({
+                                url:'/pages/order/index'
+                            })
+                        },1000)
+                    },
+                    fail: res => {
+                        console.log(res)
+                        uni.showModal({
+                            content: '支付失败',
+                            showCancel: false
+                        });
+
+                        setTimeout(res=>{
+                            uni.switchTab({
+                                url:'/pages/order/index'
+                            })
+                        },1000)
+
+                    }
+                });
+            }).catch(() =>{
+                uni.showToast({
+                    title: "操作失败"
+                })
             });
-            setTimeout(res => {
-              uni.switchTab({
-                url: '/pages/order/index'
-              })
-            }, 1000)
-          },
-          fail: res => {
-            console.log(res)
-            uni.showModal({
-              content: '支付失败',
-              showCancel: false
+        },
+
+        //余额支付
+        balancePay(){
+
+            let that = this;
+            // if(this.password.length< 6 ){
+            //     uni.showToast({
+            //         title: "交易密码不能小于6位"
+            //     })
+            //     return ;
+            // }
+            // this.$refs.passwordPopup.close()
+
+            this.$api.balancePay({
+                orderNo: this.subOrderNo,
+                password: ''
+            }).then((res)=>{
+                that.$refs.popup.close()
+                uni.showToast({
+                    title: '支付成功!'
+                });
+
+                setTimeout(res=>{
+                    uni.switchTab({
+                        url:'/pages/order/index'
+                    })
+                },1000)
+
+
+                this.getUserInfo()
+            }).catch((res) =>{
+              console.log(res)
+                that.$refs.popup.close()
+              let msg = res.data.msg || '操作失败';
+                uni.showToast({
+                    title: msg,
+                  icon:'error'
+                })
+
+                // setTimeout(res=>{
+                //     uni.switchTab({
+                //         url:'/pages/order/index'
+                //     })
+                // },1000)
             });
 
-            setTimeout(res => {
-              uni.switchTab({
-                url: '/pages/order/index'
-              })
-            }, 1000)
+        },
+
+        getUserInfo(){
+            this.$api.getUserInfo().then(res=>{
+                console.log('++++++++++++获取用户信息++++++++++++++++++',res)
+                uni.setStorageSync('userInfo',res.data.data)
+                this.userInfo = res.data.data
+            })
+
+        },
+
+        commonGeneralOrder(){
+            this.$refs.popup.close()
+          this.$api.commonGeneralOrder({
+              orderType: 1,
+              serviceObjectId: this.serviceObject.id,
+              serviceAttribute: 2,
+              serviceStoreId: this.store.storeId,
+              serviceTypeId:this.storeServiceList[this.storeServiceIndex].id,
+              serviceDate:this.periodDateList[this.periodDateIndex].label,
+              serviceUserId:this.serviceTeacher.personId,
+              serviceStartTime:this.periodTimeList[this.periodTimeIndex].label,
+              timeRangeId:this.serviceTeacher.crewPeriodId,
+              remark:this.remark
+          }).then(res=>{
+              this.orderNo=res.data.data.orderNo
+              this.subOrderNo=res.data.data.subOrderNo
+              if (res.data.data.subOrderNo === null){
+                    uni.switchTab({
+                        url:'/pages/order/index'
+                    })
+              }else{
+                  if (this.curServiceTab === 1){
+                      //开启余额支付密码框
+                    // this.$refs.passwordPopup.open()
+
+                      this.balancePay()
+
+                  }
+                  if (this.curServiceTab === 2){
+                      //调微信支付
+                      this.wechatPay()
+                  }
+              }
 
-          }
-        });
-      }).catch(() => {
-        uni.showToast({
-          title: "操作失败"
-        })
-      });
-    },
-
-    //余额支付
-    balancePay() {
-
-      let that = this;
-      // if(this.password.length< 6 ){
-      //     uni.showToast({
-      //         title: "交易密码不能小于6位"
-      //     })
-      //     return ;
-      // }
-      // this.$refs.passwordPopup.close()
-
-      this.$api.balancePay({
-        orderNo: this.subOrderNo,
-        password: ''
-      }).then((res) => {
-        that.$refs.popup.close()
-        uni.showToast({
-          title: '支付成功!'
-        });
-
-        setTimeout(res => {
-          uni.switchTab({
-            url: '/pages/order/index'
           })
-        }, 1000)
-
-
-        this.getUserInfo()
-      }).catch((res) => {
-        console.log(res)
-        that.$refs.popup.close()
-        let msg = res.data.msg || '操作失败';
-        uni.showToast({
-          title: msg,
-          icon: 'error'
-        })
-
-        // setTimeout(res=>{
-        //     uni.switchTab({
-        //         url:'/pages/order/index'
+        },
+
+
+
+
+        //获取预约费用
+        getAppointmentPrice(){
+            this.$api.getAppointmentPrice({
+                storeId: this.store.storeId,
+                date: this.periodDateList[this.periodDateIndex].label,
+                timeRangeId: this.serviceTeacher.crewPeriodId,
+                servicePersonId: this.serviceTeacher.personId,
+                serviceProjectId:this.storeServiceList[this.storeServiceIndex].id
+            }).then(res=>{
+                this.price= res.data.data.price
+            })
+        },
+
+        //选择服务人员
+        chooseServiceTeacher(){
+
+            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.periodDateIndex].label + '&time='+this.periodTimeList[this.periodTimeIndex].value
+            })
+        },
+
+        //获取排班日期
+        selectDate(){
+            console.log(this.store)
+            this.$api.selectDate({
+                organization:this.store.storeId
+            }).then(res =>{
+                this.periodDateList = res.data.data
+                // this.selectPeriodByDate(res.data.data[0].label)
+                this.getServiceTime(res.data.data[0].label);
+            })
+        },
+
+        //获取门店排班时段
+        // selectPeriodByDate(date){
+        //     this.$api.selectPeriodByDate({
+        //         organization:this.store.storeId,
+        //         schedulingDate:date
+        //     }).then(res =>{
+        //         this.periodTimeList = res.data.data
+        //         if (this.periodTimeList.length===0){
+        //             uni.$u.toast('暂无排班时段')
+        //         }
         //     })
-        // },1000)
-      });
-
-    },
-
-    getUserInfo() {
-      this.$api.getUserInfo().then(res => {
-        console.log('++++++++++++获取用户信息++++++++++++++++++', res)
-        uni.setStorageSync('userInfo', res.data.data)
-        this.userInfo = res.data.data
-      })
-
-    },
-
-    commonGeneralOrder() {
-      this.$refs.popup.close()
-
-      this.$api.commonGeneralOrder({
-        orderType: 1,
-        serviceObjectId: this.serviceObject.id,
-        serviceAttribute: 2,
-        serviceStoreId: this.store.storeId,
-        serviceTypeId: this.storeServiceList[this.storeServiceIndex].id,
-        serviceDate: this.periodDateList[this.periodDateIndex].label,
-        serviceUserId: this.serviceTeacher.personId,
-        serviceStartTime: this.periodTimeList[this.periodTimeIndex].label,
-        timeRangeId: this.serviceTeacher.crewPeriodId,
-        remark: this.remark
-      }).then(res => {
-        this.orderNo = res.data.data.orderNo
-        this.subOrderNo = res.data.data.subOrderNo
-        uni.showLoading({
-          title:'加载中...'
-        });
-        if (res.data.data.subOrderNo === null) {
-          uni.switchTab({
-            url: '/pages/order/index'
-          })
-        } else {
-          if (this.curServiceTab === 1) {
-            //开启余额支付密码框
-            // this.$refs.passwordPopup.open()
-            this.balancePay()
-          }
-          if (this.curServiceTab === 2) {
-            //调微信支付
-            this.wechatPay()
+        // },
+
+      //获取门店排班时段
+      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('暂无排班时段')
           }
-        }
-
-      })
-      setTimeout(()=>{
-        uni.hideLoading()
-      },0)
-    },
-
-
-    //获取预约费用
-    getAppointmentPrice() {
-      this.$api.getAppointmentPrice({
-        storeId: this.store.storeId,
-        date: this.periodDateList[this.periodDateIndex].label,
-        timeRangeId: this.serviceTeacher.crewPeriodId,
-        servicePersonId: this.serviceTeacher.personId,
-        serviceProjectId: this.storeServiceList[this.storeServiceIndex].id
-      }).then(res => {
-        this.price = res.data.data.price
-      })
-    },
-
-    //选择服务人员
-    chooseServiceTeacher() {
-
-      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.periodDateIndex].label + '&time=' + this.periodTimeList[this.periodTimeIndex].value
-      })
-    },
-
-    //获取排班日期
-    selectDate() {
-      console.log(this.store)
-      this.$api.selectDate({
-        organization: this.store.storeId
-      }).then(res => {
-        this.periodDateList = res.data.data
-        // this.selectPeriodByDate(res.data.data[0].label)
-        this.getServiceTime(res.data.data[0].label);
-      })
-    },
-
-    //获取门店排班时段
-    // selectPeriodByDate(date){
-    //     this.$api.selectPeriodByDate({
-    //         organization:this.store.storeId,
-    //         schedulingDate:date
-    //     }).then(res =>{
-    //         this.periodTimeList = res.data.data
-    //         if (this.periodTimeList.length===0){
-    //             uni.$u.toast('暂无排班时段')
-    //         }
-    //     })
-    // },
-
-    //获取门店排班时段
-    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({}).then((res) => {
-        this.serviceObject = res.data.data[0]
-      }).catch((err) => {
-        uni.showToast({
-          title: "操作失败"
         })
-      });
-    },
-
-    getServiceObject() {
-      uni.navigateTo({
-        url: '/orderPages/serviceObject/index'
-      })
-    },
-    selectedServiceObject(e) {
-      this.serviceObject = e
-    },
-
-    selectedServiceTeacher(e) {
-      this.serviceTeacher = e
-      this.getAppointmentPrice()
-    },
-
-    bindPickerChange(e) {
-      this.storeServiceIndex = e.detail.value
-      console.log(e)
-    },
-    bindPickerChange1(e) {
-      this.periodDateIndex = e.detail.value
-      this.getServiceTime(this.periodDateList[e.detail.value].label)
-      this.serviceTeacher = {};
-      console.log(e)
-    },
-    bindPickerChange2(e) {
-      this.periodTimeIndex = e.detail.value
-      this.serviceTeacher = {}
-      console.log(e)
-    },
-
-    category() {
-      this.$api.category({storeId: this.store.storeId}).then(res => {
-        this.storeServiceList = res.data.data
-      })
-
-    },
+      },
+
+        // 查询服务对像信息列表
+        listServiceObject(){
+            this.$api.listServiceObject({}).then((res)=>{
+                this.serviceObject = res.data.data[0]
+            }).catch((err) =>{
+                uni.showToast({
+                    title: "操作失败"
+                })
+            });
+        },
+
+        getServiceObject(){
+            uni.navigateTo({
+                url:'/orderPages/serviceObject/index'
+            })
+        },
+        selectedServiceObject(e){
+            this.serviceObject = e
+        },
+
+        selectedServiceTeacher(e){
+            this.serviceTeacher = e
+            this.getAppointmentPrice()
+        },
+
+        bindPickerChange(e){
+            this.storeServiceIndex= e.detail.value
+            console.log(e)
+        },
+        bindPickerChange1(e){
+            this.periodDateIndex= e.detail.value
+            this.getServiceTime(this.periodDateList[e.detail.value].label)
+          this.serviceTeacher = {};
+            console.log(e)
+        },
+        bindPickerChange2(e){
+            this.periodTimeIndex= e.detail.value
+          this.serviceTeacher = {}
+            console.log(e)
+        },
+
+        category(){
+            this.$api.category({storeId:this.store.storeId}).then(res=>{
+                this.storeServiceList= res.data.data
+            })
+
+        },
 
-  }
+    }
 }
 </script>
 
 <style scoped lang="scss">
-@import '/common/css/common.css';
-@import './index.rpx.scss';
+    @import '/common/css/common.css';
+    @import './index.rpx.scss';
 </style>

+ 30 - 5
orderPages/serviceObject/index.vue

@@ -2,18 +2,17 @@
     <view class="" >
         <view v-for="(item,index) in serviceObjectList" @click="chooseServiceObject(item)" class="h-item-row">
             <view class="h-img">
-                <image v-if="item.imgUrl" :src="item.imgUrl" mode=""></image>
-                <image v-else src="../../static/logo.png" mode=""></image>
+                <image :src="item.imgUrl || '/static/logo.png'" mode=""></image>
             </view>
             <view class="h-item-content">
                 <view class="h-title">
                     <view class="name">
-                        <text v-if="item.nickName">{{item.nickName}}</text>
-                        <text v-else>未填写</text>
+                        <text>{{item.nickName || '未填写'}}</text>
                     </view>
                 </view>
                 <view class="h-desc">
                     <text>关系:{{item.blood}}</text>
+                    <text>权益券</text>
                 </view>
                 <view class="h-content">
                     <view class="h-text">
@@ -22,6 +21,9 @@
                     </view>
                 </view>
             </view>
+            <view v-if="item.haveEquityCard" class="flex-col justify-center">
+                <text class="b">权益券</text>
+            </view>
         </view>
     </view>
 </template>
@@ -81,6 +83,7 @@
 </script>
 
 <style scoped lang="scss">
+    @import '/common/css/common.css';
     .h-item-row{
         display: flex;
         font-family: PingFangSC-Medium, PingFang SC;
@@ -97,6 +100,7 @@
             }
         }
         .h-item-content{
+            width: 350rpx;
             .h-title{
                 font-size: 16px;
                 font-weight: 500;
@@ -128,8 +132,11 @@
                 font-weight: 400;
                 line-height: 25px;
                 .h-text{
-                    padding-left: 4px;
+                    width: 350rpx;
                     color: #999999;
+                    white-space: nowrap;
+                    overflow: hidden;
+                    text-overflow: ellipsis;
                 }
                 .h-text1{
                     color: #ED569F;
@@ -137,4 +144,22 @@
             }
         }
     }
+    .a{
+        font-size: 28rpx;
+        line-height: 60rpx;
+        padding: 0 20rpx;
+        background: green;
+    }
+    .b{
+        font-size: 24rpx;
+        font-family: PingFangSC-Regular, PingFang SC;
+        color: #9ed733;
+        background: #e9f6d1;
+        padding: 6rpx 16rpx;
+        margin-left: 16rpx;
+        border-radius: 12rpx;
+    }
+    .bord{
+        border: 1px solid red;
+    }
 </style>

+ 7 - 1
orderPages/storeService/index.vue

@@ -51,7 +51,7 @@ export default {
     }
   },
   onLoad() {
-    this.listServiceObject()
+    // this.listServiceObject()
   },
   onShow() {
     // 服务对象
@@ -105,6 +105,12 @@ export default {
     },
 
     commonGeneralOrder() {
+
+      if(this.serviceObject){
+        uni.$u.toast('请选择服务对象')
+        return
+      }
+
       this.$api.commonGeneralOrder({
         orderType: 1,
         serviceObjectId: this.serviceObject.id,