Explorar el Código

feat: 当日排队 明日预约 新增门店选择

xuyunhui hace 2 años
padre
commit
80fd15a9b7

+ 163 - 3
orderPages/bookService/index.vue

@@ -19,7 +19,31 @@
             					transform: 'scale(1.05)'
        							 }" @click="clickPeriodDateList"></u-tabs>
 		</view>
+    <view class="store-wrap">
+      <view class="store-info">
+        <view class="logo">
+          <image src="../../static/index/u55.png" mode=""></image>
+        </view>
+        <view @click="gotoStoreChoose()" class="store-content">
+          <view class="h-row">
+            <view class="store-desc">
+              <view class="store-name">
+                <view class="">{{ storeInfo.storeName }}</view>
+              </view>
+            </view>
+            <view class="arrow-right">
+              <view class="change-store">更换门店</view>
+              <u-icon name="arrow-right" color="#333" size="16"></u-icon>
+            </view>
+          </view>
+          <view class="h-row">
+            <text class="address">地址:{{ storeInfo.address }}</text>
+            <!-- <text class="address">距你1.8km</text> -->
+          </view>
+        </view>
+      </view>
 
+    </view>
 		<view class="flex-col group">
 			<view class="serob"><text>服务对象</text></view>
 			<u-grid :border="false" col="4">
@@ -197,14 +221,13 @@
           dictType:'tomorrow_make_rule'
         },
         takeNumberRules:[],
