Browse Source

feat(pages) feat 漏推

clp 3 years ago
parent
commit
a3d4bbaad5
31 changed files with 3024 additions and 0 deletions
  1. 24 0
      api/StaffApi.js
  2. 56 0
      api/address.js
  3. 46 0
      api/invoice.js
  4. 55 0
      api/order.js
  5. 110 0
      api/storeGoods.js
  6. 34 0
      api/storeList.js
  7. BIN
      images/groupmeallist/choose_store_goods.png
  8. BIN
      images/groupmeallist/toDelete.png
  9. 281 0
      pages/groupmeallist/addOrEditaddress/addOrEditaddress.js
  10. 10 0
      pages/groupmeallist/addOrEditaddress/addOrEditaddress.json
  11. 55 0
      pages/groupmeallist/addOrEditaddress/addOrEditaddress.wxml
  12. 97 0
      pages/groupmeallist/addOrEditaddress/addOrEditaddress.wxss
  13. 185 0
      pages/groupmeallist/address/address.js
  14. 10 0
      pages/groupmeallist/address/address.json
  15. 34 0
      pages/groupmeallist/address/address.wxml
  16. 73 0
      pages/groupmeallist/address/address.wxss
  17. 176 0
      pages/groupmeallist/couponlist/couponlist.js
  18. 6 0
      pages/groupmeallist/couponlist/couponlist.json
  19. 55 0
      pages/groupmeallist/couponlist/couponlist.wxml
  20. 232 0
      pages/groupmeallist/couponlist/couponlist.wxss
  21. 234 0
      pages/groupmeallist/goodsManagementStore/goodsManagementStore.js
  22. 5 0
      pages/groupmeallist/goodsManagementStore/goodsManagementStore.json
  23. 36 0
      pages/groupmeallist/goodsManagementStore/goodsManagementStore.wxml
  24. 180 0
      pages/groupmeallist/goodsManagementStore/goodsManagementStore.wxss
  25. 233 0
      pages/groupmeallist/goodsManagements/goodsManagements.js
  26. 10 0
      pages/groupmeallist/goodsManagements/goodsManagements.json
  27. 129 0
      pages/groupmeallist/goodsManagements/goodsManagements.wxml
  28. 170 0
      pages/groupmeallist/goodsManagements/goodsManagements.wxss
  29. 236 0
      utils/base.js
  30. 192 0
      utils/cache.js
  31. 60 0
      utils/location.js

+ 24 - 0
api/StaffApi.js

@@ -0,0 +1,24 @@
+import request from '../utils/request.js'
+
+class UserApi extends request {
+
+
+    // 商品列表
+    static getGoodsStaffList(params) {
+        return this.postRequest(`${this.BASE_GROUP_URL}open/staff/get-store-product-list`, params)
+    }
+
+
+     // 门店列表哗啦啦
+     static staffShopList(params) {
+        return this.postRequest(`${this.BASE_GROUP_URL}open/staff/get-store-list-by-staff`, params)
+    }
+
+     // 门店列表产品
+     static toggleline(params) {
+        return this.postRequest(`${this.BASE_GROUP_URL}open/staff/toggle-on-offline-product`, params)
+    }
+    
+}
+
+export default UserApi

+ 56 - 0
api/address.js

@@ -0,0 +1,56 @@
+import request from '../utils/request.js'
+
+class address extends request {
+
+
+  /**
+   * 获取用户地址列表
+   */
+  static getAdressList(params) {
+    return this.postRequest(`${this.BASE_GROUP_URL}open/user/get-address-list`, {
+      mobile:params.mobile,
+    });
+  }
+
+   /**
+   * 地址保存  
+   */
+
+  static addoreditaddress(params) {
+    return this.postRequest(`${this.BASE_GROUP_URL}open/user/add-edit-address`, {
+      mobile:params.mobile,
+      addressId:params.addressId,
+      name:params.name,
+      gender:params.gender,
+      phone:params.phone,
+      address:params.address,
+      longitude:params.longitude,
+      latitude:params.latitude,
+      houseNumber:params.houseNumber,
+      tagName:params.tagName,
+    });
+  }
+   /**
+   * 地址删除
+   */
+
+
+  static deladdress(params) {
+    return this.postRequest(`${this.BASE_GROUP_URL}open/user/delete-address`, {
+      mobile:params.mobile,
+      addressId:params.addressId
+    });
+  }
+
+
+  static getddress(params) {
+    return this.postRequest(`${this.BASE_GROUP_URL}open/user/get-address`, {
+      mobile:params.mobile,
+      addressId:params.addressId
+    });
+  }
+  
+
+}
+
+export default address

+ 46 - 0
api/invoice.js

@@ -0,0 +1,46 @@
+import request from '../utils/request.js'
+
+class invoice extends request {
+
+//获取发票列表
+  static getinvoicelist(params) {
+    return this.postRequest(`${this.BASE_GROUP_URL}open/user/get-invoice-list`, {
+      mobile:params.mobile,
+    });
+  }
+
+
+  //删除发票
+  static delinvoicebyid(params) {
+    return this.postRequest(`${this.BASE_GROUP_URL}open/user/delete-invoice`, {
+      mobile:params.mobile,
+      invoiceId:params.invoiceId,
+    });
+  }
+  
+
+    //获取发票详情
+    static getinvoicebyid(params) {
+      return this.postRequest(`${this.BASE_GROUP_URL}open/user/get-invoice`, {
+        mobile:params.mobile,
+        invoiceId:params.invoiceId,
+      });
+    }
+
+  //添加编辑发票
+  static addoreditinvoice(params) {
+    return this.postRequest(`${this.BASE_GROUP_URL}open/user/add-edit-invoice`, {
+        mobile:params.mobile,
+        invoiceId:params.invoiceId,
+        invoiceTitle:params.invoiceTitle,
+        invoiceNo:params.invoiceNo,
+        companyAddress:params.companyAddress,
+        companyPhone:params.companyPhone,
+        bankName:params.bankName,
+        bankAccount:params.bankAccount,
+    });
+  }
+
+}
+
+export default invoice

+ 55 - 0
api/order.js

@@ -0,0 +1,55 @@
+import request from '../utils/request.js'
+
+class order extends request {
+
+  static cancelOrder(params) {
+    return this.postRequest(`${this.BASE_GROUP_URL}open/order/cancel`, {
+        orderSn: params.orderSn,
+        mobile: params.mobile,
+    })
+}
+  /**
+   * 获取订单列表
+   */
+  static getOrderList(params) {
+    return this.postRequest(`${this.BASE_GROUP_URL}open/order/user-order-list`, {
+      mobile: params.mobile,
+      page: params.page || 1,
+      pageSize: params.pageSize || 10,
+      keyword: params.keyword || ''
+    });
+  }
+    /**
+     * 清空购物车
+     */
+    static emptyCart(params) {
+      return this.postRequest(`${this.BASE_GROUP_URL}open/order/empty-cart`, {
+          storeId: params.storeId,
+          mobile: params.mobile,
+          tableId: params.tableId,
+          orderMode:params.orderMode
+      })
+  }
+     /**
+     * 订单详情
+     */
+    static getOrderDetail(params) {
+      return this.postRequest(`${this.BASE_GROUP_URL}open/order/detail`, {
+          orderSn: params.orderSn,
+          mobile: params.mobile,        
+      })
+  }
+       /**
+     * 订单退款
+     */
+    static refund(params) {
+      return this.postRequest(`${this.BASE_GROUP_URL}open/order/refund`, {
+          mobile: params.mobile,
+          orderSn: params.orderSn,
+          reason: params.reason,
+          photoList:params.photoList     
+      })
+  }
+}
+
+export default order

+ 110 - 0
api/storeGoods.js

@@ -0,0 +1,110 @@
+import request from '../utils/request.js'
+
+
+class storeGoods extends request {
+
+  /**
+   * 获取分类店铺门店
+   */
+  static getExhibit(storeId) {
+    return this.postRequest(`${this.BASE_GROUP_URL}open/goods/exhibit`, {
+      storeId
+    });
+  }
+
+  /**
+   * 获取购物车数据
+   */
+  static getCartData(storeId, mobile, tableId, couponSn, orderMode) {
+    return this.postRequest(`${this.BASE_GROUP_URL}open/order/cart-detail`, {
+      storeId,
+      mobile,
+      tableId,
+      couponSn,
+      orderMode
+    }, true)
+
+    // 加入购物车
+
+
+  }
+
+
+  static comBoaddToCart(params) {
+
+    return this.postRequest(`${this.BASE_GROUP_URL}open/order/add-to-cart`, {
+      storeId: params.storeId,
+      mobile: params.mobile,
+      skuId: params.skuId,
+      num: params.num,
+      comboSkuList: params.comboSkuList,
+    }, true)
+
+  }
+
+  /**
+   * 创建订单
+   */
+  static createOrder(params) {
+    return this.postRequest(`${this.BASE_GROUP_URL}open/order/create`, {
+      storeId: params.storeId,
+      mobile: params.mobile,
+      couponSn: params.couponSn,
+    })
+  }
+
+  /**
+   * 获取支付卡券
+   */
+  static orderCouponForSelect(params) {
+    return this.postRequest(`${this.BASE_GROUP_URL}open/coupon/coupon-sn-list-for-select`, {
+      storeId: params.storeId,
+      mobile: params.mobile,
+      // tableId: params.tableId,
+    })
+  }
+
+  /**
+   * 订单拉起
+   */
+  static creatOrder(params) {
+    return this.postRequest(`${this.BASE_GROUP_URL}open/order/create`, {
+      mobile: params.mobile,
+      storeId: params.storeId,
+      couponSn: params.couponSn,
+      dinnerType: params.dinnerType,
+      addressId: params.addressId,
+      invoiceId: params.invoiceId,
+      phone: params.phone,
+      remark: params.remark,
+    })
+  }
+
+
+  /**
+   * 订单支付
+   */
+  static getPayParams(params) {
+    return this.postRequest(`${this.BASE_GROUP_URL}open/order/get-pay-params`, {
+      orderSn: params.orderSn,
+      payCode: params.payCode,
+      openId: params.openId,
+      isOrderPayment: true,
+      orderInfoPath: params.orderInfoPath,
+      productDetailPath: params.productDetailPath,
+    })
+  }
+
+
+
+  
+        //主动获取订单状态
+        static getPayStatus(orderSn) {
+          let params={
+            orderSn:orderSn
+          }
+          return this.postRequest(`${this.BASE_GROUP_URL}open/call/getPayStatus`, params);
+        }
+}
+
+export default storeGoods

