Commit a2bac41d20de161f937fc400bfd139e48bcb79d2

Authored by yvan.ni
1 parent ce05cca8

1. 积分购的功能完成 2. 拼团普通购买时判断线下库存

components/diy_goodsGroup/diy_goodsGroup.js
... ... @@ -392,7 +392,10 @@ Component({
392 392 item.cardprice1 = val.cardprice1;
393 393 item.cardprice2 = val.cardprice2;
394 394 item.cardprice3 = val.cardprice3;
395   -
  395 +
  396 + if(val.prom_price) item.prom_price = val.prom_price;
  397 + if(val.prom_integral) item.prom_integral = val.prom_integral;
  398 +
396 399 prom_id = val.prom_id;
397 400  
398 401 var prom_type = val.prom_type; //0普通商品 1秒杀 6拼单
... ...
components/diy_goodsGroup/diy_goodsGroup.wxml
... ... @@ -43,9 +43,13 @@
43 43 <view class='zs_wz1' wx:if="{{object.goodstit}}">{{item.goods_name}}</view>
44 44 <!--如果有显示价格 -->
45 45 <view class='zs_wz2' wx:if="{{object.goodsprice}}">
46   - <block wx:if="{{item.prom_price}}">
47   - <view class='wz_red'>¥{{item.prom_price}}</view>
48   - <view class='del'>¥{{item.market_price}}</view>
  46 + <block wx:if="{{item.prom_price || item.prom_integral}}">
  47 + <view class='wz_red'>
  48 + <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text>
  49 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  50 + <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text>
  51 + </view>
  52 + <view class='del'>¥{{item.market_price}}</view>
49 53 </block>
50 54 <block wx:else>
51 55  
... ... @@ -187,8 +191,12 @@
187 191 <view class='zs_wz1_2l' wx:if="{{object.goodstit}}">{{item.goods_name}}</view>
188 192 <view class='zs_wz2_2l' wx:if="{{object.goodsprice}}">
189 193  
190   - <block wx:if="{{item.prom_price}}">
191   - <view class='wz_red'>¥{{item.prom_price}}</view>
  194 + <block wx:if="{{item.prom_price || item.prom_integral}}">
  195 + <view class='wz_red'>
  196 + <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text>
  197 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  198 + <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text>
  199 + </view>
192 200 <view class='del'>¥{{item.market_price}}</view>
193 201 </block>
194 202 <block wx:else>
... ... @@ -330,8 +338,12 @@
330 338  
331 339 <view class='zs_wz1_3l' wx:if="{{object.goodstit}}">{{item.goods_name}}</view>
332 340 <view class='zs_wz2_3l' wx:if="{{object.goodsprice}}">
333   - <block wx:if="{{item.prom_price}}">
334   - <view class='wz_red'>¥{{item.prom_price}}</view>
  341 + <block wx:if="{{item.prom_price || item.prom_integral}}">
  342 + <view class='wz_red'>
  343 + <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text>
  344 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  345 + <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text>
  346 + </view>
335 347 <view class='del'>¥{{item.market_price}}</view>
336 348 </block>
337 349 <block wx:else>
... ... @@ -473,96 +485,114 @@
473 485 <view class='zs_center_x'>
474 486 <view class='zs_wz1_x' wx:if="{{object.goodstit}}">{{item.goods_name}}</view>
475 487 <view class='zs_wz2_x' wx:if="{{object.goodsprice}}">
476   - <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}" >
477   - <!-- 当会员是等级卡的时候 -->
478   - <block wx:if="{{card_field}}">
479   - <!-- 等级价>0 -->
480   - <block wx:if="{{item[card_field]>0}}">
481   - <view class="money flex" >
482   - <!-- 办卡价 -->
483   - <view class="flex xc-wc ai_and">
484   - <view class="fs24 wz_red">¥</view>
485   - <view class="fs35 wz_red">{{filter.toFix(item[card_field],2)}}</view>
486   - <view class="card_bg ellipsis-1">
487   - <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
488   - <text class="card_name">{{card_name}}</text>
489   - </view>
490   - </view>
491   - </view>
492   - <view class="flex" style="line-height: 28rpx;" >
493   - <!-- 原价 -->
494   - <view class="price flex xc-ash line_th">
495   - <view class="fs22">¥</view>
496   - <view class="fs22">{{item.market_price}}</view>
497   - </view>
498   - </view>
499   - </block>
500   - <blocK wx:else>
501   - <view class="money flex" >
502   - <!-- 办卡价 -->
503   - <view class="flex xc-wc">
504   - <view class="fs24">¥</view>
505   - <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
506   - </view>
507   - </view>
508   - <view class="flex" style="line-height: 28rpx;" >
509   - <!-- 原价 -->
510   - <view class="price flex xc-ash line_th">
511   - <view class="fs22">¥</view>
512   - <view class="fs22">{{item.market_price}}</view>
513   - </view>
514   - </view>
515   - </blocK>
516   - </block>
517   - <block wx:else>
518   - <!-- 如果商品有设置等级价大于0的 -->
519   - <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}">
520   - <view class="money flex" >
521   - <!-- 办卡价 -->
522   - <view class="flex xc-wc">
523   - <view class="fs24">¥</view>
524   - <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
525   - </view>
526   - <!-- 原价 -->
527   - <view class="price flex xc-ash line_th">
528   - <view class="fs22">¥</view>
529   - <view class="fs22">{{item.market_price}}</view>
530   - </view>
531   -
532   - </view>
533   - <view class="flex" style="line-height: 28rpx;" >
534   - <!-- 等级价 -->
535   - <view class="price flex ai_and">
536   - <view class="fs22">¥</view>
537   - <view class="fs28">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view>
538   - <view class="card_bg">
539   - <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>{{g_filter.get_card_price(item,card_list,1)}}</view>
540   - </view>
541   - </view>
542   - </block>
543   - <block wx:else>
544   - <view class="money flex" >
545   - <!-- 办卡价 -->
546   - <view class="flex xc-wc">
547   - <view class="fs24 wz_red">¥</view>
548   - <view class="fs35 wz_red">{{filter.toFix(item.shop_price,2)}}</view>
549   - </view>
550   - </view>
551   - <view class="flex" style="line-height: 28rpx;" >
552   - <!-- 原价 -->
553   - <view class="price flex xc-ash line_th">
554   - <view class="fs22">¥</view>
555   - <view class="fs22">{{item.market_price}}</view>
556   - </view>
557   - </view>
558   - </block>
559   - </block>
560   - </block>
561   -
562   - <block wx:else>
563   - <view class='wz_red'>¥{{item.shop_price}}</view>
564   - <view class='del'>¥{{item.market_price}}</view>
565   - </block>
  488 +
  489 + <block wx:if="{{item.prom_price || item.prom_integral}}">
  490 + <view class='wz_red'>
  491 + <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text>
  492 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  493 + <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text>
  494 + </view>
  495 + <view class='del'>¥{{item.market_price}}</view>
  496 + </block>
  497 + <!-- 不是活动的情况 -->
  498 + <block wx:else>
  499 +
  500 + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}" >
  501 + <!-- 当会员是等级卡的时候 -->
  502 + <block wx:if="{{card_field}}">
  503 + <!-- 等级价>0 -->
  504 + <block wx:if="{{item[card_field]>0}}">
  505 + <view class="money flex" >
  506 + <!-- 办卡价 -->
  507 + <view class="flex xc-wc ai_and">
  508 + <view class="fs24 wz_red">¥</view>
  509 + <view class="fs35 wz_red">{{filter.toFix(item[card_field],2)}}</view>
  510 + <view class="card_bg ellipsis-1">
  511 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
  512 + <text class="card_name">{{card_name}}</text>
  513 + </view>
  514 + </view>
  515 + </view>
  516 + <view class="flex" style="line-height: 28rpx;" >
  517 + <!-- 原价 -->
  518 + <view class="price flex xc-ash line_th">
  519 + <view class="fs22">¥</view>
  520 + <view class="fs22">{{item.market_price}}</view>
  521 + </view>
  522 + </view>
  523 + </block>
  524 + <blocK wx:else>
  525 + <view class="money flex" >
  526 + <!-- 办卡价 -->
  527 + <view class="flex xc-wc">
  528 + <view class="fs24">¥</view>
  529 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  530 + </view>
  531 + </view>
  532 + <view class="flex" style="line-height: 28rpx;" >
  533 + <!-- 原价 -->
  534 + <view class="price flex xc-ash line_th">
  535 + <view class="fs22">¥</view>
  536 + <view class="fs22">{{item.market_price}}</view>
  537 + </view>
  538 + </view>
  539 + </blocK>
  540 + </block>
  541 + <block wx:else>
  542 + <!-- 如果商品有设置等级价大于0的 -->
  543 + <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}">
  544 + <view class="money flex" >
  545 + <!-- 办卡价 -->
  546 + <view class="flex xc-wc">
  547 + <view class="fs24">¥</view>
  548 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  549 + </view>
  550 + <!-- 原价 -->
  551 + <view class="price flex xc-ash line_th">
  552 + <view class="fs22">¥</view>
  553 + <view class="fs22">{{item.market_price}}</view>
  554 + </view>
  555 +
  556 + </view>
  557 + <view class="flex" style="line-height: 28rpx;" >
  558 + <!-- 等级价 -->
  559 + <view class="price flex ai_and">
  560 + <view class="fs22">¥</view>
  561 + <view class="fs28">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view>
  562 + <view class="card_bg">
  563 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>{{g_filter.get_card_price(item,card_list,1)}}</view>
  564 + </view>
  565 + </view>
  566 + </block>
  567 + <block wx:else>
  568 + <view class="money flex" >
  569 + <!-- 办卡价 -->
  570 + <view class="flex xc-wc">
  571 + <view class="fs24 wz_red">¥</view>
  572 + <view class="fs35 wz_red">{{filter.toFix(item.shop_price,2)}}</view>
  573 + </view>
  574 + </view>
  575 + <view class="flex" style="line-height: 28rpx;" >
  576 + <!-- 原价 -->
  577 + <view class="price flex xc-ash line_th">
  578 + <view class="fs22">¥</view>
  579 + <view class="fs22">{{item.market_price}}</view>
  580 + </view>
  581 + </view>
  582 + </block>
  583 + </block>
  584 + </block>
  585 +
  586 + <block wx:else>
  587 + <view class='wz_red'>¥{{item.shop_price}}</view>
  588 + <view class='del'>¥{{item.market_price}}</view>
  589 + </block>
  590 +
  591 +
  592 + </block>
  593 +
  594 +
  595 +
566 596 </view>
567 597 <view class='zs_wz5_x' wx:if="{{object.goodsnum}}">销量:{{item.sales_sum}}件</view>
568 598 </view>
... ... @@ -623,8 +653,12 @@
623 653 <view class='sp_wz'>
624 654 <view class='zs_wz1_3l' wx:if="{{object.goodstit}}">{{aitem.goods_name}}</view>
625 655 <view class='zs_wz2_3l' wx:if="{{object.goodsprice}}">
626   - <block wx:if="{{aitem.prom_price}}">
627   - <view class='wz_red'>¥{{aitem.prom_price}}</view>
  656 + <block wx:if="{{aitem.prom_price || aitem.prom_integral }}">
  657 + <view class='wz_red'>
  658 + <text wx:if="{{aitem.prom_integral}}">{{aitem.prom_integral}}</text>
  659 + <text wx:if="{{aitem.prom_integral && aitem.prom_price}}">+</text>
  660 + <text wx:if="{{aitem.prom_price}}">¥{{aitem.prom_price}}</text>
  661 + </view>
628 662 <view class='del'>¥{{aitem.market_price}}</view>
629 663 </block>
630 664 <block wx:else>
... ...
components/goods_list/goods_list.wxml
... ... @@ -12,10 +12,12 @@
12 12 <!-- 商品名称 -->
13 13 <view class="goods_name ellipsis-2 fs28">{{item.goods_name}}</view>
14 14 <!-- 判断是否有活动价 -->
15   - <block wx:if="{{item.prom_price>0}}">
16   - <view class="money flex">
  15 + <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}">
  16 + <view class="money flex xc-wc" >
  17 + <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text>
  18 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
17 19 <!-- 活动价 -->
18   - <view class="flex xc-wc">
  20 + <view class="flex xc-wc" wx:if="{{item.prom_price}}">
19 21 <view class="fs24">¥</view>
20 22 <view class="fs35">{{item.prom_price}}</view>
21 23 </view>
... ...
pages/cart/cart2_inte/c_filter.wxs 0 → 100644
  1 +var filters = {
  2 + toFix:function(val,count){
  3 + return val.toFixed(count)
  4 + },
  5 + format_time:function(ts,isFull) {
  6 + var d = getDate(ts*1000)
  7 + var fm=[d.getFullYear(), d.getMonth()+1, d.getDate()].join('-');
  8 + if(isFull==1)
  9 + fm=fm + ' '+ [d.getHours(), d.getMinutes(), d.getSeconds()].join(':')
  10 + return fm;
  11 + },
  12 + setcolor:function(ind){
  13 + if (ind == 0 || ind ==null) return "red";
  14 + if(ind==1 ) return "green";
  15 + if(ind==2) return "blue";
  16 + if(ind==11) return "green";
  17 + if(ind==12) return "blue";
  18 + if(ind==20) return "green";
  19 + return "";
  20 + },
  21 + setbgcolor: function (ind) {
  22 + if (ind == 0 || ind == null) return "#ffa1b9";
  23 + if (ind == 1) return "#59e1d2";
  24 + if (ind == 2) return "#a3bcff";
  25 + if (ind == 11) return "#59e1d2";
  26 + if (ind == 12) return "#a3bcff";
  27 + if (ind == 20) return "#6d87cd";
  28 + return "";
  29 + },
  30 +
  31 + get_type:function(ind){
  32 + if (ind == 0 || ind == null) return "全场通用";
  33 + if (ind == 1) return "品牌";
  34 + if (ind == 2) return "品类";
  35 + if (ind == 11) return "用途";
  36 + if (ind == 12) return "分类1";
  37 + if (ind == 20) return "指定单品";
  38 + return "";
  39 + },
  40 + get_type_card:function(ind){
  41 + if (ind == 0 || ind == null) return "全场通用";
  42 + if (ind == 1) return "指定品牌";
  43 + if (ind == 2) return "指定品类";
  44 + if (ind == 11) return "指定用途";
  45 + if (ind == 12) return "指定分类1";
  46 + if (ind == 20) return "指定单品";
  47 + return "";
  48 + },
  49 + format_huiche:function (text) {
  50 + if (!text) {
  51 + return "";
  52 + }
  53 + var reg = getRegExp('\\\\n', 'g')
  54 + return text.replace(reg, '\n')
  55 + }
  56 +}
  57 +
  58 +module.exports = {
  59 + toFix: filters.toFix,
  60 + format_time:filters.format_time,
  61 + setcolor:filters.setcolor,
  62 + setbgcolor: filters.setbgcolor,
  63 + get_type: filters.get_type,
  64 + get_split_name: filters.get_split_name,
  65 + get_type_card: filters.get_type_card,
  66 + format_huiche: filters.format_huiche,
  67 +}
