Forráskód Böngészése

feat(pages) feat团餐

clp 3 éve
szülő
commit
6a12fc0bc4

+ 7 - 1
app.json

@@ -45,7 +45,13 @@
     "pages/groupmeallist/myOrder/myOrder",
     "pages/groupmeallist/invoicesList/invoicesList",
     "pages/groupmeallist/addinvoices/addinvoices",
-    "pages/groupmeallist/submitOrder/submitOrder"
+    "pages/groupmeallist/submitOrder/submitOrder",
+    "pages/groupmeallist/goodsManagement/goodsManagement",
+    "pages/groupmeallist/address/address",
+    "pages/groupmeallist/addOrEditaddress/addOrEditaddress"
+
+
+    
 
     
     

+ 10 - 3
app.wxss

@@ -54,15 +54,15 @@
 .flex-row-between-end {
   display: flex;
   flex-flow: row nowrap;
-  justify-content: space-between;
+  justify-content: flex-end;
   align-items: flex-end;
 }
 
 .page {
   width: 100%;
   height: 100%;
-  background-color: #F7F7F7;
-  overflow-y: auto;
+  /* background-color: #F7F7F7; */
+  /* overflow-y: auto; */
 }
 
 .fontSize-3 {
@@ -91,4 +91,11 @@ font-family: Segoe UI, Segoe UI-Bold;
 font-weight: 700;
 text-align: left;
 color: #000000;
+}
+.text_over{
+  
+  vertical-align: middle;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
 }

+ 9 - 0
components/vtabs/index.wxss

@@ -9,6 +9,15 @@
 	height: 100%
 }
 
+::-webkit-scrollbar {
+ 
+	width:0;
+	 
+	height:0;
+	 
+	color:transparent;
+	 
+	}
 .weui-vtabs-bar__scrollview {
 	height: 100%
 }

+ 769 - 94
pages/groupmeallist/goodDetails/goodDetails.js

@@ -1,17 +1,32 @@
 // pages/groupmeallist/goodDetails/goodDetails.js