+ 34 - 0
api/storeList.js

@@ -0,0 +1,34 @@
+import request from '../utils/request.js'
+
+class storeList extends request {
+
+
+  /**
+   * 获取最近的门店
+   */
+  static nearbyStoreList(longitude,latitude) {
+    return this.postRequest(`${this.BASE_GROUP_URL}open/store/pos-nearby`, {
+      longitude:longitude,
+      latitude:latitude
+    });
+  }
+
+
+  static getNearbyStoreList(page,pageSize,keyword="",longitude="",latitude="") {
+    return this.postRequest(`${this.BASE_GROUP_URL}open/store/nearby-store-list`, {
+      longitude:longitude,
+      latitude:latitude,
+      page:page,
+      pageSize:pageSize,
+      keyword:keyword
+    });
+  }
+
+
+
+
+
+
+}
+
+export default storeList

BIN
images/groupmeallist/choose_store_goods.png


BIN
images/groupmeallist/toDelete.png


+ 281 - 0
pages/groupmeallist/addOrEditaddress/addOrEditaddress.js

@@ -0,0 +1,281 @@
+// pages/groupmeallist/addOrEditaddress/addOrEditaddress.js
+const cache = require('../../../utils/cache.js');
+import address from '../../../api/address'
+import base from '../../../utils/base'
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+        mobile: '',
+        addressId: '',
+        name: '',
+        gender: '2',
+        phone: '',
+        address: '',
+        longitude: '',
+        latitude: '',
+        houseNumber: '',
+        tagName: '家',
+
+
+
+
+
+        tagList: [{
+            value: '家',
+            show: true,
+            id: 0
+        }, {
+            value: '公司',
+            show: false,
+            id: 1
+        }, {
+            value: '学校',
+            show: false,
+            id: 2
+        }, {
+            value: '其他',
+            show: false,
+            id: 3
+        }],
+        tagName: '家'
+
+    },
+
+    name: function (e) {
+
+        console.log("进入确定")
+        let name = e.detail.value;
+        this.data.lock = false;
+        this.setData({
+            name,
+        })
+    },
+
+
+
+    phone: function (e) {
+        console.log("进入确定")
+        let phone = e.detail.value;
+        this.data.lock = false;
+        this.setData({
+            phone,
+        })
+    },
+    address: function (e) {
+        console.log("进入确定")
+        let address = e.detail.value;
+        this.data.lock = false;
+        this.setData({
+            address,
+        })
+    },
+
+
+    houseNumber: function (e) {
+        console.log("进入确定")
+        let houseNumber = e.detail.value;
+        this.data.lock = false;
+        this.setData({
+            houseNumber,
+        })
+    },
+    radioChange(e) {
+        console.log('radio发生change事件,携带value值为:', e.detail.value)
+        let gender = e.detail.value
+        this.setData({
+            gender: gender
+        })
+    },
+
+    //地址保存
+    async saveAddress() {
+
+        let jw = cache.getNearLocation()
+        let longitude = jw.longitude
+        let latitude = jw.latitude
+        console.log(this.data.addressId)
+
+        await address.addoreditaddress({
+            mobile: cache.getMobile(),
+            addressId: this.data.addressId,
+            name: this.data.name,
+            gender: this.data.gender,
+            phone: this.data.phone,
+            address: this.data.address,
+            longitude: longitude,
+            latitude: latitude,
+            houseNumber: this.data.houseNumber,
+            tagName: this.data.tagName,
+        }).then(res => {
+            if (res.code == 200) {
+                wx.redirectTo({
+                    url: '../address/address',
+                })
+            }
+
+
+        })
+
+
+
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        let type = options.type;
+        let addressId = options.addressId;
+
+        console.log(type +addressId)
+        if (type == 'edit') {
+            address.getddress({
+                mobile: cache.getMobile(),
+                addressId:addressId
+            }).then(res => {
+                console.log(res.data)
+
+                this.data.tagList.forEach(item => {
+                    if (item.value == res.data.tagName) {
+                        item.show = true
+                    } else {
+                        item.show = false
+                    }
+                })
+                this.setData({
+                    tagList:this.data.tagList,
+                    mobile:res.data.mobile,
+                    addressId:res.data.id,
+                    name:res.data.name,
+                    gender:res.data.gender,
+                    phone:res.data.phone,
+                    address:res.data.address,
+                    longitude:res.data.longitude,
+                    latitude:res.data.latitude,
+                    houseNumber:res.data.houseNumber,
+                    tagName:res.data.tagName,
+                })
+            })
+
+        }
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    //获取标签值
+    getagValue(e) {
+        let value = e.currentTarget.dataset.value;
+        let index = e.currentTarget.dataset.id;
+        this.data.tagList[index].show = !this.data.tagList[index].show
+        this.data.tagList.forEach(item => {
+            if (item.id == index) {
+                item.show = true
+            } else {
+                item.show = false
+            }
+        })
+
+        this.setData({
+            tagName: value,
+            tagList: this.data.tagList
+
+        })
+
+    },
+    // 自动获取手机号
+
+    getPhone() {
+        let phone = cache.getMobile()
+        this.setData({
+            phone: phone
+        })
+
+
+    },
+
+
+    // 选择地址
+    goSelectMap() {
+        var that = this;
+        wx.authorize({
+            scope: 'scope.userLocation',
+            complete: function (res) {
+                console.log(res)
+                wx.chooseLocation({
+                    success(str) {
+                        console.log(str)
+                        var key = 'V7DBZ-K7C22-SXXUJ-CDUE7-AM2LH-AEFCM';
+                        //发送请求通过经纬度反查地址信息
+                        var getAddressUrl = "https://apis.map.qq.com/ws/geocoder/v1/?location=" + str.latitude + "," + str.longitude + "&key=" + key + "&get_poi=1";
+                        wx.request({
+                            url: getAddressUrl,
+                            success: function (result) {
+                                var province = result.data.result.address_component.province; //省
+                                var city = result.data.result.address_component.city; //市
+                                var district = result.data.result.address_component.district; //区
+                                var address = result.data.result.formatted_addresses.recommend; //具体地址范围
+                                console.log('省市县:' + province + city + district)
+                                console.log('地址:' + address)
+                                that.setData({
+                                    address: province + city + address
+                                })
+                            }
+                        })
+                    }
+                })
+            }
+        })
+    },
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 10 - 0
pages/groupmeallist/addOrEditaddress/addOrEditaddress.json

@@ -0,0 +1,10 @@
+{
+  "usingComponents": {},
+  "navigationBarBackgroundColor": "#fff",
+  "navigationBarTextStyle": "black",
+  "navigationBarTitleText": "收货地址",
+  "backgroundColor": "#fff",
+  "backgroundTextStyle": "light"
+
+ 
+}

+ 55 - 0
pages/groupmeallist/addOrEditaddress/addOrEditaddress.wxml

@@ -0,0 +1,55 @@
+<view class="page flex-column" style="justify-content: center;align-items: center;">
+    <view class="flex-row" style="height: 160rpx;width: 98%;">
+        <view class="rReceiver">收货人</view>
+        <view class="rReceiver_right flex-column" style="justify-content: space-between;align-items: flex-start;">
+            <view> <input bindinput="name" class="sosoinput" placeholder="名字"  focus="{{!openFocus}}" value="{{name}}" disabled="{{openFocus}}" /></view>
+            <view style="border-top: 1rpx #C1C1C1 solid; width: 97%;"></view>
+            <view>
+                <radio-group bindchange="radioChange">
+                    <radio color="#B9D25D" value="1" checked="true" />先生
+                    <radio color="#B9D25D" style="margin-left: 69rpx;" value="2" checked="true" />女士
+                </radio-group>
+            </view>
+        </view>
+
+    </view>
+
+    <view class="phone_view flex-row">
+        <view class="phone">手机号</view>
+        <view>
+         
+        <input class="sosoinput"  bindinput="phone" style="margin-left: -30rpx;" value="{{phone}}" placeholder="手机号码"  focus="{{!openFocus}}"  disabled="{{openFocus}}" /></view>
+      
+      
+        <view class="automatic" catchtap="getPhone">自动填写</view>
+   
+    </view>
+
+    <view class="address_view flex-row">
+        <view class="phone" style="margin-left: -35rpx;">地址</view>
+        <view><input  class="sosoinput"  bindinput="address" value="{{address}}" style="margin-left: -45rpx;width: 400rpx;" placeholder="请选择所在地址"  focus="{{!openFocus}}"  disabled="{{openFocus}}" /></view>
+        <!-- <view class="automatic">自动填写</view> -->
+
+        <image style="width: 13rpx;height: 24rpx;margin-right: -30rpx;" catchtap="goSelectMap" src="/images/groupmeallist/more_than_the.png"></image>
+   
+    </view>
+    <view class="address_view flex-row" style="justify-content: flex-start;">
+        <view class="phone" style="margin-left: 25rpx;">门牌号</view>
+        <view><input  class="sosoinput" bindinput="houseNumber" value="{{houseNumber}}" style="margin-left: 50rpx;width: 400rpx;" placeholder="例:5号楼203室内"  focus="{{!openFocus}}"  disabled="{{openFocus}}" /></view>
+  
+    </view>
+    <view class="address_view flex-row" style="justify-content: flex-start; border-bottom: 0rpx #C1C1C1 solid;">
+        <view class="phone" style="margin-left: 25rpx;margin-right: 75rpx;" >标签</view>
+        <view wx:for="{{tagList}}" wx:key="index"  wx:for-item="item" >
+            <view class="tag_view {{item.show ==true?'back':''}}" style="margin-right: 19rpx; " data-value="{{item.value}}" data-id="{{index}}" catchtap="getagValue">{{item.value}}</view>
+        </view>
+    </view>
+    <view class="save" catchtap="saveAddress">
+    
+        保 存
+    </view>
+
+
+
+
+</view>

+ 97 - 0
pages/groupmeallist/addOrEditaddress/addOrEditaddress.wxss

@@ -0,0 +1,97 @@
+.rReceiver {
+    width: 180rpx;
+    text-align: left;
+
+    /* width: 90rpx;
+    height: 40px; */
+    font-size: 30rpx;
+    font-family: Microsoft YaHei, Microsoft YaHei-Bold;
+    font-weight: 700;
+    color: #000000;
+    margin-left: 25rpx;
+
+}
+
+.rReceiver_right {
+    height: 120rpx;
+    width: 100%;
+
+
+}
+
+.phone {
+    font-size: 30rpx;
+    font-family: Microsoft YaHei, Microsoft YaHei-Bold;
+    font-weight: 700;
+    color: #000000;
+    margin-left: -10rpx;
+}
+
+.automatic {
+    width: 130rpx;
+    height: 61rpx;
+    background: #f7f7f7;
+    border: 2rpx solid #b9d25d;
+    border-radius: 7rpx;
+    text-align: center;
+    line-height: 61rpx;
+    color: #B9D25D;
+    margin-left: 45rpx;
+}
+
+.tag_view {
+    width: 105rpx;
+    height: 54rpx;
+    border: 2rpx solid #dddddd;
+    border-radius: 7rpx;
+    text-align: center;
+    line-height: 54rpx;
+}
+
+.save {
+    width: 695rpx;
+    height: 79rpx;
+    background: #b9d25d;
+    border-radius: 10rpx;
+    text-align: center;
+    line-height: 79rpx;
+    margin-top: 24rpx;
+}
+
+.address_view {
+    height: 120rpx;
+    width: 96%;
+    /* border-top: 1rpx #C1C1C1 solid; */
+    border-bottom: 1rpx #C1C1C1 solid;
+    justify-content: space-around;
+}
+
+.back {
+    background-color: #B9D25D;
+}
+
+.address_view {
+    height: 120rpx;
+    width: 96%;
+    /* border-top: 1rpx #C1C1C1 solid; */
+    border-bottom: 1rpx #C1C1C1 solid;
+    justify-content: space-around;
+}
+
+.sosoinput {
+    font-size: 24rpx;
+    font-family: Microsoft YaHei, Microsoft YaHei-Regular;
+    font-weight: 400;
+    text-align: left;
+    color: #c1c1c1;
+
+}
+
+.phone_view {
+    height: 120rpx;
+    width: 96%;
+    border-top: 1rpx #C1C1C1 solid;
+    border-bottom: 1rpx #C1C1C1 solid;
+    justify-content: space-around;
+
+}

+ 185 - 0
pages/groupmeallist/address/address.js

@@ -0,0 +1,185 @@
+// pages/listDel/index.js
+import address from '../../../api/address'
+const cache = require('../../../utils/cache.js');
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    // x轴方向的偏移
+    x: 0,
+    // 当前x的值
+    currentX: 0,
+    addressList: [],
+    isreturn: ''
+  },
+
+  handleMovableChange: function (e) {
+    let index = e.currentTarget.dataset.idx;
+    let x = e.currentTarget.dataset.x;
+
+    this.data.addressList[index].currentX = x;
+  },
+
+  handleTouchend: function (e) {
+    let index = e.currentTarget.dataset.idx;
+    let x = e.currentTarget.dataset.x;
+
+    this.isMove = true;
+    if (this.data.addressList[index].currentX < -46) {
+      this.data.addressList[index].x = -112;
+      this.setData({
+        addressList: this.data.addressList
+      });
+    } else {
+      this.data.addressList[index].x = 0;
+      this.setData({
+        addressList: this.data.addressList
+      });
+    }
+  },
+
+  // 创建订单返回
+  returncreateorder(e) {
+    let addressvalue = e.currentTarget.dataset.address
+    let addressId = e.currentTarget.dataset.idx
+    console.log(addressId)
+    if (this.data.isreturn) {
+      
+      wx.redirectTo({
+     
+        url: '../submitOrder/submitOrder?addressvalue='+addressvalue + '&addressId=' + addressId,
+      })
+    } else {
+      return
+    }
+
+  },
+
+
+  handleDeleteAddress(e) {
+    console.log('进入删除')
+    let index = e.currentTarget.dataset.index;
+
+    address.deladdress({
+      mobile: cache.getMobile(),
+      addressId: index
+    }).then(res => {
+      if (res.code == 200) {
+        wx.showToast({
+          title: '删除成功',
+          icon: 'none',
+          duration: 3000
+        })
+        this.getAdressList()
+
+      }
+
+    })
+  },
+  handleTouchestart: function (e) {},
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+    let isreturn = options.isreturn
+    console.log(isreturn)
+    if (isreturn) {
+      this.setData({
+        isreturn: isreturn
+      })
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    this.getAdressList()
+
+  },
+
+  getAdressList() {
+    address.getAdressList({
+      mobile: cache.getMobile()
+    }).then(res => {
+      let data = res.data;
+      data.forEach(item => {
+
+        item.subName = item.name.substring(0, 1);
+        item.x = 0;
+        item.currentX = 0;
+
+      });
+      this.setData({
+        addressList: res.data
+      })
+
+
+    })
+
+  },
+
+
+  goToAddAddress: function (e) {
+
+    let way = e.currentTarget.dataset.way;
+    let addressId = e.currentTarget.dataset.id;
+    console.log(addressId)
+    if (addressId >= 0) {
+      wx.navigateTo({
+        url: '/pages/groupmeallist/addOrEditaddress/addOrEditaddress?type=' + way + '&addressId=' + addressId,
+      })
+    } else {
+
+      wx.navigateTo({
+        url: '/pages/groupmeallist/addOrEditaddress/addOrEditaddress?type=' + way,
+      })
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 10 - 0
pages/groupmeallist/address/address.json

@@ -0,0 +1,10 @@
+{
+  "usingComponents": {},
+  "navigationBarBackgroundColor": "#fff",
+  "navigationBarTextStyle": "black",
+  "navigationBarTitleText": "地址列表",
+  "backgroundColor": "#fff",
+  "backgroundTextStyle": "light"
+
+ 
+}

+ 34 - 0
pages/groupmeallist/address/address.wxml

@@ -0,0 +1,34 @@
+<view class="container" wx:for="{{addressList}}" wx:for-item="address" wx:key="index" wx:for-index="id">
+    <view class="main">
+        <view class="main_item">
+            <movable-area>
+                <movable-view damping="100" out-of-bounds="true" direction="horizontal" data-idx="{{id}}" data-x="{{address.x}}" animation="false" bindchange="handleMovableChange" capture-bind:touchstart="handleTouchestart" capture-bind:touchend="handleTouchend">
+                    <view class="main_item_content flex-row" data-address="{{address.address}}"  data-idx="{{address.id}}" catchtap="returncreateorder">
+                        <view style="margin-top: 78rpx;margin-left: 46rpx;">
+                            <view class="fontSize-3" style="font-size: 32rpx; width: 500rpx; overflow: hidden;text-overflow:ellipsis;white-space: nowrap;">{{address.address}}</view>
+                            <view class="flex-row" style="margin-top: 17rpx;">
+                                <view class="tag_name">{{address.tagName}}</view>
+                                <view style="color: #919191;margin-left: 10rpx;">{{address.subName}}<span wx:if="{{address.gender ==1}}">(先生)</span><span wx:if="{{address.gender ==2}}">(女士)</span>
+                                    {{address.mobile}}
+                                </view>
+                            </view>
+
+                        </view>
+                        <view>
+                        
+                            <image style="width: 30rpx; height:30rpx;margin-right: 53rpx;margin-top: 78rpx;" src="/images/groupmeallist/edit.png" data-id="{{address.id}}" data-way="edit" catchtap="goToAddAddress"></image>
+                        </view>
+                    </view>
+                </movable-view>
+            </movable-area>
+            <view class="delete_btn " data-index="{{address.id}} " catchtap="handleDeleteAddress">删除</view>
+        </view>
+    </view>
+</view>
+<view style="width: 93%; border-bottom: 1px #e2e2e2 solid; margin: auto;margin-top: 0rpx;"></view>
+
+<view class="add_invoice flex-row">
+    <image style="width:30rpx;height:31rpx;margin-left: 57rpx;" src="/images/groupmeallist/invoice_add_icon.png"></image>
+    <view style="margin-left:19rpx" data-way="add" catchtap="goToAddAddress">新增收货地址</view>
+
+</view>

+ 73 - 0
pages/groupmeallist/address/address.wxss

@@ -0,0 +1,73 @@
+.container {
+    padding: 0;
+    background-color: #F7F7F7;
+   }
+    
+   page {
+    padding: 0;
+   }
+    
+   .main {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+   }
+   .tag_name{
+    /* min-width: 56rpx !important; */
+    height: 37rpx !important;
+    background: #f7f7f7 !important;
+    border: 1rpx solid #b9d25d !important;
+    border-radius: 7rpx !important;
+    color: #B9D25D;
+    text-align: center;
+    padding: 10rpx;
+   }
+    
+   .main_item {
+    display: flex;
+    flex-direction: row;
+    background: #F7F7F7;
+    overflow: hidden;
+   }
+    
+   movable-area {
+    width: 532rpx;
+    height: 223rpx;
+    background: #F7F7F7;
+   }
+    
+   movable-view {
+    width: 716rpx;
+    height: 223rpx;
+   }
+    
+   .main_item_content {
+   width: 100%;
+    height: 223rpx;
+    /* border-radius: 10rpx; */
+    color: white;
+    /* padding-left: 16px;
+    padding-top: 78rpx; */
+    background: white;
+    align-items: flex-start;
+    justify-content: space-between;
+ 
+   }
+    
+   .delete_btn {
+    width: 184rpx;
+    height: 224rpx;
+    background-color: #E84F3D;
+    /* border-top-right-radius: 10px;
+    border-bottom-right-radius: 10px; */
+    color: #fff;
+    font-size: 28rpx;
+    text-align: center;
+    line-height: 223rpx;
+   }
+   .add_invoice{
+    width: 100%;
+    height: 223rpx;
+    background: #FFFFFF;
+
+   }

+ 176 - 0
pages/groupmeallist/couponlist/couponlist.js

@@ -0,0 +1,176 @@
+const user = require('../../../utils/cache.js');
+import base from '../../../utils/base'
+// import storeGoods from '../../api/storeGoods'
+import storeGoods from '../../../api/storeGoods'
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        currentData:0,
+        // numberOrimage:'5',
+        mobile:'',
+        isLogin:false,
+        page:1,
+        pageSize:20,
+        // 可使用
+        efficientList:[{}],
+        // 已使用
+        usedList:[],
+        // 已失效
+        invalidList:[],
+        checked:''
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+    
+      
+      
+    },
+
+
+    getCouponListBystoreAndTableId(){
+      storeGoods.orderCouponForSelect({
+        storeId: user.getStoreId(),
+        mobile: user.getMobile(),
+        // tableId: user.getTableId()
+    }).then(res => {
+        if (res.code == 200) {
+          res.data.forEach((item, i) => {
+            item.beginTime = item.beginTime.substring(0, 10)
+            item.endTime = item.endTime.substring(0, 10)})
+
+            this.setData({
+              efficientList:res.data
+            })
+        }
+    }).catch(_ => {
+        // // this.setData({
+        // //     isShowPannel: true
+        // // })
+
+        // this.tapSex()
+        console.log(_)
+    })
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    handleBack() {
+      let routeLen = getCurrentPages().length;
+      if (routeLen == 1) {
+          wx.reLaunch({
+            url: '/pages/index/index',
+          })
+          return
+      }
+      wx.navigateBack({
+          delta: -1
+      })
+  },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        this.getCouponListBystoreAndTableId();
+
+    },
+
+
+    getPhone() {
+      console.log("进入onshow")
+      let _self = this;
+      let mobile =  user.getMobile();
+      _self.setData({
+        isLogin:mobile==null?false:true,
+        mobile:mobile
+      })  
+    
+    },
+    //选择卡券跳转确认订单页面
+    confirmAndGotoOrder(e){
+      let coupon = JSON.stringify(e.currentTarget.dataset.coupon)
+      wx.redirectTo({
+        url: '../submitOrder/submitOrder?coupon='+coupon,
+      }) 
+
+
+    },
+
+    uncheckedconfirmAndGotoOrder(){
+      wx.redirectTo({
+        url: "../submitOrder/submitOrder"
+      }) 
+
+    },
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    },
+     //获取当前滑块的index
+  bindchange:function(e){
+    const that  = this;
+    that.setData({
+      currentData: e.detail.current
+    })
+  },
+  //点击切换,滑块index赋值
+  checkCurrent:function(e){
+    const that = this;
+ 
+    if (that.data.currentData === e.target.dataset.current){
+        return false;
+    }else{
+ 
+      that.setData({
+        currentData: e.target.dataset.current
+      })
+    }
+  },
+  //条款详细信息
+  goToTerms(e){
+    wx.navigateTo({
+      url:'/pages/discountCenterDetail/discountCenterDetail',
+    })
+  }
+})