0 68 \ No newline at end of file
... ...
pages/cart/cart2_inte/cart2_inte.js 0 → 100644
  1 +var t = getApp(),app=t, a = t.request, e = require("../../../utils/common.js"),
  2 + s = require("../../../utils/util.js"),ut=s, o = require("../../../utils/md5.js"), to = getApp();
  3 +var oo=t.globalData.setting,os=oo;
  4 +var regeneratorRuntime = require('../../../utils/runtime.js');
  5 +var util_pay = require("../../../utils/pay.js");
  6 +
  7 +Page({
  8 + data: {
  9 + url: t.globalData.setting.url,
  10 + imgUrl: t.globalData.setting.imghost,
  11 + goods: null,
  12 + order: null,
  13 + orderPrices: null,
  14 + coupons: null,
  15 + coupon: null,
  16 + invoiceToggle: !0,
  17 + payWithUserMoney: !0,
  18 + payWithPoints: !0,
  19 + maxWord: 0,
  20 + enterAddressPage: !1,
  21 + firstEnter: !0,
  22 + //页面获取的参数
  23 + param:null,
  24 + //提交订单的格式
  25 + formData: {
  26 + order_amount:0,//支付金额
  27 + total_amount:0,//总价
  28 + all_price:0,//商品卖的总价
  29 + pay_points: 0,//使用积分
  30 + user_money: 0,//使用余额
  31 + couponCode: "",//使用优惠券(多单就用逗号隔开)
  32 + shipping_price:0,//物流费用
  33 + },
  34 +
  35 +
  36 + /*----------------立即购买---------------------*/
  37 + is_b_now:1, //0是购物车结算 1立即购买
  38 + bn_goods:null, //立即购买时候的调用商品
  39 + bn_use_money:0,//是否使用余额
  40 + bn_exp_type:1, //0是物流 1自提
  41 + bn_pick:0, //选择的门店
  42 + bn_pickname: "", //选择的门店名称
  43 + bn_t_exp_t:0, //判断商品和门店一起决定的物流自提的方式0 都可以 1自提 2物流
  44 +
  45 + bn_plus_cut_price:0, //显示等级卡会优惠多少钱
  46 + /*------------------------*/
  47 + user_addr:null,//物流
  48 + userinfo:null, //获取会员
  49 + /*----------物流选择--------*/
  50 + wu_arr:null,
  51 + index:0,
  52 + w_sele_index:0,
  53 +
  54 + //判断页面是返回回来的还是 首次进入的
  55 + isclose:1,
  56 + //申请提现的金额
  57 + txmon:0,
  58 + yuer:0,
  59 + //提交中,不重复提交
  60 + is_summit_ing:0,
  61 +
  62 + disabled:0,
  63 + open_express:0,//控制选择物流名列表 的属性
  64 +
  65 + is_express:0, //选中物流的属性
  66 + expres_name:"", //点击选定
  67 + is_shipping_code:"",//插入用户默认地址
  68 + wu_arr_txt:"", //要更新的物流的字段
  69 +
  70 + //如果是全场包邮了,或者是全场不包邮了,就不要选包邮券
  71 + is_no_by:{},
  72 + is_by:{},
  73 + is_quan_by:{},
  74 + //--购买赠送的商品--
  75 + buy_now_gift_goods:null,
  76 + //--订单优惠--
  77 + order_prom:{},
  78 + show_submit:0, //提交按钮变正常显示
  79 +
  80 + },
  81 + onLoad: function(t) {
  82 + wx.setNavigationBarTitle({ title: "填写订单",})
  83 + var th = this;
  84 + th.data.param=t;
  85 + //清空is_pick_up
  86 + getApp().request.put("/api/weshop/useraddress/updatePickUp", {
  87 + data: {user_id: getApp().globalData.user_id, is_pickup: 0},
  88 + success: function (s) {
  89 + }
  90 + });
  91 +
  92 +
  93 + },
  94 + onUnload: function () { this.setData({ isclose: 1 })},
  95 + onHide: function () {
  96 + this.setData({
  97 + is_no_by:{},
  98 + is_by:{}
  99 + })
  100 + },
  101 +
  102 + //----------子页返回父页触发----------
  103 + onShow: function() {
  104 + var th=this;
  105 + th.setData({show_submit:0}); //让提交先掩藏
  106 + th.data.g_cart_q_time=null;
  107 +
  108 + if (th.data.isclose==0){
  109 + wx.navigateTo({
  110 + url: "/pages/index/index/index"
  111 + })
  112 +
  113 + }else{
  114 + this.getuser_addr(function(ie){
  115 + //地址切换要把包邮券清空
  116 + if( !th.data.user_addr || !ie || th.data.user_addr.address_id!=ie.address_id){
  117 + var using_quan=th.data.using_quan;
  118 + for(var i in using_quan){
  119 + var item=using_quan[i];
  120 + if(item.isby==1){
  121 + var ob={},txt="using_quan["+i+"]";ob[txt]={};
  122 + th.setData(ob);
  123 + }
  124 + }
  125 +
  126 + }
  127 +
  128 +
  129 + th.data.prom_goods_map={};
  130 + th.data.is_summit_ing=0;
  131 + //更换地址回来要重新调用计算价钱的接口
  132 + if(!th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){
  133 + th.setData({user_addr: ie });
  134 + if (th.data.is_b_now == 1) {
  135 + if(th.data.bn_goods) {
  136 + th.setData({add_back:1});
  137 +
  138 + }
  139 + }
  140 + }else{
  141 + th.setData({user_addr: ie });
  142 + }
  143 + var going=0;
  144 +
  145 + });
  146 + //--更新默认地址--,看一下是不是跳到地址页面
  147 + if(!getApp().globalData.is_cart2_old){
  148 + this.update_code();
  149 + }else{
  150 + getApp().globalData.is_cart2_old=0;
  151 + }
  152 + }
  153 +
  154 + //先获取是否有关闭使用优惠券
  155 + getApp().getConfig2(function (ee) {
  156 + var json_d = JSON.parse(ee.switch_list);
  157 + th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
  158 + th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch});
  159 +
  160 + var rank_switch=json_d.rank_switch;
  161 + var max_price=-1;
  162 + var show_card=null;
  163 + var name="";
  164 + //如果有开等级卡的时候,
  165 + //因为都是调接口,要返回在计算
  166 + if(rank_switch==2){
  167 + //-- 获取所有的等级卡, --
  168 + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?storeId=" + os.stoid,
  169 + {}).then(res => {
  170 + if(res.data.code==0){
  171 + var plusCard = res.data.data;
  172 + //-- 循环判断,拿到最贵的那张卡 --
  173 + for(var ih in plusCard){
  174 + if(plusCard[ih].IsStopBuy == true){ continue; }
  175 + if(max_price<0){
  176 + max_price=plusCard[ih].CardFee;
  177 + name='card'+plusCard[ih]['CorrPrice'];
  178 + show_card=plusCard[ih];
  179 + }else{
  180 + if(max_price<plusCard[ih].CardFee){
  181 + max_price=plusCard[ih].CardFee;
  182 + name='card'+plusCard[ih]['CorrPrice'];
  183 + show_card=plusCard[ih];
  184 + }
  185 + }
  186 + }
  187 +
  188 + if(show_card){
  189 + name=name.toLowerCase();
  190 + th.setData({card_name:name,show_card:show_card})
  191 + }
  192 + }
  193 + //-----先获取物流,再获取用户信息,再展示页面-----
  194 + th.get_wuliu(th.get_info(th.show_page));
  195 + })
  196 + }else{
  197 + //-----先获取物流,再获取用户信息,再展示页面-----
  198 + th.get_wuliu(th.get_info(th.show_page));
  199 + }
  200 + })
  201 +
  202 + },
  203 +
  204 + //-------------------获取物流---------------
  205 + get_wuliu(func) {
  206 + var th = this;
  207 + to.getwuliu(function (e) {
  208 + th.setData({ wu_arr: e })
  209 + typeof func == "function" && func();
  210 + })
  211 + },
  212 + //------获取会员信息-----先获取用户信息,在进行下一步---
  213 + get_info:function(func){
  214 + var user_id = t.globalData.user_id;
  215 + to.auth.get_u(func);
  216 + },
  217 +
  218 + //------获取会员收货地址-----
  219 + getuser_addr:function(func){
  220 + var th=this;
  221 + a.get("/api/weshop/useraddress/page", {
  222 + data: { user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600,t:Math.random()},
  223 + success: function (su) {
  224 +
  225 + var item = null;
  226 + if(su.data.code==0 && su.data.data && su.data.data.pageData){
  227 + var user_addr = su.data.data.pageData;
  228 + var def_item=null;
  229 + for (var i = 0; i < user_addr.length; i++) {
  230 + if (user_addr[i]['is_default'] == 1) { def_item = user_addr[i];}
  231 + if (user_addr[i]['is_pickup'] == 1) { item = user_addr[i]; }
  232 + }
  233 +
  234 + if (item == null) item = def_item;
  235 + if (item == null) item = user_addr[0];
  236 + }
  237 +
  238 + if(item==undefined) item=null;
  239 + if(!item) th.setData({user_addr:null}); //地址为空的时候,要清空,因为返回的时候,有缓存
  240 + func(item);
  241 + }
  242 + });
  243 + },
  244 +
  245 + //----------------展示页面,是再获取用户信息之后--------------
  246 + show_page:function(){
  247 + var th=this,ta = this.data.param;
  248 + th.setData({
  249 + userinfo: getApp().globalData.userInfo,});
  250 +
  251 + //选获取地址
  252 + th.getuser_addr(function(addr){
  253 + th.setData({user_addr: addr});
  254 + //--------------------------立即购买------------------
  255 + if(ta.is_bnow== 1){
  256 + //读取门店
  257 + to.get_allsto(function (e) {
  258 + th.setData({ allsto: e });
  259 + //获取立即购买的商品信息
  260 + th.get_buy_goods(ta.goods_id);
  261 + });
  262 + }
  263 + });
  264 + //获取提现金额
  265 + getApp().request.get("/api/weshop/withdrawals/summoney", {
  266 + data: { user_id: to.globalData.user_id, store_id: oo.stoid, status: 0 },
  267 + success: function (su) {
  268 + if (su.data.code == 0) {
  269 + var yuer = parseFloat(th.data.userinfo.user_money -
  270 + (th.data.userinfo.frozen_money>0?th.data.userinfo.frozen_money:0) - su.data.data.summoney).toFixed(2);
  271 + th.setData({ txmon: su.data.data.summoney, yuer: yuer });
  272 + }
  273 + }
  274 + });
  275 + },
  276 +
  277 + //-----获取立即购买的商品信息,入口----
  278 + get_buy_goods: function (e){
  279 + var th=this;
  280 + var gg = to.get_b_now();
  281 + //--------如果goods_id一样,就是要立即购买-----
  282 + if(e==gg.goods_id){
  283 + a.get("/api/weshop/goods/get/" + oo.stoid+"/"+e, {
  284 + success:async function (t) {
  285 + var gd = t.data.data;
  286 + t.data.data.original_img = oo.imghost + t.data.data.original_img;
  287 + t.data.data['buynum'] = gg.goods_num;
  288 + var distr_t=0,et=0
  289 + if (t.data.data.distr_type==0){
  290 + distr_t = gg.pick_dis;
  291 + }else{
  292 + distr_t = t.data.data.distr_type;
  293 + }
  294 + switch (distr_t){
  295 + case 0: et=1; break;
  296 + case 1: et = 1; break;
  297 + case 2: et = 0; break;
  298 + }
  299 +
  300 + if(th.data.bn_goods) et=th.data.bn_exp_type
  301 +
  302 + var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code;
  303 + if(et==0 && def_exp_code){
  304 + for(var k=0;k<th.data.wu_arr.length;k++){
  305 + var item=th.data.wu_arr[k]; if(def_exp_code==item.code){ m_wind=k; }
  306 + }
  307 + }
  308 +
  309 + //---是不是购买等级卡成功的返回---等级卡显示的判断---
  310 + var is_card_back=getApp().globalData.is_card_back;
  311 + if(is_card_back){
  312 + th.data.card_name=th.data.userinfo.card_field;
  313 + gg.goods_price=gd[th.data.card_name];
  314 + getApp().globalData.is_card_back=0;
  315 + th.setData({card_cut_price:0});
  316 + //如果是秒杀的返回
  317 + if(gd.prom_type==4) gd.prom_type=0;
  318 + }else{
  319 + //--- 商家等级卡开通的情况下, 会员不是等级会员的情况, 商品有设置等级卡价格,同时等级卡价格小于商品的价格
  320 + //-- 搭配购的商品也可以单独购买,所以此时搭配购的商品要进行计算优惠 --
  321 + if(!gg.collocation_goods && gd['prom_type']!=6 && th.data.card_name && gd[th.data.card_name]>0 && gg.goods_price>gd[th.data.card_name] && !th.data.userinfo.card_field){
  322 + var cut_p= (gg.goods_price-gd[th.data.card_name])*gg.goods_num;
  323 + th.setData({card_cut_price:cut_p});
  324 + }
  325 + }
  326 +
  327 + switch (gd.prom_type){
  328 + case 0:
  329 + case 2:
  330 + case 3:
  331 + case 5:
  332 + case 6:
  333 + getApp().my_warnning("商品不是积分活动",0,th);
  334 + wx.navigateBack();
  335 + break;
  336 + case 4: //-- 积分购 --
  337 + getApp().request.get("/api/weshop/integralbuy/pageIntegralBuyGoodsList?stype=1&stypeup=1",{
  338 + data:{store_id:os.stoid,goods_id:gg.goods_id},
  339 + success: async function (tt) {
  340 + if(tt.data.code==0 && tt.data.data && tt.data.data.pageData){
  341 + var inte_data=tt.data.data.pageData[0];
  342 + t.data.data.shop_price=inte_data.addmoney;
  343 + t.data.data.integral=inte_data.integral;
  344 + th.setData({
  345 + bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et,index:m_wind,
  346 + bn_pick: gg.pick_id, bn_t_exp_t: distr_t,bn_exp_type: et
  347 + });
  348 + //计算价格
  349 + th.calculatePrice2();
  350 + }else{
  351 + getApp().my_warnning("商品不是积分活动",0,th);
  352 + wx.navigateBack();
  353 + }
  354 + }
  355 + });
  356 + break;
  357 + }
  358 + },
  359 + });
  360 + }
  361 + },
  362 +
  363 + //---------------检查是否有收货地址-------------------
  364 + checkAddressList: function() {
  365 + var t = this;
  366 + return !(!this.data.order || null == this.data.order.userAddress) || (wx.showModal({
  367 + title: "请先填写或选择收货地址~",
  368 + success: function(a) {
  369 + a.confirm ? t.enterAddressPage() : wx.navigateBack();
  370 + },
  371 + fail: function() {
  372 + wx.navigateBack();
  373 + }
  374 + }), !1);
  375 + },
  376 + showInvoice: function() {
  377 + this.setData({
  378 + invoiceToggle: !this.data.invoiceToggle
  379 + });
  380 + },
  381 + keyUpChangePay1: function(t) {
  382 + this.setData({
  383 + payWithUserMoney: !(t.detail.value.length > 0)
  384 + });
  385 + },
  386 + keyUpChangePay2: function(t) {
  387 + this.setData({
  388 + payWithPoints: !(t.detail.value.length > 0)
  389 + });
  390 + },
  391 + keyUpChangeNum: function(t) {
  392 + this.setData({
  393 + maxWord: t.detail.value.length
  394 + });
  395 + },
  396 +
  397 +
  398 + //---------计算立即购买----------
  399 + calculatePrice2: function () {
  400 + var th = this, good = this.data.bn_goods;
  401 + wx.showLoading({ title:"处理中.",})
  402 + //-----------计算商品总价--------------
  403 + var allpice = good.shop_price * good.buynum;
  404 + var cut_price=0;
  405 + if(good.prom_type==3 && good.prom_price!==null){
  406 + cut_price=allpice-good.prom_price;
  407 + }
  408 + allpice=parseFloat(allpice).toFixed(2);
  409 + var txt = "formData.all_price";
  410 + th.setData({ [txt]: allpice, });
  411 + if(cut_price){
  412 + var c_txt="formData.cut_price";
  413 + th.setData({ [c_txt]: cut_price, });
  414 + }
  415 + to.getConfig2(function (ee) {
  416 + to.getwuliuprice(async function (rs) {
  417 +
  418 + var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
  419 + //-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮----------
  420 + if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && good.is_past!=1 ){
  421 +
  422 + switch (good['exp_sum_type']) {
  423 + case 1:
  424 + //统一运费
  425 + o_shipping_price += good['uniform_exp_sum']; break;
  426 + case 2:
  427 + if (goods_weight < 0) goods_weight = 0;
  428 + //累积商品重量 每种商品的重量 * 数量
  429 + goods_weight += good['weight'] * good['buynum'];break;
  430 + case 3:
  431 + if (goods_piece < 0) goods_piece = 0;
  432 + //累积商品数量
  433 + goods_piece += good['buynum']; break;
  434 + }
  435 +
  436 + var code ="";
  437 + if(th.data.wu_arr && th.data.wu_arr[th.data.index]) code=th.data.wu_arr[th.data.index].code;
  438 + var freight_free = ee.freight_free; //全场满多少包邮
  439 + var no_ex_id=ee.no_ex_id;
  440 + th.data.is_no_by[th.data.bn_pick]=0;
  441 +
  442 + var no_by_data=null;
  443 + var gift_freight_free=freight_free;
  444 + //有不包邮区域,且不免运费
  445 + if(no_ex_id && freight_free>0 && freight_free<=allpice-cut_price){
  446 + //-----------获取不包邮区域,不包邮商品-------
  447 + await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods",{
  448 + data:{store_id:os.stoid,id:no_ex_id}
  449 + }).then(res=>{
  450 + if(res.data.code==0){
  451 + no_by_data=res.data.data[0];
  452 + //如果有设置不包邮区域的时候
  453 + if(res.data.data[0].region_list){
  454 + if(th.check_by_area(res.data.data[0].region_list)){
  455 + freight_free=0;
  456 + th.data.is_no_by[th.data.bn_pick]=1;
  457 + }
  458 + }
  459 + //如果有设置不包邮商品
  460 + if(res.data.data[0].goods_list && freight_free){
  461 + if(th.check_by_goods(res.data.data[0].goods_list)){
  462 + freight_free=0;
  463 + th.data.is_no_by[th.data.bn_pick]=1;
  464 + }
  465 + }
  466 + }
  467 + })
  468 + }
  469 +
  470 + th.data.is_by[th.data.bn_pick]=0;
  471 + //--------------开始计算物流------------------
  472 + var shipping_price=
  473 + th.calculatewuliu(code, o_shipping_price, goods_weight,
  474 + goods_piece, th.data.user_addr, freight_free, allpice-cut_price, rs);
  475 + if(shipping_price<=0){
  476 + th.data.is_by[th.data.bn_pick]=1; //已经是包邮了,就不要选择包邮券
  477 + }
  478 +
  479 + shipping_price = parseFloat(shipping_price).toFixed(2);
  480 + var wl_txt = "formData.shipping_price";
  481 + th.setData({ [wl_txt]: shipping_price, })
  482 +
  483 + }else{
  484 + var wl_txt = "formData.shipping_price";
  485 + th.setData({ [wl_txt]: 0, })
  486 + }
  487 + //---如果有选择优惠券的情况下---
  488 + var quan_price=0,bn_pick=th.data.bn_pick;
  489 +
  490 + //-----------------支付价,优惠券不减物流-----------------
  491 + var total_m = (parseFloat(allpice)).toFixed(2);
  492 + var order_m = (parseFloat(allpice-cut_price)-quan_price).toFixed(2);
  493 + var coupon_price=quan_price; //优惠券优惠了多少钱
  494 + if(order_m<0) {
  495 + order_m=0;coupon_price=parseFloat(order_m).toFixed(2);
  496 + }
  497 +
  498 + //--看一下有没有订单优惠--
  499 + total_m= parseFloat( total_m)+ parseFloat( th.data.formData.shipping_price);
  500 + order_m = parseFloat(order_m)+ parseFloat( th.data.formData.shipping_price);
  501 + var atxt= "formData.total_amount";
  502 + th.setData({ [atxt]: total_m, })
  503 +
  504 + var txt = "formData.user_money";
  505 + var txt2 = "formData.order_amount";
  506 + var txt4="formData.integral";
  507 +
  508 + var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money);
  509 + //--------------如果使用余额---------------------
  510 + if (th.data.bn_use_money == 1) {
  511 + if (amoney> order_m) {
  512 + order_m = order_m.toFixed(2);
  513 + th.setData({ [txt]: order_m, [txt2]:0,[txt4]:good.integral,show_submit:1 })
  514 + }else{
  515 + order_m =parseFloat(order_m - amoney);
  516 + order_m = order_m.toFixed(2);
  517 + th.setData({ [txt]: amoney, [txt2]: order_m,[txt4]:good.integral,show_submit:1 })
  518 + }
  519 + }else{
  520 + th.setData({ [txt]: 0, [txt2]: order_m,[txt4]:good.integral, show_submit:1 })
  521 + }
  522 +
  523 + wx.hideLoading();
  524 +
  525 + });
  526 + });
  527 + },
  528 +
  529 + //--------------------提交订单-----------------------
  530 + async submitForm(t){
  531 + var sub_value=t;
  532 +
  533 + if(this.data.is_summit_ing==1) return false; //--提交中退出--
  534 + this.data.is_summit_ing=1;
  535 + var th=this,pdata=new Array();
  536 + var ff=true;
  537 + //------------立即购买-------------
  538 + if (th.data.is_b_now==1 && th.data.bn_goods.prom_type!=5){
  539 +
  540 + if(th.data.bn_exp_type == 0 && th.data.user_addr==null ){
  541 + ff = false; getApp().my_warnning("请选择收货地址",0,th);
  542 + th.data.is_summit_ing = 0;
  543 + }
  544 + if (!ff) return false;
  545 + var addr = th.data.user_addr;
  546 + if (th.data.bn_exp_type == 1) addr=null;
  547 +
  548 + if(th.data.bn_exp_type==0)
  549 + if(th.data.wu_arr==null || th.data.wu_arr.length<=0){
  550 + getApp().my_warnning("读取物流失败",0,th);
  551 + th.data.is_summit_ing = 0;
  552 + return false;
  553 + }
  554 +
  555 + var item={
  556 + 'user_id': to.globalData.user_id,
  557 + 'consignee': addr == null ? "" : addr.consignee,
  558 + 'province': addr == null ? 0 : addr.province,
  559 + 'city': addr == null ? 0 : addr.city,
  560 + 'district': addr == null ? 0 : addr.district,
  561 + 'twon': addr == null ? 0 : addr.twon,
  562 + 'address': addr == null ? "": addr.address,
  563 + 'more_address': addr == null ? "" : addr.more_address,
  564 + //'mobile': th.data.userinfo.mobile,
  565 + 'mobile': addr == null ? th.data.userinfo.mobile : addr.mobile,
  566 + 'email':'',
  567 + 'shipping_code': th.data.bn_exp_type == 1 ? 0 : th.data.wu_arr[th.data.index].code,
  568 + 'shipping_name': th.data.bn_exp_type == 1 ? '' : th.data.wu_arr[th.data.index].name,
  569 + 'invoice_title':'',
  570 + 'goods_price': th.data.formData.all_price, //商品总价
  571 + 'shipping_price': th.data.formData.shipping_price, //物流金额
  572 + 'user_money': th.data.formData.user_money, //使用余额
  573 + 'total_amount': th.data.formData.total_amount, //订单总价
  574 + 'order_amount': th.data.formData.order_amount, //应付
  575 + 'user_note': t.detail.value.user_note, //用户备注
  576 + 'store_id':oo.stoid, //商家
  577 + 'pickup_id': th.data.bn_pick, //门店
  578 + 'exp_type': th.data.bn_exp_type, //配送方式
  579 + 'order_goods':new Array(),
  580 + 'integral': th.data.formData.integral,
  581 + };
  582 + //是不是重新提交
  583 + if(th.data.is_continue==1) item.is_continue=1;
  584 +
  585 + //获取立即购买的商品的信息
  586 + var gg = to.get_b_now();
  587 + //--商品的房间号--
  588 + if(gg.room_id && gg.room_id>0){
  589 + item.room_ids=gg.room_id;
  590 + }
  591 +
  592 + var goods={
  593 + 'goods_id': gg.goods_id,
  594 + 'goods_name': gg.goods_name,
  595 + 'goods_sn': gg.goods_sn,
  596 + 'goods_num': gg.goods_num,
  597 + 'market_price': th.data.bn_goods.market_price,
  598 + 'goods_price': th.data.bn_goods.shop_price,
  599 + 'member_goods_price': th.data.bn_goods.shop_price,
  600 + 'store_id': oo.stoid,
  601 + 'prom_type':th.data.bn_goods.prom_type, //促销活动类型
  602 + 'prom_id': th.data.bn_goods.prom_id, //促销活动id
  603 + };
  604 +
  605 + //-- 把导购的信息填入--
  606 + if(gg.guide_id){
  607 + goods.guide_id=gg.guide_id;
  608 + goods.guide_type=gg.guide_type;
  609 + //调用接口判断是不是会员
  610 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{
  611 + if(res.data.code==0){
  612 + goods.guide_name=res.data.data.salesman;
  613 + goods.guide_sn=res.data.data.salesman_no;
  614 + }
  615 + })
  616 + }
  617 +
  618 + //--商品的房间号--
  619 + if(gg.room_id && gg.room_id>0){
  620 + goods.room_id=gg.room_id;
  621 + }
  622 +
  623 + item.order_goods.push(goods);
  624 + pdata.push(item);
  625 + }
  626 +
  627 +
  628 + if (pdata.length==0) return;
  629 + var str = JSON.stringify(pdata);
  630 +
  631 + wx.showLoading({title: "加载中"});
  632 + wx.request({
  633 + url: oo.url + '/api/weshop/order/createWxdOrder',
  634 + data: str,
  635 + method: 'POST',
  636 + header: {
  637 + 'content-type': 'application/json'
  638 + },// 设置请求的 header
  639 + success: function (res) {
  640 +
  641 + th.data.is_summit_ing=0; //是否提交中
  642 + wx.hideLoading();
  643 + if (res.statusCode == 200) {
  644 + var data=res.data;
  645 + if(data.code==0){
  646 + console.log(th.data.is_b_now);
  647 + //如果是购物车结算,还要删除购物车
  648 + if (th.data.is_b_now == 0) {
  649 + console.log(th.data.cartlist_y);
  650 + var list = th.data.cartlist_y;
  651 + for (var i = 0; i < list.length; i++) {
  652 + //删除购物车
  653 + a.delete("/api/weshop/cart/del/" + oo.stoid + "/" + list[i].id, {});
  654 + }
  655 + }
  656 + var order_amount = 0;
  657 + pdata.forEach(function (em, ind) {
  658 + order_amount += em.order_amount;
  659 + })
  660 + //要进行判断,如果是用微信支付,就要跳转到支付界面
  661 + if (order_amount > 0) {
  662 + th.setData({ isclose: 0 });
  663 + //void e.jumpToCart4({
  664 + // order_sn: data.data,
  665 + //}, 1);
  666 + util_pay.pay(data.data, function() {
  667 + //app.my_warnning("支付成功",1,th);
  668 + //setTimeout(function () {
  669 + wx.redirectTo({
  670 + url: "/pages/payment/pay_success/pay_success?type=2&order_sn="+data.data
  671 + })
  672 + //},1000)
  673 +
  674 + }, function () {
  675 + //支付失败
  676 + setTimeout(function () {
  677 + wx.navigateBack({ delta: 1 })
  678 + },1000)
  679 + },oo.stoid);
  680 +
  681 + } else {
  682 + var dd = {
  683 + parent_sn: data.data,
  684 + store_id: oo.stoid,
  685 + type: 2,
  686 + };
  687 + a.post("/api/weshop/order/pay/createOrder", {
  688 + data: dd,
  689 + success: function (t) {
  690 + //console.log(t);
  691 + if(t.data.code==0){
  692 + //app.my_warnning("支付成功",1,th);
  693 + //setTimeout(function () {
  694 + th.setData({ isclose: 0 });
  695 + wx.redirectTo({
  696 + url: "/pages/payment/pay_success/pay_success?type=2&order_sn="+data.data,
  697 + })
  698 + //}, 1000)
  699 + }
  700 + },
  701 + fail:function () {
  702 +
  703 + }
  704 + });
  705 + }
  706 +
  707 + }
  708 + else{
  709 + //--内容换行--
  710 + var msg=data.msg;
  711 + //赠品活动已经取消,无法赠送,是否继续买单?
  712 + if(msg.indexOf("是否继续买单")>0){
  713 + wx.showModal({
  714 + title:"提示",
  715 + content: data.msg,
  716 + cancelText:'取消',
  717 + confirmText:'确定',
  718 + showCancel: true,
  719 + success(res){
  720 + if(res.cancel){
  721 + return;
  722 + }else if(res.confirm){
  723 + th.data.is_continue=1;
  724 + th.submitForm(sub_value);
  725 + }
  726 + }
  727 + })
  728 + return;
  729 + }
  730 + if(msg.length>13){
  731 + msg=msg.slice(0, 13) + "\r\n"+ msg.slice(13);
  732 + }
  733 + getApp().confirmBox(msg);
  734 + }
  735 + }else{
  736 + console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode);
  737 + }
  738 + },
  739 + fail: function () {
  740 + th.data.is_summit_ing=0;
  741 + wx.hideLoading();
  742 + console.log("index.js wx.request CheckCallUser fail");
  743 + },
  744 + complete: function () {}
  745 + })
  746 +
  747 + },
  748 +
  749 + //---确认线下门店的数量足不足---
  750 + async check_store_num(goods_id,pick,goods_num,func){
  751 + var lock=0,pick_no,plist,erpwareid;
  752 + //先读取门店的lock
  753 + await getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{
  754 + data:{store_id:os.stoid,wareId:goods_id,storageId:pick,pageSize:1000}
  755 + }).then(res=>{
  756 + if(res.data.code==0 && res.data.data.total>0){
  757 + for(var i in res.data.data.pageData)
  758 + lock+=res.data.data.pageData[i].outQty;
  759 + }
  760 + })
  761 + //先获取门店的编号
  762 + await getApp().request.promiseGet("/api/weshop/pickup/get/"+os.stoid+"/"+pick,{
  763 + data:{storeId:os.stoid,goodsId:t.goods_id,pickupId:pick}
  764 + }).then(res=>{
  765 + if(res.data.code==0){
  766 + pick_no=res.data.data.pickup_no;
  767 + }
  768 + })
  769 + //先获取商品的线下库存
  770 + await getApp().request.promiseGet("/api/weshop/goods/get/"+os.stoid+"/"+goods_id,{
  771 + data:{storeId:os.stoid,goodsId:t.goods_id,pickupId:pick}
  772 + }).then(res=>{
  773 + if(res.data.code==0){
  774 + erpwareid=res.data.data.erpwareid;
  775 + }
  776 + })
  777 + //读取线下的门店库存
  778 + await getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{
  779 + data:{storageNos:pick_no,wareIds:encodeURIComponent(erpwareid),storeId:os.stoid}
  780 + }).then(res=>{
  781 + if(res.data.code==0){
  782 + plist=res.data.data.pageData[0];
  783 + }
  784 + })
  785 + var isok=1;
  786 + if(goods_num>plist.CanOutQty-lock){
  787 + isok=0;
  788 + }
  789 + func(isok);
  790 + },
  791 +
  792 + useCoupon: function() {
  793 + if (this.data.order.couponNum <= 0) {
  794 + getApp().my_warnning("无可用优惠券",0,this);
  795 + return;
  796 + }
  797 +
  798 + var a = {
  799 + lid: this.data.coupon ? this.data.coupon.id : "0"
  800 + };
  801 + wx.navigateTo({
  802 + url: "/pages/user/checkcoupon/checkcoupon?" + s.Obj2Str(a)
  803 + });
  804 + },
  805 + enterAddressPage: function() {
  806 + getApp().globalData.is_cart_old=1;
  807 + this.data.isget_by_quan={};
  808 + this.data.enterAddressPage = !0, wx.navigateTo({
  809 + url: "/pages/user/address_list/address_list"
  810 + });
  811 + },
  812 +
  813 +
  814 +
  815 + //--------立即购买时,选择自提和物流----------
  816 + setexptype:function(t){
  817 + var th=this;
  818 + var ty = t.currentTarget.dataset.t,def_exp_code= getApp().globalData.userInfo.def_exp_code;
  819 + th.setData({ bn_exp_type:ty});
  820 + //当物流为空的时候。
  821 + if (ty == 0 && th.data.wu_arr==null){
  822 + th.data.isget_by_quan={};
  823 + return th.get_wuliu(th.calculatePrice2());
  824 + }
  825 +
  826 + //--自提就要把包邮券清理掉--
  827 + if(ty==1){
  828 + th.data.isget_by_quan={};
  829 + if(th.data.using_quan[th.data.bn_pick] && th.data.using_quan[th.data.bn_pick].isby==1){
  830 + th.setData({using_quan:{}});
  831 + }
  832 + }
  833 +
  834 + //判断有没有默认的物流地址值
  835 + if (def_exp_code != "" && def_exp_code != null && def_exp_code !=undefined) {
  836 + var wu_arr=this.data.wu_arr;
  837 + if (wu_arr!= null && wu_arr!=""){
  838 + for(var i=0;i<wu_arr.length;i++){
  839 + if (wu_arr[i].shipping_code == def_exp_code){
  840 + th.setData({index:i});
  841 + }
  842 + }
  843 + }
  844 + }
  845 + th.calculatePrice2()
  846 +
  847 + },
  848 +
  849 + //--------立即购买时,使用余额--------
  850 + set_bn_useyuer:function(){
  851 + var th=this;
  852 + th.setData({ bn_use_money: !th.data.bn_use_money});
  853 + th.calculatePrice2();
  854 + },
  855 + set_js_useyuer:function(){
  856 + var th = this;
  857 + th.setData({ js_use_money: !th.data.js_use_money });
  858 + th.calculatePrice();
  859 + },
  860 + //-------------------计算物流---------------
  861 + calculatewuliu:function(code, o_shipping_price, goods_weight,
  862 + goods_piece,user_addr, freight_free, o_price, rs){
  863 + var price =0,th=this;
  864 + price +=parseFloat(o_shipping_price);
  865 + //如果是包邮
  866 + if (freight_free > 0 && o_price >= freight_free){ return 0;}
  867 + if (user_addr==null) { return 0; }
  868 + //计算物流的config item;
  869 + var item=null;
  870 + //先根据 镇 县 区找计算的config
  871 + item = th.get_wuliu_config(user_addr.district,code,rs);
  872 + if (item==null) item = th.get_wuliu_config(user_addr.city, code, rs);
  873 + if (item==null) item = th.get_wuliu_config(user_addr.province, code, rs);
  874 + if (item == null) item = th.get_wuliu_default(code,rs);
  875 + if (item == null) return o_shipping_price;
  876 + var fw_price = 0, fp_price=0;
  877 + item=item.config;
  878 + if (item == null) return o_shipping_price;
  879 + //------按重量----------
  880 + if (goods_weight>=0 && item['money']) {
  881 + fw_price =parseFloat(item['money']);
  882 + if (goods_weight > item['first_weight']){
  883 + var fw = goods_weight - item['first_weight'];
  884 + var n = Math.ceil(fw/item['second_weight'])
  885 + fw_price = fw_price + n * parseFloat(item['add_money']);
  886 + }
  887 + }
  888 + //------按件数----------
  889 + if (goods_piece > 0 && item['piecemoney']) {
  890 + fp_price = parseFloat(item['piecemoney']);
  891 + if (goods_piece > item['first_piece']) {
  892 + var fp = goods_piece - item['first_piece'];
  893 + var m = Math.ceil(fp / item['second_piece'])
  894 + fp_price = fp_price + m * parseFloat(item['add_piecemoney']);
  895 + }
  896 + }
  897 + var rspice =parseFloat(price + fw_price + fp_price);
  898 + return rspice;
  899 + },
  900 +
  901 + //------------循环获取config-----------
  902 + get_wuliu_config:function(region_id,code,rs){
  903 + var item=null,rslist = rs.pageData;
  904 + for (var i = 0; i < rslist.length;i++){
  905 + if (rslist[i].code == code && rslist[i].region_id == region_id) { item = rslist[i];}
  906 + }
  907 + return item;
  908 + },
  909 + //-------循环获取config,code default-------
  910 + get_wuliu_default: function (code, rs) {
  911 + var item = null, rslist=rs.pageData;
  912 + for (var i = 0; i < rslist.length; i++) {
  913 + if (rslist[i].shipping_code == code && rslist[i].is_default == 1) { item = rslist[i]; }
  914 + }
  915 + return item;
  916 + },
  917 +
  918 + //----------立即购买,选择物流-------------
  919 + bindPickerChange:function(e){
  920 + var ind = e.detail.value
  921 + this.setData({ index: ind });
  922 + this.calculatePrice2();
  923 + },
  924 + //----------购物车结算,选择物流-------------
  925 + bindPickerChange_w: function (e) {
  926 + var ind=e.detail.value, txt = e.currentTarget.dataset.txt;
  927 + this.setData({ [txt]: ind });
  928 + this.calculatePrice();
  929 + },
  930 +
  931 + cart_set_err:function(e){
  932 + var txt = e.currentTarget.dataset.err;
  933 + var ob={};
  934 + ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif";
  935 + this.setData(ob);
  936 + },
  937 +
  938 + //// 开启物流的弹窗
  939 + show_wu_arr:function(e){
  940 + var wu_arr_txt=e.currentTarget.dataset.txt;
  941 + var w_sele_index=e.currentTarget.dataset.w_sele_index;
  942 + var is_express=null;
  943 + var ob={open_express: 1,wu_arr_txt:wu_arr_txt,disabled:1};
  944 +
  945 + //--如果是多个门店的时候--
  946 + if(w_sele_index!=undefined){
  947 + is_express=this.data.cartlist[w_sele_index].wind;
  948 + ob['is_express']=is_express;
  949 + }
  950 + this.setData(ob);
  951 + },
  952 + // 关闭物流的弹窗
  953 + close_express:function(){
  954 + this.setData({ open_express:0,disabled:0 });
  955 + },
  956 + // 选择物流
  957 + click_express_name:function(e){
  958 + var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode;
  959 + var index=e.currentTarget.dataset.idxe;
  960 + var ob={ is_express: index, is_shipping_code: shippingcode,disabled:0};
  961 + ob[this.data.wu_arr_txt]=index;
  962 + this.setData(ob);
  963 + },
  964 +
  965 + //点击确定物流
  966 + determine_expres:function(e){
  967 + this.setData({ open_express: 0});
  968 + this.calculatePrice2();
  969 + },
  970 +
  971 + //设置默认物流
  972 + select_default_logistics: function () {
  973 + var th=this;
  974 + var is_shipping_code=this.data.is_shipping_code
  975 + getApp().request.put("/api/weshop/users/update",{
  976 + data: { user_id: getApp().globalData.user_id, store_id: oo.stoid, def_exp_code: is_shipping_code},
  977 + success:function(rse){
  978 + if (rse.data.code==0){
  979 + getApp().globalData.userInfo.def_exp_code=is_shipping_code;
  980 + th.setData({ open_express: 0 });
  981 + //----计算此时购物车的价格----
  982 + if(th.data.is_b_now==1) th.calculatePrice2();
  983 + else th.calculatePrice();
  984 + }
  985 + }
  986 + })
  987 + },
  988 +
  989 + //更新下默认,在onshow里面
  990 + update_code(){
  991 + var th=this,m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code;
  992 + //--定时器,判断wu_arr不未空--
  993 + var uii=setInterval(function () {
  994 + if(th.data.wu_arr)
  995 + {
  996 + clearInterval(uii);
  997 + for (var k = 0; k < th.data.wu_arr.length; k++) {
  998 + var item = th.data.wu_arr[k];
  999 + if (def_exp_code == item.code) { m_wind = k; }
  1000 + }
  1001 + //--如果是立即购买--
  1002 + th.setData({index: m_wind,is_express:m_wind});
  1003 +
  1004 + }
  1005 + },500);
  1006 + },
  1007 +
  1008 + //检查区域是不是包邮
  1009 + check_area:function(arr){
  1010 + var user_addr=this.data.user_addr;
  1011 + for(var i in arr){
  1012 + var item=arr[i];
  1013 + if(user_addr.twon==item || user_addr.district==item
  1014 + || user_addr.city==item|| user_addr.province==item ){
  1015 + return 0;
  1016 + }
  1017 + }
  1018 + return 1;
  1019 + },
  1020 +
  1021 + //检查立即购买的商品是不是不包邮
  1022 + check_good:function(arr,goods_id){
  1023 + if(!goods_id) goods_id=this.data.bn_goods.goods_id;
  1024 + for(var i in arr){
  1025 + var item=arr[i];
  1026 + if(goods_id==item) return 0;
  1027 + }
  1028 + return 1;
  1029 + },
  1030 + check_by_area:function(region_list){
  1031 + var arr=region_list.split(",");
  1032 + var check=this.check_area(arr);
  1033 + return !check;
  1034 + },
  1035 + check_by_goods:function(goods_list,goods_id){
  1036 + var arr=goods_list.split(",");
  1037 + var check=this.check_good(arr,goods_id);
  1038 + return !check;
  1039 + },
  1040 +
  1041 +
  1042 + //从优惠的映射中拿出商品从表的item
  1043 + arr_get_goods:function(goods_id,arr){
  1044 + for(var i in arr){
  1045 + if(arr[i].goods_id==goods_id) return arr[i];
  1046 + }
  1047 + },
  1048 +
  1049 + //跳转到购买卡
  1050 + buycard:function(){
  1051 + getApp().goto("/pages/user/plus/plus");
  1052 + getApp().globalData.plus_buy_back=1;
  1053 + }
  1054 +
  1055 +});
