Elbert Chen пре 2 година
родитељ
комит
b2a59ec915

+ 6 - 0
pages/cart/pages/confirmOrder/confirmOrder.js

@@ -247,6 +247,12 @@ Page({
       url = '/api/checkout/order?mode=' + dataParams.mode + '&addressId=' + this.data.addressId +  
       '&staffUserId=' + staffUserId + '&signStr=' + dataParams.signStr
       console.log(url)
+    }else if(this.data.mode == 'pointsExchange'){
+      // 积分兑换
+      url = '/api/checkout/order?mode=' + dataParams.mode + '&goodsId=' + dataParams.goodsId + '&goodsSkuId=' + dataParams.goodsSkuId +
+      '&goodsNum=' + dataParams.goodsNum+  
+      '&staffUserId=' + staffUserId  
+      console.log(url)
     }
     else {
       // 购物车下单

+ 4 - 4
pages/cart/pages/confirmOrder/confirmOrder.wxml

@@ -237,9 +237,9 @@
         </view>
     </view>
 
-    <view class="partContainer newCon" hidden="{{mode=='zareceive' || (mode=='za' && riceList.length==0)}}">
+    <view class="partContainer newCon" hidden="{{mode=='zareceive' || mode=='pointsExchange' || (mode=='za' && riceList.length==0)}}">
          <!-- 优惠劵部分 -->
-        <view class="flex coupon_card" bindtap='couponModel' wx:if="{{mode!='bargain' && mode!='miaosha' && mode!='za' && mode!='zareceive'}}">
+        <view class="flex coupon_card" bindtap='couponModel' wx:if="{{mode!='bargain' && mode!='miaosha' && mode!='za' && mode!='zareceive' && mode!='pointsExchange'}}">
             <view class="left flex-c">
                 <image  class="icon" src="/static/icon/icon_n_a.png" mode="aspectFill"></image>我的优惠券
             </view>
@@ -291,7 +291,7 @@
             </view>
         </view>
          <!-- 金米粒抵扣 isUseGoldRice 是否使用金米粒 -1禁用 0不使用 1使用-->
-        <view class="flex coupon_card" bindtap='showKimmyModel' wx:if="{{mode!='miaosha' && mode!='za' && mode!='zareceive'}}">
+        <view class="flex coupon_card" bindtap='showKimmyModel' wx:if="{{mode!='miaosha' && mode!='za' && mode!='zareceive' && mode!='pointsExchange'}}">
             <view class="left flex-c">
                 <image  class="icon" src="/static/icon/icon_n_e.png" mode="aspectFill"></image>金米粒抵扣
             </view>
@@ -302,7 +302,7 @@
             </view>
         </view>
          <!-- 米卡部分 -->
-        <view class="flex part_card" wx:if='{{riceList && riceList.length>0 && mode!="zareceive"}}' bindtap='toCheckRiceCard'>
+        <view class="flex part_card" wx:if='{{riceList && riceList.length>0 && mode!="zareceive" &&  mode!="pointsExchange"}}' bindtap='toCheckRiceCard'>
             <view class="left flex-c">
                 <image  class="icon" src="/static/icon/icon_n_f.png" mode="aspectFill"></image>我的米卡
             </view>

+ 269 - 232
pages/index/pages/bonusShop/bonusShop.js

@@ -1,247 +1,284 @@
-const app = getApp()
+const app = getApp();
 const api = require("../../../../request/api.js");
-const http = require('../../../../request/http.js');
-const utils = require('../../../../utils/util.js');
-const storeKeys = require('../../../../utils/storageKeys.js');
+const http = require("../../../../request/http.js");
+const utils = require("../../../../utils/util.js");
+const storeKeys = require("../../../../utils/storageKeys.js");
 Page({
-    data: {
-        isLoading: true, //是否处于加载
-        list: [], //政策优惠券
-        Limitcouponlist:[],  //限时抢购优惠券
-        couponState: 0, //0:可领取 1:已领取 2:领完啦
-        showConfirmModal: false, //是否显示确定激活弹窗
-        couponInputValue: '',
-        page: 1, //分页
-        list: [], //页面数据
-        dataObj: {}, //页面对象
-        is_bottom: false, //到底了
-        price: 100,
-        inputFocusValue: false,
-        isOnLoad: true
-    },
-    onLoad: function (options) {
-        this.getData()
-    },
-    onShow: function (options) {
-        if (!this.data.isOnLoad) {
-            this.getData()
-        }
-        this.data.isOnLoad = false;
-    },
-    //获取页面内容
-    getData(noLoading) {
-        if(!noLoading){
-            wx.showLoading({
-                title: "加载中",
-                mask: true
-            });
-        }
-        let promise1 = new Promise((resolve) => {
-            this.getPageData(() => {
-                resolve();
-            });
-        })
-        let promise2 = new Promise((resolve) => {
-            this.getLimitcouponlist(() => {
-                resolve();
-            });
-        })
-        Promise.all([promise1, promise2]).then((values) => {
-            !noLoading && wx.hideLoading();
-            this.setData({
-                isLoading: false
-            })
-        }).catch((error) => {})
-    },
-    //获取限时抢购优惠卷
-    getLimitcouponlist(resolve) {
-        http.request({
-            url: api.URL + "/api/coupon/limitcouponlist",
-            token: utils.getStorageSync(storeKeys.TOKEN),
-            method: 'GET',
-            success: (res) => {
-                resolve && resolve();
-                console.log(res)
-                let Limitcouponlist = res.data.data.list;
-                Limitcouponlist.forEach(item => {
-                    if (item.coupon_type == 10) {
-                        item.coupon_title_ = "立减券"
-                    } else if (item.coupon_type == 20) {
-                        item.coupon_title_ = "满减券"
-                    } else if (item.coupon_type == 30) {
-                        item.coupon_title_ = "首单券"
-                    } else if (item.coupon_type == 40) {
-                        item.coupon_title_ = "新人券"
-                    } else if (item.coupon_type == 50) {
-                        item.coupon_title_ = "折扣券"
-                    }else {
-                        item.coupon_title_ = ""
-                    }
-                });
-                this.setData({
-                    Limitcouponlist
-                });
-            },
-            error: (res) => {
-                resolve && resolve();
-            }
-        })
-    },
-    //获取正常优惠卷
-    getPageData(resolve) {
-        http.request({
-            url: api.URL + "/api/coupon/couponlist",
-            token: utils.getStorageSync(storeKeys.TOKEN),
-            method: 'GET',
-            success: (res) => {
-                resolve && resolve();
-                let list = res.data.data.list;
-                list.forEach(item => {
-                    if (item.coupon_type == 10) {
-                        item.coupon_title_ = "立减券"
-                    } else if (item.coupon_type == 20) {
-                        item.coupon_title_ = "满减券"
-                    } else if (item.coupon_type == 30) {
-                        item.coupon_title_ = "首单券"
-                    } else if (item.coupon_type == 40) {
-                        item.coupon_title_ = "新人券"
-                    } else if (item.coupon_type == 50) {
-                        item.coupon_title_ = "折扣券"
-                    } else {
-                        item.coupon_title_ = ""
-                    }
-                });
-                this.setData({
-                    list,
-                    dataObj: res.data.data
-                });
-                // if (!noLoading) {
-                //     wx.hideLoading();
-                // }
-            },
-            error: (res) => {
-                resolve && resolve();
-                // if (!noLoading) {
-                //     wx.hideLoading();
-                // }
-            }
-        })
-    },
-
-    onCardCouponSecInput: function (e) {
-        let couponInputValue = e.detail.value.replace(/\s+/g, '');
+  data: {
+    isLoading: true, //是否处于加载
+    goodsList: [], //积分商品
+    Limitcouponlist: [], //限时抢购优惠券
+    couponState: 0, //0:可领取 1:已领取 2:领完啦
+    showConfirmModal: false, //是否显示确定激活弹窗
+    couponInputValue: "",
+    page: 1, //分页
+    list: [], //页面数据
+    dataObj: {}, //页面对象
+    is_bottom: false, //到底了
+    price: 100,
+    inputFocusValue: false,
+    isOnLoad: true,
+    tabSelected: 0,
+    info: {},
+  },
+  onLoad: function (options) {
+    this.getData();
+  },
+  onShow: function (options) {
+    if (!this.data.isOnLoad) {
+      this.getData();
+    }
+    this.data.isOnLoad = false;
+  },
+  //获取页面内容
+  getData(noLoading) {
+    if (!noLoading) {
+      wx.showLoading({
+        title: "加载中",
+        mask: true,
+      });
+    }
+    let promise1 = new Promise(resolve => {
+      this.getPageData(() => {
+        resolve();
+      });
+    });
+    let promise2 = new Promise(resolve => {
+      this.getUserInfo(() => {
+        resolve();
+      });
+    });
+    Promise.all([promise1, promise2])
+      .then(values => {
+        !noLoading && wx.hideLoading();
         this.setData({
-            couponInputValue
-        })
-        // this.data.couponInputValue = e.detail.value;
-    },
-    onItemButtonClicked: utils.throttle(function (e) {
-        if (!utils.getStorageSync(storeKeys.TOKEN)) {
-            wx.navigateTo({
-                url: "/pages/tabBar/login/login"
-            })
-            return;
-        }
-        let item = e.currentTarget.dataset.item;
-        let index = e.currentTarget.dataset.index;
-        let state = e.currentTarget.dataset.type;
-        let id = item.coupon_id;
-        let num = item.avaiable_num;
-        if (state == 1) {
-            wx.showLoading({
-                title: "加载中"
-            });
-            http.request({
-                url: api.URL + '/api/MyCoupon/receive?coupon_id=' + id,
-                method: 'GET',
-                token: utils.getStorageSync(storeKeys.TOKEN),
-                success: (res) => {
-                    wx.hideLoading();
-                    if (res.data.status == 200) {
-                        wx.showToast({
-                            title: '领取成功',
-                            icon: 'success',
-                            duration: 3000
-                        });
-                        this.getData(true)
-                    }
-                },
-                error: (res) => {
-                    wx.hideLoading();
-
-                    wx.showToast({
-                        title: '领取失败',
-                        icon: 'error',
-                        duration: 3000
-                    })
-                },
-            })
-        } else if (state == 0) {
-            wx.switchTab({
-                url: '/pages/tabBar/allGoods/allGoods'
-            })
+          isLoading: false,
+        });
+      })
+      .catch(error => {});
+  },
+  changeNavTab(e) {
+    let { index } = e.currentTarget.dataset;
+    let tabSelected = this.data.tabSelected
+    this.setData({
+      tabSelected: parseInt(index),
+    });
+    if (index < 2 && tabSelected !== index) {
+        this.getPageData()
+    }
+  },
+  //获取积分产品
+  getPageData(noLoading) {
+    wx.showLoading({
+      title: "加载中",
+      mask: true,
+    });
+    http.request({
+      url:
+        api.URL +
+        "/api/goods/list?goods_type=40&sortStyle=" +
+        this.data.sortStyle +
+        "&sortSort=" +
+        this.data.sortSort +
+        "&page=" +
+        this.data.page,
+      token: utils.getStorageSync(storeKeys.TOKEN),
+      method: "GET",
+      success: res => {
+        let list = [];
+        let tmpList = res.data.data.list.data;
+        if (this.data.page == 1) {
+          list = tmpList;
+        } else {
+          list = this.data.list.concat(tmpList);
         }
-    }),
-    activateCode: utils.throttle(function (e) {
-        wx.showLoading({
-            title: "加载中"
+        this.setData({
+          list: list.filter(i => this.data.tabSelected === 1 ? i.points_to_exchange <= this.data.info.accumulate_points : true),
+          dataObj: res.data.data.list,
+        });
+        setTimeout(() => {
+          this.setData({
+            isLoading: false,
+          });
+        }, 300);
+        wx.hideLoading();
+      },
+      error: res => {
+        this.setData({
+          isLoading: false,
         });
-        http.request({
-            url: api.URL + '/api/MyCoupon/exchange?redeemCode=' + this.data.couponInputValue,
-            method: 'GET',
-            token: utils.getStorageSync(storeKeys.TOKEN),
-            success: (res) => {
-                // wx.hideLoading();
+        wx.hideLoading();
+      },
+    });
+  },
 
-                if (res.data.status == 200) {
-                    // this.getPageData()
-                    this.setData({
-                        couponInputValue: ""
-                    })
-                    wx.showToast({
-                        title: '兑换成功',
-                        icon: 'success',
-                        duration: 3000
-                    })
-                }
-            },
-            error: (res) => {
-                wx.hideLoading();
-                this.setData({
-                    inputFocusValue: true,
-                    couponInputValue: ""
-                });
-                // wx.showToast({
-                //     title: res.data.message,
-                //     icon: 'error',
-                //     duration: 3000
-                // })
+  //获取用户信息
+  getUserInfo() {
+    http.request({
+      url: api.URL + "/api/user/info",
+      method: "GET",
+      token: utils.getStorageSync(storeKeys.TOKEN),
+      success: res => {
+        let info = res.data.data.userInfo;
+        // 开发专用
 
-        utils.toast(res.data.message)
-            },
-        })
-    }),
-    //显示确定激活弹窗
-    showConfirmModal(e) {
-        if (this.data.couponInputValue.length == 0) {
-            return;
+        if (info.mobile == "17573207179") {
+          // info.show_cash_box = true;
+          // info.role = 1;
+          // info.seller_grade = 3;
+          info.grade_id = 10001;
+          info.is_pickup = 1;
         }
+        //是否为特殊身份
+        let chara = false;
+        if ((info.role && info.role != 1) || info.show_cash_box) {
+          chara = true;
+        }
+        info.chara = chara;
+        utils.setStorageSync(storeKeys.USERINFO, info);
         this.setData({
-            showConfirmModal: true,
-        })
-    },
-    //关闭确定激活弹窗
-    hideConfirmModal() {
-        this.setData({
-            showConfirmModal: false
+          info,
         });
+        setTimeout(() => {
+          this.setData({
+            isLoading: false,
+          });
+        }, 300);
+      },
+      error: res => {
+        utils.toast(res.data.message);
+      },
+    });
+  },
+  onCardCouponSecInput: function (e) {
+    let couponInputValue = e.detail.value.replace(/\s+/g, "");
+    this.setData({
+      couponInputValue,
+    });
+    // this.data.couponInputValue = e.detail.value;
+  },
+  onItemButtonClicked: utils.throttle(function (e) {
+    if (!utils.getStorageSync(storeKeys.TOKEN)) {
+      wx.navigateTo({
+        url: "/pages/tabBar/login/login",
+      });
+      return;
+    }
+    let item = e.currentTarget.dataset.item;
+    let index = e.currentTarget.dataset.index;
+    let state = e.currentTarget.dataset.type;
+    let id = item.coupon_id;
+    let num = item.avaiable_num;
+    if (state == 1) {
+      wx.showLoading({
+        title: "加载中",
+      });
+      http.request({
+        url: api.URL + "/api/MyCoupon/receive?coupon_id=" + id,
+        method: "GET",
+        token: utils.getStorageSync(storeKeys.TOKEN),
+        success: res => {
+          wx.hideLoading();
+          if (res.data.status == 200) {
+            wx.showToast({
+              title: "领取成功",
+              icon: "success",
+              duration: 3000,
+            });
+            this.getData(true);
+          }
+        },
+        error: res => {
+          wx.hideLoading();
 
+          wx.showToast({
+            title: "领取失败",
+            icon: "error",
+            duration: 3000,
+          });
+        },
+      });
+    } else if (state == 0) {
+      wx.switchTab({
+        url: "/pages/tabBar/allGoods/allGoods",
+      });
+    }
+  }),
+  activateCode: utils.throttle(function (e) {
+    wx.showLoading({
+      title: "加载中",
+    });
+    http.request({
+      url:
+        api.URL +
+        "/api/MyCoupon/exchange?redeemCode=" +
+        this.data.couponInputValue,
+      method: "GET",
+      token: utils.getStorageSync(storeKeys.TOKEN),
+      success: res => {
+        // wx.hideLoading();
 
-    },
-    onButtonActiveCode() {
+        if (res.data.status == 200) {
+          // this.getPageData()
+          this.setData({
+            couponInputValue: "",
+          });
+          wx.showToast({
+            title: "兑换成功",
+            icon: "success",
+            duration: 3000,
+          });
+        }
+      },
+      error: res => {
+        wx.hideLoading();
         this.setData({
-            showConfirmModal: false
+          inputFocusValue: true,
+          couponInputValue: "",
         });
-        this.activateCode();
+        // wx.showToast({
+        //     title: res.data.message,
+        //     icon: 'error',
+        //     duration: 3000
+        // })
+
+        utils.toast(res.data.message);
+      },
+    });
+  }),
+  //显示确定激活弹窗
+  showConfirmModal(e) {
+    if (this.data.couponInputValue.length == 0) {
+      return;
     }
-})
+    this.setData({
+      showConfirmModal: true,
+    });
+  },
+  //关闭确定激活弹窗
+  hideConfirmModal() {
+    this.setData({
+      showConfirmModal: false,
+    });
+  },
+  onButtonActiveCode() {
+    this.setData({
+      showConfirmModal: false,
+    });
+    this.activateCode();
+  },
+  //前往兑换
+  goExchange(e) {
+    let { item } = e.currentTarget.dataset;
+    console.log(item)
+    let data = {
+      mode: "pointsExchange",
+      goodsId: item.goods_id, //商品ID
+      goodsSkuId: item.goods_sku_id || 0, //商品规格ID
+      goodsNum: 1, //商品数量
+    };
+    // return
+    let url = "/pages/cart/pages/confirmOrder/confirmOrder?data=" + JSON.stringify(data);
+    app.navigateToUrl(url);
+  },
+});

+ 1 - 1
pages/index/pages/bonusShop/bonusShop.json

@@ -2,5 +2,5 @@
   "usingComponents": {
     "tui-modal": "/ThorUI/components/modal/modal"
   },
-  "navigationBarTitleText": "“惠”买"
+  "navigationBarTitleText": "我的积分"
 }

+ 82 - 90
pages/index/pages/bonusShop/bonusShop.wxml

@@ -1,114 +1,106 @@
 <wxs module="textUtil" src="../../../../utils/textUtil.wxs" />
-<wxs module="couponUtils" src="./couponCenterUtils.wxs" />
 <view class="pageContainer" wx:if="{{!isLoading}}">
-    <view class="coupon-top-card flex-c-bet">
-        <view class="flex-c coupon-margintop16 coupon-inputbg">
-            <input class="coupon-input" type='text' maxlength="20" value='{{couponInputValue}}' bindinput='onCardCouponSecInput' placeholder="输入兑换码" focus="{{inputFocusValue}}"></input>
+    <view class="top-view">
+        <image class="background-image" src="../../static/bonus_shop_bg.png" />
+        <view class="my-bonus">
+            <image class="bonus-star" src="../../static/bonus_star.png" />
+            {{info.accumulate_points || 0}}
         </view>
-        <view class="coupon-input-button {{couponInputValue.length > 0 ? 'sel' : ''}} flex-c" bindtap="showConfirmModal">兑换优惠券</view>
     </view>
-    <view class="st"></view>
     <view class="pageDataBox">
-        <!-- 限时抢券 -->
-        <block wx:if="{{Limitcouponlist.length > 0}}">
-            <view class="coupont-list-titlebg">
-                <view class="coupont-list-title">限时抢券</view>
+        <view class="tabs">
+            <view class="item {{ tabSelected === 0 ? 'selected' : '' }}" bind:tap="changeNavTab" data-index="0">
+                <view class="label">积分商城</view>
+                <view wx:if="{{tabSelected === 0}}" class="underline"></view>
             </view>
-            <view class="coupon-card-bottom1 coupon-bgcolor">
-                <scroll-view scroll-x="true" style="width: 100%;white-space: nowrap;" class="scrollView">
-                <view class="cartContainer">
-                    <view class="cartItemLim" wx:for="{{Limitcouponlist}}" wx:key="index">
-                        <image class="xxx" src="../../static/coupon_card_two.png"></image>
-                        <image class="coupon-state-Lim" src="/static/images/coupon_card_status.png" mode="aspectFill" wx:if="{{item.is_receive == true}}"></image>
-                        <!-- |oo| -->
-                        <view class="flex-c content-full cartContent">
-                            <view class="topTag flex-c-c">{{item.coupon_title_}}</view>
-                            <view class="flex-column-c cardLeftLim">
-                                <view class="coupon-price" wx:if="{{item.coupon_type==50}}">
-                                    <text class="coupon-price-big noleft">{{item.discount/10}}</text>
-                                    <text class="zhe">折</text>
-                                </view>
-                                <view class="coupon-price" wx:if="{{item.coupon_type==20}}">
-                                    ¥<text class="{{item.reduce_price.length > 3? 'coupon-price-big' : ''}}">{{textUtil.priceSplit(item.reduce_price)[0]}}</text>
-                                </view>
-                                <view class="coupon_card_title extend-width nowrap maxName">{{item.name}}</view>
-                                <view class="limTime" wx:if="{{(!item.is_receive && item.state.value == -1)  || item.state.value == 1 || item.state.value == -2}}">{{item.start_hour+':00'}}-{{item.end_hour+':00'}}</view>
-                            </view>
-                            <view class="cardRightLim">
-                                <view class="textBox flex-column-c"  wx:if="{{item.state.value == 1}}" bind:tap="onItemButtonClicked" data-item="{{item}}" data-index="{{index}}" data-type="1">
-                                    <text>立</text><text>即</text><text>抢</text><text>券</text>
-                                </view>
-                                <view class="textBox flex-column-c" wx:if="{{item.is_receive == true && (item.state.value == 0 || item.state.value == -1)}}" bind:tap="onItemButtonClicked" data-item="{{item}}" data-index="{{index}}" data-type="0">
-                                    <text>立</text><text>即</text><text>使</text><text>用</text>
-                                </view>
-                                <view class="textBox owv flex-column-c" wx:if="{{!item.is_receive && item.state.value == -1}}">
-                                    <text>领</text><text>完</text><text>了</text>
-                                </view>
-                                <view class="textBox flex-column-c" wx:if="{{item.state.value == -2}}">
-                                    <text>即</text><text>将</text><text>抢</text><text>券</text>
-                                </view>
-                            </view>
-                        </view>
-                    </view>
-                </view>
-                </scroll-view>
+            <view class="item {{ tabSelected === 1 ? 'selected' : '' }}" bind:tap="changeNavTab" data-index="1">
+                <view class="label">我可兑换</view>
+                <view wx:if="{{tabSelected === 1}}" class="underline"></view>
             </view>
-        </block>
-        <!-- 领取优惠券 -->
-        <block wx:if="{{list.length > 0}}">
-            <view class="coupont-list-titlebg">
-                <view class="coupont-list-title">领取优惠券</view>
+            <view class="item {{ tabSelected === 2 ? 'selected' : '' }}" bind:tap="changeNavTab" data-index="2">
+                <view class="label">兑换记录</view>
+                <view wx:if="{{tabSelected === 2}}" class="underline"></view>
             </view>
-            <view class="coupon-card-bottom1 coupon-bgcolor">
-                <view class="cartContainer">
-                    <view class="cartItem" wx:for="{{list}}" wx:key="index">
-                        <image class="xxx" src="/static/images/coupon_card.png"></image>
-                        <image class="coupon-state-icon" src="/static/images/coupon_card_status.png" mode="aspectFill" wx:if="{{item.is_receive == true}}"></image>
-                        <!-- |oo| -->
-                        <view class="flex-c content-full cartContent">
-                            <view class="flex-column-c cardLeft">
-                                <view class="coupon-price" wx:if="{{item.coupon_type==50}}">
-                                    <text class="coupon-price-big noleft">{{item.discount/10}}</text>
-                                    <text class="zhe">折</text>
-                                </view>
-
-                                <view class="coupon-price" wx:if="{{item.coupon_type==20}}">
-                                    ¥<text class="{{item.reduce_price.length > 3? 'coupon-price-big' : ''}}">{{textUtil.priceSplit(item.reduce_price)[0]}}</text>
-                                </view>
-                                <view class="coupon_price_footer">{{item.coupon_title_}}</view>
+        </view>
+        <view class="pageMian" wx:if="{{tabSelected === 0 || tabSelected === 1}}">
+            <!-- 商品列表 -->
+            <view class="goodsList flex">
+                <block wx:for="{{list}}" wx:for-item="item" wx:key="index">
+                    <view class="goodsItem" bindtap="navigateTo" data-url="/pages/cart/pages/goodsDetail/goodsDetail?goods_id={{item.goods_id}}">
+                        <view class="goodsContent">
+                            <view class="goodsImgBox">
+                                <image src="{{item.goods_image+textUtil.imageMiddle()}}" mode="aspectFill" lazy-load="{{true}}"></image>
                             </view>
-
-                            <view class="flex-column coupon-card-right content-full">
-                                <view class="flexBox">
-                                    <view class="flex-column card-middle">
-                                        <view class="coupon_card_title extend-width nowrap">{{item.name}}</view>
-                                        <view class="coupon_card_content">
-                                            <view class="coupon-card-content-width nowrap2Rows">{{item.subtitle}}</view>
-                                            <view class="top-space nowrap" wx:if="{{item.fmt_expire_time}}">有效期至{{item.fmt_expire_time}}</view>
+                            <view class="goodsInfoBox">
+                                <view>
+                                    <view class="title textSpill2">
+                                        <!-- 秒杀标识 -->
+                                        <image wx:if="{{item.miaosha && item.miaosha.type == 4}}" class="icon" src="/static/icon/goodsMx.png" mode="aspectFill"></image>
+                                        <image wx:elif="{{item.za}}" class="icon goodsMyZy" src="/static/icon/goodsMyZy.png" mode="aspectFill"></image>
+                                        <view class="goodsNameText">{{item.goods_name}}</view>
+                                    </view>
+                                    <view class="sales flex">
+                                        <view class="bonus-star">
+                                            <image class="bonus-star" src="../../static/bonus_star.png" />
+                                        </view>
+                                        <view class="number ">
+                                            {{textUtil.priceFixed(item.points_to_exchange)}}
                                         </view>
                                     </view>
-                                    <view class="coRIGHT flex-column-c-c">
-                                        <view class="coupon-button coupon-button-color flex-c-c coupon-align-center" wx:if="{{item.state.value == 1}}" bind:tap="onItemButtonClicked" data-item="{{item}}" data-index="{{index}}" data-type="1">立即领取</view>
-                                        <view class="coupon-button coupon-button-haveGet flex-c-c coupon-align-center" wx:if="{{item.is_receive == true && (item.state.value == 0 || item.state.value == -1)}}" bind:tap="onItemButtonClicked" data-item="{{item}}" data-index="{{index}}" data-type="0">立即使用</view>
-                                        <view class="coupon-button coupon-button-disabled flex-c-c coupon-align-center" wx:if="{{!item.is_receive && item.state.value == -1}}">领完了</view>
+                                </view>
+                                <view class="exchange-box ">
+                                    <view class="hr"></view>
+                                    <view wx:if="{{info.accumulate_points >= item.points_to_exchange && item.goods_stocks > 0}}" class="exchange" bind:tap="goExchange" data-item="{{item}}">
+                                        立即兑换
+                                    </view>
+                                    <view wx:else class="exchange inactive">
+                                        立即兑换
                                     </view>
                                 </view>
-                                <view class="coupon_card_footer nowrap extend-width">{{item.describe}}</view>
                             </view>
-
                         </view>
                     </view>
+                </block>
+            </view>
+            <view class="emptyPage flex-column-c" wx:if="{{list.length <= 0}}">
+                <image class="image" src="/static/images/image_not_log.png" mode=""></image>
+                <view class="tips">暂无商品</view>
+            </view>
+        </view>
+        <view class="pageMian" wx:else>
+             <view class="every_box" wx:for="{{list}}" wx:key="order_id"  data-idx='{{index}}' data-id='{{item.order_id}}'>
+                <view class="part_1 flex-c">
+                    <view class="time">{{item.create_time}}</view>
+                    <view class='{{item.state_text=="待付款" || item.state_text=="待收货"?"status status_item":"status"}}'>{{item.state_text}}</view>
+                </view>
+                <view class="goods_box flex-c">
+                    <view class="left" wx:if='{{item.goods.length>1}}'>
+                        <view class="img_box">
+                            <image wx:for="{{item.goods}}" wx:for-item="i" wx:key="goods_id" src="{{i.goods_image+textUtil.imageSmall()}}" mode="aspectFill"></image>
+                        </view>
+                    </view>
+                    <view class="img_1 flex-c" wx:if='{{item.goods.length==1}}' wx:for="{{item.goods}}" wx:for-item="i" wx:key="goods_id">
+                        <image src="{{i.goods_image+textUtil.imageSmall()}}" mode="aspectFill"></image>
+                        <view class="t textSpill2">{{i.goods_name}}</view>
+                    </view>
+                    <view class="right">
+                        <view class='price_style'>
+                            ¥<text>{{textUtil.priceSplit(item.pay_price)[0]}}</text>.{{textUtil.priceSplit(item.pay_price)[1]}}
+                        </view>
+                        <view class="t">共{{item.goods_total_num}}件</view>
+                    </view>
+                </view>
+                <!-- "state_value": 11  //售后状态码 20已取消 30已完成 11待支付 12待收货未发货 13待收货已发货 -->
+                <view class="part_btn flex" wx:if='{{item.state_value==11}}'>
+                    <!-- 待付款 -->
+                    <view class="btn flex-c-c" catchtap='btnStatus' data-type='1' data-item='{{item}}' data-index='{{index}}'>取消订单</view>
+                    <view class="btn flex-c-c item" catchtap='commit' data-id='{{item.order_id}}' data-index='{{index}}'>立即支付</view>
                 </view>
-                <view class='is_bottom' wx:if='{{is_bottom}}'>~没有更多了~</view>
             </view>
-        </block>
-        <view class="coupon-card-bottom2 flex-column-c coupon-emptyPage coupon-bgcolor" wx:if="{{list.length == 0 && Limitcouponlist.length == 0}}">
-            <image class="image" src="/static/images/image_not_log.png" mode="aspectFill"></image>
-            <view class="tips">暂时还没有优惠券哦~</view>
+            <view class='is_bottom' wx:if='{{dataObj.total > 0 && is_bottom}}'>~没有更多了~</view>
         </view>
     </view>
 </view>
-
 <tui-modal show="{{showConfirmModal}}" custom padding="0rpx" width="600rpx" radius="16rpx">
     <view class="modalCustom-coupon">
         <view class="closeModal" bind:tap="hideConfirmModal">

+ 168 - 203
pages/index/pages/bonusShop/bonusShop.wxss

@@ -2,6 +2,60 @@ page {
     background-color: #F7F7F7;
 }
 
+.pageContainer .top-view {
+    width: 750rpx;
+    position: relative;
+}
+
+.pageContainer .top-view .background-image {
+    width: 750rpx;
+    display: block;
+    z-index: 1;
+}
+
+.pageContainer .top-view .my-bonus {
+    position: absolute;
+    width: 700rpx;
+    text-align: left;
+    font-size: 100rpx;
+    z-index: 2;
+    top: 150rpx;
+    font-weight: 600;
+    color: #FFFFFF;
+    text-align: center;
+}
+
+.pageContainer .top-view .my-bonus .bonus-star {
+    width: 75rpx;
+    height: 75rpx;
+    z-index: 2;
+    display: inline-block;
+}
+.pageContainer .pageDataBox .tabs {
+    display: flex;
+    justify-content: space-around;
+}
+
+.pageContainer .pageDataBox .tabs .item {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    flex-wrap: wrap;
+    font-size: 36rpx;
+}
+
+.pageContainer .pageDataBox .tabs .item.selected {
+    font-weight: 600;
+    color: #df3120;
+}
+
+.pageContainer .pageDataBox .tabs .item .underline {
+    width: 117rpx;
+    height: 7rpx;
+    border-radius: 7rpx;
+    background-color: #df3120;
+}
+
 .coupon-top-card {
     background-color: #FFFFFF;
     height: 116rpx;
@@ -116,7 +170,7 @@ page {
 }
 
 .coupon-card-bottom2 {
-    padding-top: 428rpx;
+    padding-top: 128rpx;
 }
 
 .cartContainer .nowrap {
@@ -169,232 +223,143 @@ page {
 .content-center {
     align-content: center;
 }
-
-/* .copuont_card {
-    align-content: center;
-} */
-/* .coupont-left {
-    flex: 1;
-} */
-.content-full {
-    height: 100%;
+.pageMian{
+  padding: 24rpx 32rpx;
 }
-.flexBox{
-    display: flex;
-    justify-content: space-between;
-}
-.card-middle {
-    /* width: 324rpx; */
-    max-width: 334rpx;
+.goodsList {
+  flex-wrap: wrap;
+  padding: 0 24rpx 16rpx 24rpx;
 }
 
-.coupon-card-right {
-    padding-left: 28rpx;
-    padding-top: 28rpx;
-    flex: 1;
-    justify-content: space-between;
+.goodsItem {
+  width: 50%;
+  margin-bottom: 16rpx;
 }
 
-.coupon-card-content-width {
-    /* max-width: 302rpx; */
-    /* max-height: 60rpx; */
+.goodsContent {
+  margin: 0 8rpx;
+  height: 550rpx;
+  background: #ffffff;
+  border-radius: 16rpx;
+  overflow: hidden;
+  display: flex;
+  flex-direction: column;
 }
 
-.coupon_card_content {
-    font-size: 22rpx;
-    color: #5F6268;
-    padding: 12rpx 0 0 0;
-}
+.goodsImgBox {
+  width: 100%;
+  height: 336rpx;
 
-.coupon_card_footer {
-    font-size: 20rpx;
-    color: #909297;
-    margin-bottom: 30rpx;
 }
 
-.coupon-price {
-    color: #E73E2D;
-    font-size: 28rpx;
-}
-.noleft{
-    margin: 0rpx !important;
-}
-.coupon-price text {
-    margin-left: 8rpx;
-    font-size: 72rpx;
-    font-weight: bold;
-}
-.coupon-price text.zhe{
-    color: #E73E2D;
-    font-size: 28rpx;
-    margin-left: 4rpx;
-}
-.coupon-price text.coupon-price-big {
-    font-size: 56rpx;
+.goodsImgBox image {
+  width: 100%;
+  height: 100%;
 }
 
-.coupon-button {
-    width: 136rpx;
-    height: 50rpx;
-    border-radius: 44rpx;
-    font-size: 24rpx;
-    position: relative;
+.goodsInfoBox {
+  padding: 16rpx;
+  display: flex;
+  position: relative;
+  flex: 1;
+  flex-direction: column;
+  justify-content: space-between;
 }
 
-.coupon-button-color {
-    color: #FFFFFF;
-    background: #E73E2D;
-}
-.coupon-button-color::after{
-    display: none;
-}
-.coupon-button-haveGet {
-    color: #E73E2D;
-    background: none;
+.goodsInfoBox .title {
+  font-size: 28rpx;
+  color: #161719;
 }
-.coupon-button::after{
-    content: '';
-    position: absolute;
-    left: 0;
-    top: 0;
-    border: 2rpx solid #e73e2d;
-    width: 200%;
-    height: 200%;
-    -webkit-transform: scale(0.5);
-    transform: scale(0.5);
-    -webkit-transform-origin: left top;
-    transform-origin: left top;
-    border-radius: 88rpx;
-}
-.coupon-button-disabled {
-    color: #909297;
-    background: none;
-}
-.coupon-button-disabled::after{
-    border: 2rpx solid #909297;
-}
-.coupon-align-center {
-    /* padding-right: 24rpx; */
-    /* margin-top: 54rpx; */
-    /* flex: 1; */
-}
-.xSHI .coupon-align-center{
-    margin-top: 38rpx;
+.goodsNameText{
+  display: inline;
 }
 
-.coupon_price_footer {
-    color: #E73E2D;
-    font-size: 24rpx;
-    margin-top: -10rpx;
+.goodsInfoBox .title .icon{
+  vertical-align: middle;
+  width: 88rpx;
+  height: 36rpx;
+  margin-right: 8rpx;
+  position: relative;
+  top: -2rpx;
 }
 
-.coupon_card_title {
-    font-size: 30rpx;
-    color: #333333;
-    font-weight: bold;
-}
+.goodsInfoBox .title .goodsMyZy{
+  width: 116rpx;
 
-.cardRight {
-    width: 300rpx;
-    align-content: center;
-    justify-content: center;
 }
 
-.cartItem {
-    position: relative;
-    height: 246rpx;
-    margin-bottom: 24rpx;
-}
-.maxName{
-    max-width: 260rpx;
-}
-.cartContainer {
-   padding: 0 32rpx;
-}
-.cartItemLim{
-    margin-bottom: 0 !important;
-    width: 408rpx;
-    height: 218rpx;
-    position: relative;
-    margin-right: 16rpx;
-    display: inline-block;
-    vertical-align: middle;
-}
-.cardLeftLim{
-    width: 312rpx;
-    height: 100%;
-    justify-content: center;
-}
-.cardRightLim{
-    flex: 1;
-    height: 100%;
-}
-.cardRightLim .textBox{
-    width: 100%;
-    height: 100%;
-    justify-content: center;
-    font-size: 32rpx;
-    font-weight: bold;
-    color: #E73E2D;
+
+.goodsInfoBox .sales {
+  font-size: 24rpx;
+  color: #909297;
+  padding-top: 4rpx;
+  align-items: baseline;
 }
-.cardRightLim .textBox.owv{
-    color: #909297;
+.sales .bonus-star {
+    width: 24rpx;
+    height: 24rpx;
+    margin-right: 6rpx;
 }
-.coupon-state-Lim{
-    position: absolute;
-    right: 116rpx;
-    top: 0;
-    z-index: 1;
-    width: 112rpx;
-    height: 92rpx;
+.sales .bonus-star image {
+    width: 24rpx;
+    height: 24rpx;
 }
-.limTime{
-    font-size: 24rpx;
-    color: #5F6268;
-    padding-top: 2rpx;
-}
-.limPrice{
+.sales .number{
+    color: #df3120;
     font-size: 28rpx;
-    font-weight: bold;
-    color: #E73E2D;
-}
-.limPrice text{
-    font-size: 72rpx;
-    margin-left: 2rpx;
-}
-.scrollView{
-    margin-bottom: 24rpx;
-    -webkit-overflow-scrolling: touch;
-}
-::-webkit-scrollbar {
-    display: none;
-    width: 0;
-    height: 0;
-    color: transparent;
-  }
-.xxx {
-    position: absolute;
-    height: 100%;
-    width: 100%;
-    top: 0;
-    left: 0;
-    right: 0;
-    bottom: 0;
-    z-index: 1;
-}
-
-.coupon-state-icon {
-    position: absolute;
-    height: 82rpx;
-    width: 98rpx;
-    top: 0;
-    right: 20rpx;
-    z-index: 1;
-}
-
-.noStock {
-    text-align: right;
-    font-size: 24rpx;
-    color: #e73e2d;
-    padding: 0 24rpx 24rpx 0;
+    font-weight: 500;
+}
+.exchange-box {
+  /* padding-top: 16rpx; */
+  padding-bottom: 12rpx;
+  text-align: center;
+}
+.exchange-box .hr {
+    width: 294rpx;
+    height: 2rpx;
+    background: rgba(0, 0, 0, 0.1);
+}
+.exchange-box .exchange {
+    padding-top: 12rpx;
+    font-size: 44rpx;
+    color: #df3120;
+}
+.exchange-box .exchange.inactive {
+    color:  rgba(0, 0, 0, 0.1);
+}
+
+.priceBox {
+  color: #e73e2d;
+  font-size: 24rpx;
+  align-items: baseline;
+}
+
+.priceBox .pra {
+  font-weight: bold;
+  font-size: 36rpx;
+  margin-left: 6rpx;
+}
+.linkprice{
+  font-size: 20rpx;
+  color: #909297;
+  margin-right: 2rpx;
+  padding-top: 12rpx;
+  margin-left: 8rpx;
+  align-items: baseline;
+}
+.linkprice .lPr{
+  text-decoration: line-through;
+  font-size: 22rpx;
+}
+.addCartBox{
+  font-size: 0;
+  position: absolute;
+  z-index: 10;
+  right: 0;
+  bottom: 0;
+  padding: 0 16rpx 24rpx 16rpx;
+}
+.addCartBox image {
+  width: 56rpx;
+  height: 56rpx;
 }

BIN
pages/index/static/bonus_shop_bg.png


BIN
pages/index/static/bonus_star.png


+ 9 - 2
project.private.config.json

@@ -9,8 +9,15 @@
         "miniprogram": {
             "list": [
                 {
-                    "name": "membership",
-                    "pathName": "pages/member/pages/membership/membership",
+                    "name": "checkout",
+                    "pathName": "pages/cart/pages/confirmOrder/confirmOrder",
+                    "query": "data={\"mode\":\"pointsExchange\",\"goodsId\":10148,\"goodsSkuId\":0,\"goodsNum\":1}",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "bonus shop",
+                    "pathName": "pages/index/pages/bonusShop/bonusShop",
                     "query": "",
                     "launchMode": "default",
                     "scene": null

+ 1 - 1
request/api.js

@@ -1,5 +1,5 @@
 
-const API_BASE_URL = 'http://lachang.fanfanle.cn';//lachang-dev环境
+const API_BASE_URL = 'http://local.test';//lachang-dev环境
 
 const versionNumber = "v1.5.1";//版本号
 module.exports = {

BIN
static/icon/icon_order_a.png


BIN
static/icon/icon_order_b.png


BIN
static/icon/icon_order_c.png


BIN
static/icon/icon_order_d.png


BIN
static/images/u_1_ba.png