1
0
hyq 6 роки тому
батько
коміт
bd3e89baf6

+ 2 - 1
wx-mall/app.js

@@ -24,6 +24,7 @@ App({
       nickName: '点击头像登录',
       avatarUrl: 'https://www.meiping123.com/upload/20171125/1721207662403.png'
     },
-    token: ''
+    token: '',
+    appGoodsBizType: '00'
   }
 })

+ 3 - 1
wx-mall/config/api.js

@@ -102,6 +102,7 @@ module.exports = {
     CouponList: NewApiRootUrl + 'coupon/list',  //个人优惠券列表
     CouponExchange: NewApiRootUrl + 'coupon/exchange',  //个人优惠券列表
     CouponTransActivit: NewApiRootUrl + 'coupon/transActivit',  //转发优惠券
+    checkActivit: NewApiRootUrl + 'coupon/checkActivit',  //校验是否领取优惠券
 
     smscodeSend: NewApiRootUrl + 'user/smscode',  //发送短信
 
@@ -125,6 +126,7 @@ module.exports = {
 
     UcenterIndex: NewApiRootUrl + 'index/ucenterIndex',  //个人中心首页
 
-    GetLogistics: NewApiRootUrl + 'order/getLogistics',  //查询物流信息
+  GetLogistics: NewApiRootUrl + 'order/getLogistics',  //查询物流信息
+  getCheckedDataByType: NewApiRootUrl + 'cart/getCheckedDataByType',  //校验该业务类型的购物车数据
 
 };

+ 36 - 7
wx-mall/pages/auth/newuser/newuser.js

@@ -10,7 +10,8 @@ Page({
     phone: '',
     smscode: '',
     second: '发送验证码',
-    disabled: false
+    disabled: false,
+    disabledUpdate: false
   },
   clearPhone(){
     this.setData({
@@ -52,6 +53,9 @@ Page({
       phone: that.data.phone
     }, 'POST').then(function (res) {
       if (res.errno === 0) {
+        wx.showToast({
+          title: '手机号绑定成功'
+        });
         wx.redirectTo({ url: '/pages/ucenter/coupon/coupon' });
       } else if (res.errno === 1) {
         // util.showErrorToast(res.errmsg);
@@ -75,7 +79,7 @@ Page({
       return false;
     }
     util.request(api.smscodeSend, {
-      mobile: that.data.phone
+      phone: that.data.phone
     }, 'POST').then(function (res) {
       let n = 59;
       var timer = setInterval(function () {
@@ -96,10 +100,19 @@ Page({
         wx.showToast({
           title: '短信发送成功'
         })
-      } else if (res.errno == 1) {
-        wx.showToast({
-          title: '短信已发送'
-        })
+      } else{
+        // util.showErrorToast(res.errmsg);
+        wx.showModal({
+          title: '',
+          content: res.errmsg,
+          showCancel: false
+        });
+        clearInterval(timer);
+        that.setData({
+          second: '发送验证码',
+          disabled: false
+        });
+        return false;
       }
     });
   },
@@ -107,7 +120,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    this.checkActivit();
   },
 
   /**
@@ -157,5 +170,21 @@ Page({
    */
   onShareAppMessage: function () {
 
+  },
+  checkActivit() {
+    let that = this;
+    util.request(api.checkActivit).then(function (res) {
+      if (res.errno === 2) {
+        wx.showModal({
+          title: '',
+          content: res.errmsg,
+          showCancel: false
+        });
+        that.setData({
+          disabled: true,
+          disabledUpdate: true
+        });
+      }
+    });
   }
 })

+ 3 - 3
wx-mall/pages/auth/newuser/newuser.wxml

@@ -2,13 +2,13 @@
   <view class="form-box">
 
     <view class="form-item">
-      <input class="phone" value="{{phone}}" type="number" maxlength="{{11}}" bindinput="bindPhoneInput" placeholder="手机号" auto-focus/>
+      <input class="phone" value="{{phone}}" disabled="{{disabledUpdate}}"  type="number" maxlength="{{11}}" bindinput="bindPhoneInput" placeholder="手机号" auto-focus/>
       <image wx:if="{{ phone.length > 0 }}" id="clear-phone" class="clear" src="/static/images/clear_input.png" catchtap="clearPhone"></image>
     </view>
 
     <view class="form-item-code">
       <view class="form-item code-item">
-        <input class="smscode" value="{{smscode}}" type="number" bindinput="bindSmscodeInput" placeholder="短信码" />
+        <input class="smscode" disabled="{{disabledUpdate}}" value="{{smscode}}" type="number" bindinput="bindSmscodeInput" placeholder="短信码" />
         <image class="clear" id="clear-smscode" wx:if="{{ smscode.length > 0 }}" src="/static/images/clear_input.png" catchtap="clearCode"></image>
       </view>
 
@@ -18,5 +18,5 @@
 
     </view>
   </view>
-  <button type="primary" class="login-btn" bindtap="getCoupon">提交</button>
+  <button type="primary" disabled="{{disabledUpdate}}"  class="login-btn" bindtap="getCoupon">提交</button>
 </view>

+ 133 - 12
wx-mall/pages/cart/cart.js

@@ -6,7 +6,11 @@ var app = getApp();
 
 Page({
   data: {
+    cartGoods00: [],//保税仓数据
+    cartGoods02: [],//保税展示数据
+    cartGoods11: [],//现场速递数据
     cartGoods: [],
+    goodsBizType: '',//货品业务类型
     footprintList: [],
     cartTotal: {
       "goodsCount": 0,
@@ -15,6 +19,9 @@ Page({
       "checkedGoodsAmount": 0.00
     },
     checkedAllStatus: true,
+    checkedTypeStatus00: true,
+    checkedTypeStatus02: true,
+    checkedTypeStatus11: true,
     couponInfoList: [],
     openAttr: false,
     specificationList: {},
@@ -41,24 +48,32 @@ Page({
     // 页面关闭
 
   },
-  getCartList: function () {
+  getCartList: function () {//获取购物车数据
     let that = this;
     util.request(api.CartList).then(function (res) {
       if (res.errno === 0) {
         that.setData({
           cartGoods: res.data.cartList,
+          cartGoods00: res.data.cart00List,
+          cartGoods02: res.data.cart02List,
+          cartGoods11: res.data.cart11List,
           cartTotal: res.data.cartTotal,
           couponInfoList: res.data.couponInfoList
         });
       }
-
+      //数据渲染选中
       that.setData({
         checkedAllStatus: that.isCheckedAll()
       });
+      that.setData({
+        checkedTypeStatus00: that.isCheckedTypeStatus00(),
+        checkedTypeStatus02: that.isCheckedTypeStatus02(),
+        checkedTypeStatus11: that.isCheckedTypeStatus11()
+      });
     });
   },
   isCheckedAll: function () {
-    //判断购物车商品已全选
+    //判断购物车所有商品是否已全选
     return this.data.cartGoods.every(function (element, index, array) {
       if (element.checked == true) {
         return true;
@@ -67,6 +82,36 @@ Page({
       }
     });
   },
+  isCheckedTypeStatus00: function () {
+      //判断该业务类型的购物车商品是否已全选
+      return this.data.cartGoods00.every(function (element, index, array) {
+        if (element.checked == true) {
+          return true;
+        } else {
+          return false;
+        }
+      });     
+  },
+  isCheckedTypeStatus02: function () {
+    //判断该业务类型的购物车商品是否已全选
+    return this.data.cartGoods02.every(function (element, index, array) {
+      if (element.checked == true) {
+        return true;
+      } else {
+        return false;
+      }
+    });
+  },
+  isCheckedTypeStatus11: function () {
+    //判断该业务类型的购物车商品是否已全选
+    return this.data.cartGoods11.every(function (element, index, array) {
+      if (element.checked == true) {
+        return true;
+      } else {
+        return false;
+      }
+    });
+  },
   toIndexPage: function () {
     wx.switchTab({
       url: "/pages/index/index"
@@ -84,12 +129,18 @@ Page({
         console.log(res.data);
         that.setData({
           cartGoods: res.data.cartList,
+          cartGoods00: res.data.cart00List,
+          cartGoods02: res.data.cart02List,
+          cartGoods11: res.data.cart11List,
           cartTotal: res.data.cartTotal,
           couponInfoList: res.data.couponInfoList
         });
       }
       that.setData({
-        checkedAllStatus: that.isCheckedAll()
+        checkedAllStatus: that.isCheckedAll(),
+        checkedTypeStatus00: that.isCheckedTypeStatus00(),
+        checkedTypeStatus02: that.isCheckedTypeStatus02(),
+        checkedTypeStatus11: that.isCheckedTypeStatus11()
       });
     });
 
@@ -117,6 +168,9 @@ Page({
         console.log(res.data);
         that.setData({
           cartGoods: res.data.cartList,
+          cartGoods00: res.data.cart00List,
+          cartGoods02: res.data.cart02List,
+          cartGoods11: res.data.cart11List,
           cartTotal: res.data.cartTotal,
           couponInfoList: res.data.couponInfoList
         });
@@ -125,6 +179,61 @@ Page({
       that.setData({
         checkedAllStatus: that.isCheckedAll()
       });
+      that.setData({
+        checkedTypeStatus00: that.isCheckedAll(),
+        checkedTypeStatus02: that.isCheckedAll(),
+        checkedTypeStatus11: that.isCheckedAll()
+      });
+    });
+  },
+  checkedAllGoodType: function (e) {
+    let that = this;
+    let goodsBizType = e.target.dataset.goodsBizType;
+    let isCheckedTypeStatu;
+    if (goodsBizType == '00') {
+      isCheckedTypeStatu = that.isCheckedTypeStatus00();
+    }
+    if (goodsBizType == '02') {
+      isCheckedTypeStatu = that.isCheckedTypeStatus02();
+    }
+    if (goodsBizType == '11') {
+      isCheckedTypeStatu = that.isCheckedTypeStatus11();
+    }
+    util.request(api.CartChecked, {
+      isChecked: isCheckedTypeStatu ? 0 : 1,
+      goodsBizType: goodsBizType
+    }, 'POST').then(function (res) {
+      if (res.errno === 0) {
+        console.log(res.data);
+        //渲染数据
+        that.setData({
+          cartGoods: res.data.cartList,
+          cartGoods00: res.data.cart00List,
+          cartGoods02: res.data.cart02List,
+          cartGoods11: res.data.cart11List,
+          cartTotal: res.data.cartTotal,
+          couponInfoList: res.data.couponInfoList,
+          goodsBizType: goodsBizType
+        });
+      }
+      if (goodsBizType == '00') {
+          that.setData({
+            checkedTypeStatus00: that.isCheckedTypeStatus00()
+        });
+      }
+      if (goodsBizType == '02') {
+        that.setData({
+          checkedTypeStatus02: that.isCheckedTypeStatus02()
+        });
+      }
+      if (goodsBizType == '11') {
+        that.setData({
+          checkedTypeStatus11: that.isCheckedTypeStatus11()
+        });
+      }
+      that.setData({
+        checkedAllStatus: that.isCheckedAll()
+      });
     });
   },
   updateCart: function (productId, goodsId, number, beforeNumber, id, itemIndex) {
@@ -138,7 +247,7 @@ Page({
     }, 'POST').then(function (res) {
       if (res.errno === 0) {
         console.log(res.data);
-        if (res.errmsg){
+        if (res.errmsg) {
           wx.showModal({
             title: '修改失败',
             showCancel: false,
@@ -148,16 +257,19 @@ Page({
 
         that.setData({
           cartGoods: res.data.cartList,
+          cartGoods00: res.data.cart00List,
+          cartGoods02: res.data.cart02List,
+          cartGoods11: res.data.cart11List,
           cartTotal: res.data.cartTotal,
           couponInfoList: res.data.couponInfoList
         });
       } else {
         // util.showErrorToast(res.errmsg);
-          wx.showModal({
-              title: '提示信息',
-              content: res.errmsg,
-              showCancel: false
-          });
+        wx.showModal({
+          title: '提示信息',
+          content: res.errmsg,
+          showCancel: false
+        });
         let cartItem = that.data.cartGoods[itemIndex];
         cartItem.number = beforeNumber;
         that.setData({
@@ -166,7 +278,10 @@ Page({
       }
 
       that.setData({
-        checkedAllStatus: that.isCheckedAll()
+        checkedAllStatus: that.isCheckedAll(),
+        checkedTypeStatus00: that.isCheckedTypeStatus00(),
+        checkedTypeStatus02: that.isCheckedTypeStatus02(),
+        checkedTypeStatus11: that.isCheckedTypeStatus11()
       });
     });
   },
@@ -231,13 +346,19 @@ Page({
             if (res.errno === 0) {
               that.setData({
                 cartGoods: res.data.cartList,
+                cartGoods00: res.data.cart00List,
+                cartGoods02: res.data.cart02List,
+                cartGoods11: res.data.cart11List,
                 cartTotal: res.data.cartTotal,
                 couponInfoList: res.data.couponInfoList
               });
             }
 
             that.setData({
-              checkedAllStatus: that.isCheckedAll()
+              checkedAllStatus: that.isCheckedAll(),
+              checkedTypeStatus00: that.isCheckedTypeStatus00(),
+              checkedTypeStatus02: that.isCheckedTypeStatus02(),
+              checkedTypeStatus11: that.isCheckedTypeStatus11()
             });
           });
           console.log('用户点击确定')

+ 77 - 4
wx-mall/pages/cart/cart.wxml

@@ -26,9 +26,9 @@
     <view class="list">
       <view class="group-item">
         <view class="goods">
-          <view class="item" wx:for="{{cartGoods}}" wx:key="{{item.id}}">
-            <view class='title_'>
-            <text class="title-name">{{item.goodsBizType}}</text> </view>
+          
+          <view wx:if="{{cartGoods00.length != 0}}" class="checkbox-biz-type {{checkedTypeStatus00 ? 'checked' : ''}}" bindtap="checkedAllGoodType" data-goods-Biz-Type="00"><text class="title-name">保税仓</text></view>
+          <view class="item" wx:for="{{cartGoods}}" wx:if="{{item.goodsBizType == 00}}" wx:key="{{item.id}}">
             <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}"></view>
             <view class="cart-goods">
               <navigator url="/pages/goods/goods?id={{item.goods_id}}">
@@ -60,7 +60,80 @@
               </view>
             </view>
           </view>
-        </view>
+
+        <view wx:if="{{cartGoods02.length != 0}}" class="checkbox-biz-type {{checkedTypeStatus02 ? 'checked' : ''}}" bindtap="checkedAllGoodType" data-goods-Biz-Type="02"><text class="title-name">保税展示</text></view>
+
+          <view class="item" wx:for="{{cartGoods}}" wx:if="{{item.goodsBizType == 02}}" wx:key="{{item.id}}">
+            <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}"></view>
+            <view class="cart-goods">
+              <navigator url="/pages/goods/goods?id={{item.goods_id}}">
+                <image class="img" src="{{item.list_pic_url}}"></image>
+              </navigator>
+              <view class="info">
+                <view class="t">
+                  <navigator url="/pages/goods/goods?id={{item.goods_id}}">
+                    <text class="name">{{item.goods_name}}</text>
+                  </navigator>
+                  <view class="goods-do">
+                    <text class="price">¥{{item.retail_price}}</text>
+                    <text class="org-price line-through">¥{{item.market_price}}</text>
+                  </view>
+                </view>
+                <view class="attr">{{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}
+                </view>
+                <!-- //数量加减 -->
+                <view class="number-item">
+                  <view class="selnum">
+                    <view class="cut" data-goods-id="{{item.id}}" data-item-index="{{index}}" data-product-id="{{item.product_id}}" bindtap="cutNumber"></view>
+                    <input value="{{item.number}}" class="number" disabled="true" type="number" />
+                    <view class="add" data-goods-id="{{item.id}}" data-item-index="{{index}}" data-product-id="{{item.product_id}}" bindtap="addNumber"></view>
+                  </view>
+                </view>
+                <view class="handle">
+                  <image catchtap="deleteCart" data-cart-id="{{item.id}}" data-goods-name="{{item.goods_name}}" class="del" src="/static/images/del-address.png"></image>
+                </view>
+              </view>
+            </view>
+          </view>
+
+   
+          <view wx:if="{{cartGoods11.length != 0}}" class="checkbox-biz-type {{checkedTypeStatus11 ? 'checked' : ''}}" bindtap="checkedAllGoodType" data-goods-Biz-Type="11"><text class="title-name">现场速递</text></view>
+
+          <view class="item" wx:for="{{cartGoods}}" wx:if="{{item.goodsBizType == 11}}" wx:key="{{item.id}}">
+            <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}"></view>
+            <view class="cart-goods">
+              <navigator url="/pages/goods/goods?id={{item.goods_id}}">
+                <image class="img" src="{{item.list_pic_url}}"></image>
+              </navigator>
+              <view class="info">
+                <view class="t">
+                  <navigator url="/pages/goods/goods?id={{item.goods_id}}">
+                    <text class="name">{{item.goods_name}}</text>
+                  </navigator>
+                  <view class="goods-do">
+                    <text class="price">¥{{item.retail_price}}</text>
+                    <text class="org-price line-through">¥{{item.market_price}}</text>
+                  </view>
+                </view>
+                <view class="attr">{{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}
+                </view>
+                <!-- //数量加减 -->
+                <view class="number-item">
+                  <view class="selnum">
+                    <view class="cut" data-goods-id="{{item.id}}" data-item-index="{{index}}" data-product-id="{{item.product_id}}" bindtap="cutNumber"></view>
+                    <input value="{{item.number}}" class="number" disabled="true" type="number" />
+                    <view class="add" data-goods-id="{{item.id}}" data-item-index="{{index}}" data-product-id="{{item.product_id}}" bindtap="addNumber"></view>
+                  </view>
+                </view>
+                <view class="handle">
+                  <image catchtap="deleteCart" data-cart-id="{{item.id}}" data-goods-name="{{item.goods_name}}" class="del" src="/static/images/del-address.png"></image>
+                </view>
+              </view>
+            </view>
+          </view>
+
+          
+          </view>
       </view>
     </view>
 

+ 15 - 4
wx-mall/pages/cart/cart.wxss

@@ -639,16 +639,27 @@ page {
 
 .title-name {
   width: 100%;
+  height: 30rpx;
   text-align: center;
   font-size: 28rpx;
   color: rgba(87, 86, 86, 0.63);
   background:url(http://image.meiping123.com/upload/20180104/1055343561cd30.png) no-repeat center 205rpx;
   background-size: 100rpx 100rpx;
-  margin-bottom: 10rpx;
-  margin-left: 30rpx;
+  margin-left: 60rpx;
   font-weight: bolder;
 }
-.title_{
-  height: 20rpx;
+
+.checkbox-biz-type {
+  float: left;
+  height: 30rpx;
+  width: 100%;
   margin-top: 10rpx;
+  margin-left: 24rpx;
+  background: url(http://image.meiping123.com/upload/20180104/105653607bcb4b.png) no-repeat;
+  background-size: 30rpx;
+}
+
+.checkbox-biz-type.checked {
+  background: url(http://image.meiping123.com/upload/20180104/1057387862b4e8.png) no-repeat;
+  background-size: 30rpx;
 }

+ 34 - 9
wx-mall/pages/catalog/catalog.js

@@ -1,5 +1,7 @@
 var util = require('../../utils/util.js');
 var api = require('../../config/api.js');
+//获取应用实例
+const app = getApp();
 
 Page({
   data: {
@@ -17,6 +19,7 @@ Page({
     currentSortType: 'default',
     currentSortOrder: 'desc',
     filterDiscount: 0,// 0不限 1特价 2活动
+    goodsBizType: app.globalData.appGoodsBizType,//业务类型
     page: 1,
     size: 50,
     showNavList: false,
@@ -39,13 +42,16 @@ Page({
   onLoad: function (options) {
     let that = this;
     // 页面初始化 options为页面跳转所带来的参数
-    if (options.referrer) {
+    if (options.referrer){
       that.setData({
         referrer: parseInt(options.referrer),
         sourceKey: options.sourceKey,
         openCoupon: true
       });
     }
+    that.setData({
+      goodsBizType: app.globalData.appGoodsBizType
+    });
 
     wx.setNavigationBarTitle({
       title: '分类'
@@ -91,6 +97,9 @@ Page({
     // 页面渲染完成
   },
   onShow: function () {
+    this.setData({
+      goodsBizType: app.globalData.appGoodsBizType
+    });
     // 页面显示
     this.getFootCart();
     this.getCatalog();
@@ -129,12 +138,14 @@ Page({
   },
   getGoodsList() {
     var that = this;
+    console.log(that.data);
     util.request(api.CatalogProductList, {
       page: that.data.page,
       size: that.data.size,
       order: that.data.currentSortOrder,
       sort: that.data.currentSortType,
-      discount: that.data.filterDiscount,
+      // discount: that.data.filterDiscount,
+      goodsBizType: that.data.goodsBizType,
       categoryId: that.data.currentCategory.id
     })
       .then(function (res) {
@@ -216,23 +227,25 @@ Page({
     });
   },
   openSortFilter: function (event) {
+    let that = this; 
     let currentId = event.currentTarget.id;
+    console.log('currentId:'+currentId);
     switch (currentId) {
       case 'defaultActivity':
-        this.setData({
-          'filterDiscount': 0
+        that.setData({
+          'goodsBizType': '00'
         });
         this.getGoodsList();
         break;
       case 'discountActivity':
-        this.setData({
-          'filterDiscount': 1
+        that.setData({
+          'goodsBizType': '02'
         });
         this.getGoodsList();
         break;
       case 'groupActivity':
-        this.setData({
-          'filterDiscount': 2
+        that.setData({
+          'goodsBizType': '10'
         });
         this.getGoodsList();
         break;
@@ -307,5 +320,17 @@ Page({
     wx.navigateTo({
       url: url,
     })
-  },
+  }, 
+  sercherCategory: function (e) {
+    var that = this;
+    let url = '';
+    var id = e.currentTarget.dataset.replyType;
+    // console.log('replyType:' + e.currentTarget.dataset.replyType);
+    // console.log('goodsBizType:' + that.data.goodsBizType);
+    // 跳转页面
+    wx.navigateTo({
+      url: '/pages/category/category?id=' + id + '&&goodsBizType=' + that.data.goodsBizType
+    })
+
+  }
 })

+ 6 - 5
wx-mall/pages/catalog/catalog.wxml

@@ -57,13 +57,13 @@
   </view>
   <view class="activity">
     <view class="activity-box">
-      <view class="item {{filterDiscount == 0 ? 'active' : ''}}" bindtap="openSortFilter" id="defaultActivity">
+      <view class="item {{goodsBizType == '00' ? 'active' : ''}}" bindtap="openSortFilter" id="defaultActivity">
         <text class="txt">保税仓</text>
       </view>
-      <view class="item by-sell {{filterDiscount == 1 ? 'active' : ''}}" bindtap="openSortFilter" id="discountActivity">
+      <view class="item by-sell {{goodsBizType == '02' ? 'active' : ''}}" bindtap="openSortFilter" id="discountActivity">
         <text class="txt">保税展示</text>
       </view>
-      <view class="item by-price {{filterDiscount == 2 ? 'active' : ''}}" bindtap="openSortFilter" id="groupActivity">
+      <view class="item by-price {{goodsBizType == '10' ? 'active' : ''}}" bindtap="openSortFilter" id="groupActivity">
         <text class="txt">现场速递</text>
       </view>
     </view>
@@ -87,7 +87,7 @@
         <text class="line"></text>
       </view>
       <view class="bd">
-        <navigator url="/pages/category/category?id={{item.id}}" class="item {{(index+1) % 3 == 0 ? 'last' : ''}}" wx:for="{{currentCategory.subCategoryList}}" wx:key="{{item.id}}">
+        <navigator bindtap="sercherCategory" data-reply-Type="{{item.id}}" class="item {{(index+1) % 3 == 0 ? 'last' : ''}}" wx:for="{{currentCategory.subCategoryList}}" wx:key="{{item.id}}">
           <image class="icon" wx:if="{{item.wap_banner_url}}" src="{{item.wap_banner_url}}"></image>
           <text class="txt">{{item.name}}</text>
         </navigator>
@@ -106,6 +106,7 @@
         </view>
       </view>
       <view class="cate-item">
+        <view wx:if="{{goodsList.length == 0}}" class="item-text">未找到相关商品</view>
         <view class="item" wx:for="{{goodsList}}" wx:for-index="index" wx:for-item="item" wx:key="{{item.id}}">
           <navigator url="{{filterDiscount != 2 ?'/pages/goods/goods?id='+item.id:'/pages/groupDetail/groupDetail?id='+item.group_id }}">
             <view class="left">
@@ -134,7 +135,7 @@
             </view>
 
           </view>
-    </navigator>
+        </navigator>
 
         </view>
       </view>

+ 7 - 1
wx-mall/pages/catalog/catalog.wxss

@@ -260,7 +260,13 @@ page {
   height: 272rpx;
   width: 100%;
 }
-
+.item-text{
+  margin-top: 10rpx;
+  height: 100rpx;
+  width: 100%;
+  color: #a8a6a6;
+  text-align: center;
+}
 .cate-item .item .left {
   width: 190rpx;
   height: 272rpx;

+ 16 - 8
wx-mall/pages/category/category.js

@@ -8,6 +8,7 @@ Page({
         navList: [],
         goodsList: [],
         id: 0,
+        goodsBizType: '00',
         currentTab: 0,
         navIndex: 0,
         currentCategory: {},
@@ -65,8 +66,8 @@ Page({
     },
     onLoad: function (options) {
         // 页面初始化 options为页面跳转所带来的参数
-        var that = this;
-        if (options.id) {
+      var that = this; 
+      if (options.id) {
             that.setData({
                 id: parseInt(options.id)
             });
@@ -77,6 +78,11 @@ Page({
                 goodsList: [],
             });
         }
+      if (options.goodsBizType) {
+        that.setData({
+          goodsBizType: options.goodsBizType
+        });
+      } 
         wx.getSystemInfo({
             success: function (res) {
                 var clientHeight = res.windowHeight,
@@ -102,9 +108,9 @@ Page({
     },
     getCategoryInfo: function () {
         let that = this;
-        util.request(api.GoodsCategory, {id: this.data.id})
-            .then(function (res) {
-
+      console.log('idd:' + that.data.id);
+      util.request(api.GoodsCategory, { id: that.data.id, goodsBizType: that.data.goodsBizType})
+        .then(function (res) {
                 if (res.errno == 0) {
                     that.setData({
                         navList: res.data.brotherCategory,
@@ -128,7 +134,7 @@ Page({
                     that.setData({
                         currentTab: currentIndex,
                         navIndex: currentIndex
-                    });
+                  });
                     that.getGoodsList();
                 } else {
                     //显示错误信息
@@ -169,7 +175,8 @@ Page({
     getGoodsList: function () {
         var that = this;
 
-        util.request(api.GoodsList, {categoryId: that.data.id, page: that.data.page, size: that.data.size})
+        console.log('goodsBizType13:' + that.data.goodsBizType);
+      util.request(api.GoodsList, { categoryId: that.data.id, goodsBizType: that.data.goodsBizType, page: that.data.page, size: that.data.size})
             .then(function (res) {
                 let goodsList = that.data.goodsList;
                 goodsList = goodsList.concat(res.data.data);
@@ -319,7 +326,8 @@ Page({
             });
         }
         this.setData({
-            id: event.currentTarget.dataset.id
+            id: event.currentTarget.dataset.id,
+            goodsBizType: that.data.goodsBizType
         });
         this.getCategoryInfo();
     },

+ 1 - 1
wx-mall/pages/goods/goods.wxml

@@ -49,7 +49,7 @@
     </view>
     <view class="goods-info">
       <view class="c">
-        <text class="name">{{goods.goodsBizType}} {{goods.name}}</text>
+        <text class="name">{{goods.name}}</text>
         <text class="desc">{{goods.goods_brief}}</text>
         <view class="goods-do">
           <text class="price">¥{{goods.retail_price}}</text>

+ 54 - 12
wx-mall/pages/index/index.js

@@ -3,7 +3,7 @@ const api = require('../../config/api.js');
 const user = require('../../services/user.js');
 
 //获取应用实例
-const app = getApp()
+const app = getApp();
 Page({
   data: {
     groupGoods: [],
@@ -95,6 +95,16 @@ Page({
       url: '../search/search',
     })
   },
+  goCatalog: function (e) {
+    let url = '';
+    // console.log('dataset.goodsBizType:' + e.currentTarget.dataset.goodsBizType);
+    app.globalData.appGoodsBizType = e.currentTarget.dataset.goodsBizType;
+    // console.log('appgoodsBizType1:' + app.globalData.appGoodsBizType);
+    
+    wx.switchTab({
+      url: '/pages/catalog/catalog',
+    });
+  },
   onReachBottom: function () {
 
     if (this.data.bottomLoadDone === true || this.data.bottomLoading === true) {
@@ -247,6 +257,9 @@ Page({
   scanGoodsCode: function (e) {
     var that = this;
     var code;
+    var value;
+    var substrValue;
+    var scanType;
     // 调起客户端扫码界面进行扫码
     wx.scanCode({
       // 是否只能从相机扫码
@@ -254,21 +267,50 @@ Page({
       // 扫码类型, barCode:一维码, qrCode:二维码
       scanType: ['barCode', 'qrCode'],
       success: function (res) {
-        that.code = "结果:" + res.result + ",路径:" + res.path;
+        that.code = "结果:" + res.result + ",路径:" + res.path + ",编码:" + res.rawData;
+        that.value = res.result;
+        that.scanType = res.scanType;
         that.setData({
           goodsCode: that.code
-        })
+        });
+
+        if (that.scanType == 'QR_CODE') {//二维码
+          that.substrValue = that.value.substring(0, 5);
+          that.value = that.value.substring(5, that.value.length);
+          if (that.substrValue != 'emato') {//../goods/goods?id=
+            wx.showModal({
+              title: '',
+              content: '您所扫描的商品无效',
+              showCancel: false,
+              success: function (res) {
+                if (res.confirm) {
+                  console.log('用户点击确定')
+                } else if (res.cancel) {
+                  console.log('用户点击取消')
+                }
+              }
+            });
+          } else {
+            // 跳转页面
+            wx.navigateTo({
+              url: that.value,
+              success: function (e) {
+                console.log('跳转成功');
+              },
+              fail: function (e) {
+                console.log('跳转失败');
+              }
+            })
 
-        // 跳转页面
-        wx.navigateTo({
-          url: '../details/details?id=111',
-          success: function (e) {
-            console.log('跳转成功')
-          },
-          fail: function (e) {
-            console.log('跳转失败')
           }
-        })
+        }else{//其他码
+          //弹框显示结果
+          wx.showModal({
+            title: '扫描结果',
+            content: that.value,
+            showCancel: false
+          });
+        }
       },
 
       fail: function () {

+ 8 - 5
wx-mall/pages/index/index.wxml

@@ -1,6 +1,9 @@
 <!--index.wxml-->
 <view class="container">
 
+<template name="dialog">
+</template>
+
   <view class="modal-wrap" wx:if="{{showPop}}" bindtap="showCouponPop">
     <view class="discount-dialog">
       <!-- <view class="dialog-title">{{couponVo.name}}</view> -->
@@ -32,25 +35,25 @@
     </swiper-item>
   </swiper>
   <view class="m-menu">
-    <navigator class="itemb">
+    <navigator class="itemb" bindtap="goCatalog" data-goods-Biz-Type="00">
       <image src="../../static/images/service-bao.png" background-size="cover"></image>
       <text>保税仓</text>
     </navigator>
-    <navigator class="itemb">
+    <navigator class="itemb" bindtap="goCatalog" data-goods-Biz-Type="02">
       <image src="../../static/images/service-zs.png" background-size="cover"></image>
       <text>保税展示</text>
     </navigator>
-    <navigator class="itemb">
+    <navigator class="itemb" bindtap="goCatalog" data-goods-Biz-Type="10">
       <image src="../../static/images/service-ziti.png" background-size="cover"></image>
       <text>现场速递</text>
     </navigator>
   </view>
-  <view class="m-menu">
+  <!-- <view class="m-menu">
     <navigator class="item" url="{{item.url}}" wx:for="{{channel}}" wx:key="{{item.id}}">
       <image src="{{item.icon_url}}" background-size="cover"></image>
       <text>{{item.name}}</text>
     </navigator>
-  </view>
+  </view> -->
   <!-- <view class="a-section a-brand">
     <view class="h">
       <navigator url="../brand/brand">

+ 3 - 2
wx-mall/pages/pay/pay.js

@@ -4,15 +4,16 @@ var api = require('../../config/api.js');
 
 Page({
   data: {
-    orderId: 0,
+    orderIds: [],
     actualPrice: 0.00
   },
   onLoad: function (options) {
     // 页面初始化 options为页面跳转所带来的参数
     this.setData({
-      orderId: options.orderId,
+      orderIds: options.orderIds,
       actualPrice: options.actualPrice
     })
+    console.log(this.data.orderIds);
   },
   onReady: function () {
 

+ 8 - 1
wx-mall/pages/shopping/checkout/checkout.js

@@ -163,8 +163,15 @@ Page({
       delivery_remark: that.data.delivery_remark
     }, 'POST').then(function (res) {
       if (res.errno === 0) {
+        let actualPrice = that.data.actualPrice;
+        let orderIds = [];
+        for (let i = 0; i < res.data.orderInfo.length; i++){
+          orderIds[i] = res.data.orderInfo[i].id;
+        }
+        console.log(actualPrice);
+        console.log(orderIds);
         wx.redirectTo({
-          url: '/pages/pay/pay?orderId=' + res.data.orderInfo.id + '&actualPrice=' + res.data.orderInfo.actual_price
+          url: '/pages/pay/pay?orderIds=' + orderIds + '&actualPrice=' + actualPrice
         })
 
       } else {