+        storeInfo: {},
 			}
 		},
 		onLoad() {
 			this.store = uni.getStorageSync('storeInfo')
 			this.orderParam.serviceStoreId = this.store.storeId
-			//获取排班日期
-			this.selectDate()
-			this.getTemplateList()
+
 
 			this.timeoutId = setTimeout(()=>{
 				uni.showModal({
@@ -222,13 +245,72 @@
 			},1000*60*5)
 		},
 		onShow() {
+
 			this.userInfo = uni.getStorageSync('userInfo')
+      // 查询门店信息
+      const data = uni.getStorageSync('storeInfo');
+      this.store = uni.getStorageSync('storeInfo')
+      if (!data) {
+        // 获取位置信息查询门店列表数据
+        this.getLocation();
+      } else {
+        this.storeInfo = data;
+      }
+      //获取排班日期
+      this.selectDate()
+      this.getTemplateList()
       this.getSelectionRules(this.takeNumberData)
 		},
 		onUnload(){
 			clearTimeout(this.timeoutId);
 		},
 		methods: {
+// 获取门店列表数据
+      getStoreListData(data) {
+        let that = this;
+        // 用户绑定门店
+        this.$api.storeList(data).then((res) => {
+          console.log(res.data.data[0])
+          that.storeInfo = res.data.data[0]
+          // 更新用户选择的门店信息
+          uni.setStorageSync('storeInfo', res.data.data[0])
+        })
+      },
+      // 获取经纬度信息
+      getLocation() {
+        let that = this
+        console.log('+++++++++++++开始获取位置信息++++++++++++++++')
+        uni.getLocation({
+          type: 'gcj02',
+          success: function (res) {
+            console.log(res)
+            let latitude = res.latitude; // 纬度
+            let longitude = res.longitude; // 经度
+            let speed = res.speed; // 速度
+            let accuracy = res.accuracy; // 精确度
+            // 在这里可以对位置信息进行处理
+            console.log("纬度:" + latitude + ";经度" + longitude)
+            that.reqParm.latitude = latitude
+            that.reqParm.longitude = longitude
+            uni.setStorageSync('location', that.reqParm)
+            that.getStoreListData(that.reqParm)
+          },
+          fail:function (fail) {
+            console.log('获取用户地址失败==》',fail)
+            that.getStoreListData(that.reqParm)
+          },
+          complete:function (complete) {
+            console.log('获取用户地址失败or成功==》',complete)
+          }
+        });
+      },
+      // 去选择门店
+      gotoStoreChoose() {
+        uni.setStorageSync('router','1')
+        uni.redirectTo({
+          url: '/storePages/store/store-choose?type=1',
+        })
+      },
 
 			back(){
 				uni.switchTab({
@@ -720,4 +802,82 @@
 </script>
 <style scoped lang="scss">
 	@import './index.rpx.scss';
+  .store-wrap {
+    margin-top: 10rpx;
+    background-color: white;
+    .store-info {
+      display: flex;
+
+      .logo {
+        width: 10%;
+        text-align: center;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+
+        image {
+          width: 30px;
+          height: 30px;
+        }
+      }
+
+      .store-content {
+        width: 90%;
+        padding-bottom: 13px;
+
+        .h-row {
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+
+          .store-desc {
+            width: 90%;
+            display: flex;
+            line-height: 30px;
+            font-size: 14px;
+
+            .store-name {
+            }
+
+          }
+
+          .arrow-right {
+            text-align: right;
+            margin: 0 auto;
+            cursor: pointer;
+            padding-top: 3px;
+            width: 100px;
+            display: flex;
+            font-size: 14px;
+
+            .change-store {
+              text-align: right;
+              color: #666;
+            }
+
+            image {
+              width: 18px;
+              height: 18px;
+            }
+          }
+
+          .address {
+            color: #999999;
+            font-size: 12px;
+            padding-right: 12px;
+          }
+        }
+      }
+
+    }
+
+    .adress {
+      font-size: 22rpx;
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      padding-left: 80rpx;
+      color: #666;
+    }
+  }
 </style>

+ 159 - 0
orderPages/storeService/index.vue

@@ -3,7 +3,31 @@
 		<view class="periodDate">
 			<text>服务日期:{{orderParam.serviceDate}}</text>
 		</view>
+    <view class="store-wrap">
+      <view class="store-info">
+        <view class="logo">
+          <image src="../../static/index/u55.png" mode=""></image>
+        </view>
+        <view @click="gotoStoreChoose()" class="store-content">
+          <view class="h-row">
+            <view class="store-desc">
+              <view class="store-name">
+                <view class="">{{ storeInfo.storeName }}</view>
+              </view>
+            </view>
+            <view class="arrow-right">
+              <view class="change-store">更换门店</view>
+              <u-icon name="arrow-right" color="#333" size="16"></u-icon>
+            </view>
+          </view>
+          <view class="h-row">
+            <text class="address">地址:{{ storeInfo.address }}</text>
+            <!-- <text class="address">距你1.8km</text> -->
+          </view>
+        </view>
+      </view>
 
+    </view>
 		<view class="flex-col group">
 			<view class="serob"><text>服务对象</text></view>
 			<u-grid :border="false" col="4">
@@ -116,6 +140,7 @@
           dictType:'today_make_rule'
         },
         takeNumberRules:[],
+        storeInfo: {},
 			}
 		},
 		onLoad() {
@@ -141,6 +166,16 @@
 			},1000*60*5)
 		},
 		onShow() {
+
+      // 查询门店信息
+      const data = uni.getStorageSync('storeInfo');
+      this.store = uni.getStorageSync('storeInfo')
+      if (!data) {
+        // 获取位置信息查询门店列表数据
+        this.getLocation();
+      } else {
+        this.storeInfo = data;
+      }
 			this.getServicePersonTime()
 			this.getTemplateList()
       this.getSelectionRules(this.takeNumberData)
@@ -149,6 +184,52 @@
 			clearTimeout(this.timeoutId);
 		},
 		methods: {
+      // 获取门店列表数据
+      getStoreListData(data) {
+        let that = this;
+        // 用户绑定门店
+        this.$api.storeList(data).then((res) => {
+          console.log(res.data.data[0])
+          that.storeInfo = res.data.data[0]
+          // 更新用户选择的门店信息
+          uni.setStorageSync('storeInfo', res.data.data[0])
+        })
+      },
+      // 获取经纬度信息
+      getLocation() {
+        let that = this
+        console.log('+++++++++++++开始获取位置信息++++++++++++++++')
+        uni.getLocation({
+          type: 'gcj02',
+          success: function (res) {
+            console.log(res)
+            let latitude = res.latitude; // 纬度
+            let longitude = res.longitude; // 经度
+            let speed = res.speed; // 速度
+            let accuracy = res.accuracy; // 精确度
+            // 在这里可以对位置信息进行处理
+            console.log("纬度:" + latitude + ";经度" + longitude)
+            that.reqParm.latitude = latitude
+            that.reqParm.longitude = longitude
+            uni.setStorageSync('location', that.reqParm)
+            that.getStoreListData(that.reqParm)
+          },
+          fail:function (fail) {
+            console.log('获取用户地址失败==》',fail)
+            that.getStoreListData(that.reqParm)
+          },
+          complete:function (complete) {
+            console.log('获取用户地址失败or成功==》',complete)
+          }
+        });
+      },
+      // 去选择门店
+      gotoStoreChoose() {
+        uni.setStorageSync('router','0')
+        uni.redirectTo({
+          url: '/storePages/store/store-choose?type=1',
+        })
+      },
 			back(){
 				uni.switchTab({
 					url: '/pages/index/index',
@@ -382,4 +463,82 @@
 
 <style scoped lang="scss">
 	@import './index.rpx.scss';
+  .store-wrap {
+    margin-top: 10rpx;
+background-color: white;
+    .store-info {
+      display: flex;
+
+      .logo {
+        width: 10%;
+        text-align: center;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+
+        image {
+          width: 30px;
+          height: 30px;
+        }
+      }
+
+      .store-content {
+        width: 90%;
+        padding-bottom: 13px;
+
+        .h-row {
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+
+          .store-desc {
+            width: 90%;
+            display: flex;
+            line-height: 30px;
+            font-size: 14px;
+
+            .store-name {
+            }
+
+          }
+
+          .arrow-right {
+            text-align: right;
+            margin: 0 auto;
+            cursor: pointer;
+            padding-top: 3px;
+            width: 100px;
+            display: flex;
+            font-size: 14px;
+
+            .change-store {
+              text-align: right;
+              color: #666;
+            }
+
+            image {
+              width: 18px;
+              height: 18px;
+            }
+          }
+
+          .address {
+            color: #999999;
+            font-size: 12px;
+            padding-right: 12px;
+          }
+        }
+      }
+
+    }
+
+    .adress {
+      font-size: 22rpx;
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      padding-left: 80rpx;
+      color: #666;
+    }
+  }
 </style>

+ 25 - 4
storePages/store/store-choose.vue

@@ -87,7 +87,9 @@
                     latitude: 0
                 },
                 storeList: [],
-                type: '1'
+                type: '1',
+              navigateRouter:null
+
             }
         },
         onReady() {
@@ -105,6 +107,9 @@
                 this.type = option.type;
             }
         },
+      onShow(){
+        this.navigateRouter = uni.getStorageSync('router');
+      },
         methods: {
             getLocation() {
                 let that = this
@@ -129,10 +134,26 @@
             selectStore(item) {
                 // 更新用户选择的门店信息
                 uni.setStorageSync('storeInfo', item);
+                if(this.navigateRouter == 0){
+                  uni.redirectTo({
+                    url: '/orderPages/storeService/index'
+                  })
+                  uni.removeStorage({
+                    key: 'router'
+                  });
+                }else if(this.navigateRouter == 1){
+                  uni.redirectTo({
+                    url: '/orderPages/bookService/index'
+                  })
+                  uni.removeStorage({
+                    key: 'router'
+                  });
+                }else {
+                  uni.switchTab({
+                    url: '/pages/index/index'
+                  })
+                }
 
-                uni.switchTab({
-                    url: '/pages/index/index',
-                })
             },
             // 获取门店列表数据
             getStoreListData() {