+ 6 - 0
pages/groupmeallist/couponlist/couponlist.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {},
+  "navigationBarBackgroundColor": "#fff",
+  "navigationBarTitleText": "卡券中心",
+  "disableScroll": true
+}

+ 55 - 0
pages/groupmeallist/couponlist/couponlist.wxml

@@ -0,0 +1,55 @@
+<view class="containerDiscount">
+
+<view class='nav'>
+
+  <!-- <view class='title_text flex-row-between'>
+   <view catchtap="handleBack"><image class="back_button" src="/images/back_button.png"></image></view>
+   
+   卡券中心</view>
+   <view class='topTabSwiper flex-column'>
+
+</view> -->
+<view current="{{currentData}}" class='swiper' style="height:1400rpx;" duration="300" bindchange="bindchange">
+<!-- 可使用 -->
+
+    <scroll-view   style="height: 95%;" scroll-y="true" bindscrolltolower="bottomefficientList"  class="allpageclsaa" >
+      <view class='unchecked flex-row'  catchtap="uncheckedconfirmAndGotoOrder" style="margin: 0 auto;margin-top: 20rpx;">
+      <view style="font-size: 30rpx;margin-left: 50rpx;">不使用优惠券 </view>
+      </view>
+      <view  wx:for="{{efficientList}}" wx:for-item="efficient" wx:key="index" >
+
+  <view class='swiper_con flex-column'>
+  <!-- bindtap='goToTerms' -->
+ 
+  <view class="couponDiv flex-row"  data-coupon="{{efficient}}" catchtap="confirmAndGotoOrder">
+    <view class="be_usable_left flex-row">
+    <!-- 图片或者折扣数值 -->
+    <view class="priceOrimage">
+    <image  style="height: 171rpx;width:177rpx;" src="{{efficient.coupon.fullCoverImage}}"></image>
+    
+    
+    </view>
+    <!-- <view class="price_number">5</view> -->
+    <!-- <view class="be_usable_price">¥</view> -->
+    </view>
+    <view class="be_usable_left_text flex-column">
+    <view class="be_usable_left_title">{{efficient.title}}</view>
+    <view class="be_usable_left_time">有效期:{{efficient.beginTime}}~{{efficient.endTime}}</view>
+    
+    </view>
+  
+  
+  </view>
+  
+  </view>
+  </view>
+  </scroll-view>
+
+
+</view>
+</view>
+
+
+
+
+</view>

