Explorar el Código

当日排队下单

zhanghui hace 2 años
padre
commit
5758fc02c5
Se han modificado 3 ficheros con 368 adiciones y 164 borrados
  1. 23 13
      orderPages/bookService/index.vue
  2. 153 71
      orderPages/storeService/index.rpx.scss
  3. 192 80
      orderPages/storeService/index.vue

+ 23 - 13
orderPages/bookService/index.vue

@@ -147,16 +147,16 @@
 					remark: '',
 					serviceDate:'',
 					childService:[
-							{
-								periodDate:'',//回显需要,不做参数
-								serviceObjectId: '',
-								facePhotoUrl:'', //回显需要,不做参数
-								nickName:'', //回显需要,不做参数
-								serviceUserId: '',
-								personName:'',//回显需要,不做参数
-								fee:'',//回显需要,不做参数
-								serviceStartTime: ''
-						}
+						// 	{
+						// 		periodDate:'',//回显需要,不做参数
+						// 		serviceObjectId: '',
+						// 		facePhotoUrl:'', //回显需要,不做参数
+						// 		nickName:'', //回显需要,不做参数
+						// 		serviceUserId: '',
+						// 		personName:'',//回显需要,不做参数
+						// 		fee:'',//回显需要,不做参数
+						// 		serviceStartTime: ''
+						// }
 					]
 				}
 			}
@@ -287,11 +287,21 @@
 					this.serviceObjectList = res.data.data
 					this.getImgUrlByBannerOssId(this.serviceObjectList);
 