+import storeGoods from '../../../api/storeGoods'
+const user = require('../../../utils/user.js');
+const cache = require('../../../utils/cache.js');
+import base from '../../../utils/base'
 Page({
 
     /**
      * 页面的初始数据
      */
     data: {
-        bannerList:[{},{}],
-        isShowSpecPannel:false,
+        bannerList: [{}, {}],
+        isShowSpecPannel: false,
         activeTab: 0,
-        totalPrice:2,
-        isShowCartPannel: true,
-        cartSkuMapData:[{}],
-        comBoFoodsList:[{}]
+        totalPrice: 2,
+        isShowCartPannel: false,
+        cartSkuMapData: [{}],
+        comBoFoodsList: [{}],
+        comBoObject: {},
+        comBoObjectCopy: {},
+        shopCarList: [],
+        allnum: '',
+        chooseNum: 0,
+        currSpecGoodsSpec: {},
+
+        childrenindex: '',
+        idx: '',
+        setsId: ''
+
     },
 
     /**
@@ -19,8 +34,363 @@ Page({
      */
     onLoad: function (options) {
 
+        let goodsJson = JSON.parse(options.goodsJson)
+        this.setData({
+            comBoObject: goodsJson,
+            comBoObjectCopy: goodsJson
+        })
+
+        console.log(goodsJson)
+
     },
 
+    // 商品添加
+    comBoFoodsListAdd: async function (e) {
+        let childrenindex = e.currentTarget.dataset.childrenindex;
+        let comBoObject = this.data.comBoObject
+        let idx = e.currentTarget.dataset.idx;
+        let setsId = comBoObject.productComboSetsList[idx].setsId
+        let productObject = e.currentTarget.dataset.productlist;
+        let allnum = 0;
+        let chooseNum = this.data.chooseNum;
+
+        let setObeject = comBoObject.productComboSetsList[idx]
+        let chooseGood = comBoObject.productComboSetsList[idx].comboSku.productList[childrenindex]
+
+
+        if (comBoObject.productComboSetsList[idx].shopCarList == null || comBoObject.productComboSetsList[idx].shopCarList.length <= 0) {
+            console.log('進入if')
+            comBoObject.productComboSetsList[idx].shopCarList = []
+
+            comBoObject.productComboSetsList[idx].shopCarList.push({
+                productName: productObject.productName,
+                subtitle: '',
+                num: 1,
+                childrenindex: childrenindex,
+                idx: idx,
+                setsId: setsId,
+                skuId: productObject.skuList[0].skuId
+
+            })
+
+
+            //列表显示数值
+            chooseGood.num = 1
+
+            this.data.shopCarList.push(comBoObject.productComboSetsList[idx].shopCarList[comBoObject.productComboSetsList[idx].shopCarList.length - 1])
+            console.log(this.data.shopCarList)
+
+            this.data.shopCarList.forEach(v => {
+
+                allnum += v.num
+            })
+            this.setData({
+                allnum: allnum,
+                shopCarList: this.data.shopCarList,
+                comBoObject: comBoObject
+            })
+            console.log(this.data.shopCarList)
+
+        } else {
+            console.log(this.data.shopCarList)
+            console.log('else')
+            let exist = 0
+            //为添加购物车总数
+
+            comBoObject.productComboSetsList[idx].shopCarList.forEach((v) => {
+                chooseNum += v.num
+
+            })
+
+
+            // //判难是否超过最大数量
+            if (chooseNum < setObeject.optionNum) {
+                console.log(this.data.shopCarList)
+
+                let shopCartList = JSON.parse(JSON.stringify(this.data.shopCarList))
+                shopCartList.forEach((item, i) => {
+                    console.log(item)
+                    if (productObject.productName == item.productName) {
+                        console.log("qian" + item.num)
+                        item.num = item.num + 1
+
+                    }
+                })
+
+
+                this.data.comBoObject.productComboSetsList[idx].shopCarList.forEach((v) => {
+                    //名称一致 并且分类允许重复选择
+                    if (v.productName == productObject.productName && setObeject.repeatSelect == 1) {
+                        console.log("发现商品一样")
+                        v.num = v.num + 1
+                        exist = 1;
+                        chooseGood.num = chooseGood.num + 1
+
+
+                    } else if (v.productName == productObject.productName && setObeject.repeatSelect == 0) {
+                        wx.showToast({
+                            title: '此分类不可重复选择',
+                            icon: 'none',
+                            duration: 3000
+                        })
+                        exist = 2;
+                        return
+                    }
+                })
+
+                console.log(this.data.shopCarList)
+                //列表显示数值
+                console.log("执行列表显示值")
+                // chooseGood.num = chooseGood.num + 1
+
+                if (exist == 0) {
+                    console.log("进入0")
+                    comBoObject.productComboSetsList[idx].shopCarList.push({
+                        productName: productObject.productName,
+                        subtitle: '',
+                        num: 1,
+                        childrenindex: childrenindex,
+                        idx: idx,
+                        setsId: setsId,
+                        skuId: productObject.skuList[0].skuId
+                    })
+                    chooseGood.num = 1
+
+
+                    shopCartList.push(comBoObject.productComboSetsList[idx].shopCarList[comBoObject.productComboSetsList[idx].shopCarList.length - 1])
+
+                } else if (exist == 2) {
+                    return
+                }
+
+
+
+
+                // 购物车总数累加 根据分类分成多组分类购物车
+
+
+                shopCartList.forEach((v) => {
+                    allnum += v.num
+                })
+
+                this.setData({
+                    allnum: allnum,
+                    shopCarList: shopCartList,
+                    comBoObject: comBoObject,
+                    chooseNum: 0
+
+                })
+                console.log(comBoObject.productComboSetsList[idx].shopCarList)
+
+            } else {
+                wx.showToast({
+                    title: '此分类选择数量最大为' + setObeject.optionNum,
+                    icon: 'none',
+                    duration: 3000
+                })
+
+            }
+
+
+
+
+        }
+
+    },
+    comBoFoodsListReduce: function (e) {
+
+
+        let childrenindex = e.currentTarget.dataset.childrenindex;
+        let idx = e.currentTarget.dataset.idx;
+        let setsId = e.currentTarget.dataset.setsId;
+        let productObject = e.currentTarget.dataset.productlist;
+        let allnum = 0;
+
+        let comBoObject = this.data.comBoObject
+        let setObeject = comBoObject.productComboSetsList[idx]
+        let chooseGood = comBoObject.productComboSetsList[idx].comboSku.productList[childrenindex]
+
+
+        chooseGood.num = chooseGood.num - 1
+        comBoObject.productComboSetsList[idx].shopCarList.forEach((item, i) => {
+            if (productObject.productName == item.productName) {
+                item.num = item.num - 1
+                if (item.num <= 0) {
+                    comBoObject.productComboSetsList[idx].shopCarList.splice(i, 1)
+                }
+            }
+
+        })
+
+
+
+        this.data.shopCarList.forEach((item, i) => {
+            if (productObject.productName == item.productName) {
+                console.log("qian" + item.num)
+                item.num = item.num - 1
+                console.log("hou" + item.num)
+                if (item.num <= 0) {
+                    this.data.shopCarList.splice(i, 1)
+                }
+            }
+        })
+
+
+
+
+        this.data.shopCarList.forEach(v => {
+            allnum += v.num
+        })
+
+        this.setData({
+            allnum: allnum,
+            shopCarList: this.data.shopCarList,
+            comBoObject: comBoObject
+
+        })
+    },
+
+    comBoFoodsListReduceCar: function (e) {
+        let productObject = e.currentTarget.dataset.item;
+        let childrenindex = productObject.childrenindex;
+        let idx = productObject.idx;
+        let setsId = productObject.setsId;
+
+        let allnum = 0;
+
+        let comBoObject = this.data.comBoObject
+        let setObeject = comBoObject.productComboSetsList[idx]
+        let chooseGood = comBoObject.productComboSetsList[idx].comboSku.productList[childrenindex]
+
+
+        chooseGood.num = chooseGood.num - 1
+        comBoObject.productComboSetsList[idx].shopCarList.forEach((item, i) => {
+            if (productObject.productName == item.productName) {
+
+                if ((item.num = productObject.num - 1) <= 0) {
+                    comBoObject.productComboSetsList[idx].shopCarList.splice(i, 1)
+                }
+            }
+
+        })
+
+
+
+        this.data.shopCarList.forEach((item, i) => {
+            if (productObject.productName == item.productName) {
+
+                if ((item.num = productObject.num - 1) <= 0) {
+                    this.data.shopCarList.splice(i, 1)
+                }
+            }
+        })
+
+
+
+
+        this.data.shopCarList.forEach(v => {
+            allnum += v.num
+        })
+
+        this.setData({
+            allnum: allnum,
+            shopCarList: this.data.shopCarList,
+            comBoObject: comBoObject
+
+        })
+    },
+
+    comBoFoodsListAddCar: async function (e) {
+
+        let productObject = e.currentTarget.dataset.item;
+        let childrenindex = productObject.childrenindex;
+        let idx = productObject.idx;
+        let setsId = productObject.setsId;
+        // let productObject = e.currentTarget.dataset.productlist;
+        let allnum = 0;
+
+
+
+        let chooseNum = this.data.chooseNum;
+        let comBoObject = this.data.comBoObject
+        let setObeject = comBoObject.productComboSetsList[idx]
+        let chooseGood = comBoObject.productComboSetsList[idx].comboSku.productList[childrenindex]
+
+        console.log("循环之前")
+        console.log(comBoObject.productComboSetsList[idx].shopCarList)
+
+        // return
+
+        //为添加购物车总数
+        comBoObject.productComboSetsList[idx].shopCarList.forEach(v => {
+            chooseNum += v.num
+        })
+        //判难是否超过最大数量
+        if (chooseNum < setObeject.optionNum) {
+            let exits = true
+            comBoObject.productComboSetsList[idx].shopCarList.forEach(v => {
+                //名称一致 并且分类允许重复选择
+                if (v.productName == productObject.productName && setObeject.repeatSelect == 1) {
+                    console.log("发现商品一样")
+                    v.num = productObject.num + 1
+
+                } else if (v.productName == productObject.productName && setObeject.repeatSelect == 0) {
+                    wx.showToast({
+                        title: '此分类不可重复选择',
+                        icon: 'none',
+                        duration: 3000
+                    })
+                    exits = false
+                    return
+                }
+            })
+
+            if (!exits) {
+                return
+            } else {
+                //列表显示数值
+
+                chooseGood.num = chooseGood.num + 1
+
+
+                this.data.shopCarList.forEach(item => {
+
+                    if (item.productName == productObject.productName) {
+                        console.log("发现商品一样")
+                        item.num = productObject.num + 1
+
+                    }
+                })
+
+
+                // 购物车总数累加 根据分类分成多组分类购物车
+                this.data.shopCarList.forEach(v => {
+                    allnum += v.num
+                })
+
+                this.setData({
+                    allnum: allnum,
+                    shopCarList: this.data.shopCarList,
+                    comBoObject: comBoObject,
+                    chooseNum: 0
+
+                })
+
+            }
+        } else {
+            wx.showToast({
+                title: '此分类选择数量最大为' + setObeject.optionNum,
+                icon: 'none',
+                duration: 3000
+            })
+
+        }
+
+
+
+
+
+    },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */
@@ -71,106 +441,411 @@ Page({
     },
 
     //关闭购物车面板
-  closeCartPannel: function() {
-    this.setData({
-        isShowCartPannel: false
-    })
-},
+    closeCartPannel: function () {
+        this.setData({
+            isShowCartPannel: false
+        })
+    },
 
     //关闭选规格面板
-    closeSpecPannel: function() {
+    closeSpecPannel: function () {
         this.setData({
             isShowSpecPannel: false
         })
     },
-  //显示对话框
-  showCartPannel: function () {
-    // 显示遮罩层
-    var animation = wx.createAnimation({
-        duration: 100,
-        timingFunction: "linear",
-        delay: 0
-    })
-    this.animation = animation
-    animation.translateY(300).step()
-    this.setData({
-        animationData: animation.export(),
-        isShowCartPannel: true
-    })
-    setTimeout(function () {
-        animation.translateY(0).step()
+    //显示对话框
+    showCartPannel: function () {
+        // 显示遮罩层
+        var animation = wx.createAnimation({
+            duration: 100,
+            timingFunction: "linear",
+            delay: 0
+        })
+        this.animation = animation
+        animation.translateY(300).step()
         this.setData({
-            animationData: animation.export()
-        })
-    }.bind(this), 100)
-},
-
-  //显示选规格
-  showSpecPannel: function () {
-    // 显示遮罩层
-    var animation = wx.createAnimation({
-        duration: 100,
-        timingFunction: "linear",
-        delay: 0
-    })
-    this.animation = animation
-    animation.translateY(300).step()
-    this.setData({
-        animationData: animation.export(),
-        isShowSpecPannel: true
-    })
-    setTimeout(function () {
-        animation.translateY(0).step()
+            animationData: animation.export(),
+            isShowCartPannel: true
+        })
+        setTimeout(function () {
+            animation.translateY(0).step()
+            this.setData({
+                animationData: animation.export()
+            })
+        }.bind(this), 100)
+    },
+
+    //显示选规格
+    showSpecPannel: function () {
+        // 显示遮罩层
+        var animation = wx.createAnimation({
+            duration: 100,
+            timingFunction: "linear",
+            delay: 0
+        })
+        this.animation = animation
+        animation.translateY(300).step()
         this.setData({
-            animationData: animation.export()
-        })
-    }.bind(this), 100)
-},
- // 弹窗购物车面板
- popCartPannel: function () {
-    if (this.data.isShowCartPannel) {
-        this.closeCartPannel()
-        return
-    }
-    if (this.data.allNum == 0) {
-        return
-    }
-    this.showCartPannel();
-},
+            animationData: animation.export(),
+            isShowSpecPannel: true
+        })
+        setTimeout(function () {
+            animation.translateY(0).step()
+            this.setData({
+                animationData: animation.export()
+            })
+        }.bind(this), 100)
+    },
+    // 弹窗购物车面板
+    popCartPannel: function () {
+        if (this.data.isShowCartPannel) {
+            this.closeCartPannel()
+            return
+        }
+        if (this.data.allNum == 0) {
+            return
+        }
+        this.showCartPannel();
+    },
+    submitCat(e) {
+        let childrenindex = this.data.childrenindex;
+        let comBoObject = this.data.comBoObject;
+        let idx = this.data.idx;
+        let specObject = this.data.currSpecGoodsSpec;
+        let setsId = this.data.setsId;
 
 
+        let productObject = e.currentTarget.dataset.productlist;
+        let allnum = 0;
+        let chooseNum = this.data.chooseNum;
 
- // 弹窗购物车面板
- popSpecPannel: function () {
-    if (this.data.isShowCartPannel) {
-        this.closeSpecPannel()
-        return
-    }
-    if (this.data.allNum == 0) {
-        return
-    }
-    this.showSpecPannel();
-},
-
-
-   // 详情和收起
-   changeCollapseOrDetail :function (e){
-    let idx = e.currentTarget.dataset.idx;
-    var that = this;
-    that.data.cartSkuMapData[idx].show = !that.data.cartSkuMapData[idx].show
-    that.setData({
-        cartSkuMapData:that.data.cartSkuMapData
-    });
-    console.log("购物车详情");
-    console.log(that.data.cartSkuMapData);
-},
-
-// 加入购物车返回商品列表
-    gotoStoreGoods(){
-        wx.switchTab({  
-            url:'/pages/groupmeallist/storeGoods/storeGoods'       
-                });
+        let setObeject = comBoObject.productComboSetsList[idx]
+        let chooseGood = comBoObject.productComboSetsList[idx].comboSku.productList[childrenindex]
+
+        if (comBoObject.productComboSetsList[idx].shopCarList == null || comBoObject.productComboSetsList[idx].shopCarList.length <= 0) {
+            comBoObject.productComboSetsList[idx].shopCarList = []
+
+            comBoObject.productComboSetsList[idx].shopCarList.push({
+                productName: specObject.productName,
+                subtitle: '',
+                text: specObject.currSelectedSpecName,
+                num: 1,
+                childrenindex: childrenindex,
+                idx: idx,
+                setsId: setsId,
+                skuId: specObject.currSku.skuId
+
+            })
+
+            this.data.shopCarList.push(comBoObject.productComboSetsList[idx].shopCarList[comBoObject.productComboSetsList[idx].shopCarList.length - 1])
+
+
+            this.data.shopCarList.forEach(v => {
+
+                allnum += v.num
+            })
+            this.setData({
+                allnum: allnum,
+                shopCarList: this.data.shopCarList,
+                comBoObject: comBoObject
+            })
+
+        } else {
+            console.log('else')
+            let exist = 0
+            //为添加购物车总数
+            console.log(chooseNum + '上面')
+            comBoObject.productComboSetsList[idx].shopCarList.forEach(v => {
+                chooseNum += v.num
+
+            })
+            let shopCartList = JSON.parse(JSON.stringify(this.data.shopCarList))
+            shopCartList.forEach((item, i) => {
+                console.log(item)
+                if (specObject.productName == item.productName) {
+                    console.log("qian" + item.num)
+                    item.num = item.num + 1
+
+                }
+            })
+
+
+            console.log(chooseNum + '下面')
+            //判难是否超过最大数量
+            if (chooseNum < setObeject.optionNum) {
+                console.log("进入数量小于")
+                comBoObject.productComboSetsList[idx].shopCarList.forEach(v => {
+                    //名称一致 并且分类允许重复选择
+                    if (v.productName == specObject.productName && setObeject.repeatSelect == 1) {
+                        console.log("发现商品一样")
+                        v.num = v.num + 1
+                        exist = 1;
+                    } else if (v.productName == specObject.productName && setObeject.repeatSelect == 0) {
+                        wx.showToast({
+                            title: '此分类不可重复选择',
+                            icon: 'none',
+                            duration: 3000
+                        })
+                        exist = 2;
+                        return
+                    }
+                })
+                //列表显示数值
+                console.log("执行列表显示值")
+                // chooseGood.num = chooseGood.num + 1
+
+                if (exist == 0) {
+                    comBoObject.productComboSetsList[idx].shopCarList.push({
+                        productName: specObject.productName,
+                        subtitle: '',
+                        num: 1,
+                        childrenindex: childrenindex,
+                        text: specObject.currSelectedSpecName,
+                        idx: idx,
+                        setsId: setsId,
+                        skuId: specObject.currSku.skuId
+                    })
+                    // chooseGood.num = 1
+                } else if (exist == 2) {
+                    return
+                }
+                let repeatSelect = false
+                shopCartList.forEach(item => {
+
+                    if (item.productName == specObject.productName) {
+                        console.log("发现商品一样")
+                        item.num = item.num + 1
+                        repeatSelect = true
+                    }
+                })
+                if (!repeatSelect) {
+                    shopCartList.push(comBoObject.productComboSetsList[idx].shopCarList[comBoObject.productComboSetsList[idx].shopCarList.length - 1])
+                }
+
+                // 购物车总数累加 根据分类分成多组分类购物车
+                shopCartList.forEach(v => {
+                    allnum += v.num
+                })
+
+                this.setData({
+                    allnum: allnum,
+                    shopCarList: shopCartList,
+                    comBoObject: comBoObject,
+                    chooseNum: 0
+
+                })
+                console.log(comBoObject.productComboSetsList[idx])
+
+            } else {
+                wx.showToast({
+                    title: '此分类选择数量最大为' + setObeject.optionNum,
+                    icon: 'none',
+                    duration: 3000
+                })
+
+            }
+
+
+
+
+        }
+
+
+    },
+
+    comBoselectSpecNode(e) {
+        let specId = e.currentTarget.dataset.specid
+        let specKey = e.currentTarget.dataset.speckey
+        console.log("specId" + specId + "----" + "specKey" + specKey)
+
+        let currSpecGoodsSpec = this.data.currSpecGoodsSpec
+        console.log(currSpecGoodsSpec)
 
+        // 选中的规格id列表
+        let specIdList = []
+        let specNameList = []
+
+        currSpecGoodsSpec.productSpecList.forEach(function (spec, index) {
+            // currSpecGoods.productSpecList.forEach(spec => {
+            spec.specValueList.forEach(specValue => {
+                console.log("循环内specId" + spec.specId)
+                if (spec.specId == specKey) {
+                    console.log("specValue.specId" + specValue.specId + "specId" + specId)
+                    if (specValue.specId == specId) {
+                        console.log("Yes俩个条件全部命中")
+                        specValue.active = true
+                        console.log(specValue)
+                        specIdList.push(specId)
+                        specNameList.push(specValue.specValue)
+                    } else {
+                        console.log("No俩个条件全部未命中")
+                        specValue.active = false
+                    }
+                } else {
+                    if (specValue.active) {
+                        specIdList.push(specValue.specId)
+                        specNameList.push(specValue.specValue)
+                    }
+                }
+            })
+        })
+
+        currSpecGoodsSpec.currSelectedSpecName = specNameList.join('/') || ""
+        currSpecGoodsSpec.specNameList = specNameList
+        currSpecGoodsSpec.currSku = null
+
+        // 根据选中的规格找到skuId
+        currSpecGoodsSpec.skuList.forEach(function (sku, index) {
+            let dA = base.diffArr(specIdList, sku.specIdList)
+            console.log("命中")
+            console.log(dA)
+            if (dA.length == 0) {
+                // 命中
+                currSpecGoodsSpec.currSku = sku
+                console.log("命中")
+                console.log(currSpecGoodsSpec.currSku)
+            }
+        })
+
+        this.setData({
+            currSpecGoodsSpec
+        })
+
+    },
+
+    // 弹窗购物车面板
+    popSpecPannel: function (e) {
+
+        let childrenindex = e.currentTarget.dataset.childrenindex;
+
+        let idx = e.currentTarget.dataset.idx;
+        let setsId = this.data.comBoObject.productComboSetsList[idx].setsId
+
+        this.setData({
+            childrenindex: childrenindex,
+            idx: idx,
+            setsId: setsId
+
+        })
+
+
+        let productlist = e.currentTarget.dataset.productlist;
+        this.setData({
+
+            // 规格赋值
+            currSpecGoodsSpec: e.currentTarget.dataset.productlist,
+            opacityStyle: "opacity0"
+        })
+
+
+        if (this.data.isShowCartPannel) {
+            this.closeSpecPannel()
+            return
+        }
+        if (this.data.allNum == 0) {
+            return
+        }
+        this.showSpecPannel();
+    },
+
+
+    // 详情和收起
+    changeCollapseOrDetail: function (e) {
+        let idx = e.currentTarget.dataset.idx;
+        var that = this;
+        that.data.cartSkuMapData[idx].show = !that.data.cartSkuMapData[idx].show
+        that.setData({
+            cartSkuMapData: that.data.cartSkuMapData
+        });
+        console.log("购物车详情");
+        console.log(that.data.cartSkuMapData);
+    },
+
+    // 加入购物车返回商品列表
+    gotoStoreGoods() {
+        let allnum = 0
+        let subitNum = 0
+        let obeject = this.data.comBoObject.productComboSetsList
+        this.data.shopCarList.forEach(v => {
+            allnum += v.num
+        })
+        this.data.comBoObject.productComboSetsList.forEach(item => {
+            subitNum += item.optionNum
+        })
+
+        if (allnum == subitNum) {
+
+            console.log("符合加入购物车条件")
+
+            let comboSkuList = []
+
+            obeject.forEach(item => {
+                item.comboSkuList = []
+                item.shopCarList.forEach(v => {
+                    item.comboSkuList.push(v)
+
+                })
+            })
+
+            obeject.forEach(item => {
+                comboSkuList.push({
+                    setsId: item.setsId,
+                    skuList: item.comboSkuList
+                })
+
+
+            })
+            console.log(obeject)
+            console.log(comboSkuList)
+
+
+            storeGoods.comBoaddToCart({
+                storeId: cache.getStoreId(),
+                mobile: cache.getMobile(),
+                skuId: this.data.comBoObject.skuId,
+                num: 1,
+                comboSkuList: comboSkuList,
+            }).then(res => {
+                if (res.code == 200) {
+
+                    wx.switchTab({
+                        url: '/pages/groupmeallist/storeGoods/storeGoods'
+                    });
+                }
+            }).catch(_ => {})
+
+        } else {
+            wx.showToast({
+                title: '请选择您喜欢的商品哟,亲!',
+                icon: 'none',
+                duration: 3000
+            })
+        }
+
+
+
+
+    },
+    //清空购物车
+    onChangeShowStateDelFalse() {
+        //购物车清空
+        this.data.shopCarList = []
+        //列表显示清空
+        this.data.comBoObject.productComboSetsList.forEach(item => {
+            item.comboSku.productList.forEach(v => {
+                    v.num = 0
+
+                }),
+                item.shopCarList = []
+        })
+
+
+        this.setData({
+            shopCarList: this.data.shopCarList,
+            comBoObject: this.data.comBoObject,
+            allnum: 0,
+            chooseNum: 0
+        })
 
     }
 })

