Browse Source

feat(pages) feat 商品上下架

clp 3 years ago
parent
commit
7c9ce6a792

+ 1 - 0
app.wxss

@@ -62,6 +62,7 @@
   width: 100%;
   height: 100%;
   background-color: #F7F7F7;
+
   /* background-color: #F7F7F7; */
   /* overflow-y: auto; */
 }

+ 2 - 2
pages/groupmeallist/orderDetail/orderDetail.js

@@ -86,7 +86,7 @@ copywxtap: function (event) {
   // 申请退款
   goTorefund() {
     wx.navigateTo({
-      url: '/pages/groupmeallist/refund/refund',
+      url: '/pages/groupmeallist/refund/refund?sn='+this.data.orderSn,
     })
 
 
@@ -101,7 +101,7 @@ copywxtap: function (event) {
 
     storeGoods.getPayParams({
       orderSn: orderSn,
-      payCode: "SIHAIYOULONG",
+      payCode: "HSAY-SHARE",
       openId: Activity.getOpenId(),
       isOrderPayment: true,
       orderInfoPath: "/pages/orderDetail/orderDetail?sn=" + orderSn,

+ 326 - 2
pages/groupmeallist/refund/refund.js

@@ -1,10 +1,55 @@
 // pages/groupmeallist/refund/refund.js
+import order from '../../../api/order'
+const cache = require('../../../utils/cache.js');
+import base from "../../../utils/base";
+import Upload from '../../../api/upload'
 Page({
 
     /**
      * 页面的初始数据
      */
     data: {
+        orderGoodList: [{}, {}, {}, {}],
+        showAllSku: false,
+        orderInfo: {},
+        orderSn: '',
+        chooseViewShowBanner: true,
+        orderGoodList: [], //spu-sku商品信息
+        isShowPannel: false,
+        reasonValue: '请选择退款原因',
+        reasonDetailValue: '',
+        avatarUrlShow: [],
+        t_length: 0,
+        avatarUrl: [],
+        reasonListChecked: false,
+        reasonList: [{
+            text: '不想要了/临时有事',
+            checked: false
+        }, {
+            text: '点错了/点多了/点少了',
+            checked: false
+        }, {
+            text: '地址/电话填错了',
+            checked: false
+        }, {
+            text: '忘记用红包/优惠券',
+            checked: false
+        }, {
+            text: '菜品质量问题',
+            checked: false
+        }, {
+            text: '出餐/送餐速度过慢',
+            checked: false
+        }, {
+            text: '没有按承诺的优惠',
+            checked: false
+        }, {
+            text: '其他',
+            checked: false
+        }, ]
+
+
+
 
     },
 
@@ -12,9 +57,288 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
+        if (options.sn) {
+            this.reloadPage(options.sn)
+        }
+    },
+    reloadPage(orderSn) {
+        this.setData({
+            orderSn
+        })
+
+        this.getOrderdetail();
+    },
+    listenInput(e) {
+        let value = e.detail.value;
+        this.setData({
+            reasonDetailValue: value
+        })
 
     },
+    callStorePerson() {
+        let phone = this.data.orderInfo.store.liaisonPhone;
+        wx.makePhoneCall({
+            phoneNumber: phone
+        })
+    },
+    /** 图片选择 */
+    bindViewTap: function () {
+        var that = this;
+        if (this.data.avatarUrlShow.length < 4) {
+            wx.chooseImage({
+                // 设置最多可以选择的图片张数,默认9,如果我们设置了多张,那么接收时//就不在是单个变量了,
+                count: 1,
+                sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有
+                sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有
+                success: function (res) {
+                    // 获取成功,将获取到的地址赋值给临时变量
+                    console.log(res);
+                    if (res.tempFilePaths.count == 0) {
+                        return;
+                    }
+                    //图片上传到金山云
+                    var tempFilePaths = res.tempFilePaths
+
+                    wx.uploadFile({
+                        url: Upload.uploadPic(),
+                        filePath: tempFilePaths[0],
+                        name: 'file',
+                        formData: {
+                            'basePath': 'welfareMall',
+                        },
+                        success: function (res) {
+                            //提交路径
+                            var urlImg = JSON.parse(res.data).data.url;
+                            //展示路径
+                            var destPath = JSON.parse(res.data).data.destPath;
 
+                            var imgArrNow = that.data.avatarUrl;
+                            var imgArrNowShow = that.data.avatarUrlShow;
+                            imgArrNow.push(urlImg);
+                            imgArrNowShow.push(destPath);
+                            if (that.data.avatarUrlShow.length > 4) {
+                                wx.showToast({
+                                    title: '最多添加4张图片',
+                                    icon: 'none',
+                                    duration: 1500
+                                })
+                                return
+                            }
+                            that.setData({
+                                //将临时变量赋值给已经在data中定义好的变量
+                                avatarUrl: imgArrNow,
+                                avatarUrlShow: imgArrNowShow
+                            })
+                            that.chooseViewShowBanner();
+                        },
+                        fail: function (err) {
+                            console.log(err);
+                        },
+                    })
+
+                },
+                fail: function (res) {
+                    // fail
+                },
+                complete: function (res) {
+                    // complete
+                }
+            })
+        } else {
+            wx.showToast({
+                title: '最多添加4张图片',
+                icon: 'none',
+                duration: 1500
+            })
+        }
+    },
+    /** 删除图片Banner */
+    deleteImvBanner: function (e) {
+        var avatarUrlShow = this.data.avatarUrlShow;
+        var avatarUrl = this.data.avatarUrl;
+        var itemIndex = e.currentTarget.dataset.id;
+        avatarUrlShow.splice(itemIndex, 1);
+        avatarUrl.splice(itemIndex, 1);
+        this.setData({
+            avatarUrlShow: avatarUrlShow
+        })
+        //判断是否隐藏选择图片
+        this.chooseViewShowBanner();
+    },
+    /** 是否隐藏图片选择Banner*/
+    chooseViewShowBanner: function () {
+        if (this.data.avatarUrlShow.length > 3) {
+            this.setData({
+                chooseViewShowBanner: false
+            })
+        } else {
+            this.setData({
+                chooseViewShowBanner: true
+            })
+        }
+    },
+    // 选中改变
+    changeChecked(e) {
+        let index = e.currentTarget.dataset.id;
+        let value = '';
+        this.data.reasonList.forEach((item, id) => {
+            if (id == index) {
+                item.checked = true
+                value = item.text
+            } else {
+                item.checked = false
+            }
+        })
+        this.setData({
+            reasonList: this.data.reasonList,
+            reasonValue: value,
+            reasonListChecked: true
+            // isShowPannel: false
+
+        })
+
+
+    },
+    /**
+     * 获取订单详情
+     */
+    async getOrderdetail() {
+        let _self = this;
+        try {
+            let orderRes = await order.getOrderDetail({
+                orderSn: _self.data.orderSn,
+                mobile: cache.getMobile()
+            });
+            if (orderRes.code == 200 && orderRes.msg == "success") {
+                let orderInfo = orderRes.data;
+                orderInfo.originPrice = (parseFloat(orderInfo.payPrice) / 100).toFixed(2)
+                _self.setData({
+                    orderInfo: orderInfo,
+                })
+                //组建spu sku
+                _self.createOrderGoodList(orderInfo.orderGoodsList)
+            }
+        } catch (error) {
+            console.log(error);
+        }
+    },
+    closeCartPannel: function () {
+        this.setData({
+            isShowPannel: 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(),
+            isShowPannel: true
+        })
+        setTimeout(function () {
+            animation.translateY(0).step()
+            this.setData({
+                animationData: animation.export()
+            })
+        }.bind(this), 100)
+    },
+
+    submit() {
+        if (this.data.reasonListChecked) {
+            order.refund({
+                mobile: cache.getMobile(),
+                orderSn: this.data.orderSn,
+                reason: this.data.reasonValue + this.data.reasonDetailValue,
+                photoList: this.data.avatarUrl
+            }).then(res => {
+                wx.redirectTo({
+                  url: '../../welfareMall/historical/historical',
+                })
+
+
+            })
+        }else{
+            wx.showToast({
+                title: '请选择退款理由',
+                icon: 'none',
+                duration: 1000
+              })
+        }
+
+
+
+    },
+    /**
+     * 组建spu sku
+     * @param {*} list 
+     */
+    createOrderGoodList(list) {
+
+        console.log("进入详情")
+        console.log(list)
+        let _self = this;
+        if (list.length == 0) {
+            return;
+        }
+        let orderGoodList = [];
+        for (let a = 0; a < list.length; a++) { //最外层
+            //某一个商品种类
+            let goodList = list[a];
+            //sku-list
+            let orderGoodsSkuList = goodList.orderGoodsSkuList;
+            let fullFigure = list[a].fullFigure;
+            for (let b = 0; b < orderGoodsSkuList.length; b++) {
+                let orderGood = {};
+                orderGood.productName = goodList.productName;
+                let orderGoodsSku = orderGoodsSkuList[b];
+                let text = '';
+                if (orderGoodsSku.comboSkuList != null && orderGoodsSku.comboSkuList.length > 0) {
+                    console.log("进入套餐拼接")
+                    text = "套餐:"
+                    let productName = ''
+                    let specValue = []
+                    let num = ''
+                    orderGoodsSku.comboSkuList.forEach(function (comboSkuList, index) {
+                        comboSkuList.skuList.forEach(function (skuList, skuindex) {
+                            productName = skuList.productName
+                            num = skuList.num
+                            if (skuList.specList != null) {
+                                let specList = JSON.parse(skuList.specList);
+                                if (base.isArray(specList)) {
+                                    specList.forEach(function (specList, skuindex) {
+
+                                        specValue.push(specList.specValue + " X" + num)
+
+                                    })
+                                }
+                            } else {
+                                specValue.push(productName + " X" + num)
+                            }
+                        })
+                    })
+                    specValue = specValue.join('、') || ""
+                    text = text + "(" + specValue + ")"
+
+                }
+                orderGood.num = orderGoodsSkuList[b].num;
+                orderGood.allFee = base.fenToYuan(orderGoodsSkuList[b].price * orderGoodsSkuList[b].num)
+                orderGood.skuText = text
+                orderGood.fullFigure = fullFigure
+                orderGoodList.push(orderGood)
+            }
+        }
+        _self.setData({
+            orderGoodList: orderGoodList
+        })
+
+        console.log(this.data.orderGoodList)
+    },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */
@@ -64,8 +388,8 @@ Page({
 
     },
 
-    showlable(){
-        
+    showlable() {
+
 
     }
 })

+ 55 - 44
pages/groupmeallist/refund/refund.wxml

@@ -1,83 +1,94 @@
 <view class="page">
     <view class="choose_good flex-row">
-        <view class="choose_good_left">选择退款商品</view>
-        <view class="choose_good_right">
+        <view class="choose_good_left">退款商品</view>
+        <view class="choose_good_right" catchtap="callStorePerson">
             <image style="width:24rpx;height:24rpx;margin-top: 3rpx;" src="/images/groupmeallist/refund_phone_icon.png"></image>
             联系商家
         </view>
     </view>
 
     <view class="choose_center flex-column">
-        <view class="choose_center_top flex-row">
-            <view>
-                <image style="width:38rpx;height:38rpx;margin-left: 22rpx;margin-top: 15rpx;" src="/images/groupmeallist/success_icon.png"></image>
-            </view>
-            <view>
-                <image style="width:98rpx;height:98rpx;margin-left: 19rpx;" src="/images/groupmeallist/order_good.png"></image>
+        <view class="choose_center_top flex-row" wx:for="{{orderGoodList}}" wx:for-index="idx" wx:key="idx" wx:for-item="item">
+
+            <view class="flex-row" style="  align-items: flex-start;">
+                <image style="width:98rpx;height:98rpx;" src="{{item.fullFigure}}"></image>
+                <view class="choose_center_good">{{item.productName}}</view>
             </view>
-            <view class="choose_center_good">清爽夏日套餐</view>
-            <view class="choose_center_right flex-row">
-                <view>
-                    <image style="width: 45rpx;height:45rpx;" src="/images/groupmeallist/reduce_icon.png"></image>
-                </view>
-                <view class="refund_num">1</view>
-                <view>
-                    <image style="width: 45rpx;height:45rpx;" src="/images/groupmeallist/add_icon.png"></image>
-                </view>
 
+            <view style="margin-right: 70rpx;margin-top: 37rpx;">x{{item.num}}</view>
 
-            </view>
 
         </view>
         <view style="width: 93%; border-bottom: 1px #e2e2e2 solid; margin-top: 19rpx;margin:0px auto;margin-top: 18rpx;"></view>
 
         <view class="choose_center_price flex-row">
             <view style="width: 112rpx;height: 37rpx;font-size: 28rpx;font-weight: 400;text-align: center;color: #000000;line-height: 33rpx;">退款金额</view>
-            <view style="height: 43rpx;font-size: 32rpx;font-weight: 700;text-align: left;color: #d65065;margin-left:14rpx">¥20.0</view>
-
-        </view>
-    </view>
+            <view style="height: 43rpx;font-size: 32rpx;font-weight: 700;text-align: left;color: #d65065;margin-left:14rpx">¥{{orderInfo.payPriceY}}</view>
 
-
-    <view class="all_choose flex-row">
-        <view class="flex-row">
-            <image style="width:38rpx;height:38rpx;margin-left: 22rpx;" src="/images/groupmeallist/success_info.png"></image>
-            <view style="line-height: 30rpx; margin-left: 12rpx; width: 48rpx;height: 32rpx;font-size: 24rpx;font-family: Segoe UI, Segoe UI-Regular;font-weight: 400;text-align: left;color: #989898;">全选</view>
-        </view>
-        <view class="flex-row" style="margin-right: 27rpx;">
-            <view style="width: 112rpx;height: 37rpx;font-size: 28rpx;font-weight: 400;text-align: center;color: #000000;line-height: 33rpx;">退款金额</view>
-            <view style="height: 43rpx;font-size: 32rpx;font-weight: 700;text-align: left;color: #d65065;margin-left:14rpx">¥20.0</view>
         </view>
-
-
     </view>
 
 
 
     <view class="refund_bottom">
-        <view class="refund_bottom_top flex-row" bindtap="showlable">
+        <view class="refund_bottom_top flex-row" bindtap="showCartPannel">
             <view style="margin-left: 17rpx;margin-top: 38rpx;font-size: 28px;font-weight: 400;font-size: 28rpx;">
-            <span style="color:#FF0000;margin-right:10rpx">*</span>不想要了/临时有事</view>
+                <span style="color:#FF0000;margin-right:10rpx">*</span>{{reasonValue}}
+            </view>
 
             <image style="width: 12rpx;height: 23rpx;margin-top: 36rpx;margin-right: 47rpx;" src="/images/groupmeallist/more_than_the.png"></image>
         </view>
-        
-
 
         <view style="width: 93%; border-bottom: 1px #e2e2e2 solid; margin-top: 19rpx;margin:0px auto;margin-top: 37rpx;"></view>
 
-        <input bindinput="listenInput" class="sosoinput" placeholder="补充详细退款原因,有利于门店更快帮您处理" bindblur="soso" focus="{{!openFocus}}" value="{{keyword}}" disabled="{{openFocus}}" />
+        <input bindinput="listenInput" class="sosoinput" placeholder="补充详细退款原因,有利于门店更快帮您处理" bindblur="soso" focus="{{!openFocus}}" value="{{reasonDetailValue}}" disabled="{{openFocus}}" />
 
-        <view class="camera">
-            <view class="camera_img flex-column">
-                <image style="width:48rpx;height:44rpx" src="/images/groupmeallist/camera.png"></image>
-                <view style="font-size: 24rpx;font-weight: 700;text-align: left;color: #989898;margin-top: 10rpx;">添加图片</view>
+        <view class="camera flex-column">
+            <view class="flex-row">
+                <view class="explain-img-style flex-column" wx:for="{{avatarUrlShow}}" wx:key="key" data-index="{{index}}" bindtap="previewImage">
+                    <view class="close-img-style flex-row">
+                        <image class="close-img" src="" mode="scaleToFill" catchtap="deleteImvBanner" data-id="{{index}}" src="/images/groupmeallist/toDelete.png"></image>
+                    </view>
+                    <image class="explain-img-preview " src="{{item}}"></image>
+                </view>
+                <view>
+                    <view class="camera_img flex-column" wx:if="{{chooseViewShowBanner}}" catchtap="bindViewTap">
+                        <image style="width:48rpx;height:44rpx" src="/images/groupmeallist/camera.png"></image>
+                        <view style="font-size: 24rpx;font-weight: 700;text-align: left;color: #989898;margin-top: 10rpx;">添加图片</view>
+                    </view>
+                </view>
             </view>
-            <view style="font-size: 24rpx;font-weight: 400;text-align: left;color: #989898;margin-top:13rpx">最多可上传五张图片,每张图片不超过5M</view>
+            <view style="font-size: 24rpx;font-weight: 400;text-align: left;color: #989898;margin-top:13rpx">最多可上传张图片,每张图片不超过5M</view>
 
-        
+        </view>
+    </view>
+    <!--选择原因弹出  -->
+    <view class="cart-pannel" wx:if="{{isShowPannel}}">
+        <!-- 遮罩背景 -->
+        <view class="make-layer-bg" catchtap="closeCartPannel"></view>
+        <view style="opacity: 1;height: 750rpx;">
+            <view animation="{{animationData}}" class="commodity_attr_box flex-column">
+                <view class="shop_car_detail flex-row-between">
+                    <view class="shop_car_num">请选择退款原因</view>
+                    <view class="del_icaon" bindtap="onChangeShowStateDelFalse"></view>
+                </view>
+
+                <view class="cart-goods-list">
+                    <!-- 循环购物车 -->
+
+                    <view wx:for="{{reasonList}}" wx:key="index" class="shop_car_foods">
+                        <view class="reasonView {{item.checked?'checked' :''}}" catchtap="changeChecked" data-id="{{index}}"><span style="margin-left: 25rpx;font-size: 28rpx;">{{item.text}}</span> </view>
+                    </view>
+                </view>
+
+            </view>
         </view>
 
     </view>
+    <view class="bottom_div flex-column_start_center" catchtap="submit">
+        <view class="submit">提交</view>
+    </view>
+
+
 
 </view>

+ 129 - 11
pages/groupmeallist/refund/refund.wxss

@@ -2,20 +2,66 @@
     width: 100%;
     height: 43rpx;
     justify-content: space-between;
-    margin-top: 33rpx;
+    padding-top: 33rpx;
+
+
+}
+.explain-img-style{
+    width: 148rpx;
+    height: 168rpx;
+    margin-right: 8rpx;
+    margin-top: -25rpx;
+  }
+  .close-img-style{
+    width: 154rpx;
+    height: 22rpx;
+    justify-content: flex-end;
+    z-index: 10;
+  }
+  .close-img{
+    width: 22rpx;
+    height: 22rpx;
+    margin-top: 30rpx;
+    margin-right: -5rpx;
+  }
+
+  .explain-img-preview{
+    width: 148rpx;
+    height: 154rpx;
+    border: 1px solid #e0dada;
+    border-radius: 10rpx;
+    z-index: 1;
+   
+    justify-content: center;
+  }
+.reasonView {
+    width: 100%;
+    height: 60rpx;
+    text-align: left;
+    line-height: 60rpx;
+    margin-top: 30rpx;
 
 
 }
 
+.checked {
+    background-color: #F8F8F8;
+    color: #FE7253;
+}
+
+/* .reasonView:hover{
+    background-color:yellow;
+} */
+
 .choose_good_left {
-    width: 192rpx;
+    /* width: 192rpx; */
     height: 43rpx;
     font-size: 32rpx;
     line-height: 43rpx;
     font-weight: 700;
     text-align: center;
     color: #000000;
-    margin-left: 18rpx;
+    margin-left: 25rpx;
 }
 
 .choose_good_right {
@@ -26,7 +72,7 @@
     font-weight: 400;
     text-align: center;
     color: #afd250;
-    margin-right: 18rpx;
+    margin-right: 25rpx;
 
 }
 
@@ -47,6 +93,9 @@
     /* background: rgba(0,0,0,0.00); */
     /* border: 1px solid #707070; */
     align-items: flex-start;
+    margin-left: 33rpx;
+    justify-content: space-between;
+    text-align: center;
 
 }
 
@@ -87,9 +136,56 @@
 
 }
 
+.cart-pannel {
+    width: 100vw;
+    height: 100vh;
+    position: fixed;
+    left: 0;
+    top: 0;
+    z-index: 1119;
+}
+
+.make-layer-bg {
+    width: 100vw;
+    height: 100vh;
+    background: #000;
+    opacity: 0.8;
+    position: fixed;
+    left: 0;
+    top: 0;
+}
+
+.commodity_attr_box {
+    /* max-height: 60%; */
+    min-height: 60%;
+    width: 750rpx;
+    overflow: hidden;
+    position: fixed;
+    bottom: 0rpx;
+    left: 0;
+    z-index: 200;
+    background: #fff;
+    padding-top: 20rpx;
+    border-radius: 22rpx 22rpx 0px 0px;
+}
+
+.shop_car_num {
+    color: gray;
+    margin-left: 25rpx;
+
+}
+
+.shop_car_detail {
+    width: 718rpx;
+    height: 60rpx;
+    border-bottom: 2rpx solid #e9e9e9;
+    align-items: flex-start;
+}
+
 .choose_center_price {
     margin-top: 28rpx;
     margin-left: 21rpx;
+    padding-bottom: 30rpx;
 }
 
 .all_choose {
@@ -113,12 +209,12 @@
 
 .refund_bottom_top {
     justify-content: space-between;
-    margin-top: 38rpx; 
+    margin-top: 38rpx;
     /* height: 37rpx; */
-     width: 100%;
+    width: 100%;
 }
 
-.sosoinput{
+.sosoinput {
     /* width: 480px; */
     height: 32px;
     font-size: 24rpx;
@@ -130,18 +226,40 @@
 
 
 }
-.camera{
 
+.camera {
+    height: 240rpx;
     margin-left: 38rpx;
     margin-top: 62rpx;
 }
 
-.camera_img{
+.camera_img {
     width: 148rpx;
     height: 148rpx;
     border: 2rpx dashed #d6d6d6;
     border-radius: 7rpx;
-   justify-content: center;
-   align-items: center;
+    justify-content: center;
+    align-items: center;
 
+}
+.bottom_div{
+    width: 696rpx;
+    height: 95rpx;
+    background: #afd250;
+    border-radius: 48rpx;
+    position: fixed;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    bottom: 0;
+    z-index:30;
+    justify-content: center;
+    align-items: center;
+}
+.submit{
+    width: 72rpx;
+    height: 48rpx;
+    font-size: 36rpx;
+    font-weight: 700;
+    text-align: center;
+    color: #f6f6f6;
 }

+ 44 - 26
pages/groupmeallist/storeGoods/storeGoods.js

@@ -20,7 +20,7 @@ CustomPage({
       distance: null,
       title: 'vtabs',
       path: 'page/weui/example/vtabs/vtabs',
-      showViewDel:false
+      showViewDel: false
     }
   },
   data: {
@@ -63,33 +63,33 @@ CustomPage({
   handleEmptyCart() {
     this.onChangeShowStateDelTrue()
     OrderApi.emptyCart({
-     
-        storeId:  cache.getStoreId(),
-        mobile:  user.getMobileCache()
-        // tableId: user.getTableId(),
-        // orderMode: this.data.orderMode
+
+      storeId: cache.getStoreId(),
+      mobile: user.getMobileCache()
+      // tableId: user.getTableId(),
+      // orderMode: this.data.orderMode
     }).then(res => {
-        if (res.code == 200) {
-            this.loadCartData()
-            this.setData({
-              isShowCartPannel:false
-            })
-        }
+      if (res.code == 200) {
+        this.loadCartData()
+        this.setData({
+          isShowCartPannel: false
+        })
+      }
     }).catch(_ => {})
-},
+  },
 
 
-    //关闭删除弹出层
-    onChangeShowStateDelTrue: function () {
-      this.setData({
-          showViewDel: false
-      })
+  //关闭删除弹出层
+  onChangeShowStateDelTrue: function () {
+    this.setData({
+      showViewDel: false
+    })
   },
-// 清空购物车
-  onChangeShowStateDelFalse(){
+  // 清空购物车
+  onChangeShowStateDelFalse() {
     var that = this;
     that.setData({
-        showViewDel: true
+      showViewDel: true
     })
 
   },
@@ -189,6 +189,7 @@ CustomPage({
     await this.loadData()
     await this.loadStoreData()
     await this.loadCartData()
+    await this.cartPanelNum();
   },
 
   loadStoreData() {
@@ -295,8 +296,8 @@ CustomPage({
       this.setData({
         vtabs: tabs,
       })
-      console.log("this.data.vtabs")
-      console.log(this.data.vtabs)
+      // console.log("this.data.vtabs")
+      // console.log(this.data.vtabs)
     }
 
 
@@ -317,16 +318,33 @@ CustomPage({
   /**
    * 加载购物车数据
    */
-  loadCartData() {
-    storeGoods.getCartData(cache.getStoreId(), user.getMobileCache(), null, null).then(res => {
+  async loadCartData() {
+    await storeGoods.getCartData(cache.getStoreId(), user.getMobileCache(), null, null).then(res => {
       if (res.code == 200) {
-        this.cartDataMapToView(res.data)
+         this.cartDataMapToView(res.data)
       }
     }).catch(_ => {
       console.log(_)
     })
   },
+  cartPanelNum() {
+    this.data.vtabs.forEach((item, i) => {
+      item.goodsList.forEach((children, x) => {
+        this.data.cartSkuMapData.forEach((sku, s) => {
+          if (sku.skuId == children.minPriceSku.skuId) {
+            children.chooseNum = sku.num
+          }
+        })
+      })
+    })
 
+    this.setData({
+      vtabs: this.data.vtabs
+    })
+
+    console.log(this.data.vtabs)
+
+  },
   // 购物车数据映射
   cartDataMapToView(data) {
     // var isShowCartPannel = true;

+ 26 - 25
pages/groupmeallist/storeGoods/storeGoods.wxml

@@ -23,9 +23,10 @@
                   <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 style="font-weight: 700;font-size:32rpx">¥ {{goods.priceY}}</view>
+                    <view class="PositionDiv_icon flex-row">
+                      <sapn wx:if="{{goods.chooseNum >0}}">{{goods.chooseNum}}</sapn>
+                      <image style="width: 38rpx;height:38rpx;" src="/images/groupmeallist/PositionDiv_icon.png"></image>
                     </view>
                   </view>
 
@@ -75,7 +76,7 @@
                   <!-- 可能存在优惠标识 -->
                   <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"  data-idx="{{index}}">{{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>
@@ -95,23 +96,23 @@
                   </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 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>
@@ -122,16 +123,16 @@
     </view>
 
     <!-- 清空购物车弹出层 -->
-<view wx:if="{{showViewDel}}" class="commodity_attr_box_delAll flex-column_start_center">
-    <view class="commodity_attr_box_delAll_text">是否清空购物车?</view>
-    <view class="commodity_attr_box_view_Two flex-row">
+    <view wx:if="{{showViewDel}}" class="commodity_attr_box_delAll flex-column_start_center">
+      <view class="commodity_attr_box_delAll_text">是否清空购物车?</view>
+      <view class="commodity_attr_box_view_Two flex-row">
         <view class="view_one" catchtap="handleEmptyCart">清空</view>
         <view class="view_two" bindtap="onChangeShowStateDelTrue">取消</view>
+      </view>
     </view>
-</view>
 
-<!-- 全部删除弹出层 -->
-<view wx:if="{{showViewDel}}" class="commodity_screen_del"></view>
+    <!-- 全部删除弹出层 -->
+    <view wx:if="{{showViewDel}}" class="commodity_screen_del"></view>
   </view>
 
 

+ 2 - 2
pages/groupmeallist/storeGoods/storeGoods.wxss

@@ -139,8 +139,8 @@ margin-top: 7rpx;
     
 }
 .PositionDiv_icon{
-    width: 38rpx;
-    height: 38rpx;
+    /* width: 38rpx; */
+   height: 38rpx;
    margin-left: 10rpx;
 }
 .bottom_div{

+ 11 - 12
pages/groupmeallist/storeList/storeList.wxml

@@ -1,8 +1,8 @@
-<view class="page ">
+<view class="page">
     <!-- 有门店显示此部门 -->
-    <view class="forview" wx:for="{{storeList}}" wx:key="index" wx:for-item="item" >
+    <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" data-idx="{{index}}" >
+            <view class="store flex-row" catchtap="confirmtPannel" data-idx="{{index}}">
                 <view class="store_left flex-column">
                     <view class="store_Name">{{item.storeName}}</view>
                     <view style="margin-left: 36rpx;margin-top:18rpx;align-items: flex-start;" class="flex-row">
@@ -17,15 +17,14 @@
                         <view class="storebusinesshours">12:00-21:00</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 class="storeState">{{item.stateText}}</view>
+                    <view style="margin-top: 21rpx; 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;">距离{{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>
-
-
+                    <image catchtap="showPhoneTab" data-idx="{{index}}" style="width: 65rpx;height: 65rpx;margin-top: 25rpx;" src="/images/groupmeallist/phone_icon.png"></image>
                 </view>
             </view>
 
@@ -54,7 +53,7 @@
                                 <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>
+                                    <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>
@@ -77,7 +76,7 @@
                     </view>
                     <view class="confirmstore_Delivery_Method flex-row">
                         <view class="Pick_up_in_store" catchtap="confirmStoreGoToStoreGoods" data-way="1">门店自取</view>
-                        <view class="home_delivery" catchtap="confirmStoreGoToStoreGoods" data-way="2"   >外送到家</view>
+                        <view class="home_delivery" catchtap="confirmStoreGoToStoreGoods" data-way="2">外送到家</view>
 
                     </view>
 
@@ -88,8 +87,8 @@
 
     </view>
 
- <!-- 无门店显示此部分 -->
-    <view style="display: {{storeList.length<=0? 'block':'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>

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

@@ -31,7 +31,7 @@
 
 .store {
     width: 690rpx;
-    height: 272rpx;
+    /* height: 272rpx; */
     background-color: white;
     border-radius: 9rpx;
     justify-content: space-between;
@@ -101,15 +101,17 @@
     height: 38rpx;
     border: 1px solid #707070;
     border-radius: 5rpx;
-    margin-top: 38rpx;
-    margin-left: 38rpx;
+    /* margin-top: 38rpx;
+    margin-left: 38rpx; */
     text-align: center;
     line-height: 38rpx;
+    justify-content: flex-start;
+    margin-top: 18rpx;
 }
 
 .store_right {
-    max-height: 180rpx;
-    margin-right: 10rpx;
+    min-height: 180rpx;
+    margin-right: 25rpx;
 }
 
 .phoneTab {

+ 43 - 34
pages/welfareMall/historical/historical.js

@@ -42,7 +42,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: async function (options) {
-    
+
   },
 
   handleCancelOrder(e) {
@@ -50,34 +50,34 @@ Page({
     console.log("取消订单")
     let that = this;
     wx.showModal({
-        title: '',
-        content: '是否确定取消订单?',
-        success: function(sm) {
-            if (sm.confirm) {
-                console.log("确定了")
-                order.cancelOrder({
-                    orderSn: orderSn,
-                    mobile: cache.getMobile(),
-                }).then(res => {
-                    if (res.code == 200) {
-                        that.getTOrderList()
-                    }
-                }).catch(_ => {})
-
-            } else if (sm.cancel) {
-
+      title: '',
+      content: '是否确定取消订单?',
+      success: function (sm) {
+        if (sm.confirm) {
+          console.log("确定了")
+          order.cancelOrder({
+            orderSn: orderSn,
+            mobile: cache.getMobile(),
+          }).then(res => {
+            if (res.code == 200) {
+              that.getTOrderList()
             }
+          }).catch(_ => {})
+
+        } else if (sm.cancel) {
+
         }
+      }
     })
-},
+  },
   //立即支付
   handelToPay(e) {
     let orderSn = e.currentTarget.dataset.ord;
     console.log(orderSn)
-  
+
     storeGoods.getPayParams({
       orderSn: orderSn,
-      payCode: "SIHAIYOULONG",
+      payCode: "HSAY-SHARE",
       openId: Activity.getOpenId(),
       isOrderPayment: true,
       orderInfoPath: "/pages/orderDetail/orderDetail?sn=" + orderSn,
@@ -115,15 +115,24 @@ Page({
     })
   },
   // 申请退款
-  goTorefund() {
+  goTorefund(e) {
+    let sn = e.currentTarget.dataset.sn;
+    
+
     wx.navigateTo({
-      url: '/pages/groupmeallist/refund/refund',
+      url: '/pages/groupmeallist/refund/refund?sn=' + sn,
     })
 
 
 
 
   },
+
+  // goTorefundList(){
+  //   wx.navigateTo({
+  //     url: '/pages/groupmeallist/refundRecord/refundRecord',
+  //   })
+  // },
   // 团餐订单
   async getTOrderList() {
 
@@ -237,20 +246,20 @@ Page({
 
 
 
-      /**
-     * 跳转订单详情
-     * @param {*} e 
-     */
-    orderDetail(e) {
+  /**
+   * 跳转订单详情
+   * @param {*} e 
+   */
+  orderDetail(e) {
 
-      this.setData({
-          torderList:[]
-      })
+    this.setData({
+      torderList: []
+    })
 
-      let ordersn = e.currentTarget.dataset.sn;
-      wx.navigateTo({
-        url: '/pages/groupmeallist/orderDetail/orderDetail?sn='+ordersn,
-      })
+    let ordersn = e.currentTarget.dataset.sn;
+    wx.navigateTo({
+      url: '/pages/groupmeallist/orderDetail/orderDetail?sn=' + ordersn,
+    })
   },
 
   /**

+ 2 - 2
pages/welfareMall/historical/historical.wxml

@@ -70,8 +70,8 @@
                 </view>
 
 
-                <view class="Request_a_refund" wx:if="{{item.state == 2}}" catchtap="goTorefund">申请退款</view>
-                <view class="Request_a_refund" wx:if="{{item.state == 4}}">退款记录</view>
+                <view class="Request_a_refund" wx:if="{{item.state == 2}}"  data-sn="{{item.orderSn}}"  catchtap="goTorefund">申请退款</view>
+                <view class="Request_a_refund" wx:if="{{item.state == 4}}"  catchtap="goTorefundList">退款记录</view>
 
               </view>
 

+ 56 - 0
project.private.config.json

@@ -646,6 +646,62 @@
                     "name": "",
                     "pathName": "pages/groupmeallist/goodsManagements/goodsManagements",
                     "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/groupmeallist/storeList/storeList",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/welfareMall/historical/historical",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/groupmeallist/refund/refund",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/welfareMall/historical/historical",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/groupmeallist/refund/refund",
+                    "query": "sn=654499421493156",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/welfareMall/personal/personal",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/welfareMall/historical/historical",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/groupmeallist/storeGoods/storeGoods",
+                    "query": "",
                     "scene": null,
                     "launchMode": "default"
                 }