... ...
pages/cart/cart2_inte/cart2_inte.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "填写订单",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "warn": "/components/long_warn/long_warn"
  6 + }
  7 +}
0 8 \ No newline at end of file
... ...
pages/cart/cart2_inte/cart2_inte.wxml 0 → 100644
  1 +<wxs module="filter" src="c_filter.wxs"></wxs>
  2 +<wxs src="filter.wxs" module="util"></wxs>
  3 +<wxs module="filters" src="../../../utils/filter.wxs"></wxs>
  4 +
  5 +<form bindsubmit="submitForm">
  6 + <view class="container">
  7 + <!--要进行判断地址是否显示---->
  8 + <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'>
  9 + <!---默认地址显示------>
  10 + <block wx:if="{{user_addr!=null}}">
  11 +
  12 + <view class="user-contact">
  13 + <text>收货人:</text>{{user_addr.consignee}}{{'  '}}{{user_addr.mobile}}</view>
  14 + <view class="location">
  15 + <view class="address">{{user_addr.more_address}}{{' '}}{{user_addr.address}}</view>
  16 + <view class="pos-icon">
  17 + <image class="wh100 bdr14" src="{{imgUrl}}/miniapp/images/goodscategory/new_position.png"></image>
  18 + </view>
  19 + </view>
  20 + <view class="update-logistics">
  21 + <!-- <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/new_position.png"></image> -->
  22 + <view class="xc-right"></view>
  23 + </view>
  24 + </block>
  25 + <!---先增地址------>
  26 + <block wx:else>
  27 + <view class="add_new">
  28 + <image class="addr_jia" src="{{imgUrl}}/miniapp/images/jia.png"></image>添加地址
  29 + </view>
  30 + </block>
  31 + <!-- <view class="border-img">
  32 + <image class="wh100" src="{{imgUrl}}/miniapp/images/order/new_dividing_line.png"></image>
  33 + </view> -->
  34 + </view>
  35 +
  36 +
  37 +
  38 + <!-- ----立即购买------ -->
  39 + <!-- <view class="xc-border xc-border"></view> -->
  40 + <block wx:if="{{is_b_now==1}}">
  41 + <view class="use-item bfff bdr_t-14 mgt20">
  42 + <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image>
  43 + <view>{{bn_pickname}}</view>
  44 + <!-- <view>门店:{{bn_pickname}}</view> -->
  45 + </view>
  46 + <view class="order-detail">
  47 + <view class="goods-img">
  48 + <image class="wh100 bdr14" src="{{bn_goods.original_img}}" binderror='cart_set_err' data-err="bn_goods.original_img"></image>
  49 + </view>
  50 + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}">
  51 + <view class="goods-name ellipsis-2">{{bn_goods.goods_name}}</view>
  52 + <!-- 商品属性 -->
  53 + <view class="flex-vertical fs28 xc-ash color-gray n_guige">
  54 + <view class="goods-color">
  55 + <block><text>{{filters.show_gui_ge(bn_goods.goods_spec,bn_goods.goods_color)}}</text></block>
  56 + </view>
  57 + </view>
  58 +
  59 + <!-----商品名称规格------>
  60 + <view class="order-num flex-space-between">
  61 + <view class="co-red">
  62 + <text wx:if="{{bn_goods.integral}}" class="fs36">{{bn_goods.integral}}积分</text>
  63 + <text wx:if="{{bn_goods.integral && bn_goods.shop_price}}">+</text>
  64 + <block wx:if="{{bn_goods.shop_price}}"> ¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></block>
  65 + </view>
  66 + <view class="goods-num">x{{bn_goods.buynum}}</view>
  67 + </view>
  68 + </navigator>
  69 +
  70 + </view>
  71 +
  72 + <view class="set-mes bdr_b-14">
  73 + <view wx:if="{{order.store_prom}}">
  74 + <icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}}
  75 + </view>
  76 +
  77 + <view class="xc-coupon-frame flex-center" data-bn="1" bindtap="open_coupon_list" data-pickid="{{bn_pick}}" wx:if="{{(selected_quan_list && selected_quan_list.length>0) || get_by_quan_list!=null}}">
  78 + <view class="work-frame flex-space-between">
  79 + <view class="work">
  80 + 优惠券 <text class="quan_num_show">{{(selected_quan_list?selected_quan_list.length:0)+ (get_by_quan_list?get_by_quan_list.length:0)}}张可用</text>
  81 + </view>
  82 + <view class="xc-right-frame">
  83 + <text wx:if="{{using_quan[bn_pick].is_nouse}}">不使用</text>
  84 + <block wx:else>
  85 + <text wx:if="{{using_quan[bn_pick].money}}">¥{{using_quan[bn_pick].money}}元优惠券</text>
  86 + <text wx:if="{{using_quan[bn_pick].isby}}">包邮券</text>
  87 + </block>
  88 + <view class="xc-right"></view>
  89 + </view>
  90 + </view>
  91 + </view>
  92 +
  93 + <view class="use-item flex-space-between">
  94 + <view class="flex">
  95 + <view bindtap='setexptype' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' style="padding-right:26rpx;display:{{bn_t_exp_t==2?'none':'flex;align-items:center;'}};">
  96 + <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon>
  97 + <view class="yu_er">门店自提</view>
  98 + </view>
  99 + <view bindtap='setexptype' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' style="display:{{bn_t_exp_t==1?'none':'flex;align-items:center;'}};">
  100 + <icon color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon>
  101 + <view class="yu_er">快递邮寄</view>
  102 + </view>
  103 + </view>
  104 + <block wx:if="{{bn_exp_type==0}}">
  105 + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index'>
  106 + <view class="logistics-name">{{wu_arr[index].name}}</view>
  107 + <view class="xc-right"></view>
  108 + </view>
  109 + </block>
  110 + </view>
  111 + </view>
  112 +
  113 + <view class="coupon-mes flex-vertical">
  114 + <view>留言</view>
  115 + <view class="leave-word">
  116 + <input placeholder-class="fs28" placeholder='给商家留言,最多100字' bindinput="keyUpChangeNum" disabled="{{disabled}}"
  117 + class="word-box" maxlength="100" name="user_note"></input>
  118 + </view>
  119 + </view>
  120 +
  121 + <!-- ---使用余额---- -->
  122 + <view class="set-mes bdr_t-14" wx:if="{{yuer>0 && formData.all_price>0}}">
  123 + <view class="use-item" bindtap='set_bn_useyuer'>
  124 + <icon color="{{bn_use_money?'red':'gray'}}" size="16" type="success"></icon>
  125 + <view class="yu_er">使用余额 :¥{{yuer}} </view>
  126 + </view>
  127 + </view>
  128 +
  129 + </block>
  130 +
  131 + <view class="information bdr14">
  132 + <view class="item" wx:if="{{formData.all_price>0}}">
  133 + <view>商品金额</view>
  134 + <view class="co-red">¥ {{formData.all_price}}元</view>
  135 + </view>
  136 + <view class="item" wx:if="{{formData.integral>0}}">
  137 + <view>可用积分{{integral_can}}</view>
  138 + <view class="co-red">{{formData.integral}}积分</view>
  139 + </view>
  140 + <view class="item" wx:if="{{formData.shipping_price>0}}">
  141 + <view>配送费用</view>
  142 + <view class="co-red">¥ {{formData.shipping_price}}元</view>
  143 + </view>
  144 + <view class="item" wx:if="{{formData.user_money>0}}">
  145 + <view>使用余额</view>
  146 + <view class="co-red">- ¥ {{formData.user_money}}元</view>
  147 + </view>
  148 + </view>
  149 + </view>
  150 +
  151 + <view class="btn-wrap shadow-1" wx:if="{{show_submit}}">
  152 + <view class="pay-amount">
  153 + <view class="payable">应付金额:<text class="co-red">¥{{formData.order_amount}}</text></view>
  154 + <view class="payable">应付积分:<text class="co-red">{{formData.integral}}积分</text></view>
  155 + </view>
  156 + <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button>
  157 + </view>
  158 +</form>
  159 +
  160 +<!----弹起选择物流名的列表---->
  161 +<view wx:if='{{open_express==1}}'>
  162 + <view class="cover-layer flex-center " bindtap='close_express'>
  163 + </view>
  164 +
  165 + <view class="cx-popup radius {{open_express==1?'up' : 'down'}}">
  166 + <view class="tops flex">
  167 + <view class="top-content fs32">
  168 + <view>选择物流名字</view>
  169 + </view>
  170 + <view class="close-frame" bindtap='close_express'>
  171 + <view class="xc-close-express">×</view>
  172 + </view>
  173 + </view>
  174 + <view class="express_list">
  175 + <view wx:for="{{wu_arr}}" wx:for-item="express_list" wx:for-index="idx">
  176 + <view class="express_list_frame" bindtap="click_express_name" data-shippingcode="{{express_list.shipping_code}}"
  177 + data-name="{{express_list.name}}" data-idxe="{{idx}}">
  178 +
  179 + <block wx:if="{{is_express==idx}}">
  180 + <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view>
  181 + </block>
  182 + <block wx:else>
  183 + <view class="circle xc-hooks"></view>
  184 + </block>
  185 + <view class="fs30">{{express_list.name}}</view>
  186 +
  187 + </view>
  188 + </view>
  189 + </view>
  190 + <view class="flex click-buttem">
  191 + <view class="xc-determine flex-center" bindtap="determine_expres">
  192 + <view class="flex-vertical t-c">确定</view>
  193 + </view>
  194 + <view class="xc-confirms flex-center" bindtap="select_default_logistics">
  195 + <view class="flex-vertical t-c">设为默认</view>
  196 + </view>
  197 + </view>
  198 +
  199 + </view>
  200 +</view>
  201 +
  202 +<warn id="warn"></warn>