+ 232 - 0
pages/groupmeallist/couponlist/couponlist.wxss

@@ -0,0 +1,232 @@
+.containerDiscount {
+    height: 100%;
+    background-color: silver;
+
+  } 
+
+
+
+.nav {
+    width: 100%;
+    height: 100%;
+    overflow: hidden;
+    position: relative;
+    top: 0;
+    left: 0;
+    z-index: 10;
+    background: white ;
+    }
+    .back_button{
+      width: 20rpx;
+      height: 26rpx;
+      position: absolute;
+      top: 115rpx;
+      left: 26rpx;
+  
+  }
+    .title_text {
+        width: 100%;
+        height: 45px;
+        color: black;
+        text-align: center;
+        justify-content: center;
+        margin-top: 55px;
+        z-index: 10;
+        font-size: 34rpx;
+        font-weight: bold;
+        }
+
+
+        .tab {
+            float: left;
+            width: 50px;
+            text-align: center;
+          }
+           
+          .topTabSwiper {
+            display: flex;
+            flex-flow: row nowrap;
+            justify-content: space-around;
+            align-items: center;
+            margin-left: 50px;
+            font-size: 15px;
+            color: black;
+            font-weight: bold;
+            /* margin-top: -40px; */
+          }
+           
+          .topTabSwiper:after {
+            content: "";
+            clear: both;
+            display: block;
+          }
+           
+          .tabBorer {
+            /* background: #FE7253; */
+            border-bottom: 2px solid #FE7253;
+            color: #FE7253;
+          }
+           
+          .swiper {
+            width: 100%;
+            height: 1400rpx;
+            background-image: url(https://cdn1.overseasdragon.com.cn/xcx-smdd/background_and_flower.png);
+            background-size: 100% 100%;
+          }
+          .unchecked{
+            width: 718rpx;
+            height: 106rpx;
+            background: #FFFFFF;
+            border-radius: 25px;
+          align-items: center;
+      
+
+
+
+          }
+           
+          .swiper_con {
+            text-align: center;
+            width: 100%;
+            height: 100%;
+            margin-top: 24rpx;
+            /* padding: 32rpx 0; */
+            /* background-color: darkgray; */
+            align-items: center;
+          }
+
+          .allpageclsaa{
+            text-align: center;
+            width: 100%;
+            height: 100%;
+            /* padding: 32rpx 0; */
+            /* background-color: darkgray; */
+            align-items: center;
+          }
+          ::-webkit-scrollbar {
+ 
+            width:0;
+             
+            height:0;
+             
+            color:transparent;
+             
+            }
+          .couponDiv{
+            width: 718rpx;
+            height: 206rpx;
+            background: #FFFFFF;
+            border-radius: 25px;
+            margin-top: 20rpx;
+            
+          }
+          .priceOrimage{
+            width: 171rpx;
+            height: 177rpx;
+            opacity: 1;
+            border-radius: 0px;
+            
+          }
+
+          .be_usable_left{
+            width: 234rpx;
+            height: 206rpx;
+            background: #FFFFFF;
+            border-radius: 25px 0px 0px 25px;
+            
+            justify-content: center;
+          }
+          .be_usable_price{
+            width: 34rpx;
+            height: 79rpx;
+            font-size: 57rpx;
+            font-weight: bold;
+            line-height: 90px;
+            color: #FE7253;
+            margin-top: -90px;
+            opacity: 1;
+          }
+
+
+          .be_usable_price_gray{
+            width: 34rpx;
+            height: 79rpx;
+            font-size: 57rpx;
+            font-weight: bold;
+            line-height: 90px;
+            color: gray;
+            margin-top: -90px;
+            opacity: 1;
+          }
+
+          .be_usable_left_text{
+              width: 200px;
+              height: 50px;
+              align-items: flex-start;
+              line-height: 50rpx;
+              margin-left: 27rpx;
+
+          }
+          .be_usable_left_title{
+            height: 45rpx;
+            font-size: 32rpx;
+            font-weight: bold;
+            line-height: 45rpx;
+            color: #000000;
+          }
+          .be_usable_left_title_gray{
+            height: 45rpx;
+            font-size: 32rpx;
+            font-weight: bold;
+            line-height: 45rpx;
+            color: gray;
+          }
+
+
+
+          .be_usable_left_time{
+            /* width: 346rpx; */
+            height: 33rpx;
+            font-size: 24rpx;
+            font-weight: 400;
+            line-height: 38rpx;
+            color: #000000;
+            margin-top: 14rpx;
+          }
+
+
+          .be_usable_left_time_gray{
+            width: 346rpx;
+            height: 33rpx;
+            font-size: 24rpx;
+            font-weight: 400;
+            line-height: 38rpx;
+            color: gray;
+            margin-top: 14rpx;
+          }
+
+
+          .price_number{
+            width: 85rpx;
+            height: 197rpx;
+            font-size: 131rpx;
+            font-weight: bold;
+            line-height: 224rpx;
+            color: #FE7253;
+            line-height: 197rpx;
+            margin-left: 72rpx;
+        
+          }
+
+
+          .price_number_gray{
+            width: 85rpx;
+            height: 197rpx;
+            font-size: 131rpx;
+            font-weight: bold;
+            line-height: 224rpx;
+            color: gray;
+            line-height: 197rpx;
+            margin-left: 72rpx;
+        
+          }

+ 234 - 0
pages/groupmeallist/goodsManagementStore/goodsManagementStore.js

@@ -0,0 +1,234 @@
+// pages/shopList/shopList.js
+const app = getApp();
+const user = require('../../../utils/cache.js');
+// import StoreApi from "../../../api/storeList.js";
+
+
+import staff from '../../../api/StaffApi'
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        phoneIcon: 'https://cdn1.overseasdragon.com.cn/xcx-smdd/shop_list_phone.png',
+        page: 1,
+        pageSize: 5,
+        longitude: "",
+        latitude: "",
+        keyword: "",
+        storeList: [],
+        selectStoreInfo: null,
+        id: 0,
+        isClicked: false, //是否已经点击过了,默认没有
+        pageSource: "",
+        way: ''
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        let _self = this;
+        let way = options.way
+        console.log('way' + way)
+
+        if (way == 1) {
+            _self.setData({
+                way: way
+            })
+        }
+
+        console.log(options)
+
+        if (options.id) {
+            _self.setData({
+                id: options.id
+            })
+        }
+        if (options.pageSource) {
+            _self.setData({
+                pageSource: options.pageSource
+            })
+        }
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        let _self = this;
+        //获取最近的经纬度
+        // let locationPosition = user.getNearLocation()
+        // if (locationPosition != null) {
+        //     _self.setData({
+        //         longitude: locationPosition.longitude,
+        //         latitude: locationPosition.latitude
+        //     })
+        // }
+        _self.getNearbyStoreList();
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+        let _self = this;
+        _self.setData({
+            page: _self.data.page + 1
+        })
+        //获取门店列表
+        _self.getNearbyStoreList('pull')
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    },
+
+    /**
+     * 获取门店列表
+     */
+    async getNearbyStoreList(step = 'init') {
+        console.log("进入方法执行")
+        let _self = this;
+        let page = 0
+        if (this.data.keyword != null && this.data.keyword != '') {
+            page = 1
+        } else {
+            page = this.data.page
+        }
+        try {
+            let storeRes = await staff.staffShopList({
+                mobile:user.getMobile()
+            });
+            if (storeRes.code == 200 && storeRes.msg == 'success') {
+                let list = storeRes.data;
+                if (list.length != 0) {
+                    list.map((item, index) => {
+                        if (item.distance !== null) {
+                            let distance = parseFloat(item.distance);
+                            item.distance = distance.toFixed(2);
+                        }
+
+                        if (item.id == _self.data.id && _self.data.isClicked == false) {
+                            item.active = true;
+                            _self.setData({
+                                selectStoreInfo: item,
+                            })
+                        } else {
+                            item.active = false;
+                        }
+                    })
+                }
+                if (step == 'init') { //初始化
+                    _self.setData({
+                        storeList: list
+                    })
+                } else {
+                    if (list.length == 0) {
+                        _self.setData({
+                            page: _self.data.page - 1
+                        })
+                    } else {
+                        //分页
+                        _self.setData({
+                            storeList: _self.data.storeList.concat(list),
+                        })
+                    }
+
+                }
+            }
+        } catch (error) {
+            console.log(error);
+        }
+    },
+    //打电话
+    callPhone(e) {
+        //   console.log(e);
+        let _self = this;
+        let phone = e.currentTarget.dataset.phone;
+        wx.makePhoneCall({
+            phoneNumber: phone
+        })
+    },
+    /**
+     * 选择门店
+     */
+    selectStore(e) {
+        let _self = this;
+        let idx = e.currentTarget.dataset.idx;
+        let storeList = _self.data.storeList;
+        _self.setData({
+            isClicked: true,
+        })
+        for (let i = 0; i < storeList.length; i++) {
+            if (idx == i) {
+                storeList[i].active = true;
+                _self.setData({
+                    selectStoreInfo: storeList[i]
+                })
+            } else {
+                storeList[i].active = false;
+            }
+        }
+        _self.setData({
+            storeList
+        })
+    },
+    /**
+     * 选择门店
+     */
+    sureStore() {
+        let _self = this;
+        //存储选中的地址
+        if (this.data.way == 1) {
+            user.setChooseStore(_self.data.selectStoreInfo);
+            wx.redirectTo({
+                url: '../goodsManagements/goodsManagements',
+            })
+        }
+
+
+    },
+
+    listenInput: function (e) {
+        console.log("进入确定")
+        let keyword = e.detail.value;
+        this.data.lock = false;
+        this.setData({
+            keyword,
+        })
+        this.getNearbyStoreList();
+    },
+})

