1
0
Переглянути джерело

小程序前端新增满减满折功能,以及门店商品逻辑修改

hyq 5 роки тому
батько
коміт
15f75e9cda

+ 2 - 1
wx-mall/app.json

@@ -53,7 +53,8 @@
     "pages/ucenter/applyRefund/applyRefund",
     "pages/ucenter/ticketDiscountGoods/ticketDiscountGoods",
     "pages/ucenter/couponDetail/couponDetail",
-    "pages/ucenter/couponTickInfo/couponTickInfo"
+    "pages/ucenter/couponTickInfo/couponTickInfo",
+    "pages/ucenter/campMinus/campMinus"
     
   ],
   "window": {

+ 131 - 128
wx-mall/config/api.js

@@ -12,137 +12,140 @@ var NewApiRootUrl = 'https://mp.k1net.cn/api/';
 
 module.exports = {
 
-    // tab
-    IndexUrl: NewApiRootUrl + 'index/index', //首页数据接口
-    CatalogList: NewApiRootUrl + 'catalog/index',  //分类目录全部分类数据接口
-    CatalogCurrent: NewApiRootUrl + 'catalog/current',  //分类目录当前分类数据接口
-    CatalogProductList: NewApiRootUrl + 'goods/productlist',  //分类目录当前产品
-    // 权限
-    AuthLoginByWeixin: NewApiRootUrl + 'auth/login_by_weixin', //微信登录
-    ChooseStoreId: NewApiRootUrl + 'auth/chooseStoreId', //选择门店Id
-    NearbyList: NewApiRootUrl + 'auth/nearbyLists',//根据经纬度获取配送范围内的门店
-    StoreByCity: NewApiRootUrl + 'auth/storeListByCity',//获取地市的门店
-    //
-    ActivityList: NewApiRootUrl + 'activity/list', //活动列表
-
-    GoodsSku: NewApiRootUrl + 'goods/sku',  //获取sku信息
-    GoodsCount: NewApiRootUrl + 'goods/count',  //统计商品总数
-    GoodsList: NewApiRootUrl + 'goods/list',  //获得商品列表
-    GoodsCategory: NewApiRootUrl + 'goods/category',  //获得分类数据
-    GoodsCategoryBrand: NewApiRootUrl + 'goods/brand',  //获得分类品牌数据
-    GoodsDetail: NewApiRootUrl + 'goods/details',  //获得商品的详情
-    GoodsHot: NewApiRootUrl + 'goods/hot',  //热门
-    GoodsRelated: NewApiRootUrl + 'goods/related',  //商品详情页的关联商品(大家都在看)
-    GoodsCrashList: NewApiRootUrl + 'goodscrash/list',  //搭配减价
-    GoodsTransferCoupon: NewApiRootUrl + 'goods/transferCoupon',  //转发获取优惠券
-    GoodsGallery: NewApiRootUrl + 'goods/goodsGallery',  //商品画廊
-
-    HotGoodsList: NewApiRootUrl + 'goods/hotGoodsList',  //疯狂折扣商品列表
-
-    BrandList: NewApiRootUrl + 'brand/list',  //品牌列表
-    BrandDetail: NewApiRootUrl + 'brand/detail',  //品牌详情
-
-    CartList: NewApiRootUrl + 'cart/indexs', //获取购物车的数据
-    CartAdd: NewApiRootUrl + 'cart/add', // 添加商品到购物车
-    CartAddByOrder: NewApiRootUrl + 'cart/addByOrder', // 根据订单id添加商品到购物车
-    CartMinus: NewApiRootUrl + 'cart/minus', // 删除购物车
-    CartUpdate: NewApiRootUrl + 'cart/update', // 更新购物车的商品
-    CartDelete: NewApiRootUrl + 'cart/delete', // 删除购物车的商品
-    CartChecked: NewApiRootUrl + 'cart/checked', // 选择或取消选择商品
-    CartGoodsCount: NewApiRootUrl + 'cart/goodscounts', // 获取购物车商品件数
-    CartCheckout: NewApiRootUrl + 'cart/checkout', // 下单前信息确认
-    CartCouponList: NewApiRootUrl + 'cart/checkedCouponList', // 选择用户可用优惠券
-    GetFootCart: NewApiRootUrl + 'cart/getFootCart', // 底部购物车显示
-    deleteValidCart: NewApiRootUrl + 'cart/deleteValidCart', //清空购物车失效商品
-
-    OrderSubmit: NewApiRootUrl + 'order/submit', // 提交订单
-    PayPrepayId: NewApiRootUrl + 'pay/pay_prepay', //获取微信统一下单prepay_id
-    Payorder: NewApiRootUrl + 'pay/pingan/payorder', //获取平安支付
-    MpconfigQuery: NewApiRootUrl + 'pay/pingan/mpconfig/setKey', //获取平安支付配置
-    refund: NewApiRootUrl + 'pay/refund', //订单申请退款
-  
-    CheckStore: NewApiRootUrl + 'address/checkStore', //下单前,门店校验
-
-    CollectList: NewApiRootUrl + 'collect/list',  //收藏列表
-    CollectAddOrDelete: NewApiRootUrl + 'collect/addordelete',  //添加或取消收藏
-
-    CommentList: NewApiRootUrl + 'comment/list',  //评论列表
-    CommentCount: NewApiRootUrl + 'comment/count',  //评论总数
-    CommentPost: NewApiRootUrl + 'comment/post',   //发表评论
-
-    TopicList: NewApiRootUrl + 'topic/list',  //专题列表
-    TopicDetail: NewApiRootUrl + 'topic/detail',  //专题详情
-    TopicRelated: NewApiRootUrl + 'topic/related',  //相关专题
-
-    SearchIndex: NewApiRootUrl + 'search/index',  //搜索页面数据
-    SearchResult: NewApiRootUrl + 'search/result',  //搜索数据
-    SearchHelper: NewApiRootUrl + 'search/helper',  //搜索帮助
-    SearchClearHistory: NewApiRootUrl + 'search/clearhistory',  //搜索帮助
-
-    AddressList: NewApiRootUrl + 'address/list',  //收货地址列表
-    AddressDetail: NewApiRootUrl + 'address/detail',  //收货地址详情
-    AddressSave: NewApiRootUrl + 'address/save',  //保存收货地址
-    AddressDelete: NewApiRootUrl + 'address/delete',  //保存收货地址
-    AddressSync: NewApiRootUrl + 'address/syncAddress',  //同步小程序地址
-
-    FeedbackSave: NewApiRootUrl + 'feedback/save',//反馈
-    RegionIdsByNames: NewApiRootUrl + 'region/regionIdsByNames',  //地市名翻译
-    RegionList: NewApiRootUrl + 'region/list',  //获取区域列表
-
-    OrderList: NewApiRootUrl + 'order/list',  //订单列表
-    OrderDetail: NewApiRootUrl + 'order/detail',  //订单详情
-    OrderDetailList: NewApiRootUrl + 'order/detailList',  //多条订单详情
-    OrderCancel: NewApiRootUrl + 'order/cancelOrder',  //取消订单
-    OrderConfirm: NewApiRootUrl + 'order/confirmOrder',  //确认收货
-
-    FootprintList: NewApiRootUrl + 'footprint/list',  //足迹列表
-    FootprintDelete: NewApiRootUrl + 'footprint/delete', //删除足迹
-    ShareList: NewApiRootUrl + 'footprint/sharelist', //
-
-    footbackSave: NewApiRootUrl + 'footprint/delete',  //会员反馈
-
-    GuessFootprintList: NewApiRootUrl + 'footprint/glist',  //足迹列表
-
-    EnableActivity: NewApiRootUrl + 'coupon/enableActivity', //获取活动弹出框
-    newUserCoupn: NewApiRootUrl + 'coupon/newuser',  //新用户领取券
-    CouponList: NewApiRootUrl + 'coupon/list',  //个人优惠券列表
-    CouponExchange: NewApiRootUrl + 'coupon/exchange',  //兑换优惠券
-    CouponTransActivit: NewApiRootUrl + 'coupon/transActivit',  //转发优惠券
-    checkActivit: NewApiRootUrl + 'coupon/checkActivit',  //校验是否领取优惠券
-    getUserCoupon: NewApiRootUrl + 'coupon/getUserCoupon',  //用户领取优惠券
-
-    smscodeSend: NewApiRootUrl + 'user/smscode',  //发送短信
-
-    GroupList: NewApiRootUrl + 'group/list',  //团购列表
-    GroupDetail: NewApiRootUrl + 'group/info',  //团购详情
-    GroupOpenList: NewApiRootUrl + 'groupopen/list',  //拼团列表
-    GroupOpenMyList: NewApiRootUrl + 'groupopen/myList',  //我的拼团列表
-    GroupCheckInfo: NewApiRootUrl + 'groupopen/groupcheck',  //拼团订单check
-
-    OpenGroup: NewApiRootUrl + 'groupopen/openGroup',  //单独拼团
-    OpenInfo: NewApiRootUrl + 'groupopen/info',  //开团详情
-    AttendGroup: NewApiRootUrl + 'groupopen/attendGroup',  //参与拼团
-    AttendList: NewApiRootUrl + 'groupopen/attendList',  //参与拼团的人
-    GroupOpenDetail: NewApiRootUrl + 'groupopen/groupOpenDetail',  //根据开团明细查询开团详情
-
-    HelpTypeList: NewApiRootUrl + 'helpissue/typeList',  //查看帮助类型列表
-    HelpIssueList: NewApiRootUrl + 'helpissue/issueList',  //查看问题列表
-
-    UploadFileURL: NewApiRootUrl + 'upload/upload',  //图片上传
-    getCurUser: NewApiRootUrl + 'user/getCurUser',  //获取当前登录人信息
-
-    UcenterIndex: NewApiRootUrl + 'index/ucenterIndex',  //个人中心首页
-
-  GetLogistics: NewApiRootUrl + 'order/getLogistics',  //查询物流信息
-  getCheckedDataByType: NewApiRootUrl + 'cart/getCheckedDataByType',  //校验该业务类型的购物车数据
+  // tab
+  IndexUrl: NewApiRootUrl + 'index/index', //首页数据接口
+  CatalogList: NewApiRootUrl + 'catalog/index', //分类目录全部分类数据接口
+  CatalogCurrent: NewApiRootUrl + 'catalog/current', //分类目录当前分类数据接口
+  CatalogProductList: NewApiRootUrl + 'goods/productlist', //分类目录当前产品
+  // 权限
+  AuthLoginByWeixin: NewApiRootUrl + 'auth/login_by_weixin', //微信登录
+  ChooseStoreId: NewApiRootUrl + 'auth/chooseStoreId', //选择门店Id
+  NearbyList: NewApiRootUrl + 'auth/nearbyLists', //根据经纬度获取配送范围内的门店
+  StoreByCity: NewApiRootUrl + 'auth/storeListByCity', //获取地市的门店
+  ActivityList: NewApiRootUrl + 'activity/list', //活动列表
+
+  GoodsSku: NewApiRootUrl + 'goods/sku', //获取sku信息
+  GoodsCount: NewApiRootUrl + 'goods/count', //统计商品总数
+  GoodsList: NewApiRootUrl + 'goods/list', //获得商品列表
+  GoodsCategory: NewApiRootUrl + 'goods/category', //获得分类数据
+  GoodsCategoryBrand: NewApiRootUrl + 'goods/brand', //获得分类品牌数据
+  GoodsDetail: NewApiRootUrl + 'goods/details', //获得商品的详情
+  GoodsHot: NewApiRootUrl + 'goods/hot', //热门
+  GoodsRelated: NewApiRootUrl + 'goods/related', //商品详情页的关联商品(大家都在看)
+  GoodsCrashList: NewApiRootUrl + 'goodscrash/list', //搭配减价
+  GoodsTransferCoupon: NewApiRootUrl + 'goods/transferCoupon', //转发获取优惠券
+  GoodsGallery: NewApiRootUrl + 'goods/goodsGallery', //商品画廊
+
+  HotGoodsList: NewApiRootUrl + 'goods/hotGoodsList', //疯狂折扣商品列表
+
+  BrandList: NewApiRootUrl + 'brand/list', //品牌列表
+  BrandDetail: NewApiRootUrl + 'brand/detail', //品牌详情
+
+  CartList: NewApiRootUrl + 'cart/indexs', //获取购物车的数据
+  CartAdd: NewApiRootUrl + 'cart/add', // 添加商品到购物车
+  CartAddByOrder: NewApiRootUrl + 'cart/addByOrder', // 根据订单id添加商品到购物车
+  CartMinus: NewApiRootUrl + 'cart/minus', // 删除购物车
+  CartUpdate: NewApiRootUrl + 'cart/update', // 更新购物车的商品
+  CartDelete: NewApiRootUrl + 'cart/delete', // 删除购物车的商品
+  CartChecked: NewApiRootUrl + 'cart/checked', // 选择或取消选择商品
+  CartGoodsCount: NewApiRootUrl + 'cart/goodscounts', // 获取购物车商品件数
+  CartCheckout: NewApiRootUrl + 'cart/checkouts', // 下单前信息确认
+  CartCouponList: NewApiRootUrl + 'cart/checkedCouponList', // 选择用户可用优惠券
+  GetFootCart: NewApiRootUrl + 'cart/getFootCart', // 底部购物车显示
+  deleteValidCart: NewApiRootUrl + 'cart/deleteValidCart', //清空购物车失效商品
+
+  OrderSubmit: NewApiRootUrl + 'order/submit', // 提交订单
+  PayPrepayId: NewApiRootUrl + 'pay/pay_prepay', //获取微信统一下单prepay_id
+  Payorder: NewApiRootUrl + 'pay/pingan/payorder', //获取平安支付
+  MpconfigQuery: NewApiRootUrl + 'pay/pingan/mpconfig/setKey', //获取平安支付配置
+  refund: NewApiRootUrl + 'pay/refund', //订单申请退款
+
+  CheckStore: NewApiRootUrl + 'address/checkStore', //下单前,门店校验
+
+  CollectList: NewApiRootUrl + 'collect/list', //收藏列表
+  CollectAddOrDelete: NewApiRootUrl + 'collect/addordelete', //添加或取消收藏
+
+  CommentList: NewApiRootUrl + 'comment/list', //评论列表
+  CommentCount: NewApiRootUrl + 'comment/count', //评论总数
+  CommentPost: NewApiRootUrl + 'comment/post', //发表评论
+
+  TopicList: NewApiRootUrl + 'topic/list', //专题列表
+  TopicDetail: NewApiRootUrl + 'topic/detail', //专题详情
+  TopicRelated: NewApiRootUrl + 'topic/related', //相关专题
+
+  SearchIndex: NewApiRootUrl + 'search/index', //搜索页面数据
+  SearchResult: NewApiRootUrl + 'search/result', //搜索数据
+  SearchHelper: NewApiRootUrl + 'search/helper', //搜索帮助
+  SearchClearHistory: NewApiRootUrl + 'search/clearhistory', //搜索帮助
+
+  AddressList: NewApiRootUrl + 'address/list', //收货地址列表
+  AddressDetail: NewApiRootUrl + 'address/detail', //收货地址详情
+  AddressSave: NewApiRootUrl + 'address/save', //保存收货地址
+  AddressDelete: NewApiRootUrl + 'address/delete', //保存收货地址
+  AddressSync: NewApiRootUrl + 'address/syncAddress', //同步小程序地址
+
+  FeedbackSave: NewApiRootUrl + 'feedback/save', //反馈
+  RegionIdsByNames: NewApiRootUrl + 'region/regionIdsByNames', //地市名翻译
+  RegionList: NewApiRootUrl + 'region/list', //获取区域列表
+
+  OrderList: NewApiRootUrl + 'order/list', //订单列表
+  OrderDetail: NewApiRootUrl + 'order/detail', //订单详情
+  OrderDetailList: NewApiRootUrl + 'order/detailList', //多条订单详情
+  OrderCancel: NewApiRootUrl + 'order/cancelOrder', //取消订单
+  OrderConfirm: NewApiRootUrl + 'order/confirmOrder', //确认收货
+
+  FootprintList: NewApiRootUrl + 'footprint/list', //足迹列表
+  FootprintDelete: NewApiRootUrl + 'footprint/delete', //删除足迹
+  ShareList: NewApiRootUrl + 'footprint/sharelist', //
+
+  footbackSave: NewApiRootUrl + 'footprint/delete', //会员反馈
+
+  GuessFootprintList: NewApiRootUrl + 'footprint/glist', //足迹列表
+
+  EnableActivity: NewApiRootUrl + 'coupon/enableActivity', //获取活动弹出框
+  newUserCoupn: NewApiRootUrl + 'coupon/newuser', //新用户领取券
+  CouponList: NewApiRootUrl + 'coupon/list', //个人优惠券列表
+  CouponExchange: NewApiRootUrl + 'coupon/exchange', //兑换优惠券
+  CouponTransActivit: NewApiRootUrl + 'coupon/transActivit', //转发优惠券
+  checkActivit: NewApiRootUrl + 'coupon/checkActivit', //校验是否领取优惠券
+  getUserCoupon: NewApiRootUrl + 'coupon/getUserCoupon', //用户领取优惠券
+
+  smscodeSend: NewApiRootUrl + 'user/smscode', //发送短信
+
+  GroupList: NewApiRootUrl + 'group/list', //团购列表
+  GroupDetail: NewApiRootUrl + 'group/info', //团购详情
+  GroupOpenList: NewApiRootUrl + 'groupopen/list', //拼团列表
+  GroupOpenMyList: NewApiRootUrl + 'groupopen/myList', //我的拼团列表
+  GroupCheckInfo: NewApiRootUrl + 'groupopen/groupcheck', //拼团订单check
+
+  OpenGroup: NewApiRootUrl + 'groupopen/openGroup', //单独拼团
+  OpenInfo: NewApiRootUrl + 'groupopen/info', //开团详情
+  AttendGroup: NewApiRootUrl + 'groupopen/attendGroup', //参与拼团
+  AttendList: NewApiRootUrl + 'groupopen/attendList', //参与拼团的人
+  GroupOpenDetail: NewApiRootUrl + 'groupopen/groupOpenDetail', //根据开团明细查询开团详情
+
+  HelpTypeList: NewApiRootUrl + 'helpissue/typeList', //查看帮助类型列表
+  HelpIssueList: NewApiRootUrl + 'helpissue/issueList', //查看问题列表
+
+  UploadFileURL: NewApiRootUrl + 'upload/upload', //图片上传
+  getCurUser: NewApiRootUrl + 'user/getCurUser', //获取当前登录人信息
+
+  UcenterIndex: NewApiRootUrl + 'index/ucenterIndex', //个人中心首页
+
+  GetLogistics: NewApiRootUrl + 'order/getLogistics', //查询物流信息
+  getCheckedDataByType: NewApiRootUrl + 'cart/getCheckedDataByType', //校验该业务类型的购物车数据
   idCardRealName: NewApiRootUrl + 'index/idCardRealName', //身份证实名
   saveApplyRefund: NewApiRootUrl + 'order/saveApplyRefund', //申请维权
   updateLoginUser: NewApiRootUrl + 'auth/updateLoginUser',
   GlobalPayorder: NewApiRootUrl + '/global/pay/pay_prepay',
   GoodsSaveTransNum: NewApiRootUrl + '/goods/goodsSaveTransNum',
-  TicketDiscountList: NewApiRootUrl + '/mkstoreticketdiscount/list',  //门店优惠券列表 
-  StoreTicketDiscountGoodsList: NewApiRootUrl + '/goods/getStoreTicketDiscountGoodsList',  //门店优惠券商品列表 
-  DiscountByGoodsIdList: NewApiRootUrl + '/mkstoreticketdiscount/getDiscountByGoodsIdList',  //门店优惠券列表 
-  DiscountByCheckCartList: NewApiRootUrl + '/mkstoreticketdiscount/getDiscountByCheckCartList',//查看当前用户已领取的且订单商品所支持的优惠券列表
-  DiscountDetail: NewApiRootUrl + '/mkstoreticketdiscount/detail',//优惠券详情
+  TicketDiscountList: NewApiRootUrl + '/mkstoreticketdiscount/list', //门店优惠券列表 
+  StoreTicketDiscountGoodsList: NewApiRootUrl + '/goods/getStoreTicketDiscountGoodsList', //门店优惠券商品列表 
+  DiscountByGoodsIdList: NewApiRootUrl + '/mkstoreticketdiscount/getDiscountByGoodsIdList', //门店优惠券列表 
+  DiscountByCheckCartList: NewApiRootUrl + '/mkstoreticketdiscount/getDiscountByCheckCartList', //查看当前用户已领取的且订单商品所支持的优惠券列表
+  DiscountDetail: NewApiRootUrl + '/mkstoreticketdiscount/detail', //优惠券详情
+  CampminusDetail: NewApiRootUrl + '/campminus/detail', //满减满折详情
+  StoreCampMinusByGoodsIdList: NewApiRootUrl + '/campminus/getStoreCampMinusByGoodsIdList', //详情页查询该商品可支持的满减满折信息
+  CampminusByCheckCartList: NewApiRootUrl + '/campminus/getCampminusByCheckCartList', //确认订单页,查看订单商品所支持的满减满折列表
+  StoreCampMinusGoodsList: NewApiRootUrl + '/goods/getStoreCampMinusGoodsList', //门店优惠券商品列表 
 };

+ 1 - 11
wx-mall/pages/cart/cart.js

@@ -626,22 +626,12 @@ Page({
       goodsId: goodsId
     }).then(function(res) {
       if (res.errno === 0 && null != res.data) {
-        let stockNumbers = 0;
-        if (res.data.goodsVo.goodsBizType=='00') {
-          if (res.data.goodsVo.isStockShare == 1) {
-            stockNumbers = res.data.goodsVo.goods_number;
-          } else {
-            stockNumbers = res.data.goodsVo.stockNum;
-          }
-        } else {
-          stockNumbers = res.data.goodsVo.stockNum;
-        }
         that.setData({
           goodsVo: res.data.goodsVo,
           specificationList: res.data.specificationList,
           productList: res.data.productList,
           openAttr: !that.data.openAttr,
-          stockNum: stockNumbers,
+          stockNum: res.data.stockNum,
           cartNumber: res.data.cartNumber,
           checkedSpecText: res.data.specificationList[0].valueList[0].value,
           openTicketAttr: false

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

@@ -280,7 +280,7 @@
           <view class="c">
             <view class="p">价格:¥{{goodsVo.retail_price}}</view>
             <view class="a" wx:if="{{productList.length>0}}">已选择:{{checkedSpecText}}</view>
-            <view class="a">库存{{goodsVo.goodsBizType==00 && goodsVo.isStockShare==1?goodsVo.goods_number:goodsVo.stockNum}}件</view>
+            <view class="a">库存{{stockNum}}件</view>
           </view>
         </view>
       </view>

+ 1 - 1
wx-mall/pages/cart/cart.wxss

@@ -428,7 +428,7 @@ page {
 
 .a-guess .h .txt {
   padding-right: 30rpx;
-  background: url("http://120.76.26.84:80/group1/M00/00/02/rBJEdVvr2W6ATlkvAAAA_rntq4s180.png") right 4rpx no-repeat;
+  /* background: url("http://120.76.26.84:80/group1/M00/00/02/rBJEdVvr2W6ATlkvAAAA_rntq4s180.png") right 4rpx no-repeat; */
   background-size: 16.656rpx 27rpx;
   display: inline-block;
   height: 36rpx;

+ 8 - 2
wx-mall/pages/catalog/catalog.js

@@ -66,8 +66,12 @@ Page({
     })
     //CatalogList
     let that = this;
-    util.request(api.CatalogList).then(function (res) {
+    util.request(api.CatalogList,{
+      storeId: wx.getStorageSync('storeId')
+    }).then(function (res) {
       if (!wx.getStorageSync('currentCategory')) {
+        console.log(res.data.currentCategory);
+        console.log(res.data.categoryList);
         that.setData({
           navList: res.data.categoryList,
           currentCategory: res.data.currentCategory,
@@ -88,6 +92,8 @@ Page({
             currentCategory: res.data.currentCategory,
             brandList: res.data.brandList
           });
+          console.log(res.data.currentCategory);
+          console.log(res.data.currentCategory.id);
         }
       }
 
@@ -223,7 +229,7 @@ Page({
     //   title: '加载中...',
     // });
     var that = this;
-    if (that.data.currentCategory){
+    if (that.data.currentCategory.id > 0){
       util.request(api.CatalogProductList, {
         page: that.data.page,
         size: that.data.size,

+ 1 - 11
wx-mall/pages/category/category.js

@@ -208,21 +208,11 @@ Page({
       var goodsId = e.currentTarget.dataset.goodsId;
       util.request(api.GoodsSku, { goodsId: goodsId }).then(function (res) {
         if (res.errno === 0 && null != res.data) {
-          let stockNumbers = 0;
-          if (res.data.goodsVo.goodsBizType == '00') {
-            if (res.data.goodsVo.isStockShare == 1) {
-              stockNumbers = res.data.goodsVo.goods_number;
-            } else {
-              stockNumbers = res.data.goodsVo.stockNum;
-            }
-          } else {
-            stockNumbers = res.data.goodsVo.stockNum;
-          }
           that.setData({
             goodsVo: res.data.goodsVo,
             specificationList: res.data.specificationList,
             productList: res.data.productList,
-            stockNum: stockNumbers,
+            stockNum: res.data.stockNum,
             openAttr: !that.data.openAttr,
             cartNumber: res.data.cartNumber,
             checkedSpecText: res.data.specificationList[0].valueList[0].value

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

@@ -110,7 +110,7 @@
               <view class="c">
                 <view class="p">价格:¥{{goodsVo.retail_price}}</view>
                 <view class="a" wx:if="{{productList.length>0}}">已选择:{{checkedSpecText}}</view>
-                <view class="a">库存{{goodsVo.goodsBizType==00 && goodsVo.isStockShare==1?goodsVo.goods_number:goodsVo.stockNum}}件</view>
+                <view class="a">库存{{stockNum}}件</view>
               </view>
             </view>
           </view>

+ 116 - 12
wx-mall/pages/goods/goods.js

@@ -50,8 +50,12 @@ Page({
     merchSn: '',
     openTicketAttr: false,
     ticketDiscountList:[],
+    detailTicketDiscountList: [],
     discountSize: 9999,//查看全部
     discountDetailSize: 3,//详情查看部分
+    campDetailSize: 1,//详情查看部分
+    detailStoreCampMinusList: [],
+    storeCampMinusList:[]
   },
   toggleNav() {
     this.setData({
@@ -104,6 +108,8 @@ Page({
 
         that.getDetailTicketDiscountList();
 
+        that.getDetailStoreCampMinusList();
+
         if (res.data.userHasCollect == 1) {
           that.setData({
             'collectBackImage': that.data.hasCollectImage
@@ -202,6 +208,7 @@ Page({
     // options.scene = "1181115&20&1&26"; 
     // options.scene = "1181167&12&5&26"; 
     // options.scene = "1181133&12&6&26";
+    // options.scene = "1181133&12&&26";
     if (options.scene) {
       var scene = decodeURIComponent(options.scene);
       console.log("scene is ", scene);
@@ -346,13 +353,15 @@ Page({
   switchAttrPop: function () {
     this.setData({
       openAttr: !this.data.openAttr,
-      openTicketAttr: false
+      openTicketAttr: false,
+      openCampMinusAttr: false
     })
   },
   hideSwitchAttrPop: function() {
     this.setData({
       openAttr: false,
-      openTicketAttr: false
+      openTicketAttr: false,
+      openCampMinusAttr: false
     })
   },
   reLoad: function () {
@@ -432,7 +441,6 @@ Page({
         openAttr: !this.data.openAttr
       });
     } else {
-
       //提示选择完整规格
       if (!goodsUtil.isCheckedAllSpec(that)) {
         return false;
@@ -690,16 +698,19 @@ Page({
   switchTicketPop: function () {
     this.setData({
       openTicketAttr: !this.data.openTicketAttr,
-      openAttr: false
-    })
-    this.getTicketDiscountList();
-  },
-  hideSwitchTicketPop: function () {
-    this.setData({
-      openTicketAttr: false,
-      openAttr: false
+      openAttr: false,
+      openCampMinusAttr: false
     })
+    if (this.data.openTicketAttr) {
+      this.getTicketDiscountList();
+    }
   },
+  // hideSwitchTicketPop: function () {
+  //   this.setData({
+  //     openTicketAttr: false,
+  //     openAttr: false
+  //   })
+  // },
   /**
    * 领取优惠券
    */
@@ -762,5 +773,98 @@ Page({
         });
       }
     });
-  }, 
+  },
+  /**
+   * 查看满减满折列表
+   */
+  getStoreCampMinusList() {
+    let that = this;
+    util.request(api.StoreCampMinusByGoodsIdList, {
+      storeId: that.data.storeId,
+      goodsId: that.data.id,
+      size: that.data.discountSize
+    }).then(function (res) {
+      if (res.errno === 0) {
+        that.setData({
+          storeCampMinusList: res.data
+        });
+        let storeCampMinusList = that.data.storeCampMinusList
+        for (let i = 0; i < storeCampMinusList.length; i++){
+          if (storeCampMinusList[i].campMinusType == '00' && storeCampMinusList[i].minusMode == '00'){
+            that.setData({
+              minusList0000: true
+            });
+          }
+          if (storeCampMinusList[i].campMinusType == '01' && storeCampMinusList[i].minusMode == '00') {
+            that.setData({
+              minusList0100: true
+            });
+          }
+          if (storeCampMinusList[i].campMinusType == '00' && storeCampMinusList[i].minusMode == '10') {
+            that.setData({
+              minusList0010: true
+            });
+          }
+          if (storeCampMinusList[i].campMinusType == '01' && storeCampMinusList[i].minusMode == '10') {
+            that.setData({
+              minusList0110: true
+            });
+          }
+          if (storeCampMinusList[i].campMinusType == '10') {
+            that.setData({
+              minusList10: true
+            });
+          }
+          if (storeCampMinusList[i].campMinusType == '11') {
+            that.setData({
+              minusList11: true
+            });
+          }
+        }
+      }
+      }); 
+  },
+  /**
+   * 查看满减满折列表,详情页展示
+   */
+  getDetailStoreCampMinusList() {
+    let that = this;
+    util.request(api.StoreCampMinusByGoodsIdList, {
+      storeId: that.data.storeId,
+      goodsId: that.data.id,
+      size: that.data.campDetailSize
+    }).then(function (res) {
+      if (res.errno === 0) {
+        that.setData({
+          detailStoreCampMinusList: res.data
+        });
+      }
+    });
+  },
+  switchCampMinusPop: function () {
+    this.setData({
+      openCampMinusAttr: !this.data.openCampMinusAttr,
+      openTicketAttr: false,
+      openAttr: false
+    })
+    if (this.data.openCampMinusAttr) {
+      this.getStoreCampMinusList();
+    }
+  },
+  hideSwitchCampMinusPop: function () {
+    this.setData({
+      openCampMinusAttr: false,
+      openTicketAttr: false,
+      openAttr: false
+    })
+  },
+  selectCampMinus(event) {
+    var that = this;
+    let campId = event.currentTarget.dataset.campId;
+    let campName = event.currentTarget.dataset.campName;
+    
+    wx.navigateTo({
+      url: '../ucenter/campMinus/campMinus?campMinusId=' + campId + '&&storeId=' + that.data.storeId + '&&campName=' + campName + "&&isShare=1"
+    })
+  }
 })

+ 104 - 27
wx-mall/pages/goods/goods.wxml

@@ -135,6 +135,17 @@
       </view>
       <image class="i" src="../../static/images/address_right.png" background-size="cover"></image>
     </view>
+
+    <view class="section-nav section-attr" wx:if="{{detailStoreCampMinusList.length>0}}" bindtap="switchCampMinusPop" bindtouchstart='touchStart2' bindtouchend='touchEnd2'>
+      <view class="t">
+        <view style='float:left'>促销</view>
+        <view class='ticket-border' wx:for="{{detailStoreCampMinusList}}" wx:key="{{item.campMinusId}}">
+          <view class='ticket-text'>{{item.campName}}</view>
+        </view>
+      </view>
+      <image class="i" src="../../static/images/address_right.png" background-size="cover"></image>
+    </view>
+
     <view class="section-nav section-attr" bindtap="switchAttrPop" wx:if="{{stockNum >0}}" bindtouchstart='touchStart2' bindtouchend='touchEnd2'>
       <view class="t">{{checkedSpecText=="请选择规格数量"?"请选择规格数量":"已选:【"+checkedSpecText+"】"}}</view>
       <image class="i" src="../../static/images/address_right.png" background-size="cover"></image>
@@ -296,40 +307,106 @@
       </view>
     </view>
   </view>
-  <!-- 领券弹框start -->
-  <view wx:if="{{openTicketAttr}}" class="attr-pop">
-    <view class="attr-title">领取优惠券</view>
-    <view class="attr-close" bindtap="switchTicketPop">X</view>
-    <view class="ticket-img-info">
-      <!-- 查看门店优惠券列表 -->
-      <view style="margin: 16px 0px;" wx:for="{{ticketDiscountList}}" wx:key="{{item.tickDiscId}}" data-coupon-id="{{item.tickDiscId}}">
-        <view class="coupon-box {{item.isReceive==0?'coupon-box1':'coupon-box2'}} coupon-box-g">
-          <view class="coupon-bg {{item.isReceive==0?'coupon-bg1':'coupon-bg2'}}">
-            <view>
-              <text class="coupon-currency">¥</text>{{item.tickDiscType==00?item.voucherMoney:''}}{{item.tickDiscType==01?item.discRatio:''}}{{item.tickDiscType==02?item.exchCond:''}}</view>
-            <view class="coupon-type">{{item.tickDiscType==00?'满'+item.voucherCond+'可用':''}}{{item.tickDiscType==01?'满'+item.discCond+'可用':''}}{{item.tickDiscType==02?'满'+item.exchCond+'可用':''}}</view>
+</scroll-view>
+
+<!-- 领券弹框start -->
+<view wx:if="{{openTicketAttr}}" class="attr-pop2">
+  <view class="attr-title">领取优惠券</view>
+  <view class="attr-close" bindtap="switchTicketPop">X</view>
+  <view class="ticket-img-info">
+    <!-- 查看门店优惠券列表 -->
+    <view style="margin: 16px 0px;" wx:for="{{ticketDiscountList}}" wx:key="{{item.tickDiscId}}" data-coupon-id="{{item.tickDiscId}}">
+      <view class="coupon-box {{item.isReceive==0?'coupon-box1':'coupon-box2'}} coupon-box-g">
+        <view class="coupon-bg {{item.isReceive==0?'coupon-bg1':'coupon-bg2'}}">
+          <view>
+            <text class="coupon-currency">¥</text>{{item.tickDiscType==00?item.voucherMoney:''}}{{item.tickDiscType==01?item.discRatio:''}}{{item.tickDiscType==02?item.exchCond:''}}</view>
+          <view class="coupon-type">{{item.tickDiscType==00?'满'+item.voucherCond+'可用':''}}{{item.tickDiscType==01?'满'+item.discCond+'可用':''}}{{item.tickDiscType==02?'满'+item.exchCond+'可用':''}}</view>
+        </view>
+        <view class="coupon-info">
+          <view class="coupon-title">{{ item.name }}</view>
+          <view class="coupon-desc">
+            <view style="font-size: 26rpx;">{{ item.inValidTime }}</view>
           </view>
-          <view class="coupon-info">
-            <view class="coupon-title">{{ item.name }}</view>
-            <view class="coupon-desc">
-              <view style="font-size: 26rpx;">{{ item.inValidTime }}</view>
-            </view>
-            <view class="coupon-desc-shop">
-              <view style='font-size:24rpx;'>{{item.applyType==00?'全部商品可用':''}}{{item.applyType==01?'部分商品可用':''}}{{item.applyType==02?'部分商品可用':''}}{{item.goodsBizType==00?'-仅限保税仓商品':''}}{{item.goodsBizType==02?'-仅限补货商品':''}}{{item.goodsBizType==10?'-仅限现场速递商品':''}}{{item.goodsBizType==11?'-仅限普通商品':''}}</view>
-            </view>
+          <view class="coupon-desc-shop">
+            <view style='font-size:24rpx;'>{{item.applyType==00?'全部商品可用':''}}{{item.applyType==01?'部分商品可用':''}}{{item.applyType==02?'部分商品可用':''}}{{item.goodsBizType==00?'-仅限保税仓商品':''}}{{item.goodsBizType==02?'-仅限补货商品':''}}{{item.goodsBizType==10?'-仅限现场速递商品':''}}{{item.goodsBizType==11?'-仅限普通商品':''}}</view>
           </view>
-          <view class="{{item.isReceive==0?'coupon-info-use':'coupon-info-use2'}}" bindtap="{{item.isReceive==0?'getUserCoupon':''}}" data-coupon-Id="{{item.tickDiscId}}" data-store-Topic-Id="{{item.storeTopicId}}">
-            <view class="coupon-desc-use">
-              {{item.isReceive==0?'领取':'已领完'}}
-            </view>
+        </view>
+        <view class="{{item.isReceive==0?'coupon-info-use':'coupon-info-use2'}}" bindtap="{{item.isReceive==0?'getUserCoupon':''}}" data-coupon-Id="{{item.tickDiscId}}" data-store-Topic-Id="{{item.storeTopicId}}">
+          <view class="coupon-desc-use">
+            {{item.isReceive==0?'领取':'已领完'}}
           </view>
         </view>
       </view>
-      <!-- 查看门店优惠券列表end -->
     </view>
+    <!-- 查看门店优惠券列表end -->
   </view>
-  <!-- 领券弹框end -->
-</scroll-view>
+</view>
+<!-- 领券弹框end -->
+
+<!-- 促销弹框start -->
+<view wx:if="{{openCampMinusAttr}}" class="attr-pop2">
+  <view class="attr-title">优惠详情</view>
+  <view class="attr-close" bindtap="hideSwitchCampMinusPop">X</view>
+  <view class="ticket-img-info">
+    <!-- 查看门店满减满折列表 -->
+    <view style="margin: 16px 0px;" wx:if="{{minusList0000}}">
+      <view class='camp-title'>满元满减,且满足最高层级减一次</view>
+      <view style="margin: 10px 0px;" wx:for="{{storeCampMinusList}}" wx:if="{{item.campMinusType=='00'&&item.minusMode=='00'}}" wx:key="{{item.campMinusId}}" data-camp-id="{{item.campMinusId}}" data-camp-Name="{{item.campName}}" bindtap="selectCampMinus">
+        <view style='width:100%;height:50rpx;line-height:50rpx;'>
+          <view class='camp-name'>{{item.campName}}</view>
+          <view class='camp-url'>进入专题 ></view>
+        </view>
+      </view>
+    </view>
+    <view style="margin: 16px 0px;" wx:if="{{minusList0100}}">
+      <view class='camp-title'>满件满减,且满足最高层级减一次</view>
+      <view style="margin: 10px 0px;" wx:for="{{storeCampMinusList}}" wx:if="{{item.campMinusType=='01'&&item.minusMode=='00'}}" wx:key="{{item.campMinusId}}" data-camp-id="{{item.campMinusId}}" data-camp-Name="{{item.campName}}" bindtap="selectCampMinus">
+        <view style='width:100%;height:50rpx;line-height:50rpx;'>
+          <view class='camp-name'>{{item.campName}}</view>
+          <view class='camp-url'>进入专题 ></view>
+        </view>
+      </view>
+    </view>
+    <view style="margin: 16px 0px;" wx:if="{{minusList0010}}">
+      <view class='camp-title'>满元满减,且满足每满一次减一次</view>
+      <view style="margin: 10px 0px;" wx:for="{{storeCampMinusList}}" wx:if="{{item.campMinusType=='00'&&item.minusMode=='10'}}" wx:key="{{item.campMinusId}}" data-camp-id="{{item.campMinusId}}" data-camp-Name="{{item.campName}}" bindtap="selectCampMinus">
+        <view style='width:100%;height:50rpx;line-height:50rpx;'>
+          <view class='camp-name'>{{item.campName}}</view>
+          <view class='camp-url'>进入专题 ></view>
+        </view>
+      </view>
+    </view>
+    <view style="margin: 16px 0px;" wx:if="{{minusList0110}}">
+      <view class='camp-title'>满件满减,且满足每满一次减一次</view>
+      <view style="margin: 10px 0px;" wx:for="{{storeCampMinusList}}" wx:if="{{item.campMinusType=='01'&&item.minusMode=='10'}}" wx:key="{{item.campMinusId}}" data-camp-id="{{item.campMinusId}}" data-camp-Name="{{item.campName}}" bindtap="selectCampMinus">
+        <view style='width:100%;height:50rpx;line-height:50rpx;'>
+          <view class='camp-name'>{{item.campName}}</view>
+          <view class='camp-url'>进入专题 ></view>
+        </view>
+      </view>
+    </view>
+    <view style="margin: 16px 0px;" wx:if="{{minusList10}}">
+      <view class='camp-title'>满元满折</view>
+      <view style="margin: 10px 0px;" wx:for="{{storeCampMinusList}}" wx:if="{{item.campMinusType=='10'}}" wx:key="{{item.campMinusId}}" data-camp-id="{{item.campMinusId}}" data-camp-Name="{{item.campName}}" bindtap="selectCampMinus">
+        <view style='width:100%;height:50rpx;line-height:50rpx;'>
+          <view class='camp-name'>{{item.campName}}</view>
+          <view class='camp-url'>进入专题 ></view>
+        </view>
+      </view>
+    </view>
+    <view style="margin: 16px 0px;" wx:if="{{minusList11}}">
+      <view class='camp-title'>满件满折</view>
+      <view style="margin: 10px 0px;" wx:for="{{storeCampMinusList}}" wx:if="{{item.campMinusType=='11'}}" wx:key="{{item.campMinusId}}" data-camp-id="{{item.campMinusId}}" data-camp-Name="{{item.campName}}" bindtap="selectCampMinus">
+        <view style='width:100%;height:50rpx;line-height:50rpx;'>
+          <view class='camp-name'>{{item.campName}}</view>
+          <view class='camp-url'>进入专题 ></view>
+        </view>
+      </view>
+    </view>
+    <!-- 查看门店满减满折列表end -->
+  </view>
+</view>
+<!-- 促销弹框end -->
 <view class='shelves-view' wx:if="{{stockNum ==0 || goods.is_on_sale == 0}}">
   <view class="shelves">
     <text class='shelves-text'>已下架</text>

+ 23 - 0
wx-mall/pages/goods/goods.wxss

@@ -869,6 +869,15 @@
   bottom: 100rpx;
   z-index: 500;
 }
+.attr-pop2 {
+  width: 100%;
+  height: auto;
+  padding: 31.25rpx;
+  background: #fff;
+  position: fixed;
+  bottom: 1rpx;
+  z-index: 500;
+}
 
 .attr-close{
   float: right;
@@ -1284,4 +1293,18 @@
   font-size: 30rpx;
   color: white;
   margin-top:50rpx;
+}
+.camp-title{
+  color: #b4282d;
+  font-size: 28rpx;
+}
+.camp-name{
+  float: left;
+  font-size: 25rpx;
+  color: rgb(82, 81, 81);
+}
+.camp-url{
+  float: right;
+  font-size: 25rpx;
+  color: rgb(151, 150, 150);
 }

+ 1 - 11
wx-mall/pages/hotGoods/hotGoods.js

@@ -181,23 +181,13 @@ Page({
       goodsId: goodsId
     }).then(function (res) {
       if (res.errno === 0 && null != res.data) {
-        let stockNumbers = 0;
-        if (res.data.goodsVo.goodsBizType == '00') {
-          if (res.data.goodsVo.isStockShare == 1) {
-            stockNumbers = res.data.goodsVo.goods_number;
-          } else {
-            stockNumbers = res.data.goodsVo.stockNum;
-          }
-        } else {
-          stockNumbers = res.data.goodsVo.stockNum;
-        }
         that.setData({
           goodsVo: res.data.goodsVo,
           specificationList: res.data.specificationList,
           productList: res.data.productList,
           openAttr: !that.data.openAttr,
           retailPrice: retailPrice,
-          stockNum: stockNumbers,
+          stockNum: res.data.stockNum,
           cartNumber: res.data.cartNumber,
           checkedSpecText: res.data.specificationList[0].valueList[0].value
         });

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

@@ -102,7 +102,7 @@
         <view class="c">
           <view class="p">价格:¥{{retailPrice}}</view>
           <view class="a" wx:if="{{productList.length>0}}">已选择:{{checkedSpecText}}</view>
-          <view class="a">库存{{goodsVo.goodsBizType==00 && goodsVo.isStockShare==1?goodsVo.goods_number:goodsVo.stockNum}}件</view>
+          <view class="a">库存{{stockNum}}件</view>
         </view>
       </view>
     </view>

+ 13 - 17
wx-mall/pages/index/index.js

@@ -73,18 +73,19 @@ Page({
           that.getGoodsList();
         }
         console.log("isShare:" + wx.getStorageSync('isShare'))
-        if (wx.getStorageSync('storeId') != wx.getStorageSync('mapIndexStoreId') || wx.getStorageSync('isShare')){
+        if (wx.getStorageSync('storeId') != wx.getStorageSync('mapIndexStoreId') || wx.getStorageSync('isShare')=='true'){
           that.setData({
             hotGoods: [],
             page: 1
           });
           that.getGoodsList();
+          wx.setStorageSync('isShare', 'false');
         }
       }
       wx.hideLoading();
     });
   },
-  getGoodsList: function(){
+  getGoodsList: function () {
     let that = this;
     util.request(api.GoodsHot).then(function (res) {
       if (res.errno == 0) {
@@ -115,7 +116,9 @@ Page({
   onLoad: function (options) {
     let that = this;
     wx.setStorageSync("navUrl", "/pages/index/index");
-    // options.scene = 10;
+    // options.scene = 65;
+    // options.scene = 28;
+    // options.scene = 8;
     if (options.scene) {
       console.log("have scene");
       var scene = decodeURIComponent(options.scene);
@@ -432,7 +435,7 @@ Page({
           }
           util.request(api.GoodsDetail, { id: goodId,storeId:storeId, referrer: '' }).then(function (res) {
             if (res.errno === 0) {
-              console.log(res);
+              // console.log(res);
               // 跳转页面
               setTimeout(function () {
                 wx.navigateTo({
@@ -510,23 +513,13 @@ Page({
       goodsId: goodsId
     }).then(function (res) {
       if (res.errno === 0 && null != res.data) {
-        let stockNumbers = 0;
-        if (res.data.goodsVo.goodsBizType == '00') {
-          if (res.data.goodsVo.isStockShare == 1) {
-            stockNumbers = res.data.goodsVo.goods_number;
-          } else {
-            stockNumbers = res.data.goodsVo.stockNum;
-          }
-        } else {
-          stockNumbers = res.data.goodsVo.stockNum;
-        }
         that.setData({
           goodsVo: res.data.goodsVo,
           specificationList: res.data.specificationList,
           productList: res.data.productList,
           openAttr: !that.data.openAttr,
           retailPrice: retailPrice,
-          stockNum: stockNumbers,
+          stockNum: res.data.stockNum,
           cartNumber: res.data.cartNumber,
           checkedSpecText: res.data.specificationList[0].valueList[0].value
         });
@@ -547,8 +540,11 @@ Page({
   },
 
   shows: function (e) {
-    wx.redirectTo({
-      url: '/pages/images/images'
+    // wx.redirectTo({
+    //   url: '/pages/images/images'
+    // })
+    wx.navigateTo({
+      url: '../ucenter/campMinus/campMinus?campMinusId=' + 9 + '&&storeId=' + 8 + '&&campName=' + '满200减50' + "&&isShare=1"
     })
   },
   onReachBottom() {

+ 4 - 0
wx-mall/pages/index/index.wxml

@@ -60,6 +60,10 @@
     </navigator>
     <!-- <navigator class="itemb" bindtap="shows">
       <image src="../../static/images/service-smgw.png" background-size="cover"></image>
+      <text>满减满折</text>
+    </navigator> -->
+    <!-- <navigator class="itemb" bindtap="shows">
+      <image src="../../static/images/service-smgw.png" background-size="cover"></image>
       <text>图片</text>
     </navigator> -->
 

+ 328 - 98
wx-mall/pages/shopping/checkout/checkout.js

@@ -35,7 +35,7 @@ Page({
     goodsTotalPrice00: 0,
     goodsTotalPrice02: 0,
     goodsTotalPrice10: 0,
-    goodsTotalPrice11:0,
+    goodsTotalPrice11: 0,
     postscript: "",
     postscript00: '', //备货业务备注
     postscript02: '', //补货业务备注
@@ -63,6 +63,21 @@ Page({
     actualPrice02: 0.00,
     actualPrice10: 0.00,
     actualPrice11: 0.00,
+    campId00: 0,
+    campId02: 0,
+    campId10: 0,
+    campId11: 0,
+    campList00: '',
+    campList02: '',
+    campList10: '',
+    campList11: '',
+    campMinusDto00: '',
+    campMinusDto02: '',
+    campMinusDto10: '',
+    campMinusDto11: '',
+    checkCampId: 0,
+    storeCampMinusList: [],
+    openCampMinusAttr: false
   },
   bindMultiPickerColumnChange: function(e) {
     let that = this;
@@ -87,13 +102,13 @@ Page({
   },
   bindMultiPickerChange: function(e) {
     let that = this;
-    console.log('picker发送选择改变,携带值为', e.detail.value)
+    // console.log('picker发送选择改变,携带值为', e.detail.value)
     this.setData({
       multiIndex: e.detail.value,
       delivery_date: dateArray[e.detail.value[0]],
       delivery_remark: e.detail.value[0] == 0 ? that.data.timeArray[e.detail.value[1]] : that.data.timeArray[e.detail.value[1]]
     })
-    console.log('delivery_date', this.data.delivery_date, ',delivery_remark', this.data.delivery_remark)
+    // console.log('delivery_date', this.data.delivery_date, ',delivery_remark', this.data.delivery_remark)
   },
   initPicker() {
     let that = this;
@@ -123,9 +138,14 @@ Page({
       tickDiscId02: that.data.tickDiscId02,
       tickDiscId10: that.data.tickDiscId10,
       tickDiscId11: that.data.tickDiscId11,
+      campId00: that.data.campId00,
+      campId02: that.data.campId02,
+      campId10: that.data.campId10,
+      campId11: that.data.campId11,
       merchSn: wx.getStorageSync('merchSn'),
-      checkCart: that.data.checkCart
-    }).then(function(res) {
+      checkCart: that.data.checkCart,
+      isLoadStatus: 0//是首次加载
+    }, 'POST').then(function (res) {
       if (res.errno === 0) {
         console.log(res.data);
         that.setData({
@@ -144,7 +164,8 @@ Page({
           couponList02: res.data.couponList02,
           couponList10: res.data.couponList10,
           couponList11: res.data.couponList11,
-          fullCutCouponId: res.data.fullCutCouponId,
+          // fullCutCouponId: res.data.fullCutCouponId,
+          //   fullCutCouponDec: res.data.fullCutCouponDec,
           couponPrice: res.data.couponPrice,
           freightPrice00: res.data.freightPrice00,
           freightPrice02: res.data.freightPrice02,
@@ -152,9 +173,25 @@ Page({
           freightPrice11: res.data.freightPrice11,
           goodsTotalPrice: res.data.goodsTotalPrice,
           orderTotalPrice: res.data.orderTotalPrice,
-          fullCutCouponDec: res.data.fullCutCouponDec,
           userName: res.data.userName,
-          idNo: res.data.idNo
+          idNo: res.data.idNo,
+          campList00: res.data.campList00,
+          campList02: res.data.campList02,
+          campList10: res.data.campList10,
+          campList11: res.data.campList11,
+          campMinusDto00: res.data.campMinusDto00,
+          campMinusDto02: res.data.campMinusDto02,
+          campMinusDto10: res.data.campMinusDto10,
+          campMinusDto11: res.data.campMinusDto11,
+          campId00: res.data.campId00,
+          campId02: res.data.campId02,
+          campId10: res.data.campId10,
+          campId11: res.data.campId11,
+          tickDiscId00: res.data.tickDiscId00,
+          tickDiscId02: res.data.tickDiscId02,
+          tickDiscId10: res.data.tickDiscId10,
+          tickDiscId11: res.data.tickDiscId11,
+          isLoadStatus: 0
         });
         if (that.data.idNo) {
           that.setData({
@@ -211,48 +248,10 @@ Page({
         // console.log(that.data.goodsTotalByType02);
         // console.log(that.data.goodsTotalByType10);
         // console.log(that.data.goodsTotalByType11);
-
-        // 选择优惠券
-        if (that.data.tickDiscId00 && that.data.couponList00.length > 0) {
-          for (var i = 0; i < that.data.couponList00.length; i++) {
-            if (that.data.tickDiscId00 == that.data.couponList00[i].id) {
-              that.setData({
-                checkedCoupon00: that.data.couponList00[i]
-              });
-              break;
-            }
-          }
-        }
-        if (that.data.tickDiscId02 && that.data.couponList02.length > 0) {
-          for (var i = 0; i < that.data.couponList02.length; i++) {
-            if (that.data.tickDiscId02 == that.data.couponList02[i].id) {
-              that.setData({
-                checkedCoupon02: that.data.couponList02[i]
-              });
-              break;
-            }
-          }
-        }
-        if (that.data.tickDiscId10 && that.data.couponList10.length > 0) {
-          for (var i = 0; i < that.data.couponList10.length; i++) {
-            if (that.data.tickDiscId10 == that.data.couponList10[i].id) {
-              that.setData({
-                checkedCoupon10: that.data.couponList10[i]
-              });
-              break;
-            }
-          }
-        }
-        if (that.data.tickDiscId11 && that.data.couponList11.length > 0) {
-          for (var i = 0; i < that.data.couponList11.length; i++) {
-            if (that.data.tickDiscId11 == that.data.couponList11[i].id) {
-              that.setData({
-                checkedCoupon11: that.data.couponList11[i]
-              });
-              break;
-            }
-          }
-        }
+        //选择促销
+        that.setCampMinus();
+        //选择优惠券
+        that.setTickDisc();
       }
       wx.hideLoading();
       that.checkStore();
@@ -352,7 +351,7 @@ Page({
       tickDiscId02: that.data.tickDiscId02,
       tickDiscId10: that.data.tickDiscId10,
       tickDiscId11: that.data.tickDiscId11,
-      fullCutCouponId: that.data.fullCutCouponId,
+      // fullCutCouponId: that.data.fullCutCouponId,
       postscript00: that.data.postscript00,
       postscript02: that.data.postscript02,
       postscript10: that.data.postscript10,
@@ -362,7 +361,12 @@ Page({
       idNo: that.data.idNo,
       userName: that.data.userName,
       merchSn: wx.getStorageSync("merchSn"),
-      checkCart: that.data.checkCart
+      checkCart: that.data.checkCart,
+      campId00: that.data.campId00,
+      campId02: that.data.campId02,
+      campId10: that.data.campId10,
+      campId11: that.data.campId11,
+      isLoadStatus: that.data.isLoadStatus
     }, 'POST').then(function(res) {
       if (res.errno === 0) {
         let actualPrice = that.data.actualPrice;
@@ -585,7 +589,8 @@ Page({
     //   url: '/pages/shopping/coupon/coupon',
     // })
     that.setData({
-      openTicketAttr: !that.data.openTicketAttr
+      openTicketAttr: !that.data.openTicketAttr,
+      openCampMinusAttr: false
     })
     if (that.data.openTicketAttr) {
       that.getTicketDiscountList(goodsBizType);
@@ -622,7 +627,7 @@ Page({
     let id = e.currentTarget.dataset.ticketId;
     let goodsBizType = e.currentTarget.dataset.goodsType;
     // console.log(id);
-    if (id) {
+    if (id != null) {
       if (goodsBizType == '00') {
         that.setData({
           tickDiscId00: id,
@@ -662,9 +667,15 @@ Page({
       tickDiscId02: that.data.tickDiscId02,
       tickDiscId10: that.data.tickDiscId10,
       tickDiscId11: that.data.tickDiscId11,
+      campId00: that.data.campId00,
+      campId02: that.data.campId02,
+      campId10: that.data.campId10,
+      campId11: that.data.campId11,
       merchSn: wx.getStorageSync('merchSn'),
-      checkCart: that.data.checkCart
-    }).then(function(res) {
+      checkCart: that.data.checkCart,
+      isLoadStatus: 2//2代表选择优惠券加载
+    }, 'POST').then(function (res) {
+      console.log(res.data);
       if (res.errno === 0) {
         that.setData({
           actualPrice: res.data.actualPrice,
@@ -682,54 +693,273 @@ Page({
           couponList11: res.data.couponList11,
           goodsTotalPrice: res.data.goodsTotalPrice,
           orderTotalPrice: res.data.orderTotalPrice,
-          fullCutCouponDec: res.data.fullCutCouponDec,
-          fullCutCouponId: res.data.fullCutCouponId,
+          // fullCutCouponDec: res.data.fullCutCouponDec,
+          // fullCutCouponId: res.data.fullCutCouponId,
+          campList00: res.data.campList00,
+          campList02: res.data.campList02,
+          campList10: res.data.campList10,
+          campList11: res.data.campList11,
+          campMinusDto00: res.data.campMinusDto00,
+          campMinusDto02: res.data.campMinusDto02,
+          campMinusDto10: res.data.campMinusDto10,
+          campMinusDto11: res.data.campMinusDto11,
+          campId00: res.data.campId00,
+          campId02: res.data.campId02,
+          campId10: res.data.campId10,
+          campId11: res.data.campId11,
+          tickDiscId00: res.data.tickDiscId00,
+          tickDiscId02: res.data.tickDiscId02,
+          tickDiscId10: res.data.tickDiscId10,
+          tickDiscId11: res.data.tickDiscId11,
+          isLoadStatus: 2
         });
+        //选择促销
+        that.setCampMinus();
+        //选择优惠券
+        that.setTickDisc();
+      }
+      wx.hideLoading();
 
-        // 选择优惠券
-        if (that.data.tickDiscId00 && that.data.couponList00.length > 0) {
-          for (var i = 0; i < that.data.couponList00.length; i++) {
-            if (that.data.tickDiscId00 == that.data.couponList00[i].id) {
-              that.setData({
-                checkedCoupon00: that.data.couponList00[i]
-              });
-              break;
-            }
-          }
+    });
+  },
+  selectCamp(e) {
+    let goodsBizType = e.currentTarget.dataset.goodsType;
+    let that = this;
+    // wx.navigateTo({
+    //   url: '/pages/shopping/coupon/coupon',
+    // })
+    that.setData({
+      openCampMinusAttr: !that.data.openCampMinusAttr,
+      openTicketAttr: false
+    })
+    if (that.data.openCampMinusAttr) {
+      that.getStoreCampMinusList(goodsBizType);
+    }
+  },
+  hideSwitchTicketPop: function() {
+    this.setData({
+      openTicketAttr: false,
+      openCampMinusAttr: false
+    })
+  },
+  /**
+   * 查看满减满折列表
+   */
+  getStoreCampMinusList(goodsBizType) {
+    wx.showLoading({
+      title: '加载中...',
+    });
+    let that = this;
+    util.request(api.CampminusByCheckCartList, {
+      storeId: wx.getStorageSync('storeId'),
+      checkCart: that.data.checkCart,
+      bizType: goodsBizType
+    }).then(function(res) {
+      if (res.errno === 0) {
+        that.setData({
+          storeCampMinusList: res.data
+        });
+        wx.hideLoading();
+      }
+    });
+  },
+  selectUserCamp(e) {
+    let that = this;
+    let campId = e.currentTarget.dataset.campId;
+    let goodsBizType = e.currentTarget.dataset.goodsType;
+    if (campId != null) {
+      if (goodsBizType == '00') {
+        that.setData({
+          campId00: campId,
+          checkCampId: campId
+        });
+      }
+      if (goodsBizType == '02') {
+        that.setData({
+          campId02: campId,
+          checkCampId: campId
+        });
+      }
+      if (goodsBizType == '10') {
+        that.setData({
+          campId10: campId,
+          checkCampId: campId
+        });
+      }
+      if (goodsBizType == '11') {
+        that.setData({
+          campId11: campId,
+          checkCampId: campId
+        });
+      }
+    }
+  },
+  submitCampMinus() {
+    let that = this;
+    that.hideSwitchTicketPop();
+    wx.showLoading({
+      title: '加载中...',
+    });
+    util.request(api.CartCheckout, {
+      tickDiscId00: that.data.tickDiscId00,
+      tickDiscId02: that.data.tickDiscId02,
+      tickDiscId10: that.data.tickDiscId10,
+      tickDiscId11: that.data.tickDiscId11,
+      campId00: that.data.campId00,
+      campId02: that.data.campId02,
+      campId10: that.data.campId10,
+      campId11: that.data.campId11,
+      merchSn: wx.getStorageSync('merchSn'),
+      checkCart: that.data.checkCart,
+      isLoadStatus: 1//1代表选择促销活动加载
+    }, 'POST').then(function (res) {
+      console.log(res.data);
+      if (res.errno === 0) {
+        that.setData({
+          actualPrice: res.data.actualPrice,
+          actualPrice00: res.data.actualPrice00,
+          actualPrice02: res.data.actualPrice02,
+          actualPrice10: res.data.actualPrice10,
+          actualPrice11: res.data.actualPrice11,
+          checkedCoupon00: res.data.checkedCoupon00,
+          checkedCoupon02: res.data.checkedCoupon02,
+          checkedCoupon10: res.data.checkedCoupon10,
+          checkedCoupon11: res.data.checkedCoupon11,
+          couponList00: res.data.couponList00,
+          couponList02: res.data.couponList02,
+          couponList10: res.data.couponList10,
+          couponList11: res.data.couponList11,
+          goodsTotalPrice: res.data.goodsTotalPrice,
+          orderTotalPrice: res.data.orderTotalPrice,
+          // fullCutCouponDec: res.data.fullCutCouponDec,
+          // fullCutCouponId: res.data.fullCutCouponId,
+          campList00: res.data.campList00,
+          campList02: res.data.campList02,
+          campList10: res.data.campList10,
+          campList11: res.data.campList11,
+          campMinusDto00: res.data.campMinusDto00,
+          campMinusDto02: res.data.campMinusDto02,
+          campMinusDto10: res.data.campMinusDto10,
+          campMinusDto11: res.data.campMinusDto11,
+          campId00: res.data.campId00,
+          campId02: res.data.campId02,
+          campId10: res.data.campId10,
+          campId11: res.data.campId11,
+          tickDiscId00: res.data.tickDiscId00,
+          tickDiscId02: res.data.tickDiscId02,
+          tickDiscId10: res.data.tickDiscId10,
+          tickDiscId11: res.data.tickDiscId11,
+          isLoadStatus: 1
+        });
+        //选择促销
+        that.setCampMinus();
+        //选择优惠券
+        that.setTickDisc();
+      }
+      wx.hideLoading();
+    });
+  },
+  /**
+   * 选择促销
+   */
+  setCampMinus() {
+    let that = this;
+    // console.log(that.data.campMinusDto00);
+    // console.log(that.data.campList00);
+    // console.log(that.data.campId00);
+    if (that.data.campMinusDto00 != null && that.data.campList00 != null && that.data.campList00.length > 0) {
+      for (var i = 0; i < that.data.campList00.length; i++) {
+        if (that.data.campId00 == that.data.campList00[i].campMinusId) {
+          that.setData({
+            campMinusDto00: that.data.campList00[i],
+            checkCampId: that.data.campId00
+          });
+          break;
         }
-        if (that.data.tickDiscId02 && that.data.couponList02.length > 0) {
-          for (var i = 0; i < that.data.couponList02.length; i++) {
-            if (that.data.tickDiscId02 == that.data.couponList02[i].id) {
-              that.setData({
-                checkedCoupon02: that.data.couponList02[i]
-              });
-              break;
-            }
-          }
+      }
+    }
+    if (that.data.campMinusDto02 != null && that.data.campList02 != null && that.data.campList02.length > 0) {
+      for (var i = 0; i < that.data.campList02.length; i++) {
+        if (that.data.campId02 == that.data.campList02[i].campMinusId) {
+          that.setData({
+            campMinusDto02: that.data.campList02[i],
+            checkCampId: that.data.campId02
+          });
+          break;
         }
-        if (that.data.tickDiscId10 && that.data.couponList10.length > 0) {
-          for (var i = 0; i < that.data.couponList10.length; i++) {
-            if (that.data.tickDiscId10 == that.data.couponList10[i].id) {
-              that.setData({
-                checkedCoupon10: that.data.couponList10[i]
-              });
-              break;
-            }
-          }
+      }
+    }
+    if (that.data.campMinusDto10 != null && that.data.campList10 != null && that.data.campList10.length > 0) {
+      for (var i = 0; i < that.data.campList10.length; i++) {
+        if (that.data.campId10 == that.data.campList10[i].campMinusId) {
+          that.setData({
+            campMinusDto10: that.data.campList10[i],
+            checkCampId: that.data.campId10
+          });
+          break;
         }
-        if (that.data.tickDiscId11 && that.data.couponList11.length > 0) {
-          for (var i = 0; i < that.data.couponList11.length; i++) {
-            if (that.data.tickDiscId11 == that.data.couponList11[i].id) {
-              that.setData({
-                checkedCoupon11: that.data.couponList11[i]
-              });
-              break;
-            }
-          }
+      }
+    }
+    if (that.data.campMinusDto11 != null && that.data.campList11 != null && that.data.campList11.length > 0) {
+      for (var i = 0; i < that.data.campList11.length; i++) {
+        if (that.data.campId11 == that.data.campList11[i].campMinusId) {
+          that.setData({
+            campMinusDto11: that.data.campList11[i],
+            checkCampId: that.data.campId11
+          });
+          break;
         }
       }
-      wx.hideLoading();
-
-    });
+    }
+  },
+  /**
+   * 选择优惠券
+   */
+  setTickDisc() {
+    let that = this;
+    if (that.data.tickDiscId00 != null && that.data.couponList00 != null && that.data.couponList00.length > 0) {
+      for (var i = 0; i < that.data.couponList00.length; i++) {
+        if (that.data.tickDiscId00 == that.data.couponList00[i].id) {
+          that.setData({
+            checkedCoupon00: that.data.couponList00[i],
+            checkTickDiscId: that.data.tickDiscId00
+          });
+          break;
+        }
+      }
+    }
+    if (that.data.tickDiscId02 != null && that.data.couponList02 != null && that.data.couponList02.length > 0) {
+      for (var i = 0; i < that.data.couponList02.length; i++) {
+        if (that.data.tickDiscId02 == that.data.couponList02[i].id) {
+          that.setData({
+            checkedCoupon02: that.data.couponList02[i],
+            checkTickDiscId: that.data.tickDiscId02
+          });
+          break;
+        }
+      }
+    }
+    if (that.data.tickDiscId10 != null && that.data.couponList10 != null && that.data.couponList10.length > 0) {
+      for (var i = 0; i < that.data.couponList10.length; i++) {
+        if (that.data.tickDiscId10 == that.data.couponList10[i].id) {
+          that.setData({
+            checkedCoupon10: that.data.couponList10[i],
+            checkTickDiscId: that.data.tickDiscId10
+          });
+          break;
+        }
+      }
+    }
+    if (that.data.tickDiscId11 != null && that.data.couponList11 != null && that.data.couponList11.length > 0) {
+      for (var i = 0; i < that.data.couponList11.length; i++) {
+        if (that.data.tickDiscId11 == that.data.couponList11[i].id) {
+          that.setData({
+            checkedCoupon11: that.data.couponList11[i],
+            checkTickDiscId: that.data.tickDiscId11
+          });
+          break;
+        }
+      }
+    }
   }
 })

+ 113 - 16
wx-mall/pages/shopping/checkout/checkout.wxml

@@ -89,15 +89,26 @@
             </view>
           </view>
         </view>
-        <!-- 优惠券、总金额、运费start -->
+        <!-- 促销、优惠券、总金额、运费start -->
+        <view class="list-cell-checked" bindtap="selectCamp" data-goods-type="00" wx:if="{{campList00.length > 0}}">
+          <view class="list-cell-checked-bd">
+            <text wx:if="{{campMinusDto00.campMinusId!=0}}" class="name">促销:{{campMinusDto00.campMinusType==00?'满元减:':''}}{{campMinusDto00.campMinusType==01?'满件减:':''}}{{campMinusDto00.campMinusType==10?'满元折:':''}}{{campMinusDto00.campMinusType==11?'满件折:':''}}{{campMinusDto00.campName}}</text>
+            <text wx:if="{{campMinusDto00.campMinusId==0}}" class="name">促销:未选择</text>
+          </view>
+          <view class="list-cell-checked-ft router">
+            <text wx:if="{{campMinusDto00.campMinusId!=0}}" class="money red-txt">{{campMinusDto00.campMinusType==10 || campMinusDto00.campMinusType==11?'¥'+campMinusDto00.money+'折':'-¥'+campMinusDto00.money}}</text>
+            <text wx:if="{{campMinusDto00.campMinusId==0}}" class="txt">{{campList00.length}}张</text>
+          </view>
+        </view>
+
         <view class="list-cell-checked" bindtap="selectCoupon" data-goods-type="00" wx:if="{{couponList00.length > 0}}">
           <view class="list-cell-checked-bd">
-            <text wx:if="{{checkedCoupon00.id > 0}}" class="name">优惠券:{{checkedCoupon00.couponName}}</text>
-            <text wx:if="{{!checkedCoupon00}}" class="name">优惠券:未选择</text>
+            <text wx:if="{{checkedCoupon00.id > 0}}" class="name">优惠券{{checkedCoupon00.couponName}}</text>
+            <text wx:if="{{checkedCoupon00.id==0}}" class="name">优惠券:未选择</text>
           </view>
           <view class="list-cell-checked-ft router">
             <text wx:if="{{checkedCoupon00.id > 0}}" class="money red-txt">{{checkedCoupon00.tickDiscType==01?'¥'+checkedCoupon00.typeMoney+'折':'-¥'+checkedCoupon00.typeMoney}}</text>
-            <text wx:if="{{!checkedCoupon00}}" class="txt">{{couponList00.length}}张</text>
+            <text wx:if="{{checkedCoupon00.id==0}}" class="txt">{{couponList00.length}}张</text>
           </view>
         </view>
         <view class="list-cell" bindtap="hideSwitchTicketPop">
@@ -108,6 +119,14 @@
             <text class="txt">共{{goodsTotalByType00}}件商品  总计¥{{goodsTotalPrice00}} 优惠后价格<text style='color:#b4282d;font-size:24rpx'>¥{{actualPrice00}}</text></text>
           </view>
         </view>
+        <view class="list-cell" wx:if="{{campMinusDto00.campMinusId > 0}}" bindtap="hideSwitchTicketPop">
+          <view class="list-cell-bd">
+            <view class="list-label">促销活动:{{campMinusDto00.campMinusType==00?'满元减':''}}{{campMinusDto00.campMinusType==01?'满件减':''}}{{campMinusDto00.campMinusType==10?'满元折':''}}{{campMinusDto00.campMinusType==11?'满件折':''}}</view>
+          </view>
+          <view class="list-cell-ft">
+            <text class="txt" style='color:#b4282d'>{{campMinusDto00.campMinusType==10 || campMinusDto00.campMinusType==11?'¥'+campMinusDto00.money+'折':'-¥'+campMinusDto00.money}}</text>
+          </view>
+        </view>
         <view class="list-cell" wx:if="{{checkedCoupon00.id > 0}}" bindtap="hideSwitchTicketPop">
           <view class="list-cell-bd">
             <view class="list-label">商品优惠券</view>
@@ -167,15 +186,26 @@
           </view>
         </view>
 
-        <!-- 优惠券、总金额、运费start -->
+        <!-- 促销、优惠券、总金额、运费start -->
+        <view class="list-cell-checked" bindtap="selectCamp" data-goods-type="02" wx:if="{{campList02.length > 0}}">
+          <view class="list-cell-checked-bd">
+            <text wx:if="{{campMinusDto02.campMinusId!=0}}" class="name">促销:{{campMinusDto02.campMinusType==00?'满元减:':''}}{{campMinusDto02.campMinusType==01?'满件减:':''}}{{campMinusDto02.campMinusType==10?'满元折:':''}}{{campMinusDto02.campMinusType==11?'满件折:':''}}{{campMinusDto02.campName}}</text>
+            <text wx:if="{{campMinusDto02.campMinusId==0}}" class="name">促销:未选择</text>
+          </view>
+          <view class="list-cell-checked-ft router">
+            <text wx:if="{{campMinusDto02.campMinusId!=0}}" class="money red-txt">{{campMinusDto02.campMinusType==10 || campMinusDto02.campMinusType==11?'¥'+campMinusDto02.money+'折':'-¥'+campMinusDto02.money}}</text>
+            <text wx:if="{{campMinusDto02.campMinusId==0}}" class="txt">{{campList02.length}}张</text>
+          </view>
+        </view>
+
         <view class="list-cell-checked" bindtap="selectCoupon" data-goods-type="02" wx:if="{{couponList02.length > 0}}">
           <view class="list-cell-checked-bd">
             <text wx:if="{{checkedCoupon02.id > 0}}" class="name">优惠券:{{checkedCoupon02.couponName}}</text>
-            <text wx:if="{{!checkedCoupon02}}" class="name">优惠券:未选择</text>
+            <text wx:if="{{checkedCoupon02.id==0}}" class="name">优惠券:未选择</text>
           </view>
           <view class="list-cell-checked-ft router">
             <text wx:if="{{checkedCoupon02.id > 0}}" class="money red-txt">{{checkedCoupon02.tickDiscType==01?'¥'+checkedCoupon02.typeMoney+'折':'-¥'+checkedCoupon02.typeMoney}}</text>
-            <text wx:if="{{!checkedCoupon02}}" class="txt">{{couponList02.length}}张</text>
+            <text wx:if="{{checkedCoupon02.id==0}}" class="txt">{{couponList02.length}}张</text>
           </view>
         </view>
         <view class="list-cell" bindtap="hideSwitchTicketPop">
@@ -186,6 +216,14 @@
             <text class="txt">共{{goodsTotalByType02}}件商品  总计¥{{goodsTotalPrice02}} 优惠后价格<text style='color:#b4282d;font-size:24rpx'>¥{{actualPrice02}}</text></text>
           </view>
         </view>
+        <view class="list-cell" wx:if="{{campMinusDto02.campMinusId > 0}}" bindtap="hideSwitchTicketPop">
+          <view class="list-cell-bd">
+            <view class="list-label">促销活动:{{campMinusDto02.campMinusType==00?'满元减':''}}{{campMinusDto02.campMinusType==01?'满件减':''}}{{campMinusDto02.campMinusType==10?'满元折':''}}{{campMinusDto02.campMinusType==11?'满件折':''}}</view>
+          </view>
+          <view class="list-cell-ft">
+            <text class="txt" style='color:#b4282d'>{{campMinusDto02.campMinusType==10 || campMinusDto02.campMinusType==11?'¥'+campMinusDto02.money+'折':'-¥'+campMinusDto02.money}}</text>
+          </view>
+        </view>
         <view class="list-cell" wx:if="{{checkedCoupon02.id > 0}}" bindtap="hideSwitchTicketPop">
           <view class="list-cell-bd">
             <view class="list-label">商品优惠券</view>
@@ -245,16 +283,26 @@
           </view>
         </view>
 
-        
-        <!-- 优惠券、总金额、运费start -->
+        <!-- 促销、优惠券、总金额、运费start -->
+        <view class="list-cell-checked" bindtap="selectCamp" data-goods-type="10" wx:if="{{campList10.length > 0}}">
+          <view class="list-cell-checked-bd">
+            <text wx:if="{{campMinusDto10.campMinusId!=0}}" class="name">促销:{{campMinusDto10.campMinusType==00?'满元减:':''}}{{campMinusDto10.campMinusType==01?'满件减:':''}}{{campMinusDto10.campMinusType==10?'满元折:':''}}{{campMinusDto10.campMinusType==11?'满件折:':''}}{{campMinusDto10.campName}}</text>
+            <text wx:if="{{campMinusDto10.campMinusId==0}}" class="name">促销:未选择</text>
+          </view>
+          <view class="list-cell-checked-ft router">
+            <text wx:if="{{campMinusDto10.campMinusId!=0}}" class="money red-txt">{{campMinusDto10.campMinusType==10 || campMinusDto10.campMinusType==11?'¥'+campMinusDto10.money+'折':'-¥'+campMinusDto10.money}}</text>
+            <text wx:if="{{campMinusDto10.campMinusId==0}}" class="txt">{{campList10.length}}张</text>
+          </view>
+        </view>
+
         <view class="list-cell-checked" bindtap="selectCoupon" data-goods-type="10" wx:if="{{couponList10.length > 0}}">
           <view class="list-cell-checked-bd">
             <text wx:if="{{checkedCoupon10.id > 0}}" class="name">优惠券:{{checkedCoupon10.couponName}}</text>
-            <text wx:if="{{!checkedCoupon10}}" class="name">优惠券:未选择</text>
+            <text wx:if="{{checkedCoupon10.id==0}}" class="name">优惠券:未选择</text>
           </view>
           <view class="list-cell-checked-ft router">
             <text wx:if="{{checkedCoupon10.id > 0}}" class="money red-txt">{{checkedCoupon10.tickDiscType==01?'¥'+checkedCoupon10.typeMoney+'折':'-¥'+checkedCoupon10.typeMoney}}</text>
-            <text wx:if="{{!checkedCoupon10}}" class="txt">{{couponList10.length}}张</text>
+            <text wx:if="{{checkedCoupon10.id==0}}" class="txt">{{couponList10.length}}张</text>
           </view>
         </view>
         <view class="list-cell" bindtap="hideSwitchTicketPop">
@@ -265,6 +313,14 @@
             <text class="txt">共{{goodsTotalByType10}}件商品  总计¥{{goodsTotalPrice10}} 优惠后价格<text style='color:#b4282d;font-size:24rpx'>¥{{actualPrice10}}</text></text>
           </view>
         </view>
+        <view class="list-cell" wx:if="{{campMinusDto10.campMinusId > 0}}" bindtap="hideSwitchTicketPop">
+          <view class="list-cell-bd">
+            <view class="list-label">促销活动:{{campMinusDto10.campMinusType==00?'满元减':''}}{{campMinusDto10.campMinusType==01?'满件减':''}}{{campMinusDto10.campMinusType==10?'满元折':''}}{{campMinusDto10.campMinusType==11?'满件折':''}}</view>
+          </view>
+          <view class="list-cell-ft">
+            <text class="txt" style='color:#b4282d'>{{campMinusDto10.campMinusType==10 || campMinusDto10.campMinusType==11?'¥'+campMinusDto10.money+'折':'-¥'+campMinusDto10.money}}</text>
+          </view>
+        </view>
         <view class="list-cell" wx:if="{{checkedCoupon10.id > 0}}" bindtap="hideSwitchTicketPop">
           <view class="list-cell-bd">
             <view class="list-label">商品优惠券</view>
@@ -325,16 +381,27 @@
           </view>
         </view>
 
-        
-        <!-- 优惠券、总金额、运费start -->
+
+        <!-- 促销、优惠券、总金额、运费start -->
+        <view class="list-cell-checked" bindtap="selectCamp" data-goods-type="11" wx:if="{{campList11.length > 0}}">
+          <view class="list-cell-checked-bd">
+            <text wx:if="{{campMinusDto11.campMinusId!=0}}" class="name">促销:{{campMinusDto11.campMinusType==00?'满元减:':''}}{{campMinusDto11.campMinusType==01?'满件减:':''}}{{campMinusDto11.campMinusType==10?'满元折:':''}}{{campMinusDto11.campMinusType==11?'满件折:':''}}{{campMinusDto11.campName}}</text>
+            <text wx:if="{{campMinusDto11.campMinusId==0}}" class="name">促销:未选择</text>
+          </view>
+          <view class="list-cell-checked-ft router">
+            <text wx:if="{{campMinusDto11.campMinusId!=0}}" class="money red-txt">{{campMinusDto11.campMinusType==10 || campMinusDto11.campMinusType==11?'¥'+campMinusDto11.money+'折':'-¥'+campMinusDto11.money}}</text>
+            <text wx:if="{{campMinusDto11.campMinusId==0}}" class="txt">{{campList11.length}}张</text>
+          </view>
+        </view>
+
         <view class="list-cell-checked" bindtap="selectCoupon" data-goods-type="11" wx:if="{{couponList11.length > 0}}">
           <view class="list-cell-checked-bd">
             <text wx:if="{{checkedCoupon11.id > 0}}" class="name">优惠券:{{checkedCoupon11.couponName}}</text>
-            <text wx:if="{{!checkedCoupon11}}" class="name">优惠券:未选择</text>
+            <text wx:if="{{checkedCoupon11.id==0}}" class="name">优惠券:未选择</text>
           </view>
           <view class="list-cell-checked-ft router">
             <text wx:if="{{checkedCoupon11.id > 0}}" class="money red-txt">{{checkedCoupon11.tickDiscType==01?'¥'+checkedCoupon11.typeMoney+'折':'-¥'+checkedCoupon11.typeMoney}}</text>
-            <text wx:if="{{!checkedCoupon11}}" class="txt">{{couponList11.length}}张</text>
+            <text wx:if="{{checkedCoupon11.id==0}}" class="txt">{{couponList11.length}}张</text>
           </view>
         </view>
         <view class="list-cell" bindtap="hideSwitchTicketPop">
@@ -345,6 +412,14 @@
             <text class="txt">共{{goodsTotalByType11}}件商品  总计¥{{goodsTotalPrice11}} 优惠后价格<text style='color:#b4282d;font-size:24rpx'>¥{{actualPrice11}}</text></text>
           </view>
         </view>
+        <view class="list-cell" wx:if="{{campMinusDto11.campMinusId > 0}}" bindtap="hideSwitchTicketPop">
+          <view class="list-cell-bd">
+            <view class="list-label">促销活动:{{campMinusDto11.campMinusType==00?'满元减':''}}{{campMinusDto11.campMinusType==01?'满件减':''}}{{campMinusDto11.campMinusType==10?'满元折':''}}{{campMinusDto11.campMinusType==11?'满件折':''}}</view>
+          </view>
+          <view class="list-cell-ft">
+            <text class="txt" style='color:#b4282d'>{{campMinusDto11.campMinusType==10 || campMinusDto11.campMinusType==11?'¥'+campMinusDto11.money+'折':'-¥'+campMinusDto11.money}}</text>
+          </view>
+        </view>
         <view class="list-cell" wx:if="{{checkedCoupon11.id > 0}}" bindtap="hideSwitchTicketPop">
           <view class="list-cell-bd">
             <view class="list-label">商品优惠券</view>
@@ -387,7 +462,7 @@
       <view class="ticket-img-info">
         <!-- 查看门店优惠券列表 -->
         <!-- data-ticket-id="{{item.id}}" data-goods-type="{{item.id}}" bindtap="selectTicket"  -->
-        <view style="margin-top: 16rpx;height:50rpx;width:687.5rpx;" wx:for="{{ticketDiscountList}}" wx:key="{{item.id}}" >
+        <view style="margin-top: 16rpx;height:50rpx;width:687.5rpx;" wx:for="{{ticketDiscountList}}" wx:key="{{item.id}}">
           <view class="coupon-title">
             <view style='float:left'>{{ item.couponName }} {{item.tickDiscType==01?'¥'+item.typeMoney+'折':'¥'+item.typeMoney}}</view>
             <view style='float:right;margin-right:30rpx;' data-ticket-id="{{item.id}}" data-goods-type="{{item.goodsBizType}}" bindtap="selectTicket">
@@ -404,6 +479,28 @@
     </view>
     <!-- 领券弹框end -->
 
+    <!-- 选择促销活动弹框start -->
+    <view wx:if="{{openCampMinusAttr}}" class="attr-pop">
+      <view class="attr-title">选择促销活动</view>
+      <view class="ticket-img-info">
+        <!-- 查看门店优惠券列表 -->
+        <!-- data-ticket-id="{{item.id}}" data-goods-type="{{item.id}}" bindtap="selectTicket"  -->
+        <view style="margin-top: 16rpx;height:50rpx;width:687.5rpx;" wx:for="{{storeCampMinusList}}" wx:key="{{item.campMinusId}}">
+          <view class="coupon-title">
+            <view style='float:left'>{{ item.campName }} {{item.campMinusType==10||item.campMinusType==11?'¥'+item.money+'折':'¥'+item.money}}</view>
+            <view style='float:right;margin-right:30rpx;' data-camp-id="{{item.campMinusId}}" data-goods-type="{{item.goodsBizType}}" bindtap="selectUserCamp">
+              <image class="img" src="{{checkCampId==item.campMinusId?'../../../static/images/select.png':'../../../static/images/no-select.png'}}"></image>
+            </view>
+          </view>
+
+          <view class="bottom-btn">
+            <view class="r" bindtap="submitCampMinus">完成</view>
+          </view>
+        </view>
+        <!-- 查看门店优惠券列表end -->
+      </view>
+    </view>
+    <!-- 选择促销活动弹框end -->
 
     <view class="order-total">
       <view class="l">实付:¥{{actualPrice}}</view>

+ 1 - 1
wx-mall/pages/ucenter/coupon/coupon.js

@@ -94,7 +94,7 @@ Page({
     let that = this;
     util.request(api.TicketDiscountList, { storeId: wx.getStorageSync('storeId')}).then(function (res) {
       if (res.errno === 0) {
-        console.log(res.data);
+        // console.log(res.data);
         that.setData({
           ticketDiscountList: res.data
         });

+ 1 - 3
wx-mall/pages/ucenter/coupon/coupon.wxml

@@ -61,7 +61,7 @@
           <view class="coupon-type" wx:if="{{item.tickDiscType==02}}">兑换券</view> -->
           <view class="coupon-type">{{item.tickDiscType==00?'满'+item.voucherCond+'可用':''}}{{item.tickDiscType==01?'满'+item.discCond+'可用':''}}{{item.tickDiscType==02?'满'+item.exchCond+'可用':''}}</view>
         </view>
-        <view class="coupon-info"  bindtap="getCouponDetail2" data-disc-Id="{{item.tickDiscId}}" data-store-Topic-Id="{{item.storeTopicId}}">
+        <view class="coupon-info" bindtap="getCouponDetail2" data-disc-Id="{{item.tickDiscId}}" data-store-Topic-Id="{{item.storeTopicId}}">
           <view class="coupon-title">{{ item.name }}</view>
           <view class="coupon-desc">
             <view style="font-size: 26rpx;">{{ item.inValidTime }}</view>
@@ -80,6 +80,4 @@
     </view>
     <!-- 查看门店优惠券列表end -->
   </view>
-
-
 </view>

+ 1 - 1
wx-mall/pages/ucenter/orderDetail/orderDetail.wxml

@@ -94,7 +94,7 @@
     </view>
     <view class="list-cell" wx:if="{{orderInfo.full_cut_price}}">
       <view class="list-cell-bd">
-        <view class="list-label week orange">满减</view>
+        <view class="list-label week orange">满减:<text class='orange'>{{orderInfo.campName}}</text></view>
       </view>
       <view class="list-cell-ft week orange">
         -¥{{orderInfo.full_cut_price}}

+ 1 - 12
wx-mall/pages/ucenter/ticketDiscountGoods/ticketDiscountGoods.js

@@ -37,7 +37,6 @@ Page({
       });
     }
     this.getGoodsList();
-    this.getFootCart();
   },
   onReady: function () {
   },
@@ -160,23 +159,13 @@ Page({
       goodsId: goodsId
     }).then(function (res) {
       if (res.errno === 0 && null != res.data) {
-        let stockNumbers = 0;
-        if (res.data.goodsVo.goodsBizType == '00') {
-          if (res.data.goodsVo.isStockShare == 1) {
-            stockNumbers = res.data.goodsVo.goods_number;
-          } else {
-            stockNumbers = res.data.goodsVo.stockNum;
-          }
-        } else {
-          stockNumbers = res.data.goodsVo.stockNum;
-        }
         that.setData({
           goodsVo: res.data.goodsVo,
           specificationList: res.data.specificationList,
           productList: res.data.productList,
           openAttr: !that.data.openAttr,
           retailPrice: retailPrice,
-          stockNum: stockNumbers,
+          stockNum: res.data.stockNum,
           cartNumber: res.data.cartNumber,
           checkedSpecText: res.data.specificationList[0].valueList[0].value
         });

+ 1 - 1
wx-mall/pages/ucenter/ticketDiscountGoods/ticketDiscountGoods.wxml

@@ -59,7 +59,7 @@
       <view class="c">
         <view class="p">价格:¥{{retailPrice}}</view>
         <view class="a" wx:if="{{productList.length>0}}">已选择:{{checkedSpecText}}</view>
-        <view class="a">库存{{goodsVo.goodsBizType==00 && goodsVo.isStockShare==1?goodsVo.goods_number:goodsVo.stockNum}}件</view>
+        <view class="a">库存{{stockNum}}件</view>
       </view>
     </view>
   </view>