+ 2 - 0
pages/groupmeallist/goodDetails/goodDetails.json

@@ -1,5 +1,7 @@
 {
   "usingComponents": {
+    "topbar": "../../../components/topbar",
+    "custom-page": "../../../components/customPage/customPage"
   },
   "navigationStyle": "custom"
 }

+ 59 - 39
pages/groupmeallist/goodDetails/goodDetails.wxml

@@ -1,7 +1,8 @@
 <view class="page_background">
+    <topbar slot="head" title="" back-color="" title-color="" />
     <view>
         <image src="/images/groupmeallist/goodDetailbackgroundImg.png" class="imgDiv"></image>
-        <view class="goodTitle">清爽夏日套餐</view>
+        <view class="goodTitle">{{comBoObject.productName}}</view>
     </view>
 
 
@@ -9,32 +10,42 @@
     <view class="flex-column">
 
 
-        <swiper interval="5000" duration="500"  >
-            <block wx:for="{{bannerList}}" wx:key="unique">
-                <swiper-item >
+        <swiper class='swiper' style="height:1400rpx;" duration="300" bindchange="bindchange">
+            <block wx:for="{{comBoObject.productComboSetsList}}" wx:for-item="item" wx:key="index">
+                <swiper-item class="swiper_item">
                     <!-- 商品提示 是否可重复 -->
-                    <view style="  box-shadow: 0px -8px 10px 0px rgba(0,0,0,0.16); width: 98%;margin: 0px auto">
+                    <view style="box-shadow: 0px -8px 10px 0px rgba(0,0,0,0.16); width: 98%;margin: 0px auto;height: 1000rpx;">
                         <view class="page_center flex-row">
-                            <view class="page_center_text">选择3个饮品(可重复)</view>
+                            <view class="page_center_text">请选择{{item.setsName}} {{item.optionNum}}份
+
+                                <span wx:if="{{item.repeatSelect==0}}">(不可重复)</span>
+                                <span wx:if="{{item.repeatSelect==1}}">(可重复)</span>
 
-                        </view>
-                        <view class="forGoodDiv flex-row">
-                            <view class="forGoodDiv_img">
-                                <image style="width: 160rpx; height: 160rpx;" src="http://res.hualala.com/basicdoc/6023560d-c88f-4858-b984-6f7c056769d7.jpg"></image>
                             </view>
-                            <view class="forGoodDiv_right flex-column">
-                                <view class="forGoodDiv_right_title"> 杨枝甘露清爽版</view>
-                                <view class="flex-row-between-end" style="width: 100%;">
-                                    <view style="font-size:32rpx;font-weight:700;">¥ 20.0</view>
-                                    <view class="good_spec" catchtap="popSpecPannel">选规格</view>
-                                    <!-- <image  class="shop-cart-price-wrap_add" src="/images/groupmeallist/PositionDiv_icon.png"></image> -->
+                        </view>
+                        <view wx:for="{{item.comboSku.productList}}" wx:for-item="productList" wx:for-index="childrenindex">
+                            <view class="forGoodDiv flex-row" style="margin-bottom: 38rpx;">
+                                <view class="forGoodDiv_img">
+                                    <image style="width: 160rpx; height: 160rpx;" src="http://res.hualala.com/basicdoc/6023560d-c88f-4858-b984-6f7c056769d7.jpg"></image>
+                                </view>
+                                <view class="forGoodDiv_right flex-column">
+                                    <view class="forGoodDiv_right_title">{{productList.productName}}</view>
+                                    
+                                    <view class="flex-row-between-end" style="width: 100%;">
+                                        <view style="font-size:32rpx;font-weight:700;"></view>
+                                        <view   wx:if="{{productList.openSpec == 1}}" class="good_spec"  data-idx="{{index}}" data-productlist="{{productList}}" data-childrenindex="{{childrenindex}}" data-setsId=" {{item}}" catchtap="popSpecPannel">选规格</view>
+
+                                        <view style="display: flex; flex-flow: row;">
+                                            <image wx:if="{{productList.num >0}}" data-idx="{{index}}" data-productlist="{{productList}}" data-childrenindex="{{childrenindex}}" data-setsId=" {{item}}" catchtap="comBoFoodsListReduce" class="shop-cart-price-wrap_add" style="margin-right: 0rpx;" src="/images/groupmeallist/reduce.png"></image>
+                                            <view style="margin-left: 5rpx; margin-right: 5rpx;" wx:if="{{productList.num >0}}">{{productList.num}}</view>
+                                            <image wx:if="{{productList.openSpec == 0}}" data-idx="{{index}}" data-productlist="{{productList}}" data-childrenindex="{{childrenindex}}" data-setsId=" {{item}}" catchtap="comBoFoodsListAdd" class="shop-cart-price-wrap_add" src="/images/groupmeallist/PositionDiv_icon.png"></image>
+                                        </view>
+                                    </view>
 
                                 </view>
 
                             </view>
-
                         </view>
-
                     </view>
                 </swiper-item>
             </block>
@@ -46,28 +57,32 @@
             <view class="flex-row">
                 <view style="margin-left: 51rpx;" class="flex-row" catchtap="popCartPannel">
                     <image src="/images/groupmeallist/shop_car.png" style="width: 53rpx;height: 53rpx;"></image>
-                    <view class="sum_shop">1</view>
+                    <view class="sum_shop" wx:if="{{allnum>0}}">{{allnum}}</view>
                 </view>
-                <view style="font-size: 47rpx;font-weight: 700;">
+                <!-- <view style="font-size: 47rpx;font-weight: 700;">
                     <text style="font-size: 37rpx;font-weight: 700;margin-left: 34rpx;">¥</text>58.8
-                </view>
+                </view> -->
             </view>
-            <view class="addCar" catchtap="gotoStoreGoods">加入购物车</view>
+            <view class="addCar yes" catchtap="gotoStoreGoods">加入购物车</view>
         </view>
     </view>
 
     <view class="bottom_div flex-row" style="display: {{isShowSpecPannel ==true ? 'bloack':'none'  }};">
         <view class="flex-row">
-            <view style="margin-left: 40rpx;justify-content: flex-start;" class="flex-row" catchtap="popCartPannel">
+            <!-- <view style="margin-left: 40rpx;justify-content: flex-start;" class="flex-row" catchtap="popCartPannel">
                 <view style="font-size: 24rpx;font-weight: 400;line-height: 40rpx;width: 48rpx;height: 32rpx;">合计</view>
 
                 <view style="font-size: 47rpx;font-weight: 700;">
                     <text style="font-size: 37rpx;font-weight: 700;margin-left: 8rpx;">¥</text>58.8
                 </view>
-            </view>
+            </view> -->
 
         </view>
-        <view class="addCar" catchtap="">加入购物车</view>
+        <view class="addCar {{currSpecGoodsSpec.specNameList.length == currSpecGoodsSpec.productSpecList.length?'yes':'no'}}"
+         catchtap="{{currSpecGoodsSpec.specNameList.length == currSpecGoodsSpec.productSpecList.length?'submitCat':''}}">
+           
+        
+        加入购物车</view>
     </view>
 
     <!--选规格弹出框  -->
@@ -81,9 +96,9 @@
                         <image style="width: 160rpx; height: 160rpx;" src="http://res.hualala.com/basicdoc/6023560d-c88f-4858-b984-6f7c056769d7.jpg"></image>
                     </view>
                     <view class="forGoodDiv_right flex-column" style="margin-top: 35rpx;">
-                        <view class="forGoodDiv_right_title"> 杨枝甘露清爽版</view>
+                        <view class="forGoodDiv_right_title"> {{currSpecGoodsSpec.productName}}</view>
                         <view class="flex-row-between-end" style="width: 100%;">
-                            <view style="font-size:32rpx;font-weight:700;">¥ 20.0</view>
+                            <view style="font-size:32rpx;font-weight:700;"></view>
                         </view>
 
                     </view>
@@ -91,15 +106,19 @@
                 </view>
                 <!-- 规格循环 -->
                 <view>
+                <block wx:for="{{currSpecGoodsSpec.productSpecList}}" wx:for-item="spec" wx:key="idx">
                     <view style="margin-top: 39rpx;height: 37px;font-size: 28rpx;font-weight: 400;color: #000000;margin-left: 40rpx;line-height: 37rpx;">
-                        杯型
+                        {{spec.specName}}
                     </view>
                     <!-- 规格值循环 -->
-                    <view class="flex-row" style="  margin-left: 40rpx;">
-                        <view class="sepc_value {{item.active? 'active': ''}}">大杯</view>
-                        <view class="sepc_value">中杯</view>
+                    <view class="flex-row">
+                    <view wx:for="{{spec.specValueList}}" wx:for-item="item" wx:key="specIdx" class=" flex-row  {{item.active? 'active': ''}}" data-speckey="{{spec.specId}}" data-specid="{{item.specId}}" catchtap="comBoselectSpecNode" style="  margin-left: 40rpx;">
+                        <view class="sepc_value {{item.active? 'active': ''}}"> {{item.specValue}}</view>
+                        <!-- <view class="sepc_value">中杯</view> -->
                     </view>
                 </view>