-					if (this.orderParam.childService.length === 1) {
+					if (this.orderParam.childService.length === 0) {
 						let selectServiceObject = this.serviceObjectList[0]
-						this.orderParam.childService[0].serviceObjectId = selectServiceObject.id,
-						this.orderParam.childService[0].nickName = selectServiceObject.nickName,
 						this.serviceObjectList[0].select = true
+
+						let childService ={
+							periodDate: '',
+							serviceObjectId: selectServiceObject.id,
+							facePhotoUrl:selectServiceObject.facePhotoUrl,
+							nickName:selectServiceObject.nickName,
+							serviceUserId: -1 ,
+							fee:'' ,
+							serviceStartTime: '' ,
+						}
+						this.orderParam.childService.push(childService)
+
 					} else {
 						for (let selectServiceObject of this.orderParam.childService) {
 							for (let serviceObject of this.serviceObjectList) {

+ 153 - 71
orderPages/storeService/index.rpx.scss

@@ -1,90 +1,172 @@
-.tabBarLineHeight {
-    height: 138rpx;
+.page{
+  background: #F7F7F7;
+}
+.group{
+  background: #FFFFFF;
+  padding: 24rpx 32rpx;
+}
+.serob{
+  font-size: 32rpx;
+  font-weight: bold;
+  color: #333333;
+}
+.serobItems{
+  margin-top: 32rpx;
+  height: 206rpx;
 }
+.scrollX{
+  height: 206rpx;
+  white-space: nowrap;
+  min-width: 150rpx;
+  max-width: 506rpx;
 
-.tabBarView {
-    position: fixed;
-    bottom: 32rpx;
-    left: 32rpx;
-    .submitButton {
-        text-align: center;
-        line-height: 84rpx;
-        width: 686rpx;
-        height: 84rpx;
-        background: #FFE05C;
-        border-radius: 54rpx;
-    }
 }
+.serobItem{
+  width: 150rpx;
+  height: 206rpx;
+  text-align: center;
+  margin-left: 28rpx;
+  position: relative;
 
-.box_4 {
-    display: flex;
-    flex-direction: column;
-    padding: 24rpx 32rpx 1026rpx 32rpx;
 }
+.serobItem:first-child {
+  margin-left: 0rpx;
+}
+.serobImgView{
+  width: 146rpx;
+  height: 146rpx;
+  overflow: hidden;
+}
+.serobImg{
+  width: 146rpx;
+  height: 146rpx;
+  border-radius: 75rpx;
 
-.group_1 {
-    width: 686rpx;
-    flex-direction: row;
-    display: flex;
-    justify-content: space-between;
+}
+.addSerobImg{
+  width: 146rpx;
+  height: 146rpx;
+  border-radius: 75rpx;
+  margin-left: 28rpx;
+  border: 2rpx dashed #DDDDDD;
+  font-size: 120rpx;
+  text-align: center;
+  line-height: 130rpx;
 }
 
-.text-group_2 {
-    //border: 2rpx solid blue;
-    width: 650rpx;
-    display: flex;
-    flex-direction: column;
-    //justify-content: space-between;
-}
-.text-group_3{
-    //border: 2rpx solid blue;
-    width: 686rpx;
-    display: flex;
-    //flex-direction: column;
-    justify-content: space-between;
+.serobName{
+  height: 40rpx;
+  font-size: 24rpx;
+  font-weight: 400;
+  color: #666666;
+  line-height: 40rpx;
+  margin-top: 16rpx;
 }
+.serobV{
+  width: 32rpx;
+  height: 32rpx;
+  position: absolute;
+  top: 0;
+  right: 0;
+}
+.serobVicon{
+  width: 32rpx;
+  height: 32rpx;
+}
+
 
-.text_4 {
-    overflow-wrap: break-word;
-    color: rgba(153, 153, 153, 1);
-    font-size: 28rpx;
-    font-family: PingFangSC-Regular;
-    font-weight: normal;
-    text-align: left;
-    white-space: nowrap;
-    line-height: 44rpx;
-    margin-top: 16rpx;
-}
-.text_5 {
-    font-size: 24rpx;
-    color: red;
-    line-height: 30rpx;
-}
-.groupItem1{
-    height: 220rpx;
-    border-bottom: 1px solid #EEEEEE;
+.hintView{
+  width: 686rpx;
+  height: 104rpx;
+  background: #FFF7EA;
+  border-radius: 16rpx;
+  border: 2rpx solid #FFFFFF;
+  margin: 24rpx 32rpx;
+}
+.hint{
+  width: 24rpx;
+  height: 24rpx;
+  border-radius: 12rpx;
+  text-align: center;
+  background:   #FFAF36;
+  color: #FFFFFF;
+  font-size: 18rpx;
+  margin-left: 10rpx;
+}
+.hintCentent{
+  font-size: 24rpx;
+  font-weight: 400;
+  color: #FFAF36;
+  line-height: 40rpx;
+  margin-left: 16rpx;
+  margin-top: 12rpx;
+}
+.marginTop{
+  margin-top: 24rpx;
+}
+.selectSerobImg{
+  width: 80rpx;
+  height: 80rpx;
+  border-radius: 40rpx;
+  margin-bottom: 40rpx;
+}
+.selectSerobName{
+  font-size: 24rpx;
+  font-weight: 400;
+  color: #666666;
+  line-height: 80rpx;
+  margin-left: 16rpx;
+}
+.groupItem{
+  height: 92rpx;
+  border-bottom: 1px solid #EEEEEE;
 }
 .groupItemKey{
-    font-size: 28rpx;
-    font-weight: bold;
-    color: #333333;
+  font-size: 28rpx;
+  width: 200rpx;
+  font-weight: bold;
+  color: #333333;
+  line-height: 92rpx;
 }
 .groupItemContent{
-    font-size: 28rpx;
-    font-weight: 400;
-    color: #999999;
+  font-size: 28rpx;
+  line-height: 92rpx;
+  font-weight: 400;
+  width: 486rpx;
+  color: #999999;
 }
-
-.thumbnail_2 {
-    width: 32rpx;
-    height: 32rpx;
-    margin: 66rpx 0 6rpx 0;
+.tabBarLineHeight {
+  height: 138rpx;
 }
 
-.group_2 {
-    background-color: rgba(238, 238, 238, 1.000000);
+.tabBarView {
+  width: 750rpx;
+  height: 138rpx;
+  background: #ffffff;
+  position: fixed;
+  left: 0;
+  bottom: 0;
+
+  .submitButton {
+    text-align: center;
+    line-height: 84rpx;
     width: 686rpx;
-    height: 2rpx;
-    margin-top: 24rpx;
-    display: flex
+    height: 84rpx;
+    background: #FFE05C;
+    border-radius: 54rpx;
+    margin-left: 32rpx;
+  }
+}
+.textareaView{
+  height: 280rpx;
+  background: #FAFAFA;
+  border-radius: 16rpx;
+  margin-top: 16rpx;
+  margin-bottom: 32rpx;
+
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #999999;
+  padding: 24rpx;
 }

+ 192 - 80
orderPages/storeService/index.vue

@@ -1,131 +1,244 @@
 <template>
-  <view class="content">
-    <view>
-      <view class="box_4">
-        <view class="flex-col justify-around groupItem1">
-          <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>
-          <text class="text_5">娇宝,此排队提交后只针对一个服务对象,服务对象指接受娇骄儿理发服务的儿童</text>
-        </view>
-        <view class="group_1">
-          <picker @change="bindPickerChange" mode='selector' range-key="typeName" :value="index"
-                  :range="storeServiceList">
-            <view>
-              <text class="groupItemKey ">请选择服务类型</text>
-              <view class="text-group_3 ">
-                <view class="text_4">{{ storeServiceList[index].typeName || '111111' }}</view>
-                <u-icon name="arrow-right" color="#666" size="18"></u-icon>
+  <view class="page">
+    <view class="flex-col group">
+      <view class="serob"><text>服务对象</text></view>
+      <view class="serobItems flex-row">
+        <scroll-view class="scrollX" scroll-x>
+          <view class="flex-row">
+            <view class="serobItem flex-col" v-for="(item,index) in serviceObjectList" :key="index">
+              <view class="serobImgView" @click="selectServiceObject(item)">
+                <image class="serobImg" mode="aspectFill" :src="item.facePhotoUrl || '/static/logo.png'"></image>
+              </view>
+              <text class="serobName">{{item.nickName || '未填写'}}</text>
+              <view class="serobV" v-if="item.select === true">
+                <image class="serobVicon" src="/static/order/ud20.png"></image>
               </view>
             </view>
-          </picker>
+          </view>
+        </scroll-view>
+        <view class="addSerobImg" @click="addServiceObject">
+          <text>+</text>
+        </view>
+      </view>
+    </view>
+
+
+    <view class="flex-row hintView">
+      <view class="flex-col justify-center">
+        <view class="hint">
+          <text>!</text>
         </view>
-        <view class="group_2"></view>
       </view>
-      <view class="tabBarLineHeight"></view>
-      <view class="tabBarView">
-        <view class="submitButton" @click="commonGeneralOrder">提交</view>
+      <view class="hintCentent">
+        <text>娇宝,此排队提交后只针对一个服务对象,服务对象指接受娇骄儿理发服务的儿童</text>
+      </view>
+
+    </view>
+
+    <view class="flex-col group marginTop" v-for="(item, index) in  orderParam.childService" :key="index">
+      <view class="flex-row">
+        <image class="selectSerobImg" mode="aspectFill" :src="item.facePhotoUrl || '/static/logo.png'"></image>
+        <text class="selectSerobName">{{item.nickName || '未填写'}}</text>
+      </view>
+
+      <view class="flex-row  groupItem ">
+        <view class="groupItemKey ">
+          <text>服务日期</text>
+        </view>
+        <view class="flex-row justify-between groupItemContent ">
+          <text>{{ orderParam.serviceDate || '请选择服务日期' }}</text>
+        </view>
+      </view>
+
+      <view class="flex-row  groupItem">
+        <view class="groupItemKey">
+          <text>服务人员</text>
+        </view>
+        <view class="flex-row justify-between groupItemContent" >
+          <text>系统随机</text>
+        </view>
+      </view>
+
+      <view class="flex-row  groupItem">
+        <view class="groupItemKey">
+          <text>服务时段</text>
+        </view>
+        <view class="flex-row justify-between groupItemContent">
+          <text>系统随机</text>
+        </view>
+      </view>
+    </view>
+
+
+    <view class="flex-col group marginTop">
+      <view class="groupItemKey">
+        <text>服务定制</text>
+      </view>
+      <view class="textareaView">
+        <textarea v-model="orderParam.remark" placeholder-style="color:#999999;fontSize:28rpx" placeholder="如有其它特殊需求,请在此输入您的需求" />
       </view>
     </view>
+
+    <view class="tabBarLineHeight "></view>
+    <view class="tabBarView">
+      <view class="submitButton " @click="commonGeneralOrder">提交</view>
+    </view>
+
   </view>
 </template>
 
 <script>
-import tabBar from "../../components/tabBar/tabBar";
 
 export default {
+
   components: {
-    tabBar
+
   },
   data() {
     return {
       userInfo:{},
-      serviceObject: {},
-      store: {},
-      storeServiceList: [],
-      index: 0
-
+      store:{},
+      serviceObjectList: [],
+      requestStatus: false,
+      orderParam:{
+        orderType: 1,
+        serviceAttribute: 1,
+        serviceStoreId: '',
+        remark: '',
+        serviceDate:'',
+        childService:[
+          // {
+          //   periodDate:'',//回显需要,不做参数
+          //   serviceObjectId: '',
+          //   facePhotoUrl:'', //回显需要,不做参数
+          //   nickName:'', //回显需要,不做参数
+          //   serviceUserId: '',
+          //   personName:'',//回显需要,不做参数
+          //   fee:'',//回显需要,不做参数
+          //   serviceStartTime: ''
+          // }
+        ]
+      }
 
     }
   },
   onLoad() {
-    // this.listServiceObject()
+    this.store = uni.getStorageSync('storeInfo')
     this.userInfo = uni.getStorageSync('userInfo')
+    this.orderParam.serviceStoreId = this.store.storeId
+    let date = new Date();
+    this.orderParam.serviceDate = date.getFullYear() + '-' + ('0' + (date.getMonth() +1) ).slice(-2) + '-' + ('0' + date.getDate()).slice(-2)
+
   },
   onShow() {
     // 服务对象
-    uni.$off()
-    uni.$on('selectedServiceObject', this.selectedServiceObject);
-
-    this.store = uni.getStorageSync('storeInfo')
-    // this.storeAllServiceList()
-    this.category()
+    this.listServiceObject()
   },
   methods: {
 
-    getServiceObject() {
-      uni.navigateTo({
-        url: '/orderPages/serviceObject/index'
+    // 查询服务对接信息列表
+    listServiceObject() {
+      this.$api.listServiceObject(this.reqParm).then((res) => {
+        console.log(res)
+        this.serviceObjectList = res.data.data
+        this.getImgUrlByBannerOssId(this.serviceObjectList);
+
+        if (this.orderParam.childService.length === 0) {
+          let selectServiceObject = this.serviceObjectList[0]
+          this.serviceObjectList[0].select = true
+
+          let childService ={
+            periodDate: '',
+            serviceObjectId: selectServiceObject.id,
+            facePhotoUrl:selectServiceObject.facePhotoUrl,
+            nickName:selectServiceObject.nickName,
+            serviceUserId: -1 ,
+            fee:'' ,
+            serviceStartTime: '' ,
+          }
+          this.orderParam.childService.push(childService)
+        } else {
+          for (let selectServiceObject of this.orderParam.childService) {
+            for (let serviceObject of this.serviceObjectList) {
+              if (selectServiceObject.id === serviceObject.id) {
+                serviceObject.select = true
+              }
+            }
+          }
+        }
+
+
       })
     },
-
-    // storeAllServiceList(){
-    //     this.$api.storeAllServiceList({storeId:this.store.storeId}).then(res=>{
-    //         this.storeServiceList= res.data.data
-    //     })
-    // },
-
-    // 查询服务对像信息列表
-    listServiceObject(){
-      this.$api.listServiceObject(this.reqParm).then((res)=>{
-        this.serviceObject = res.data.data[0]
-      }).catch((err) =>{
-        uni.showToast({
-          title: "操作失败"
-        })
-      });
+    // 获取图片
+    getImgUrlByBannerOssId(items) {
+      for (let i = 0; i < items.length; i++) {
+        if (items[i].facePhoto) {
+          this.$api.getImgUrlByOssId({
+            ossId: items[i].facePhoto
+          }).then(res => {
+            items[i].facePhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
+            this.$set(this.serviceObjectList, i, items[i])
+            if (i === 0){
+              this.orderParam.childService[0].facePhotoUrl =res.data.data[0].url.replace(/^http:/, "https:")
+            }
+          })
+        }
+      }
     },
 
-    selectedServiceObject(e) {
-      this.serviceObject = e
-      console.log('++++++++++++selectedServiceObject++++++++++++++', e)
+    addServiceObject() {
+      uni.navigateTo({
+        url: '/myPages/ServiceObjectManagement/index'
+      })
     },
 
-    category() {
-      this.$api.category({storeId: this.store.storeId}).then(res => {
-        this.storeServiceList = res.data.data
-        console.log('+++++++++++++++category+++++++++++++++++', res)
-      })
+    selectServiceObject(item) {
+      if (item.select) {
+        this.orderParam.childService = this.orderParam.childService.filter(selectServiceObject =>
+                selectServiceObject.serviceObjectId !== item.id)
+      } else {
+        let childService ={
+          periodDate: '',
+          serviceObjectId: item.id,
+          facePhotoUrl:item.facePhotoUrl,
+          nickName:item.nickName,
+          serviceUserId: -1 ,
+          fee:'' ,
+          serviceStartTime: '' ,
+        }
+        this.orderParam.childService.push(childService)
 
+      }
+      item.select = !item.select
+      this.price = 0
+      for (let childService of this.orderParam.childService) {
+        this.price =  this.price * 1 + childService.fee * 1
+      }
     },
-    bindPickerChange(e) {
-      this.index = e.detail.value
-      console.log(e)
-    },
+
+
 
     commonGeneralOrder() {
 
 
-      if(!this.serviceObject){
+      if(!this.orderParam.childService.length){
         uni.$u.toast('请选择服务对象')
         return
       }
+      if (this.requestStatus) {
+        return;
+      }
+      this.requestStatus = true
 
-      this.$api.commonGeneralOrder({
-        orderType: 1,
-        serviceObjectId: this.serviceObject.id,
-        serviceAttribute: 1,
-        serviceStoreId: this.store.storeId,
-        serviceTypeId: this.storeServiceList[this.index].id
-      }).then(res => {
+      this.$api.commonGeneralOrder(this.orderParam).then(res => {
+        this.requestStatus = false
         uni.switchTab({
           url: '/pages/order/index'
         })
 
+      }).catch(err=>{
+        this.requestStatus = false
       })
     }
 
@@ -134,6 +247,5 @@ export default {
 </script>
 
 <style scoped lang="scss">
-@import '../../common/css/common.css';
 @import './index.rpx.scss';
 </style>