+ 5 - 0
pages/groupmeallist/goodsManagementStore/goodsManagementStore.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {},
+  "navigationBarBackgroundColor": "#fff",
+  "navigationBarTitleText": "门店列表"
+}

+ 36 - 0
pages/groupmeallist/goodsManagementStore/goodsManagementStore.wxml

@@ -0,0 +1,36 @@
+<view class="shopList">
+
+<!-- <view class="searchbar" catchtap="toSearchPage">
+
+<icon class="searchico" type='search' size='20'></icon>
+
+<input bindinput="listenInput" class="sosoinput" placeholder="搜索" bindblur="soso" focus="{{!openFocus}}" value="{{keyword}}" disabled="{{openFocus}}" />
+
+<image class ="closebtn" src="../../images/close.png" wx:if="{{keyword}}" catchtap="cleanKeyword"></image>
+
+</view> -->
+
+
+
+<view class="shopName flex-row-between {{item.active?'active-shop':''}}" wx:for="{{storeList}}" wx:for-index="idx" wx:for-item="item" bindtap="selectStore" data-idx="{{idx}}">
+   <view class="left_view flex-column">
+         <view class="shopNametTile">{{item.storeName}}</view>
+         <view class="shopNameAdress">{{item.address}}</view>
+         <!-- <view class="distance" wx:if="{{item.distance}}">{{item.distance}}m</view> -->
+   </view>
+   <!-- <view class="right_view flex-column">
+         <view class="shop_state">{{item.stateText}}</view>
+         <view class="shop_state_icon">
+            <view data-phone="{{item.liaisonPhone}}" bindtap="callPhone">
+               <image class="phoneIcon" src="{{phoneIcon}}" mode="widthFix"></image>
+            </view>
+         </view>
+   </view> -->
+
+</view>
+<view class="bottom"></view>
+</view>
+
+<view class="select-bottom">
+<view class="bottom_shop" bindtap="sureStore">选择门店</view>
+</view>

+ 180 - 0
pages/groupmeallist/goodsManagementStore/goodsManagementStore.wxss