+                </block>
+                </view>
             </view>
         </view>
     </view>
@@ -121,25 +140,26 @@
                 <view class="cart-goods-list">
                     <!-- 循环购物车 -->
 
-                    <view wx:for="{{cartSkuMapData}}" wx:key="index" class="shop_car_foods">
+                    <view wx:for="{{shopCarList}}" wx:key="index" class="shop_car_foods" wx:for-item="item">
                         <view class="flex-column">
                             <view class="shop_car_foods_title flex-row-between">
                                 <!-- 可能存在优惠标识 -->
-                                <view class="shop_car_foods_title_left flex-row">
-                                    <view style="max-width: 370rpx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;margin-left: 28rpx;"> 清爽夏日套餐</view>
-                                    <view catchtap="changeCollapseOrDetail" class="Collapse_and_details">{{cartSkuMapData[index].show == true ? '收起' : '详情'}}</view>
+                                <view class="shop_car_foods_title_left flex-column">
+                                    <view style="max-width: 370rpx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;margin-left: 28rpx;"> {{item.productName}}</view>
+                                    <!-- <view catchtap="changeCollapseOrDetail" class="Collapse_and_details">{{cartSkuMapData[index].show == true ? '收起' : '详情'}}</view> -->
+                                    <view wx:if="{{item.text.length>0}}" style="height: 27rpx;font-size: 20rpx;font-weight: 400;text-align: left;color: #a8a8a8;margin-top:9rpx;margin-left: 28rpx;">{{item.text}}</view>
                                 </view>
                                 <view class="shop-cart-price-wrap">
-                                    <view style="font-size: 32rpx;font-weight:700;margin-right: 14rpx;">¥ 58.8</view>
+                                    <view style="font-size: 32rpx;font-weight:700;margin-right: 14rpx;"></view>
                                     <view class="flex-row" style="height: 45rpx;line-height: 45rpx;text-align: center;">
 
                                         <view>
-                                            <image class="shop-cart-price-wrap_reduce" src="/images/groupmeallist/reduce.png"></image>
+                                            <image class="shop-cart-price-wrap_reduce" catchtap="comBoFoodsListReduceCar" data-item="{{item}}" src="/images/groupmeallist/reduce.png"></image>
                                         </view>
 
-                                        <view class="price_food">1</view>
+                                        <view class="price_food">{{item.num}}</view>
                                         <view>
-                                            <image class="shop-cart-price-wrap_add" src="/images/groupmeallist/PositionDiv_icon.png"></image>
+                                            <image class="shop-cart-price-wrap_add" data-item="{{item}}" catchtap="comBoFoodsListAddCar" src="/images/groupmeallist/PositionDiv_icon.png"></image>
                                         </view>
                                     </view>
 

+ 15 - 1
pages/groupmeallist/goodDetails/goodDetails.wxss

@@ -11,6 +11,13 @@
     height: 596rpx;
     background: rgba(0,0,0,0.00);
 }