... ...
pages/cart/cart2_inte/cart2_inte.wxss 0 → 100644
  1 +.bdr_t-14 {
  2 + border-top-left-radius: 14rpx;
  3 + border-top-right-radius: 14rpx;
  4 +}
  5 +.bdr_b-14 {
  6 + border-bottom-left-radius: 14rpx;
  7 + border-bottom-right-radius: 14rpx;
  8 +}
  9 +.bdr14 {
  10 + border-radius: 14rpx;
  11 +}
  12 +.mgt20 {
  13 + margin-top: 20rpx;
  14 +}
  15 +.shadow {
  16 + box-shadow: 0 4rpx 12px #e7e9eb;
  17 +}
  18 +.shadow-1 {
  19 + box-shadow: 16rpx 0px 12px #e7e9eb;
  20 +}
  21 +
  22 +
  23 +page {
  24 + /* background-color: #FAFAFA; */
  25 + background-color: #F0F0F0;
  26 + padding: 0 22rpx;
  27 + box-sizing: border-box;
  28 +}
  29 +.container {
  30 + background-color: #F0F0F0;
  31 + /* padding-top: 28rpx; */
  32 + padding-bottom: 120rpx;
  33 +}
  34 +.user-mes {
  35 + position: relative;
  36 + background-color: #fff;
  37 + font-size: 32rpx;
  38 + color: #444;
  39 + /* margin-top: 28rpx; */
  40 + border-radius: 14rpx;
  41 +}
  42 +.user-contact {
  43 + padding: 24rpx 26rpx;
  44 + font-weight: 600;
  45 +}
  46 +
  47 +.location {
  48 + position: relative;
  49 + padding: 0 70rpx 24rpx;
  50 +}
  51 +
  52 +.pos-icon {
  53 + position: absolute;
  54 + left: 28rpx;
  55 + top: 6rpx;
  56 + width: 30rpx;
  57 + height: 36rpx;
  58 +}
  59 +
  60 +.border-img {
  61 + width: 100%;
  62 + height: 12rpx;
  63 +}
  64 +
  65 +.update-logistics {
  66 + position: absolute;
  67 + right: 0;
  68 + top: 0;
  69 + width: 80rpx;
  70 + height: 100%;
  71 + display: flex;
  72 + align-items: center;
  73 + justify-content: center;
  74 +}
  75 +
  76 +.arrow-rigth {
  77 + width: 32rpx;
  78 + height: 32rpx;
  79 +}
  80 +
  81 +.order-meg {
  82 + margin-bottom: 20rpx;
  83 + font-size: 28rpx;
  84 +
  85 +}
  86 +
  87 +.order-detail {
  88 + padding: 30rpx 0;
  89 + border-bottom: 2rpx solid #eee;
  90 + color: #777;
  91 + min-height: 190rpx;
  92 + background-color: #fff;
  93 +
  94 +}
  95 +
  96 +.goods-img {
  97 + float: left;
  98 + width: 200rpx;
  99 + height: 200rpx;
  100 + margin: 0 20rpx;
  101 +}
  102 +
  103 +.order-cont {
  104 + float: left;
  105 + width: 438rpx;
  106 +}
  107 +
  108 +.goods-name {
  109 + height: 74rpx;
  110 + line-height: 40rpx;
  111 + overflow: hidden;
  112 + margin-bottom: 16rpx;
  113 + font-size: 28rpx;
  114 + color: #333;
  115 +
  116 +}
  117 +
  118 +.goods-color {
  119 + font-size: 24rpx;
  120 +}
  121 +
  122 +.order-num {
  123 + margin-top: 25rpx;
  124 + font-size: 24rpx;
  125 + line-height: 42rpx;
  126 +}
  127 +
  128 +.set-mes{
  129 + background-color: #fff;
  130 + /* margin-top: 20rpx; */
  131 +}
  132 +.use-item{
  133 + display: flex;
  134 + align-items: center;
  135 + height: 80rpx;
  136 + /* border-bottom: 1px solid #ddd; */
  137 + font-size: 30rpx;
  138 + /* width:95%;
  139 +margin:auto; */
  140 + padding: 0 26rpx;
  141 +}
  142 +.use-item>view{
  143 + display: flex;
  144 + /* margin-right: 12rpx; */
  145 +}
  146 +.use-item.bfff{
  147 + background-color: #fff;
  148 +}
  149 +.use-item .dp{
  150 + display: block;
  151 + width: 50rpx;
  152 + height: 50rpx;
  153 + margin-left: -6rpx;
  154 +}
  155 +
  156 +.set-item {
  157 + justify-content: space-between;
  158 + background-color: #fff;
  159 +}
  160 +
  161 +.set-btn {
  162 + display: flex;
  163 + font-size: 24rpx;
  164 +}
  165 +
  166 +.set-mes input {
  167 + width: 380rpx;
  168 + height: 50rpx;
  169 + line-height: 50rpx;
  170 + border: 1px solid #ddd;
  171 +}
  172 +
  173 +.use-btn {
  174 + width: 100rpx;
  175 + height: 50rpx;
  176 + margin-left: 20rpx;
  177 + line-height: 50rpx;
  178 + text-align: center;
  179 + background-color: #f23030;
  180 + color: #fff;
  181 +}
  182 +
  183 +.coupon-mes {
  184 + /* box-sizing: border-box; */
  185 + height:95rpx;
  186 + padding: 0 26rpx;
  187 + background-color: #fff;
  188 + font-size: 30rpx;
  189 + color: #444;
  190 + /* width: 100%; */
  191 + border-radius: 14rpx;
  192 + margin-top: 20rpx;
  193 + margin-bottom: 20rpx;
  194 +}
  195 +
  196 +.coupon-title {
  197 + display: flex;
  198 + justify-content: space-between;
  199 + align-items: center;
  200 + height: 92rpx;
  201 +}
  202 +
  203 +.coupon-title>view {
  204 + display: flex;
  205 +}
  206 +
  207 +.coupon-num {
  208 + height: 36rpx;
  209 + margin-left: 20rpx;
  210 + padding: 0 16rpx;
  211 + line-height: 36rpx;
  212 + text-align: center;
  213 + background-color: #f23030;
  214 + color: #fff;
  215 + font-size: 24rpx;
  216 +}
  217 +
  218 +.leave-word {
  219 + position: relative;
  220 + font-size: 24rpx;
  221 + margin-left: 20rpx;
  222 + flex-grow: 1;
  223 +}
  224 +
  225 +.word-box {
  226 + font-size: 26rpx;
  227 + /* width: 600rpx; */
  228 + padding: 10rpx;
  229 + height: 28rpx;
  230 + line-height: 40rpx;
  231 +}
  232 +
  233 +.max-word {
  234 + position: absolute;
  235 + right: 0;
  236 + bottom: 0;
  237 +}
  238 +
  239 +.information {
  240 + padding: 0 26rpx;
  241 + background-color: #fff;
  242 + /* margin-bottom: 120rpx; */
  243 +}
  244 +
  245 +.information .item {
  246 + display: flex;
  247 + justify-content: space-between;
  248 + height: 60rpx;
  249 + line-height: 60rpx;
  250 + font-size: 26rpx;
  251 + color: #777;
  252 +}
  253 +
  254 +.btn-wrap {
  255 + height: 94rpx;
  256 + box-sizing: border-box;
  257 + display: flex;
  258 + justify-content: space-between;
  259 + background-color: white;
  260 + align-items: center;
  261 + position: fixed;
  262 + bottom: 0;
  263 + left: 0;
  264 + width: 100%;
  265 + padding: 0 30rpx;
  266 +}
  267 +
  268 +.tips-btn {
  269 + /* float: right;
  270 + width: 200rpx;
  271 + height: 100rpx;
  272 + line-height: 100rpx;
  273 + text-align: center;
  274 + font-size: 30rpx;
  275 + color: #fff;
  276 + background-color: #f23030; */
  277 + color: white;
  278 + background-color: #FE4445;
  279 + height: 72rpx;
  280 + line-height: 72rpx;
  281 + padding: 0 42rpx;
  282 + border-radius: 36rpx;
  283 + margin-left: 0;
  284 + margin-right: 0;
  285 +}
  286 +
  287 +.pay-amount {
  288 + /* float: right;
  289 + display: flex;
  290 + align-items: center;
  291 + height: 100rpx;
  292 + font-size: 26rpx;
  293 + margin-right: 40rpx; */
  294 +}
  295 +
  296 +.payable {
  297 + color: #444;
  298 + /* margin-right: 20rpx; */
  299 +}
  300 +
  301 +.shipping-modal {
  302 + z-index: 20;
  303 + position: fixed;
  304 + bottom: 0;
  305 + left: 0;
  306 + right: 0;
  307 + overflow-y: hidden;
  308 + color: #666666;
  309 + background-color: white;
  310 +}
  311 +
  312 +.shipping-nav {
  313 + text-align: center;
  314 + font-size: 35rpx;
  315 + padding-top: 30rpx;
  316 +}
  317 +
  318 +.shipping-list {
  319 + padding: 20rpx 30rpx 40rpx;
  320 + font-size: 28rpx;
  321 +}
  322 +
  323 +.shipping-item {
  324 + display: block;
  325 + padding: 20rpx 0;
  326 +}
  327 +
  328 +.shipping-btn {
  329 + width: 100%;
  330 + color: white;
  331 + background-color: #f23030;
  332 + line-height: 90rpx;
  333 + text-align: center;
  334 + font-size: 40rpx;
  335 +}
  336 +
  337 +/*----------nyf新增,地址---------*/
  338 +.add_new{
  339 + height: 90rpx;
  340 + display: flex;
  341 + align-items: center;
  342 + padding: 0 26rpx;
  343 +}
  344 +.addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd;
  345 + margin-right: 15rpx;vertical-align: middle;}
  346 +.yu_er{
  347 + margin-left: 10rpx;
  348 + /* margin-right: 60rpx; */
  349 +}
  350 +.wuliu{margin-left: 20rpx;}
  351 +
  352 +
  353 +/*---- 优惠券列表 -----*/
  354 +.xc-coupon-frame{
  355 + width: 100%;
  356 + height: 92rpx;
  357 +
  358 +}
  359 +.xc-coupon-frame .work-frame{
  360 + width: 100%;
  361 + height: 100%;
  362 + border-bottom:3rpx solid #eee;
  363 + padding: 0 26rpx;
  364 + background-color: white;
  365 +}
  366 +.xc-right{
  367 + width:20rpx;
  368 + height:20rpx;
  369 + border-top:2rpx solid #000;
  370 + border-right:2rpx solid #000;
  371 + transform:rotate(45deg);
  372 + display:inline-block;
  373 +}
  374 +
  375 +.xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; }
  376 +.xc-right-frame{font-size: 30rpx;line-height: 92rpx; margin-right: 10rpx }
  377 +
  378 +/* 自定义弹出窗口 */
  379 +.cx-popup{
  380 + width:100%;
  381 + height:880rpx;
  382 + background: #fff;
  383 + z-index: 35;
  384 + border-top-left-radius: 20rpx;
  385 + border-top-right-radius: 20rpx;
  386 + position:fixed;
  387 + bottom:0;
  388 + left: 0;
  389 + /* padding-bottom: 25rpx; */
  390 +}
  391 +
  392 +.cx-popup .top{
  393 + width:95%;
  394 + height:100rpx;
  395 + border-bottom:3rpx solid #ddd;
  396 + margin: auto;
  397 + margin-top: 30rpx;
  398 +
  399 +}
  400 +.xc-top-content{
  401 + width: 93%;
  402 + height:85rpx;
  403 + padding-top: 30rpx;
  404 + font-size: 34rpx;
  405 + font-weight: 600;
  406 +
  407 +}
  408 +
  409 +
  410 +.xc-valid-coupon{
  411 + width: 90%;
  412 + height:40rpx;
  413 + padding-top: 24rpx;
  414 + overflow: hidden;
  415 +}
  416 +.xc-frame{
  417 + width: 100%;
  418 + height:60%;
  419 +}
  420 +
  421 +.xc-frame .list-frame{
  422 + width: 95%;
  423 + height: 100%;
  424 + overflow-y:scroll;
  425 +
  426 +}
  427 +.xc-close-frame{
  428 + margin-top:-10rpx;
  429 +
  430 +}
  431 +
  432 +.xc-close{
  433 + width: 37rpx;
  434 +height: 37rpx;
  435 +border-radius: 50%;
  436 +border: 3rpx solid #333;
  437 +text-align: center;
  438 +line-height: 34rpx;
  439 +font-size: 29rpx;
  440 +color: #333;
  441 +
  442 +}
  443 +.xc-money{
  444 + color: #af2346;
  445 + font-size: 35rpx;
  446 +}
  447 +
  448 +.xc-money-frame{
  449 + margin-left:35rpx;
  450 +
  451 +}
  452 +.xc-coupon-effect{
  453 + width: 99%;
  454 + min-height: 100rpx;
  455 + border-bottom:3rpx solid #ddd;
  456 +
  457 +
  458 +}
  459 +.xc-goods-coupon{
  460 + width: 85%;
  461 + height:100%;
  462 +
  463 +}
  464 +.xc-title{
  465 + width:50%;
  466 + margin-left:222rpx;
  467 +
  468 +}
  469 +.xc-coupon-money0{
  470 + color: #c91e31;
  471 + font-size: 35rpx;
  472 + line-height: 40rpx;
  473 +
  474 +}
  475 +.xc-coupon-money{
  476 + color: #c91e31;
  477 + font-size: 35rpx;
  478 + line-height: 40rpx;
  479 + padding-top: 10px;
  480 +
  481 +}
  482 +.xc-coupon-money1{
  483 + color: #444;
  484 + font-size: 28rpx;
  485 + line-height: 60rpx;
  486 +
  487 +
  488 +}
  489 +.xc-coupon-time{
  490 + height: 50rpx;
  491 + font-size: 27rpx;
  492 + color: #a4a4a4;
  493 +}
  494 +.xc-coupon-time .time{
  495 + margin-left: 15rpx;
  496 + font-size: 27rpx;
  497 +}
  498 +.xc-coupon-selection{
  499 + height:100%;
  500 +}
  501 +
  502 +.xc-confirm {
  503 + width: 50%;
  504 + border-radius: 50rpx;
  505 + height: 80rpx;
  506 + margin:0 auto;
  507 + background:#d60021;
  508 + color:#fff;
  509 + font-size:28rpx;
  510 + margin-top: 28rpx;
  511 +}
  512 +
  513 +.up{ animation: up .7s; }
  514 +.down{ animation: down 1s; }
  515 +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } }
  516 +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } }
  517 +
  518 +.xc-not-Selection{
  519 + width: 40rpx;
  520 +height: 40rpx;
  521 + background: #eeeeee;
  522 +}
  523 +
  524 +
  525 +.xc-close-express{
  526 + width: 40rpx;
  527 +height: 40rpx;
  528 +border-radius: 50%;
  529 +border: 3rpx solid #333;
  530 +text-align: center;
  531 +font-size:32rpx;
  532 +line-height: 38rpx;
  533 +color: #333;
  534 +margin-top: 5rpx;
  535 +}
  536 +.cx-popup .tops{
  537 + width: 100%;
  538 +height: 145rpx;
  539 +border-bottom: 3rpx solid #eee;
  540 +
  541 +}
  542 +.top-content {
  543 + width: 82%;
  544 +padding-top: 33px;
  545 +height: 100%;
  546 +padding-left: 40rpx;
  547 +}
  548 +.close-frame{
  549 + margin-top: 30rpx;
  550 +
  551 +}
  552 +
  553 +.xc-hook {
  554 +width: 33rpx;
  555 +height: 33rpx;
  556 +transform: rotate(-135deg);
  557 +line-height: 35rpx;
  558 +text-align: center;
  559 +margin-right: 20rpx
  560 +
  561 +
  562 +}
  563 +.xc-hooks {
  564 +width: 30rpx;
  565 +height: 30rpx;
  566 +border: 1rpx solid #999;
  567 +margin-right: 20rpx;
  568 +}
  569 +.express_list_frame{
  570 + display: flex;
  571 +height: 80rpx;
  572 +align-items: center;
  573 +padding-left: 40rpx;
  574 +border-bottom: 1rpx solid #eee;
  575 +
  576 +}
  577 +.express_list{
  578 + width: 100%;
  579 + height: 65%;
  580 + overflow-y: auto;
  581 + margin-bottom: 40rpx;
  582 +
  583 +}
  584 +.xc-confirms {
  585 + box-sizing: border-box;
  586 + width: 40%;
  587 + border-radius: 50rpx;
  588 + height: 80rpx;
  589 + margin:0 auto;
  590 + font-size:28rpx;
  591 + background: #fff;
  592 + color: #333;
  593 + border: 2rpx solid #333;
  594 +}
  595 +
  596 +
  597 +/* 优惠券的改版样式 */
  598 +.xc-coupon-frame{
  599 + /* width: 710rpx; */
  600 + width: 100%;
  601 + height:auto;
  602 + margin: 0 auto;
  603 +
  604 +}
  605 +.xc-coupon-frame .coupon-frame{
  606 + width: 100%;
  607 + height: 200rpx;
  608 + margin-top:10rpx;
  609 + border-bottom: 1rpx solid #eee;
  610 +
  611 +}
  612 +.xc-coupon-frame .coupon-frame .coupon-left{
  613 + width: 215rpx;
  614 + height:100%;
  615 + overflow: hidden;
  616 +}
  617 +.xc-money-frames{
  618 + width:96%;
  619 + margin-top: -10px;
  620 +}
  621 +
  622 +.xc-rmb-symbol{
  623 + font-size:40rpx;
  624 +
  625 +}
  626 +
  627 +.xc-rmb-val{
  628 + font-size:60rpx;
  629 +
  630 +}
  631 +.coupon-explain{
  632 + font-size:25rpx;
  633 +width:100%;
  634 +
  635 +
  636 +}
  637 +.xc-valuer{
  638 + margin-top:39rpx;
  639 + margin-left:28rpx;
  640 + font-size:25rpx;
  641 +}
  642 +.coupon-frame .oval{
  643 + width:155rpx;
  644 + height:83rpx;
  645 + border-radius: 50%;
  646 + right:-78rpx;
  647 + top:-37rpx;
  648 +}
  649 +.coupon-right{
  650 + /* width:490rpx; */
  651 + height: 99%;
  652 + border-top: 1rpx solid #eaeaea;
  653 + /* //border-bottom: 1rpx solid #eaeaea; */
  654 + border-right: 1rpx solid #eaeaea;
  655 + flex-grow: 1;
  656 +}
  657 +.coupon-annotation{
  658 + width: 95%;
  659 + height: 100%;
  660 +
  661 +}
  662 +.xc-brand{
  663 + width:100rpx;
  664 + height:35rpx;
  665 + line-height: 35rpx;
  666 + font-size:21rpx;
  667 + border-radius:10rpx; position: relative; top:-1px;
  668 + margin-right: 8rpx
  669 +}
  670 +.top-frame{
  671 + width:82%;
  672 + height: 75rpx;
  673 + margin-top:10rpx;
  674 +}
  675 +.top-frame .coupon-wode{
  676 + font-size: 25rpx;
  677 + margin-left:10rpx;
  678 + width:340rpx;
  679 + height:88rpx;
  680 +}
  681 +.coupon-code{
  682 + width:60rpx;
  683 + height:60rpx;
  684 + margin-top:5rpx;
  685 +
  686 +}
  687 +.frame{
  688 + width: 100%
  689 +}
  690 +.coupon-time{
  691 + font-size: 23rpx;
  692 + line-height:33rpx;
  693 + color: #333;
  694 +}
  695 +
  696 +.clik-get{
  697 + width:125rpx;
  698 + height:45rpx;
  699 + border-radius: 25rpx;
  700 + line-height: 45rpx;
  701 + font-size:25rpx;
  702 + bottom:67rpx;
  703 + right:6px;
  704 +}
  705 +
  706 +.code-img{
  707 + margin-left:20rpx;
  708 +}
  709 +.bottmo-explain{
  710 +top:145rpx;
  711 +width:94%;
  712 +border-top:1rpx dashed #eee;
  713 +padding-top:8rpx;
  714 +height:38rpx;
  715 +line-height: 51rpx;
  716 +
  717 +}
  718 +.font-word{
  719 + font-size: 22rpx;
  720 +}
  721 +.circle-size{
  722 + background: #a0a0a0;
  723 + width: 27rpx;
  724 + height: 27rpx;
  725 + margin-top:13rpx;
  726 +margin-left:8rpx;
  727 +display: flex;
  728 +
  729 +align-items: center;
  730 +}
  731 +.xc-jiantou{
  732 + /* width: 9rpx;
  733 + height: 9rpx; */
  734 + /* border-top: 2rpx solid #fff;
  735 + border-right: 2rpx solid #fff; */
  736 + transform: rotate(-90deg);
  737 + color: #fff;
  738 + font-size: 15rpx;
  739 + /* display:inline-block;
  740 + margin-top: 6.5rpx; */
  741 + text-align: center;
  742 +width: 24rpx;
  743 +}
  744 +.xc-buttom{
  745 + box-sizing: border-box;
  746 + width:100%;
  747 + min-height:76rpx;
  748 + height:auto;
  749 + line-height:40rpx;
  750 + border-left:1rpx solid #eee;
  751 + border-right:1rpx solid #eee;
  752 + border-bottom:1rpx solid #eee;
  753 +/* margin-left: 6rpx; */
  754 +}
  755 +
  756 +.goods-num{
  757 + font-size: 28rpx;
  758 + color: #333;
  759 +}
  760 +
  761 +.explain-coupon{
  762 + font-size:25rpx;
  763 + padding: 10rpx 10rpx
  764 +}
  765 +.circle-frame{
  766 + width: 20rpx;
  767 + height: auto;
  768 + z-index:1;
  769 + left:210rpx;
  770 +
  771 +}
  772 +.circle-sawtooth{
  773 + width: 11rpx;
  774 + height: 11rpx;
  775 + background: #fff;
  776 +}
  777 +
  778 +.red{background-color: #fe7496;}
  779 +.green{ background-color: #22c7c1;}
  780 +.blue{background-color:#5e82e3;}
  781 +.g_gray{background-color: #aaaaaa}
  782 +
  783 +.f_text{text-align: center; height:96rpx; }
  784 +.xc-hook.sn {
  785 + margin-top:12%;
  786 +width:45rpx;
  787 +height:45rpx;
  788 +font-size:28rpx;
  789 +line-height:44rpx;
  790 +
  791 +
  792 +}
  793 +.xc-hooks.on{
  794 + margin-top:12%;
  795 +width:42rpx;
  796 +height:42rpx;
  797 +}
  798 +.may_use_coupon{
  799 + /* width: 95%; */
  800 + /* height: 68rpx; */
  801 + line-height:78rpx;
  802 + padding: 0 26rpx;
  803 + justify-content: space-between;
  804 + align-items: center;
  805 +}
  806 +.determine-frame{
  807 + width: 100%;
  808 + height: 130rpx;
  809 +
  810 +}
  811 +.xc-determine{
  812 + height: 80rpx;
  813 + width: 40%;
  814 + border-radius: 50rpx;
  815 +background: #d60021;
  816 +color: #fff;
  817 +font-size: 28rpx;
  818 +margin: 0 auto;
  819 +
  820 +}
  821 +.click-buttem{
  822 +width: 90%;
  823 +margin: auto;
  824 +}
  825 +.logistics-name{
  826 + margin-right:20rpx;
  827 +}
  828 +.xc-border{
  829 + border-top:8rpx solid #eee;
  830 +width: 100%
  831 +}
  832 +.main-top{
  833 +margin-top: 20rpx;
  834 +
  835 +}
  836 +.xc-hookts{
  837 +border: 1rpx solid #999;
  838 +
  839 +}
  840 +.xc-hookts.on{
  841 + width:30rpx;
  842 +height:30rpx;
  843 +
  844 +}
  845 +.xc-hookt.sn{
  846 + width: 32rpx;
  847 +height: 32rpx;
  848 +font-size: 28rpx;
  849 +line-height: 34rpx;
  850 +}
  851 +.xc-hookt{
  852 + transform: rotate(-135deg);
  853 +text-align: center;
  854 +
  855 +}
  856 +.main-bottom{
  857 + margin-bottom: 20rpx;
  858 +
  859 +}
  860 +.xc-hookst{
  861 + border: 1rpx solid #999;
  862 +
  863 +}
  864 +.xc-hookst.ons{
  865 + width: 42rpx;
  866 +height: 42rpx;
  867 +margin-left: 20rpx;
  868 +
  869 +}
  870 +.is_use_coupon{
  871 + width: 65%;
  872 +justify-content: flex-end;
  873 +padding-top: 10rpx;
  874 +
  875 +
  876 +}
  877 +.xc-hooka{
  878 + transform: rotate(-135deg);
  879 +text-align: center;
  880 +
  881 +}
  882 +.xc-hooka.sn{
  883 + width: 45rpx;
  884 +height: 45rpx;
  885 +font-size: 28rpx;
  886 +line-height: 44rpx;
  887 +margin-left: 20rpx;
  888 +
  889 +}
  890 +.color-gray{
  891 + color: #808080;
  892 +}
  893 +.n_guige{ display: inline-block; background:rgb(236, 236, 236); color: rgb(63,63,63); padding: 3rpx 10rpx; border-radius: 3rpx }
  894 +.gift_image{ width: 60rpx; height: 60rpx; position: absolute; top: 0; left: 0}
  895 +
  896 +.quan_num_show{ padding: 4rpx 6rpx; background-color:#ea5551; color:#fff; border-radius: 6rpx;margin-left:10rpx;font-size:24rpx;}
  897 +
  898 +.navigator-hover {
  899 + background: none;
  900 + opacity: 1;
  901 +}
  902 +
  903 +
  904 +.plus_buy{
  905 + background-color: #fff;
  906 + margin:15rpx 0;
  907 + padding: 20rpx 10rpx;
  908 + position: relative;
  909 +}
  910 +
  911 +
  912 +.card_bg {
  913 + box-sizing: border-box;
  914 + padding: 2rpx 10rpx;
  915 + height: 28rpx;
  916 + border-radius: 26rpx;
  917 + font-size: 18rpx;
  918 + line-height: 28rpx;
  919 + max-width: 210rpx;
  920 + background: #333;
  921 + color: #fff;
  922 + margin-left: 8rpx;
  923 + position:relative;
  924 + top:7rpx;
  925 +}
  926 +
  927 +.card_bg image {
  928 + width: 19rpx;
  929 + height: 19rpx;
  930 + margin-right: 8rpx;
  931 +}
  932 +
  933 +/* .card_bg .card_name {
  934 + max-width: 76rpx;
  935 + width: auto;
  936 + overflow: hidden;
  937 + white-space: nowrap;
  938 +} */
  939 +
  940 +.card_name {
  941 + position: relative;
  942 + top: -4rpx;
  943 + margin-left: 6px;
  944 +}
  945 +
  946 +.car_tri_up {
  947 + width: 0;height: 0;
  948 + border-left: 20rpx solid transparent;
  949 + border-right: 20rpx solid transparent;
  950 + border-bottom: 20rpx solid #fff;
  951 + position: absolute;
  952 + right: 20rpx;
  953 + top:-10rpx
  954 +}
  955 +.card_op{
  956 + position: absolute;
  957 + right: 20rpx;
  958 + top:36rpx
  959 +}
  960 +
... ...
pages/cart/cart2_inte/filter.wxs 0 → 100644
  1 +var format = function (text) {
  2 + if (!text) {
  3 + return
  4 + }
  5 + var reg = getRegExp('\\\\n', 'g')
  6 + return text.replace(reg, '\n')
  7 +}
  8 +
  9 +module.exports = {
  10 + format: format
  11 +}
... ...
pages/goods/goodsInfo/buy_integral.wxml 0 → 100644
  1 +<view bindtap="closeSpecModal_inte" class="cover-layer"></view>
  2 + <view class="spec-model">
  3 + <view class="pding">
  4 + <icon bindtap="closeSpecModal_inte" class="modal-close" color="black" size="22" type="cancel"></icon>
  5 + <view class="spec-goods">
  6 + <image class="wh100 spec-img xc-distance-bottom" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image>
  7 + <view class="spec-goods-info">
  8 + <view class="spec-goods-name ellipsis-2">{{data.goods_name}}</view>
  9 + <view class="flex ai_end xc-val-money">
  10 + <view class="spec-goods-price">
  11 + <text wx:if="{{prom_integral}}">{{prom_integral}}积分</text>
  12 + <text wx:if="{{prom_integral && prom_price}}">+</text>
  13 + <text wx:if="{{prom_price}}">{{prom_price}}元</text>
  14 + </view>
  15 + </view>
  16 +
  17 +
  18 + <view class="flex">
  19 + <view class="spec-goods-stock">已售:{{prom_act.buy_num}}</view>
  20 + <view class="spec-goods-stock">可售:{{prom_act.limitqty-prom_act.buy_num}}</view>
  21 + </view>
  22 +
  23 + </view>
  24 +
  25 + <!-- 选择门店模块 -->
  26 + <view class="flex-space-between address ai_end xc-width ">
  27 +
  28 + <view class="flex ai_end" wx:if="{{def_pick_store}}">
  29 + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
  30 + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
  31 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  32 +
  33 + </view>
  34 + </view>
  35 +
  36 + <!-- 没有门店的时候 -->
  37 + <view class="flex" bindtap="choice_store" wx:else>
  38 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  39 + <view class="fs30" style="color:black;">选择门店</view>
  40 + </view>
  41 +
  42 + <view class="red-co fs28" bindtap="choice_store" >
  43 + 更多门店
  44 + <text class="right-arrow"></text>
  45 + </view>
  46 + </view>
  47 + <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>
  48 + <block wx:else>
  49 + <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
  50 + <block wx:else>
  51 + <view wx:if="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view>
  52 + </block>
  53 + </block>
  54 +
  55 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view>
  56 +
  57 +
  58 + <!--商品的属性项目-->
  59 + <view class="xc-goods-attribute">
  60 + <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
  61 + <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">
  62 + <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">
  63 + {{item.gg}}
  64 + </view>
  65 + </view>
  66 + </view>
  67 +
  68 + <view class="b_num">
  69 + <view>购买数量</view>
  70 + <view class="count">
  71 + <view bindtap="subCartNum_inte" class="sub">-</view>
  72 + <input bindblur="inputCartNum_inte" type="number" value="{{goodsInputNum}}"></input>
  73 + <view bindtap="addCartNum_inte" class="add">+</view>
  74 + </view>
  75 + </view>
  76 + </view>
  77 +
  78 + <!-- 按钮部分 -->
  79 + <view class="spec-cart-btns">
  80 + <!-- 根本就找不到门店 -->
  81 + <block wx:if="{{!only_pk && !def_pickpu_list}}">
  82 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  83 + </block>
  84 + <block wx:else>
  85 +
  86 +
  87 + <block wx:if="{{only_pk.length && !only_pk.length}}">
  88 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  89 + </block>
  90 + <block wx:else>
  91 + <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">
  92 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  93 + </block>
  94 + <block wx:else>
  95 + <block wx:if="{{!def_pick_store}}">
  96 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view>
  97 + </block>
  98 + <block wx:else>
  99 + <block wx:if="{{data.store_count<=0}}">
  100 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  101 + </block>
  102 + <block wx:else>
  103 + <view bindtap="addCart_inte" class="spec-cart-btn spec-buy" data-action="buy">立即兑换</view>
  104 + </block>
  105 +
  106 + </block>
  107 + </block>
  108 + </block>
  109 + </block>
  110 + </view>
  111 +
  112 +
  113 + </view>
  114 + </view>
  115 + <view class="clear"></view>
0 116 \ No newline at end of file
... ...
pages/goods/goodsInfo/buy_integral_normal.wxml 0 → 100644
  1 +<view bindtap="closeSpecModal_inte_normal" class="cover-layer"></view>
  2 + <view class="spec-model">
  3 + <view class="pding">
  4 + <icon bindtap="closeSpecModal_inte_normal" class="modal-close" color="black" size="22" type="cancel"></icon>
  5 + <view class="spec-goods">
  6 + <image class="wh100 spec-img xc-distance-bottom" src="{{sele_g.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image>
  7 + <view class="spec-goods-info">
  8 + <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view>
  9 + <view class="flex ai_end xc-val-money">
  10 + <text class="fs20">¥</text>
  11 + <!-- 如果是等级会员,且有等级价 -->
  12 + <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}} </block>
  13 + <block wx:else>{{sele_g.shop_price}}</block>
  14 + </view>
  15 +
  16 + <view class="flex">
  17 + <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>
  18 + <block wx:if="{{sales_rules==2}}">
  19 + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view>
  20 + <view class="spec-goods-stock" wx:else>可售:0</view>
  21 + </block>
  22 + <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block>
  23 + </view>
  24 +
  25 +
  26 + </view>
  27 +
  28 + <!-- 选择门店模块 -->
  29 + <view class="flex-space-between address ai_end xc-width ">
  30 +
  31 + <view class="flex ai_end" wx:if="{{def_pick_store}}">
  32 + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
  33 + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
  34 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  35 +
  36 + </view>
  37 + </view>
  38 +
  39 + <!-- 没有门店的时候 -->
  40 + <view class="flex" bindtap="choice_store" wx:else>
  41 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  42 + <view class="fs30" style="color:black;">选择门店</view>
  43 + </view>
  44 +
  45 + <view class="red-co fs28" bindtap="choice_store" >
  46 + 更多门店
  47 + <text class="right-arrow"></text>
  48 + </view>
  49 + </view>
  50 + <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>
  51 + <block wx:else>
  52 + <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
  53 + <block wx:else>
  54 + <view wx:if="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view>
  55 + </block>
  56 + </block>
  57 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view>
  58 +
  59 +
  60 + <!--商品的属性项目-->
  61 + <view class="xc-goods-attribute">
  62 + <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
  63 + <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">
  64 + <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">
  65 + {{item.gg}}
  66 + </view>
  67 + </view>
  68 + </view>
  69 +
  70 + <view class="b_num">
  71 + <view>购买数量</view>
  72 + <view class="count">
  73 + <view bindtap="subCartNum" class="sub">-</view>
  74 + <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input>
  75 + <view bindtap="addCartNum" class="add">+</view>
  76 + </view>
  77 + </view>
  78 + </view>
  79 +
  80 + <!-- 按钮部分 -->
  81 + <view class="spec-cart-btns">
  82 + <!-- 根本就找不到门店 -->
  83 + <block wx:if="{{!only_pk && !def_pickpu_list}}">
  84 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  85 + </block>
  86 + <block wx:else>
  87 +
  88 +
  89 + <block wx:if="{{only_pk.length && !only_pk.length}}">
  90 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  91 + </block>
  92 + <block wx:else>
  93 + <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">
  94 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  95 + </block>
  96 + <block wx:else>
  97 + <block wx:if="{{!def_pick_store}}">
  98 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view>
  99 + </block>
  100 + <block wx:else>
  101 + <block wx:if="{{data.store_count<=0}}">
  102 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  103 + </block>
  104 + <block wx:else>
  105 + <view class="flex jc_sb">
  106 + <view class="spec-cart-btn spec-buy w40" bindtap="addCart"
  107 + data-action="add" style="background-color: #ffb03f;">加入购物车</view>
  108 + <view class="spec-cart-btn spec-buy w40" bindtap="addCart"
  109 + data-action="buy">立即购买</view>
  110 + </view>
  111 + </block>
  112 +
  113 + </block>
  114 + </block>
  115 + </block>
  116 + </block>
  117 + </view>
  118 +
  119 +
  120 + </view>
  121 + </view>
  122 + <view class="clear"></view>
0 123 \ No newline at end of file
... ...
pages/goods/goodsInfo/buy_pt.wxml 0 → 100644
  1 +<view bindtap="closeSpecModal" class="cover-layer"></view>
  2 + <view class="spec-model">
  3 + <view class="pding">
  4 + <icon bindtap="closeSpecModal" class="modal-close" color="gray" size="22" type="cancel"></icon>
  5 +
  6 + <!-- 商品名称 -->
  7 + <view class="spec-goods">
  8 + <image class="wh100 spec-img xc-distance-bottom" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image>
  9 + <view class="spec-goods-info">
  10 + <view class="spec-goods-name ellipsis-1">{{sele_g.goods_name}}</view>
  11 + <view class="flex ai_end xc-val-money {{sele_g[card_field]}}" >
  12 + <view class="spec-goods-price" wx:if="{{is_normal==1}}" >
  13 + <!-- 如果是等级会员,且有等级价 -->
  14 + <block wx:if="{{card_field && sele_g[card_field]>0}}">
  15 + ¥ {{sele_g[card_field]}}
  16 + </block>
  17 + <block wx:else>
  18 + ¥ {{sele_g.shop_price}}
  19 + </block>
  20 + </view>
  21 + <view class="spec-goods-price" wx:else>¥ {{prom_price}}</view>
  22 + </view>
  23 +
  24 + <block wx:if="{{is_normal==1}}">
  25 + <view class="flex">
  26 + <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>
  27 + <block wx:if="{{sales_rules==2}}">
  28 + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view>
  29 + <view class="spec-goods-stock" wx:else>可售:0</view>
  30 + </block>
  31 + <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block>
  32 + </view>
  33 + </block>
  34 + <block wx:if="{{is_normal==0}}">
  35 + <view class="flex">
  36 + <view class="spec-goods-stock" wx:if="{{prom_st>0}}">已售:{{prom_act.buy_num}}</view>
  37 + <view class="spec-goods-stock" wx:else >已售:{{prom_act.buy_num}}</view>
  38 + <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view>
  39 + </view>
  40 + </block>
  41 + </view>
  42 +
  43 + </view>
  44 +
  45 +
  46 + <view style="clear: both"></view>
  47 + <view style="margin-top: 20rpx">
  48 + <view class="flex-space-between address ai_end xc-width ">
  49 +
  50 + <view class="flex ai_end" wx:if="{{def_pick_store}}">
  51 + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
  52 + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
  53 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  54 +
  55 + </view>
  56 + </view>
  57 +
  58 + <!-- 没有门店的时候 -->
  59 + <view class="flex" bindtap="choice_store" wx:else>
  60 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  61 + <view class="fs28 xc-ash-9f">选择门店</view>
  62 + </view>
  63 +
  64 + <view class="red-co fs28" bindtap="choice_store" >
  65 + 更多门店
  66 + <text class="right-arrow"></text>
  67 + </view>
  68 + </view>
  69 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view>
  70 + </view>
  71 + <!----商品的属性项目---->
  72 + <view>
  73 + <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
  74 + <block wx:if="{{is_normal==0}}">
  75 + <view hidden="{{ismend==1}}" class="flex">
  76 + <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">{{item.gg}}
  77 + </view>
  78 + </view>
  79 + </block>
  80 +
  81 + <block wx:else>
  82 + <view hidden="{{ismend==1}}" class="flex">
  83 + <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">{{item.gg}}
  84 + </view>
  85 + </view>
  86 + </block>
  87 + <view class="clear"></view>
  88 + </view>
  89 +
  90 +
  91 + <view>
  92 + <!--<view bindtap="getmendian" class="quhuo logistics-item" hidden="{{ismend==1}}">-->
  93 + <!--<view wx:if="{{sto_sele_name==''}}">取货门店-->
  94 + <!--<text class='small'>(选择门店)</text>-->
  95 + <!--</view>-->
  96 + <!--<view wx:else>{{sto_sele_name}}</view>-->
  97 + <!--<view class="item-img">-->
  98 + <!--<image class="wh100" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image>-->
  99 + <!--</view>-->
  100 + <!--</view>-->
  101 +
  102 +
  103 + <view class="b_num" hidden="{{ismend==1}}" style="margin-top: 20rpx">
  104 + <view>购买数量</view>
  105 + <view class="count">
  106 + <view bindtap="subCartNum" class="sub">-</view>
  107 + <input bindblur="inputCartNum" class="xc-val-fream" type="number" value="{{goodsInputNum}}"></input>
  108 + <view bindtap="addCartNum" class="add">+</view>
  109 + </view>
  110 + </view>
  111 +
  112 + <view class="clear"></view>
  113 + <!---当选取门店的时候会显示门店的选项---->
  114 + <view hidden="{{ismend==0}}" class="sto_v">
  115 + <view class="title" hidden="{{is_sec_mend==1}}" bindtap="hidemend">
  116 + <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>选择门店
  117 + </view>
  118 + <!-----第一级显示------>
  119 + <view class="itemlists" hidden="{{is_sec_mend==1}}">
  120 + <block wx:if="{{is_show_sto_cat>0}}">
  121 + <view wx:for="{{all_sto}}" wx:key="all_sto" class="item" bindtap="show_sec" data-index="{{index}}">{{item.name}}</view>
  122 + </block>
  123 + <block wx:else>
  124 + <view wx:for="{{only_pk}}" wx:key="only_pk" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">{{item.pickup_name}}
  125 + </view>
  126 + </block>
  127 + </view>
  128 + <!-----第二级显示------>
  129 + <view class="stitle" hidden="{{is_sec_mend==0}}" bindtap="hide_sec_mend">
  130 + <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>{{sec_sto.name}}</view>
  131 + <view class="itemlists" hidden="{{is_sec_mend==0}}">
  132 + <view wx:for="{{sec_sto.s_arr}}" wx:key="{{index}}" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">{{item.pickup_name}}
  133 + </view>
  134 + </view>
  135 + </view>
  136 + </view>
  137 + </view>
  138 + <view class="pt_qd">
  139 + <block wx:if="{{is_normal==1}}">
  140 + <!-- 按钮部分 -->
  141 + <view class="spec-cart-btns">
  142 + <!-- 根本就找不到门店 -->
  143 + <block wx:if="{{!only_pk && !def_pickpu_list}}">
  144 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  145 + </block>
  146 + <block wx:else>
  147 +
  148 +
  149 + <block wx:if="{{only_pk.length && !only_pk.length}}">
  150 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  151 + </block>
  152 + <block wx:else>
  153 + <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">
  154 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  155 + </block>
  156 + <block wx:else>
  157 + <block wx:if="{{!def_pick_store}}">
  158 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view>
  159 + </block>
  160 + <block wx:else>
  161 + <block wx:if="{{data.store_count<=0}}">
  162 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  163 + </block>
  164 + <block wx:else>
  165 + <view bindtap="addCart_pt" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view>
  166 + </block>
  167 +
  168 + </block>
  169 + </block>
  170 + </block>
  171 + </block>
  172 + </view>
  173 +
  174 + </block>
  175 + <block wx:else>
  176 + <view bindtap="addCart_pt" class="spec-cart-btn spec-buy w100" data-action="buy">确定</view>
  177 + </block>
  178 +
  179 +
  180 + </view>
  181 + </view>
  182 +
0 183 \ No newline at end of file
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -28,9 +28,10 @@ Page({
28 28 gid: "",
29 29 stoid: o.stoid,
30 30 url: o.url,
31   - resourceUrl: o.resourceUrl,
  31 + resourceUrl: 'https://mshop-lib.yolipai.net/', //公众号那边的图片文件域名
32 32 iurl: o.imghost,
33 33 defaultAvatar: o.resourceUrl + "/static/images/user68.jpg",
  34 +
34 35 data: null,
35 36 content: "", //商品详情
36 37 comments: null, //商品评论
... ... @@ -242,7 +243,8 @@ Page({
242 243 poster:null, //自定义海报
243 244 share_b_img:'', //自定义分享的背景
244 245  
245   - showPoster: false,
  246 + showPoster: false,
  247 + hui_condition:null,
246 248 },
247 249  
248 250 //------初始化加载----------
... ... @@ -279,8 +281,7 @@ Page({
279 281 },
280 282 fail: function(res) {}
281 283 });
282   - }
283   -
  284 + }
284 285 th.setData({poster:json_data})
285 286  
286 287 }
... ... @@ -313,7 +314,6 @@ Page({
313 314 getApp().globalData.room_goods_id=gid;
314 315 }
315 316  
316   -
317 317 var c_guide_id=t.c_guide_id;
318 318 if(c_guide_id){
319 319 th.data.c_guide_id=c_guide_id;
... ... @@ -388,7 +388,6 @@ Page({
388 388 }
389 389 }, 500)
390 390 })
391   -
392 391 }
393 392  
394 393 });
... ... @@ -404,8 +403,8 @@ Page({
404 403  
405 404 //获取用户的默认门店
406 405 getApp().get_user_store(function(ee) {
407   -
408   - if(!ee) {
  406 +
  407 + if(!ee) {
409 408 th.data.fir_def_store={}; //赋值空对象
410 409 return false;
411 410 }
... ... @@ -480,8 +479,6 @@ Page({
480 479 },1000)
481 480  
482 481 });
483   -
484   -
485 482  
486 483 },
487 484  
... ... @@ -710,7 +707,7 @@ Page({
710 707  
711 708  
712 709 //获取统一条形码,普通商品和优惠促销的商品
713   - if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 2 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 4 || ee.data.data.prom_type == 5){
  710 + if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 2 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 5){
714 711 //默认门店要拿下门店库存
715 712 if(that.data.sales_rules==2 && that.data.is_newsales_rules){
716 713 //获取门店
... ... @@ -753,8 +750,7 @@ Page({
753 750 ee.get_sku(o.stoid, t.data.data.sku, gid);
754 751 }
755 752 else {
756   - var gg = "",
757   - item = t.data.data;
  753 + var gg = "", item = t.data.data;
758 754  
759 755 if(item.goods_spec=="null" || item.goods_spec==null ) item.goods_spec="";
760 756 if(item.goods_color=="null" || item.goods_color==null) item.goods_color="";
... ... @@ -951,7 +947,106 @@ Page({
951 947 th.add_cart_func(t);
952 948 }
953 949 },
954   - //加入购物的函数
  950 +
  951 +
  952 +
  953 + //-- 加入购物的函数 --
  954 + add_cart_func_inte: function(t) {
  955 + var i = getApp().request;
  956 + if (oo.user_id == null) {
  957 + return s.my_warnning("还未登录!", 0, this);
  958 + }
  959 + var e = this,
  960 + th = e,
  961 + a = 0,
  962 + o = this.data.data;
  963 + a = o.goods_id;
  964 +
  965 + //----------添加到购物车时,要判断限购数量,--------
  966 + e.get_buy_num(o, function(ee) {
  967 + //---判断商品是否超出限购---
  968 + if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
  969 + if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {
  970 + wx.showModal({
  971 + title: '提示',
  972 + content: '超出商品限购'
  973 + });
  974 + return false;
  975 + }
  976 + }
  977 + //---判断商品是否超出活动限购---
  978 + if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
  979 + if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {
  980 + wx.showModal({
  981 + title: '提示',
  982 + content: '超出商品活动限购'
  983 + });
  984 + return false;
  985 + }
  986 + }
  987 +
  988 + if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);
  989 + if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)
  990 + this.setData({
  991 + sto_sele_name: ""
  992 + });
  993 + if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);
  994 +
  995 + //--------------此时操作的数据------------
  996 + var newd = {
  997 + goods_id: o.goods_id,
  998 + goods_num: th.data.goodsInputNum,
  999 + pick_id: th.data.sto_sele_id,
  1000 + user_id: oo.user_id,
  1001 + store_id: th.data.stoid,
  1002 + goods_price: th.data.prom_price,
  1003 + integral:th.data.prom_integral,
  1004 + member_goods_price: o.shop_price,
  1005 + goods_name: o.goods_name,
  1006 + goods_sn: o.goods_sn,
  1007 + sku: o.sku,
  1008 + };
  1009 +
  1010 + //---是不是从收藏夹出来的---
  1011 + if(th.data.c_guide_id){
  1012 + newd['guide_id'] = th.data.c_guide_id;
  1013 + newd['guide_type']=2;
  1014 + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=3;
  1015 + }else{
  1016 + if(getApp().globalData.guide_id){
  1017 + newd['guide_id'] = getApp().globalData.guide_id;
  1018 + newd['guide_type']=0;
  1019 + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=1;
  1020 + }
  1021 + }
  1022 +
  1023 + //让商品带上房间号
  1024 + //让商品带上房间号
  1025 + if(th.data.sys_switch.is_skuroom_id==1){
  1026 + if(th.data.data.goods_id==getApp().globalData.room_goods_id){
  1027 + newd.room_id=getApp().globalData.room_id;
  1028 + }
  1029 + }else{
  1030 + if(newd.goods_id==getApp().globalData.room_goods_id) newd.room_id=getApp().globalData.room_id;
  1031 + }
  1032 +
  1033 + //如果是积分够,is_integral_normal就要有积分购普通购买字段
  1034 + //if(o.prom_type==4){
  1035 + //newd.is_integral_normal=1;
  1036 + //}
  1037 +
  1038 + //-----如果是秒杀,团购,积分购,拼团-----
  1039 + newd.prom_type = th.data.prom_type;
  1040 + newd.prom_id = th.data.prom_id;
  1041 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
  1042 + if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
  1043 +
  1044 + th.add_cart_next(e,t,a,o,newd); //立即购买下一步
  1045 +
  1046 + })
  1047 + },
  1048 +
  1049 + //-- 加入购物的函数 --
955 1050 add_cart_func: function(t) {
956 1051 var i = getApp().request;
957 1052 if (oo.user_id == null) {
... ... @@ -1105,7 +1200,7 @@ Page({
1105 1200 add_cart_next(e,t,a,o,newd,CanOutQty){
1106 1201 var th=this,i=getApp().request;
1107 1202 //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------
1108   - if(o.prom_type!=1 && o.prom_type!=6){
  1203 + if(o.prom_type!=1 && ((o.prom_type!=6 && o.prom_type!=4) || th.data.is_normal)){
1109 1204 var conf=th.data.bconfig;
1110 1205 if (conf.switch_list && getApp().globalData.userInfo['card_field']){
1111 1206 var s_list=JSON.parse(conf.switch_list);
... ... @@ -1258,16 +1353,22 @@ Page({
1258 1353 url: "/pages/cart/integral/integral?" + t.Obj2Str(e)
1259 1354 });
1260 1355 },
1261   -
  1356 +
  1357 +
1262 1358 //----------立即购买-----------
1263 1359 buyNow: function(e) {
1264 1360 // this.data.shippingCost < 0 || this.data.select.stock <= 0 || (Object.assign(e, {
1265 1361 // action: "buy_now"
1266 1362 // }),
1267   - s.set_b_now(e);
1268   - wx.redirectTo({
1269   - url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id,
1270   - });
  1363 + s.set_b_now(e);
  1364 + if(e.prom_type==4){
  1365 + var url="/pages/cart/cart2_inte/cart2_inte?is_bnow=1&goods_id=" + e.goods_id;
  1366 + getApp().goto(url);
  1367 + }else{
  1368 + wx.redirectTo({
  1369 + url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id,
  1370 + });
  1371 + }
1271 1372 },
1272 1373  
1273 1374 //----------增加购买数量-----------
... ... @@ -1282,6 +1383,20 @@ Page({
1282 1383 inputCartNum: function(t) {
1283 1384 this.checkCartNum(Number(t.detail.value));
1284 1385 },
  1386 +
  1387 + //----------增加购买数量-----------
  1388 + addCartNum_inte: function(t) {
  1389 + this.checkCartNum_inte(this.data.goodsInputNum + 1);
  1390 + },
  1391 + //----------减少购买数量-----------
  1392 + subCartNum_inte: function(t) {
  1393 + this.checkCartNum_inte(this.data.goodsInputNum - 1);
  1394 + },
  1395 + //----------输入框输入购买数量-----------
  1396 + inputCartNum_inte: function(t) {
  1397 + this.checkCartNum_inte(Number(t.detail.value));
  1398 + },
  1399 +
1285 1400  
1286 1401 //------检查数量是不是超出限购------
1287 1402 checkCartNum: function(t) {
... ... @@ -1356,16 +1471,99 @@ Page({
1356 1471 }
1357 1472 t > e || 0 == e ? t = e : t < 1 && (t = 1);
1358 1473 th.setData({ goodsInputNum: t });
  1474 + th.is_show_more_buy();
  1475 +
  1476 + })
  1477 + },
1359 1478  
  1479 + //----- 检查一下积分购的限购之类的问题 -----
  1480 + checkCartNum_inte: function(t) {
  1481 + var th = this;
  1482 + this.get_buy_num(this.data.data, async function() {
  1483 +
  1484 + //--判断商品是否超出限购--
  1485 + if (th.data.g_buy_num != null && th.data.data.viplimited > 0) {
  1486 +
  1487 + var gd_buy_num=th.data.g_buy_num.get(th.data.sele_g.goods_id);
  1488 +
  1489 + if (t + gd_buy_num > th.data.sele_g.viplimited) {
  1490 + wx.showModal({
  1491 + title: '超出商品限购',
  1492 + });
  1493 +
  1494 + var num= th.data.sele_g.viplimited-gd_buy_num;
  1495 + if(num<0) num=0;
  1496 + th.setData({goodsInputNum:num})
  1497 + return false;
  1498 + }
  1499 + }
  1500 +
  1501 + //--判断商品是否超出活动限购--
  1502 + if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
  1503 + if (t + th.data.prom_buy_num > th.data.prom_buy_limit) {
  1504 + wx.showModal({
  1505 + title: '超出商品活动限购',
  1506 + });
  1507 +
  1508 + var num=th.data.prom_buy_limit- th.data.prom_buy_num ;
  1509 + if(num<0) num=0;
  1510 + th.setData({goodsInputNum:num})
  1511 + return false;
  1512 + }
  1513 + }
  1514 +
  1515 + if (th.data.sele_g.prom_type == 1 || th.data.sele_g.prom_type == 6) {
  1516 + var redis_num = 0;
  1517 + //------判断活动是否抢光-----
  1518 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  1519 + os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, {
  1520 + 1: 1
  1521 + }).then(res => {
  1522 + redis_num = res.data.data;
  1523 + });
  1524 +
  1525 + if (t > redis_num) {
  1526 + wx.showModal({
  1527 + title: '超出商品活动库存',
  1528 + });
  1529 + th.setData({goodsInputNum:redis_num})
  1530 + return false;
  1531 + }
  1532 +
  1533 + }
  1534 +
  1535 + var e = th.data.sele_g.store_count;
  1536 + if(th.data.sales_rules==2){
  1537 + if(!th.data.def_pick_store){
  1538 + wx.showModal({ title: '请选择门店', });
  1539 + return false;
  1540 + }else{
  1541 + e=th.data.def_pick_store.CanOutQty;
  1542 + }
  1543 + }
  1544 +
  1545 + //库存不足,不增加
  1546 + if(e<t){ wx.showModal({ title: '库存不足', });
  1547 + if(e<0) e=0;
  1548 + th.setData({ goodsInputNum: e }); return false;
  1549 + }
  1550 + t > e || 0 == e ? t = e : t < 1 && (t = 1);
  1551 + th.setData({ goodsInputNum: t });
1360 1552 })
1361 1553 },
1362 1554  
1363   - closeSpecModal: function() {
  1555 +
  1556 + closeSpecModal: function() {
  1557 + if(this.data.openSpecModal_pt && this.data.is_normal){
  1558 + this.get_sto();
  1559 + }
  1560 +
1364 1561 this.setData({
1365 1562 openSpecModal: !1,
1366 1563 openSpecModal_pt: !1
1367 1564 });
1368 1565 },
  1566 +
1369 1567 openSpecModel: function(t) {
1370 1568 var open_store = t.currentTarget.dataset.ind;
1371 1569  
... ... @@ -1692,8 +1890,11 @@ Page({
1692 1890  
1693 1891 that.check_is_youhui(gid)
1694 1892  
1695   -
  1893 + var ty=0;
  1894 +
1696 1895 this.get_sto();
  1896 +
  1897 +
1697 1898 //默认门店要拿下门店库存
1698 1899 if(that.data.sales_rules==2 && that.data.def_pick_store){
1699 1900 var lock=0,plist=null;
... ... @@ -1778,6 +1979,14 @@ Page({
1778 1979 //---------拿出门店分类和门店------------
1779 1980 get_sto(e) {
1780 1981 var th = this,that=this;
  1982 + var is_normal=e;
  1983 +
  1984 + if(e==1){
  1985 + th.setData({is_normal:1})
  1986 + }else{
  1987 + th.setData({is_normal:0})
  1988 + }
  1989 +
1781 1990 var timer_get = setInterval(function() {
1782 1991 if (th.data.is_get_local_ok == 0) return false;
1783 1992 var dd = null,
... ... @@ -1803,16 +2012,25 @@ Page({
1803 2012 dd.lon = th.data.lon;
1804 2013 }
1805 2014 clearInterval(timer_get);
1806   -
  2015 +
  2016 + //如果会员是有默认的门店话
  2017 + if(!th.data.def_pick_store && th.data.fir_def_store){
  2018 + th.setData({def_pick_store:th.data.fir_def_store});
  2019 + }
  2020 +
1807 2021 if(th.data.def_pick_store && g_distr_type!=0 && th.data.def_pick_store.distr_type!=0 && th.data.def_pick_store.distr_type!=g_distr_type ){
1808 2022 th.setData({def_pick_store:null});
1809 2023 }
1810   -
  2024 +
  2025 + wx.showLoading({
  2026 + title:'加载中.'
  2027 + });
1811 2028 //----------获取门店----------------
1812 2029 getApp().request.promiseGet("/api/weshop/pickup/list", {
1813 2030 data: dd,
1814 2031 }).then(res => {
1815 2032 var e = res;
  2033 +
1816 2034 if (e.data.code == 0) {
1817 2035  
1818 2036 //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店
... ... @@ -1827,7 +2045,7 @@ Page({
1827 2045 }
1828 2046  
1829 2047 //-- 如果有默认选择门店的时候,要把默认门店放在第一位 --
1830   - if (th.data.def_pick_store && (th.data.def_pick_store.distr_type==0 || th.data.def_pick_store.distr_type==g_distr_type )){
  2048 + if (th.data.def_pick_store && (g_distr_type==0 || th.data.def_pick_store.distr_type==0 || th.data.def_pick_store.distr_type==g_distr_type )){
1831 2049 for (var k = 0; k < e.data.data.pageData.length; k++) {
1832 2050 if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) {
1833 2051 e.data.data.pageData.splice(k, 1); //删除
... ... @@ -1840,8 +2058,8 @@ Page({
1840 2058  
1841 2059 th.setData({all_pick_list:e.data.data.pageData});
1842 2060  
1843   - //--获取线下库存,而且不是新的门店规则,同时不能是活动--
1844   - if(th.data.sales_rules==2 && !th.data.is_newsales_rules && th.data.prom_type!=1 && th.data.prom_type!=6){
  2061 + //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购--
  2062 + if(th.data.sales_rules==2 && !th.data.is_newsales_rules && ((th.data.prom_type!=1 && th.data.prom_type!=6 && th.data.prom_type!=4) || is_normal==1)){
1845 2063 setTimeout(function(){
1846 2064 th.deal_pickup_dline(e);
1847 2065 },800)
... ... @@ -1859,8 +2077,8 @@ Page({
1859 2077 //------------处理门店---------------
1860 2078 deal_pickup(e){
1861 2079 var th=this;
1862   -
1863 2080 var g_distr_type=th.data.sele_g.distr_type;
  2081 + wx.hideLoading();
1864 2082  
1865 2083 //单总量超出5个的时候
1866 2084 if (e.data.data.total > 5) {
... ... @@ -1874,6 +2092,7 @@ Page({
1874 2092 },
1875 2093 success: function(ee) {
1876 2094 if (ee.data.code == 0) {
  2095 +
1877 2096 if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0) {
1878 2097 var def_arr = new Array();
1879 2098 var ishas = 0;
... ... @@ -1969,10 +2188,7 @@ Page({
1969 2188 };
1970 2189 newarr.push(item);
1971 2190 }
1972   -
1973   -
1974   -
1975   -
  2191 +
1976 2192 th.setData({
1977 2193 is_show_sto_cat: 1,
1978 2194 all_sto: newarr
... ... @@ -2001,7 +2217,7 @@ Page({
2001 2217 }
2002 2218 }
2003 2219 });
2004   - } else {
  2220 + } else {
2005 2221 th.setData({
2006 2222 is_show_sto_cat: 0,
2007 2223 only_pk: e.data.data.pageData
... ... @@ -2017,6 +2233,7 @@ Page({
2017 2233 }
2018 2234 }
2019 2235 },
  2236 +
2020 2237 //------------处理线下门店库存--------
2021 2238 deal_pickup_dline(e){
2022 2239 var pkno=[],th=this;
... ... @@ -2048,8 +2265,10 @@ Page({
2048 2265 data:{storageNos:pkno_str,wareIds:encodeURIComponent(th.data.sele_g.erpwareid),storeId:os.stoid,pageSize:2000}
2049 2266 })
2050 2267 }).then(res=>{
  2268 +
  2269 + wx.hideLoading();
2051 2270 if(res.data.code==0){
2052   - if(res.data.data.pageData){
  2271 + if(res.data.data.pageData && res.data.data.pageData.length>0){
2053 2272 var plist=res.data.data.pageData;
2054 2273 var def_pick_store=th.data.def_pick_store;
2055 2274 //以原来的数组为外循环,保证距离的顺序
... ... @@ -2237,19 +2456,19 @@ Page({
2237 2456 async check_prom(gid, prom_type, prom_id) {
2238 2457 var ee = this,
2239 2458 th = ee;
2240   - if (prom_type == 3 || prom_type == 0 || prom_type == 2 || prom_type == 4 || prom_type == 5) {
  2459 + if (prom_type == 3 || prom_type == 0 || prom_type == 2 || prom_type == 5) {
2241 2460 this.setData({
2242 2461 prom_type: 0,
2243 2462 isshow: 1,
2244 2463 });
2245 2464 return false;
2246 2465 }
2247   - if(prom_type==4){
2248   - th.setData({is_integral_normal:1});
2249   - }
2250   - //if (prom_type != 3 && prom_type!=0){
2251   - //---判断秒杀----
2252   - if (prom_type == 1) {
  2466 +
  2467 +
  2468 +
  2469 + //if (prom_type != 3 && prom_type!=0){
  2470 + //---判断秒杀----
  2471 + if (prom_type == 1) {
2253 2472 //-------判断活动是否抢光---------
2254 2473 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
2255 2474 1: 1
... ... @@ -2351,6 +2570,54 @@ Page({
2351 2570 })
2352 2571 }
2353 2572  
  2573 + if(prom_type==4){
  2574 + //th.setData({is_integral_normal:1});
  2575 + var rdata={
  2576 + store_id:o.stoid,stype:1,stypeup:1,goods_id:gid
  2577 + }
  2578 +
  2579 + var integrals=0;
  2580 + var get_datas= {
  2581 + user_id:getApp().globalData.user_id, store_id:o.stoid,
  2582 + };
  2583 + await getApp().request.promiseGet("/api/weshop/users/getAllPoints", {
  2584 + data: get_datas
  2585 + }).then(res => {
  2586 + if(res.data.code==0){
  2587 + integrals=res.data.data.Integral;
  2588 + }
  2589 + })
  2590 +
  2591 + //获取一下积分活动
  2592 + await getApp().request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList", {
  2593 + data: rdata
  2594 + }).then(res => {
  2595 + //调用接口有数据的时候
  2596 + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0) {
  2597 + var inte_data=res.data.data.pageData[0];
  2598 + var can_integral=(parseFloat(integrals)>=parseFloat(inte_data.integral));
  2599 + ee.setData({
  2600 + prom_price:parseFloat(inte_data.addmoney),
  2601 + prom_integral:parseFloat(inte_data.integral),
  2602 + prom_type: 4,
  2603 + prom_id: inte_data.id,
  2604 + prom_buy_limit: inte_data.limitvipqty,
  2605 + prom_act: inte_data,
  2606 + isshow: 1,
  2607 + can_integral:can_integral,
  2608 + });
  2609 + ee.get_sto();
  2610 +
  2611 + }else{
  2612 + ee.setData({prom_type: 0, isshow: 1,});
  2613 + ee.get_sku(os.stoid, ee.data.data.sku, gid);
  2614 + return false;
  2615 + }
  2616 + })
  2617 +
  2618 + }
  2619 +
  2620 +
2354 2621 //---判断拼单----
2355 2622 if (prom_type == 6) {
2356 2623 //-------判断活动是否抢光---------
... ... @@ -2740,11 +3007,13 @@ Page({
2740 3007 if (ind == 1) {
2741 3008 //如果拼单的sku data是空的,就要先获取一下
2742 3009 if (th.data.sku_g_pt) {
  3010 + th.get_sto(1);
2743 3011 th.setData({
2744 3012 is_normal: ind,
2745 3013 openSpecModal_pt: 1
2746 3014 });
2747 3015 } else {
  3016 + th.get_sto(1);
2748 3017 th.get_sku(o.stoid, th.data.data.sku, th.data.gid, 1, function() {
2749 3018 th.setData({
2750 3019 is_normal: ind,
... ... @@ -2753,7 +3022,7 @@ Page({
2753 3022 });
2754 3023 }
2755 3024 } else {
2756   -
  3025 +
2757 3026 //拼单商品从这里进,先判断有没有买过商品,
2758 3027 getApp().request.get("/api/weshop/order/page", {
2759 3028 data: {
... ... @@ -4022,8 +4291,8 @@ Page({
4022 4291 var plist=null;
4023 4292 var lock=0;
4024 4293  
4025   - //---如果是活动的时候---
4026   - if(th.data.prom_type==1 || th.data.prom_type==6){
  4294 + //---如果是活动的时候,同时不是普通购买---
  4295 + if((th.data.prom_type==1 || th.data.prom_type==6 || th.data.prom_type==4) && !th.data.is_normal ) {
4027 4296 func(); return false;
4028 4297 }
4029 4298  
... ... @@ -4360,6 +4629,8 @@ Page({
4360 4629 collocationGoods:r_data.collocationPromList,
4361 4630 prom_goods:r_data.promGoodsLists,
4362 4631 })
  4632 +
  4633 + th.is_show_more_buy();
4363 4634 }
4364 4635 })
4365 4636 },
... ... @@ -4475,5 +4746,56 @@ Page({
4475 4746 urls: [this.data.shareImgPath]
4476 4747 });
4477 4748 },
  4749 +
  4750 + is_show_more_buy:function(){
  4751 + var prom_goods=this.data.prom_goods;
  4752 + var per_price=this.data.sele_g.shop_price
  4753 + if(this.data.card_field && this.data.sele_g[this.data.card_field]>0){
  4754 + per_price=this.data.sele_g[this.data.card_field];
  4755 + }
  4756 + var all_price=per_price*this.data.goodsInputNum;
  4757 + var con=null;
  4758 + for(var i in prom_goods){
  4759 + var item=prom_goods[i];
  4760 + if(item.prom_type==1){
  4761 + if(item.condition>this.data.goodsInputNum) {
  4762 + con=item;
  4763 + con.need=(item.condition-this.data.goodsInputNum)+"件";
  4764 + break;
  4765 + }
  4766 + }else{
  4767 + if(item.condition>this.data.goodsInputNum){
  4768 + con=item;
  4769 + con.need=(item.condition-this.data.goodsInputNum)+"元";
  4770 + break;
  4771 + }
  4772 + }
  4773 + }
  4774 +
  4775 + this.setData({hui_condition:con});
  4776 +
  4777 + },
  4778 +
  4779 + //-- 积分购 --
  4780 + go_pay_integral:function(){
  4781 + this.setData({openSpecModal_inte:1});
  4782 + },
  4783 + //-- 积分购普通购买 --
  4784 + go_pay_integral_normal:function(){
  4785 + this.get_sto(1)
  4786 + this.setData({openSpecModal_inte_normal:1});
  4787 + },
  4788 +
  4789 + closeSpecModal_inte:function(){
  4790 + this.setData({openSpecModal_inte:0});
  4791 + } ,
  4792 + closeSpecModal_inte_normal:function(){
  4793 + this.get_sto()
  4794 + this.setData({openSpecModal_inte_normal:0});
  4795 + },
  4796 +
  4797 + addCart_inte:function(t){
  4798 + this.add_cart_func_inte(t);
  4799 + }
4478 4800  
4479 4801 });
... ...
pages/goods/goodsInfo/goodsInfo.wxml
... ... @@ -230,8 +230,41 @@
230 230 </view>
231 231 </view>
232 232  
233   - <!-- 不是拼团 -->
234   - <block wx:if="{{prom_type!=6}}">
  233 + <!-- 积分购 -->
  234 + <view wx:if="{{prom_type==4}}">
  235 + <view class="goods-price rel">
  236 + <!-- 价格显示 -->
  237 + <view class="co-red" style="overflow: hidden" >
  238 + <view class="market-price" style="overflow: hidden">
  239 + <image class="rel_img" src="{{resourceUrl}}/template/mobile/new/static/images/weixin/integral_red.png"></image>
  240 + <block wx:if="{{prom_integral}}">{{prom_integral}}
  241 + <text class="rel_txt">积分</text></block>
  242 + <text class="rel_txt" wx:if="{{prom_integral && prom_price}}">+</text>
  243 + <text class="rel_txt" wx:if="{{prom_price}}" >{{filters.toFix(prom_price,2)}}元</text>
  244 + <text class="rel_txt" decode="{{true}}" space="{{true}}" style="color: #999; text-decoration: line-through;">&nbsp;&nbsp;&nbsp;零售价:¥{{data.market_price}}</text>
  245 + </view>
  246 + </view>
  247 +
  248 + <!-- 这个是分享按钮 -->
  249 + <view class="xc-share-frame flex {{prom_type==1?'s_ms_bth':''}} " bindtap="saveImageToPhotosAlbum">
  250 + <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image>
  251 + <view class="share-font">分享</view>
  252 + </view>
  253 +
  254 + <view class="goods-title">
  255 + <view class="goods-name elli">{{data.goods_name}}</view>
  256 + </view>
  257 +
  258 + <view class="goods-num">
  259 + <view class="sales">销量:{{prom_act.buy_num}}件</view>
  260 + <view class="stock">折扣:{{filters.pInt((prom_price?prom_price:0)*100/data.shop_price)}}折</view>
  261 + <view class="stock">{{categories3[0].num}}人评价</view>
  262 + </view>
  263 + </view>
  264 + </view>
  265 +
  266 + <!-- 不是拼团,不是积分购 -->
  267 + <block wx:if="{{prom_type!=6 && prom_type!=4}}">
235 268 <view class="goods-price rel">
236 269 <view class="co-red" style="overflow: hidden" wx:if="{{prom_type==0 || prom_type==3}}">
237 270 <view class="market-price" style="overflow: hidden">
... ... @@ -241,7 +274,7 @@
241 274 <view class="fs24 white view card-name ellipsis-1">{{card_name}}</view>
242 275 </view>
243 276 <text class="rel yuan">¥</text>{{filters.toFix(data[card_field],2)}}
244   - <view class='yj' style="top:35rpx">
  277 + <view class='yj' style="top:35rpx">
245 278 <text>零售价:¥{{data.market_price}}</text>
246 279 </view>
247 280 </block>
... ... @@ -350,7 +383,7 @@
350 383 </view>
351 384 </view>
352 385  
353   - <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0}}">
  386 + <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4}}">
354 387 {{data.goods_name}}
355 388 </view>
356 389  
... ... @@ -835,7 +868,7 @@
835 868 <view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{data.goods.is_virtual}}">立即购买</view>
836 869  
837 870 <!-- 普通商品购买 -->
838   - <block wx:if="{{prom_type==0 || prom_type==2 || prom_type==3 || prom_type==4}}">
  871 + <block wx:if="{{prom_type==0 || prom_type==2 || prom_type==3}}">
839 872  
840 873 <!-- 线上销售的时候,要判断库存量, 线下库存的时候不用判断 -->
841 874 <block wx:if="{{(sele_g.store_count>0 && sales_rules==1) || sales_rules==2 }}">
... ... @@ -916,6 +949,26 @@
916 949 <view wx:if="{{user_order_pt_state==3}}" bindtap="go_pay_wk" class="buy-btn cart-btn">支付尾款</view>
917 950 </block>
918 951 </block>
  952 +
  953 +
  954 + <!-------积分购-------->
  955 + <block wx:if="{{prom_type==4}}">
  956 +
  957 + <view bindtap="go_pay_integral_normal" class="join-btn cart-btn line-h">
  958 + <view class="fir-v">
  959 + <block wx:if="{{card_field && sele_g[card_field]>0}}">
  960 + {{filters.toFix(sele_g[card_field],2)}}
  961 + </block>
  962 + <block wx:else>
  963 + {{filters.toFix(sele_g.shop_price,2)}}
  964 + </block>
  965 + </view>
  966 + <view>单独购买</view>
  967 + </view>
  968 + <view bindtap="go_pay_integral" class="buy-btn cart-btn" wx:if="{{can_integral}}" >立即兑换</view>
  969 + <view class="buy-btn cart-btn" style="background-color: #aaa;" wx:else >立即兑换</view>
  970 + </block>
  971 +
919 972 <!---<view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:else>立即兑换</view>-->
920 973 </view>
921 974  
... ... @@ -926,7 +979,7 @@
926 979  
927 980 <!----弹起来,选择规格数量,普通商品购买和秒杀------>
928 981 <view hidden="{{!openSpecModal}}">
929   - <view bindtap="closeSpecModal" class="cover-layer"></view>
  982 + <view bindtap="closeSpecModal" class="cover-layer"></view>
930 983 <view class="spec-model">
931 984 <view class="pding">
932 985 <icon bindtap="closeSpecModal" class="modal-close" color="black" size="22" type="cancel"></icon>
... ... @@ -935,41 +988,31 @@
935 988 <view class="spec-goods-info">
936 989 <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view>
937 990 <view class="flex ai_end xc-val-money">
938   - <view class="spec-goods-price" wx:if="{{prom_price==null}}" >
939   - <text class="fs20">¥</text>
940   - <!-- 如果是等级会员,且有等级价 -->
941   - <block wx:if="{{card_field && sele_g[card_field]>0}}">
942   - {{sele_g[card_field]}}
943   - </block>
944   - <block wx:else>
945   - {{sele_g.shop_price}}
946   - </block>
947   -
  991 + <view class="spec-goods-price" wx:if="{{prom_price==null}}" >
  992 + <text class="fs20">¥</text>
  993 + <!-- 如果是等级会员,且有等级价 -->
  994 + <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}} </block>
  995 + <block wx:else>{{sele_g.shop_price}}</block>
948 996 </view>
949   - <view class="spec-goods-price" wx:else><text class="fs20">¥</text>{{prom_price}}</view>
950   - </view>
  997 + <view class="spec-goods-price" wx:else><text class="fs20">¥</text>{{prom_price}}</view>
  998 + </view>
951 999  
952 1000 <block wx:if="{{prom_type==0}}">
953   - <view class="flex">
954   - <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>
955   - <block wx:if="{{sales_rules==2}}">
956   - <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view>
957   - <view class="spec-goods-stock" wx:else>可售:0</view>
958   - </block>
959   - <block wx:else>
960   - <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view>
961   - </block>
962   -
963   - </view>
  1001 + <view class="flex">
  1002 + <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>
  1003 + <block wx:if="{{sales_rules==2}}">
  1004 + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view>
  1005 + <view class="spec-goods-stock" wx:else>可售:0</view>
  1006 + </block>
  1007 + <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block>
  1008 + </view>
964 1009 </block>
965 1010 <block wx:if="{{prom_type==1}}">
966   - <view class="flex">
967   - <view class="spec-goods-stock" wx:if="{{prom_st>0}}">已售:{{prom_act.buy_num+prom_act.virtual}}</view>
968   - <view class="spec-goods-stock" wx:else >已售:{{prom_act.buy_num}}</view>
969   - <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view>
970   -
971   -
972   - </view>
  1011 + <view class="flex">
  1012 + <view class="spec-goods-stock" wx:if="{{prom_st>0}}">已售:{{prom_act.buy_num+prom_act.virtual}}</view>
  1013 + <view class="spec-goods-stock" wx:else >已售:{{prom_act.buy_num}}</view>
  1014 + <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view>
  1015 + </view>
973 1016 </block>
974 1017 </view>
975 1018  
... ... @@ -1006,15 +1049,15 @@
1006 1049 <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view>
1007 1050 </view>
1008 1051  
1009   - <!----商品的属性项目---->
1010   - <view class="xc-goods-attribute">
1011   - <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
1012   - <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">
1013   - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">
1014   - {{item.gg}}
  1052 + <!--商品的属性项目-->
  1053 + <view class="xc-goods-attribute">
  1054 + <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
  1055 + <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">
  1056 + <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">
  1057 + {{item.gg}}
  1058 + </view>
  1059 + </view>
1015 1060 </view>
1016   - </view>
1017   -</view>
1018 1061  
1019 1062  
1020 1063 <view class="b_num">
... ... @@ -1025,6 +1068,20 @@
1025 1068 <view bindtap="addCartNum" class="add">+</view>
1026 1069 </view>
1027 1070 </view>
  1071 +
  1072 + <!-- 提示再买多少优惠 -->
  1073 + <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition && openSpecModal_ind==2}}">
  1074 + 再买{{hui_condition.need}}
  1075 + <text wx:if="{{hui_condition.money}}">,免{{hui_condition.money}}元</text>
  1076 + <text wx:if="{{hui_condition.sale}}">,打{{hui_condition.sale}}折</text>
  1077 + <text wx:if="{{hui_condition.past==1}}">,包邮</text>
  1078 + <text wx:if="{{hui_condition.intValue>0}}">,送{{hui_condition.intValue}}积分</text>
  1079 + <text wx:if="{{hui_condition.couponId>0}}">,送优惠券</text>
  1080 + <text wx:if="{{hui_condition.gift_id>0}}">,送赠品</text>
  1081 + <text wx:if="{{hui_condition.lb_id>0}}">,送礼包</text>
  1082 + </view>
  1083 +
  1084 +
1028 1085 </view>
1029 1086 <view class="spec-cart-btns">
1030 1087 <!-- 根本就找不到门店 -->
... ... @@ -1072,12 +1129,9 @@
1072 1129 </block>
1073 1130 </block>
1074 1131 </block>
1075   - </block>
1076   -
1077   -
1078   - </block>
1079   -
1080   - </view>
  1132 + </block>
  1133 + </block>
  1134 + </view>
1081 1135  
1082 1136 <view class="clear"></view>
1083 1137 <!---选择门店的列表--->
... ... @@ -1103,152 +1157,23 @@
1103 1157 </view>
1104 1158 </view>
1105 1159 </view>
1106   - </view>
1107   -
  1160 + </view>
1108 1161 </view>
1109 1162  
  1163 +<!-- 弹起来,购买积分购 -->
  1164 +<view hidden="{{!openSpecModal_inte}}">
  1165 + <include src="buy_integral.wxml" />
  1166 +</view>
  1167 +<!-- 弹起来,购买积分购的普通购买 -->
  1168 +<view hidden="{{!openSpecModal_inte_normal}}">
  1169 + <include src="buy_integral_normal.wxml" />
  1170 +</view>
1110 1171  
1111 1172 <!----弹起来,选择规格数量,拼单商品购买------>
1112 1173 <view hidden="{{!openSpecModal_pt}}">
1113   - <view bindtap="closeSpecModal" class="cover-layer"></view>
1114   - <view class="spec-model">
1115   - <view class="pding">
1116   - <icon bindtap="closeSpecModal" class="modal-close" color="gray" size="22" type="cancel"></icon>
1117   -
1118   - <!-- 商品名称 -->
1119   - <view class="spec-goods">
1120   - <image class="wh100 spec-img xc-distance-bottom" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image>
1121   - <view class="spec-goods-info">
1122   - <view class="spec-goods-name ellipsis-1">{{sele_g.goods_name}}</view>
1123   - <view class="flex ai_end xc-val-money {{sele_g[card_field]}}" >
1124   - <view class="spec-goods-price" wx:if="{{is_normal==1}}" >
1125   - <!-- 如果是等级会员,且有等级价 -->
1126   - <block wx:if="{{card_field && sele_g[card_field]>0}}">
1127   - ¥ {{sele_g[card_field]}}
1128   - </block>
1129   - <block wx:else>
1130   - ¥ {{sele_g.shop_price}}
1131   - </block>
1132   - </view>
1133   - <view class="spec-goods-price" wx:else>¥ {{prom_price}}</view>
1134   - </view>
1135   -
1136   - <block wx:if="{{is_normal==1}}">
1137   - <view class="flex">
1138   - <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>
1139   - <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view>
1140   - </view>
1141   - </block>
1142   - <block wx:if="{{is_normal==0}}">
1143   - <view class="flex">
1144   - <view class="spec-goods-stock" wx:if="{{prom_st>0}}">已售:{{prom_act.buy_num}}</view>
1145   - <view class="spec-goods-stock" wx:else >已售:{{prom_act.buy_num}}</view>
1146   - <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view>
1147   - </view>
1148   - </block>
1149   - </view>
1150   -
1151   - </view>
1152   -
1153   -
1154   -
1155   - <view style="clear: both"></view>
1156   - <view style="margin-top: 20rpx">
1157   - <view class="flex-space-between address ai_end xc-width ">
1158   -
1159   - <view class="flex ai_end" wx:if="{{def_pick_store}}">
1160   - <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
1161   - <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
1162   - 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
1163   -
1164   - </view>
1165   - </view>
1166   -
1167   - <!-- 没有门店的时候 -->
1168   - <view class="flex" bindtap="choice_store"wx:else>
1169   - <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
1170   - <view class="fs28 xc-ash-9f">选择门店</view>
1171   - </view>
1172   -
1173   - <view class="red-co fs28" bindtap="choice_store" >
1174   - 更多门店
1175   - <text class="right-arrow"></text>
1176   - </view>
1177   - </view>
1178   - <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view>
1179   - </view>
1180   - <!----商品的属性项目---->
1181   - <view>
1182   - <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
1183   - <block wx:if="{{is_normal==0}}">
1184   - <view hidden="{{ismend==1}}" class="flex">
1185   - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">{{item.gg}}
1186   - </view>
1187   - </view>
1188   - </block>
1189   -
1190   - <block wx:else>
1191   - <view hidden="{{ismend==1}}" class="flex">
1192   - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">{{item.gg}}
1193   - </view>
1194   - </view>
1195   - </block>
1196   - <view class="clear"></view>
1197   - </view>
1198   -
1199   -
1200   - <view>
1201   - <!--<view bindtap="getmendian" class="quhuo logistics-item" hidden="{{ismend==1}}">-->
1202   - <!--<view wx:if="{{sto_sele_name==''}}">取货门店-->
1203   - <!--<text class='small'>(选择门店)</text>-->
1204   - <!--</view>-->
1205   - <!--<view wx:else>{{sto_sele_name}}</view>-->
1206   - <!--<view class="item-img">-->
1207   - <!--<image class="wh100" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image>-->
1208   - <!--</view>-->
1209   - <!--</view>-->
1210   -
1211   -
1212   - <view class="b_num" hidden="{{ismend==1}}" style="margin-top: 20rpx">
1213   - <view>购买数量</view>
1214   - <view class="count">
1215   - <view bindtap="subCartNum" class="sub">-</view>
1216   - <input bindblur="inputCartNum" class="xc-val-fream" type="number" value="{{goodsInputNum}}"></input>
1217   - <view bindtap="addCartNum" class="add">+</view>
1218   - </view>
1219   - </view>
1220   -
1221   - <view class="clear"></view>
1222   - <!---当选取门店的时候会显示门店的选项---->
1223   - <view hidden="{{ismend==0}}" class="sto_v">
1224   - <view class="title" hidden="{{is_sec_mend==1}}" bindtap="hidemend">
1225   - <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>选择门店
1226   - </view>
1227   - <!-----第一级显示------>
1228   - <view class="itemlists" hidden="{{is_sec_mend==1}}">
1229   - <block wx:if="{{is_show_sto_cat>0}}">
1230   - <view wx:for="{{all_sto}}" wx:key="all_sto" class="item" bindtap="show_sec" data-index="{{index}}">{{item.name}}</view>
1231   - </block>
1232   - <block wx:else>
1233   - <view wx:for="{{only_pk}}" wx:key="only_pk" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">{{item.pickup_name}}
1234   - </view>
1235   - </block>
1236   - </view>
1237   - <!-----第二级显示------>
1238   - <view class="stitle" hidden="{{is_sec_mend==0}}" bindtap="hide_sec_mend">
1239   - <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>{{sec_sto.name}}</view>
1240   - <view class="itemlists" hidden="{{is_sec_mend==0}}">
1241   - <view wx:for="{{sec_sto.s_arr}}" wx:key="{{index}}" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">{{item.pickup_name}}
1242   - </view>
1243   - </view>
1244   - </view>
1245   - </view>
1246   - </view>
1247   - <view class="pt_qd">
1248   - <view bindtap="addCart_pt" class="spec-cart-btn spec-buy w100" data-action="buy">确定</view>
1249   - </view>
1250   - </view>
  1174 + <include src="buy_pt.wxml" />
1251 1175 </view>
  1176 +
1252 1177 <!----弹起来优惠信息------>
1253 1178 <view hidden="{{!openPromModal}}">
1254 1179 <view bindtap="closePromModal" class="cover-layer"></view>
... ...
pages/goods/goodsInfo/goodsInfo.wxss
... ... @@ -659,7 +659,6 @@ border-radius: 0 56rpx 55rpx 0;
659 659 position: fixed;
660 660 bottom: 50rpx;
661 661 left: 4%;
662   -
663 662 }
664 663  
665 664 .spec-cart-btn {
... ... @@ -671,6 +670,10 @@ left: 4%;
671 670 border-radius: 40rpx;
672 671 }
673 672  
  673 +.spec-cart-btn.w40 {
  674 + width: 46%;
  675 +}
  676 +
674 677 .spec-add-cart {
675 678 background-color: #ffb03f;
676 679 }
... ... @@ -2682,4 +2685,9 @@ button.custom-service::after{
2682 2685 position: absolute;
2683 2686 right: 20rpx;
2684 2687 top: 10rpx;
2685   -}
2686 2688 \ No newline at end of file
  2689 +}
  2690 +
  2691 +.goods-price .rel_txt{
  2692 + position: relative; top: 32rpx; font-size: 30rpx;
  2693 +}
  2694 +.goods-price .rel_img{width: 62rpx; height: 62rpx;position: relative; top: 12rpx;}
2687 2695 \ No newline at end of file
... ...
pages/goods/goodsList/goodsList.wxml
... ... @@ -52,9 +52,14 @@
52 52 <view class="item-cont">
53 53 <view class="title">{{item.goods_name}}</view>
54 54 <!-- 判断是否有活动价 -->
55   - <block wx:if="{{item.prom_price>0 && item.prom_type!=2 && item.prom_type!=4}}">
  55 + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2}}">
56 56 <!-- 活动价 -->
57   - <view class="price">¥{{item.prom_price}}</view>
  57 + <view class="price">
  58 + <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text>
  59 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  60 + <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text>
  61 + </view>
  62 +
58 63 <view class="comment flex jc_sb">
59 64 <view class="word-line xc-ash">¥{{item.market_price}}</view>
60 65 <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view>
... ...
pages/goods/search/search.wxml
... ... @@ -35,9 +35,13 @@
35 35 <view class="item-cont">
36 36 <view class="title ellipsis-2">{{item.goods_name}}</view>
37 37 <!-- 判断是否有活动价,小程序没有有团购和拼单 -->
38   - <block wx:if="{{item.prom_price>0 && item.prom_type!=2 && item.prom_type!=4}}">
  38 + <block wx:if="{{(item.prom_price>0 || item.prom_integral) && item.prom_type!=2}}">
39 39 <!-- 活动价 -->
40   - <view class="price">¥{{item.prom_price}}</view>
  40 + <view class="price">
  41 + <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text>
  42 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  43 + <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text>
  44 + </view>
41 45 <view class="comment flex jc_sb">
42 46 <view class="word-line xc-ash">¥{{item.market_price}}</view>
43 47 <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view>
... ...