@@ -0,0 +1,180 @@
+
+page {
+    width: 100%;
+    height: 100%;
+    background: url(https://cdn1.overseasdragon.com.cn/xcx-smdd/background_and_flower.png?v=1) repeat;
+    background-size: 100%;
+}
+
+.nav {
+    width: 100%;
+    height: 100%;
+    overflow: hidden;
+    z-index: 10;
+    background: white;
+}
+
+.title_text {
+    width: 100%;
+    height: 45px;
+    color: black;
+    text-align: center;
+    margin-top: 55px;
+    z-index: 10;
+    font-size: 34rpx;
+    font-weight: bold;
+}
+
+.shopList {
+    display: flex;
+    width: 100%;
+    justify-content: center;
+    flex-direction: column;
+    margin-top: 20rpx;
+    align-items: center;
+}
+
+.shopName {
+    width: 718rpx;
+    padding: 30rpx 0;
+    background: #FFFFFF;
+    border-radius: 25rpx;
+    margin-top: 20rpx;
+}
+
+.active-shop {
+    border: 3px solid #AFD250;
+}
+
+.left_view {
+    flex: 1;
+    height: 100%;
+    padding-right: 100rpx;
+}
+
+.right_view {
+    width: 100rpx;
+    height: 100%;
+    align-items: center;
+    padding-right: 10rpx;
+}
+
+.shopNametTile {
+    height: 45rpx;
+    font-size: 32rpx;
+    font-weight: bold;
+    line-height: 45rpx;
+    color: #000000;
+    margin-left: 18rpx;
+}
+
+.shopNameAdress {
+    font-size: 24rpx;
+    font-weight: 300;
+    line-height: 33rpx;
+    color: #000000;
+    margin-top: 11rpx;
+    margin-left: 18rpx;
+}
+
+.distance {
+    height: 33rpx;
+    font-size: 24rpx;
+    font-family: PingFang SC;
+    font-weight: 300;
+    line-height: 33rpx;
+    color: #000000;
+    opacity: 1;
+    margin-top: 5rpx;
+    margin-left: 18rpx;
+}
+
+.shop_state {
+    width: 84rpx;
+    height: 40rpx;
+    font-size: 28rpx;
+    font-weight: 400;
+    line-height: 50rpx;
+    color: #AFD250;
+    margin-right: 21rpx;
+    text-align: center;
+}
+
+.shop_state_icon {
+    margin-top: 26rpx;
+}
+
+.bottom_shop {
+    width: 724rpx;
+    height: 103rpx;
+    background: #AFD250;
+    opacity: 1;
+    border-radius: 62rpx;
+    font-size: 36rpx;
+    text-align: center;
+    color: #FFFFFF;
+    line-height: 103rpx;
+}
+
+.phoneIcon {
+    width: 62rpx;
+    height: 62rpx;
+    margin-right: 20rpx;
+}
+
+/* 底部 */
+.select-bottom {
+    width: 100%;
+    height: 220rpx;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    position: fixed;
+    left: 0;
+    bottom: 0;
+    background-color: #fff;
+}
+
+.bottom {
+    width: 100%;
+    height: 250rpx;
+    opacity: 0.0;
+}
+/* pages/datumCenter/component/searchbar/index.wxss */
+.searchbar {
+    width: 718rpx;
+    height: 70rpx !important;
+    margin: 0 28rpx;
+    height: 60rpx;
+    line-height: 60rpx;
+    border-radius: 100rpx;
+    background: #FFFFFF;
+    display: flex;
+    flex-direction: row;
+    position: relative;
+    line-height: 70rpx;
+    
+  }
+  
+  .searchico {
+    margin: 17rpx 0 0 30rpx;
+    flex: 1;
+  }
+  
+  .sosoinput {
+    width: calc(100% - 150rpx);
+    height: 60rpx;
+    line-height: 60rpx;
+    font-size: 28rpx;
+    margin-right: 60rpx;
+    margin-top: 5rpx;
+  }
+  
+  .closebtn {
+    width: 40rpx;
+    height: 40rpx;
+    position: absolute;
+    right: 20rpx;
+    top: 10rpx;
+    z-index: 2;
+  }

+ 233 - 0
pages/groupmeallist/goodsManagements/goodsManagements.js

@@ -0,0 +1,233 @@
+const user = require('../../../utils/cache.js');
+import staff from '../../../api/StaffApi'
+
+
+// pages/groupmeallist/goodsManagement/goodsManagement.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    currentData: 0,
+    storeObject: {},
+    allgoods: [],
+    onlinetrue: [],
+    onlinefalse: [],
+    page: 1,
+    pageSize: 5,
+    keyword: '',
+    text: 0,
+    allTop: 0,
+    onLineTop: 0,
+    offLineTop: 0
+  },
+
+
+  //点击切换,滑块index赋值
+  checkCurrent: function (e) {
+    if (this.data.currentData === e.target.dataset.current) {
+      return false;
+    } else {
+      this.setData({
+        currentData: e.target.dataset.current
+      })
+    }
+  },
+
+  //获取当前滑块的index
+  bindchange: function (e) {
+    const that = this;
+    that.setData({
+      currentData: e.detail.current
+    })
+    console.log("切换导航2")
+
+    this.reloadData(e.detail.current)
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  reloadData(index) {
+    this.data.page = 1
+    this.getGoodsList()
+  },
+
+  gotoStoreList() {
+    wx.redirectTo({
+      url: '../goodsManagementStore/goodsManagementStore?way=' + '1',
+    })
+  },
+
+  bottomefficientList() {
+    let _self = this;
+    _self.setData({
+      page: _self.data.page + 1
+    })
+    _self.getGoodsList()
+  },
+
+  toggleline: function (e) {
+    let goodid = e.currentTarget.dataset.goodid;
+
+    let idx = e.currentTarget.dataset.idx;
+
+    this.togglelinechange(goodid);
+
+    let currentData = this.data.currentData
+
+    if (currentData == 0) {
+      this.data.allgoods[idx].isOnline = this.data.allgoods[idx].isOnline == 1 ? '0' : 1
+
+      this.setData({
+        allgoods: this.data.allgoods
+      })
+
+    } else if (currentData == 1) {
+      this.data.onlinetrue[idx].isOnline = this.data.onlinetrue[idx].isOnline == 1 ? '0' : 1
+      this.setData({
+        onlinetrue: this.data.onlinetrue
+      })
+    } else {
+      this.data.onlinefalse[idx].isOnline = this.data.onlinefalse[idx].isOnline == 1 ? '0' : 1
+      this.setData({
+        onlinefalse: this.data.onlinefalse
+      })
+    }
+  },
+
+  async togglelinechange(goodid) {
+
+    await staff.toggleline({
+      mobile: user.getMobile(),
+      storeCode: this.data.storeObject.storeNo,
+      goodsId: goodid
+    })
+
+
+    // await this.getGoodsList();
+
+  },
+
+  listenInput: function (e) {
+    console.log("进入确定")
+    let keyword = e.detail.value;
+    this.data.lock = false;
+    this.data.page = 1;
+    this.setData({
+      keyword,
+    })
+    this.getGoodsList();
+  },
+
+
+  async getGoodsList() {
+    await staff.getGoodsStaffList({
+      mobile: user.getMobile(),
+      storeCode: this.data.storeObject.storeNo,
+      state: this.data.currentData,
+      keyword: this.data.keyword,
+      page: this.data.page,
+      pageSize: this.data.pageSize
+    }).then(res => {
+      let all = res.data
+      if (this.data.currentData == 0) {
+        if (this.data.page == 1) {
+          this.setData({
+            allgoods: all,
+            allTop: 0,
+          })
+        } else {
+          this.setData({
+            allgoods: this.data.allgoods.concat(all)
+          })
+        }
+      } else if (this.data.currentData == 1) {
+        if (this.data.page == 1) {
+          this.setData({
+            onlinetrue: all,
+            onLineTop: 0,
+          })
+        } else {
+          this.setData({
+            onlinetrue: this.data.onlinetrue.concat(all)
+          })
+        }
+
+      } else if (this.data.currentData == 2) {
+        if (this.data.page == 1) {
+          this.setData({
+            onlinefalse: all,
+            offLineTop: 0,
+          })
+        } else {
+          this.setData({
+            onlinefalse: this.data.onlinefalse.concat(all)
+          })
+        }
+      }
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+    let storeObject = user.getChooseStore();
+    if (storeObject != null) {
+      this.setData({
+        storeObject: storeObject
+      })
+      this.getGoodsList()
+    }
+
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 10 - 0
pages/groupmeallist/goodsManagements/goodsManagements.json

@@ -0,0 +1,10 @@
+{
+  "usingComponents": {
+  },
+  "disableScroll": true,
+  "navigationBarBackgroundColor": "#F7F7F7",
+  "navigationBarTextStyle": "black",
+  "navigationBarTitleText": "商品管理",
+  "backgroundColor": "#F7F7F7",
+  "backgroundTextStyle": "light"
+}

+ 129 - 0
pages/groupmeallist/goodsManagements/goodsManagements.wxml

@@ -0,0 +1,129 @@
+<view class="page">
+    <view class="choose_store">
+        <view catchtap="gotoStoreList" class="flex-row">
+            <span wx:if="{{storeObject.storeName == null}}">选择门店</span>
+            <view wx:if="{{storeObject.storeName != null}}" class="storeObjectstoreName">{{storeObject.storeName}}</view>
+            <image style="width: 24rpx; height: 24rpx;margin-left: 41rpx;border-radius: 50%;" src="/images/groupmeallist/choose_store_goods.png"></image>
+        </view>
+
+
+    </view>
+    <view class="bg">
+        <view class="input_bg">
+            <icon class="searchico" type='search' size='20'></icon>
+            <input bindinput="listenInput" class="sosoinput" placeholder="搜索商品" bindblur="soso" focus="{{!openFocus}}" value="{{keyword}}" disabled="{{openFocus}}" />
+        </view>
+
+    </view>
+
+    <view class="tab_box">
+        <view class='topTabSwiper flex-column'>
+            <view class='tab  {{currentData == 0 ? "tabBorer" : ""}}' data-current="0" bindtap='checkCurrent'>
+                全部商品</view>
+            <view class='tab  {{currentData == 1 ? "tabBorer" : ""}}' data-current="1" bindtap='checkCurrent'>上架商品</view>
+            <view class='tab  {{currentData == 2 ? "tabBorer" : ""}}' data-current="2" bindtap='checkCurrent'>下架商品</view>
+        </view>
+        <swiper current="{{currentData}}" class='swiper' duration="300" bindchange="bindchange">
+            <!-- 可使用 -->
+            <swiper-item style="width: 100%;">
+                <scroll-view class="scroll-body" scroll-y="true" scroll-top="{{allTop}}" bindscrolltolower="bottomefficientList">
+                    <view wx:for="{{allgoods}}" wx:key="index" wx:for-index="idx" wx:for-item="item">
+                        <view class="good_div flex-row">
+                            <view style="margin-top: 36rpx;margin-left: 33rpx;">
+                                <image style="width:150rpx;height:150rpx" src="{{item.fullFigure}}"></image>
+                            </view>
+                            <view class="good_title flex-column">
+                                <view class="title_font text_over">{{item.productName}}</view>
+
+                                <view style="font-size: 26rpx;font-weight: normal;color: #A0A0A0;  text-decoration: line-through;">{{item.showPriceY}}</view>
+
+                            </view>
+
+                            <view class="good_status flex-column">
+                                <view style="font-size: 26rpx;font-weight: 500;color: {{item.isOnline  ==  1?'#B6D163':'#A0A0A0'}}">
+                                    <span wx:if="{{item.isOnline ==1}}">已上架</span>
+                                    <span wx:if="{{item.isOnline ==0}}">已下架</span>
+                                </view>
+                                <view class="change_status" style="background-color: {{item.isOnline == 0?'#B6D163':'#F0FFC2'}};" catchtap="toggleline" data-idx="{{idx}}" data-goodid="{{item.goodsId}}" data-online="{{item.isOnline}}">
+                                    <span wx:if="{{item.isOnline ==0}}" style="color: white;">上架</span>
+                                    <span wx:if="{{item.isOnline ==1}}">下架</span>
+                                </view>
+
+                            </view>
+
+                        </view>
+
+                    </view>
+                </scroll-view>
+            </swiper-item>
+
+
+            <!-- 可使用 -->
+            <swiper-item style="width: 100%; ">
+                <scroll-view class="scroll-body" scroll-y="true" scroll-top="{{onLineTop}}" bindscrolltolower="bottomefficientList">
+                    <view wx:for="{{onlinetrue}}" wx:key="index" wx:for-index="idx" wx:for-item="item">
+                        <view class="good_div flex-row">
+                            <view style="margin-top: 36rpx;margin-left: 33rpx;">
+                                <image style="width:150rpx;height:150rpx" src="{{item.fullFigure}}"></image>
+                            </view>
+                            <view class="good_title flex-column">
+                                <view class="title_font text_over">{{item.productName}}</view>
+
+                                <view style="font-size: 26rpx;font-weight: normal;color: #A0A0A0;  text-decoration: line-through;">{{item.showPriceY}}</view>
+
+                            </view>
+
+                            <view class="good_status flex-column">
+
+                                <view style="font-size: 26rpx;font-weight: 500;color: #B6D163;">
+                                    <span wx:if="{{item.isOnline ==1}}">已上架</span>
+                                    <span wx:if="{{item.isOnline ==0}}">已下架</span>
+                                </view>
+                                <view class="change_status" catchtap="toggleline" data-idx="{{idx}}" data-goodid="{{item.goodsId}}" data-online="{{item.isOnline}}">
+                                    <span wx:if="{{item.isOnline ==0}}">上架</span>
+                                    <span wx:if="{{item.isOnline ==1}}">下架</span>
+                                </view>
+
+                            </view>
+
+                        </view>
+                    </view>
+                </scroll-view>
+            </swiper-item>
+
+            <!-- 可使用 -->
+            <swiper-item style="width: 100%; ">
+                <scroll-view class="scroll-body" scroll-y="true" scroll-top="{{offLineTop}}" bindscrolltolower="bottomefficientList">
+                    <view wx:for="{{onlinefalse}}" wx:key="index" wx:for-index="idx" wx:for-item="item">
+                        <view class="good_div flex-row">
+                            <view style="margin-top: 36rpx;margin-left: 33rpx;">
+                                <image style="width:150rpx;height:150rpx" src="{{item.fullFigure}}"></image>
+                            </view>
+                            <view class="good_title flex-column">
+                                <view class="title_font text_over">{{item.productName}}</view>
+
+                                <view style="font-size: 26rpx;font-weight: normal;color: #A0A0A0;  text-decoration: line-through;">{{item.showPriceY}}</view>
+
+                            </view>
+
+                            <view class="good_status flex-column">
+                                <view style="font-size: 26rpx;font-weight: 500;color: #A0A0A0;">
+                                    <span wx:if="{{item.isOnline ==1}}">已上架</span>
+                                    <span wx:if="{{item.isOnline ==0}}">已下架</span>
+                                </view>
+                                <view class="change_status" catchtap="toggleline" data-idx="{{idx}}" data-goodid="{{item.goodsId}}" data-online="{{item.isOnline}}">
+                                    <span wx:if="{{item.isOnline ==0}}">上架</span>
+                                    <span wx:if="{{item.isOnline ==1}}">下架</span>
+                                </view>
+                            </view>
+
+                        </view>
+                    </view>
+                </scroll-view>
+            </swiper-item>
+        </swiper>
+    </view>
+
+
+
+</view>

+ 170 - 0
pages/groupmeallist/goodsManagements/goodsManagements.wxss

@@ -0,0 +1,170 @@
+.tab_box {
+  display: flex;
+  flex-direction: column;
+  height: calc(100vh - 150rpx);
+}
+
+.swiper {
+  flex: 1;
+}
+
+.scroll-body {
+  height: 100%;
+}
+
+
+.choose_store {
+  width: 402rpx;
+  height: 50rpx;
+  font-size: 28rpx;
+  margin-left: 52rpx;
+  font-weight: normal;
+  color: #A0A0A0;
+  line-height: 50rpx;
+}
+
+.input_bg {
+  width: 680rpx;
+  height: 70rpx !important;
+  margin: 0 28rpx;
+  height: 60rpx;
+  line-height: 60rpx;
+  border-radius: 100rpx;
+  background: #FFFFFF;
+  display: flex;
+  flex-direction: row;
+  position: relative;
+  line-height: 70rpx;
+
+}
+
+.sosoinput {
+  width: calc(100% - 150rpx);
+  height: 60rpx;
+  line-height: 60rpx;
+  font-size: 28rpx;
+  margin-right: 60rpx;
+  margin-top: 5rpx;
+
+
+}
+
+.searchico {
+  margin: 17rpx 0 0 30rpx;
+  flex: 1;
+}
+
+.bg {
+  height: 100rpx;
+  width: 100%;
+  background: #F7F7F7;
+  display: flex;
+  flex-flow: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.topTabSwiper {
+  display: flex;
+  flex-flow: row nowrap;
+  justify-content: space-around;
+  align-items: center;
+  font-size: 15px;
+  color: black;
+  font-weight: bold;
+  margin-bottom: 22rpx;
+
+}
+
+
+::-webkit-scrollbar {
+
+  width: 0;
+
+  height: 0;
+
+  color: transparent;
+
+}
+
+.tabBorer {
+
+  border-bottom: 2px solid #B6D163;
+
+
+
+}
+
+.tab {
+  float: left;
+  /* width: 50px; */
+  text-align: center;
+  margin-top: 21rpx;
+  font-size: 28rpx;
+  padding-bottom: 10rpx;
+}
+
+.good_div {
+
+  width: 100%;
+  height: 254rpx;
+  background: #FFFFFF;
+  border-top: 1rpx #F6F6F6 solid;
+  border-bottom: 1rpx #F6F6F6 solid;
+  align-items: flex-start;
+
+}
+
+.good_title {
+  width: 300rpx;
+  height: 120rpx;
+  justify-content: space-between;
+  align-items: flex-start;
+  margin-top: 49rpx;
+  margin-left: 28rpx;
+
+}
+
+.title_font {
+  width: 300rpx;
+  font-size: 36rpx;
+  font-weight: 500;
+  color: #444444;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+
+
+}
+
+.good_status {
+  width: 120rpx;
+  height: 170rpx;
+  justify-content: space-between;
+  align-items: center;
+  margin-top: 52rpx;
+  margin-left: 58rpx;
+}
+
+.change_status {
+  width: 120rpx;
+  height: 50rpx;
+  background: #F0FFC2;
+  border-radius: 10rpx 10rpx 10rpx 10rpx;
+  opacity: 1;
+  border: 1rpx solid #B6D163;
+  font-size: 26rpx;
+  text-align: center;
+  line-height: 50rpx;
+  font-weight: normal;
+  color: #B6D163;
+
+}
+
+.storeObjectstoreName {
+  width: 300rpx;
+  /* width: 50rpx !important; */
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}

+ 236 - 0
utils/base.js

@@ -0,0 +1,236 @@
+/**
+ * 深度克隆
+ * Object deepClone
+ * @param {Object} obj the object need clone
+ */
+function deepClone(obj) {
+    if (typeof obj !== 'object' || obj === null) {
+      return obj;
+    }
+  
+    if (Array.isArray(obj)) {
+      return obj.map((v) => {
+        if (typeof v === 'object' && v !== null) {
+          return deepClone(v);
+        } else {
+          return v;
+        }
+      });
+    } else {
+      const newObj = {};
+  
+      Object.keys(obj).forEach((v) => {
+        if (typeof obj[v] === 'object' && obj[v] !== null) {
+          newObj[v] = deepClone(obj[v]);
+        } else {
+          newObj[v] = obj[v];
+        }
+      });
+  
+      return newObj;
+    }
+  }
+  
+  /**
+   * @param {Object} target -目标对象
+   * @param {...Object} source -原对象 
+   * @return {Object}
+   */
+  function assign(target, ...source) {
+    const newObj = target;
+    if (source.length > 1) {
+      let newTarget = source[0];
+      source.splice(0, 1);
+      source = assign(newTarget, ...source);
+    } else {
+      source = source[0];
+    }
+    Object.keys(newObj).forEach((v) => {
+      if (typeof newObj[v] === 'object' && newObj[v] !== null && typeof source[v] === 'object' && source[v] !== null) {
+        newObj[v] = assign(newObj[v], source[v]);
+        delete source[v];
+      }
+    });
+    Object.keys(source).forEach((v) => {
+      newObj[v] = source[v];
+    });
+    return newObj;
+  }
+  
+  /**
+   * 返回空
+   * @returns {Object} -null
+   */
+  function noop() {
+    return null;
+  }
+  
+  /**
+   * 判断属性是否是对象的私有属性 非原型链属性
+   * @param {Object} obj -对象
+   * @param {string} type -属性
+   * @returns {Boolean}
+   */
+  function hasOwn(obj, type) {
+    return Object.prototype.hasOwnProperty.call(obj, type);
+  }
+  
+  /**
+   * 判断变量是否未定义
+   * @param  item
+   * @returns {Boolean}
+   */
+  function isUndef(item) {
+    return item === undefined || item === null;
+  }
+  
+  /**
+   * 判断变量是否定义
+   * @param item
+   * @returns {Boolean}
+   */
+  function isDef(item) {
+    return !this.isUndefined(item);
+  }
+  
+  /**
+   * 判断是否是字符串
+   * @param {any} item
+   * @returns {Boolean}
+   */
+  function isStr(item) {
+    return typeof item === 'string';
+  }
+  
+  /**
+   * 判断是否是数字
+   * @param {any} item
+   * @returns {Boolean}
+   */
+  function isNumber(item) {
+    return typeof item === 'number';
+  }
+  
+  /**
+   * 判断是否是数组
+   * @param {any} item
+   * @returns {Boolean}
+   */
+  function isArray(item) {
+    // 判断是否有 isArray方法 如果有绑定当前content 返回
+    if (typeof Array.isArray === 'function') {
+      return Array.isArray.bind(this)(item);
+    }
+    // pollfill
+    return Object.prototype.toString.call(item) === '[object Array]';
+  }
+  
+  /**
+   * 判断是否是对象
+   * @param {any} item
+   * @returns {Boolean}
+   */
+  function isObj(obj) {
+    return obj !== null && typeof obj === 'object';
+  }
+  
+  /**
+   * 判断是否是函数
+   * @param {any} item
+   * @returns {Boolean}
+   */
+  function isFunc(item) {
+    return typeof item === 'function';
+  }
+  
+  /**
+   * 转数字
+   * @param {any} val
+   * @returns {(typeof val | number)} -返回的值
+   */
+  function toNumber(val) {
+    let n = parseFloat(val);
+    return isNaN(n) ? val : n;
+  }
+  
+  function isEmpty(v) {
+    if (typeof v == "undefined" || v == null) {
+        return true
+    }
+    if (v == 0 || v == "") {
+        return true
+    }
+    return /^\s+$/g.test(v)
+  }
+  
+  function fenToYuan(cost) {
+    if (cost == null || cost <= 0) {
+      return 0.00
+    }
+  
+    var res = parseInt((cost / 100) * 100) / 100
+    return res.toFixed(2);
+  }
+  
+  function diffArr(arr1, arr2) {
+    return arr1.concat(arr2).filter(function (v) {
+      return arr1.indexOf(v)===-1 || arr2 .indexOf(v)===-1
+    })
+  }
+  
+  /**
+   * 计算距离,返回米
+   */
+  function getDistance(lat1, lng1, lat2, lng2) {
+    var radLat1 = lat1 * Math.PI / 180.0;
+    var radLat2 = lat2 * Math.PI / 180.0;
+    var a = radLat1 - radLat2;
+    var b = lng1 * Math.PI / 180.0 - lng2 * Math.PI / 180.0;
+    var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
+    s = s * 6378.137;
+    s = Math.round(s * 10000) / 10;
+    return s
+  }
+  
+  function parseUrlParamToObj(str) {
+    str = decodeURIComponent(str)
+    // 创建目标对象
+    let params = {}, 
+    // 截取数据字符串
+    data=str.slice(str.indexOf("?")),
+    aParams = data.substr(1).split("&")
+  
+    for (let i = 0; i < aParams.length; i++) {
+       let aParam = aParams[i].split("=");
+       params[aParam[0]] = aParam[1]
+    }
+    return params;
+  }
+  
+  /**
+   * base module. - 公共基础方法模块
+   * @module utils/base
+   * @see module:utils/base
+   */
+  
+  module.exports = {
+    /** 深拷贝 */
+    deepClone,
+    noop,
+    hasOwn,
+    isUndef,
+    isDef,
+    isStr,
+    isNumber,
+    isArray,
+    isObj,
+    isFunc,
+    toNumber,
+    assign,
+    isEmpty,
+    fenToYuan,
+    diffArr,
+    getDistance,
+    parseUrlParamToObj
+  };
+  

+ 192 - 0
utils/cache.js

@@ -0,0 +1,192 @@
+
+import { isFunc, isEmpty } from "./base";
+
+function getUserInfo() {
+    return wx.getStorageSync('userInfo') || null;
+}
+
+function setUserInfo(user) {
+    wx.setStorageSync('userInfo', user)
+}
+
+function setaddress(address) {
+    wx.setStorageSync('address', address)
+}
+function getaddress() {
+  return wx.getStorageSync('address')
+}
+
+
+
+function setUserInfoPart(userPart) {
+    let user = getUserInfo()
+    if (user == null) {
+        user = userPart
+    } else {
+        for(let k in userPart) {
+            user[k] = userPart[k]
+        }
+    }
+    setUserInfo(user)
+}
+
+/**
+ * 获取用户当前选中的店铺
+ */
+function getCurrStore() {
+    return wx.getStorageSync('store') || null
+}
+
+/**
+ * 获取用户当前选中的桌位
+ */
+function getCurrTable() {
+    return wx.getStorageSync('table') || null
+}
+function getChooseStore() {
+    return wx.getStorageSync('chooseStore') || null
+}
+
+
+function setChooseStore(chooseStore) {
+    wx.setStorageSync('chooseStore', chooseStore)
+}
+function getMobile() {
+    const userInfo = getUserInfo()
+    if (userInfo != null) {
+        return userInfo.mobile || ''
+    }
+    return ''
+}
+
+function getStoreId() {
+    const store = getCurrStore()
+    if (store != null) {
+        return store.id || null;
+    }
+    return null
+}
+
+
+// 缓存门店取餐方式
+
+function setStoreWay(storeway) {
+    wx.setStorageSync('storeway', storeway)
+}
+
+
+
+function getStoreWay(storeway) {
+    return wx.getStorageSync('storeway')||null;
+}
+
+
+function setCurrStore(store) {
+    wx.setStorageSync('store', store)
+}
+
+
+
+function setCurrTable(table) {
+    wx.setStorageSync('table', table)
+}
+
+//存储最近的经纬度
+function setNearLocation(longitude,latitude) {
+    wx.setStorageSync('nearLocation', {
+        longitude:longitude,
+        latitude:latitude
+    })
+}
+//获取最近的经纬度
+function getNearLocation() {
+    return wx.getStorageSync('nearLocation')||null;
+}
+function getTableId() {
+    const table = getCurrTable()
+    if (table != null) {
+        return table.tableId || null
+    }
+    return null
+}
+
+function getSessionKey() {
+    return wx.getStorageSync('loginInfo').sessionKey
+}
+
+function getOpenId() {
+    return wx.getStorageSync('loginInfo').openId
+}
+
+function getLoginInfo() {
+    wx.getStorageSync('loginInfo')||null;
+}
+
+/**
+ * 授权手机号
+ * @param {*} e 
+ * @param {*} func 
+ */
+function getPhoneNumber(e, func) {
+    console.log(e)
+    let code = e.detail.code;
+    //获取手机号
+    if (isEmpty(code)) {
+        // 兼容老版本
+        var encryptedData = e.detail.encryptedData;
+        // console.log(encryptedData);
+        var iv = e.detail.iv;
+        if (!encryptedData || encryptedData.length == 0 || !iv || iv.length == 0) {
+          return;
+        }
+        //获取手机号
+        doDecodePhoneOld(encryptedData, iv, function (mobile) {
+          func(mobile)
+        });
+    } else {
+        doDecodePhone(code, function (mobile) {
+            func(mobile)
+        });
+    }
+}
+
+
+
+
+function checkInvalid(param = {}, callBack) {
+    // wx.checkSession({
+    //     success() {
+    //         if (isFunc(callBack)) {
+    //             callBack(param)
+    //         }
+    //     },
+    //     fail() {
+    //         login(callBack)
+    //     }
+    // })
+    login(callBack)
+}
+
+
+module.exports = {
+    getMobile,
+    getPhoneNumber,
+    getStoreId,
+    getTableId,
+    setCurrStore,
+    getCurrStore,
+    getCurrTable,
+    setCurrTable,
+    setUserInfo,
+    getUserInfo,
+    setUserInfoPart,
+    getLoginInfo,
+    setNearLocation,
+    getNearLocation,
+    setStoreWay,
+    getStoreWay,
+    setaddress,
+    getaddress,
+    setChooseStore,
+    getChooseStore,
+}

+ 60 - 0
utils/location.js

@@ -0,0 +1,60 @@
+import base from "./base"
+
+export function getLocation(callBack) {
+    wx.getSetting({
+        success(res) {
+            // 1. scope.userLocation 为真, 代表用户已经授权
+            if (res.authSetting['scope.userLocation']) {
+            // 1.1 使用 getlocation 获取用户 经纬度位置
+            wx.getLocation({
+                success(res){
+                    // 1.2 获取用户位置成功后,将会返回 latitude, longitude 两个字段,代表用户的经纬度位置
+                    if (base.isFunc(callBack)) {
+                        callBack(res.longitude, res.latitude)
+                    }
+                },
+                fail() {
+                }
+            })
+            }else {
+                // 2. 用户未授权的情况下, 打开授权界面, 引导用户授权.
+                wx.authorize({
+                    scope: "scope.userLocation",
+                    success(res) {
+                        wx.getLocation({
+                            success(res){
+                                if (base.isFunc(callBack)) {
+                                    callBack(res.longitude, res.latitude)
+                                }
+                            },
+                            fail() {
+                            }
+                        })     
+                    }
+                })
+            }
+        }
+    })
+}
+
+export function getCurrDistance(longitude, latitude, resultFunc) {
+    getLocation(function(lng,lat) {
+        let m = base.getDistance(latitude, longitude, lat, lng)
+        console.log("m")
+        console.log(m)
+        let formatM1 = ""
+        let formatM2 = ""
+        if (m < 1000) {
+            formatM1 = m + "m"
+            formatM2 = m + "米"
+        } else {
+            let km = (m/1000).toFixed(2)
+            console.log(km)
+            formatM1 = km + "km"
+            formatM2 = km + "千米"
+        }
+        if (base.isFunc(resultFunc)) {
+            resultFunc(m, formatM1, formatM2)
+        }
+    })
+}