+
+.swiper {
+
+  /* width: 100%; */
+  height: 100vh;
+
+}
 .page_center{
     width: 100%;
     height: 64rpx;
@@ -21,6 +28,7 @@
     align-items: center;
     margin-bottom: 45rpx;
     margin-top: -40rpx;
+
    
 
 
@@ -32,6 +40,7 @@
     font-weight: 400;
     text-align: center;
     color: #ffffff;
+    margin-top: 50rpx;
 }
 .goodTitle{
     /* width: 216px; */
@@ -119,7 +128,6 @@
 .addCar{
     width: 200rpx;
     height: 60rpx;
-    background: #AFD250;
     text-align: center;
     line-height: 60rpx;
     font-size: 28rpx;
@@ -128,6 +136,12 @@
     color: #ffffff;
     margin-right: 33rpx;
 }
+.yes{
+  background: #AFD250;
+}
+.no{
+  background: gray;
+}
 
 .cart-pannel {
     width: 100vw;

+ 401 - 72
pages/groupmeallist/storeGoods/storeGoods.js

@@ -1,8 +1,21 @@
 import CustomPage from '../../../base/CustomPage'
+import storeGoods from '../../../api/storeGoods'
+
+import {
+  getCurrDistance
+} from '../../../utils/location'
+
+import storeList from '../../../api/storeList'
+const cache = require('../../../utils/cache.js');
+const user = require('../../../utils/user.js');
+import base from '../../../utils/base'
 
 CustomPage({
   onShareAppMessage() {
     return {
+      storeInfo: null,
+      store: null,
+      distance: null,
       title: 'vtabs',
       path: 'page/weui/example/vtabs/vtabs'
     }
@@ -10,114 +23,430 @@ CustomPage({
   data: {
     vtabs: [],
     activeTab: 0,
-    totalPrice:2,
+    totalPrice: 2,
     isShowCartPannel: false,
-    cartSkuMapData:[{}],
-    comBoFoodsList:[{},{}]
+    cartSkuMapData: [{}],
+    comBoFoodsList: [{}, {}],
+    showView: true,
+    showViewDel: false,
+    showViewNotInStore: false,
+    notInStoreImage: 'https://cdn1.overseasdragon.com.cn/xcx-smdd/order_not_in_store.png',
+    openScroll: true,
+    openGoodsScroll: false,
+    goodsScrollTop: 0,
+    currSpecGoods: {},
+    allNum: 0,
+    allFee: 0.0,
+    isShowCartPannel: false,
+    isShowSpecPannel: false,
+    isShowComboPannel: false,
+    collapseOrDetail: {},
+    hasMobile: false,
+    isShowComboSpecPannel: false,
+    currSpecGoodsSpec: {},
+    comBoShow: false,
+    opacityStyle: "opacity8",
+    orderMode: ''
   },
 
   // 进入门店列表
-  goToStoreList(){
+  goToStoreList() {
     wx.navigateTo({
       url: '/pages/groupmeallist/storeList/storeList',
     })
 
 
   },
-    // 商品详情
-    gotoGoodDetails(){
-      wx.navigateTo({
-        url: '/pages/groupmeallist/goodDetails/goodDetails'
-      })
+  // 商品详情
+  gotoGoodDetails(e) {
+    let idx = e.currentTarget.dataset.index;
+    let fatherindex = e.currentTarget.dataset.fatherindex;
 
+    let goods = this.data.vtabs[fatherindex].goodsList[idx]
+    let goodsJson = JSON.stringify(goods)
+
+    wx.navigateTo({
+      url: '/pages/groupmeallist/goodDetails/goodDetails?goodsJson=' + goodsJson
+    })
 
-    },
 
-    // 弹窗购物车面板
-    popCartPannel: function () {
-      if (this.data.isShowCartPannel) {
-          this.closeCartPannel()
-          return
-      }
-      if (this.data.allNum == 0) {
-          return
-      }
-      this.showCartPannel();
   },
-   // 详情和收起
-   changeCollapseOrDetail :function (e){
+
+  //创建订单
+  confirmOrder() {
+
+    wx.navigateTo({
+      url: '../submitOrder/submitOrder',
+    })
+
+
+  },
+
+  // 弹窗购物车面板
+  popCartPannel: function () {
+    if (this.data.isShowCartPannel) {
+      this.closeCartPannel()
+      return
+    }
+    if (this.data.allNum == 0) {
+      return
+    }
+    this.showCartPannel();
+  },
+  // 详情和收起
+  changeCollapseOrDetail: function (e) {
     let idx = e.currentTarget.dataset.idx;
     var that = this;
     that.data.cartSkuMapData[idx].show = !that.data.cartSkuMapData[idx].show
     that.setData({
-        cartSkuMapData:that.data.cartSkuMapData
+      cartSkuMapData: that.data.cartSkuMapData
     });
     console.log("购物车详情");
     console.log(that.data.cartSkuMapData);
-},
-//关闭购物车面板
-  closeCartPannel: function() {
+  },
+  //关闭购物车面板
+  closeCartPannel: function () {
     this.setData({
-        isShowCartPannel: false
+      isShowCartPannel: false
     })
-},
+  },
   //显示对话框
   showCartPannel: function () {
     // 显示遮罩层
     var animation = wx.createAnimation({
-        duration: 100,
-        timingFunction: "linear",
-        delay: 0
+      duration: 100,
+      timingFunction: "linear",
+      delay: 0
     })
     this.animation = animation
     animation.translateY(300).step()
     this.setData({
-        animationData: animation.export(),
-        isShowCartPannel: true
+      animationData: animation.export(),
+      isShowCartPannel: true
     })
     setTimeout(function () {
-        animation.translateY(0).step()
-        this.setData({
-            animationData: animation.export()
-        })
+      animation.translateY(0).step()
+      this.setData({
+        animationData: animation.export()
+      })
     }.bind(this), 100)
-},
-  onLoad() {
-    const tabs = [
-      {
-        title: '技术开发',
-        title2: '小程序开发进阶',
-        img: 'https://cdn1.shpr.top/saas1/hsay/publicPath/228aaa1e-450f-4d52-a61a-e4f32b1c9bc0.jpg',
-        desc: '本视频系列课程,由腾讯课堂NEXT学院与微信团队联合出品,通过实战案例,深入浅出地进行讲解。',
-      },
-      {
-        title: '产品解析',
-        title2: '微信小程序直播',
-        img: 'http://mmbiz.qpic.cn/sz_mmbiz_png/GEWVeJPFkSHALb0g5rCc4Jf5IqDfdwhWJ43I1IvriaV5uFr9fLAuv3uxHR7DQstbIxhNXFoQEcxGzWwzQUDBd6Q/0?wx_fmt=png',
-        desc: '微信小程序直播系列课程持续更新中,帮助大家更好地理解、应用微信小程序直播功能。',
-      },
-      {
-        title: '运营规范',
-        title2: '常见问题和解决方案',
-        img: 'http://mmbiz.qpic.cn/sz_mmbiz_jpg/GEWVeJPFkSGqys4ibO2a8L9nnIgH0ibjNXfbicNbZQQYfxxUpmicQglAEYQ2btVXjOhY9gRtSTCxKvAlKFek7sRUFA/0?wx_fmt=jpeg',
-        desc: '提高审核质量',
-      },
-      {
-        title: '营销经验',
-        title2: '流量主小程序',
-        img: 'http://mmbiz.qpic.cn/sz_mmbiz_jpg/GEWVeJPFkSH2Eic4Lt0HkZeEN08pWXTticVRgyNGgBVHMJwMtRhmB0hE4m4alSuwsBk3uBBOhdCr91bZlSFbYhFg/0?wx_fmt=jpeg',
-        desc: '本课程共四节,将分阶段为开发者展示如何开通流量主功能、如何接入广告组件、不同类型小程序接入的建议。',
-      },
-      {
-        title: '高校大赛',
-        title2:'2020中国高校计算机大赛',
-        img: 'http://mmbiz.qpic.cn/mmbiz_jpg/TcDuyasB5T3Eg34AYwjMw7xbEK2n01ekiaicPiaMInEMTkOQtuv1yke5KziaYF4MLia4IAbxlm0m5NxkibicFg4IZ92EA/0?wx_fmt=jpeg',
-        desc: '微信小程序应用开发赛',
+  },
+  onLoad(options) {},
+
+  async onShow() {
+    let _self = this;
+
+    //获取缓存赋值
+    let location = cache.getCurrStore()
+    console.log("缓存值")
+    console.log(location)
+    if (location != null) {
+      _self.setData({
+        storeInfo: location
+      })
+
+    } else {
+      _self.authMobileLocation()
+
+    }
+
+    await this.loadData()
+    await this.loadStoreData()
+    await this.loadCartData()
+  },
+
+  loadStoreData() {
+    let store = cache.getCurrStore()
+    console.log("store")
+    console.log(store)
+    this.setData({
+      store: store || {}
+    })
+    getCurrDistance(store.longitude, store.latitude, (m, m1, m2) => {
+      this.setData({
+        distance: "距离您" + m1
+      })
+    })
+  },
+
+
+  loadData() {
+    storeGoods.getExhibit(cache.getStoreId()).then(res => {
+      if (res.code == 200) {
+        this.dataMapView(res.data)
+      }
+    }).catch(_ => {})
+  },
+
+
+  handleAddToCart(e) {
+    let goodsId = e.currentTarget.dataset.goodsid;
+    let skuId = e.currentTarget.dataset.skuid || null;
+    let combo = e.currentTarget.dataset.combo;
+
+    this.addSubCart(goodsId, skuId, 1, combo)
+  },
+
+  async addSubCart(goodsId, skuId, num, comboSkuList) {
+
+    console.log("进入套餐购物api")
+    await storeGoods.comBoaddToCart({
+      storeId: cache.getStoreId(),
+      mobile: cache.getMobile(),
+      skuId: skuId,
+      num: num,
+      comboSkuList: comboSkuList,
+    }).then(res => {
+      if (res.code == 200) {
+        this.refreshCartData()
+      }
+    }).catch(_ => {})
+    await this.loadCartData()
+
+
+
+
+  },
+
+  handleSubToCart(e) {
+    let goodsId = e.currentTarget.dataset.goodsid;
+    let skuId = e.currentTarget.dataset.skuid || null;
+    let combo = e.currentTarget.dataset.combo;
+
+    this.addSubCart(goodsId, skuId, -1, combo)
+
+  },
+
+  dataMapView(data) {
+
+    // let bannerList = null;
+    // if (data.bannerList && data.bannerList.length > 0) {
+    //     bannerList = data.bannerList;
+    // }
+    let tabs = [];
+    if (data.classifyGoodsList && data.classifyGoodsList.length > 0) {
+      console.log("进入方法")
+      data.classifyGoodsList.forEach(v => {
+        let classify = v.classify || {}
+        let node = {
+          title: classify.classifyName,
+          img: classify.fullClassifyFigure,
+          classifyId: classify.classifyId,
+          classifyCode: classify.classifyCode,
+          classifyName: classify.classifyName,
+          fullClassifyFigure: classify.fullClassifyFigure,
+          goodsList: v.goodsList
+        }
+
+        v.goodsList.forEach((vv, i) => {
+          if (base.isArray(vv.productSkuList)) {
+            let minPriceSku = this.getMinPriceGoods(vv.productSkuList)
+            vv.priceY = minPriceSku.priceY
+            vv.oriPriceY = minPriceSku.oriPriceY
+            vv.minPriceSku = minPriceSku
+          }
+          if (base.isEmpty(vv.openSpec) && base.isArray(vv.productSkuList) && vv.productSkuList.length > 0) {
+            if (vv.minPriceSku) {
+              vv.skuId = vv.minPriceSku.skuId
+            } else {
+              vv.skuId = vv.productSkuList[0].skuId
+            }
+          }
+        })
+        tabs.push(node)
+      })
+
+      this.setData({
+        vtabs: tabs,
+      })
+      console.log("this.data.vtabs")
+      console.log(this.data.vtabs)
+    }
+
+
+  },
+  getMinPriceGoods(productSkuList) {
+    let minPriceSku = null;
+    productSkuList.forEach(sku => {
+      if (minPriceSku == null) {
+        minPriceSku = sku
+      } else {
+        if (minPriceSku.price > sku.price) {
+          minPriceSku = sku
+        }
+      }
+    })
+    return minPriceSku
+  },
+  /**
+   * 加载购物车数据
+   */
+  loadCartData() {
+    storeGoods.getCartData(cache.getStoreId(), user.getMobileCache(), null, null).then(res => {
+      if (res.code == 200) {
+        this.cartDataMapToView(res.data)
+      }
+    }).catch(_ => {
+      console.log(_)
+    })
+  },
+
+  // 购物车数据映射
+  cartDataMapToView(data) {
+    // var isShowCartPannel = true;
+    if (base.isEmpty(data.skuList) || data.skuList.length == 0) {
+      // isShowCartPannel = false
+      data.totalPriceY = "0.00"
+      data.totalNum = 0
+    }
+
+    console.log("进入购物车塞值")
+
+    this.setData({
+      allFee: data.totalPriceY,
+      allNum: data.totalNum,
+      cartSkuMapData: data.skuList,
+      // isShowCartPannel: isShowCartPannel,
+      isShowSpecPannel: false,
+    })
+
+    // if (base.isEmpty(data.skuList) || data.skuList.length == 0) {
+    //     this.setData({
+    //         allFee: 0.0,
+    //         allNum: 0,
+    //         cartSkuMapData: {},
+    //         isShowCartPannel: false,
+    //     })
+    //     return
+    // }
+    // this.data.cartSkuMapData = {}
+    // // 总金额
+    // let allFee = 0;
+    // // 总商品数
+    // let allNum = 0;
+    // data.skuList.forEach(sku => {
+    //     this.data.cartSkuMapData[sku.skuId] = sku
+    //     sku.allFee = base.fenToYuan(sku.num * sku.price)
+    //     allFee = allFee.add(sku.allFee)
+    //     allNum = allNum.add(sku.num)
+    //     sku.allOriFee = base.fenToYuan(sku.num * sku.oriPrice)
+    // })
+    // this.setData({
+    //     allFee: allFee,
+    //     allNum,
+    //     cartSkuMapData: this.data.cartSkuMapData
+    // })
+  },
+  /**
+   * 获取定位
+   */
+  getPosition() {
+    let _self = this;
+    wx.getLocation({
+      type: 'wgs84',
+      success(res) {
+        console.log(res);
+        const latitude = res.latitude
+        const longitude = res.longitude
+        //存储最近的经纬度
+        cache.setNearLocation(longitude, latitude);
+
+        _self.nearbyStoreList(longitude, latitude);
       },
-    ]
-    this.setData({ vtabs: tabs })
+      fail(res) {
+        console.log(res)
+      }
+    })
+  },
+
+  /**
+   * 获取最近的门店
+   */
+  async nearbyStoreList(longitude, latitude) {
+    let _self = this;
+    try {
+      let storeRes = await storeList.nearbyStoreList(longitude, latitude);
+      if (storeRes.code == 200 && storeRes.msg == "success") {
+        let data = storeRes.data;
+        _self.setData({
+          storeInfo: data
+        })
+
+        cache.setCurrStore(data)
+      }
+    } catch (error) {
+      console.log(error);
+    }
   },
+  authMobileLocation: function () {
+    var _self = this;
+    wx.getSystemInfoAsync({
+      success(res) {
+        console.log(res)
+        if (res.locationEnabled) {
+          _self.authLocation();
+        } else {
+          wx.showToast({
+            title: '请打开手机位置信息',
+            icon: 'none',
+            duration: 1000
+          })
+
+        }
 
+      }
+    })
+  },
+  authLocation: function () {
+    var _self = this;
+    wx.getSetting({ //先查看授权情况
+      success: function (res) {
+        console.log(res);
+        var statu = res.authSetting;
+        //判断是否授权,没有授权就提示下面的信息
+        //undefined  是第一次没有拒绝 也没有同意
+        //true 是已经同意了
+        //false  是拒绝了
+        if (statu['scope.userLocation'] === undefined || statu['scope.userLocation'] === true) {
+          _self.getPosition()
+          return;
+        }
+
+        //授权被拒绝了 需要重新允许小程序授权
+        if (statu['scope.userLocation'] === false) {
+          wx.showModal({
+            title: '需要获取您的地理位置,请确认授权,否则小程序功能将无法使用',
+            cancelColor: '需要获取您的地理位置,请确认授权,否则小程序功能将无法使用',
+            success: function (tip) {
+              if (tip.confirm) { //查看是否点击确定
+                wx.openSetting({ //打开设置
+                  success: function (data) {
+                    if (data.authSetting["scope.userLocation"] == true) { //到这一步表示打开了位置授权   
+                      _self.getPosition()
+                    }
+
+                  },
+
+                })
+              } else {
+                wx.showToast({
+                  title: '取消授权',
+                  icon: 'none',
+                  duration: 1000
+                })
+              }
+            }
+          })
+        } else {
+          wx.showToast({
+            title: '请给小程序授权位置服务',
+            icon: 'none',
+            duration: 1000
+          })
+        }
+      }
+    })
+  },
 
   onTabClick(e) {
     const index = e.detail.index
@@ -134,4 +463,4 @@ CustomPage({
     })
   }
 
-})
+})

+ 41 - 27
pages/groupmeallist/storeGoods/storeGoods.wxml

@@ -1,55 +1,55 @@
 <view class="page_background">
   <!-- 门店定位地址 -->
   <view class="storePositioning flex-column">
-    <view class="storeName" catchtap="goToStoreList">上海浦东金高路店
+    <view class="storeName" catchtap="goToStoreList">{{storeInfo.storeName}}
       <image src="/images/groupmeallist/left_icon.png" style="width: 10rpx;height: 19rpx;"></image>
     </view>
     <view class="storedistance">
       <image src="/images/groupmeallist/distance.png" style="width: 18rpx;height: 23rpx;"></image>
-      距离您1.03km
+      {{distance}}
     </view>
 
     <view class="goods_scroll_content">
       <mp-vtabs vtabs="{{vtabs}}" activeTab="{{activeTab}}" bindtabclick="onTabClick" bindchange="onChange" class="test">
-        <block wx:for="{{vtabs}}" wx:key="title">
+        <block wx:for="{{vtabs}}" wx:key="title" wx:for-index="father_index">
           <mp-vtabs-content tabIndex="{{index}}">
             <view class="classify_title">{{item.title}}</view>
 
             <!-- 商品列表 -->
-            <!-- <view wx:for="{{item.goodsList}}" wx:key="goodsKey" wx:for-item="goods" class="goods_item"> -->
-            <view class="vtabs-content-item" catchtap="gotoGoodDetails">
-              <image src="{{item.img}}" class="itemimg"></image>
-              <view class="PositionDiv">
-                <view class="PositionDiv_title">清爽夏日套餐</view>
-                <view class="PositionDiv_detail">订单满188元,立减38元</view>
-                <view class="PositionDiv_addAndicon flex-row">
-                  <view style="font-weight: 700;font-size:32rpx">¥ 58.8 起</view>
-                  <view class="PositionDiv_icon">
-                    <image src="/images/groupmeallist/PositionDiv_icon.png"></image>
+            <view wx:for="{{item.goodsList}}" wx:key="index" wx:for-item="goods" class="goods_item">
+              <view class="vtabs-content-item" data-index="{{index}}" data-fatherindex="{{father_index}}" catchtap="gotoGoodDetails">
+                <image src="{{goods.fullFigure}}" class="itemimg"></image>
+                <view class="PositionDiv">
+                  <view class="PositionDiv_title">{{goods.productName}}</view>
+                  <view class="PositionDiv_detail">{{goods.subtitle}}</view>
+                  <view class="PositionDiv_addAndicon flex-row">
+                    <view style="font-weight: 700;font-size:32rpx">¥ {{goods.priceY}} 起</view>
+                    <view class="PositionDiv_icon">
+                      <image src="/images/groupmeallist/PositionDiv_icon.png"></image>
+                    </view>
                   </view>
-                </view>
 
 
 
+                </view>
               </view>
-            </view>
 
-            <!-- </view> -->
+            </view>
 
           </mp-vtabs-content>
         </block>
 
 
       </mp-vtabs>
-      <view class="bottom_div flex-row" style="display: {{totalPrice >0 ? 'bloack':'none'  }};">
+      <view class="bottom_div flex-row" style="display: {{allNum >0 ? 'bloack':'none'  }};">
         <view style="margin-left: 89rpx;" class="flex-row" catchtap="popCartPannel">
           <image src="/images/groupmeallist/shop_car.png" style="width: 53rpx;height: 53rpx;"></image>
-          <view class="sum_shop">1</view>
+          <view class="sum_shop" wx:if="{{allNum >0}}">{{allNum}}</view>
         </view>
         <view style="font-size: 47rpx;font-weight: 700;">
-          <text style="font-size: 37rpx;font-weight: 700;margin-left: 34rpx;">¥</text>58.8
+          <text style="font-size: 37rpx;font-weight: 700;margin-left: 34rpx;">¥</text>{{allFee}}
         </view>
-        <view style="margin-left: 292rpx;font-size: 32rpx;font-weight: 700;color: #444444;">去结算</view>
+        <view style="margin-left: 292rpx;font-size: 32rpx;font-weight: 700;color: #444444;" catchtap="confirmOrder">去结算</view>
 
 
       </view>
@@ -75,18 +75,18 @@
                   <!-- 可能存在优惠标识 -->
                   <view class="shop_car_foods_title_left flex-row">
                     <view style="max-width: 370rpx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;margin-left: 28rpx;"> 清爽夏日套餐</view>
-                    <view catchtap="changeCollapseOrDetail" class="Collapse_and_details">{{cartSkuMapData[index].show == true ? '收起' : '详情'}}</view>
+                    <view catchtap="changeCollapseOrDetail" class="Collapse_and_details"  data-idx="{{index}}">{{cartSkuMapData[index].show == true ? '收起' : '详情'}}</view>
                   </view>
                   <view class="shop-cart-price-wrap">
                     <view style="font-size: 32rpx;font-weight:700;margin-right: 14rpx;">¥ 58.8</view>
                     <view class="flex-row" style="height: 45rpx;line-height: 45rpx;text-align: center;">
 
-                      <view>
+                      <view data-goodsid="{{item.goodsId}}" data-skuid="{{item.skuId}}" catchtap="handleSubToCart" data-combo="{{item.comboSkuList}}">
                         <image class="shop-cart-price-wrap_reduce" src="/images/groupmeallist/reduce.png"></image>
                       </view>
 
-                      <view class="price_food">1</view>
-                      <view>
+                      <view class="price_food">{{item.num}}</view>
+                      <view data-goodsid="{{item.goodsId}}" data-skuid="{{item.skuId}}" catchtap="handleAddToCart" data-combo="{{item.comboSkuList}}">
                         <image class="shop-cart-price-wrap_add" src="/images/groupmeallist/PositionDiv_icon.png"></image>
                       </view>
                     </view>
@@ -95,9 +95,23 @@
                   </view>
                 </view>
 
-                <view class="shop_car_foods_spec" wx:for="{{comBoFoodsList}}" wx:for-item="comBoFoodsList" wx:key="index" style="display: {{cartSkuMapData[index].show == true ? 'bloack':'none'  }};">
-                  <view>杨枝甘露清爽版</view>
-                </view>
+                <view  wx:if="{{item.comboSkuList!= null}}" class="shop_car_foods_spec {{cartSkuMapData[index].show != true ?'hide':''}}">
+                        <!-- 规格 -->
+                        套餐:
+                        <block wx:for="{{item.comboSkuList}}" wx:for-item="combo" wx:key="comboIdx">
+                            <!-- {{combo.setsName}}: -->
+                            <view style="display: inline;" wx:for="{{combo.skuList}}" wx:for-item="skuItem" wx:key="skuItemIdx">
+                                {{skuItem.productName}}<block wx:if="{{skuItem.specList.length>0}}">(</block>
+                                <block style="display: inline;" wx:for="{{skuItem.specList}}" wx:for-item="spec" wx:key="specIdx">
+                            <text>{{spec.specValue}}</text>
+                        </block>
+                        <block wx:if="{{skuItem.specList.length>0}}">)</block>
+                        x{{skuItem.num}}
+                        </view>
+                        
+                        </block>
+                    </view>
+
 
               </view>
             </view>

+ 9 - 4
pages/groupmeallist/storeGoods/storeGoods.wxss

@@ -154,8 +154,8 @@ margin-top: 7rpx;
     z-index:30;
 }
 .sum_shop{
-    width: 28rpx;
-    height: 28rpx;
+    min-width: 28rpx;
+    min-height: 28rpx;
     background: #ff0000;
     border-radius: 50%;
     margin-top: -45rpx;
@@ -332,16 +332,21 @@ margin-top: 7rpx;
 
 
 }
+
+.hide{
+  display: none !important;
+ }
 .shop_car_foods_spec {
-    /* width: 168px; */
+    width: 300px;
     /* height: 32px; */
     font-size: 24rpx;
     line-height: 32rpx;
     font-weight: 400;
-    text-align: center;
+    text-align: left;
     color: #9b9b9b;
     justify-content: center;
     align-self: start;
     margin-left: 28rpx;
     margin-top: 10rpx;
+    /* padding-bottom: 10rpx; */
   }

+ 141 - 12
pages/groupmeallist/storeList/storeList.js

@@ -1,4 +1,8 @@
 // pages/groupmeallist/storeList/storeList.js
+
+
+import StoreApi from '../../../api/storeList'
+const cache = require('../../../utils/cache.js');
 Page({
 
     /**
@@ -6,7 +10,20 @@ Page({
      */
     data: {
         phoneshow:false,
-        isShowConfirmPannel:false
+        isShowConfirmPannel:false,
+        idx:'',
+        page:1,
+        pageSize:8,
+        longitude:"",
+        latitude:"",
+        keyword:"",
+        storeList:[],
+        selectStoreInfo:null,
+        id:0,
+        isClicked:false, //是否已经点击过了,默认没有
+        pageSource:"",
+        storePhone:'',
+        store:null
     },
 
     /**
@@ -16,6 +33,63 @@ Page({
 
     },
 
+
+
+        /**
+     * 获取门店列表
+     */
+    async getNearbyStoreList(step='init') {
+        let _self = this;
+        try {
+            let storeRes = await StoreApi.getNearbyStoreList(
+                _self.data.page,
+                _self.data.pageSize,
+                _self.data.keyword,
+                _self.data.longitude,
+                _self.data.latitude);
+            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
+                    })
+
+                    console.log(list.length)
+                } 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);
+        }
+    },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */
@@ -27,7 +101,16 @@ Page({
      * 生命周期函数--监听页面显示
      */
     onShow: function () {
-
+        let _self = this;
+        //获取最近的经纬度
+        let locationPosition = cache.getNearLocation()
+        if(locationPosition!=null) {
+            _self.setData({
+                longitude:locationPosition.longitude,
+                latitude:locationPosition.latitude
+            })
+        }
+        _self.getNearbyStoreList();
     },
 
     /**
@@ -55,7 +138,12 @@ Page({
      * 页面上拉触底事件的处理函数
      */
     onReachBottom: function () {
-
+        let _self = this;
+        _self.setData({
+            page:_self.data.page+1
+        })
+        //获取门店列表
+        _self.getNearbyStoreList('pull')
     },
 
     /**
@@ -65,32 +153,45 @@ Page({
 
     },
     // 拉出电话面板
-    showPhoneTab(){
+    showPhoneTab(e){
+        let idx = e.currentTarget.dataset.idx;
+        var that = this;
+        let storePhone=this.data.storeList[idx].phone
         this.setData({
+            storePhone:storePhone,
             phoneshow : !this.data.phoneshow
-
+          
         })
 
     },
     // 确认门店拉出
     confirmstore(){},
-    confirmtPannel: function () {
+    confirmtPannel: function (e) {
+        this.setData({
+                phoneshow : false
+        })
         if (this.data.isShowConfirmPannel) {
             this.closeConfirmPannel()
             return
         }
 
-        this.showConfirmPannel();
+        this.showConfirmPannel(e);
     },
     //关闭购物车面板
   closeConfirmPannel: function() {
     this.setData({
-        isShowConfirmPannel: false
+        isShowConfirmPannel: false,
+            phoneshow : false
+
     })
 },
   //显示对话框
-  showConfirmPannel: function () {
+  showConfirmPannel (e) {
     // 显示遮罩层
+    let idx = e.currentTarget.dataset.idx;
+    var that = this;
+    let store=this.data.storeList[idx]
+
     var animation = wx.createAnimation({
         duration: 100,
         timingFunction: "linear",
@@ -100,7 +201,9 @@ Page({
     animation.translateY(300).step()
     this.setData({
         animationData: animation.export(),
-        isShowConfirmPannel: true
+        isShowConfirmPannel: true,
+        store:store,
+        idx:idx
     })
     setTimeout(function () {
         animation.translateY(0).step()
@@ -111,10 +214,36 @@ Page({
 },
 
 // 确定门店跳回商品列表
-confirmStoreGoToStoreGoods(){
+confirmStoreGoToStoreGoods(e){
+    let way = e.currentTarget.dataset.way;
+    //缓存门店取餐方式
+        cache.setStoreWay(way)
+        cache.setCurrStore(this.data.storeList[this.data.idx]);
     wx.switchTab({  
         url:'/pages/groupmeallist/storeGoods/storeGoods'       
             });
 
-}
+},
+
+
+  /**
+     * 选择门店
+     */
+    sureStore() {
+        let _self = this;
+        //存储选中的地址
+       
+        console.log(_self.data.pageSource);
+        if(_self.data.pageSource == "storeGoods"){
+            console.log(999999);
+            wx.redirectTo({
+                url: '/pages/storeGoods/storeGoods'
+            })
+           
+        }else{
+            wx.reLaunch({
+                url: '/pages/index/index?step=storeSelect'
+            })
+         }
+    },
 })

+ 26 - 26
pages/groupmeallist/storeList/storeList.wxml

@@ -1,29 +1,29 @@
-<view class="page">
+<view class="page ">
     <!-- 有门店显示此部门 -->
-    <view >
+    <view class="forview" wx:for="{{storeList}}" wx:key="index" wx:for-item="item" >
         <view class="flex-column_start_center">
-            <view class="store flex-row" catchtap="confirmtPannel">
+            <view class="store flex-row" catchtap="confirmtPannel" data-idx="{{index}}" >
                 <view class="store_left flex-column">
-                    <view class="store_Name">上海浦东金高路店</view>
-                    <view style="margin-left: 36rpx;margin-top:18rpx;" class="flex-row">
-                        <view style="margin-top: -30rpx;">
-                            <image style="width: 18rpx;height: 23rpx;line-height: 23rpx;" src="/images/groupmeallist/distance.png"></image>
+                    <view class="store_Name">{{item.storeName}}</view>
+                    <view style="margin-left: 36rpx;margin-top:18rpx;align-items: flex-start;" class="flex-row">
+                        <view style="">
+                            <image style="width: 18rpx;height: 23rpx;margin-top: 5rpx;" src="/images/groupmeallist/distance.png"></image>
                         </view>
-                        <view class="store_detail_adress">高行镇金高路1128号沪上阿姨(上海浦 东金高路店)</view>
+                        <view class="store_detail_adress">{{item.address}}</view>
                     </view>
 
-                    <view class="flex-row" style="margin-left: 36rpx;margin-top:14rpx;">
+                    <!-- <view class="flex-row" style="margin-left: 36rpx;margin-top:14rpx;">
                         <image style="width: 19rpx;height: 19rpx;line-height: 23rpx;" src="/images/groupmeallist/store_time.png"></image>
                         <view class="storebusinesshours">12:00-21:00</view>
 
-                    </view>
-                    <view class="storeState">营业中</view>
+                    </view> -->
+                    <view class="storeState">{{item.stateText}}</view>
                 </view>
                 <view style="width: 0px;height: 219rpx;border-left: 1px solid #ececec;"></view>
                 <view class="store_right flex-column_start_center">
                     <view style="width: 72rpx;height: 32rpx;font-size: 24rpx;font-weight: 400;text-align: left;color: #afd250;">去下单</view>
-                    <view style="height: 27rpx;font-size: 20rpx;margin-top: 12rpx;font-weight: 400;text-align: left;color: #000000;">距离1.03km</view>
-                    <image catchtap="showPhoneTab" style="width: 65rpx;height: 65rpx;margin-top: 40rpx;" src="/images/groupmeallist/phone_icon.png"></image>
+                    <view style="height: 27rpx;font-size: 20rpx;margin-top: 12rpx;font-weight: 400;text-align: left;color: #000000;">距离{{item.distance}}km</view>
+                    <image catchtap="showPhoneTab" data-idx="{{index}}" style="width: 65rpx;height: 65rpx;margin-top: 40rpx;" src="/images/groupmeallist/phone_icon.png"></image>
 
 
                 </view>
@@ -34,7 +34,7 @@
 
         <view class="phoneTab" style="display: {{phoneshow == true? 'block' : 'none'}};">
             <view class="phoneTab_center flex-column">
-                <view>门店电话:186-2100-3075</view>
+                <view>门店电话:{{storePhone}}</view>
                 <view style="margin-top: 60rpx;">客服电话: 400-018-9066</view>
                 <view catchtap="showPhoneTab" style="margin-top: 45rpx; width: 56rpx;height: 37rpx;font-size: 28rpx;font-weight: 400;text-align: left;color: #000000;">取消</view>
             </view>
@@ -51,24 +51,24 @@
                     <view>
                         <view class="confirmstore flex-row">
                             <view class="confirmstore_left flex-column">
-                                <view class="store_Name" style="margin-top: 23rpx;">上海浦东金高路店</view>
-                                <view style="margin-left: 36rpx;margin-top:18rpx;" class="flex-row">
-                                    <view style="margin-top: -30rpx;">
-                                        <image style="width: 18rpx;height: 23rpx;line-height: 23rpx;" src="/images/groupmeallist/distance.png"></image>
-                                    </view>
-                                    <view class="store_detail_adress">高行镇金高路1128号沪上阿姨(上海浦 东金高路店)</view>
+                                <view class="store_Name" style="margin-top: 23rpx;">{{store.storeName}}</view>
+                                <view style="margin-left: 36rpx;margin-top:18rpx;height:64rpx;align-items: flex-start;" class="flex-row">
+                                    <!-- <view style=""> -->
+                                        <image style="width: 18rpx;height: 23rpx;margin-top: 5rpx;" src="/images/groupmeallist/distance.png"></image>
+                                    <!-- </view> -->
+                                    <view class="store_detail_adress">{{store.address}}</view>
                                 </view>
 
-                                <view class="flex-row" style="margin-left: 36rpx;margin-top:14rpx;">
+                                <!-- <view class="flex-row" style="margin-left: 36rpx;margin-top:14rpx;">
                                     <image style="width: 19rpx;height: 19rpx;line-height: 23rpx;" src="/images/groupmeallist/store_time.png"></image>
                                     <view class="storebusinesshours">12:00-21:00</view>
 
-                                </view>
+                                </view> -->
 
                             </view>
                             <view style="width: 0px;height: 190rpx;border-left: 1px solid #ececec;"></view>
                             <view class="store_right flex-column_start_center">
-                                <view style="height: 27rpx;font-size: 20rpx;margin-top: 12rpx;font-weight: 400;text-align: left;color: #000000;">距离1.03km</view>
+                                <view style="height: 27rpx;font-size: 20rpx;margin-top: 12rpx;font-weight: 400;text-align: left;color: #000000;">距离{{store.distance}}km</view>
 
 
                             </view>
@@ -76,8 +76,8 @@
 
                     </view>
                     <view class="confirmstore_Delivery_Method flex-row">
-                        <view class="Pick_up_in_store" catchtap="confirmStoreGoToStoreGoods">门店自取</view>
-                        <view class="home_delivery">外送到家</view>
+                        <view class="Pick_up_in_store" catchtap="confirmStoreGoToStoreGoods" data-way="1">门店自取</view>
+                        <view class="home_delivery" catchtap="confirmStoreGoToStoreGoods" data-way="2"   >外送到家</view>
 
                     </view>
 
@@ -89,7 +89,7 @@
     </view>
 
  <!-- 无门店显示此部分 -->
-    <view style="display: none;">
+    <view style="display: {{storeList.length<=0? 'block':'none'}}" >
         <view class="page_none flex-column_start_center">
             <view class="sotre_none_img">
                 <image style="width: 579rpx; height: 478rpx; margin-top: 150rpx;" src="/images/groupmeallist/store_none.png"></image>

+ 26 - 7
pages/groupmeallist/storeList/storeList.wxss

@@ -2,9 +2,26 @@
     width: 100%;
     height: 100%;
     background-color: #F7F7F7;
-
+    overflow-y: auto;
+
+}
+::-webkit-scrollbar {
+ 
+	width:0;
+	 
+	height:0;
+	 
+	color:transparent;
+	 
+	}
+.forview{
+    width: 100%;
+    height: 100%;
+}
+/* 滚动条消失术 */
+.forview::-webkit-scrollbar {
+    display: none;
 }
-
 .page_none {
     width: 100%;
     height: 100%;
@@ -17,6 +34,7 @@
     height: 272rpx;
     background-color: white;
     border-radius: 9rpx;
+    justify-content: space-between;
 }
 
 .confirmstore {
@@ -27,6 +45,7 @@
     border: 2rpx solid #afd250;
     margin: auto;
     margin-top: 35rpx;
+    justify-content: space-between;
 }
 
 .store_left {
@@ -56,9 +75,10 @@
 
 .store_detail_adress {
     width: 395rpx;
-    height: 64rpx;
+    /* height: 64rpx; */
     font-size: 24rpx;
     font-weight: 400;
+    word-wrap: break-word;
     text-align: left;
     /* line-height: 64rpx; */
     color: #000000;
@@ -81,7 +101,7 @@
     height: 38rpx;
     border: 1px solid #707070;
     border-radius: 5rpx;
-    margin-top: 18rpx;
+    margin-top: 38rpx;
     margin-left: 38rpx;
     text-align: center;
     line-height: 38rpx;
@@ -89,8 +109,7 @@
 
 .store_right {
     max-height: 180rpx;
-    /* width: 92rpx; */
-    margin-left: 50rpx;
+    margin-right: 10rpx;
 }
 
 .phoneTab {
@@ -137,7 +156,7 @@
     width: 100vw;
     height: 100vh;
     background: #000;
-    opacity: 0.8;
+    opacity: 0.1;
     position: fixed;
     left: 0;
     top: 0;

+ 156 - 8
pages/groupmeallist/submitOrder/submitOrder.js

@@ -1,24 +1,53 @@
 // pages/groupmeallist/submitOrder/submitOrder.js
+import storeGoods from '../../../api/storeGoods'
+const cache = require('../../../utils/cache.js');
+import base from '../../../utils/base'
 Page({
 
     /**
      * 页面的初始数据
      */
     data: {
-        orderGoodList:[{},{},{},{}],
-        showAllSku:false
+        orderGoodList: [{}, {}, {}, {}],
+        store: {},
+        phone: '',
+        storeWay: '',
+        addressvaule:'',
+        addressId:'',
+
+        
+
+
+        showAllSku: false,
+        isShowPannel: false,
+        forSelectList: [],
+        discoutTitle: '',
+        couponSn: '',
+        orderMode: '',
+        discountPriceY: ''
+    },
+    //全部显示和收起
+    handleFlodExtend() {
+        this.setData({
+            showAllSku: !this.data.showAllSku
+        })
     },
-  //全部显示和收起
-  handleFlodExtend() {
-    this.setData({
-       showAllSku: !this.data.showAllSku
-    })
-},
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
 
+        let addressvaule = options.addressvalue
+        let addressId = options.addressId
+       if(addressvaule !=null && addressId!=null ){
+        this.setData({
+            addressvaule:addressvaule,
+            addressId:addressId
+
+        })
+
+       }
+
     },
 
     /**
@@ -32,8 +61,127 @@ Page({
      * 生命周期函数--监听页面显示
      */
     onShow: function () {
+        let store = cache.getCurrStore();
+        let storeWay = cache.getStoreWay()
+
+        console.log(store)
+        console.log(storeWay)
+        if (store != null) {
+            this.setData({
+                store: store,
+                storeWay: storeWay
+            })
+
+        }
+
+        this.loadCartData();
+        this.getUseConfirmOrderCoupon()
+
+
+    },
+
+    // 自动获取手机号
+
+    getPhone() {
+        let phone = cache.getMobile()
+        this.setData({
+            phone: phone
+        })
+
 
     },
+    // 选择收货地址
+    chooseAdress() {
+        wx.redirectTo({
+            url: '../address/address?isreturn=' + 'true',
+        })
+
+    },
+
+    getUseConfirmOrderCoupon() {
+        storeGoods.orderCouponForSelect({
+            storeId: cache.getStoreId(),
+            mobile: cache.getMobile(),
+            // tableId: 1
+        }).then(res => {
+            if (res.code == 200) {
+                this.setData({
+                    forSelectList: res.data
+                })
+            }
+        }).catch(_ => {
+            // // this.setData({
+            // //     isShowPannel: true
+            // // })
+
+            // this.tapSex()
+            console.log(_)
+        })
+    },
+
+
+    /**
+     * 加载购物车数据
+     */
+    loadCartData() {
+        storeGoods.getCartData(cache.getStoreId(), cache.getMobile(), null, null).then(res => {
+            if (res.code == 200) {
+                this.cartDataMapToView(res.data)
+            }
+        }).catch(_ => {
+            console.log(_)
+        })
+    },
+
+
+    cartDataMapToView(data) {
+
+        var isShowCartPannel = true;
+        if (base.isEmpty(data.skuList) || data.skuList.length == 0) {
+            isShowCartPannel = false
+            data.totalPriceY = "0.00"
+            data.totalNum = 0
+        }
+        // let skuList = data.skuList || []
+        // skuList.forEach(sku => {
+        //     if (!base.isEmpty(sku.specList)) {
+        //         let specValueList = []
+        //         sku.specList.forEach(spec => {
+        //             specValueList.push(spec.specValue)
+        //         })
+        //         sku.specDes = specValueList.join("、")
+        //     } else {
+        //         sku.specDes = ""
+        //     }
+        //     sku.allFee = base.fenToYuan(sku.num * sku.price)
+        //     sku.allOriFee = base.fenToYuan(sku.num * sku.oriPrice)
+        // })
+
+
+        this.setData({
+            isValid: data.skuList.length > 0,
+            skuList: data.skuList,
+            areaName: data.areaName,
+            tableCode: data.tableCode,
+            totalNum: data.totalNum,
+            totalOriPriceY: data.totalOriPriceY,
+            totalPriceY: data.totalPriceY - data.discountPriceY,
+            totalPrice: data.totalPrice,
+            totalOriPrice: data.totalOriPrice,
+            discountPriceY: data.discountPriceY
+        })
+    },
+    // 详情和收起
+    changeCollapseOrDetail: function (e) {
+        let idx = e.currentTarget.dataset.idx;
+        var that = this;
+        that.data.skuList[idx].show = !that.data.skuList[idx].show
+        that.setData({
+            skuList: that.data.skuList
+        });
+        console.log("购物车详情");
+        console.log(that.data.skuList);
+    },
 
     /**
      * 生命周期函数--监听页面隐藏

+ 51 - 21
pages/groupmeallist/submitOrder/submitOrder.wxml

@@ -1,49 +1,79 @@
 <view class="page flex-column">
     <view class="submitadress flex-column">
         <view>
-            <view class="fotSize32" style="margin-left: 25rpx;margin-top: 23rpx;">上海浦东金高路店</view>
+            <view class="fotSize32" style="margin-left: 25rpx;margin-top: 23rpx;">{{store.storeName}}</view>
             <view>
                 <image style="width: 18rpx;height: 23rpx;margin-left: 28rpx;margin-top: 17rpx;" src="/images/groupmeallist/distance.png"></image>
-                <span style="margin-left: 10rpx;">距离您1.03km</span>
+                <span style="margin-left: 10rpx;">距离您{{store.distance}}km</span>
             </view>
-            <view class="fontSize24" style="margin-left: 25rpx;margin-top: 16rpx;">高行镇金高路1128号沪上阿姨(上海浦东金高路店)</view>
+            <view class="fontSize24" style="margin-left: 25rpx;margin-top: 16rpx;">{{store.address}}({{store.storeName}})</view>
         </view>
 
-        <view class="flex-row" style="margin-top: 67rpx;margin-left: 22rpx;justify-content: space-between;">
+            <!-- 自取 -->
+        <view  wx:if="{{storeWay ==1}}"class="flex-row" style="margin-top: 67rpx;margin-left: 22rpx;justify-content: space-between;">
             <view class="fontSize-28" style="font-weight: 700;color: #000000;">预留电话</view>
             <view class="flex-row">
-                <span style="margin-right: 23rpx;color: #000000;" class="fontSize-28"> 18655520192 </span>
-                <view class="autoFill">自动填写</view>
+                <span style="margin-right: 23rpx;color: #000000;" class="fontSize-28">
+                    <input bindinput="listenInput" value="{{phone}}" class="sosoinput" bindblur="soso" focus="{{!openFocus}}">
+                    </input>
+                    <!-- {18655520192}  -->
+                </span>
+                <view class="autoFill" catchtap="getPhone">自动填写</view>
+            </view>
+        </view>
+<!-- 门店外送 -->
+        <view  wx:if="{{storeWay ==2}}" class="flex-row" style="margin-top: 67rpx;margin-left: 22rpx;justify-content: space-between;" catchtap="chooseAdress">
+            <view class="fontSize-28" style="font-weight: 700;color: #000000;">请选择收货地址
+            
+            <span style=" width: 200rpx; margin-left: 50rpx;color: #8B8B8B;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;">{{addressvaule}}</span>
+            </view>
+            <view class="flex-row">
+                <span style="margin-right: 23rpx;color: #000000;" class="fontSize-28">
+                </span>
+                <image style="width: 10rpx;height: 19rpx;margin-right: 35rpx;" src="/images/groupmeallist/more_than_the.png"></image>
             </view>
-
         </view>
-
         <view style="width: 93%; border-bottom: 1px #e2e2e2 solid; margin:0px auto;margin-top: 55rpx;"></view>
-
         <view class="flex-row" style="margin-top: 31rpx;margin-left: 22rpx;justify-content: space-between;">
             <view class="fontSize-28" style="font-weight: 700;color: #000000;">用餐方式</view>
-            <view class="fontSize-28" style="font-weight: 700;color: #000000;margin-right: 24rpx;">门店自取</view>
+            <view class="fontSize-28" style="font-weight: 700;color: #000000;margin-right: 24rpx;">
+                <span wx:if="{{storeWay ==1}}">门店自取</span>
+                <span wx:if="{{storeWay ==2}}">外送到家</span>
+
+
+            </view>
         </view>
     </view>
 
-    <view class="detail_center">
+    <view class="detail_center {{showAllSku ? '': 'fold'}}">
 
         <!-- 循环订单商品 -->
-        <view class="for_detail_good {{showAllSku ? '': 'fold'}}">
-            <view wx:for="{{orderGoodList}}" wx:for-index="idx" wx:key="idx" wx:for-item="item" style="margin-bottom: 62rpx;">
+        <view class="for_detail_good ">
+            <view wx:for="{{skuList}}" wx:key="index" wx:for-item="item" style="margin-bottom: 62rpx;">
 
                 <view class="goods_detail flex-row">
                     <view class="flex-row">
-                        <view class="for_detail_good_title">清爽夏日套餐<span style="color:#AFD250;margin-left:10rpx;font-size:22rpx">x1</span> </view>
-                        <view style="font-size: 24rpx;font-weight: 400;text-align: center;color: #9b9b9b;margin-left: 14rpx;border-bottom: 1rpx #9B9B9B solid;"> {{cartSkuMapData[index].show == true ? '收起' : '详情'}}</view>
+                        <view class="for_detail_good_title">{{item.productName}}<span style="color:#AFD250;margin-left:10rpx;font-size:22rpx">x{{item.num}}</span> </view>
+                        <view style="font-size: 24rpx;font-weight: 400;text-align: center;color: #9b9b9b;margin-left: 14rpx;border-bottom: 1rpx #9B9B9B solid;" data-idx="{{index}}" catchtap="changeCollapseOrDetail"> {{skuList[index].show == true ? '收起' : '详情'}}</view>
                     </view>
-                    <view class="for_detail_good_price">¥ 58.8</view>
+                    <view class="for_detail_good_price">¥ {{item.totalOriPriceY}}</view>
 
                 </view>
                 <!-- 套餐详情 -->
-                <view class="combo_detail">
-                    杨枝甘露清爽版
-                    <span style="font-size: 20rpx;">(大杯/常温/标准糖)</span>
+                <view class="combo_detail {{skuList[index].show != true ?'hide':''}}" >
+                    <!-- 杨枝甘露清爽版 -->
+                    <block wx:for="{{item.comboSkuList}}" wx:for-item="combo" wx:key="comboIdx">
+                            <!-- {{combo.setsName}}: -->
+                            <view style="display: inline;" wx:for="{{combo.skuList}}" wx:for-item="skuItem" wx:key="skuItemIdx">
+                                {{skuItem.productName}}
+
+                        <block wx:if="{{skuItem.specList.length>0}}" style="display: inline;" wx:for="{{skuItem.specList}}" wx:for-item="spec" wx:key="specIdx">
+                            <text>({{spec.specValue}})</text>
+                        </block>
+                        x{{skuItem.num}}
+                        </view>
+                        
+                        </block>
                     <span style="color:#AFD250;margin-left:10rpx;font-size:22rpx">x1</span>
                 </view>
 
@@ -60,7 +90,7 @@
                 </view>
             </block>
             <block wx:else>
-                <view class="exten-flod">查看全部(5
+                <view class="exten-flod">查看全部({{skuList.length}}
                     <image style="width:19rpx;height:10rpx;" src="/images/groupmeallist/bottom_icom.png" />
                 </view>
             </block>
@@ -75,7 +105,7 @@
             </view>
 
             <view class="flex-row">
-                <view class="coupon_sum">21个可用</view>
+                <view class="coupon_sum">{{forSelectList.length}}个可用</view>
 
                 <image style="width: 10rpx;height: 19rpx;margin-right: 35rpx;margin-top: 2rpx;" src="/images/groupmeallist/more_than_the.png"></image>
             </view>

+ 7 - 1
pages/groupmeallist/submitOrder/submitOrder.wxss

@@ -72,6 +72,9 @@
     margin-left: 25rpx;
     margin-top: 26rpx;
 }
+.sosoinput{
+    width: 180rpx;
+}
 
 .for_detail_good {
     /* max-height: 325rpx; */
@@ -125,9 +128,12 @@
     color: #afd250;
     margin-right: 61rpx;
 }
+.hide{
+    display: none !important;
+   }
 
 .combo_detail {
-    /* width: 168px; */
+    width: 248px;
     height: 32rpx;
     font-size: 24rpx;
     font-weight: 400;

+ 76 - 76
project.config.json

@@ -1,83 +1,83 @@
 {
-  "description": "项目配置文件",
-  "packOptions": {
-    "ignore": [
-      {
-        "type": "folder",
-        "value": "/minitest"
-      }
-    ],
-    "include": []
-  },
-  "setting": {
-    "urlCheck": false,
-    "es6": true,
-    "enhance": true,
-    "postcss": false,
-    "preloadBackgroundData": false,
-    "minified": false,
-    "newFeature": false,
-    "coverView": true,
-    "nodeModules": false,
-    "autoAudits": false,
-    "showShadowRootInWxmlPanel": true,
-    "scopeDataCheck": false,
-    "uglifyFileName": false,
-    "checkInvalidKey": true,
-    "checkSiteMap": true,
-    "uploadWithSourceMap": true,
-    "compileHotReLoad": false,
-    "lazyloadPlaceholderEnable": false,
-    "useMultiFrameRuntime": true,
-    "useApiHook": true,
-    "useApiHostProcess": true,
-    "babelSetting": {
-      "ignore": [],
-      "disablePlugins": [],
-      "outputPath": ""
+    "description": "项目配置文件",
+    "packOptions": {
+        "ignore": [
+            {
+                "type": "folder",
+                "value": "/minitest"
+            }
+        ],
+        "include": []
     },
-    "useIsolateContext": false,
-    "userConfirmedBundleSwitch": false,
-    "packNpmManually": false,
-    "packNpmRelationList": [],
-    "minifyWXSS": false,
-    "disableUseStrict": false,
-    "minifyWXML": false,
-    "showES6CompileOption": false,
-    "useCompilerPlugins": false,
-    "ignoreUploadUnusedFiles": false
-  },
-  "compileType": "miniprogram",
-  "libVersion": "2.23.4",
-  "appid": "wxcc1cdb8babd3f62c",
-  "projectname": "%E9%A3%9E%E7%A0%81",
-  "debugOptions": {
-    "hidedInDevtools": []
-  },
-  "scripts": {},
-  "staticServerOptions": {
-    "baseURL": "",
-    "servePath": ""
-  },
-  "isGameTourist": false,
-  "condition": {
-    "search": {
-      "list": []
+    "setting": {
+        "urlCheck": false,
+        "es6": true,
+        "enhance": true,
+        "postcss": false,
+        "preloadBackgroundData": false,
+        "minified": false,
+        "newFeature": false,
+        "coverView": true,
+        "nodeModules": false,
+        "autoAudits": false,
+        "showShadowRootInWxmlPanel": true,
+        "scopeDataCheck": false,
+        "uglifyFileName": false,
+        "checkInvalidKey": true,
+        "checkSiteMap": true,
+        "uploadWithSourceMap": true,
+        "compileHotReLoad": false,
+        "lazyloadPlaceholderEnable": false,
+        "useMultiFrameRuntime": true,
+        "useApiHook": true,
+        "useApiHostProcess": true,
+        "babelSetting": {
+            "ignore": [],
+            "disablePlugins": [],
+            "outputPath": ""
+        },
+        "useIsolateContext": false,
+        "userConfirmedBundleSwitch": false,
+        "packNpmManually": false,
+        "packNpmRelationList": [],
+        "minifyWXSS": false,
+        "disableUseStrict": false,
+        "minifyWXML": false,
+        "showES6CompileOption": false,
+        "useCompilerPlugins": false,
+        "ignoreUploadUnusedFiles": false
     },
-    "conversation": {
-      "list": []
+    "compileType": "miniprogram",
+    "libVersion": "2.19.2",
+    "appid": "wxcc1cdb8babd3f62c",
+    "projectname": "%E9%A3%9E%E7%A0%81",
+    "debugOptions": {
+        "hidedInDevtools": []
     },
-    "game": {
-      "list": []
+    "scripts": {},
+    "staticServerOptions": {
+        "baseURL": "",
+        "servePath": ""
     },
-    "plugin": {
-      "list": []
-    },
-    "gamePlugin": {
-      "list": []
-    },
-    "miniprogram": {
-      "list": []
+    "isGameTourist": false,
+    "condition": {
+        "search": {
+            "list": []
+        },
+        "conversation": {
+            "list": []
+        },
+        "game": {
+            "list": []
+        },
+        "plugin": {
+            "list": []
+        },
+        "gamePlugin": {
+            "list": []
+        },
+        "miniprogram": {
+            "list": []
+        }
     }
-  }
 }

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 168 - 0
project.private.config.json


+ 3 - 1
utils/request.js

@@ -2,7 +2,9 @@ import util, { isFunc } from './util.js'
 class request {
 
     //本地的
-  //  static BASE_URL = 'http://localhost:8014/'
+    static BASE_GROUP_URL = 'http://hsay.clp.com:8024/'
+   // static BASE_GROUP_URL = 'https://menu-api.overseasdragon.com.cn/'
+  
 //   pre环境的
 //   static BASE_URL = 'https://oapi.shpr.top/'
 //   正式的

+ 6 - 0
utils/user.js

@@ -1,4 +1,10 @@
 import WelfareMall from '../api/welfareMall'
+
+
+
+
+
+
 function getUserInfo() {
     return wx.getStorageSync('userInfo') || null;
 }