Commit 6c65e58809345e13c05e9081dbd7f1e34c279bc9

Authored by taiyuan
1 parent cf7f602d

首页惊喜预售、预售活动列表、预售商品详情、预售提交订单

app.wxss
... ... @@ -706,9 +706,9 @@ background: #ffe3e2;
706 706 /* 图标字体(ty) */
707 707 @font-face {
708 708 font-family: 'iconfont'; /* Project id 2054717 */
709   - src: url('//at.alicdn.com/t/font_2054717_j27uzo13r5f.woff2?t=1628845583213') format('woff2'),
710   - url('//at.alicdn.com/t/font_2054717_j27uzo13r5f.woff?t=1628845583213') format('woff'),
711   - url('//at.alicdn.com/t/font_2054717_j27uzo13r5f.ttf?t=1628845583213') format('truetype');
  709 + src: url('//at.alicdn.com/t/font_2054717_lj9v8hh5xa.woff2?t=1630891447571') format('woff2'),
  710 + url('//at.alicdn.com/t/font_2054717_lj9v8hh5xa.woff?t=1630891447571') format('woff'),
  711 + url('//at.alicdn.com/t/font_2054717_lj9v8hh5xa.ttf?t=1630891447571') format('truetype');
712 712 }
713 713  
714 714 .iconfont {
... ... @@ -719,6 +719,26 @@ background: #ffe3e2;
719 719 -moz-osx-font-smoothing: grayscale;
720 720 }
721 721  
  722 +.icon-daifu:before {
  723 + content: "\e723";
  724 +}
  725 +
  726 +.icon-tkcg:before {
  727 + content: "\e61a";
  728 +}
  729 +
  730 +.icon-kefu:before {
  731 + content: "\e619";
  732 +}
  733 +
  734 +.icon-qianbao:before {
  735 + content: "\e616";
  736 +}
  737 +
  738 +.icon-presell:before {
  739 + content: "\e6f6";
  740 +}
  741 +
722 742 .icon-nodata:before {
723 743 content: "\e636";
724 744 }
... ...
packageC/pages/presell/cart/c_filter.wxs 0 → 100644
  1 +var filters = {
  2 + toFix:function(val,count){
  3 + if(!val) return parseFloat(0).toFixed(count);
  4 + return val.toFixed(count)
  5 + },
  6 + format_time:function(ts,isFull) {
  7 + var d = getDate(ts*1000)
  8 + var fm=[d.getFullYear(), d.getMonth()+1, d.getDate()].join('-');
  9 + if(isFull==1)
  10 + fm=fm + ' '+ [d.getHours(), d.getMinutes(), d.getSeconds()].join(':')
  11 + return fm;
  12 + },
  13 + setcolor:function(ind){
  14 + if (ind == 0 || ind ==null) return "red";
  15 + if(ind==1 ) return "green";
  16 + if(ind==2) return "blue";
  17 + if(ind==11) return "green";
  18 + if(ind==12) return "blue";
  19 + if(ind==20) return "green";
  20 + return "";
  21 + },
  22 + setbgcolor: function (ind) {
  23 + if (ind == 0 || ind == null) return "#ffa1b9";
  24 + if (ind == 1) return "#59e1d2";
  25 + if (ind == 2) return "#a3bcff";
  26 + if (ind == 11) return "#59e1d2";
  27 + if (ind == 12) return "#a3bcff";
  28 + if (ind == 20) return "#6d87cd";
  29 + return "";
  30 + },
  31 +
  32 + get_type:function(ind){
  33 + if (ind == 0 || ind == null) return "全场通用";
  34 + if (ind == 1) return "品牌";
  35 + if (ind == 2) return "品类";
  36 + if (ind == 11) return "用途";
  37 + if (ind == 12) return "分类1";
  38 + if (ind == 20) return "指定单品";
  39 + return "";
  40 + },
  41 + get_type_card:function(ind){
  42 + if (ind == 0 || ind == null) return "全场通用";
  43 + if (ind == 1) return "指定品牌";
  44 + if (ind == 2) return "指定品类";
  45 + if (ind == 11) return "指定用途";
  46 + if (ind == 12) return "指定分类1";
  47 + if (ind == 20) return "指定单品";
  48 + return "";
  49 + },
  50 + format_huiche:function (text) {
  51 + if (!text) {
  52 + return "";
  53 + }
  54 + var reg = getRegExp('\\\\n', 'g')
  55 + return text.replace(reg, '\n')
  56 + }
  57 +}
  58 +
  59 +module.exports = {
  60 + toFix: filters.toFix,
  61 + format_time:filters.format_time,
  62 + setcolor:filters.setcolor,
  63 + setbgcolor: filters.setbgcolor,
  64 + get_type: filters.get_type,
  65 + get_split_name: filters.get_split_name,
  66 + get_type_card: filters.get_type_card,
  67 + format_huiche: filters.format_huiche,
  68 +}
0 69 \ No newline at end of file
... ...
packageC/pages/presell/cart/cart.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 +var zh_calc = require("zh_calculate.js");
  7 +
  8 +Page({
  9 + data: {
  10 + url: t.globalData.setting.url,
  11 + resourceUrl: t.globalData.setting.resourceUrl,
  12 + imgUrl: t.globalData.setting.imghost,
  13 + goods: null,
  14 + order: null,
  15 + orderPrices: null,
  16 + coupons: null,
  17 + coupon: null,
  18 + invoiceToggle: !0,
  19 + payWithUserMoney: !0,
  20 + payWithPoints: !0,
  21 + maxWord: 0,
  22 + enterAddressPage: !1,
  23 + firstEnter: !0,
  24 + //页面获取的参数
  25 + param: null,
  26 + //提交订单的格式
  27 + formData: {
  28 + order_amount: 0,//支付金额
  29 + total_amount: 0,//总价
  30 + all_price: 0,//商品卖的总价
  31 + pay_points: 0,//使用积分
  32 + user_money: 0,//使用余额
  33 + couponCode: "",//使用优惠券(多单就用逗号隔开)
  34 + shipping_price: 0,//物流费用
  35 + },
  36 + /*-----------当是购物车结算的时候-------------*/
  37 + cartlist: null,
  38 + old_cartlist: null,
  39 + cartlist_y: null, //购物车原始列表
  40 + js_use_money: 0, //是否使用余额
  41 + is_all_zt: 1, //是否全部都是自提
  42 +
  43 + /*----------------立即购买---------------------*/
  44 + is_b_now: 0, //0是购物车结算 1立即购买
  45 + bn_goods: null, //立即购买时候的调用商品
  46 + bn_use_money: 0,//是否使用余额
  47 + bn_exp_type: 1, //0是物流 1自提
  48 + bn_pick: 0, //选择的门店
  49 + bn_pickname: "", //选择的门店名称
  50 + bn_t_exp_t: 0, //判断商品和门店一起决定的物流自提的方式0 都可以 1自提 2物流
  51 +
  52 + bn_plus_cut_price: 0, //显示等级卡会优惠多少钱
  53 + /*------------------------*/
  54 + user_addr: null,//物流
  55 + userinfo: null, //获取会员
  56 + /*----------物流选择--------*/
  57 + wu_arr: null,
  58 + index: 0,
  59 + w_sele_index: 0,
  60 +
  61 + //判断页面是返回回来的还是 首次进入的
  62 + isclose: 1,
  63 + //申请提现的金额
  64 + txmon: 0,
  65 + yuer: 0,
  66 + //提交中,不重复提交
  67 + is_summit_ing: 0,
  68 + //--更优惠券抵用有关,立即购买的,如果是购物车,就要把相应的值,写入cartlist数组中--
  69 + ckeck_quan_price: 0,
  70 + check_quan_price_list: '',
  71 + check_quan_ware_list: '',
  72 +
  73 + // 设计一个数组来存放已经选择了的券编号,coupon_no是券号,money是面值,coupon_price是真正优惠的价格,数组的下标是pickid
  74 + //using_quan[11]={coupon_no:"1212121",money:"20",coupon_price:"45"}
  75 + using_quan: {},
  76 + open_quan: 0,
  77 + //选择的券列表
  78 + selected_quan_list: null,
  79 + //选择的券的门店
  80 + selected_quan_pick: null,
  81 + is_close_quan: 0,
  82 + disabled: 0,
  83 + open_express: 0,//控制选择物流名列表 的属性
  84 +
  85 + is_express: 0, //选中物流的属性
  86 + expres_name: "", //点击选定
  87 + isopen: 0, //券的说明
  88 + is_coupon: null, //选择券的控制属性
  89 + is_shipping_code: "",//插入用户默认地址
  90 + wu_arr_txt: "", //要更新的物流的字段
  91 +
  92 + sales_rules: 1, //默认是显示线上库存
  93 + isget_by_quan: {}, //是否调用了接口获取包邮券
  94 + get_by_quan_list: null, //立即购买的
  95 + get_by_quan_list_cart: {}, //购物车的
  96 + by_quan_list_cart: null, //点击选择的包邮列表
  97 +
  98 + //如果是全场包邮了,或者是全场不包邮了,就不要选包邮券
  99 + is_no_by: {},
  100 + is_by: {},
  101 + is_quan_by: {},
  102 + //--购买赠送的商品--
  103 + buy_now_gift_goods: null,
  104 + //--订单优惠--
  105 + order_prom: {},
  106 + //-- 购物车优惠活动 --
  107 + prom_goods_map: {},
  108 + //-- order_prom_list --
  109 + order_prom_list_cart: null,
  110 +
  111 + ispt_goods: 0, //是否平摊至单品,0要平摊 1不平摊
  112 +
  113 + rank_switch: 0, //是不是开同等级卡
  114 + show_card: null, //显示的等级卡
  115 + card_name: '', //显示的卡的名称
  116 + card_cut_price: null,//减价多少钱
  117 +
  118 + show_submit: 0, //提交按钮变正常显示
  119 + is_get_offline: 1,
  120 +
  121 + tabs: ['门店自提', '快递邮寄'],
  122 + currentTabIndex: 1,
  123 + },
  124 + onLoad: function (t) {
  125 + wx.setNavigationBarTitle({title: "填写订单",})
  126 + var th = this;
  127 + this.setData({is_b_now: t.is_bnow == undefined ? 0 : t.is_bnow,});
  128 + th.data.param = t;
  129 + //清理一下,确保最新的系统配置
  130 + getApp().globalData.config2 = null;
  131 + //清空is_pick_up
  132 + getApp().request.put("/api/weshop/useraddress/updatePickUp", {
  133 + data: {user_id: getApp().globalData.user_id, is_pickup: 0},
  134 + success: function (s) {
  135 + }
  136 + });
  137 +
  138 +
  139 + },
  140 + onUnload: function () {
  141 + this.setData({isclose: 1})
  142 + },
  143 + onHide: function () {
  144 + this.setData({
  145 + isget_by_quan: {},
  146 + is_no_by: {},
  147 + is_by: {}
  148 + })
  149 + },
  150 +
  151 + //----------子页返回父页触发----------
  152 + onShow: function () {
  153 + var th = this;
  154 + th.setData({show_submit: 0}); //让提交先掩藏
  155 + th.data.g_cart_q_time = null;
  156 +
  157 + if (th.data.isclose == 0) {
  158 + wx.navigateTo({
  159 + url: "/pages/index/index/index"
  160 + })
  161 +
  162 + } else {
  163 + this.getuser_addr(function (ie) {
  164 +
  165 + console.log("getuser_addr")
  166 + console.log(ie)
  167 +
  168 + //地址切换要把包邮券清空
  169 + if (!th.data.user_addr || !ie || th.data.user_addr.address_id != ie.address_id) {
  170 + var using_quan = th.data.using_quan;
  171 + for (var i in using_quan) {
  172 + var item = using_quan[i];
  173 + if (item.isby == 1) {
  174 + var ob = {}, txt = "using_quan[" + i + "]";
  175 + ob[txt] = {};
  176 + th.setData(ob);
  177 + }
  178 + }
  179 + th.data.isget_by_quan = {};
  180 + }
  181 +
  182 +
  183 + th.data.prom_goods_map = {};
  184 + th.data.is_summit_ing = 0;
  185 + //更换地址回来要重新调用计算价钱的接口
  186 + if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) {
  187 + th.setData({user_addr: ie});
  188 + if (th.data.is_b_now == 1) {
  189 + if (th.data.bn_goods) {
  190 + th.setData({add_back: 1});
  191 + //th.calculatePrice2();
  192 + }
  193 + } else {
  194 + if (th.data.cartlist) {
  195 + th.setData({add_back: 1});
  196 + //th.calculatePrice();
  197 + }
  198 + }
  199 + } else {
  200 + th.setData({user_addr: ie});
  201 + }
  202 + var going = 0;
  203 +
  204 +
  205 + //使用计时器,避免空现象
  206 + /*---
  207 + var jishi= setInterval(function () {
  208 + if (th.data.is_b_now == 1 && going==0) {
  209 + if(th.data.bn_goods) {
  210 + th.calculatePrice2();going=1;clearInterval(jishi);
  211 + }
  212 + }else if(going==0) {
  213 + if (th.data.cartlist){
  214 + th.calculatePrice();going = 1; clearInterval(jishi);
  215 + }
  216 + }
  217 + },500)--*/
  218 +
  219 + });
  220 + var is_card_back = getApp().globalData.is_card_back;
  221 + //--更新默认地址--,看一下是不是跳到地址页面,同时也不是购买等级卡返回的,这里很重要,否则会重新更新收货物流公司
  222 + if (!getApp().globalData.is_cart_old && !is_card_back && !getApp().globalData.plus_buy_back) {
  223 + this.update_code();
  224 + } else {
  225 + getApp().globalData.is_cart_old = 0;
  226 + getApp().globalData.plus_buy_back = 0;
  227 + }
  228 + }
  229 +
  230 + //先获取是否有关闭使用优惠券
  231 + getApp().getConfig2(function (ee) {
  232 + var json_d = JSON.parse(ee.switch_list);
  233 + th.data.json_d = json_d;
  234 + th.data.ispt_goods = json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
  235 + var is_default_logistics = json_d.is_default_logistics;
  236 +
  237 + th.setData({
  238 + is_close_quan: json_d.is_close_quan,
  239 + sales_rules: ee.sales_rules,
  240 + rank_switch: json_d.rank_switch,
  241 + is_default_logistics: is_default_logistics
  242 + });
  243 +
  244 + var rank_switch = json_d.rank_switch;
  245 + var max_price = -1;
  246 + var show_card = null;
  247 + var name = "";
  248 + //如果有开等级卡的时候,
  249 + //因为都是调接口,要返回在计算
  250 + if (rank_switch == 2) {
  251 + //-- 获取所有的等级卡, --
  252 + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?storeId=" + os.stoid,
  253 + {}).then(res => {
  254 + if (res.data.code == 0) {
  255 + var plusCard = res.data.data;
  256 + //-- 循环判断,拿到最贵的那张卡 --
  257 + for (var ih in plusCard) {
  258 + if (plusCard[ih].IsStopBuy == true) {
  259 + continue;
  260 + }
  261 + if (max_price < 0) {
  262 + max_price = plusCard[ih].CardFee;
  263 + name = 'card' + plusCard[ih]['CorrPrice'];
  264 + show_card = plusCard[ih];
  265 + } else {
  266 + if (max_price < plusCard[ih].CardFee) {
  267 + max_price = plusCard[ih].CardFee;
  268 + name = 'card' + plusCard[ih]['CorrPrice'];
  269 + show_card = plusCard[ih];
  270 + }
  271 + }
  272 + }
  273 +
  274 + if (show_card) {
  275 + name = name.toLowerCase();
  276 + th.setData({card_name: name, show_card: show_card})
  277 + }
  278 + }
  279 + //-----先获取物流,再获取用户信息,再展示页面-----
  280 + th.get_wuliu(th.get_info(th.show_page));
  281 + })
  282 + } else {
  283 + //-----先获取物流,再获取用户信息,再展示页面-----
  284 + th.get_wuliu(th.get_info(th.show_page));
  285 + }
  286 +
  287 + }, 1);
  288 +
  289 + //值在这里换
  290 + getApp().globalData.plus_buy_back = 0;
  291 + },
  292 +
  293 + //-------------------获取物流---------------
  294 + get_wuliu(func) {
  295 + var th = this;
  296 + to.getwuliu(function (e) {
  297 + //系统是是否开启了默认的物流
  298 + if (th.data.is_default_logistics) {
  299 + //如果第一个不是开启默认,说明要让用户自己选
  300 + if (!e[0].is_default) {
  301 + th.setData({is_default_logistics: 0});
  302 + }
  303 + }
  304 + th.setData({wu_arr: e})
  305 + typeof func == "function" && func();
  306 + })
  307 + },
  308 + //------获取会员信息-----先获取用户信息,在进行下一步---
  309 + get_info: function (func) {
  310 + var user_id = t.globalData.user_id;
  311 + to.auth.get_u(func);
  312 + },
  313 +
  314 + //------获取会员收货地址-----
  315 + getuser_addr: function (func) {
  316 + var th = this;
  317 + a.get("/api/weshop/useraddress/page", {
  318 + data: {user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600, t: Math.random()},
  319 + success: function (su) {
  320 + /*---
  321 + var user_addr=[
  322 + { 'address_id': 882, 'user_id': 2661, 'consignee': '测试测试测', 'province': 3102, 'city': 3431, 'district': 3466,
  323 + 'address': 'ed', 'more_address': '山西-长治市-襄垣县-虎(音si)亭镇', 'mobile': 13012345678,'is_default':1},
  324 + ];---*/
  325 + var item = null;
  326 + if (su.data.code == 0 && su.data.data && su.data.data.pageData) {
  327 + var user_addr = su.data.data.pageData;
  328 + var def_item = null;
  329 + for (var i = 0; i < user_addr.length; i++) {
  330 + if (user_addr[i]['is_default'] == 1) {
  331 + def_item = user_addr[i];
  332 + }
  333 + if (user_addr[i]['is_pickup'] == 1) {
  334 + item = user_addr[i];
  335 + }
  336 + }
  337 +
  338 + if (item == null) item = def_item;
  339 + if (item == null) item = user_addr[0];
  340 + }
  341 +
  342 + if (item == undefined) item = null;
  343 + if (!item) th.setData({user_addr: null}); //地址为空的时候,要清空,因为返回的时候,有缓存
  344 +
  345 + func(item);
  346 + }
  347 + });
  348 + },
  349 +
  350 + //----------------展示页面,是再获取用户信息之后--------------
  351 + show_page: function () {
  352 + var th = this, ta = this.data.param;
  353 + //th.setData({ userinfo: getApp().globalData.userInfo,}); //这个余额被缓存了
  354 +
  355 + //会员的信息,要获取最新
  356 + var user = getApp().globalData.userInfo;
  357 + getApp().request.get("/api/weshop/users/get/" + oo.stoid + "/" + user.user_id, {
  358 + data: {r: Math.random()},
  359 + success: function (e) {
  360 + getApp().globalData.userInfo = e.data.data;
  361 + th.setData({userinfo: e.data.data});
  362 +
  363 + //选获取地址
  364 + th.getuser_addr(function (addr) {
  365 + th.setData({user_addr: addr});
  366 + //--------------------------立即购买------------------
  367 + if (ta.is_bnow == 1) {
  368 + //读取门店
  369 + to.get_allsto(function (e) {
  370 + th.setData({allsto: e});
  371 + //获取立即购买的商品信息
  372 + th.get_buy_goods(ta.goods_id);
  373 + });
  374 + } else {
  375 + //------------------------购物车结算----------------------
  376 + //读取门店
  377 + to.get_allsto(function (e) {
  378 + th.setData({allsto: e});
  379 + //-------获取购物车已经选择的商品--------
  380 + th.get_cart();
  381 + })
  382 + }
  383 + });
  384 +
  385 + //获取提现金额
  386 + getApp().request.get("/api/weshop/withdrawals/summoney", {
  387 + data: {user_id: to.globalData.user_id, store_id: oo.stoid, status: 0},
  388 + success: function (su) {
  389 + if (su.data.code == 0) {
  390 + var yuer = parseFloat(th.data.userinfo.user_money -
  391 + (th.data.userinfo.frozen_money > 0 ? th.data.userinfo.frozen_money : 0) - su.data.data.summoney).toFixed(2);
  392 + th.setData({txmon: su.data.data.summoney, yuer: yuer});
  393 + }
  394 + }
  395 + });
  396 +
  397 + },
  398 + });
  399 +
  400 + },
  401 +
  402 +
  403 + //-----真的获取购物车,入口--------
  404 + get_cart: function () {
  405 + var th = this, app = getApp();
  406 + a.get("/api/weshop/cart/list", {
  407 + data: {
  408 + user_id: to.globalData.user_id, selected: 1, state: 0,
  409 + store_id: oo.stoid, pageSize: 600
  410 + },
  411 + success: async function (su) {
  412 + //按门店分类的数组
  413 + var arr = new Array();
  414 + var carr = su.data.data.pageData;
  415 + th.data.cartlist_y = carr; //存储原始购物车列表
  416 +
  417 + //---是不是购买等级卡成功的返回---等级卡显示的判断---
  418 + var is_card_back = getApp().globalData.is_card_back;
  419 +
  420 + for (var i = 0; i < carr.length; i++) {
  421 + var item1 = carr[i];
  422 + //把已经购买了多少见的内容填入
  423 +
  424 + var goodsbuynum=0,promgoodsbuynum=0;
  425 + //--要获得商品,该用户买了多少件,同步应用--
  426 + await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {
  427 + data: {
  428 + store_id: os.stoid,
  429 + user_id: getApp().globalData.user_id,
  430 + goods_id: item1.goods_id,
  431 + prom_type: item1.prom_type,
  432 + prom_id: item1.prom_id
  433 + },
  434 + }).then(res => {
  435 + var buy_num_data = res.data.data;
  436 + if (buy_num_data.promgoodsbuynum) {
  437 + promgoodsbuynum = buy_num_data.promgoodsbuynum;
  438 + }
  439 + goodsbuynum = buy_num_data.goodsbuynum;
  440 + })
  441 + //如果有购买活动
  442 + item1.promgoodsbuynum=promgoodsbuynum;
  443 +
  444 + //要把优惠活动加入,prom_goods_map中,赠品不要运算
  445 + if (item1.prom_type == 3 && item1.is_gift != 1) {
  446 + await th.add_prom_goods_map(item1);
  447 + }
  448 +
  449 + //要把组合购的东西拿出来算一下
  450 + if (item1.prom_type == 7) {
  451 + var isok = 1;
  452 + //如果有组合购
  453 + var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item1.prom_id+'/'+getApp().globalData.userInfo.user_id;
  454 + await getApp().request.promiseGet(url, {}).then(res => {
  455 + if (res.data.code == 0 && res.data.data) {
  456 + //如果活动已经结束
  457 + if (res.data.data.is_end == 1) {
  458 + isok = 0;
  459 + }
  460 + if (ut.gettimestamp() > res.data.data.end_time) {
  461 + isok = 0;
  462 + }
  463 + } else {
  464 + //未找到商品的活动
  465 + isok = 0;
  466 + }
  467 + item1.act = res.data.data;
  468 + })
  469 +
  470 + if (!isok) {
  471 + getApp().my_warnning("组合购的活动已经过期", 0, th);
  472 + return false;
  473 + }
  474 +
  475 + }
  476 + }
  477 +
  478 + //在分组的时候,就不要再调用接口,await
  479 + for (var i = 0; i < carr.length; i++) {
  480 + var item = carr[i];
  481 +
  482 + //-- 如果是等级会员注册返回 --
  483 + if (is_card_back) {
  484 + th.data.card_name = th.data.userinfo.card_field;
  485 + //如果是秒杀的返回,就要把活动弄回0
  486 + if (item['prom_type'] == 1) {
  487 + item['prom_type'] = 0;
  488 + item['prom_id'] = 0;
  489 + }
  490 + // 拼团,搭配购不计算,赠品也不计算
  491 + if (item['prom_type'] != 5 && item['prom_type'] != 6 && !item.is_gift && !item['is_collocation'] && item.goods_price > item[th.data.card_name]) {
  492 + item.goods_price = item[th.data.card_name];
  493 + carr[i].goods_price = item[th.data.card_name];
  494 +
  495 + }
  496 + } else {
  497 + // 拼团,搭配购不计算,赠品也不计算,同时会员还未购买等级会员
  498 + if (item[th.data.card_name] > 0 && item['prom_type'] != 5 && item['prom_type'] != 6 && !th.data.userinfo.card_field
  499 + && !item.is_gift && !item['is_collocation'] && item.goods_price > item[th.data.card_name]) {
  500 + item.cut_price1 = item.goods_price - item[th.data.card_name];
  501 + carr[i].cut_price1 = (item.goods_price - item[th.data.card_name]) * item.goods_num;
  502 + }
  503 +
  504 + }
  505 +
  506 + item.original_img = oo.imghost + item.original_img;
  507 +
  508 + var car_item=item;
  509 + /*----接口要弄出来的,先顶着-----*/
  510 + var pcid = car_item.pick_id;
  511 + var find = 0;
  512 + //----如果有就加进去,没有就新增一个----
  513 + //-----------循环查找门店-------------
  514 + if (arr.length > 0) {
  515 + for (var j = 0; j < arr.length; j++) {
  516 + if (arr[j].pickup_id == pcid) {
  517 + //if(item.is_gift!=1){
  518 + //确定配送方式
  519 + if (arr[j].distr_t == 0) {
  520 + arr[j].distr_t = car_item.distr_type;
  521 + }
  522 + var e_t = 0
  523 + switch (arr[j].distr_t) {
  524 + case 0:
  525 + e_t = 1;
  526 + if (th.data.json_d.pickupway && th.data.json_d.pickupway == 1) e_t = 0;
  527 + break;
  528 + case 1:
  529 + e_t = 1;
  530 + break;
  531 + case 2:
  532 + e_t = 0;
  533 + break;
  534 + }
  535 + arr[j].exp_type = e_t;
  536 + if (e_t == 0) th.setData({is_all_zt: 0});
  537 + //}
  538 +
  539 + //-- 把等级卡会优惠多少钱装进去 --
  540 + if (car_item.cut_price1) arr[j].card_cut_price += car_item.cut_price1;
  541 +
  542 + arr[j].goods.push(car_item);
  543 + find = 1;
  544 + break;
  545 + }
  546 + }
  547 + }
  548 + //------如果没有找到-----
  549 + if (find == 0) {
  550 + var pikname = '', sto = null;
  551 + //----找到门店名称-----
  552 + for (var k = 0; k < th.data.allsto.length; k++) {
  553 + if (pcid == th.data.allsto[k].pickup_id) {
  554 + pikname = th.data.allsto[k].pickup_name;
  555 + sto = th.data.allsto[k];
  556 + break;
  557 + }
  558 + }
  559 + var e_t = 0, dis_t = 0;//物流方式,配送方式
  560 + if (item.distr_type == 0) {
  561 + dis_t = sto.distr_type;
  562 + } else {
  563 + dis_t = item.distr_type;
  564 + }
  565 + switch (dis_t) {
  566 + case 0:
  567 + e_t = 1;
  568 + //-- 系统后台有设置要默认的 --
  569 + if (th.data.json_d.pickupway && th.data.json_d.pickupway == 1) e_t = 0;
  570 + break;
  571 + case 1:
  572 + e_t = 1;
  573 + break;
  574 + case 2:
  575 + e_t = 0;
  576 + break;
  577 + }
  578 + //如果是物流的话,全部自提的控制要弄成0
  579 + if (e_t == 0) th.setData({is_all_zt: 0});
  580 +
  581 + var narr = new Array();
  582 + narr.push(car_item);
  583 +
  584 + //-----------拼装购物车结算的数组,如果有默认物流时要用默认物流编号,计算默认的物流,不管是不是自提都算一下-----------------
  585 + var m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code;
  586 + if (def_exp_code) {
  587 + for (var k = 0; k < th.data.wu_arr.length; k++) {
  588 + var item = th.data.wu_arr[k];
  589 + if (def_exp_code == item.code) {
  590 + m_wind = k;
  591 + }
  592 + }
  593 + }
  594 +
  595 + var ie = {
  596 + pickup_id: pcid,
  597 + pname: pikname,
  598 + goods: narr,
  599 + wind: m_wind,
  600 + distr_t: dis_t,
  601 + card_cut_price: 0,
  602 + exp_type: e_t,
  603 + goods_price: 0,
  604 + shipping_price: 0,
  605 + user_money: 0,
  606 + total_amount: 0,
  607 + order_amount: 0,
  608 + user_note: 0
  609 + };
  610 +
  611 + //-- 把等级卡会优惠多少钱装进去 --
  612 + if (car_item.cut_price1) ie.card_cut_price += car_item.cut_price1;
  613 + arr.push(ie);
  614 +
  615 + }
  616 + }
  617 + //-- 如果是回退回来的情况 --
  618 + if (th.data.cartlist && th.data.cartlist.length > 0) {
  619 + for (var kj in th.data.cartlist) {
  620 + for (var ih in arr) {
  621 + var ie = arr[ih];
  622 + if (ie.pickup_id == th.data.cartlist[kj].pickup_id) {
  623 + ie.exp_type = parseInt(th.data.cartlist[kj].exp_type);
  624 + ie.wind = parseInt(th.data.cartlist[kj].wind);
  625 + break;
  626 + }
  627 + }
  628 + }
  629 + }
  630 +
  631 + //-- 循环计算一下线下取价 --
  632 + for (var k = 0; k < arr.length; k++) {
  633 + var c_item = arr[k];
  634 + var item = arr[k].goods;
  635 + var offline_price = 0;
  636 + var offline_num = 0;
  637 + for (var c = 0; c < item.length; c++) {
  638 + if(th.data.sales_rules!=2){
  639 + item[c].offline_price=0;
  640 + }
  641 + //-- 如果这个商品是线下取价的时候 --
  642 + if (item[c].offline_price > 0 && item[c].prom_type != 7 ) {
  643 + offline_price += (item[c].goods_price - item[c].offline_price) * item[c].goods_num;
  644 + offline_num += item[c].goods_num;
  645 + }
  646 + }
  647 + if (offline_price > 0) {
  648 + c_item.offline_price = offline_price;
  649 + c_item.offline_num = offline_num;
  650 + c_item.is_offline = 1;
  651 + }
  652 + }
  653 +
  654 + //每一个门店内的组合购要进行拆分,
  655 + //还得把组合商品的多余商品的线下价格算一算
  656 + for (let var1 in arr) {
  657 + var u_item = arr[var1];
  658 + //把组合购进行分组
  659 + var obj = zh_calc.find_split(u_item);
  660 + if (!obj) continue;
  661 + //存储不同活动的商品列表
  662 + u_item.zh_prom_goods = {};
  663 + for (let var1 in obj) {
  664 + var h_item = obj[var1];
  665 + var gdlist = null;
  666 + var url1 = "/api/weshop/prom/zhbuyGoods/page";
  667 + var req_data = {
  668 + page: 1,
  669 + pageSize: 2000,
  670 + store_id: os.stoid,
  671 + zh_id: h_item.prom_id,
  672 + }
  673 + await getApp().request.promiseGet(url1, {
  674 + data: req_data
  675 + }).then(res => {
  676 + if (ut.ajax_ok(res)) {
  677 + gdlist = res.data.data.pageData;
  678 + }
  679 + })
  680 + //获取活动需要的商品列表
  681 + u_item.zh_prom_goods[h_item.prom_id] = {gdlist: gdlist, act: h_item.act};
  682 + }
  683 + zh_calc.fir_set_arr(u_item, th);
  684 + }
  685 + //深拷贝
  686 + th.data.old_cartlist = JSON.parse(JSON.stringify(arr));
  687 + th.setData({
  688 + cartlist: arr,
  689 + });
  690 + //--- 获取一下看有没有优惠券 ----
  691 + setTimeout(function () {
  692 + var frozenQuan = null;
  693 + var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id;
  694 + app.request.promiseGet(url0, {1: 1}).then(res => {
  695 + if (res.data.code == 0) {
  696 + frozenQuan = res.data.data;
  697 + th.data.frozenQuan = frozenQuan;
  698 + }
  699 + th.calculatePrice();
  700 + th.get_cart_quan();
  701 + })
  702 +
  703 + }, 500)
  704 +
  705 + }
  706 + });
  707 + },
  708 +
  709 + //-----获取立即购买的商品信息,入口----
  710 + get_buy_goods: function (e) {
  711 + var th = this;
  712 + var gg = to.get_b_now();
  713 + //--------如果goods_id一样,就是要立即购买-----
  714 + if (e == gg.goods_id) {
  715 + a.get("/api/weshop/goods/get/" + oo.stoid + "/" + e, {
  716 + success: async function (t) {
  717 + var gd = t.data.data;
  718 + if (!gd) return false;
  719 +
  720 + t.data.data.original_img = oo.imghost + t.data.data.original_img;
  721 + t.data.data['buynum'] = gg.goods_num;
  722 + var distr_t = 0, et = 0
  723 + if (t.data.data.distr_type == 0) {
  724 + distr_t = gg.pick_dis;
  725 + } else {
  726 + distr_t = t.data.data.distr_type;
  727 + }
  728 +
  729 + switch (distr_t) {
  730 + case 0:
  731 + et = 1;
  732 + //-- 系统后台有设置要默认的 --
  733 + if (th.data.json_d.pickupway && th.data.json_d.pickupway == 1) et = 0;
  734 + break;
  735 + case 1:
  736 + et = 1;
  737 + break;
  738 + case 2:
  739 + et = 0;
  740 + break;
  741 + }
  742 +
  743 +
  744 + var m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code;
  745 + if (et == 0 && def_exp_code) {
  746 + for (var k = 0; k < th.data.wu_arr.length; k++) {
  747 + var item = th.data.wu_arr[k];
  748 + if (def_exp_code == item.code) {
  749 + m_wind = k;
  750 + }
  751 + }
  752 + }
  753 +
  754 + if (th.data.bn_goods) {
  755 + et = th.data.bn_exp_type;
  756 + m_wind = th.data.index;
  757 + }
  758 +
  759 + //---是不是购买等级卡成功的返回---等级卡显示的判断---
  760 + var is_card_back = getApp().globalData.is_card_back;
  761 + if (is_card_back) {
  762 + th.data.card_name = th.data.userinfo.card_field;
  763 + gg.goods_price = gd[th.data.card_name];
  764 + getApp().globalData.is_card_back = 0;
  765 + th.setData({card_cut_price: 0});
  766 + //如果是秒杀的返回
  767 + if (gd.prom_type == 1) gd.prom_type = 0;
  768 + } else {
  769 + //--- 商家等级卡开通的情况下, 会员不是等级会员的情况, 商品有设置等级卡价格,同时等级卡价格小于商品的价格
  770 + //-- 搭配购的商品也可以单独购买,所以此时搭配购的商品要进行计算优惠 --
  771 + 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) {
  772 + var cut_p = (gg.goods_price - gd[th.data.card_name]) * gg.goods_num;
  773 + th.setData({card_cut_price: cut_p});
  774 + }
  775 + }
  776 +
  777 + switch (gd.prom_type) {
  778 + case 0:
  779 + case 2:
  780 + case 3:
  781 + case 4:
  782 + case 5:
  783 + case 6:
  784 + case 7:
  785 + //--此时开始计算商品的使用券相关,如果有等级价还要计算和等级价相关的,
  786 + // 如果有优惠促销,还要把促销的部分计算在内,因为促销还有不能使用优惠券--
  787 + t.data.data.shop_price = gg.goods_price;
  788 + t.data.data.goods_price = gg.goods_price;
  789 + t.data.data.goods_num = gg.goods_num;
  790 + th.data.ckeck_quan_price = t.data.data.shop_price * gg.goods_num;
  791 + th.data.check_quan_price_list = t.data.data.shop_price * gg.goods_num + "";
  792 + th.data.check_quan_ware_list = t.data.data.erpwareid + "";
  793 +
  794 + //-- 如果有线下取价的时候 --
  795 + if (gg.offline_price) {
  796 + t.data.data.offline_price = gg.offline_price;
  797 + t.data.data.pricing_type = gg.pricing_type;
  798 + t.data.data.is_offline = 1;
  799 +
  800 + th.data.ckeck_quan_price = t.data.data.offline_price * gg.goods_num;
  801 + th.data.check_quan_price_list = t.data.data.offline_price * gg.goods_num + "";
  802 + th.data.check_quan_ware_list = t.data.data.erpwareid + "";
  803 + }
  804 +
  805 + t.data.data.prom_id = 0;
  806 + t.data.data.prom_type = 0;
  807 +
  808 + //如果立即购买那边过来,就要读取接口,查看活动的优惠内容
  809 + if (gg.prom_type == 3) {
  810 + t.data.data.prom_id = gg.prom_id;
  811 + t.data.data.prom_type = 3;
  812 + //如果是优惠活动,就要调用活动,计算价格
  813 + th.buy_now_prom_goods(gg.prom_id, t.data.data, function (data) {
  814 + //判断一下购买商品的数量是不是超过
  815 + if (data.gift_goods_id) {
  816 + var num = 1;
  817 + if (data.is_bz == 1) {
  818 + num = data.bs;
  819 + if (num > data.gift_limit_num) num = 0;
  820 + }
  821 + //如果赠品数量超出礼品库存,就取消
  822 + if (num > data['gift_storecount']) num = 0;
  823 + if (num > 0) {
  824 + var ob = {};
  825 + ob.is_gift = 1;
  826 + ob.prom_id = data.prom_id;
  827 + ob.goods_id = data.gift_goods_id;
  828 + ob.goods_name = data.gift_goods_name;
  829 + ob.goods_color = data.gift_goods_color;
  830 + ob.goods_spec = data.gift_goods_spec;
  831 + ob.original_img = os.imghost + data.gift_original_img;
  832 + ob.market_price = data.gift_market_price;
  833 + ob.gift_id = data.gift_id;
  834 + ob.shop_price = 0;
  835 + ob.buynum = num;
  836 + ob.weight = data.gift_weight; //商品的重量
  837 + ob.exp_sum_type = data.gift_exp_sum_type; //商品的物流计算方式
  838 + ob.uniform_exp_sum = data.gift_uniform_exp_sum //统一运费的金额
  839 +
  840 + th.setData({buy_now_gift_goods: ob});
  841 + }
  842 + }
  843 +
  844 + th.setData({
  845 + bn_goods: data, bn_pickname: gg.pick_name, index: m_wind,
  846 + bn_pick: gg.pick_id, bn_t_exp_t: distr_t, bn_exp_type: et
  847 + });
  848 +
  849 + //计算价格
  850 + th.calculatePrice2();
  851 + //获取优惠券
  852 + th.get_buy_now_quan();
  853 +
  854 + })
  855 + } else {
  856 + //--看是不是搭配促销--
  857 + if (gg.prom_type == 5) {
  858 + t.data.data.prom_id = gg.prom_id;
  859 + t.data.data.prom_type = 5;
  860 + if (gg.room_id) {
  861 + t.data.data.room_id = gg.room_id;
  862 + }
  863 + //--主商品要有导购id和导购类型--
  864 + if (gg.guide_id) {
  865 + t.data.data.guide_id = gg.guide_id;
  866 + t.data.data.guide_type = gg.guide_type;
  867 + }
  868 + th.setData({collocation_goods: gg.collocation_goods});
  869 +
  870 + var cart_arr = new Array();
  871 + //var narr=gg.collocation_goods;
  872 + //修改成深拷贝,确保返回是数据正确
  873 + var narr = JSON.parse(JSON.stringify(gg.collocation_goods));
  874 +
  875 + narr.push(t.data.data);
  876 +
  877 + //-- 搭配促销的门店配送方式的修复 --
  878 + et = 1;
  879 + distr_t = 0;
  880 + for (var hi in narr) {
  881 + var dis_t = narr[hi].distr_type;
  882 + if (dis_t == 2) {
  883 + th.setData({is_all_zt: 0});
  884 + et = 0;
  885 + }
  886 + if (dis_t > 0) {
  887 + distr_t = dis_t;
  888 + }
  889 + }
  890 +
  891 + //自选的时候,系统配置了默认的配送方式是物流的时候
  892 + if (distr_t == 0 && th.data.json_d.pickupway && th.data.json_d.pickupway == 1) {
  893 + et = 0;
  894 + }
  895 +
  896 +
  897 + var ie = {
  898 + pickup_id: gg.pick_id,
  899 + pname: gg.pick_name,
  900 + goods: narr,
  901 + exp_type: et,
  902 + wind: m_wind,
  903 + distr_t: distr_t,
  904 + bn_t_exp_t: distr_t,
  905 + goods_price: 0,
  906 + shipping_price: 0,
  907 + user_money: 0,
  908 + total_amount: 0,
  909 + order_amount: 0,
  910 + user_note: 0
  911 + };
  912 + cart_arr.push(ie);
  913 + th.data.old_cartlist = cart_arr;
  914 + }
  915 + th.setData({
  916 + bn_goods: t.data.data, bn_pickname: gg.pick_name, index: m_wind,
  917 + bn_pick: gg.pick_id, bn_t_exp_t: distr_t, bn_exp_type: et
  918 + });
  919 +
  920 +
  921 + //--搭配促销也是按照购物车的方式来计算优惠券--
  922 + if (gg.prom_type == 5) {
  923 + var frozenQuan = null;
  924 + var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id;
  925 + app.request.promiseGet(url0, {1: 1}).then(res => {
  926 + if (res.data.code == 0) {
  927 + frozenQuan = res.data.data;
  928 + th.data.frozenQuan = frozenQuan;
  929 + }
  930 + //计算价格
  931 + th.calculatePrice2();
  932 + th.get_cart_quan();
  933 + });
  934 + } else {
  935 + //计算价格
  936 + th.calculatePrice2();
  937 + //获取优惠券,
  938 + th.get_buy_now_quan();
  939 + }
  940 + }
  941 +
  942 + break;
  943 + case 1: //---秒杀-----
  944 + var quanlist = null;
  945 + getApp().request.get("/api/weshop/activitylist/getSJGoodsPrice/" + gd.store_id
  946 + + "/" + gd.goods_id + "/1/" + gd.prom_id, {
  947 + success: async function (tt) {
  948 + if (tt.data.code == 0) {
  949 + t.data.data.shop_price = tt.data.data.prom_price;
  950 + } else {
  951 + t.data.data.prom_id = 0;
  952 + t.data.data.prom_type = 0;
  953 +
  954 + th.data.ckeck_quan_price = t.data.data.shop_price * gg.goods_num;
  955 + th.data.check_quan_price_list = t.data.data.shop_price * gg.goods_num + "";
  956 + th.data.check_quan_ware_list = t.data.data.erpwareid + "";
  957 + }
  958 +
  959 + th.setData({
  960 + bn_goods: t.data.data,
  961 + bn_pickname: gg.pick_name,
  962 + bn_exp_type: et,
  963 + index: m_wind,
  964 + bn_pick: gg.pick_id,
  965 + bn_t_exp_t: distr_t,
  966 + bn_exp_type: et
  967 + });
  968 +
  969 + //计算价格
  970 + th.calculatePrice2();
  971 + //获取优惠券,如果有券的钱,就调用
  972 + if(th.data.ckeck_quan_price>0) th.get_buy_now_quan();
  973 + }
  974 + });
  975 +
  976 + break;
  977 + }
  978 + },
  979 + });
  980 + }
  981 + },
  982 +
  983 + //---------------检查是否有收货地址-------------------
  984 + checkAddressList: function () {
  985 + var t = this;
  986 + return !(!this.data.order || null == this.data.order.userAddress) || (wx.showModal({
  987 + title: "请先填写或选择收货地址~",
  988 + success: function (a) {
  989 + a.confirm ? t.enterAddressPage() : wx.navigateBack();
  990 + },
  991 + fail: function () {
  992 + wx.navigateBack();
  993 + }
  994 + }), !1);
  995 + },
  996 + showInvoice: function () {
  997 + this.setData({
  998 + invoiceToggle: !this.data.invoiceToggle
  999 + });
  1000 + },
  1001 + keyUpChangePay1: function (t) {
  1002 + this.setData({
  1003 + payWithUserMoney: !(t.detail.value.length > 0)
  1004 + });
  1005 + },
  1006 + keyUpChangePay2: function (t) {
  1007 + this.setData({
  1008 + payWithPoints: !(t.detail.value.length > 0)
  1009 + });
  1010 + },
  1011 + keyUpChangeNum: function (t) {
  1012 + this.setData({
  1013 + maxWord: t.detail.value.length
  1014 + });
  1015 + },
  1016 +
  1017 + calc_per: async function (c_arr) {
  1018 + var th = this;
  1019 + //-- 循环处理 --
  1020 + for (var i in c_arr) {
  1021 + var cart_item = c_arr[i]; //就是每一单的意思
  1022 + var pickid = cart_item.pickup_id;
  1023 + var ord_goods = c_arr[i].goods; //就是每一单的从表的意思
  1024 + var o_price = 0, q_conditin = 0;
  1025 + //--------循环计算总价-----------
  1026 + for (var j = 0; j < ord_goods.length; j++) {
  1027 + o_price += ord_goods[j].goods_price * ord_goods[j].goods_num;
  1028 + }
  1029 +
  1030 + //---如果该门店的相关活动,就要算一下减价--
  1031 + if (th.data.prom_goods_map[pickid]) {
  1032 + var ob = th.data.prom_goods_map[pickid];
  1033 + for (var ii in ob) {
  1034 + var item_map = ob[ii];
  1035 + if (item_map.bs == undefined || item_map.bs == null) {
  1036 + //等待,获取一下优惠活动的信息
  1037 + await getApp().request.promiseGet("/api/weshop/goods/getDiscount", {
  1038 + data: {
  1039 + price: item_map.price, prom_id: item_map.prom_id,
  1040 + goods_num: item_map.goods_num, user_id: getApp().globalData.user_id,
  1041 + is_bz: item_map.is_bz
  1042 + }
  1043 + }).then(res => {
  1044 + if (res.data.code == 0 && res.data.data.condition) {
  1045 + var get_data = res.data.data;
  1046 + item_map.is_bz = get_data.is_bz; //是不是倍增
  1047 + item_map.bs = get_data.bs; //是不是倍数
  1048 + item_map.is_past = get_data.is_past; //是不是包邮
  1049 + item_map.prom_price = get_data.price >= 0 ? get_data.price : item_map.price;
  1050 + item_map.s_intValue = get_data.intValue;
  1051 + item_map.s_coupon_id = get_data.coupon_id;
  1052 + item_map.s_coupon_num = get_data.coupon_num;
  1053 + if (get_data.gift_id && get_data.goodsinfo) {
  1054 + item_map.gift_id = get_data.gift_id;
  1055 + item_map.gift_goods_id = get_data.goods_id;
  1056 + item_map.gift_goods_name = get_data.goods_name;
  1057 + item_map.gift_goods_color = get_data.goodsinfo.goods_color ? get_data.goodsinfo.goods_color : '';
  1058 + item_map.gift_goods_spec = get_data.goodsinfo.goods_spec ? get_data.goodsinfo.goods_spec : '';
  1059 + item_map.gift_original_img = get_data.goodsinfo.original_img;
  1060 + item_map.gift_limit_num = get_data.limit_num;
  1061 + item_map.gift_storecount = get_data.gift_storecount;
  1062 + item_map.gift_weight = get_data.goodsinfo.weight;
  1063 + item_map.gift_exp_sum_type = get_data.goodsinfo.exp_sum_type;
  1064 + item_map.uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum;
  1065 +
  1066 + }
  1067 + item_map.s_libao = get_data.libao;
  1068 + item_map.s_lb_num = get_data.lb_num;
  1069 + }
  1070 + })
  1071 + }
  1072 +
  1073 + //有活动,且优惠活动并没有限制使用优惠券,且有减价
  1074 + //--看有没有减价--
  1075 + //if(item_map.prom_price>=0 && item_map.price-item_map.prom_price){
  1076 + if (item_map.price - item_map.prom_price && item_map.prom_price !== null) {
  1077 + if (cart_item.prom_pt_json) {
  1078 + cart_item.prom_pt_json.push({
  1079 + "prom_id": item_map.prom_id,
  1080 + "dis": (item_map.price - item_map.prom_price).toFixed(2),
  1081 + "ispt": 0
  1082 + })
  1083 + } else {
  1084 + cart_item.prom_pt_json = [{
  1085 + "prom_id": item_map.prom_id,
  1086 + "dis": (item_map.price - item_map.prom_price).toFixed(2),
  1087 + "ispt": 0
  1088 + }];
  1089 + }
  1090 +
  1091 + //-- 如果系统要平摊到单品 --
  1092 +
  1093 + var pt_data = {
  1094 + 'prom_id': item_map.prom_id,
  1095 + 'dis': parseFloat((item_map.price - item_map.prom_price).toFixed(2)),
  1096 + 'goods': item_map.goods
  1097 + }
  1098 +
  1099 + var pt_res = null;
  1100 + await getApp().request.promisePost("/api/weshop/order/getGoodsSplit", {
  1101 + is_json: 1,
  1102 + data: pt_data
  1103 + }).then(res => {
  1104 + if (res.data.code == 0) {
  1105 + pt_res = res.data.data;
  1106 + }
  1107 + })
  1108 + if (pt_res) {
  1109 + for (var io in item_map.goods) {
  1110 + //平摊赋值
  1111 + item_map.goods[io].account_fir = th.arr_get_goods(item_map.goods[io].goods_id, pt_res).fisrt_account;
  1112 + item_map.goods[io].account_yu_fir = th.arr_get_goods(item_map.goods[io].goods_id, pt_res).fisrt_account_yu;
  1113 + if (!th.data.ispt_goods) {
  1114 + item_map.goods[io].account = item_map.goods[io].account_fir;
  1115 + item_map.goods[io].account_yu = item_map.goods[io].account_yu_fir;
  1116 + }
  1117 + }
  1118 + }
  1119 +
  1120 +
  1121 + o_price -= (item_map.price - item_map.prom_price);
  1122 + //如果有限制使用优惠券,就要减掉参与的活动商品的钱
  1123 + if (!item_map.is_xz_yh) q_conditin = o_price;
  1124 + }
  1125 +
  1126 + //--------循环计算商品是不是包邮,是不是使用优惠券,此时循环是商品从表-----------
  1127 + for (var j = 0; j < ord_goods.length; j++) {
  1128 + if (ord_goods[j].is_gift) continue;
  1129 + if (ord_goods[j].prom_type == 3 && ord_goods[j].prom_id == item_map.prom_id) {
  1130 + ord_goods[j].is_xz_yh = item_map.is_xz_yh;
  1131 + ord_goods[j].is_past = item_map.is_past;
  1132 + ord_goods[j].account_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_fir;
  1133 + ord_goods[j].account_yu_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_yu_fir;
  1134 + ord_goods[j].account = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account;
  1135 + ord_goods[j].account_yu = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_yu;
  1136 + }
  1137 + }
  1138 +
  1139 +
  1140 + //--优惠多少钱--
  1141 + if (!cart_item.cut_price) cart_item.cut_price = 0;
  1142 + //-- --
  1143 + if (item_map.price != undefined && item_map.price != null
  1144 + && item_map.prom_price != undefined && item_map.prom_price != null)
  1145 + cart_item.cut_price += (item_map.price - item_map.prom_price);
  1146 + //---如果有送积分---
  1147 + if (item_map.s_intValue) {
  1148 + if (!cart_item.s_intValue) cart_item.s_intValue = 0;
  1149 + cart_item.s_intValue += item_map.s_intValue;
  1150 + }
  1151 + //-- 如果有送优惠券的情况 --
  1152 + if (item_map.s_coupon_id) {
  1153 + if (!cart_item.s_coupon_id) {
  1154 + cart_item.s_coupon_id = item_map.s_coupon_id + "";
  1155 + cart_item.g_coupon_num = [{'c_id': item_map.s_coupon_id, "num": item_map.s_coupon_num}];
  1156 + }
  1157 + else {
  1158 + cart_item.s_coupon_id += "," + item_map.s_coupon_id;
  1159 + cart_item.g_coupon_num.push({'c_id': item_map.s_coupon_id, "num": item_map.s_coupon_num})
  1160 + }
  1161 + }
  1162 +
  1163 + //-- 如果有送优包邮券的情况 --
  1164 + if (item_map.s_libao) {
  1165 + if (!cart_item.s_libao) {
  1166 + cart_item.s_libao = item_map.s_libao + "";
  1167 + cart_item.g_lb_num = [{'l_id': item_map.s_libao, "num": item_map.s_lb_num}];
  1168 + }
  1169 + else {
  1170 + cart_item.s_libao += "," + item_map.s_libao;
  1171 + cart_item.g_lb_num.push({'l_id': item_map.s_libao, "num": item_map.s_lb_num})
  1172 + }
  1173 + }
  1174 + }
  1175 + }
  1176 + }
  1177 + },
  1178 +
  1179 + //-------------------计算订单价格-------------------
  1180 + calculatePrice: function (t, s) {
  1181 + var th = this;
  1182 + to.getConfig2(function (ee) {
  1183 + to.getwuliuprice(async function (rs) {
  1184 + wx.showLoading({
  1185 + title: "处理中."
  1186 + })
  1187 + var all_price = 0; //所有的商品总价
  1188 + var all_shipping_m = 0; //所有的物流总价
  1189 + var all_total_m = 0; //所有的订单应付总价
  1190 + var all_order_m = 0; //所有的订单应付总价
  1191 + var all_user_m = 0; //所有的订单用户使用金额
  1192 + var all_coupon_price_m = 0; //所有的订单用户使用优惠券价格
  1193 + var all_cutprice = 0; //所有的优惠减
  1194 + var all_zh_cutprice = 0; //所有的组合优惠减
  1195 + var all_order_prom = 0; //所有的订单优惠
  1196 +
  1197 + var umoney = th.data.userinfo.user_money - th.data.txmon - (th.data.userinfo.frozen_money ? th.data.userinfo.frozen_money : 0);
  1198 + var freight_free = ee.freight_free; //全场满多少包邮
  1199 + var no_ex_id = ee.no_ex_id;
  1200 + var no_ex_good = null;
  1201 + var by_qc = {};
  1202 +
  1203 + if (no_ex_id && freight_free > 0) {
  1204 + //-----------获取不包邮区域,不包邮商品-------
  1205 + await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", {
  1206 + data: {store_id: os.stoid, id: no_ex_id}
  1207 + }).then(res => {
  1208 + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
  1209 + by_qc = res.data.data[0];
  1210 + }
  1211 + })
  1212 + }
  1213 + ;
  1214 + var c_arr = JSON.parse(JSON.stringify(th.data.old_cartlist));
  1215 +
  1216 + if (th.data.cartlist && th.data.cartlist.length > 0) {
  1217 + for (var i = 0; i < c_arr.length; i++) {
  1218 + c_arr[i].exp_type = th.data.cartlist[i].exp_type;
  1219 + c_arr[i].wind = th.data.cartlist[i].wind;
  1220 + }
  1221 + }
  1222 +
  1223 + //调用函数计算每件商品的单价
  1224 + await th.calc_per(c_arr);
  1225 + //调用函数计算每件组合购商品的单价,
  1226 + await zh_calc.calc_zh_split_price(c_arr,th);
  1227 + //调用函数计算,优惠券优惠什么商品价格,优惠券优惠什么商品
  1228 + await th.get_cart_quan(c_arr);
  1229 + //---循环购物车---
  1230 + for (var i in c_arr) {
  1231 + //因为搭配购买也是再这里计算,搭配购的is_b_now==1
  1232 + if (th.data.is_b_now == 0) {
  1233 + //此时物流的选择方式要用th.data.cartlist;
  1234 + c_arr[i].exp_type = th.data.cartlist[i].exp_type;
  1235 + c_arr[i].wind = th.data.cartlist[i].wind;
  1236 + if (th.data.cartlist[i].check_quan_price_list) c_arr[i].check_quan_price_list = th.data.cartlist[i].check_quan_price_list; //优惠券优惠什么商品价格
  1237 + if (th.data.cartlist[i].check_quan_ware_list) c_arr[i].check_quan_ware_list = th.data.cartlist[i].check_quan_ware_list; //优惠券优惠什么商品
  1238 + } else {
  1239 + c_arr[i].exp_type = th.data.bn_exp_type; //配送方式
  1240 + c_arr[i].wind = th.data.index; //立即购买选择的物流
  1241 + //c_arr[i].=th.data. //立即购买的使用余额
  1242 + if (th.data.cartlist) c_arr[i].check_quan_price_list = th.data.cartlist[i].check_quan_price_list; //优惠券优惠什么商品价格
  1243 + if (th.data.cartlist) c_arr[i].check_quan_ware_list = th.data.cartlist[i].check_quan_ware_list; //优惠券优惠什么商品
  1244 + }
  1245 +
  1246 + var cart_item = c_arr[i]; //就是每一单的意思
  1247 + var pickid = cart_item.pickup_id;
  1248 + var o_price = 0;
  1249 + var o_price_no_zh=0; //不包含限制优惠叠加组合购的金额汇总
  1250 + var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
  1251 + var item = c_arr[i].goods; //就是每一单的从表的意思
  1252 +
  1253 + //---如果有选择优惠券的情况下---
  1254 + var quan_price = 0;
  1255 + var coupon_price = 0;
  1256 + var quan_no = null;
  1257 + var is_has_zh=c_arr[i].is_has_zh;
  1258 + var zh_prom_goods=c_arr[i].zh_prom_goods; //组合购计算的原始数据存储空间
  1259 +
  1260 + if (th.data.using_quan[pickid] != null && th.data.using_quan[pickid] != undefined)
  1261 + quan_no = th.data.using_quan[pickid].coupon_no;
  1262 +
  1263 + //普通券的时候
  1264 + if (quan_no && th.data.using_quan[pickid].isby != 1) {
  1265 + //---获取优惠券优惠---
  1266 + await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", {
  1267 + data: {
  1268 + storeId: oo.stoid,
  1269 + CashRepNo: quan_no,
  1270 + WaresSum: cart_item.check_quan_price_list,
  1271 + WareIds: cart_item.check_quan_ware_list
  1272 + }
  1273 + }).then(res => {
  1274 + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
  1275 + var q_data = res.data.data;
  1276 + //--存储商品优惠的内容--
  1277 + cart_item.quan_youhui_list = q_data;
  1278 + for (var k in q_data)
  1279 + quan_price += q_data[k].WareCashSum;
  1280 + }
  1281 + })
  1282 + }
  1283 +
  1284 + //--------循环计算总价-----------
  1285 + for (var j = 0; j < item.length; j++) {
  1286 + if(item[j].prom_type!=7){
  1287 + o_price_no_zh += item[j].goods_price * item[j].goods_num;
  1288 + }
  1289 + //组合购的商品,且有订单优惠的叠加,is_orderyh就是优惠叠加
  1290 + else if(zh_prom_goods && zh_prom_goods[item[j].prom_id] && zh_prom_goods[item[j].prom_id].act.is_orderyh )
  1291 + {
  1292 + o_price_no_zh += item[j].goods_price * item[j].goods_num;
  1293 + }
  1294 + o_price += item[j].goods_price * item[j].goods_num;
  1295 + }
  1296 + //判断是不是有组合购的金额
  1297 + var f_o_price = o_price;
  1298 + //如果又优惠的钱,就要减价
  1299 + if (c_arr[i].cut_price > 0){
  1300 + o_price -= c_arr[i].cut_price;
  1301 + o_price_no_zh-=c_arr[i].cut_price;
  1302 + }
  1303 + //如果有组合购优惠的钱,就要减价
  1304 + if (c_arr[i].zh_cut_price>0 || c_arr[i].zh_cut_price<0){
  1305 + o_price -= c_arr[i].zh_cut_price;
  1306 + if(o_price_no_zh>0){
  1307 + //找到那些可以订单优惠叠加的
  1308 + for(let ij in zh_prom_goods){
  1309 + let kitem=zh_prom_goods[ij];
  1310 + if(kitem.act.is_orderyh) continue;
  1311 + o_price_no_zh-=kitem.cut_price;
  1312 + }
  1313 + }
  1314 + }
  1315 +
  1316 + //-- 计算线下取价的功能 --
  1317 + if (cart_item.is_offline == 1) {
  1318 + o_price = o_price - cart_item.offline_price;
  1319 + o_price_no_zh-=c_arr[i].offline_price;
  1320 + }
  1321 + //判断包邮券的钱,组合购的商品不使用优惠券
  1322 + var q_conditin = 0;
  1323 + q_conditin = o_price - quan_price;
  1324 + if(is_has_zh){
  1325 + q_conditin = o_price_no_zh - quan_price;
  1326 + }
  1327 + cart_item.goods_price = f_o_price.toFixed(2); //商品总费用,用f_o_price来计算
  1328 + //计算物流费用
  1329 + cart_item.shipping_price = 0;
  1330 +
  1331 +
  1332 + //--有不包邮区域,且不免运费,全场的计算,要减到优惠金额 和券的金额--
  1333 + if (no_ex_id && freight_free > 0 && (o_price - quan_price) >= freight_free && cart_item.exp_type == 0 && (by_qc.region_list || by_qc.goods_list)) {
  1334 + //如果有设置不包邮区域的时候
  1335 + if (by_qc.region_list != "" && by_qc.region_list != null && by_qc.region_list != undefined) {
  1336 + if (th.check_by_area(by_qc.region_list)) {
  1337 + freight_free = 0;
  1338 + th.data.is_no_by[pickid] = 1;
  1339 + }
  1340 + }
  1341 + //如果有设置不包邮区商品
  1342 + if (by_qc.goods_list != "" && by_qc.goods_list != undefined && by_qc != null && freight_free > 0) {
  1343 + freight_free = 0;
  1344 + no_ex_good = by_qc.goods_list;
  1345 + }
  1346 + }
  1347 +
  1348 + //--如果是物流,且选择了地址,就要开始显示包邮券,且包邮券也已经优惠了优惠活动的金额--
  1349 + if (cart_item.exp_type == 0 && th.data.user_addr != null) {
  1350 + //看是不是有调用过包邮券
  1351 + if (!th.data.isget_by_quan[pickid]) {
  1352 + //--判断要不要显示包邮券,调用接口,因为有for循环---
  1353 + await getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", {
  1354 + data: {
  1355 + store_id: os.stoid,
  1356 + isuse: 0,
  1357 + condition: q_conditin,
  1358 + user_id: getApp().globalData.user_id,
  1359 + pageSize: 2000
  1360 + }
  1361 + }).then(res => {
  1362 + if (res.data.code == 0 && res.data.data.total > 0) {
  1363 + //此时要循环判断包邮的地区,不包邮商品是不是符合
  1364 + var arr = [], quanlist = res.data.data.pageData;
  1365 + quanlist = th.check_is_frozenQuan(quanlist, th.data.frozenQuan, 1);
  1366 + for (var i in quanlist) {
  1367 + var item = quanlist[i];
  1368 + var goods = cart_item.goods;
  1369 + var g_arr = [];
  1370 + for (var ii in goods) {
  1371 + g_arr.push(goods[ii].goods_id);
  1372 + }
  1373 + if (item.region_list && th.check_by_area(item.region_list)) continue; //如果是不包邮区域
  1374 + if (item.goods_list) {
  1375 + var no_goods_arr = item.goods_list.split(",");
  1376 + if (ut.isContained(no_goods_arr, g_arr)) continue; //如果是不包邮商品
  1377 + }
  1378 + arr.push(item);
  1379 + }
  1380 + if (arr) {
  1381 + th.data.get_by_quan_list_cart[pickid] = arr;
  1382 + //th.setData({get_by_quan_list_cart:th.data.get_by_quan_list_cart});
  1383 + if (th.data.is_b_now) {
  1384 + th.setData({get_by_quan_list: arr});
  1385 + }
  1386 + }
  1387 + th.data.isget_by_quan[pickid] = 1;
  1388 + }
  1389 + })
  1390 + }
  1391 + }
  1392 +
  1393 + //如果是包邮券的时候,要看看券的情况
  1394 + if (quan_no && th.data.using_quan[pickid].isby == 1) {
  1395 + var quan = th.data.using_quan[pickid];
  1396 + if (!quan.goods_list) {
  1397 + th.data.is_quan_by[pickid] = 1; //专门给券的判断用的
  1398 + } else {
  1399 + th.data.is_quan_by[pickid] = 0;
  1400 + //看有没有模板的包邮
  1401 + if (no_ex_good) {
  1402 + var arr = no_ex_good.split(",");
  1403 + var arr2 = quan.goods_list.split(",");
  1404 + if (ut.isContained(arr, arr2)) {
  1405 + getApp().my_warnning("全场不包邮商品和包邮券的重复", 0, th);
  1406 + th.data.using_quan[pickid] = {};
  1407 + th.setData({using_quan: th.data.using_quan})
  1408 + return false;
  1409 + }
  1410 + var n_arr = ut.mergeArray(arr, arr2);
  1411 + no_ex_good = n_arr.join(",");
  1412 + } else {
  1413 + no_ex_good = quan.goods_list;
  1414 + }
  1415 + }
  1416 + } else {
  1417 + th.data.is_quan_by[pickid] = 0; //专门给券的判断用的
  1418 + }
  1419 +
  1420 + //--------循环计算总价-----------
  1421 + for (var j = 0; j < item.length; j++) {
  1422 + //如果都包邮,都没必要等级数量了
  1423 + if (th.data.is_quan_by[pickid]) continue;
  1424 + //如果是优惠活动是包邮,就不用计算包邮的费用了
  1425 + if (item[j].is_past) continue;
  1426 + //是不是不包邮的商品
  1427 + var is_good_no_by = 0;
  1428 + if (no_ex_good) {
  1429 + is_good_no_by = th.check_by_goods(no_ex_good, item[j].goods_id);
  1430 + }
  1431 +
  1432 + //如果达到全场包邮的条件,同时,没有地区不包邮,或者商品不包邮
  1433 + if (o_price - quan_price >= freight_free && freight_free > 0 && !is_good_no_by && th.data.is_no_by[pickid] != 1) {
  1434 + continue;
  1435 + }
  1436 +
  1437 + //--如果是包邮券使用的情况下,如果商品是包邮的,那么就不进行计算--
  1438 + if (th.data.using_quan[pickid] && th.data.using_quan[pickid].isby == 1 && !is_good_no_by) {
  1439 + continue;
  1440 + }
  1441 +
  1442 + var no_ex_good_arr = null;
  1443 + if (no_ex_good) no_ex_good_arr = no_ex_good.split(',');
  1444 +
  1445 + //----------------如果是选择了物流---------------------
  1446 + if (cart_item.exp_type == 0 && item[j].is_free_shipping == 0 && (!no_ex_good_arr || no_ex_good_arr.indexOf(item[j].goods_id + '') > -1 )) {
  1447 +
  1448 + //如果地址不为空
  1449 + if (th.data.user_addr != null) {
  1450 + switch (item[j]['exp_sum_type']) {
  1451 + case 1:
  1452 + //统一运费
  1453 + o_shipping_price += item[j]['uniform_exp_sum'];
  1454 + break;
  1455 + case 2:
  1456 + +''
  1457 + if (goods_weight < 0) goods_weight = 0;
  1458 + //累积商品重量 每种商品的重量 * 数量
  1459 + goods_weight += item[j]['weight'] * item[j]['goods_num'];
  1460 +
  1461 + break;
  1462 + case 3:
  1463 + if (goods_piece < 0) goods_piece = 0;
  1464 + //累积商品数量
  1465 + goods_piece += item[j]['goods_num'];
  1466 + break;
  1467 + }
  1468 + }
  1469 +
  1470 + }
  1471 + }
  1472 +
  1473 + //计算物流价格
  1474 + if (cart_item.exp_type == 0) {
  1475 + //freight_free=0; //后面不在进行判断
  1476 + var code = "";
  1477 + if (th.data.wu_arr && th.data.wu_arr[cart_item.wind])
  1478 + code = th.data.wu_arr[cart_item.wind].code;
  1479 + cart_item.shipping_price =
  1480 + th.calculatewuliu(code, o_shipping_price, goods_weight,
  1481 + goods_piece, th.data.user_addr, freight_free, o_price - quan_price, rs);
  1482 +
  1483 + if (!th.data.using_quan[pickid] || th.data.using_quan[pickid].isby != 1) {
  1484 + if (cart_item.shipping_price == 0) th.data.is_by[pickid] = 1; //已经全场包邮,就不要选择券了
  1485 + }
  1486 + } else {
  1487 + cart_item.shipping_price = 0;
  1488 + }
  1489 +
  1490 + cart_item.shipping_price = cart_item.shipping_price.toFixed(2);
  1491 +
  1492 + //总价计算,总价不包含运费
  1493 + cart_item.order_amount = (o_price - quan_price).toFixed(2);
  1494 + cart_item.total_amount = f_o_price.toFixed(2);
  1495 +
  1496 + var order_prom_amount = 0;
  1497 + var order_prom_id = 0;
  1498 + var o_condition = cart_item.order_amount;
  1499 + //看一下是不是不用组合购的订单优惠的叠加
  1500 + if(is_has_zh){
  1501 + o_condition=o_price_no_zh-quan_price;
  1502 + }
  1503 +
  1504 + var order_m = 0;
  1505 + //---判断是不是有订单优惠---
  1506 + await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
  1507 + data: {store_id: os.stoid, orderAmount: o_condition}
  1508 + }).then(res => {
  1509 + if (res.data.code == 0) {
  1510 + var ord_prom = res.data.data;
  1511 + order_prom_id = ord_prom['id'];
  1512 + switch (ord_prom['type']) {
  1513 + case 0:
  1514 + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折
  1515 + order_prom_amount = (o_condition - order_m).toFixed(2);
  1516 + break;
  1517 + case 1:
  1518 + //order_m = o_condition - ord_prom['expression'];//满额优惠金额
  1519 + order_prom_amount = ord_prom['expression'];
  1520 + break;
  1521 + }
  1522 + }
  1523 + })
  1524 +
  1525 + cart_item.order_prom_amount = 0;
  1526 + //--订单优惠的显示--
  1527 + if (order_prom_id > 0) {
  1528 + cart_item.order_amount = (o_price - quan_price - order_prom_amount).toFixed(2);
  1529 + cart_item.order_prom_id = order_prom_id;
  1530 + cart_item.order_prom_amount = order_prom_amount;
  1531 + }
  1532 + coupon_price = quan_price;
  1533 + if (cart_item.order_amount < 0) {
  1534 + cart_item.order_amount = 0;
  1535 + coupon_price = o_price;
  1536 + }
  1537 +
  1538 + cart_item.total_amount = parseFloat(cart_item.total_amount) + parseFloat(cart_item.shipping_price); //总金额
  1539 + cart_item.order_amount = parseFloat(cart_item.order_amount) + parseFloat(cart_item.shipping_price); //总金额
  1540 + cart_item.total_amount = cart_item.total_amount.toFixed(2);
  1541 + cart_item.order_amount = cart_item.order_amount.toFixed(2);
  1542 +
  1543 + //搭配购在使用余额
  1544 + if (th.data.bn_use_money == 1 && th.data.is_b_now == 1) {
  1545 +
  1546 + if (umoney > cart_item.order_amount) {
  1547 + cart_item.user_money = cart_item.order_amount;
  1548 + umoney = umoney - cart_item.order_amount;
  1549 + } else {
  1550 + cart_item.user_money = umoney;
  1551 + umoney = 0;
  1552 + }
  1553 +
  1554 + } else {
  1555 + //--------------如果使用余额,购物车购买---------------------
  1556 + if (th.data.js_use_money == 1) {
  1557 + if (umoney > cart_item.order_amount) {
  1558 + cart_item.user_money = cart_item.order_amount;
  1559 + umoney = umoney - cart_item.order_amount;
  1560 + } else {
  1561 + cart_item.user_money = umoney;
  1562 + umoney = 0;
  1563 + }
  1564 + } else {
  1565 + cart_item.user_money = 0;
  1566 + }
  1567 + }
  1568 +
  1569 + cart_item.user_money = parseFloat(cart_item.user_money).toFixed(2);
  1570 + if (coupon_price > 0) cart_item.coupon_price = coupon_price.toFixed(2);
  1571 + else cart_item.coupon_price = coupon_price
  1572 + if (quan_no) cart_item.quan_no = quan_no;
  1573 +
  1574 +
  1575 + //cart_item.goods_price = o_price.toFixed(2);
  1576 + cart_item.order_amount = cart_item.order_amount - cart_item.user_money; //会员使用余额
  1577 +
  1578 +
  1579 + all_price += parseFloat(f_o_price);
  1580 + all_total_m += parseFloat(cart_item.total_amount);
  1581 + all_shipping_m += parseFloat(cart_item.shipping_price);
  1582 + all_order_m += parseFloat(cart_item.order_amount);
  1583 + all_user_m += parseFloat(cart_item.user_money);
  1584 + all_coupon_price_m += parseFloat(cart_item.coupon_price);
  1585 + all_cutprice += parseFloat(cart_item.cut_price);
  1586 + all_zh_cutprice += parseFloat(cart_item.zh_cut_price);
  1587 + all_order_prom += parseFloat(cart_item.order_prom_amount);
  1588 + }
  1589 +
  1590 + all_shipping_m = parseFloat(all_shipping_m).toFixed(2);
  1591 + all_total_m = parseFloat(all_total_m).toFixed(2);
  1592 + all_order_m = parseFloat(all_order_m).toFixed(2);
  1593 + all_price = parseFloat(all_price).toFixed(2);
  1594 + all_user_m = parseFloat(all_user_m).toFixed(2);
  1595 + all_total_m = parseFloat(all_total_m).toFixed(2);
  1596 + all_coupon_price_m = parseFloat(all_coupon_price_m).toFixed(2);
  1597 + all_cutprice = all_cutprice.toFixed(2);
  1598 + all_order_prom = all_order_prom.toFixed(2);
  1599 + all_zh_cutprice = parseFloat(all_zh_cutprice).toFixed(2);
  1600 +
  1601 + var atxt = "formData.total_amount";
  1602 + var atxt1 = "formData.order_amount";
  1603 + var atxt2 = "formData.all_price";
  1604 + var atxt3 = "formData.user_money";
  1605 + var atxt4 = "formData.shipping_price";
  1606 + var atxt5 = "formData.coupon_price";
  1607 + var atxt6 = "formData.cut_price";
  1608 + var atxt7 = "formData.order_prom_amount";
  1609 + var atxt8 = "formData.zh_cut_price";
  1610 +
  1611 + th.setData({
  1612 + [atxt]: all_total_m, [atxt1]: all_order_m,
  1613 + [atxt2]: all_price, [atxt3]: all_user_m, [atxt4]: all_shipping_m,
  1614 + [atxt5]: all_coupon_price_m, [atxt6]: all_cutprice,
  1615 + [atxt7]: all_order_prom, show_submit: 1, [atxt8]: all_zh_cutprice
  1616 + })
  1617 + th.data.order_prom_list_cart = c_arr;
  1618 + th.set_can_num();
  1619 + wx.hideLoading();
  1620 +
  1621 + });
  1622 + });
  1623 + },
  1624 +
  1625 + set_can_num: function () {
  1626 + var th = this;
  1627 + //-- 这个地方,循环计算几张优惠券可用--
  1628 + for (var iter in th.data.cartlist) {
  1629 + var num = 0;
  1630 + var c_item = th.data.cartlist[iter];
  1631 + var pkid = c_item.pickup_id;
  1632 + //-- 普通券 --
  1633 + if (c_item.quan_list) {
  1634 + for (var iter1 in c_item.quan_list) {
  1635 + //判断是不是其他订单有选用
  1636 + var is_other_is_use = th.check_other_use(c_item.quan_list[iter1], pkid);
  1637 + if (!is_other_is_use) num++;
  1638 + }
  1639 + }
  1640 + //-- 包邮券 --
  1641 + var by_quan = th.data.get_by_quan_list_cart[pkid];
  1642 + if (by_quan) {
  1643 + for (var iter2 in by_quan) {
  1644 + //判断是不是其他订单有选用
  1645 + var is_other_is_use = th.check_other_use_by(by_quan[iter2], pkid);
  1646 + if (!is_other_is_use) num++;
  1647 + }
  1648 + }
  1649 + var set_txt = "cartlist[" + iter + "].can_num";
  1650 + th.setData({[set_txt]: num});
  1651 + }
  1652 + },
  1653 +
  1654 +
  1655 + //---------计算立即购买----------
  1656 + calculatePrice2: function () {
  1657 + var th = this, good = this.data.bn_goods;
  1658 +
  1659 + if (!good) return false;
  1660 +
  1661 + //搭配的计算要用购物的车计算方法
  1662 + if (good.prom_type == 5) {
  1663 + th.calculatePrice();
  1664 + return false;
  1665 + }
  1666 +
  1667 + wx.showLoading({
  1668 + title: "处理中."
  1669 + })
  1670 + //-----------计算商品总价--------------
  1671 + var allpice = good.shop_price * good.buynum;
  1672 + var cut_price = 0;
  1673 + var allpice1 = allpice;
  1674 +
  1675 +
  1676 + if (good.prom_type == 3 && good.prom_price !== null) {
  1677 + cut_price = allpice - good.prom_price;
  1678 + }
  1679 +
  1680 + allpice = parseFloat(allpice).toFixed(2);
  1681 + var txt = "formData.all_price";
  1682 + th.setData({[txt]: allpice,});
  1683 + if (cut_price) {
  1684 + var c_txt = "formData.cut_price";
  1685 + th.setData({[c_txt]: cut_price,});
  1686 +
  1687 + }
  1688 +
  1689 + //如果有线下取价的时候
  1690 + if (good.is_offline) {
  1691 + allpice = good.offline_price * good.buynum;
  1692 + }
  1693 +
  1694 +
  1695 + to.getConfig2(function (ee) {
  1696 + to.getwuliuprice(async function (rs) {
  1697 +
  1698 + var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
  1699 +
  1700 + //---如果有选择优惠券的情况下---
  1701 + var quan_price = 0, bn_pick = th.data.bn_pick;
  1702 + var quan_no = null;
  1703 + if (th.data.using_quan[bn_pick] != null && th.data.using_quan[bn_pick] != undefined)
  1704 + quan_no = th.data.using_quan[bn_pick].coupon_no;
  1705 +
  1706 + if (quan_no) {
  1707 + if (th.data.using_quan[bn_pick].isby != 1) {
  1708 + //---获取优惠券优惠---
  1709 + await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", {
  1710 + data: {
  1711 + storeId: oo.stoid,
  1712 + CashRepNo: quan_no,
  1713 + WaresSum: th.data.ckeck_quan_price,
  1714 + WareIds: th.data.check_quan_ware_list
  1715 + }
  1716 + }).then(res => {
  1717 + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
  1718 + quan_price = res.data.data[0].WareCashSum;
  1719 + }
  1720 + })
  1721 + }
  1722 + }
  1723 +
  1724 + //-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮----------
  1725 + if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && good.is_past != 1) {
  1726 + //看是不是有调用过包邮券
  1727 + if (!th.data.isget_by_quan[th.data.bn_pick] && good.is_xz_yh != 1) {
  1728 + var condition = allpice - cut_price - quan_price;
  1729 + //--判断要不要显示包邮券,链式调用接口,调取包邮券,已经是减了优惠的金额,见到优惠券的钱---
  1730 + getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", {
  1731 + data: {
  1732 + store_id: os.stoid,
  1733 + isuse: 0,
  1734 + condition: condition,
  1735 + user_id: getApp().globalData.user_id,
  1736 + pageSize: 2000
  1737 + }
  1738 + }).then(res => {
  1739 + if (res.data.code == 0 && res.data.data.total > 0) {
  1740 + //此时要循环判断包邮的地区,不包邮商品是不是符合
  1741 + var arr = [], quanlist = res.data.data.pageData;
  1742 + quanlist = th.check_is_frozenQuan(quanlist, th.data.frozenQuan, 1);
  1743 + for (var i in quanlist) {
  1744 + var item = quanlist[i];
  1745 + if (item.region_list && th.check_by_area(item.region_list)) continue; //如果是不包邮区域
  1746 + if (item.goods_list && th.check_by_goods(item.goods_list)) continue; //如果是不包邮商品
  1747 + arr.push(item);
  1748 + }
  1749 + if (arr) {
  1750 + th.setData({get_by_quan_list: arr});
  1751 + }
  1752 + th.data.isget_by_quan[th.data.bn_pick] = 1;
  1753 + }
  1754 + })
  1755 + }
  1756 +
  1757 + switch (good['exp_sum_type']) {
  1758 + case 1:
  1759 + //统一运费
  1760 + o_shipping_price += good['uniform_exp_sum'];
  1761 + break;
  1762 + case 2:
  1763 + if (goods_weight < 0) goods_weight = 0;
  1764 + //累积商品重量 每种商品的重量 * 数量
  1765 + goods_weight += good['weight'] * good['buynum'];
  1766 + break;
  1767 + case 3:
  1768 + if (goods_piece < 0) goods_piece = 0;
  1769 + //累积商品数量
  1770 + goods_piece += good['buynum'];
  1771 + break;
  1772 + }
  1773 +
  1774 + var code = "";
  1775 + if (th.data.wu_arr && th.data.wu_arr[th.data.index]) code = th.data.wu_arr[th.data.index].code;
  1776 + var freight_free = ee.freight_free; //全场满多少包邮
  1777 + var no_ex_id = ee.no_ex_id;
  1778 + th.data.is_no_by[th.data.bn_pick] = 0;
  1779 +
  1780 + var no_by_data = null;
  1781 + var gift_freight_free = freight_free;
  1782 +
  1783 +
  1784 + //有不包邮区域,且不免运费
  1785 + if (no_ex_id && freight_free > 0 && freight_free <= parseFloat(allpice) - cut_price - quan_price) {
  1786 + //-----------获取不包邮区域,不包邮商品-------
  1787 + await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", {
  1788 + data: {store_id: os.stoid, id: no_ex_id}
  1789 + }).then(res => {
  1790 + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
  1791 + no_by_data = res.data.data[0];
  1792 + //如果有设置不包邮区域的时候
  1793 + if (res.data.data[0].region_list) {
  1794 + if (th.check_by_area(res.data.data[0].region_list)) {
  1795 + freight_free = 0;
  1796 + th.data.is_no_by[th.data.bn_pick] = 1;
  1797 + }
  1798 + }
  1799 + //如果有设置不包邮商品
  1800 + if (res.data.data[0].goods_list && freight_free) {
  1801 + if (th.check_by_goods(res.data.data[0].goods_list)) {
  1802 + freight_free = 0;
  1803 + th.data.is_no_by[th.data.bn_pick] = 1;
  1804 + }
  1805 + }
  1806 + }
  1807 + })
  1808 + }
  1809 +
  1810 + th.data.is_by[th.data.bn_pick] = 0;
  1811 + //--------------开始计算物流------------------
  1812 + var shipping_price =
  1813 + th.calculatewuliu(code, o_shipping_price, goods_weight,
  1814 + goods_piece, th.data.user_addr, freight_free, parseFloat(allpice) - cut_price - quan_price, rs);
  1815 +
  1816 + //如果有赠品的时候,也要计算赠品的物流费用
  1817 + if (th.data.buy_now_gift_goods) {
  1818 + shipping_price = th.get_now_gift_goods_wuliu(code, o_shipping_price, th.data.user_addr, gift_freight_free,
  1819 + parseFloat(allpice) - cut_price - quan_price, rs, shipping_price, no_by_data, goods_weight, goods_piece);
  1820 + }
  1821 +
  1822 + if (shipping_price <= 0) {
  1823 + th.data.is_by[th.data.bn_pick] = 1; //已经是包邮了,就不要选择包邮券
  1824 + }
  1825 +
  1826 + shipping_price = parseFloat(shipping_price).toFixed(2);
  1827 + var wl_txt = "formData.shipping_price";
  1828 + th.setData({[wl_txt]: shipping_price,})
  1829 +
  1830 + } else {
  1831 + var wl_txt = "formData.shipping_price";
  1832 + th.setData({[wl_txt]: 0,})
  1833 + }
  1834 +
  1835 + if (quan_no) {
  1836 + if (th.data.using_quan[bn_pick].isby == 1) {
  1837 + shipping_price = 0;
  1838 + var wl_txt = "formData.shipping_price";
  1839 + th.setData({[wl_txt]: 0,})
  1840 + }
  1841 + }
  1842 + //-----------------支付价,优惠券不减物流-----------------
  1843 + var total_m = (parseFloat(allpice1)).toFixed(2);
  1844 + var order_m = (parseFloat(allpice - cut_price) - quan_price).toFixed(2);
  1845 + var coupon_price = quan_price; //优惠券优惠了多少钱
  1846 + if (order_m < 0) {
  1847 + order_m = 0;
  1848 + coupon_price = parseFloat(order_m).toFixed(2);
  1849 + }
  1850 + //--看一下有没有订单优惠--
  1851 + var o_condition = parseFloat(order_m);
  1852 + if (o_condition > 0) {
  1853 + th.check_is_order_prom(o_condition, function () {
  1854 + var order_prom_amount = 0;
  1855 + var order_prom_id = 0;
  1856 + if (th.data.order_prom[th.data.bn_pick]) {
  1857 + var ord_prom = th.data.order_prom[th.data.bn_pick];
  1858 + order_prom_id = ord_prom['id'];
  1859 + switch (ord_prom['type']) {
  1860 + case 0:
  1861 + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折
  1862 + order_prom_amount = (o_condition - order_m).toFixed(2);
  1863 + break;
  1864 + case 1:
  1865 + order_m = o_condition - ord_prom['expression'];//满额优惠金额
  1866 + order_prom_amount = ord_prom['expression'];
  1867 + break;
  1868 + }
  1869 + }
  1870 + //--订单优惠的显示--
  1871 + if (order_prom_id > 0) {
  1872 + var order_prom_txt1 = "formData.order_prom_id";
  1873 + var order_prom_txt2 = "formData.order_prom_amount";
  1874 + th.setData({[order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount})
  1875 + }
  1876 +
  1877 + total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price);
  1878 + order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price);
  1879 +
  1880 + total_m = total_m.toFixed(2);
  1881 + order_m = order_m.toFixed(2);
  1882 +
  1883 + var atxt = "formData.total_amount";
  1884 + th.setData({[atxt]: total_m,})
  1885 +
  1886 + var txt = "formData.user_money";
  1887 + var txt2 = "formData.order_amount";
  1888 + var txt3 = "formData.coupon_price";
  1889 + var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money);
  1890 + //--------------如果使用余额---------------------
  1891 + if (th.data.bn_use_money == 1) {
  1892 + if (amoney > order_m) {
  1893 + order_m = parseFloat(order_m).toFixed(2);
  1894 + th.setData({[txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1})
  1895 + } else {
  1896 + order_m = parseFloat(order_m) - parseFloat(amoney);
  1897 + order_m = order_m.toFixed(2);
  1898 + th.setData({[txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1})
  1899 + }
  1900 + } else {
  1901 + th.setData({[txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1})
  1902 + }
  1903 + //优惠活动送积分
  1904 + if (good.s_intValue) {
  1905 + txt = "formData.give_integral";
  1906 + th.setData({[txt]: good.s_intValue});
  1907 + }
  1908 + //优惠送券
  1909 + if (good.s_coupon_id) {
  1910 + var i_txt = "formData.give_coupon_id";
  1911 + //这个是json格式的
  1912 + var i_txt1 = "formData.g_coupon_num";
  1913 + var ob = [{"num": good.s_coupon_num, "c_id": good.s_coupon_id}];
  1914 + ob = JSON.stringify(ob);
  1915 + th.setData({[i_txt]: good.s_coupon_id, [i_txt1]: ob});
  1916 + }
  1917 + //优惠礼包
  1918 + if (good.s_libao) {
  1919 + var l_txt = "formData.give_lb_id";
  1920 + //这个是json格式的
  1921 + var l_txt1 = "formData.g_lb_num";
  1922 + var ob = [{"num": good.s_lb_num, "l_id": good.s_libao}];
  1923 + ob = JSON.stringify(ob);
  1924 + th.setData({[l_txt]: good.s_libao, [l_txt1]: ob});
  1925 + }
  1926 + })
  1927 + } else {
  1928 + total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price);
  1929 + order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price);
  1930 + var atxt = "formData.total_amount";
  1931 +
  1932 + total_m = total_m.toFixed(2);
  1933 + order_m = order_m.toFixed(2);
  1934 +
  1935 + th.setData({[atxt]: total_m,})
  1936 +
  1937 + var txt = "formData.user_money";
  1938 + var txt2 = "formData.order_amount";
  1939 + var txt3 = "formData.coupon_price";
  1940 + var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money);
  1941 + //--------------如果使用余额---------------------
  1942 + if (th.data.bn_use_money == 1) {
  1943 + if (amoney > order_m) {
  1944 + order_m = parseFloat(order_m).toFixed(2);
  1945 + th.setData({[txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1})
  1946 + } else {
  1947 + order_m = parseFloat(order_m) - parseFloat(amoney);
  1948 + order_m = order_m.toFixed(2);
  1949 + th.setData({[txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1})
  1950 + }
  1951 + } else {
  1952 + th.setData({[txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1})
  1953 + }
  1954 + //优惠活动送积分
  1955 + if (good.s_intValue) {
  1956 + txt = "formData.give_integral";
  1957 + th.setData({[txt]: good.s_intValue});
  1958 + }
  1959 + //优惠送券
  1960 + if (good.s_coupon_id) {
  1961 + var i_txt = "formData.give_coupon_id";
  1962 + //这个是json格式的
  1963 + var i_txt1 = "formData.g_coupon_num";
  1964 + var ob = [{"num": good.s_coupon_num, "c_id": good.s_coupon_id}];
  1965 + ob = JSON.stringify(ob);
  1966 + th.setData({[i_txt]: good.s_coupon_id, [i_txt1]: ob});
  1967 + }
  1968 + //优惠礼包
  1969 + if (good.s_libao) {
  1970 + var l_txt = "formData.give_lb_id";
  1971 + //这个是json格式的
  1972 + var l_txt1 = "formData.g_lb_num";
  1973 + var ob = [{"num": good.s_lb_num, "l_id": good.s_libao}];
  1974 + ob = JSON.stringify(ob);
  1975 + th.setData({[l_txt]: good.s_coupon_id, [l_txt1]: ob});
  1976 + }
  1977 + }
  1978 +
  1979 + wx.hideLoading();
  1980 +
  1981 + });
  1982 + });
  1983 + },
  1984 +
  1985 + //--------------------提交订单-----------------------
  1986 + async submitForm(t){
  1987 + var sub_value = t;
  1988 +
  1989 + if (this.data.is_summit_ing == 1) return false; //--提交中退出--
  1990 + this.data.is_summit_ing = 1;
  1991 + var th = this, pdata = new Array();
  1992 + var ff = true;
  1993 + //------------立即购买-------------
  1994 + if (th.data.is_b_now == 1 && th.data.bn_goods.prom_type != 5) {
  1995 +
  1996 + if (th.data.bn_exp_type == 0 && th.data.user_addr == null) {
  1997 + ff = false;
  1998 + getApp().my_warnning("请选择收货地址", 0, th);
  1999 + th.data.is_summit_ing = 0;
  2000 + }
  2001 + if (!ff) return false;
  2002 + var addr = th.data.user_addr;
  2003 + if (th.data.bn_exp_type == 1) addr = null;
  2004 +
  2005 + if (th.data.bn_exp_type == 0)
  2006 + if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) {
  2007 + getApp().my_warnning("读取物流失败", 0, th);
  2008 + th.data.is_summit_ing = 0;
  2009 + return false;
  2010 + }
  2011 +
  2012 + var item = {
  2013 + 'user_id': to.globalData.user_id,
  2014 + 'consignee': addr == null ? "" : addr.consignee,
  2015 + 'province': addr == null ? 0 : addr.province,
  2016 + 'city': addr == null ? 0 : addr.city,
  2017 + 'district': addr == null ? 0 : addr.district,
  2018 + 'twon': addr == null ? 0 : addr.twon,
  2019 + 'address': addr == null ? "" : addr.address,
  2020 + 'more_address': addr == null ? "" : addr.more_address,
  2021 + //'mobile': th.data.userinfo.mobile,
  2022 + 'mobile': addr == null ? th.data.userinfo.mobile : addr.mobile,
  2023 + 'email': '',
  2024 + 'shipping_code': th.data.bn_exp_type == 1 ? 0 : th.data.wu_arr[th.data.index].code,
  2025 + 'shipping_name': th.data.bn_exp_type == 1 ? '' : th.data.wu_arr[th.data.index].name,
  2026 + 'invoice_title': '',
  2027 + 'goods_price': th.data.formData.all_price, //商品总价
  2028 + 'shipping_price': th.data.formData.shipping_price, //物流金额
  2029 + 'user_money': th.data.formData.user_money, //使用余额
  2030 + 'total_amount': th.data.formData.total_amount, //订单总价
  2031 + 'order_amount': th.data.formData.order_amount, //应付
  2032 + 'user_note': t.detail.value.user_note, //用户备注
  2033 + 'store_id': oo.stoid, //商家
  2034 + 'pickup_id': th.data.bn_pick, //门店
  2035 + 'exp_type': th.data.bn_exp_type, //配送方式
  2036 + 'order_goods': new Array(),
  2037 + };
  2038 + //是不是重新提交
  2039 + if (th.data.is_continue == 1) item.is_continue = 1;
  2040 +
  2041 + //获取立即购买的商品的信息
  2042 + var gg = to.get_b_now();
  2043 + //--商品的房间号--
  2044 + if (gg.room_id && gg.room_id > 0) {
  2045 + item.room_ids = gg.room_id;
  2046 + }
  2047 +
  2048 + var order_prom_list = {};
  2049 + //--判断有没有优惠活动--
  2050 + if (th.data.order_prom[item.pickup_id]) {
  2051 + if (th.data.formData.order_prom_amount > 0) {
  2052 + order_prom_list.order_prom_id = th.data.formData.order_prom_id;
  2053 + order_prom_list.order_prom_amount = th.data.formData.order_prom_amount;
  2054 + }
  2055 + }
  2056 +
  2057 + //--判断优惠活动的提交--
  2058 + if (th.data.formData.cut_price > 0 ) {
  2059 + order_prom_list.discount_amount = th.data.formData.cut_price.toFixed(2);
  2060 + var ob = [{
  2061 + "prom_id": th.data.bn_goods.prom_id,
  2062 + "dis": parseFloat(th.data.formData.cut_price).toFixed(2),
  2063 + "ispt": 0
  2064 + }]
  2065 + order_prom_list.prom_pt_json = JSON.stringify(ob);
  2066 + }
  2067 + if (th.data.formData.give_integral > 0) {
  2068 + order_prom_list.give_integral = th.data.formData.give_integral;
  2069 + }
  2070 + if (th.data.formData.give_coupon_id > 0) {
  2071 + order_prom_list.give_coupon_id = th.data.formData.give_coupon_id;
  2072 + order_prom_list.g_coupon_num = th.data.formData.g_coupon_num;
  2073 + }
  2074 + if (th.data.formData.give_lb_id > 0) {
  2075 + order_prom_list.give_lb_id = th.data.formData.give_lb_id;
  2076 + order_prom_list.g_lb_num = th.data.formData.g_lb_num;
  2077 + }
  2078 + item.order_prom_list = order_prom_list;
  2079 +
  2080 + //组装优惠券的钱
  2081 + if (parseFloat(th.data.formData.coupon_price) > 0) {
  2082 + item.coupon_price = th.data.formData.coupon_price;
  2083 + item.coupon_no = th.data.using_quan[th.data.bn_pick].coupon_no;
  2084 + }
  2085 + if (th.data.using_quan[th.data.bn_pick] && th.data.using_quan[th.data.bn_pick].coupon_no && th.data.using_quan[th.data.bn_pick].isby) {
  2086 + item.coupon_no = th.data.using_quan[th.data.bn_pick].coupon_no;
  2087 + item.coupon_price = 0;
  2088 + }
  2089 +
  2090 + //老会员成为分销下线需要的参数
  2091 + if (getApp().globalData.first_leader && !getApp().globalData.userInfo.first_leader) {
  2092 + //判断一下分享人是不是分享商
  2093 + await app.request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.first_leader, {}).then(res => {
  2094 + if (res.data.code == 0) {
  2095 + var user = res.data.data;
  2096 + if (user.is_distribut == 1) {
  2097 + item.first_leader = parseInt(getApp().globalData.first_leader);
  2098 + }
  2099 + }
  2100 + })
  2101 + }
  2102 +
  2103 + var goods = {
  2104 + 'goods_id': gg.goods_id,
  2105 + 'goods_name': gg.goods_name,
  2106 + 'goods_sn': gg.goods_sn,
  2107 + 'goods_num': gg.goods_num,
  2108 + 'market_price': th.data.bn_goods.market_price,
  2109 + 'goods_price': th.data.bn_goods.shop_price,
  2110 + 'member_goods_price': th.data.bn_goods.shop_price,
  2111 + 'store_id': oo.stoid,
  2112 + 'prom_type': th.data.bn_goods.prom_type, //促销活动类型
  2113 + 'prom_id': th.data.bn_goods.prom_id, //促销活动id
  2114 + };
  2115 +
  2116 + //-- 把导购的信息填入--
  2117 + if (gg.guide_id) {
  2118 + goods.guide_id = gg.guide_id;
  2119 + goods.guide_type = gg.guide_type;
  2120 + //调用接口判断是不是会员
  2121 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(res => {
  2122 + if (res.data.code == 0) {
  2123 + goods.guide_name = res.data.data.salesman;
  2124 + goods.guide_sn = res.data.data.salesman_no;
  2125 + }
  2126 + })
  2127 + }
  2128 +
  2129 + //--商品的房间号--
  2130 + if (gg.room_id && gg.room_id > 0) {
  2131 + goods.room_id = gg.room_id;
  2132 + }
  2133 +
  2134 + //积分购,先要带is_integral_normal=1
  2135 + if (gg.is_integral_normal) goods.is_integral_normal = 1;
  2136 +
  2137 + //先要带is_pd_normal=1
  2138 + if (gg.is_pd_normal) goods.is_pd_normal = 1;
  2139 +
  2140 + //如果不立即购买或者秒杀,如果是线下库存购买的时候
  2141 + if (goods.prom_type != 1 && goods.prom_type != 6 && th.data.sales_rules == 2) {
  2142 + var isok = 1;
  2143 + await th.check_store_num(goods.goods_id, th.data.bn_pick, gg.goods_num, function (res) {
  2144 + isok = res;
  2145 + });
  2146 + if (!isok) {
  2147 + getApp().confirmBox("商品的门店库存不足");
  2148 + th.data.is_summit_ing = 0;
  2149 + return false;
  2150 + }
  2151 + }
  2152 +
  2153 + //-- 如果有线下取价的话 --
  2154 + if (th.data.bn_goods.is_offline) {
  2155 + item.sum_offline_cut = (th.data.bn_goods.shop_price - th.data.bn_goods.offline_price).toFixed(2);
  2156 + goods.offline_cut = item.sum_offline_cut;
  2157 + goods.pricing_type = th.data.bn_goods.pricing_type;
  2158 + goods.goods_price = th.data.bn_goods.offline_price;
  2159 + goods.member_goods_price = th.data.bn_goods.offline_price;
  2160 + }
  2161 +
  2162 + //--- 如果有优惠促销的金额,要把金额先平摊下去 ---
  2163 + if (th.data.formData.cut_price > 0 && !th.data.ispt_goods) {
  2164 + var g_arr = new Array();
  2165 + g_arr.push(goods);
  2166 + var pt_data = {
  2167 + 'prom_id': goods.prom_id,
  2168 + 'dis': parseFloat(th.data.formData.cut_price),
  2169 + 'goods': g_arr,
  2170 + }
  2171 +
  2172 + var pt_res = null;
  2173 + await getApp().request.promisePost("/api/weshop/order/getGoodsSplit", {
  2174 + is_json: 1,
  2175 + data: pt_data
  2176 + }).then(res => {
  2177 + if (res.data.code == 0) {
  2178 + pt_res = res.data.data;
  2179 + }
  2180 + })
  2181 + if (pt_res) {
  2182 + //平摊赋值
  2183 + goods.account = pt_res[0].fisrt_account;
  2184 + goods.account_yu = pt_res[0].fisrt_account_yu;
  2185 + item.is_discount_amount = 1;
  2186 + }
  2187 + }
  2188 +
  2189 + //--组装优惠券的钱--
  2190 + if (th.data.formData.coupon_price) {
  2191 + item.coupon_price = th.data.formData.coupon_price;
  2192 + item.coupon_no = th.data.using_quan[th.data.bn_pick].coupon_no;
  2193 + goods.quan_num = th.data.formData.coupon_price;
  2194 + goods.quan_no = item.coupon_no;
  2195 + }
  2196 +
  2197 + item.order_goods.push(goods);
  2198 +
  2199 + //--如果有赠品的时候,赠品也要提交---
  2200 + if (th.data.buy_now_gift_goods) {
  2201 + var gift_gg = th.data.buy_now_gift_goods;
  2202 + var g_goods = {
  2203 + 'goods_id': gift_gg.goods_id,
  2204 + 'goods_name': gift_gg.goods_name,
  2205 + 'goods_sn': gift_gg.goods_sn,
  2206 + 'goods_num': gift_gg.buynum,
  2207 + 'market_price': gift_gg.market_price,
  2208 + 'goods_price': 0,
  2209 + 'member_goods_price': 0,
  2210 + 'store_id': oo.stoid,
  2211 + 'is_gift': 1,
  2212 + 'gift_id': gift_gg.gift_id,
  2213 + 'prom_id': gift_gg.prom_id,
  2214 + };
  2215 + item.order_goods.push(g_goods);
  2216 + }
  2217 + pdata.push(item);
  2218 +
  2219 + console.log(pdata);
  2220 + } else {
  2221 + //---------购物车的结算---------
  2222 + if (th.data.is_all_zt == 0 && th.data.user_addr == null) {
  2223 + th.data.is_summit_ing = 0;
  2224 + ff = false;
  2225 + getApp().confirmBox("请新建收货地址");
  2226 + }
  2227 + if (!ff) return false;
  2228 +
  2229 + var addr = th.data.user_addr;
  2230 + if (th.data.is_all_zt == 1) addr = null;
  2231 + var val_arr = t.detail.value;
  2232 +
  2233 +
  2234 + if (th.data.is_all_zt != 1)
  2235 + if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) {
  2236 + th.data.is_summit_ing = 0;
  2237 + getApp().confirmBox("读取物流失败");
  2238 + return false;
  2239 + }
  2240 +
  2241 + var order_prom_list_cart = th.data.order_prom_list_cart;
  2242 +
  2243 + //--组装推送数据--
  2244 + for (var i = 0; i < order_prom_list_cart.length; i++) {
  2245 + var t_item = order_prom_list_cart[i];
  2246 + var item = {
  2247 + 'user_id': to.globalData.user_id,
  2248 + 'consignee': addr == null ? th.data.userinfo.mobile : addr.consignee,
  2249 + 'province': addr == null ? 0 : addr.province,
  2250 + 'city': addr == null ? 0 : addr.city,
  2251 + 'district': addr == null ? 0 : addr.district,
  2252 + 'twon': addr == null ? 0 : addr.twon,
  2253 + 'address': addr == null ? "" : addr.address,
  2254 + 'more_address': addr == null ? "" : addr.more_address,
  2255 + 'mobile': addr == null ? th.data.userinfo.mobile : addr.mobile,
  2256 + 'email': '',
  2257 + 'shipping_code': th.data.is_all_zt == 1 ? 0 : th.data.wu_arr[t_item.wind].code,
  2258 + 'shipping_name': th.data.is_all_zt == 1 ? '' : th.data.wu_arr[t_item.wind].name,
  2259 + 'invoice_title': '',
  2260 + 'goods_price': t_item.goods_price, //商品总价
  2261 + 'shipping_price': t_item.shipping_price, //物流金额
  2262 + 'user_money': t_item.user_money, //使用余额
  2263 + 'total_amount': t_item.total_amount, //订单总价
  2264 + 'order_amount': t_item.order_amount, //应付
  2265 + 'user_note': val_arr['user_note_' + t_item.pickup_id], //用户备注
  2266 + 'store_id': oo.stoid, //商家
  2267 + 'pickup_id': t_item.pickup_id, //门店
  2268 + 'exp_type': t_item.exp_type, //配送方式
  2269 + 'order_goods': new Array(),
  2270 + };
  2271 + //是不是重新提交
  2272 + if (th.data.is_continue == 1) item.is_continue = 1;
  2273 + //----- 如果有线下取价的话 ----
  2274 + if (t_item.is_offline == 1) {
  2275 + item.sum_offline_cut = t_item.offline_price.toFixed(2);
  2276 + }
  2277 +
  2278 + //组装优惠券的钱
  2279 + if (t_item.coupon_price) {
  2280 + item.coupon_price = t_item.coupon_price;
  2281 + item.coupon_no = th.data.using_quan[t_item.pickup_id].coupon_no;
  2282 + } else if (t_item.quan_no) {
  2283 + item.coupon_no = t_item.quan_no;
  2284 + item.coupon_price = 0;
  2285 + }
  2286 +
  2287 + var order_prom_list = {};
  2288 + //--判断有没有优惠活动--
  2289 + if (t_item.order_prom_amount > 0) {
  2290 + order_prom_list.order_prom_id = t_item.order_prom_id;
  2291 + order_prom_list.order_prom_amount = t_item.order_prom_amount;
  2292 + }
  2293 +
  2294 + order_prom_list.discount_amount =0;
  2295 + //--判断优惠活动的提交--
  2296 + if (t_item.cut_price > 0) {
  2297 + order_prom_list.discount_amount += t_item.cut_price;
  2298 + order_prom_list.prom_pt_json = JSON.stringify(t_item.prom_pt_json);
  2299 + }
  2300 + //--判断组合优惠活动的提交--
  2301 + if (t_item.zh_cut_price > 0 || t_item.zh_cut_price<0) {
  2302 + order_prom_list.discount_amount += t_item.zh_cut_price;
  2303 + order_prom_list.zh_pt_json = JSON.stringify(t_item.zh_pt_json);
  2304 + }
  2305 + if (t_item.s_intValue > 0) {
  2306 + order_prom_list.give_integral = t_item.s_intValue;
  2307 + }
  2308 + if (t_item.s_coupon_id) {
  2309 + order_prom_list.give_coupon_id = t_item.s_coupon_id;
  2310 + order_prom_list.g_coupon_num = JSON.stringify(t_item.g_coupon_num);
  2311 + }
  2312 + if (t_item.s_libao) {
  2313 + order_prom_list.give_lb_id = t_item.s_libao;
  2314 + order_prom_list.g_lb_num = JSON.stringify(t_item.g_lb_num);
  2315 + }
  2316 + if (Object.keys(order_prom_list).length > 0){
  2317 + if(order_prom_list.discount_amount)
  2318 + order_prom_list.discount_amount= parseFloat(order_prom_list.discount_amount).toFixed(2);
  2319 + if(order_prom_list.order_prom_amount)
  2320 + order_prom_list.order_prom_amount= parseFloat(order_prom_list.order_prom_amount).toFixed(2);
  2321 + item.order_prom_list = order_prom_list;
  2322 + }
  2323 +
  2324 +
  2325 + //老会员成为分销下线需要的参数
  2326 + if (getApp().globalData.first_leader && !getApp().globalData.userInfo.first_leader) {
  2327 + //判断一下分享人是不是分享商
  2328 + await app.request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.first_leader, {}).then(res => {
  2329 + if (res.data.code == 0) {
  2330 + var user = res.data.data;
  2331 + if (user.is_distribut == 1) {
  2332 + item.first_leader = parseInt(getApp().globalData.first_leader);
  2333 + }
  2334 + }
  2335 + })
  2336 + }
  2337 +
  2338 +
  2339 + //房间号的ids
  2340 + var room_ids = "";
  2341 + //-------------让商品添加到商品列表--------------------
  2342 + for (var k = 0; k < t_item.goods.length; k++) {
  2343 + var g_item = t_item.goods[k];
  2344 + var goods = {
  2345 + 'goods_id': g_item.goods_id,
  2346 + 'goods_name': g_item.goods_name,
  2347 + 'goods_sn': g_item.goods_sn,
  2348 + 'goods_num': g_item.goods_num,
  2349 + 'market_price': g_item.market_price,
  2350 + 'goods_price': g_item.goods_price,
  2351 + 'member_goods_price': g_item.goods_price,
  2352 + 'store_id': oo.stoid,
  2353 + };
  2354 +
  2355 + //-- 线下取价也要写入,组合购的商品不能去线下价格 --
  2356 + if (g_item.offline_price && t_item.is_offline == 1 && g_item.prom_type!=7) {
  2357 + goods.goods_price = g_item.offline_price;
  2358 + goods.member_goods_price = g_item.offline_price;
  2359 + goods.offline_cut = (g_item.goods_price - g_item.offline_price).toFixed(2);
  2360 + goods.pricing_type = g_item.pricing_type;
  2361 + }
  2362 +
  2363 + //--把券的钱,写入从表---
  2364 + if (t_item.quan_youhui_list && t_item.coupon_price) {
  2365 + for (var kk in t_item.quan_youhui_list) {
  2366 + var you_item = t_item.quan_youhui_list[kk];
  2367 + if (g_item.prom_type!=7 && g_item.erpwareid == you_item.WareId) {
  2368 + goods.quan_num = you_item.WareCashSum;
  2369 + goods.quan_no = you_item.CashRepNo;
  2370 + }
  2371 + }
  2372 + }
  2373 +
  2374 + //--判断活动的类型--
  2375 + switch (g_item.prom_type) {
  2376 + case 1:
  2377 + goods.prom_type = g_item.prom_type;
  2378 + goods.prom_id = g_item.prom_id;
  2379 + break;
  2380 + case 3:
  2381 + goods.prom_type = 3;
  2382 + goods.prom_id = g_item.prom_id;
  2383 + if (g_item.is_gift) {
  2384 + goods.is_gift = g_item.is_gift;
  2385 + goods.gift_id = g_item.gift_id;
  2386 + }
  2387 + break;
  2388 + case 5:
  2389 + goods.prom_type = 5;
  2390 + goods.prom_id = g_item.prom_id;
  2391 + if (g_item.is_collocation) {
  2392 + goods.is_collocation = g_item.is_collocation;
  2393 + }
  2394 + break
  2395 + case 7:
  2396 + goods.prom_type = 7;
  2397 + goods.prom_id = g_item.prom_id;
  2398 + break
  2399 + default:
  2400 + goods.prom_type = 0;
  2401 + goods.prom_id = 0;
  2402 + }
  2403 +
  2404 + //如果不立即购买或者秒杀,如果是线下库存购买的时候
  2405 + if (goods.prom_type == 0 && th.data.sales_rules == 2) {
  2406 + var isok = 1;
  2407 + await th.check_store_num(goods.goods_id, t_item.pickup_id, goods.goods_num, function (res) {
  2408 + isok = res;
  2409 + });
  2410 + if (!isok) {
  2411 + getApp().confirmBox(goods.goods_name + "的门店库存不足");
  2412 + th.data.is_summit_ing = 0;
  2413 + return false;
  2414 + }
  2415 + }
  2416 +
  2417 + //把优惠的平摊结果写进去
  2418 + if (g_item.account >= 0 || g_item.account_yu != 0) {
  2419 + if (g_item.account >= 0) goods.account = g_item.account;
  2420 + if (g_item.account_yu != 0) goods.account_yu = g_item.account_yu;
  2421 + item.is_discount_amount = 1;
  2422 + }
  2423 +
  2424 + //导购ID
  2425 + if (g_item.guide_id) {
  2426 + goods.guide_id = g_item.guide_id;
  2427 + goods.guide_type = g_item.guide_type;
  2428 + //调用接口判断是不是会员
  2429 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + g_item.guide_id, {}).then(res => {
  2430 + if (res.data.code == 0) {
  2431 + goods.guide_name = res.data.data.salesman;
  2432 + goods.guide_sn = res.data.data.salesman_no;
  2433 + }
  2434 + })
  2435 + }
  2436 + //如果房间号不为空的时候
  2437 + if (g_item.room_id) {
  2438 + goods.room_id = g_item.room_id;
  2439 + room_ids += g_item.room_id + ",";
  2440 + }
  2441 + item.order_goods.push(goods);
  2442 + }
  2443 +
  2444 + //如果房间号不为空的时候
  2445 + if (room_ids != "") item.room_ids = ut.sub_last(room_ids);
  2446 + pdata.push(item);
  2447 + }
  2448 +
  2449 +
  2450 + }
  2451 +
  2452 + if (pdata.length == 0) return;
  2453 + var str = JSON.stringify(pdata);
  2454 +
  2455 + wx.showLoading({title: "加载中"});
  2456 + wx.request({
  2457 + url: oo.url + '/api/weshop/order/createWxdOrder',
  2458 + data: str,
  2459 + method: 'POST',
  2460 + header: {
  2461 + 'content-type': 'application/json'
  2462 + },// 设置请求的 header
  2463 + success: function (res) {
  2464 +
  2465 +
  2466 + wx.hideLoading();
  2467 + if (res.statusCode == 200) {
  2468 + var data = res.data;
  2469 + if (data.code == 0) {
  2470 + console.log(th.data.is_b_now);
  2471 + //如果是购物车结算,还要删除购物车
  2472 + if (th.data.is_b_now == 0) {
  2473 + console.log(th.data.cartlist_y);
  2474 + var list = th.data.cartlist_y;
  2475 + for (var i = 0; i < list.length; i++) {
  2476 + //删除购物车
  2477 + a.delete("/api/weshop/cart/del/" + oo.stoid + "/" + list[i].id, {});
  2478 + }
  2479 + }
  2480 + var order_amount = 0;
  2481 + pdata.forEach(function (em, ind) {
  2482 + order_amount += em.order_amount;
  2483 + })
  2484 + //要进行判断,如果是用微信支付,就要跳转到支付界面
  2485 + if (order_amount > 0) {
  2486 + th.setData({isclose: 0});
  2487 + //void e.jumpToCart4({
  2488 + // order_sn: data.data,
  2489 + //}, 1);
  2490 + util_pay.pay(data.data, function () {
  2491 + //app.my_warnning("支付成功",1,th);
  2492 + //setTimeout(function () {
  2493 + wx.redirectTo({
  2494 + url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data
  2495 + })
  2496 + //},1000)
  2497 +
  2498 + }, function () {
  2499 + //支付失败
  2500 + setTimeout(function () {
  2501 + var cps=getCurrentPages();
  2502 + if(cps.length>1){
  2503 + wx.navigateBack({delta: 1})
  2504 + }else{
  2505 + getApp().goto("/pages/index/index/index");
  2506 + }
  2507 +
  2508 + }, 1000)
  2509 + }, oo.stoid);
  2510 +
  2511 + } else {
  2512 + var dd = {
  2513 + parent_sn: data.data,
  2514 + store_id: oo.stoid,
  2515 + type: 2,
  2516 + };
  2517 + a.post("/api/weshop/order/pay/createOrder", {
  2518 + data: dd,
  2519 + success: function (t) {
  2520 + //console.log(t);
  2521 + if (t.data.code == 0) {
  2522 + //app.my_warnning("支付成功",1,th);
  2523 + //setTimeout(function () {
  2524 + th.setData({isclose: 0});
  2525 + wx.redirectTo({
  2526 + url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data,
  2527 + })
  2528 + //}, 1000)
  2529 + }
  2530 + },
  2531 + fail: function () {
  2532 +
  2533 + }
  2534 + });
  2535 + }
  2536 +
  2537 + }
  2538 + else {
  2539 + //--内容换行--
  2540 + var msg = data.msg;
  2541 + //赠品活动已经取消,无法赠送,是否继续买单?
  2542 + if (msg.indexOf("是否继续买单") > 0) {
  2543 + wx.showModal({
  2544 + title: "提示",
  2545 + content: data.msg,
  2546 + cancelText: '取消',
  2547 + confirmText: '确定',
  2548 + showCancel: true,
  2549 + success(res){
  2550 + if (res.cancel) {
  2551 + return;
  2552 + } else if (res.confirm) {
  2553 + th.data.is_continue = 1;
  2554 + th.data.is_summit_ing = 0; //是否提交中
  2555 + th.submitForm(sub_value);
  2556 + }
  2557 + }
  2558 + })
  2559 + return;
  2560 + }
  2561 + if (msg.length > 13) {
  2562 + msg = msg.slice(0, 13) + "\r\n" + msg.slice(13);
  2563 + }
  2564 + getApp().confirmBox(msg);
  2565 + th.data.is_summit_ing = 0; //是否提交中
  2566 + }
  2567 + } else {
  2568 + th.data.is_summit_ing = 0; //是否提交中
  2569 + console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode);
  2570 + }
  2571 + },
  2572 + fail: function () {
  2573 + th.data.is_summit_ing = 0;
  2574 + wx.hideLoading();
  2575 + console.log("index.js wx.request CheckCallUser fail");
  2576 + },
  2577 + complete: function () {
  2578 + }
  2579 + })
  2580 +
  2581 + },
  2582 + //---确认线下门店的数量足不足---
  2583 + async check_store_num(goods_id, pick, goods_num, func){
  2584 + var lock = 0, pick_no, plist, erpwareid;
  2585 + //先读取门店的lock
  2586 + await getApp().request.promiseGet("/api/weshop/order/ware/lock/page", {
  2587 + data: {store_id: os.stoid, wareId: goods_id, storageId: pick, pageSize: 1000}
  2588 + }).then(res => {
  2589 + if (res.data.code == 0 && res.data.data.total > 0) {
  2590 + for (var i in res.data.data.pageData)
  2591 + lock += res.data.data.pageData[i].outQty;
  2592 + }
  2593 + })
  2594 + //先获取门店的编号
  2595 + await getApp().request.promiseGet("/api/weshop/pickup/get/" + os.stoid + "/" + pick, {
  2596 + data: {storeId: os.stoid, goodsId: t.goods_id, pickupId: pick}
  2597 + }).then(res => {
  2598 + if (res.data.code == 0) {
  2599 + pick_no = res.data.data.pickup_no;
  2600 + }
  2601 + })
  2602 + //先获取商品的线下库存
  2603 + await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + goods_id, {
  2604 + data: {storeId: os.stoid, goodsId: t.goods_id, pickupId: pick}
  2605 + }).then(res => {
  2606 + if (res.data.code == 0) {
  2607 + erpwareid = res.data.data.erpwareid;
  2608 + }
  2609 + })
  2610 + //读取线下的门店库存
  2611 + await getApp().request.promiseGet("/api/weshop/goods/getWareStorages", {
  2612 + data: {storageNos: pick_no, wareIds: encodeURIComponent(erpwareid), storeId: os.stoid, pageSize: 2000}
  2613 + }).then(res => {
  2614 + if (res.data.code == 0) {
  2615 + plist = res.data.data.pageData[0];
  2616 + }
  2617 + })
  2618 + var isok = 1;
  2619 + if (goods_num > plist.CanOutQty - lock) {
  2620 + isok = 0;
  2621 + }
  2622 + func(isok);
  2623 + },
  2624 +
  2625 + useCoupon: function () {
  2626 + if (this.data.order.couponNum <= 0) {
  2627 + getApp().my_warnning("无可用优惠券", 0, this);
  2628 + return;
  2629 + }
  2630 +
  2631 + var a = {
  2632 + lid: this.data.coupon ? this.data.coupon.id : "0"
  2633 + };
  2634 + wx.navigateTo({
  2635 + url: "/pages/user/checkcoupon/checkcoupon?" + s.Obj2Str(a)
  2636 + });
  2637 + },
  2638 + enterAddressPage: function () {
  2639 + getApp().globalData.is_cart_old = 1;
  2640 + this.data.isget_by_quan = {};
  2641 + this.data.enterAddressPage = !0, wx.navigateTo({
  2642 + url: "/pages/user/address_list/address_list"
  2643 + });
  2644 + },
  2645 +
  2646 + //--------购物车购买时,选择自提和物流-----------
  2647 + setexptype_w: function (t) {
  2648 +
  2649 + var def_exp_code = getApp().globalData.userInfo.def_exp_code, th = this;
  2650 + var ty = t.currentTarget.dataset.t, txt = t.currentTarget.dataset.txt,
  2651 + wl_txt = t.currentTarget.dataset.wl_txt,
  2652 + ont = t.currentTarget.dataset.ont;
  2653 +
  2654 + th.setData({[txt]: ty});
  2655 + var iszt = 1;
  2656 +
  2657 + if (ty == 0) {
  2658 + th.setData({is_all_zt: 0});
  2659 + } else {
  2660 + for (var i = 0; i < th.data.cartlist.length; i++) {
  2661 + var item = th.data.cartlist[i];
  2662 + if (item.exp_type == 0) {
  2663 + iszt = 0;
  2664 + break;
  2665 + }
  2666 + }
  2667 +
  2668 + th.setData({is_all_zt: iszt});
  2669 +
  2670 + var ind = t.currentTarget.dataset.ind;
  2671 + var c_item = th.data.cartlist[ind];
  2672 + var pickid = c_item.pickup_id;
  2673 +
  2674 + if (th.data.using_quan[pickid] && th.data.using_quan[pickid].isby == 1) {
  2675 + th.data.using_quan[pickid] = {};
  2676 + th.setData({using_quan: th.data.using_quan});
  2677 + }
  2678 +
  2679 +
  2680 + }
  2681 + //判断有没有默认的物流地址值
  2682 + if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined) {
  2683 + var wu_arr = this.data.wu_arr;
  2684 + if (wu_arr != null && wu_arr != "") {
  2685 + for (var i = 0; i < wu_arr.length; i++) {
  2686 + if (wu_arr[i].shipping_code == def_exp_code) {
  2687 + var set_txt = "cartlist"
  2688 + th.setData({wl_txt: i});
  2689 + }
  2690 + }
  2691 + }
  2692 + }
  2693 + //----计算此时购物车的价格----
  2694 + th.calculatePrice();
  2695 + },
  2696 +
  2697 + //--------立即购买时,选择自提和物流----------
  2698 + setexptype: function (t) {
  2699 + var th = this;
  2700 + var ty = t.currentTarget.dataset.t, def_exp_code = getApp().globalData.userInfo.def_exp_code;
  2701 + th.setData({bn_exp_type: ty});
  2702 + if (ty == 0) {
  2703 + th.setData({is_all_zt: 0});
  2704 + }
  2705 +
  2706 + //当物流为空的时候。
  2707 + if (ty == 0 && th.data.wu_arr == null) {
  2708 + th.data.isget_by_quan = {};
  2709 + return th.get_wuliu(th.calculatePrice2());
  2710 + }
  2711 +
  2712 + //--自提就要把包邮券清理掉--
  2713 + if (ty == 1) {
  2714 + th.data.isget_by_quan = {};
  2715 + if (th.data.using_quan[th.data.bn_pick] && th.data.using_quan[th.data.bn_pick].isby == 1) {
  2716 + th.setData({using_quan: {}});
  2717 + }
  2718 + }
  2719 +
  2720 + //判断有没有默认的物流地址值
  2721 + if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined) {
  2722 + var wu_arr = this.data.wu_arr;
  2723 + if (wu_arr != null && wu_arr != "") {
  2724 + for (var i = 0; i < wu_arr.length; i++) {
  2725 + if (wu_arr[i].shipping_code == def_exp_code) {
  2726 + th.setData({index: i});
  2727 + }
  2728 + }
  2729 + }
  2730 + }
  2731 + th.calculatePrice2()
  2732 +
  2733 + },
  2734 +
  2735 + //--------立即购买时,使用余额--------
  2736 + set_bn_useyuer: function () {
  2737 + var th = this;
  2738 + th.setData({bn_use_money: !th.data.bn_use_money});
  2739 + th.calculatePrice2();
  2740 + },
  2741 + set_js_useyuer: function () {
  2742 + var th = this;
  2743 + th.setData({js_use_money: !th.data.js_use_money});
  2744 + th.calculatePrice();
  2745 + },
  2746 + //-------------------计算物流---------------
  2747 + calculatewuliu: function (code, o_shipping_price, goods_weight,
  2748 + goods_piece, user_addr, freight_free, o_price, rs) {
  2749 + var price = 0, th = this;
  2750 + price += parseFloat(o_shipping_price);
  2751 + //如果是包邮
  2752 + if (freight_free > 0 && o_price >= freight_free) {
  2753 + return 0;
  2754 + }
  2755 + if (user_addr == null) {
  2756 + return 0;
  2757 + }
  2758 + //计算物流的config item;
  2759 + var item = null;
  2760 + //先根据 镇 县 区找计算的config
  2761 + item = th.get_wuliu_config(user_addr.district, code, rs);
  2762 + if (item == null) item = th.get_wuliu_config(user_addr.city, code, rs);
  2763 + if (item == null) item = th.get_wuliu_config(user_addr.province, code, rs);
  2764 + if (item == null) item = th.get_wuliu_default(code, rs);
  2765 + if (item == null) return o_shipping_price;
  2766 + var fw_price = 0, fp_price = 0;
  2767 + item = item.config;
  2768 + if (item == null) return o_shipping_price;
  2769 + //------按重量----------
  2770 + if (goods_weight >= 0 && item['money']) {
  2771 + fw_price = parseFloat(item['money']);
  2772 + if (goods_weight > item['first_weight']) {
  2773 + var fw = goods_weight - item['first_weight'];
  2774 + var n = Math.ceil(fw / item['second_weight'])
  2775 + fw_price = fw_price + n * parseFloat(item['add_money']);
  2776 + }
  2777 + }
  2778 + //------按件数----------
  2779 + if (goods_piece > 0 && item['piecemoney']) {
  2780 + fp_price = parseFloat(item['piecemoney']);
  2781 + if (goods_piece > item['first_piece']) {
  2782 + var fp = goods_piece - item['first_piece'];
  2783 + var m = Math.ceil(fp / item['second_piece'])
  2784 + fp_price = fp_price + m * parseFloat(item['add_piecemoney']);
  2785 + }
  2786 + }
  2787 + var rspice = parseFloat(price + fw_price + fp_price);
  2788 + return rspice;
  2789 + },
  2790 +
  2791 + //------------循环获取config-----------
  2792 + get_wuliu_config: function (region_id, code, rs) {
  2793 + var item = null, rslist = rs.pageData;
  2794 + for (var i = 0; i < rslist.length; i++) {
  2795 + if (rslist[i].code == code && rslist[i].region_id == region_id) {
  2796 + item = rslist[i];
  2797 + }
  2798 + }
  2799 + return item;
  2800 + },
  2801 + //-------循环获取config,code default-------
  2802 + get_wuliu_default: function (code, rs) {
  2803 + var item = null, rslist = rs.pageData;
  2804 + for (var i = 0; i < rslist.length; i++) {
  2805 + if (rslist[i].shipping_code == code && rslist[i].is_default == 1) {
  2806 + item = rslist[i];
  2807 + }
  2808 + }
  2809 + return item;
  2810 + },
  2811 +
  2812 + //----------立即购买,选择物流-------------
  2813 + bindPickerChange: function (e) {
  2814 + var ind = e.detail.value
  2815 + this.setData({index: ind});
  2816 + this.calculatePrice2();
  2817 + },
  2818 + //----------购物车结算,选择物流-------------
  2819 + bindPickerChange_w: function (e) {
  2820 + var ind = e.detail.value, txt = e.currentTarget.dataset.txt;
  2821 + this.setData({[txt]: ind});
  2822 + this.calculatePrice();
  2823 + },
  2824 +
  2825 + /*----券的所有操作----*/
  2826 + open_coupon_list: function (e) {
  2827 + var th = this;
  2828 + var pickid = e.currentTarget.dataset.pickid;
  2829 + var bn = e.currentTarget.dataset.bn;
  2830 + var cindx = e.currentTarget.dataset.cind;
  2831 + var get_by_quan_list_cart = th.data.get_by_quan_list_cart[pickid];
  2832 +
  2833 +
  2834 + if (bn == 1) {
  2835 + th.setData({open_quan: 1, selected_quan_pick: pickid, disabled: 1});
  2836 + } else {
  2837 + //---多单打开券的时候,就要判断券在其他门店是否有使用---
  2838 + var quanlist = th.data.cartlist[cindx].quan_list;
  2839 + var exp_type = th.data.cartlist[cindx].exp_type;
  2840 +
  2841 +
  2842 + //对于在其他门店已经选择了的券 要判断是否显示到界面
  2843 + var t_user = th.data.using_quan[pickid];
  2844 +
  2845 + for (var i in quanlist) {
  2846 + quanlist[i].is_using = th.check_in_sele(quanlist[i].CashRepNo, pickid);
  2847 + if (t_user && quanlist[i].CashRepNo == t_user.coupon_no)
  2848 + quanlist[i].show_red = 1;
  2849 + else
  2850 + quanlist[i].show_red = 0;
  2851 + }
  2852 +
  2853 + if (get_by_quan_list_cart) {
  2854 + for (var i in get_by_quan_list_cart) {
  2855 + get_by_quan_list_cart[i].is_using = th.check_in_sele(get_by_quan_list_cart[i].no, pickid);
  2856 + if (t_user && get_by_quan_list_cart[i].no == t_user.coupon_no)
  2857 + get_by_quan_list_cart[i].show_red = 1;
  2858 + else
  2859 + get_by_quan_list_cart[i].show_red = 0;
  2860 + }
  2861 + th.setData({by_quan_list_cart: get_by_quan_list_cart});
  2862 + } else {
  2863 + th.setData({by_quan_list_cart: null});
  2864 + }
  2865 +
  2866 + console.log("2222222券的列表", quanlist);
  2867 + th.setData({
  2868 + sele_cart_ind: cindx,
  2869 + sele_exp_type: exp_type,
  2870 + open_quan: 1,
  2871 + selected_quan_pick: pickid,
  2872 + selected_quan_list: quanlist,
  2873 + disabled: 1
  2874 + });
  2875 + }
  2876 + },
  2877 + close_coupon: function (e) {
  2878 + var th = this;
  2879 + th.setData({open_quan: 0, disabled: 0});
  2880 + },
  2881 +
  2882 + //---判断券时候在已经选择的列表中---
  2883 + check_in_sele: function (no, pick_id) {
  2884 + var th = this;
  2885 + if (th.data.using_quan.length <= 0) return false;
  2886 + for (var i in th.data.using_quan) {
  2887 + //--如果键值等于本身就要跳出--
  2888 + if (parseInt(i) == parseInt(pick_id)) continue;
  2889 + var item = th.data.using_quan[i];
  2890 + if (item.coupon_no == no) {
  2891 + return true;
  2892 + }
  2893 + }
  2894 + return false;
  2895 + },
  2896 +
  2897 + /*--点击选择券--*/
  2898 + sele_quan_item: function (e) {
  2899 +
  2900 + var ind = e.currentTarget.dataset.ind;
  2901 + var quan_item = this.data.selected_quan_list[ind];
  2902 + var pickid = this.data.selected_quan_pick; //现在选择的是哪一个门店
  2903 + //--如果券是单品使用的时候--
  2904 + if (quan_item && quan_item.UseObjectType && quan_item.UseObjectType == "20") {
  2905 + //---只有多件购买的时候才要计算,//购物车购买和搭配勾的时候---
  2906 + var gg = getApp().get_b_now();
  2907 + if (this.data.is_b_now == 0 || gg.prom_type == 5) {
  2908 + var arr = this.data.order_prom_list_cart;
  2909 + var t_pk_item = null;
  2910 + for (var ii in arr) {
  2911 + var ep = arr[ii];
  2912 + if (pickid == ep.pickup_id) {
  2913 + t_pk_item = ep;
  2914 + break;
  2915 + }
  2916 + }
  2917 + //--寻找券指定的商品--
  2918 + var gd = null;
  2919 + if (t_pk_item) {
  2920 + var goods = t_pk_item.goods;
  2921 + for (var gid in goods) {
  2922 + if (quan_item.UseObjectID == goods[gid].erpwareid) {
  2923 + gd = goods[gid];
  2924 + }
  2925 + }
  2926 + }
  2927 + if (!gd) {
  2928 + getApp().my_warnning("未找到指定商品使用", 0, this, 600);
  2929 + return false;
  2930 + }
  2931 + //计算价格,如果有平摊的实收要计算实收的金额
  2932 + var item_price = gd.goods_price * gd.goods_num;
  2933 + //-- 如果有平摊下去,有实收价格的时候,就要用account_fir来计算价格 --
  2934 + if (gd.account_fir != null && gd.account_fir != undefined) {
  2935 + item_price = gd.account_fir * gd.goods_num;
  2936 + }
  2937 +
  2938 + if (item_price < parseFloat(quan_item.BuySum)) {
  2939 + getApp().my_warnning("该单品金额没有大于等于" + quan_item.BuySum + "元时不能使用优惠券", 0, this, 600);
  2940 + return false;
  2941 + }
  2942 + }
  2943 + }
  2944 +
  2945 + var no_use = e.currentTarget.dataset.no, quanlist = this.data.selected_quan_list;
  2946 + //---所有的券的显示红色选择都清理一遍---
  2947 + for (var i in quanlist) {
  2948 + quanlist[i].show_red = 0;
  2949 + }
  2950 + this.setData({selected_quan_list: quanlist});
  2951 + var by_quanlist = this.data.get_by_quan_list;
  2952 + if (by_quanlist) {
  2953 + //---所有的券的显示红色选择都清理一遍---
  2954 + for (var inb in by_quanlist) {
  2955 + by_quanlist[inb].show_red = 0;
  2956 + }
  2957 + this.setData({get_by_quan_list: by_quanlist});
  2958 + }
  2959 +
  2960 + var by_cart_list = this.data.by_quan_list_cart;
  2961 + if (by_cart_list) {
  2962 + //---所有的券的显示红色选择都清理一遍---
  2963 + for (var inc in by_cart_list) {
  2964 + by_cart_list[inc].show_red = 0;
  2965 + }
  2966 + this.setData({by_quan_list_cart: by_cart_list});
  2967 + }
  2968 +
  2969 + var using_quan = this.data.using_quan;
  2970 + var th = this;
  2971 + //---如果是不使用优惠券---
  2972 + if (no_use == 1) {
  2973 + console.log("有进来吗券", no_use);
  2974 + if (using_quan[th.data.selected_quan_pick]) {
  2975 + using_quan[th.data.selected_quan_pick].is_nouse_red = 1;
  2976 + }
  2977 + else {
  2978 + using_quan[th.data.selected_quan_pick] = {is_nouse_red: 1};
  2979 + }
  2980 + this.setData({using_quan: using_quan, is_coupon: 2222});
  2981 + return;
  2982 + }
  2983 +
  2984 +
  2985 + var txt = "selected_quan_list[" + ind + "].show_red";
  2986 + var obj = {};
  2987 + obj[txt] = 1;
  2988 + if (quan_item.show_red) {
  2989 + obj[txt] = 0;
  2990 + }
  2991 + this.setData(obj);
  2992 + console.log(this.data.selected_quan_list, "选中的券的下标", quan_item, "数据都在这里", txt);
  2993 + if (using_quan[th.data.selected_quan_pick]) {
  2994 + using_quan[th.data.selected_quan_pick].is_nouse_red = 0;
  2995 + }
  2996 + else {
  2997 + using_quan[th.data.selected_quan_pick] = {is_nouse_red: 0};
  2998 + }
  2999 + this.setData({using_quan: using_quan});
  3000 +
  3001 + },
  3002 +
  3003 +
  3004 + /*----- 点击选择包邮券 -----*/
  3005 + sele_quan_item_by: function (e) {
  3006 + var no_use = e.currentTarget.dataset.no;
  3007 + //立即购买的包邮券
  3008 + var by_quanlist = this.data.get_by_quan_list;
  3009 + if (by_quanlist) {
  3010 + //---所有的券的显示红色选择都清理一遍---
  3011 + for (var ind in by_quanlist) {
  3012 + by_quanlist[ind].show_red = 0;
  3013 + }
  3014 + this.setData({get_by_quan_list: by_quanlist});
  3015 + }
  3016 +
  3017 + //--购物车过来的包邮券--
  3018 + var by_cart_list = this.data.by_quan_list_cart;
  3019 + if (by_cart_list) {
  3020 + //---所有的券的显示红色选择都清理一遍---
  3021 + for (var ind in by_cart_list) {
  3022 + by_cart_list[ind].show_red = 0;
  3023 + }
  3024 + this.setData({by_quan_list_cart: by_cart_list});
  3025 + }
  3026 + //普通券
  3027 + var quanlist = this.data.selected_quan_list;
  3028 + if (quanlist) {
  3029 + //---所有的券的显示红色选择都清理一遍---
  3030 + for (var ind in quanlist) {
  3031 + quanlist[ind].show_red = 0;
  3032 + }
  3033 + this.setData({selected_quan_list: quanlist});
  3034 + }
  3035 +
  3036 + var th = this;
  3037 + var using_quan = this.data.using_quan;
  3038 + //---如果是不使用优惠券---
  3039 + if (no_use == 1) {
  3040 + if (using_quan[th.data.selected_quan_pick]) {
  3041 + using_quan[th.data.selected_quan_pick].is_nouse_red = 1;
  3042 + }
  3043 + else {
  3044 + using_quan[th.data.selected_quan_pick] = {is_nouse_red: 1};
  3045 + }
  3046 + this.setData({using_quan: using_quan, is_coupon: 2222});
  3047 + return;
  3048 + }
  3049 +
  3050 + var pickid = th.data.selected_quan_pick; //现在选择的是哪一个门店
  3051 + var ind = e.currentTarget.dataset.ind;
  3052 + //--如果是立即购买的部分--
  3053 + var txt = "";
  3054 + var txt1 = "";
  3055 + var quan_item = null;
  3056 + if (th.data.is_b_now) {
  3057 + quan_item = this.data.get_by_quan_list[ind];
  3058 + txt = "get_by_quan_list[" + ind + "].show_red";
  3059 + var obj = {};
  3060 + obj[txt] = 1;
  3061 + this.setData(obj);
  3062 + } else {
  3063 + txt = "by_quan_list_cart[" + ind + "].show_red";
  3064 + quan_item = th.data.by_quan_list_cart[ind];
  3065 + var obj = {};
  3066 + obj[txt] = 1;
  3067 + this.setData(obj);
  3068 + th.data.get_by_quan_list_cart[pickid] = JSON.parse(JSON.stringify(th.data.by_quan_list_cart)); //要把选中的弄回数组
  3069 + }
  3070 +
  3071 + if (using_quan[th.data.selected_quan_pick]) {
  3072 + using_quan[th.data.selected_quan_pick].is_nouse_red = 0;
  3073 + }
  3074 + else {
  3075 + using_quan[th.data.selected_quan_pick] = {is_nouse_red: 0};
  3076 + }
  3077 + this.setData({using_quan: using_quan});
  3078 + },
  3079 +
  3080 + //--确认使用券---
  3081 + confirm_quan: function () {
  3082 + var using_quan = this.data.using_quan; //正在使用中的券列表
  3083 + var pickid = this.data.selected_quan_pick; //选中的门店ID
  3084 + var th = this;
  3085 + var selected_quan_list = this.data.selected_quan_list; //选择了那个门店的券列表
  3086 + var get_by_quan_list = this.data.get_by_quan_list; //立即购买的包邮券列表
  3087 + var by_quan_list_cart = this.data.by_quan_list_cart; //购物车购买的包邮券列表
  3088 + //选择了的券
  3089 + var sele_quan = null;
  3090 +
  3091 + //循环普通的券
  3092 + for (var i in selected_quan_list) {
  3093 + var item = selected_quan_list[i];
  3094 + if (item.show_red) {
  3095 + th.insert_into_using_quan(item, using_quan, pickid);
  3096 + return;
  3097 + }
  3098 + }
  3099 + //循环包邮的券,立即购买的
  3100 + for (var i in get_by_quan_list) {
  3101 + var item = get_by_quan_list[i];
  3102 + if (item.show_red) {
  3103 + if (th.data.is_no_by[pickid] == 1) {
  3104 + getApp().my_warnning("已全场不能包邮,不能选择包邮券", 0, th);
  3105 + return false;
  3106 + }
  3107 + if (th.data.is_by[pickid] == 1) {
  3108 + getApp().my_warnning("已全场包邮,不能选择包邮券", 0, th);
  3109 + return false;
  3110 + }
  3111 +
  3112 + th.insert_into_using_quan(item, using_quan, pickid, 1);
  3113 + return;
  3114 + }
  3115 + }
  3116 +
  3117 + //循环包邮的券
  3118 + for (var i in by_quan_list_cart) {
  3119 + var item = by_quan_list_cart[i];
  3120 + if (item.show_red) {
  3121 + if (th.data.is_no_by[pickid] == 1) {
  3122 + getApp().my_warnning("已全场不能包邮,不能选择包邮券", 0, th);
  3123 + return false;
  3124 + }
  3125 + if (th.data.is_by[pickid] == 1) {
  3126 + getApp().my_warnning("已全场包邮,不能选择包邮券", 0, th);
  3127 + return false;
  3128 + }
  3129 + th.insert_into_using_quan(item, using_quan, pickid, 1);
  3130 + return;
  3131 + }
  3132 + }
  3133 +
  3134 + //选择了的券,看是不是点击了不使用券,点击了不使用优惠券
  3135 + if (using_quan[pickid]) {
  3136 + if (using_quan[pickid].is_nouse_red == 1) {
  3137 + using_quan[pickid] = {is_nouse_red: 1};
  3138 + th.setData({using_quan: using_quan});
  3139 + if (th.data.is_b_now == 1) {
  3140 + th.calculatePrice2();
  3141 + } else {
  3142 + th.calculatePrice();
  3143 + }
  3144 + th.setData({open_quan: 0});
  3145 + return;
  3146 + }
  3147 + }
  3148 + },
  3149 +
  3150 + //----把券插入之后的操作,同时还要重新计算价格----
  3151 + insert_into_using_quan: function (item, using_quan, pickid, isby) {
  3152 + var th = this;
  3153 + if (isby == 1) {
  3154 + using_quan[pickid] = {
  3155 + coupon_no: item.no,
  3156 + money: 0,
  3157 + is_nouse_red: 0,
  3158 + region_list: item.region_list,
  3159 + goods_list: item.goods_list
  3160 + };
  3161 + using_quan[pickid].isby = 1;
  3162 + } else {
  3163 + using_quan[pickid] = {coupon_no: item.CashRepNo, money: item.Sum, is_nouse_red: 0};
  3164 + using_quan[pickid].isby = 0;
  3165 + }
  3166 + this.setData({using_quan: using_quan});
  3167 + if (th.data.is_b_now == 1) {
  3168 + th.calculatePrice2();
  3169 + } else {
  3170 + th.calculatePrice();
  3171 + }
  3172 + th.setData({open_quan: 0});
  3173 + },
  3174 +
  3175 + cart_set_err: function (e) {
  3176 + var txt = e.currentTarget.dataset.err;
  3177 + var ob = {};
  3178 + ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif";
  3179 + this.setData(ob);
  3180 + },
  3181 + //--验证是否已经冻结--
  3182 + check_is_frozenQuan: function (quanlist, frozenQuan, isby) {
  3183 + console.log("券列表", quanlist);
  3184 + if (!quanlist) return null;
  3185 + if (!frozenQuan) return quanlist;
  3186 + var arr = [];
  3187 + for (var i = 0; i < quanlist.length; i++) {
  3188 + var item = quanlist[i];
  3189 + var is_find = 0;
  3190 + var Q_no = quanlist[i].CashRepNo;
  3191 + if (isby) Q_no = quanlist[i].no;
  3192 + for (var j = 0; j < frozenQuan.length; j++) {
  3193 + var q_no = frozenQuan[j].cashRepNo;
  3194 + if (Q_no == q_no) {
  3195 + is_find = 1;
  3196 + break;
  3197 + }
  3198 + }
  3199 + if (!is_find) arr.push(item);
  3200 + }
  3201 + return arr;
  3202 + },
  3203 +
  3204 + //// 开启物流的弹窗
  3205 + show_wu_arr: function (e) {
  3206 + var wu_arr_txt = e.currentTarget.dataset.txt;
  3207 + var w_sele_index = e.currentTarget.dataset.w_sele_index;
  3208 + var is_express = null;
  3209 + var ob = {open_express: 1, wu_arr_txt: wu_arr_txt, disabled: 1};
  3210 +
  3211 + //--如果是多个门店的时候--
  3212 + if (w_sele_index != undefined) {
  3213 + is_express = this.data.cartlist[w_sele_index].wind;
  3214 + ob['is_express'] = is_express;
  3215 + }
  3216 + this.setData(ob);
  3217 + },
  3218 + // 关闭物流的弹窗
  3219 + close_express: function () {
  3220 + this.setData({open_express: 0, disabled: 0});
  3221 + },
  3222 + // 选择物流
  3223 + click_express_name: function (e) {
  3224 + var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode;
  3225 + var index = e.currentTarget.dataset.idxe;
  3226 + var ob = {is_express: index, is_shipping_code: shippingcode, disabled: 0};
  3227 + ob[this.data.wu_arr_txt] = index;
  3228 + this.setData(ob);
  3229 + },
  3230 +
  3231 + //点击确定物流
  3232 + determine_expres: function (e) {
  3233 + this.setData({open_express: 0});
  3234 + if (this.data.is_b_now == 1)
  3235 + this.calculatePrice2();
  3236 + else
  3237 + this.calculatePrice();
  3238 + },
  3239 +
  3240 + //点击打开优惠券使用说明
  3241 + clik_coupons: function (e) {
  3242 + var ind = e.currentTarget.dataset.idx;
  3243 + var is_open = this.data.selected_quan_list[ind].is_open;
  3244 +
  3245 + if (is_open == 1) is_open = 0;
  3246 + else is_open = 1;
  3247 +
  3248 + var txt = "selected_quan_list[" + ind + "].is_open"
  3249 + var obj = {};
  3250 + obj[txt] = is_open;
  3251 +
  3252 + this.setData(obj);
  3253 + this.setData({disabled: 1})
  3254 + },
  3255 +
  3256 + clik_coupons2: function (e) {
  3257 + var ind = e.currentTarget.dataset.idx;
  3258 + var is_open = this.data.get_by_quan_list[ind].is_open;
  3259 +
  3260 + if (is_open == 1) is_open = 0;
  3261 + else is_open = 1;
  3262 +
  3263 + var txt = "get_by_quan_list[" + ind + "].is_open"
  3264 + var obj = {};
  3265 + obj[txt] = is_open;
  3266 +
  3267 + this.setData(obj);
  3268 + this.setData({disabled: 1})
  3269 + },
  3270 +
  3271 +
  3272 + //设置默认物流
  3273 + select_default_logistics: function () {
  3274 + var th = this;
  3275 + var is_shipping_code = this.data.is_shipping_code
  3276 + getApp().request.put("/api/weshop/users/update", {
  3277 + data: {user_id: getApp().globalData.user_id, store_id: oo.stoid, def_exp_code: is_shipping_code},
  3278 + success: function (rse) {
  3279 + if (rse.data.code == 0) {
  3280 + getApp().globalData.userInfo.def_exp_code = is_shipping_code;
  3281 + th.setData({open_express: 0});
  3282 + //----计算此时购物车的价格----
  3283 + if (th.data.is_b_now == 1) th.calculatePrice2();
  3284 + else th.calculatePrice();
  3285 + }
  3286 + }
  3287 + })
  3288 + },
  3289 +
  3290 + //更新下默认,在onshow里面
  3291 + update_code(){
  3292 + var th = this, m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code;
  3293 + //--定时器,判断wu_arr不未空--
  3294 + var uii = setInterval(function () {
  3295 + if (th.data.wu_arr) {
  3296 + clearInterval(uii);
  3297 + for (var k = 0; k < th.data.wu_arr.length; k++) {
  3298 + var item = th.data.wu_arr[k];
  3299 + if (def_exp_code == item.code) {
  3300 + m_wind = k;
  3301 + }
  3302 + }
  3303 + //--如果是立即购买--
  3304 + if (th.data.is_b_now == 1) {
  3305 + th.setData({index: m_wind, is_express: m_wind});
  3306 + } else {
  3307 + var ui = setInterval(function () {
  3308 + if (th.data.cartlist) {
  3309 + var c_arr = th.data.cartlist;
  3310 + for (var i in c_arr) {
  3311 + c_arr[i].wind = m_wind;
  3312 + }
  3313 + th.setData({cartlist: c_arr, is_express: m_wind})
  3314 + clearInterval(ui);
  3315 + }
  3316 + }, 500)
  3317 + }
  3318 + }
  3319 + }, 500);
  3320 + },
  3321 + //-----获取购物车进来的劵-------
  3322 + get_cart_quan: async function (order_prom_list_cart) {
  3323 + var th = this;
  3324 + var is_xz_yh = 1;
  3325 + //等待值的出现
  3326 + //getApp().waitfor2(this,"g_cart_q_time","order_prom_list_cart",async function () {
  3327 + //var arr=th.data.order_prom_list_cart;
  3328 + var arr = order_prom_list_cart;
  3329 + if (!arr) arr = [];
  3330 + //如果系统有限制使用优惠券
  3331 + if (th.data.is_close_quan) return false;
  3332 +
  3333 + //------------开始计算使用优惠券相关------------
  3334 + for (var ind in arr) {
  3335 + var ep = arr[ind];
  3336 + var goodlist = ep.goods;
  3337 + var pickup_id = ep.pickup_id;
  3338 + //--更优惠券抵用有关,立即购买的,如果是购物车,如果有等级价还有考虑等级价的东西
  3339 + //就要把相应的值,写入cartlist数组中--
  3340 + var ckeck_quan_price = 0,
  3341 + check_quan_price_list = '',
  3342 + check_quan_ware_list = '';
  3343 +
  3344 + for (var i in goodlist) {
  3345 + var gd = goodlist[i];
  3346 + //--如果是秒杀就跳出,如果是赠品,如果是组合购,如果是限制使用优惠券--
  3347 + if (gd.prom_type == 1 || gd.is_gift || gd.prom_type == 7) {
  3348 + continue;
  3349 + }
  3350 + //如果有限制使用优惠券,就要返回
  3351 + if (gd.prom_type == 3) {
  3352 + if (th.data.prom_goods_map[pickup_id][gd.prom_id].is_xz_yh) continue;
  3353 + th.data.prom_goods_map[pickup_id][gd.prom_id].coupon_sele = 1;
  3354 + }
  3355 + is_xz_yh = 0;
  3356 + var item_price = gd.goods_price * gd.goods_num;
  3357 + //-- 如果有平摊下去,有实收价格的时候,就要用account来计算价格 --
  3358 + if (gd.account_fir != null && gd.account_fir != undefined) {
  3359 + item_price = gd.account_fir * gd.goods_num;
  3360 + }
  3361 + ckeck_quan_price += item_price;
  3362 +
  3363 + //--组装价格list--
  3364 + if (check_quan_price_list) {
  3365 + check_quan_price_list += "," + item_price;
  3366 + } else {
  3367 + check_quan_price_list = item_price;
  3368 + }
  3369 + //--组装商品的线下erpwareid--
  3370 + if (check_quan_ware_list) {
  3371 + check_quan_ware_list += "," + encodeURIComponent(gd['erpwareid']);
  3372 + } else {
  3373 + check_quan_ware_list = encodeURIComponent(gd['erpwareid']);
  3374 + }
  3375 + }
  3376 + //优惠券优惠的金额要控制到优惠券的选择条件
  3377 + var cut_price = 0;
  3378 + for (var i in th.data.prom_goods_map[pickup_id]) {
  3379 + var obj = th.data.prom_goods_map[pickup_id][i];
  3380 + if (obj.coupon_sele) {
  3381 + cut_price += obj.price - obj.prom_price;
  3382 + }
  3383 + }
  3384 +
  3385 + arr[ind].ckeck_quan_price = ckeck_quan_price - cut_price;
  3386 + arr[ind].check_quan_ware_list = check_quan_ware_list;
  3387 + arr[ind].check_quan_price_list = check_quan_price_list;
  3388 +
  3389 + //是否关闭使用优惠券
  3390 + if (th.data.is_close_quan != 1 && !is_xz_yh) {
  3391 + //--调用接口,获取优惠券的列表,3秒钟内控制接口请求--
  3392 + var url = "/api/weshop/couponList/getUseCouponList";
  3393 + await app.request.promiseGet(url, {
  3394 + data: {
  3395 + storeId: oo.stoid,
  3396 + userId: app.globalData.user_id,
  3397 + BuySum: ckeck_quan_price,
  3398 + WareIds: check_quan_ware_list,
  3399 + pageSize: 100
  3400 + }
  3401 + }).then(res => {
  3402 + if (res.data.code == 0) {
  3403 + var quan_list = res.data.data.pageData;
  3404 + arr[ind].quan_list = th.check_is_frozenQuan(quan_list, th.data.frozenQuan);
  3405 + }
  3406 + })
  3407 + }
  3408 + }
  3409 +
  3410 + //如果是搭配购的立即购买的时候
  3411 + if (th.data.is_b_now) {
  3412 + if (arr && arr.length > 0) {
  3413 + var quanlist = arr[0].quan_list;
  3414 + th.setData({selected_quan_list: quanlist, cartlist: arr})
  3415 + }
  3416 + } else {
  3417 + th.setData({cartlist: arr})
  3418 + th.set_can_num();
  3419 + }
  3420 +
  3421 + //})
  3422 + },
  3423 +
  3424 + //------ 获取立即购买的购物车的劵 --------
  3425 + get_buy_now_quan: function () {
  3426 + var quanlist = null, th = this, frozenQuan = null;
  3427 + var good = this.data.bn_goods;
  3428 + if (good.prom_price) {
  3429 + th.data.ckeck_quan_price = good.prom_price; //如果有优惠价,就用优惠价
  3430 + } else if (good.is_offline) {
  3431 + th.data.ckeck_quan_price = good.offline_price; //如果有线下取价,就用线下价
  3432 + }
  3433 + //--如果商家后台没有限制使用优惠券,同时商品的优惠活动没有限制使用优惠券--
  3434 + if (th.data.is_close_quan != 1 && th.data.bn_goods.is_xz_yh != 1) {
  3435 + var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id;
  3436 + var url = "/api/weshop/couponList/getUseCouponList";
  3437 + app.request.promiseGet(url0, {1: 1}).then(res => {
  3438 + if (res.data.code == 0) {
  3439 + frozenQuan = res.data.data;
  3440 + th.data.frozenQuan = frozenQuan;
  3441 + }
  3442 + app.request.time_limit_get(6, url, {
  3443 + data: {
  3444 + storeId: oo.stoid,
  3445 + userId: app.globalData.user_id,
  3446 + BuySum: th.data.ckeck_quan_price,
  3447 + WareIds: encodeURIComponent(th.data.check_quan_ware_list),
  3448 + pageSize: 100
  3449 + },
  3450 + success: function (res) {
  3451 + if (res.data.code == 0) {
  3452 + quanlist = res.data.data.pageData;
  3453 + if (quanlist) {
  3454 + quanlist = th.check_is_frozenQuan(quanlist, frozenQuan);
  3455 + th.setData({selected_quan_list: quanlist})
  3456 + }
  3457 + }
  3458 + }
  3459 + })
  3460 + })
  3461 + }
  3462 + },
  3463 +
  3464 + //检查区域是不是包邮
  3465 + check_area: function (arr) {
  3466 + var user_addr = this.data.user_addr;
  3467 + if (!user_addr) return 0;
  3468 + for (var i in arr) {
  3469 + var item = arr[i];
  3470 + if (user_addr.twon == item || user_addr.district == item
  3471 + || user_addr.city == item || user_addr.province == item) {
  3472 + return 0;
  3473 + }
  3474 + }
  3475 + return 1;
  3476 + },
  3477 +
  3478 + //检查立即购买的商品是不是不包邮
  3479 + check_good: function (arr, goods_id) {
  3480 + if (!goods_id) goods_id = this.data.bn_goods.goods_id;
  3481 + for (var i in arr) {
  3482 + var item = arr[i];
  3483 + if (goods_id == item) return 0;
  3484 + }
  3485 + return 1;
  3486 + },
  3487 + check_by_area: function (region_list) {
  3488 + var arr = region_list.split(",");
  3489 + var check = this.check_area(arr);
  3490 + return !check;
  3491 + },
  3492 + check_by_goods: function (goods_list, goods_id) {
  3493 + var arr = goods_list.split(",");
  3494 + var check = this.check_good(arr, goods_id);
  3495 + return !check;
  3496 + },
  3497 + //立即购买获取优惠活动的内容
  3498 + buy_now_prom_goods: function (prom_id, arr, func) {
  3499 + var price = arr.shop_price * arr.goods_num;
  3500 + var prom = null;
  3501 + getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + prom_id, {}).then(res => {
  3502 + if (res.data.code == 0) {
  3503 + prom = res.data.data;
  3504 + return getApp().request.promiseGet("/api/weshop/goods/getDiscount", {
  3505 + data: {
  3506 + price: price,
  3507 + prom_id: prom_id,
  3508 + goods_num: arr.goods_num,
  3509 + user_id: getApp().globalData.user_id,
  3510 + is_bz: prom.is_bz
  3511 + }
  3512 + })
  3513 + } else {
  3514 + func(arr);
  3515 + }
  3516 + }).then(res => {
  3517 + if (res.data.code == 0) {
  3518 + var get_data = res.data.data;
  3519 + arr.is_bz = prom.is_bz; //是不是倍增
  3520 + arr.is_xz_yh = prom.is_xz_yh; //是不是优惠
  3521 + arr.bs = get_data.bs; //是不是倍数
  3522 + arr.is_past = get_data.is_past; //是不是包邮
  3523 + arr.prom_price = get_data.price >= 0 ? get_data.price : price;
  3524 + arr.s_intValue = get_data.intValue;
  3525 + arr.s_coupon_id = get_data.coupon_id;
  3526 + arr.s_coupon_num = get_data.coupon_num;
  3527 + //-- 看是不是有赠品 --
  3528 + if (get_data.gift_id) {
  3529 + arr.gift_id = get_data.gift_id;
  3530 + arr.gift_goods_id = get_data.goods_id;
  3531 + arr.gift_goods_name = get_data.goods_name;
  3532 + arr.gift_goods_color = get_data.goodsinfo.goods_color;
  3533 + arr.gift_goods_spec = get_data.goodsinfo.goods_spec;
  3534 + arr.gift_original_img = get_data.goodsinfo.original_img;
  3535 + arr.gift_weight = get_data.goodsinfo.weight;
  3536 + arr.gift_exp_sum_type = get_data.goodsinfo.exp_sum_type;
  3537 + arr.gift_uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum;
  3538 + arr.gift_limit_num = get_data.limit_num;
  3539 + arr.gift_storecount = get_data.gift_storecount;
  3540 + }
  3541 + arr.s_libao = get_data.libao;
  3542 + arr.s_lb_num = get_data.lb_num;
  3543 + arr.prom_id = prom_id;
  3544 + }
  3545 + func(arr);
  3546 + })
  3547 + },
  3548 + //--检查订单优惠--
  3549 + check_is_order_prom: function (condition, func, pick) {
  3550 + var th = this;
  3551 + if (this.data.is_b_now == 1) pick = this.data.bn_pick;
  3552 + //---获取订单优惠---
  3553 + getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
  3554 + data: {store_id: os.stoid, orderAmount: condition}
  3555 + }).then(res => {
  3556 + if (res.data.code == 0) {
  3557 + var data = res.data.data;
  3558 + th.data.order_prom[pick] = data;
  3559 + }
  3560 + func();
  3561 + })
  3562 + },
  3563 +
  3564 + //--- 加入优惠活动的映射中,同时要有一个good列表 ---
  3565 + add_prom_goods_map: async function (item) {
  3566 + var th = this;
  3567 + var pickid = item.pick_id;
  3568 + var map = th.data.prom_goods_map;
  3569 + var obj = map[pickid];
  3570 +
  3571 + if (map[pickid]) {
  3572 + if (map[pickid][item.prom_id]) {
  3573 + var ob = map[pickid][item.prom_id];
  3574 + ob.price += item.goods_price * item.goods_num;
  3575 + ob.goods_num += item.goods_num;
  3576 + ob.goods.push({goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num});
  3577 +
  3578 + } else {
  3579 + var prom = null;
  3580 + await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + item.prom_id, {}).then(res => {
  3581 + if (res.data.code == 0) {
  3582 + prom = res.data.data;
  3583 + }
  3584 + })
  3585 + var ob = {};
  3586 + ob.prom_id = item.prom_id;
  3587 + ob.price = item.goods_price * item.goods_num;
  3588 + ob.goods_num = item.goods_num;
  3589 + ob.is_bz = prom.is_bz;
  3590 + ob.is_xz_yh = prom.is_xz_yh;
  3591 + ob.goods = new Array();
  3592 + ob.goods.push({goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num});
  3593 + map[pickid][item.prom_id] = ob;
  3594 + }
  3595 + } else {
  3596 + var ob = {};
  3597 + var prom = null;
  3598 + await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + item.prom_id, {}).then(res => {
  3599 + if (res.data.code == 0) {
  3600 + prom = res.data.data;
  3601 + }
  3602 + })
  3603 + ob.prom_id = item.prom_id;
  3604 + ob.price = item.goods_price * item.goods_num;
  3605 + ob.goods_num = item.goods_num;
  3606 + ob.is_bz = prom.is_bz;
  3607 + ob.is_xz_yh = prom.is_xz_yh;
  3608 + ob.goods = new Array();
  3609 + ob.goods.push({goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num});
  3610 +
  3611 + var obj = {};
  3612 + obj[item.prom_id] = ob;
  3613 + map[pickid] = obj;
  3614 +
  3615 + }
  3616 + },
  3617 +
  3618 + //计算立即购买赠品的物流费用
  3619 + get_now_gift_goods_wuliu: function (code, o_shipping_price, user_addr, gift_freight_free, allpice, rs, shipping_price, no_by_data, goods_weight1, goods_piece1) {
  3620 + var good = this.data.buy_now_gift_goods;
  3621 + var goods_weight = -1, goods_piece = -1;
  3622 + var gift_shipping_price = 0;
  3623 + var th = this;
  3624 + switch (good['exp_sum_type']) {
  3625 + case 1:
  3626 + //统一运费
  3627 + gift_shipping_price += good['uniform_exp_sum'];
  3628 + gift_shipping_price += o_shipping_price;
  3629 + break;
  3630 + case 2:
  3631 + if (goods_weight < 0) goods_weight = 0;
  3632 + //累积商品重量 每种商品的重量 * 数量
  3633 + goods_weight += good['weight'] * good['buynum'];
  3634 + if (goods_weight1 > 0) {
  3635 + goods_weight += goods_weight1;
  3636 + }
  3637 + break;
  3638 + case 3:
  3639 + if (goods_piece < 0) goods_piece = 0;
  3640 + //累积商品数量
  3641 + goods_piece += good['buynum'];
  3642 + if (goods_piece1) {
  3643 + goods_piece += goods_piece1;
  3644 + }
  3645 + break;
  3646 + }
  3647 +
  3648 +
  3649 + //如果有设置不包邮区域的时候
  3650 + if (no_by_data && no_by_data.region_list) {
  3651 + if (th.check_by_area(no_by_data.region_list)) {
  3652 + gift_freight_free = 0;
  3653 + th.data.is_no_by[th.data.bn_pick] = 1;
  3654 + }
  3655 + }
  3656 + //如果有设置不包邮商品
  3657 + if (no_by_data && no_by_data.goods_list && gift_freight_free) {
  3658 + if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) {
  3659 + gift_freight_free = 0;
  3660 + //th.data.is_no_by[th.data.bn_pick]=1;
  3661 + }
  3662 + }
  3663 +
  3664 + var t_shipping_price =
  3665 + this.calculatewuliu(code, gift_shipping_price, goods_weight,
  3666 + goods_piece, user_addr, gift_freight_free, allpice, rs);
  3667 + return t_shipping_price;
  3668 +
  3669 + },
  3670 +
  3671 + //从优惠的映射中拿出商品从表的item
  3672 + item_map_get_goods: function (goods_id, map) {
  3673 + for (var i in map.goods) {
  3674 + if (map.goods[i].goods_id == goods_id) return map.goods[i];
  3675 + }
  3676 + },
  3677 + //从优惠的映射中拿出商品从表的item
  3678 + arr_get_goods: function (goods_id, arr) {
  3679 + for (var i in arr) {
  3680 + if (arr[i].goods_id == goods_id) return arr[i];
  3681 + }
  3682 + },
  3683 +
  3684 + //检查是不是有其他门店的订单在选择了券
  3685 + check_other_use: function (iter, pkid) {
  3686 + var using = this.data.using_quan;
  3687 + var is_use = 0;
  3688 + if (using) {
  3689 + for (var i in using) {
  3690 + if (i == pkid) continue;
  3691 + if (iter.CashRepNo == using[i].coupon_no) {
  3692 + is_use = 1;
  3693 + break;
  3694 + }
  3695 + }
  3696 + }
  3697 + return is_use;
  3698 + },
  3699 + //检查是不是有其他门店的订单在选择了包邮券
  3700 + check_other_use_by: function (iter, pkid) {
  3701 + var using = this.data.using_quan;
  3702 + var is_use = 0;
  3703 + if (using) {
  3704 + for (var i in using) {
  3705 + if (i == pkid) continue;
  3706 + if (iter.no == using[i].coupon_no) {
  3707 + is_use = 1;
  3708 + break;
  3709 + }
  3710 + }
  3711 + }
  3712 + return is_use;
  3713 + },
  3714 +
  3715 + //跳转到购买卡
  3716 + buycard: function () {
  3717 + getApp().goto("/pages/user/plus/plus");
  3718 + getApp().globalData.plus_buy_back = 1;
  3719 + },
  3720 +
  3721 + //跳转关闭弹出框的显示
  3722 + close_offline: function () {
  3723 + this.setData({is_offline_show: 0});
  3724 + },
  3725 +
  3726 + //立即购买显示弹出框
  3727 + bn_pop_offline: function () {
  3728 + var off_price = this.data.bn_goods.shop_price - this.data.bn_goods.offline_price;
  3729 + //是不是线下
  3730 + var is_get_offline = this.data.bn_goods.is_offline;
  3731 + this.setData({is_offline_show: 1, show_off_price: off_price.toFixed(2), is_get_offline: is_get_offline});
  3732 + },
  3733 +
  3734 + //确定使用线下取价
  3735 + sure_offline: function () {
  3736 + var bn_goods = this.data.bn_goods;
  3737 + if (bn_goods && bn_goods.prom_type == 0) {
  3738 + bn_goods.is_offline = 1;
  3739 + this.setData({is_offline_show: 0, bn_goods: bn_goods});
  3740 + this.calculatePrice2();
  3741 + }
  3742 + //就是购物车结算时的
  3743 + else {
  3744 + var index = this.data.pop_offline_index;
  3745 + var txt = "cartlist[" + index + "].is_offline";
  3746 + this.setData({[txt]: 1, is_offline_show: 0,});
  3747 + this.data.old_cartlist[index].is_offline = 1;
  3748 + this.calculatePrice();
  3749 + }
  3750 + },
  3751 +
  3752 +
  3753 + //取消使用线下取价
  3754 + cancle_offline: function () {
  3755 + //判断是不是立即购买
  3756 + var bn_goods = this.data.bn_goods;
  3757 + if (bn_goods && bn_goods.prom_type == 0) {
  3758 + bn_goods.is_offline = 0;
  3759 + this.setData({is_offline_show: 0, bn_goods: bn_goods});
  3760 + this.calculatePrice2();
  3761 + }
  3762 + //就是购物车结算时的
  3763 + else {
  3764 + var index = this.data.pop_offline_index;
  3765 + var txt = "cartlist[" + index + "].is_offline";
  3766 + this.setData({[txt]: 0, is_offline_show: 0,})
  3767 + this.data.old_cartlist[index].is_offline = 0;
  3768 + this.calculatePrice();
  3769 + }
  3770 + },
  3771 +
  3772 + //-- 弹出购物车选择是不是要店铺优惠 --
  3773 + cart_pop_offline: function (e) {
  3774 + var index = e.currentTarget.dataset.index;
  3775 + var item = this.data.cartlist[index];
  3776 + var off_price = item.offline_price;
  3777 + //是不是线下
  3778 + var is_get_offline = item.is_offline;
  3779 + this.setData({
  3780 + pop_offline_index: index,
  3781 + is_offline_show: 1,
  3782 + show_off_price: off_price.toFixed(2),
  3783 + is_get_offline: is_get_offline
  3784 + });
  3785 + },
  3786 +
  3787 + // 是否同意预售商品不退定金
  3788 + switchChange(e) {
  3789 + let isSwitchOn = e.detail;
  3790 + }
  3791 +
  3792 +
  3793 +});
... ...
packageC/pages/presell/cart/cart.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
... ...
packageC/pages/presell/cart/cart.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 + <!-- 支付进度 -->
  9 + <view class="information bdr14 mgt20">
  10 + <view class="item ai-center" style="justify-content: flex-start;">
  11 + <view class="pdr20"><text class="iconfont icon-qianbao fs60"></text></view>
  12 + <!-- <view class="">
  13 + <view>等待尾款支付开始</view>
  14 + <view>2021.10.01 00:00:00 - 2021.10.10 23:59:59</view>
  15 + </view> -->
  16 + <view class="">
  17 + <view>等待买家付尾款</view>
  18 + <view class="fs22">请于*天**小时**分**秒内付款完成,超时订单将自动取消</view>
  19 + </view>
  20 + </view>
  21 + <view class="pdb20 flex t-c fs22 c-7b">
  22 + <view class="f1">
  23 + <view>付定金</view>
  24 + <view class="box">
  25 + <text class="iconfont icon-yes"></text>
  26 + </view>
  27 + </view>
  28 + <view class="f1">
  29 + <view>付尾款</view>
  30 + <view class="box line"><text class="circle"></text></view>
  31 + </view>
  32 + <view class="f1">
  33 + <view>商家发货</view>
  34 + <view class="box line"><text class="circle"></text></view>
  35 + </view>
  36 + <view class="f1">
  37 + <view>交易完成</view>
  38 + <view class="box line"><text class="circle"></text></view>
  39 + </view>
  40 + </view>
  41 + </view>
  42 +
  43 + <!-- 退款完成 -->
  44 + <view class="information bdr14 mgt20">
  45 + <view class="item ai-center" style="justify-content: flex-start;">
  46 + <view class="pdr20"><text class="iconfont icon-tkcg fs60"></text></view>
  47 + <view class="">退款完成(定金)</view>
  48 + </view>
  49 + </view>
  50 +
  51 + <!-- 立即购买的时候 -->
  52 + <block wx:if="{{is_b_now==1}}">
  53 + <view class="tab-container">
  54 + <view class="tab-wrapper">
  55 + <view hidden="{{bn_t_exp_t==2}}" bindtap='setexptype' data-t='1' class="tab {{bn_exp_type == 1? 'active':''}}"
  56 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view>
  57 +
  58 + <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}"
  59 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view>
  60 +
  61 + </view>
  62 + </view>
  63 + </block>
  64 + <!-- 购物购买只有一单的时候 -->
  65 + <block wx:if="{{is_b_now==0 && cartlist.length==1}}">
  66 + <view class="tab-container">
  67 + <view class="tab-wrapper">
  68 + <view hidden="{{cartlist[0].distr_t==2}}" bindtap='setexptype_w' data-ind="0" data-t='1' class="tab {{cartlist[0].exp_type == 1? 'active':''}}"
  69 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view>
  70 +
  71 + <view hidden="{{cartlist[0].distr_t==1}}" bindtap='setexptype_w' data-ind="0" data-t='0' class="tab {{cartlist[0].exp_type== 0 ? 'active':''}}"
  72 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view>
  73 +
  74 + </view>
  75 + </view>
  76 + </block>
  77 +
  78 +
  79 + <!--要进行判断地址是否显示---->
  80 + <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'>
  81 + <!---默认地址显示------>
  82 + <block wx:if="{{user_addr!=null}}">
  83 +
  84 + <view class="user-contact">
  85 + <text class="bold fs36 pdr20">{{user_addr.consignee}}</text>
  86 + <text class="fs28">{{user_addr.mobile}}</text>
  87 + </view>
  88 + <view class="location">
  89 + <view class="address fs26 pdt20">
  90 + <view class="pos-icon">
  91 + <image class="wh100 bdr14" src="{{imgUrl}}/miniapp/images/goodscategory/new_position.png"></image>
  92 + </view>
  93 + {{user_addr.more_address}}{{' '}}{{user_addr.address}}
  94 + </view>
  95 +
  96 + </view>
  97 + <view class="update-logistics">
  98 + <!-- <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/new_position.png"></image> -->
  99 + <view class="xc-right"></view>
  100 + </view>
  101 + </block>
  102 + <!---先增地址------>
  103 + <block wx:else>
  104 + <view class="add_new">
  105 + <image class="addr_jia" src="{{imgUrl}}/miniapp/images/jia.png"></image>添加地址
  106 + </view>
  107 + </block>
  108 + <!-- <view class="border-img">
  109 + <image class="wh100" src="{{imgUrl}}/miniapp/images/order/new_dividing_line.png"></image>
  110 + </view> -->
  111 + </view>
  112 +
  113 + <!-- -------------------购物车进来,有可能多单-------------------- -->
  114 + <block wx:if="{{is_b_now==0}}">
  115 + <!-- <view class="xc-border main-top"></view> -->
  116 + <view wx:for="{{cartlist}}" wx:for-index="pidx">
  117 + <view class="use-item bfff bdr_t-14 mgt20">
  118 + <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'></image>
  119 + <!-- <view>门店:{{item.pname}}</view> -->
  120 + <view>{{item.pname}}</view>
  121 + </view>
  122 + <view class="order-detail" wx:for="{{item.goods}}" wx:for-index="idx" wx:for-item="items">
  123 + <!----商品图片----->
  124 + <view class="goods-img" style="position: relative">
  125 + <image wx:if="{{items.is_gift}}" src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image>
  126 + <image class="wh100 bdr14" src="{{items.original_img}}" binderror='cart_set_err' data-err='cartlist[{{pidx}}].goods[{{idx}}].original_img'></image>
  127 + </view>
  128 + <!----商品名称规格---->
  129 + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}">
  130 + <view class="goods-name ellipsis-2">{{items.goods_name}}</view>
  131 + <!-- 商品属性 -->
  132 + <view class="flex-vertical fs28 color-gray n_guige">
  133 + <view class="goods-color">
  134 + <block><text>{{filters.show_gui_ge(items.goods_spec,items.goods_color)}}</text></block>
  135 + <!--<block wx:if="{{!items.goods_spec && !items.goods_color}}"><text>规格1</text></block>-->
  136 + <!--<block wx:else>-->
  137 + <!--<text wx:if="{{items.goods_spec!=''}}">{{items.goods_spec}}<text wx:if="{{items.goods_color}}">/</text></text>-->
  138 + <!--<text wx:if="{{items.goods_color}}">{{items.goods_color}}</text>-->
  139 + <!--</block>-->
  140 + </view>
  141 + </view>
  142 +
  143 +
  144 + <!-----商品名称规格------>
  145 + <view class="order-num flex-space-between">
  146 + <view class="co-red">¥<text class="fs36">{{filters.toFix(items.goods_price,2)}}</text></view>
  147 + <view class="goods-num">x{{items.goods_num}}</view>
  148 + </view>
  149 + </navigator>
  150 + </view>
  151 +
  152 + <!-- 如果是等级卡的商品,会员没有注册,要提醒注册 -->
  153 + <view class="plus_buy fs28" wx:if="{{item.card_cut_price>0}}">
  154 + <view class="flex">
  155 + <view class="card_bg ellipsis-1" style="margin-right: 10rpx;">
  156 + <image src="{{imgUrl}}/miniapp/images/plus/dj_icon.png"></ image>
  157 + <text class="card_name">{{show_card.CardName}}</text>
  158 + </view>
  159 + <view>立减 <text style="color:#f23030;">{{filters.toFix(item.card_cut_price,2) }}</text> 元</view>
  160 + </view>
  161 + <view>
  162 + <text style="color: #999;margin-left: 4rpx;">vip超级会员仅需{{show_card.CardFee}}元</text>
  163 + </view>
  164 + <!-- 三角形 -->
  165 + <view class="car_tri_up"></view>
  166 + <!-- 立即开通跳转 -->
  167 + <view bindtap="buycard" class="card_op">立即开通</view>
  168 + </view>
  169 +
  170 +
  171 + <!-----使用优惠券------>
  172 + <view class="xc-coupon-frame flex-center" data-bn="0" bindtap="open_coupon_list" wx:if="{{(item.quan_list && item.quan_list.length>0) || get_by_quan_list_cart[item.pickup_id]!=null}}"
  173 + data-cind="{{pidx}}" data-pickid="{{item.pickup_id}}">
  174 + <view class="work-frame flex-space-between">
  175 + <view class="work">优惠券<text class="quan_num_show fs20">{{item.can_num}}张可用</text></view>
  176 + <view class="xc-right-frame">
  177 + <text wx:if="{{using_quan[item.pickup_id].is_nouse}}">不使用</text>
  178 + <text wx:if="{{using_quan[item.pickup_id].money}}">¥{{using_quan[item.pickup_id].money}}元优惠券</text>
  179 + <text wx:if="{{using_quan[item.pickup_id].isby}}">包邮券</text>
  180 + <view class="xc-right"></view>
  181 + </view>
  182 + </view>
  183 + </view>
  184 +
  185 +
  186 + <view class="set-mes bdr_b-14">
  187 + <view wx:if="{{order.store_prom}}">
  188 + <icon color="#f23030" size="16" type="info"></icon>
  189 + {{order.store_prom}}
  190 + </view>
  191 +
  192 + <!-- 当是物流很多单的时候 -->
  193 + <view class="use-item flex-space-between" wx:if="{{cartlist.length>1}}">
  194 + <view class="flex-vertical" >
  195 + <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type'
  196 + style="padding-right:26rpx;display:{{item.distr_t==2?'none':'flex;align-items: center'}};">
  197 + <!-- <icon bindtap='setexptype_w' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' color="{{item.exp_type==1?'red':'gray'}}" size="16" type="success"></icon> -->
  198 +
  199 + <block wx:if="{{item.exp_type==1}}">
  200 + <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> -->
  201 + <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon>
  202 + </block>
  203 + <block wx:else>
  204 + <view class="circle xc-hookts on"></view>
  205 + </block>
  206 + <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type' class="yu_er">门店自提</view>
  207 + </view>
  208 +
  209 + <view data-t='0' data-txt='cartlist[{{pidx}}].exp_type' data-ind="{{pidx}}" bindtap="setexptype_w" style="display:{{item.distr_t==1?'none':'flex;align-items: center'}};">
  210 + <!-- <icon bindtap='setexptype_w' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="{{item.exp_type==0?'red':'gray'}}" size="16" type="success"></icon> -->
  211 + <block wx:if="{{item.exp_type==0}}">
  212 + <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> -->
  213 + <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon>
  214 + </block>
  215 + <block wx:else>
  216 + <view class="circle xc-hookts on"></view>
  217 + </block>
  218 +
  219 + <view bindtap='setexptype_w' data-t='0' data-ind="{{pidx}}" data-txt='cartlist[{{pidx}}].exp_type' data-wl_txt='cartlist[{{pidx}}].wind'
  220 + class="yu_er">快递邮寄</view>
  221 + </view>
  222 + </view>
  223 +
  224 +
  225 + <!-- 点击显示物流选择,如果是默认使用的情况不成立 -->
  226 + <view wx:if="{{!is_default_logistics && item.exp_type!=1}}" class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;">
  227 + <view>{{wu_arr[item.wind].name}}</view>
  228 + <view class="xc-right"></view>
  229 + </view>
  230 +
  231 + </view>
  232 +
  233 + <!-- 当是物流,只有一单的时候 -->
  234 + <block wx:else >
  235 + <view class="use-item flex-space-between" wx:if="{{item.exp_type==0 && !is_default_logistics}}">
  236 + <view class="flex jc_sb" style="width: 100%; padding: 0 13rpx;">
  237 + <view>选择物流</view>
  238 + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;">
  239 + <view>{{wu_arr[item.wind].name}}</view>
  240 + <view class="xc-right"></view>
  241 + </view>
  242 + </view>
  243 + </view>
  244 + </block>
  245 +
  246 +
  247 + </view>
  248 +
  249 + <!-- 留言 -->
  250 + <view class="coupon-mes flex-vertical">
  251 + <view>留言</view>
  252 + <view class="leave-word">
  253 + <input placeholder-class="fs28" placeholder='给商家留言,最多100字' bindinput="keyUpChangeNum" disabled="{{disabled}}"
  254 + class="word-box" maxlength="100" name="user_note_{{item.pickup_id}}"></input>
  255 +
  256 + </view>
  257 + </view>
  258 +
  259 + <!-- 是否参与店铺优惠 -->
  260 + <view class="coupon-mes flex-vertical" data-index="{{index}}" bindtap="cart_pop_offline" wx:if="{{item.offline_price}}">
  261 + <view>店铺优惠</view>
  262 + <view class="leave-word fs32" style="color: #999;">
  263 + 省{{filters.toFix(item.offline_price,2)}}元
  264 + </view>
  265 + <block wx:if="{{item.is_offline}}">
  266 + <text style="color: #d7642b;">-¥{{filters.toFix(item.offline_price,2)}}</text>
  267 + </block>
  268 + <block wx:else>
  269 + <text style="color: #d7642b;">不使用优惠</text>
  270 + </block>
  271 + <!-- 右边点击 -->
  272 + <view class="xc-right" style="margin-right: 12rpx; border-color: #d7642b;"></view>
  273 + </view>
  274 +
  275 + </view>
  276 +
  277 + <!-- ---使用余额---- -->
  278 + <view class="set-mes bdr_t-14" wx:if="{{yuer>0}}">
  279 + <view class="use-item" bindtap='set_js_useyuer'>
  280 + <icon color="{{js_use_money?'red':'gray'}}" size="16" type="success"></icon>
  281 + <view class="yu_er">使用余额 :¥{{yuer}} </view>
  282 + </view>
  283 + </view>
  284 +
  285 + </block>
  286 +
  287 + <!-- ----立即购买------ -->
  288 + <!-- <view class="xc-border xc-border"></view> -->
  289 + <block wx:if="{{is_b_now==1}}">
  290 + <view class="use-item bfff bdr_t-14 mgt20">
  291 + <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image>
  292 + <view>{{bn_pickname}}</view>
  293 + <!-- <view>门店:{{bn_pickname}}</view> -->
  294 + </view>
  295 + <view class="order-detail">
  296 + <view class="goods-img">
  297 + <image class="wh100 bdr14" src="{{bn_goods.original_img}}" binderror='cart_set_err' data-err="bn_goods.original_img"></image>
  298 + </view>
  299 + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}">
  300 + <view class="goods-name ellipsis-2">{{bn_goods.goods_name}}</view>
  301 + <!-- 商品属性 -->
  302 + <view class="flex-vertical fs28 xc-ash color-gray n_guige">
  303 + <view class="goods-color">
  304 + <block><text>{{filters.show_gui_ge(bn_goods.goods_spec,bn_goods.goods_color)}}</text></block>
  305 + <!--<block wx:if="{{!bn_goods.goods_spec && !bn_goods.goods_color}}"><text>规格1</text></block>-->
  306 + <!--<block wx:else>-->
  307 + <!--<text wx:if="{{bn_goods.goods_spec!=''}}">{{bn_goods.goods_spec}}<text wx:if="{{bn_goods.goods_color}}">/</text></text>-->
  308 + <!--<text wx:if="{{bn_goods.goods_color}}">{{bn_goods.goods_color}}</text>-->
  309 + <!--</block>-->
  310 + </view>
  311 + </view>
  312 +
  313 + <!-- ---商品名称规格---- -->
  314 + <view class="order-num flex-space-between">
  315 + <view class="co-red">¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></view>
  316 + <view class="goods-num">x{{bn_goods.buynum}}</view>
  317 + </view>
  318 + </navigator>
  319 +
  320 + </view>
  321 + <!-- 赠品的显示 -->
  322 + <view class="order-detail" wx:if="{{buy_now_gift_goods}}">
  323 + <view class="goods-img" style="position: relative">
  324 + <image src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image>
  325 +
  326 + <image class="wh100 bdr14" src="{{buy_now_gift_goods.original_img}}" binderror='cart_set_err' data-err="buy_now_gift_goods.original_img"></image>
  327 + </view>
  328 + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{buy_now_gift_goods.goods_id}}">
  329 + <view class="goods-name ellipsis-2">{{buy_now_gift_goods.goods_name}}</view>
  330 + <!-- 商品属性 -->
  331 + <view class="flex-vertical fs28 xc-ash color-gray n_guige">
  332 + <view class="goods-color">
  333 + <block><text>{{filters.show_gui_ge(buy_now_gift_goods.goods_spec,buy_now_gift_goods.goods_color)}}</text></block>
  334 + </view>
  335 + </view>
  336 + <!-- ---商品名称规格---- -->
  337 + <view class="order-num flex-space-between">
  338 + <view class="co-red">¥<text class="fs36">0</text></view>
  339 + <view class="goods-num">x{{buy_now_gift_goods.buynum}}</view>
  340 + </view>
  341 + </navigator>
  342 + </view>
  343 +
  344 +
  345 + <block wx:if="{{collocation_goods}}">
  346 + <!-- 搭配购买的功能实现 -->
  347 + <view class="order-detail" wx:for="{{collocation_goods}}">
  348 + <view class="goods-img">
  349 + <image class="wh100 bdr14" src="{{imgUrl+item.original_img}}" binderror='err_img_collocation' data-err="item.original_img"></image>
  350 + </view>
  351 + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">
  352 + <view class="goods-name ellipsis-2">{{item.goods_name}}</view>
  353 + <!-- 商品属性 -->
  354 + <view class="flex-vertical fs28 xc-ash color-gray n_guige">
  355 + <view class="goods-color">
  356 + <block><text>{{filters.show_gui_ge(item.goods_spec,item.goods_color)}}</text></block>
  357 + </view>
  358 + </view>
  359 + <!-- ---商品名称规格---- -->
  360 + <view class="order-num flex-space-between">
  361 + <view class="co-red">¥<text class="fs36">{{item.price}}</text></view>
  362 + <view class="goods-num">x{{item.goods_num}}</view>
  363 + </view>
  364 + </navigator>
  365 + </view>
  366 + </block>
  367 +
  368 + <!-- 如果是等级卡的商品,会员没有注册,要提醒注册 -->
  369 + <view class="plus_buy fs28" wx:if="{{card_cut_price>0}}">
  370 + <view class="flex">
  371 + <view class="card_bg ellipsis-1" style="margin-right: 10rpx;">
  372 + <image src="{{imgUrl}}/miniapp/images/plus/dj_icon.png"></ image>
  373 + <text class="card_name">{{show_card.CardName}}</text>
  374 + </view>
  375 + <view>立减 <text style="color:#f23030;">{{filters.toFix(card_cut_price,2) }}</text> 元</view>
  376 + </view>
  377 + <view>
  378 + <text style="color: #999;margin-left: 4rpx;">vip超级会员仅需{{show_card.CardFee}}元</text>
  379 + </view>
  380 + <!-- 三角形 -->
  381 + <view class="car_tri_up"></view>
  382 + <!-- 立即开通跳转 -->
  383 + <view bindtap="buycard" class="card_op">立即开通</view>
  384 + </view>
  385 +
  386 +
  387 + <view class="set-mes bdr_b-14">
  388 + <view wx:if="{{order.store_prom}}">
  389 + <icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}}
  390 + </view>
  391 +
  392 + <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}}">
  393 + <view class="work-frame flex-space-between">
  394 + <view class="work">
  395 + 优惠券 <text class="quan_num_show">{{(selected_quan_list?selected_quan_list.length:0)+ (get_by_quan_list?get_by_quan_list.length:0)}}张可用</text>
  396 + </view>
  397 + <view class="xc-right-frame">
  398 + <text wx:if="{{using_quan[bn_pick].is_nouse}}">不使用</text>
  399 + <block wx:else>
  400 + <text wx:if="{{using_quan[bn_pick].money}}">¥{{using_quan[bn_pick].money}}元优惠券</text>
  401 + <text wx:if="{{using_quan[bn_pick].isby}}">包邮券</text>
  402 + </block>
  403 + <view class="xc-right"></view>
  404 + </view>
  405 + </view>
  406 + </view>
  407 +
  408 + <view class="xc-coupon-frame" wx:if="{{bn_exp_type==0 && !is_default_logistics}}">
  409 + <view class="flex-space-between" style="padding: 20rpx 25rpx; font-size: 30rpx;">
  410 + <view>选择物流</view>
  411 + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index' style="margin-right: 12rpx;">
  412 + <view class="logistics-name">{{wu_arr[index].name}}</view>
  413 + <view class="xc-right"></view>
  414 + </view>
  415 + </view>
  416 + </view>
  417 + </view>
  418 + <!-- 留言 -->
  419 + <view class="coupon-mes flex-vertical">
  420 + <view>留言</view>
  421 + <view class="leave-word">
  422 + <input placeholder-class="fs28" placeholder='给商家留言,最多100字' bindinput="keyUpChangeNum" disabled="{{disabled}}"
  423 + class="word-box" maxlength="100" name="user_note"></input>
  424 + </view>
  425 + </view>
  426 +
  427 + <!-- 是否参与店铺优惠 -->
  428 + <view class="coupon-mes flex-vertical" bindtap="bn_pop_offline" wx:if="{{bn_goods.offline_price}}">
  429 + <view>店铺优惠</view>
  430 + <view class="leave-word fs32" style="color: #999;">
  431 + 省{{filters.toFix(bn_goods.shop_price-bn_goods.offline_price,2)}}元
  432 + </view>
  433 + <block wx:if="{{bn_goods.is_offline}}">
  434 + <text style="color: #d7642b;">-¥{{filters.toFix(bn_goods.shop_price-bn_goods.offline_price,2)}}</text>
  435 + </block>
  436 + <block wx:else>
  437 + <text style="color: #d7642b;">不使用优惠</text>
  438 + </block>
  439 + <!-- 右边点击 -->
  440 + <view class="xc-right" style="margin-right: 12rpx; border-color: #d7642b;"></view>
  441 + </view>
  442 +
  443 +
  444 + <!-----使用余额------>
  445 + <view class="set-mes bdr_t-14" wx:if="{{yuer>0}}">
  446 + <view class="use-item" bindtap='set_bn_useyuer'>
  447 + <icon color="{{bn_use_money?'red':'gray'}}" size="16" type="success"></icon>
  448 + <view class="yu_er">使用余额 :¥{{yuer}} </view>
  449 + </view>
  450 + </view>
  451 +
  452 + </block>
  453 +
  454 + <view class="information bdr14">
  455 + <view class="item" wx:if="{{formData.all_price>0}}">
  456 + <view>商品金额</view>
  457 + <view class="co-red">¥ {{formData.all_price}}元</view>
  458 + </view>
  459 + <view class="item" wx:if="{{formData.shipping_price>0}}">
  460 + <view>配送费用</view>
  461 + <view class="co-red">¥ {{formData.shipping_price}}元</view>
  462 + </view>
  463 + <view class="item" wx:if="{{formData.coupon_price>0}}">
  464 + <view>使用优惠券</view>
  465 + <view class="co-red">- ¥ {{formData.coupon_price}}元</view>
  466 + </view>
  467 + <!-- 优惠活动优惠金额 -->
  468 + <view class="item" wx:if="{{formData.cut_price>0}}">
  469 + <view>优惠活动</view>
  470 + <view class="co-red">- ¥ {{filters.toFix(formData.cut_price,2)}}元</view>
  471 + </view>
  472 + <!-- 组合购优惠金额 -->
  473 + <view class="item" wx:if="{{formData.zh_cut_price>0 || formData.zh_cut_price<0}}">
  474 + <view>组合购优惠</view>
  475 + <view class="co-red">- ¥ {{filters.toFix(formData.zh_cut_price,2)}}元</view>
  476 + </view>
  477 +
  478 + <!-- 订单优惠优惠金额 -->
  479 + <view class="item" wx:if="{{formData.order_prom_amount>0}}">
  480 + <view>订单优惠</view>
  481 + <view class="co-red">- ¥ {{filters.toFix(formData.order_prom_amount,2)}}元</view>
  482 + </view>
  483 + <view class="item" wx:if="{{formData.user_money>0}}">
  484 + <view>使用余额</view>
  485 + <view class="co-red">- ¥ {{formData.user_money}}元</view>
  486 + </view>
  487 + </view>
  488 +
  489 + <view class="information bdr14 mgt20">
  490 + <view class="item">
  491 + <view>阶段一:定金(待付款)</view>
  492 + <view class="co-red">¥9.99元</view>
  493 + </view>
  494 + <view class="item">
  495 + <view>阶段二:尾款</view>
  496 + <view class="co-red">¥88元</view>
  497 + </view>
  498 + </view>
  499 +
  500 + <view class="information bdr14 mgt20">
  501 + <view class="item ai-center">
  502 + <view>我同意预售商品不退定金</view>
  503 + <switch type="switch" checked="" bindchange="switchChange"/>
  504 + </view>
  505 + </view>
  506 +
  507 + </view>
  508 +
  509 + <view class="fixedToBottom shadow-1" wx:if="{{show_submit}}">
  510 + <!-- <view class="date-container">尾款时间:2021.10.01 00:00:00 - 2021.10.10 23:59:59</view> -->
  511 + <view class="date-container">请于*天**小时**分**秒内付款完成,超时订单将自动取消</view>
  512 + <view class="btn-wrap">
  513 + <view class="pay-amount">
  514 + <view class="payable">应付金额:<text class="co-red"><text class="fs24">¥</text>{{formData.order_amount}}</text></view>
  515 + <!-- 预售 -->
  516 + <!-- <view class="payable">尾款:<text class="co-red"><text class="fs24">¥</text>{{formData.order_amount}}</text></view> -->
  517 + </view>
  518 + <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button>
  519 + <!-- 预售 -->
  520 + <!-- <button class="tips-btn" formType="submit" id="submitOrder">立即支付</button> -->
  521 + </view>
  522 + </view>
  523 +</form>
  524 +
  525 +<!-- 使用券列表的弹窗 -->
  526 +<view wx:if='{{open_quan==1}}'>
  527 + <view class="cover-layer flex-center " bindtap='close_coupon'> </view>
  528 + <view class="cx-popup {{open_quan==true?'up' : 'down'}}">
  529 + <!-- 最上面 -->
  530 + <view class="top flex">
  531 + <view class="xc-top-content t-c">
  532 + <view class="xc-title">优惠券使用</view>
  533 + </view>
  534 + <view class="xc-close-frame" bindtap='close_coupon'>
  535 + <view class="xc-close">×</view>
  536 + </view>
  537 + </view>
  538 + <!-- 使用优惠券和不使用优惠券层-->
  539 + <view class="may_use_coupon fs28 flex"> 可使用的优惠券
  540 + <view class=" is_use_coupon flex-vertical" bindtap="sele_quan_item" data-no="1">不使用优惠券
  541 + <block wx:if="{{using_quan[selected_quan_pick].is_nouse_red}}">
  542 + <view class="circle white xc-hooka fs20 red-b sn"><text>Γ</text></view>
  543 + </block>
  544 + <block wx:else>
  545 + <view class="circle xc-hookst ons"></view>
  546 + </block>
  547 + </view>
  548 + </view>
  549 +
  550 + <!-- 中间券内容显示 -->
  551 + <view class="xc-frame flex-level">
  552 + <view class="list-frame">
  553 + <view wx:for="{{selected_quan_list}}" bindtap="sele_quan_item" wx:if="{{!item.is_using}}" data-ind="{{q_index}}"
  554 + wx:for-item="item" wx:for-index="q_index">
  555 + <view class="xc-coupon-frame flex-center" data-ind="{{q_index}}">
  556 + <view class="coupon-frame flex rel">
  557 + <!-- 锯齿 -->
  558 + <include src="juchi_part.wxml" />
  559 + <!-- 左边 -->
  560 + <view class="coupon-left rel {{filter.setcolor(item.UseObjectType)}} flex-center">
  561 + <view class="white xc-money-frames">
  562 + <view class="f_text"><text class="xc-rmb-symbol">¥</text><text class="xc-rmb-val">{{item.Sum}}</text></view>
  563 + <view class="coupon-explain t-c" wx:if="{{item.BuySum>0}}">满{{item.BuySum}}元可用</view>
  564 + <view class="coupon-explain t-c" wx:else>满0元可用</view>
  565 + </view>
  566 + </view>
  567 + <!-- 右边 -->
  568 + <view class="coupon-right flex-center rel">
  569 + <view class="coupon-annotation flex">
  570 + <view class="flex top-frame">
  571 + <view class="frame">
  572 + <view class="coupon-wode ib flex ellipsis-2 ">
  573 + <text class="xc-brand t-c ib white {{filter.setcolor(item.UseObjectType)}}">{{filter.get_type_card(item.UseObjectType)}}</text>
  574 + <block>{{item.Sum}}元优惠券</block>
  575 + </view>
  576 + <view class="coupon-time">{{filters.replace_time2(item.BeginDate)}}至{{item.ValidDate?filters.replace_time2(item.ValidDate):'不限'}}</view>
  577 + </view>
  578 + </view>
  579 + <block wx:if="{{item.show_red}}">
  580 + <view class="circle white xc-hook fs20 red-b sn"><text>Γ</text></view>
  581 + </block>
  582 + <block wx:else>
  583 + <view class="circle xc-hooks on"></view>
  584 + </block>
  585 + </view>
  586 + <include src="remark_click_part.wxml" />
  587 + </view>
  588 + </view>
  589 + </view>
  590 + <!-- 打开是说明 -->
  591 + <include src="remark_part.wxml" />
  592 + </view>
  593 + <!-- 包邮券的显示,立即购买 -->
  594 + <block wx:if="{{ is_b_now && bn_exp_type==0}}">
  595 + <view wx:for="{{get_by_quan_list}}" bindtap="sele_quan_item_by" wx:if="{{!item.is_using}}" data-ind="{{byq_index}}"
  596 + wx:for-item="item" wx:for-index="byq_index">
  597 + <view class="xc-coupon-frame flex-center" data-ind="{{byq_index}}">
  598 + <view class="coupon-frame flex rel">
  599 + <!-- 锯齿 -->
  600 + <include src="juchi_part.wxml" />
  601 + <!-- 左边 -->
  602 + <view class="coupon-left rel {{filter.setcolor(item.UseObjectType)}} flex-center">
  603 + <view class="white xc-money-frames">
  604 + <view class="f_text"><text class="xc-rmb-val">包邮券</text></view>
  605 + <view class="coupon-explain t-c" wx:if="{{item.condition>0}}">满{{item.condition}}元可用</view>
  606 + <view class="coupon-explain t-c" wx:else>满0元可用</view>
  607 + </view>
  608 + </view>
  609 + <!-- 右边 -->
  610 + <view class="coupon-right flex-center rel">
  611 + <view class="coupon-annotation flex">
  612 + <view class="flex top-frame">
  613 + <view class="frame">
  614 + <view class="coupon-wode ib flex ellipsis-2 ">
  615 + <text class="xc-brand t-c ib white {{filter.setcolor(item.UseObjectType)}}">{{filter.get_type_card(0)}}</text>
  616 + <block>包邮券</block>
  617 + </view>
  618 + <view class="coupon-time">{{filters.format_time(item.use_start_time)}}至{{item.use_end_time?filters.format_time(item.use_end_time):'不限'}}</view>
  619 + </view>
  620 + </view>
  621 + <block wx:if="{{item.show_red}}">
  622 + <view class="circle white xc-hook fs20 red-b sn"><text>Γ</text></view>
  623 + </block>
  624 + <block wx:else>
  625 + <view class="circle xc-hooks on"></view>
  626 + </block>
  627 + </view>
  628 + <include src="remark_click_part2.wxml" />
  629 + </view>
  630 + </view>
  631 + </view>
  632 + <!-- 打开是说明 -->
  633 + <include src="remark_part.wxml" />
  634 + </view>
  635 + </block>
  636 +
  637 + <!-- 包邮券的显示,购物车购买 -->
  638 + <block wx:if="{{!is_b_now && sele_exp_type==0}}">
  639 + <view wx:for="{{by_quan_list_cart}}" bindtap="sele_quan_item_by" wx:if="{{!item.is_using}}" data-ind="{{byq_index}}"
  640 + wx:for-item="item" wx:for-index="byq_index">
  641 + <view class="xc-coupon-frame flex-center" data-ind="{{byq_index}}">
  642 + <view class="coupon-frame flex rel">
  643 + <!-- 锯齿 -->
  644 + <include src="juchi_part.wxml" />
  645 + <!-- 左边 -->
  646 + <view class="coupon-left rel {{filter.setcolor(item.UseObjectType)}} flex-center">
  647 + <view class="white xc-money-frames">
  648 + <view class="f_text"><text class="xc-rmb-val">包邮券</text></view>
  649 + <view class="coupon-explain t-c" wx:if="{{item.condition>0}}">满{{item.condition}}元可用</view>
  650 + <view class="coupon-explain t-c" wx:else>满0元可用</view>
  651 + </view>
  652 + </view>
  653 + <!-- 右边 -->
  654 + <view class="coupon-right flex-center rel">
  655 + <view class="coupon-annotation flex">
  656 + <view class="flex top-frame">
  657 + <view class="frame">
  658 + <view class="coupon-wode ib flex ellipsis-2 ">
  659 + <text class="xc-brand t-c ib white {{filter.setcolor(item.UseObjectType)}}">{{filter.get_type_card(0)}}</text>
  660 + <block>包邮券</block>
  661 + </view>
  662 + <view class="coupon-time">{{filters.format_time(item.use_start_time)}}至{{item.use_end_time?filters.format_time(item.use_end_time):'不限'}}</view>
  663 + </view>
  664 + </view>
  665 + <block wx:if="{{item.show_red}}">
  666 + <view class="circle white xc-hook fs20 red-b sn"><text>Γ</text></view>
  667 + </block>
  668 + <block wx:else>
  669 + <view class="circle xc-hooks on"></view>
  670 + </block>
  671 + </view>
  672 + <include src="remark_click_part2.wxml" />
  673 + </view>
  674 + </view>
  675 + </view>
  676 + <!-- 打开是说明 -->
  677 + <include src="remark_part.wxml" />
  678 + </view>
  679 + </block>
  680 +
  681 +
  682 + </view>
  683 + </view>
  684 + <!-- 最底下确定层-->
  685 + <view class="determine-frame">
  686 + <view class="xc-confirm flex-center" bindtap="confirm_quan"> 确定 </view>
  687 + </view>
  688 + </view>
  689 +</view>
  690 +<!----弹起选择物流名的列表---->
  691 +<view wx:if='{{open_express==1}}'>
  692 + <view class="cover-layer flex-center " bindtap='close_express'>
  693 + </view>
  694 +
  695 + <view class="cx-popup radius {{open_express==1?'up' : 'down'}}">
  696 + <view class="tops flex">
  697 + <view class="top-content fs32">
  698 + <view>选择物流名字</view>
  699 + </view>
  700 + <view class="close-frame" bindtap='close_express'>
  701 + <view class="xc-close-express">×</view>
  702 + </view>
  703 + </view>
  704 + <view class="express_list">
  705 + <view wx:for="{{wu_arr}}" wx:for-item="express_list" wx:for-index="idx">
  706 + <view class="express_list_frame" bindtap="click_express_name" data-shippingcode="{{express_list.shipping_code}}"
  707 + data-name="{{express_list.name}}" data-idxe="{{idx}}">
  708 +
  709 + <block wx:if="{{is_express==idx}}">
  710 + <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view>
  711 + </block>
  712 + <block wx:else>
  713 + <view class="circle xc-hooks"></view>
  714 + </block>
  715 + <view class="fs30">{{express_list.name}}</view>
  716 +
  717 + </view>
  718 + </view>
  719 + </view>
  720 + <view class="flex click-buttem">
  721 + <view class="xc-determine flex-center" bindtap="determine_expres">
  722 + <view class="flex-vertical t-c">确定</view>
  723 + </view>
  724 + <view class="xc-confirms flex-center" bindtap="select_default_logistics">
  725 + <view class="flex-vertical t-c">设为默认</view>
  726 + </view>
  727 + </view>
  728 +
  729 + </view>
  730 +</view>
  731 +<warn id="warn"></warn>
  732 +<!-- 是不是使用店铺优惠pop -->
  733 +<view class="cover-layer flex ai-center" bindtap="close_offline" wx:if="{{is_offline_show}}">
  734 + <view style="background-color: #fff; width: 540rpx; margin: 0 auto; border-radius: 20rpx;">
  735 + <view class="fs32" style="text-align: center;height: 80rpx; line-height: 80rpx;">店铺优惠</view>
  736 + <view class="flex jc_sb ai-center fs28" style="height: 80rpx; width: 400rpx; margin-left: 70rpx;">
  737 + <view catchtap="sure_offline" class="flex ai-center" >优惠¥{{show_off_price}}
  738 + <icon style="margin-left: 10rpx;" color="{{is_get_offline?'red':'gray'}}" size="14" type="success" role="img"></icon></view>
  739 + <view catchtap="cancle_offline" class="flex ai-center" >不用优惠
  740 + <icon style="margin-left: 10rpx;" color="{{is_get_offline!=1?'red':'gray'}}" size="14" type="success" role="img"></icon> </view>
  741 + </view>
  742 + </view>
  743 +</view>
  744 +
  745 +<!-- 客服 -->
  746 +<view class="kefu-container shadow-1">
  747 + <text class="iconfont icon-kefu fs60 co-red"></text>
  748 +</view>
... ...
packageC/pages/presell/cart/cart.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 +
  24 +
  25 +page {
  26 + /* background-color: #FAFAFA; */
  27 + background-color: #F0F0F0;
  28 + padding: 0 22rpx;
  29 + box-sizing: border-box;
  30 +}
  31 +.container {
  32 + background-color: #F0F0F0;
  33 + /* padding-top: 28rpx; */
  34 + padding-bottom: 280rpx;
  35 +}
  36 +
  37 +.tab-container {
  38 + font-size: 28rpx;
  39 + margin-top: 20rpx;
  40 + display: flex;
  41 +}
  42 +
  43 +.tab-wrapper {
  44 + background-color: #ccc;
  45 + display: flex;
  46 + border-radius: 40rpx;
  47 + overflow: hidden;
  48 +}
  49 +
  50 +.tab {
  51 + padding: 20rpx 30rpx;
  52 +
  53 +}
  54 +
  55 +
  56 +.tab.active {
  57 + background-color: white;
  58 + border-radius: 40rpx;
  59 +}
  60 +
  61 +
  62 +.user-mes {
  63 + position: relative;
  64 + background-color: #fff;
  65 + font-size: 32rpx;
  66 + color: #444;
  67 + /* margin-top: 28rpx; */
  68 + border-radius: 14rpx;
  69 + padding: 20rpx 70rpx 20rpx 20rpx;
  70 +}
  71 +.user-contact {
  72 + /* padding: 24rpx 26rpx;
  73 + font-weight: 600; */
  74 +}
  75 +
  76 +.location {
  77 + position: relative;
  78 + /* padding: 0 70rpx 24rpx; */
  79 +}
  80 +
  81 +.pos-icon {
  82 + /* position: absolute; */
  83 + /* left: 28rpx;
  84 + top: 6rpx; */
  85 + width: 20rpx;
  86 + height: 24rpx;
  87 + display: inline-block;
  88 +}
  89 +
  90 +.border-img {
  91 + width: 100%;
  92 + height: 12rpx;
  93 +}
  94 +
  95 +.update-logistics {
  96 + position: absolute;
  97 + right: 0;
  98 + top: 0;
  99 + width: 80rpx;
  100 + height: 100%;
  101 + display: flex;
  102 + align-items: center;
  103 + justify-content: center;
  104 +}
  105 +
  106 +.arrow-rigth {
  107 + width: 32rpx;
  108 + height: 32rpx;
  109 +}
  110 +
  111 +.order-meg {
  112 + margin-bottom: 20rpx;
  113 + font-size: 28rpx;
  114 +
  115 +}
  116 +
  117 +.order-detail {
  118 + padding: 30rpx 0;
  119 + border-bottom: 2rpx solid #eee;
  120 + color: #777;
  121 + min-height: 190rpx;
  122 + background-color: #fff;
  123 +
  124 +}
  125 +
  126 +.goods-img {
  127 + float: left;
  128 + width: 200rpx;
  129 + height: 200rpx;
  130 + margin: 0 20rpx;
  131 +}
  132 +
  133 +.order-cont {
  134 + float: left;
  135 + width: 438rpx;
  136 +}
  137 +
  138 +.goods-name {
  139 + height: 74rpx;
  140 + line-height: 40rpx;
  141 + overflow: hidden;
  142 + margin-bottom: 16rpx;
  143 + font-size: 28rpx;
  144 + color: #333;
  145 +
  146 +}
  147 +
  148 +.goods-color {
  149 + font-size: 24rpx;
  150 +}
  151 +
  152 +.order-num {
  153 + margin-top: 25rpx;
  154 + font-size: 24rpx;
  155 + line-height: 42rpx;
  156 +}
  157 +
  158 +.set-mes{
  159 + background-color: #fff;
  160 + /* margin-top: 20rpx; */
  161 +}
  162 +.use-item{
  163 + display: flex;
  164 + align-items: center;
  165 + /* height: 80rpx; */
  166 + /* border-bottom: 1px solid #ddd; */
  167 + font-size: 26rpx;
  168 + /* width:95%;
  169 +margin:auto; */
  170 + padding: 20rpx;
  171 +}
  172 +.use-item>view{
  173 + display: flex;
  174 + /* margin-right: 12rpx; */
  175 +}
  176 +.use-item.bfff{
  177 + background-color: #fff;
  178 +}
  179 +.use-item .dp{
  180 + display: block;
  181 + width: 40rpx;
  182 + height: 40rpx;
  183 + /* margin-left: -6rpx; */
  184 +}
  185 +
  186 +.set-item {
  187 + justify-content: space-between;
  188 + background-color: #fff;
  189 +}
  190 +
  191 +.set-btn {
  192 + display: flex;
  193 + font-size: 24rpx;
  194 +}
  195 +
  196 +.set-mes input {
  197 + width: 380rpx;
  198 + height: 50rpx;
  199 + line-height: 50rpx;
  200 + border: 1px solid #ddd;
  201 +}
  202 +
  203 +.use-btn {
  204 + width: 100rpx;
  205 + height: 50rpx;
  206 + margin-left: 20rpx;
  207 + line-height: 50rpx;
  208 + text-align: center;
  209 + background-color: #f23030;
  210 + color: #fff;
  211 +}
  212 +
  213 +.coupon-mes {
  214 + /* box-sizing: border-box; */
  215 + /* height:95rpx; */
  216 + padding: 20rpx;
  217 + background-color: #fff;
  218 + font-size: 30rpx;
  219 + /* color: #444; */
  220 + /* width: 100%; */
  221 + border-radius: 14rpx;
  222 + margin-top: 20rpx;
  223 + margin-bottom: 20rpx;
  224 +}
  225 +
  226 +.coupon-title {
  227 + display: flex;
  228 + justify-content: space-between;
  229 + align-items: center;
  230 + height: 92rpx;
  231 +}
  232 +
  233 +.coupon-title>view {
  234 + display: flex;
  235 +}
  236 +
  237 +.coupon-num {
  238 + height: 36rpx;
  239 + margin-left: 20rpx;
  240 + padding: 0 16rpx;
  241 + line-height: 36rpx;
  242 + text-align: center;
  243 + background-color: #f23030;
  244 + color: #fff;
  245 + font-size: 24rpx;
  246 +}
  247 +
  248 +.leave-word {
  249 + position: relative;
  250 + font-size: 24rpx;
  251 + margin-left: 20rpx;
  252 + flex-grow: 1;
  253 +}
  254 +
  255 +.word-box {
  256 + font-size: 26rpx;
  257 + /* width: 600rpx; */
  258 + /* padding: 10rpx;
  259 + height: 28rpx;
  260 + line-height: 40rpx; */
  261 +}
  262 +
  263 +.max-word {
  264 + position: absolute;
  265 + right: 0;
  266 + bottom: 0;
  267 +}
  268 +
  269 +.information {
  270 + /* padding: 20rpx; */
  271 + background-color: #fff;
  272 + /* margin-bottom: 120rpx; */
  273 +}
  274 +
  275 +.information .item {
  276 + display: flex;
  277 + justify-content: space-between;
  278 + /* height: 60rpx;
  279 + line-height: 60rpx; */
  280 + font-size: 24rpx;
  281 + /* color: #333; */
  282 + padding: 20rpx;
  283 +}
  284 +
  285 +.btn-wrap {
  286 + height: 94rpx;
  287 + box-sizing: border-box;
  288 + display: flex;
  289 + flex-wrap: wrap;
  290 + justify-content: space-between;
  291 + background-color: white;
  292 + align-items: center;
  293 +
  294 + padding: 0 30rpx;
  295 +}
  296 +
  297 +.fixedToBottom {
  298 + position: fixed;
  299 + bottom: 0;
  300 + left: 0;
  301 + width: 100%;
  302 +}
  303 +
  304 +.tips-btn {
  305 + /* float: right;
  306 + width: 200rpx;
  307 + height: 100rpx;
  308 + line-height: 100rpx;
  309 + text-align: center;
  310 + font-size: 30rpx;
  311 + color: #fff;
  312 + background-color: #f23030; */
  313 + color: white;
  314 + background-color: #FE4445;
  315 + height: 72rpx;
  316 + line-height: 72rpx;
  317 + padding: 0 42rpx;
  318 + border-radius: 36rpx;
  319 + margin-left: 0;
  320 + margin-right: 0;
  321 +}
  322 +
  323 +.pay-amount {
  324 + /* float: right;
  325 + display: flex;
  326 + align-items: center;
  327 + height: 100rpx;
  328 + font-size: 26rpx;
  329 + margin-right: 40rpx; */
  330 +}
  331 +
  332 +.payable {
  333 + color: #444;
  334 + /* margin-right: 20rpx; */
  335 +}
  336 +
  337 +.shipping-modal {
  338 + z-index: 20;
  339 + position: fixed;
  340 + bottom: 0;
  341 + left: 0;
  342 + right: 0;
  343 + overflow-y: hidden;
  344 + color: #666666;
  345 + background-color: white;
  346 +}
  347 +
  348 +.shipping-nav {
  349 + text-align: center;
  350 + font-size: 35rpx;
  351 + padding-top: 30rpx;
  352 +}
  353 +
  354 +.shipping-list {
  355 + padding: 20rpx 30rpx 40rpx;
  356 + font-size: 28rpx;
  357 +}
  358 +
  359 +.shipping-item {
  360 + display: block;
  361 + padding: 20rpx 0;
  362 +}
  363 +
  364 +.shipping-btn {
  365 + width: 100%;
  366 + color: white;
  367 + background-color: #f23030;
  368 + line-height: 90rpx;
  369 + text-align: center;
  370 + font-size: 40rpx;
  371 +}
  372 +
  373 +/*----------nyf新增,地址---------*/
  374 +.add_new{
  375 + height: 90rpx;
  376 + display: flex;
  377 + align-items: center;
  378 + padding: 0 26rpx;
  379 +}
  380 +.addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd;
  381 + margin-right: 15rpx;vertical-align: middle;}
  382 +.yu_er{
  383 + margin-left: 10rpx;
  384 + /* margin-right: 60rpx; */
  385 +}
  386 +.wuliu{margin-left: 20rpx;}
  387 +
  388 +
  389 +/*---- 优惠券列表 -----*/
  390 +.xc-coupon-frame{
  391 + width: 100%;
  392 + height: 92rpx;
  393 +
  394 +}
  395 +.xc-coupon-frame .work-frame{
  396 + width: 100%;
  397 + height: 100%;
  398 + border-bottom:3rpx solid #eee;
  399 + padding: 0 26rpx;
  400 + background-color: white;
  401 +}
  402 +.xc-right{
  403 + width:12rpx;
  404 + height:12rpx;
  405 + border-top:2rpx solid #000;
  406 + border-right:2rpx solid #000;
  407 + transform:rotate(45deg);
  408 + display:inline-block;
  409 + margin-left: 10rpx;
  410 +}
  411 +
  412 +.xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; }
  413 +.xc-right-frame{font-size: 30rpx;line-height: 92rpx; margin-right: 10rpx }
  414 +
  415 +/* 自定义弹出窗口 */
  416 +.cx-popup{
  417 + width:100%;
  418 + height:880rpx;
  419 + background: #fff;
  420 + z-index: 35;
  421 + border-top-left-radius: 20rpx;
  422 + border-top-right-radius: 20rpx;
  423 + position:fixed;
  424 + bottom:0;
  425 + left: 0;
  426 + /* padding-bottom: 25rpx; */
  427 +}
  428 +
  429 +.cx-popup .top{
  430 + width:95%;
  431 + height:100rpx;
  432 + border-bottom:3rpx solid #ddd;
  433 + margin: auto;
  434 + margin-top: 30rpx;
  435 +
  436 +}
  437 +.xc-top-content{
  438 + width: 93%;
  439 + height:85rpx;
  440 + padding-top: 30rpx;
  441 + font-size: 34rpx;
  442 + font-weight: 600;
  443 +
  444 +}
  445 +
  446 +
  447 +.xc-valid-coupon{
  448 + width: 90%;
  449 + height:40rpx;
  450 + padding-top: 24rpx;
  451 + overflow: hidden;
  452 +}
  453 +.xc-frame{
  454 + width: 100%;
  455 + height:60%;
  456 +}
  457 +
  458 +.xc-frame .list-frame{
  459 + width: 95%;
  460 + height: 100%;
  461 + overflow-y:scroll;
  462 +
  463 +}
  464 +.xc-close-frame{
  465 + margin-top:-10rpx;
  466 +
  467 +}
  468 +
  469 +.xc-close{
  470 + width: 37rpx;
  471 +height: 37rpx;
  472 +border-radius: 50%;
  473 +border: 3rpx solid #333;
  474 +text-align: center;
  475 +line-height: 34rpx;
  476 +font-size: 29rpx;
  477 +color: #333;
  478 +
  479 +}
  480 +.xc-money{
  481 + color: #af2346;
  482 + font-size: 35rpx;
  483 +}
  484 +
  485 +.xc-money-frame{
  486 + margin-left:35rpx;
  487 +
  488 +}
  489 +.xc-coupon-effect{
  490 + width: 99%;
  491 + min-height: 100rpx;
  492 + border-bottom:3rpx solid #ddd;
  493 +
  494 +
  495 +}
  496 +.xc-goods-coupon{
  497 + width: 85%;
  498 + height:100%;
  499 +
  500 +}
  501 +.xc-title{
  502 + width:50%;
  503 + margin-left:222rpx;
  504 +
  505 +}
  506 +.xc-coupon-money0{
  507 + color: #c91e31;
  508 + font-size: 35rpx;
  509 + line-height: 40rpx;
  510 +
  511 +}
  512 +.xc-coupon-money{
  513 + color: #c91e31;
  514 + font-size: 35rpx;
  515 + line-height: 40rpx;
  516 + padding-top: 10px;
  517 +
  518 +}
  519 +.xc-coupon-money1{
  520 + color: #444;
  521 + font-size: 28rpx;
  522 + line-height: 60rpx;
  523 +
  524 +
  525 +}
  526 +.xc-coupon-time{
  527 + height: 50rpx;
  528 + font-size: 27rpx;
  529 + color: #a4a4a4;
  530 +}
  531 +.xc-coupon-time .time{
  532 + margin-left: 15rpx;
  533 + font-size: 27rpx;
  534 +}
  535 +.xc-coupon-selection{
  536 + height:100%;
  537 +}
  538 +
  539 +.xc-confirm {
  540 + width: 50%;
  541 + border-radius: 50rpx;
  542 + height: 80rpx;
  543 + margin:0 auto;
  544 + background:#d60021;
  545 + color:#fff;
  546 + font-size:28rpx;
  547 + margin-top: 28rpx;
  548 +}
  549 +
  550 +.up{ animation: up .7s; }
  551 +.down{ animation: down 1s; }
  552 +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } }
  553 +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } }
  554 +
  555 +.xc-not-Selection{
  556 + width: 40rpx;
  557 +height: 40rpx;
  558 + background: #eeeeee;
  559 +}
  560 +
  561 +
  562 +.xc-close-express{
  563 + width: 40rpx;
  564 +height: 40rpx;
  565 +border-radius: 50%;
  566 +border: 3rpx solid #333;
  567 +text-align: center;
  568 +font-size:32rpx;
  569 +line-height: 38rpx;
  570 +color: #333;
  571 +margin-top: 5rpx;
  572 +}
  573 +.cx-popup .tops{
  574 + width: 100%;
  575 +height: 145rpx;
  576 +border-bottom: 3rpx solid #eee;
  577 +
  578 +}
  579 +.top-content {
  580 + width: 82%;
  581 +padding-top: 33px;
  582 +height: 100%;
  583 +padding-left: 40rpx;
  584 +}
  585 +.close-frame{
  586 + margin-top: 30rpx;
  587 +
  588 +}
  589 +
  590 +.xc-hook {
  591 +width: 33rpx;
  592 +height: 33rpx;
  593 +transform: rotate(-135deg);
  594 +line-height: 35rpx;
  595 +text-align: center;
  596 +margin-right: 20rpx
  597 +
  598 +
  599 +}
  600 +.xc-hooks {
  601 +width: 30rpx;
  602 +height: 30rpx;
  603 +border: 1rpx solid #999;
  604 +margin-right: 20rpx;
  605 +}
  606 +.express_list_frame{
  607 + display: flex;
  608 +height: 80rpx;
  609 +align-items: center;
  610 +padding-left: 40rpx;
  611 +border-bottom: 1rpx solid #eee;
  612 +
  613 +}
  614 +.express_list{
  615 + width: 100%;
  616 + height: 65%;
  617 + overflow-y: auto;
  618 + margin-bottom: 40rpx;
  619 +
  620 +}
  621 +.xc-confirms {
  622 + box-sizing: border-box;
  623 + width: 40%;
  624 + border-radius: 50rpx;
  625 + height: 80rpx;
  626 + margin:0 auto;
  627 + font-size:28rpx;
  628 + background: #fff;
  629 + color: #333;
  630 + border: 2rpx solid #333;
  631 +}
  632 +
  633 +
  634 +/* 优惠券的改版样式 */
  635 +.xc-coupon-frame{
  636 + /* width: 710rpx; */
  637 + width: 100%;
  638 + height:auto;
  639 + margin: 0 auto;
  640 +
  641 +}
  642 +.xc-coupon-frame .coupon-frame{
  643 + width: 100%;
  644 + height: 200rpx;
  645 + margin-top:10rpx;
  646 + border-bottom: 1rpx solid #eee;
  647 +
  648 +}
  649 +.xc-coupon-frame .coupon-frame .coupon-left{
  650 + width: 215rpx;
  651 + height:100%;
  652 + overflow: hidden;
  653 +}
  654 +.xc-money-frames{
  655 + width:96%;
  656 + margin-top: -10px;
  657 +}
  658 +
  659 +.xc-rmb-symbol{
  660 + font-size:40rpx;
  661 +
  662 +}
  663 +
  664 +.xc-rmb-val{
  665 + font-size:60rpx;
  666 +
  667 +}
  668 +.coupon-explain{
  669 + font-size:25rpx;
  670 +width:100%;
  671 +
  672 +
  673 +}
  674 +.xc-valuer{
  675 + margin-top:39rpx;
  676 + margin-left:28rpx;
  677 + font-size:25rpx;
  678 +}
  679 +.coupon-frame .oval{
  680 + width:155rpx;
  681 + height:83rpx;
  682 + border-radius: 50%;
  683 + right:-78rpx;
  684 + top:-37rpx;
  685 +}
  686 +.coupon-right{
  687 + /* width:490rpx; */
  688 + height: 99%;
  689 + border-top: 1rpx solid #eaeaea;
  690 + /* //border-bottom: 1rpx solid #eaeaea; */
  691 + border-right: 1rpx solid #eaeaea;
  692 + flex-grow: 1;
  693 +}
  694 +.coupon-annotation{
  695 + width: 95%;
  696 + height: 100%;
  697 +
  698 +}
  699 +.xc-brand{
  700 + width:100rpx;
  701 + height:35rpx;
  702 + line-height: 35rpx;
  703 + font-size:21rpx;
  704 + border-radius:10rpx; position: relative; top:-1px;
  705 + margin-right: 8rpx
  706 +}
  707 +.top-frame{
  708 + width:82%;
  709 + height: 75rpx;
  710 + margin-top:10rpx;
  711 +}
  712 +.top-frame .coupon-wode{
  713 + font-size: 25rpx;
  714 + margin-left:10rpx;
  715 + width:340rpx;
  716 + height:88rpx;
  717 +}
  718 +.coupon-code{
  719 + width:60rpx;
  720 + height:60rpx;
  721 + margin-top:5rpx;
  722 +
  723 +}
  724 +.frame{
  725 + width: 100%
  726 +}
  727 +.coupon-time{
  728 + font-size: 23rpx;
  729 + line-height:33rpx;
  730 + color: #333;
  731 +}
  732 +
  733 +.clik-get{
  734 + width:125rpx;
  735 + height:45rpx;
  736 + border-radius: 25rpx;
  737 + line-height: 45rpx;
  738 + font-size:25rpx;
  739 + bottom:67rpx;
  740 + right:6px;
  741 +}
  742 +
  743 +.code-img{
  744 + margin-left:20rpx;
  745 +}
  746 +.bottmo-explain{
  747 +top:145rpx;
  748 +width:94%;
  749 +border-top:1rpx dashed #eee;
  750 +padding-top:8rpx;
  751 +height:38rpx;
  752 +line-height: 51rpx;
  753 +
  754 +}
  755 +.font-word{
  756 + font-size: 22rpx;
  757 +}
  758 +.circle-size{
  759 + background: #a0a0a0;
  760 + width: 27rpx;
  761 + height: 27rpx;
  762 + margin-top:13rpx;
  763 +margin-left:8rpx;
  764 +display: flex;
  765 +
  766 +align-items: center;
  767 +}
  768 +.xc-jiantou{
  769 + /* width: 9rpx;
  770 + height: 9rpx; */
  771 + /* border-top: 2rpx solid #fff;
  772 + border-right: 2rpx solid #fff; */
  773 + transform: rotate(-90deg);
  774 + color: #fff;
  775 + font-size: 15rpx;
  776 + /* display:inline-block;
  777 + margin-top: 6.5rpx; */
  778 + text-align: center;
  779 +width: 24rpx;
  780 +}
  781 +.xc-buttom{
  782 + box-sizing: border-box;
  783 + width:100%;
  784 + min-height:76rpx;
  785 + height:auto;
  786 + line-height:40rpx;
  787 + border-left:1rpx solid #eee;
  788 + border-right:1rpx solid #eee;
  789 + border-bottom:1rpx solid #eee;
  790 +/* margin-left: 6rpx; */
  791 +}
  792 +
  793 +.goods-num{
  794 + font-size: 28rpx;
  795 + color: #333;
  796 +}
  797 +
  798 +.explain-coupon{
  799 + font-size:25rpx;
  800 + padding: 10rpx 10rpx
  801 +}
  802 +.circle-frame{
  803 + width: 20rpx;
  804 + height: auto;
  805 + z-index:1;
  806 + left:210rpx;
  807 +
  808 +}
  809 +.circle-sawtooth{
  810 + width: 11rpx;
  811 + height: 11rpx;
  812 + background: #fff;
  813 +}
  814 +
  815 +.red{background-color: #fe7496;}
  816 +.green{ background-color: #22c7c1;}
  817 +.blue{background-color:#5e82e3;}
  818 +.g_gray{background-color: #aaaaaa}
  819 +
  820 +.f_text{text-align: center; height:96rpx; }
  821 +.xc-hook.sn {
  822 + margin-top:12%;
  823 +width:45rpx;
  824 +height:45rpx;
  825 +font-size:28rpx;
  826 +line-height:44rpx;
  827 +
  828 +
  829 +}
  830 +.xc-hooks.on{
  831 + margin-top:12%;
  832 +width:42rpx;
  833 +height:42rpx;
  834 +}
  835 +.may_use_coupon{
  836 + /* width: 95%; */
  837 + /* height: 68rpx; */
  838 + line-height:78rpx;
  839 + padding: 0 26rpx;
  840 + justify-content: space-between;
  841 + align-items: center;
  842 +}
  843 +.determine-frame{
  844 + width: 100%;
  845 + height: 130rpx;
  846 +
  847 +}
  848 +.xc-determine{
  849 + height: 80rpx;
  850 + width: 40%;
  851 + border-radius: 50rpx;
  852 +background: #d60021;
  853 +color: #fff;
  854 +font-size: 28rpx;
  855 +margin: 0 auto;
  856 +
  857 +}
  858 +.click-buttem{
  859 +width: 90%;
  860 +margin: auto;
  861 +}
  862 +.logistics-name{
  863 + margin-right:20rpx;
  864 +}
  865 +.xc-border{
  866 + border-top:8rpx solid #eee;
  867 +width: 100%
  868 +}
  869 +.main-top{
  870 +margin-top: 20rpx;
  871 +
  872 +}
  873 +.xc-hookts{
  874 +border: 1rpx solid #999;
  875 +
  876 +}
  877 +.xc-hookts.on{
  878 + width:30rpx;
  879 +height:30rpx;
  880 +
  881 +}
  882 +.xc-hookt.sn{
  883 + width: 32rpx;
  884 +height: 32rpx;
  885 +font-size: 28rpx;
  886 +line-height: 34rpx;
  887 +}
  888 +.xc-hookt{
  889 + transform: rotate(-135deg);
  890 +text-align: center;
  891 +
  892 +}
  893 +.main-bottom{
  894 + margin-bottom: 20rpx;
  895 +
  896 +}
  897 +.xc-hookst{
  898 + border: 1rpx solid #999;
  899 +
  900 +}
  901 +.xc-hookst.ons{
  902 + width: 42rpx;
  903 +height: 42rpx;
  904 +margin-left: 20rpx;
  905 +
  906 +}
  907 +.is_use_coupon{
  908 + width: 65%;
  909 +justify-content: flex-end;
  910 +padding-top: 10rpx;
  911 +
  912 +
  913 +}
  914 +.xc-hooka{
  915 + transform: rotate(-135deg);
  916 +text-align: center;
  917 +
  918 +}
  919 +.xc-hooka.sn{
  920 + width: 45rpx;
  921 +height: 45rpx;
  922 +font-size: 28rpx;
  923 +line-height: 44rpx;
  924 +margin-left: 20rpx;
  925 +
  926 +}
  927 +.color-gray{
  928 + color: #808080;
  929 +}
  930 +.n_guige{ display: inline-block; background:rgb(236, 236, 236); color: rgb(63,63,63); padding: 3rpx 10rpx; border-radius: 3rpx }
  931 +.gift_image{ width: 60rpx; height: 60rpx; position: absolute; top: 0; left: 0}
  932 +
  933 +.quan_num_show{ padding: 4rpx 6rpx; background-color:#ea5551; color:#fff; border-radius: 6rpx;margin-left:10rpx;font-size:24rpx;}
  934 +
  935 +.navigator-hover {
  936 + background: none;
  937 + opacity: 1;
  938 +}
  939 +
  940 +
  941 +.plus_buy{
  942 + background-color: #fff;
  943 + margin:15rpx 0;
  944 + padding: 20rpx;
  945 + position: relative;
  946 +}
  947 +
  948 +
  949 +.card_bg {
  950 + box-sizing: border-box;
  951 + padding: 2rpx 10rpx;
  952 + height: 28rpx;
  953 + border-radius: 26rpx;
  954 + font-size: 18rpx;
  955 + line-height: 28rpx;
  956 + max-width: 210rpx;
  957 + background: #333;
  958 + color: #fff;
  959 + margin-left: 8rpx;
  960 + position:relative;
  961 + top:7rpx;
  962 +}
  963 +
  964 +.card_bg image {
  965 + width: 19rpx;
  966 + height: 19rpx;
  967 + margin-right: 8rpx;
  968 +}
  969 +
  970 +/* .card_bg .card_name {
  971 + max-width: 76rpx;
  972 + width: auto;
  973 + overflow: hidden;
  974 + white-space: nowrap;
  975 +} */
  976 +
  977 +.card_name {
  978 + position: relative;
  979 + top: -4rpx;
  980 + margin-left: 6px;
  981 +}
  982 +
  983 +.car_tri_up {
  984 + width: 0;height: 0;
  985 + border-left: 20rpx solid transparent;
  986 + border-right: 20rpx solid transparent;
  987 + border-bottom: 20rpx solid #fff;
  988 + position: absolute;
  989 + right: 20rpx;
  990 + top:-10rpx
  991 +}
  992 +.card_op{
  993 + position: absolute;
  994 + right: 20rpx;
  995 + top:36rpx
  996 +}
  997 +
  998 +
  999 +.circle {
  1000 + display: block;
  1001 + width: 10rpx;
  1002 + height: 10rpx;
  1003 + border-radius: 50%;
  1004 + background-color: #ccc;
  1005 + margin: 0 auto;
  1006 +}
  1007 +
  1008 +.item-progress {
  1009 + /* display: flex;
  1010 + flex-direction: column;
  1011 + justify-content: space-around;
  1012 + font-size: 24rpx; */
  1013 +}
  1014 +
  1015 +.icon-yes {
  1016 + font-size: 12px;
  1017 + color: #07c160;
  1018 +}
  1019 +
  1020 +.box {
  1021 + height: 32rpx;
  1022 + display: flex;
  1023 + align-items: center;
  1024 + justify-content: center;
  1025 + position: relative;
  1026 + padding-top: 8rpx;
  1027 +}
  1028 +
  1029 +.line::before {
  1030 + position: absolute;
  1031 + right: 60%;
  1032 + content: '';
  1033 + width: 80%;
  1034 + height: 2rpx;
  1035 + background-color: #f2f2f2;
  1036 +}
  1037 +
  1038 +.date-container {
  1039 + background-color: #F6A299;
  1040 + color: #f23030;
  1041 + font-size: 24rpx;
  1042 + padding: 10rpx 30rpx;
  1043 +}
  1044 +
  1045 +.kefu-container {
  1046 + width: 100rpx;
  1047 + height: 100rpx;
  1048 + border-radius: 50%;
  1049 + position: fixed;
  1050 + right: 10rpx;
  1051 + bottom: 160rpx;
  1052 + background-color: white;
  1053 + display: flex;
  1054 + align-items: center;
  1055 + justify-content: center;
  1056 + box-shadow: 0 4rpx 12px #e7e9eb;
  1057 +}
  1058 +
  1059 +/* .icon-kefu {
  1060 + font-size: 40rpx;
  1061 +}
  1062 + */
... ...
packageC/pages/presell/cart/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 +}
... ...
packageC/pages/presell/cart/juchi_part.wxml 0 → 100644
  1 +<!-- 锯齿 -->
  2 +<view class="circle-frame abs">
  3 + <view class='circle circle-sawtooth'></view>
  4 + <view class='circle circle-sawtooth'></view>
  5 + <view class='circle circle-sawtooth'></view>
  6 + <view class='circle circle-sawtooth'></view>
  7 + <view class='circle circle-sawtooth'></view>
  8 + <view class='circle circle-sawtooth'></view>
  9 + <view class='circle circle-sawtooth'></view>
  10 + <view class='circle circle-sawtooth'></view>
  11 + <view class='circle circle-sawtooth'></view>
  12 + <view class='circle circle-sawtooth'></view>
  13 + <view class='circle circle-sawtooth'></view>
  14 + <view class='circle circle-sawtooth'></view>
  15 + <view class='circle circle-sawtooth'></view>
  16 + <view class='circle circle-sawtooth'></view>
  17 + <view class='circle circle-sawtooth'></view>
  18 + <view class='circle circle-sawtooth'></view>
  19 + <view class='circle circle-sawtooth'></view>
  20 + <view class='circle circle-sawtooth'></view>
  21 + <view class='circle circle-sawtooth'></view>
  22 + <view class='circle circle-sawtooth'></view>
  23 +</view>
0 24 \ No newline at end of file
... ...
packageC/pages/presell/cart/remark_click_part.wxml 0 → 100644
  1 +<!--点击券说明-->
  2 +<view class="abs flex-vertical-between bottmo-explain" catchtap='clik_coupons' data-idx="{{q_index}}">
  3 + <view></view><view class="font-word flex">优惠券使用说明<view class="circle circle-size flex t-c"> <view class="xc-jiantou">く</view> </view></view>
  4 +</view>
0 5 \ No newline at end of file
... ...
packageC/pages/presell/cart/remark_click_part2.wxml 0 → 100644
  1 +<!--点击券说明-->
  2 +<view class="abs flex-vertical-between bottmo-explain" catchtap='clik_coupons2' data-idx="{{byq_index}}">
  3 + <view></view><view class="font-word flex">优惠券使用说明<view class="circle circle-size flex t-c"> <view class="xc-jiantou">く</view> </view></view>
  4 +</view>
0 5 \ No newline at end of file
... ...
packageC/pages/presell/cart/remark_part.wxml 0 → 100644
  1 +<view class="xc-buttom " wx:if="{{item.is_open==1}}" >
  2 + <view style="padding:10rpx">
  3 + <text class="five-level-word explain-coupon" wx:if="{{item.Remark}}">{{util.format(item.Remark)}}</text>
  4 + <text class="five-level-word explain-coupon" wx:else>
  5 + <block wx:if="{{item.UseObjectName}}">仅{{item.UseObjectName}}使用</block>
  6 + <block wx:else>全场通用</block>
  7 + </text>
  8 + </view>
  9 +</view>
0 10 \ No newline at end of file
... ...
packageC/pages/presell/cart/zh_calculate.js 0 → 100644
  1 +var regeneratorRuntime = require('../../../../utils/runtime.js');
  2 +module.exports = {
  3 + //主要的作用,就是把组合购多余的商品进行拆分,
  4 + //如果没有达成组合购的要求,所有的商品都打回原价购买
  5 + fir_set_arr: function (c_item) {
  6 + //组合活动,以及组合活动从表的商品
  7 + let zh_prom_goods = c_item.zh_prom_goods;
  8 + let goods = c_item.goods; //一个门店中所有的商品
  9 + let tfeel = 0,cut_price=0, offline_price = 0, offline_num = 0;
  10 + let txt_ite = c_item.need_list;
  11 + //多个活动要拿来循环一下
  12 + for (let i in zh_prom_goods) {
  13 + let title = ""; //提示语;
  14 + //其中的一个活动
  15 + let act_item = zh_prom_goods[i];
  16 + let act_goos = act_item.gdlist;
  17 + let act = act_item.act;
  18 +
  19 + let all_num = 0; //商品数量之和
  20 + let all_price0 = 0; //商品数量之和
  21 + let aprice=0; //达到活动条件的购买价格
  22 + let need_to_buy = 0;
  23 + let all_zhqty = 0; //所有商品要求起购数之和
  24 + let no_in_arr = []; //剩余的未加入组合购
  25 + let out_arr=[]; //超出活动限购的商品放入
  26 +
  27 + //-- 寻找一下 --
  28 + function get_num2(ite) {
  29 + for (let v2 in goods) {
  30 + var vh = goods[v2];
  31 + if (vh.goods_id == ite.goods_id) {
  32 + return vh;
  33 + }
  34 + }
  35 + return 0;
  36 + }
  37 +
  38 + for (let j in act_goos) {
  39 + let item = act_goos[j];
  40 + let item_j = goods.find(function (ele) {
  41 + return ele.goods_id == act_goos[j].goods_id;
  42 + })
  43 + //-- 如果有找到的话 --
  44 + if (item_j) {
  45 + act_goos[j].num = item_j.goods_num;
  46 + act_goos[j].goods_price = item_j.goods_price;
  47 + var cart_num=item.cart_num =item_j.goods_num;
  48 + var zh_b_num=item_j.promgoodsbuynum;
  49 + if(item.buyqty>0){
  50 + var cbuy=item.buyqty-zh_b_num;
  51 + //当可买的数量为0
  52 + if(cbuy<=0){
  53 + item.num=0;
  54 + out_arr.push({
  55 + price: item.goods_price,offline_price:item.offline_price,goods_id:item.goods_id,num:cart_num
  56 + })
  57 + }else{
  58 + if(cbuy>=cart_num) item.num =cart_num;
  59 + else{
  60 + item.num =cbuy;
  61 + out_arr.push({
  62 + price: item.goods_price,offline_price:item.offline_price,goods_id:item.goods_id,num:cart_num-cbuy
  63 + })
  64 + }
  65 + }
  66 + }
  67 +
  68 + all_num += item.num;
  69 + //当有起购数的控制的时候
  70 + if (item.zhqty) {
  71 + all_zhqty += item.zhqty;
  72 + if (item.num < item.zhqty) {
  73 + need_to_buy += item.zhqty - item.num;
  74 + }
  75 + if (item.num > item.zhqty) {
  76 + for (let i = 0; i < item.num - item.zhqty; i++) {
  77 + no_in_arr.push({
  78 + price: item.goods_price, goods_id: item.goods_id, offline_price: item_j.offline_price
  79 + })
  80 + }
  81 + }
  82 + } else {
  83 + for (let j = 0; j < item.num; j++) {
  84 + no_in_arr.push({
  85 + price: item.goods_price, goods_id: item.goods_id, offline_price: item_j.offline_price
  86 + })
  87 + }
  88 + }
  89 + } else {
  90 + if (item.zhqty) {
  91 + title = "必买商品未加购,下单立享【" + act.zhprice + "元任选" + act.zhbuyqty + "件】";
  92 + need_to_buy += item.zhqty;
  93 + }
  94 + }
  95 +
  96 + }
  97 +
  98 + //当满足组合的要求:总数要满足,起购数要满足
  99 + if (all_num >= act.zhbuyqty && !need_to_buy) {
  100 + function sortData(a, b) {
  101 + return a.price - b.price
  102 + }
  103 +
  104 + if(no_in_arr.length>0) no_in_arr.sort(sortData);
  105 +
  106 + aprice = act.zhprice;
  107 + if (act.zhbuyqty > all_zhqty) {
  108 + for (let n = 0; n < act.zhbuyqty-all_zhqty; n++) {
  109 + no_in_arr.pop();
  110 + }
  111 + }
  112 + //看一下剩下的数量有没有满足组合购的要求,以及要不要倍增
  113 + if (act.is_bz && no_in_arr.length >= act.zhbuyqty) {
  114 + //看一下是几倍
  115 + let be = parseInt(no_in_arr.length / act.zhbuyqty);
  116 + aprice += be * act.zhprice;
  117 + for (let m = 0; m < be * act.zhbuyqty; m++) {
  118 + no_in_arr.pop();
  119 + }
  120 + }
  121 +
  122 +
  123 + let goods_map = {};
  124 + //算一下剩余的商品
  125 + if(no_in_arr.length) {
  126 + for (let ii in no_in_arr) {
  127 + let item = no_in_arr[ii];
  128 + if (item.offline_price) {
  129 + offline_price += item.price - item.offline_price;
  130 + offline_num += 1;
  131 + }
  132 + if (goods_map[item.goods_id]) {
  133 + var num = goods_map[item.goods_id];
  134 + goods_map[item.goods_id] = ++num;
  135 + } else {
  136 + goods_map[item.goods_id] = 1;
  137 + }
  138 + }
  139 + }
  140 +
  141 + //超量的部分也要计算一下
  142 + if(out_arr.length){
  143 + for (var m in out_arr) {
  144 + var item = out_arr[m];
  145 + if (item.offline_price) {
  146 + offline_price += (item.price - item.offline_price)*item.num;
  147 + offline_num += item.num;
  148 + }
  149 + if (goods_map[item.goods_id]) {
  150 + var num = goods_map[item.goods_id];
  151 + num+=item.num
  152 + goods_map[item.goods_id] =num;
  153 + } else {
  154 + goods_map[item.goods_id] = item.num;
  155 + }
  156 + }
  157 + }
  158 +
  159 + if(Object.keys(goods_map).length) {
  160 + //这里就开始拆分提交订单时的列表
  161 + for (let j in goods_map) {
  162 + //map中存的就是商品的数量
  163 + let num = goods_map[j];
  164 + //找到相应的商品
  165 + let idx = goods.findIndex(function (ele) {
  166 + return ele.goods_id == j;
  167 + })
  168 + goods[idx].goods_num -= num;
  169 + let new_g = JSON.parse(JSON.stringify(goods[idx]));
  170 + new_g.goods_num = num;
  171 + new_g.prom_type = 0;
  172 + new_g.prom_id = 0;
  173 + goods.push(new_g);
  174 + }
  175 + }
  176 +
  177 +
  178 + //-- 只统计是参与活动的商品 --
  179 + for(var ij in goods){
  180 + var iter=goods[ij];
  181 + if(iter.prom_type!=7 || iter.prom_id!=act.id){ continue; }
  182 + all_price0+=iter.goods_num*iter.goods_price;
  183 + }
  184 + //-- 活动的条件已经满足 --
  185 + c_item.zh_prom_goods[act.id].is_has_zh = 1;
  186 + c_item.is_has_zh = 1;
  187 + c_item.zh_prom_goods[act.id].actual_price = aprice;
  188 + c_item.zh_prom_goods[act.id].cut_price =all_price0-aprice;
  189 +
  190 + //-- 设置还需要购买多少件,享受活动,前段显示 --
  191 + let need_to = c_item.need_list;
  192 + let index = this.find_need_to(need_to, act);
  193 + if (index > -1) {
  194 + need_to.splice(index, 1);
  195 + txt_ite = need_to
  196 + }
  197 +
  198 +
  199 + } else {
  200 + for (let ii in goods) {
  201 + let item = goods[ii];
  202 + if (item.prom_type != 7) continue;
  203 + if (item.prom_id != act.id) continue;
  204 + if (item.offline_price) {
  205 + offline_price += item.goods_price - item.offline_price;
  206 + offline_num += 1;
  207 + }
  208 + item.prom_type = 0;
  209 + item.prom_id = 0;
  210 + }
  211 + if (act.zhbuyqty - all_num > need_to_buy) {
  212 + need_to_buy = act.zhbuyqty - all_num;
  213 + }
  214 + //-- 设置还需要购买多少件享受活动,前端显示 --
  215 + let need_to = c_item.need_list;
  216 + let index = this.find_need_to(need_to, act);
  217 + if (title == '') title = "再买" + need_to_buy + "件,下单立享【" + act.zhprice + "元任选" + act.zhbuyqty + "件】";
  218 + if (index != -1) {
  219 + need_to[index].title = title;
  220 + } else {
  221 + if (!need_to) need_to = [];
  222 + let it = {
  223 + id: act.id,
  224 + pickup_id: c_item.pickup_id,
  225 + title: title
  226 + };
  227 + need_to.push(it);
  228 + }
  229 + txt_ite = need_to;
  230 + }
  231 + tfeel += aprice;
  232 + cut_price+=all_price0-aprice;;
  233 + }
  234 +
  235 + c_item.zh_all_price = tfeel;
  236 + c_item.zh_cut_price = cut_price;
  237 +
  238 + if (c_item.is_offline == 1) {
  239 + c_item.offline_price += offline_price;
  240 + c_item.offline_num += offline_num;
  241 + } else {
  242 + c_item.is_offline == 1;
  243 + c_item.offline_price = offline_price;
  244 + c_item.offline_num = offline_num;
  245 + }
  246 +
  247 + },
  248 + //筛选组合购,纯粹的数组按活动id分组
  249 + find_split: function (arr) {
  250 + //过滤只有团购的商品
  251 + let oarr = arr.goods.filter(function (ele) {
  252 + return ele.prom_type == 7
  253 + })
  254 + if (!oarr || oarr.length == 0) return null;
  255 + //看一下有多少个不同的团购
  256 + let map = {},
  257 + dest = [];
  258 + for (let i = 0; i < oarr.length; i++) {
  259 + let ai = oarr[i];
  260 + let index = map[ai.prom_id]
  261 + if (!index) {
  262 + dest.push({
  263 + prom_id: ai.prom_id,
  264 + act: ai.act,
  265 + data: [ai]
  266 + });
  267 + map[ai.prom_id] = dest.length; //存储下标
  268 + } else {
  269 + let dj = dest[index - 1];
  270 + dj.data.push(ai);
  271 + }
  272 + }
  273 + return dest;
  274 + },
  275 +
  276 + find_need_to: function (list, iter) {
  277 + if (!list || list.length <= 0) return -1;
  278 + for (var i in list) {
  279 + var item = list[i];
  280 + if (item.id == iter.id) {
  281 + return i;
  282 + }
  283 + }
  284 + return -1;
  285 + },
  286 + //-- 平摊组合购的价格 --
  287 + calc_zh_split_price: async function (c_arr, th) {
  288 + //-- 循环处理 --
  289 + for (var k in c_arr) {
  290 + var cart_item = c_arr[k]; //就是每一单的意思
  291 + var ord_goods = c_arr[k].goods; //就是每一单的从表的意思
  292 +
  293 + var zh_prom_goods = cart_item.zh_prom_goods; //一单中所有的组合购的集合
  294 + var item_map = {};
  295 + for (let i in zh_prom_goods) {
  296 + let item = zh_prom_goods[i];
  297 + let prom_id = i;
  298 + //如果这个活动还没有达到要求,继续下一个计算
  299 + if (!item.is_has_zh) continue;
  300 + //过滤出相应组合购活动的商品
  301 + let glist = ord_goods.filter(function (ele) {
  302 + return ele.prom_type == 7 && ele.prom_id == i;
  303 + })
  304 + var all_good_price = 0;
  305 + var post_gd=[];
  306 + for (let j in glist) {
  307 + let item = glist[j];
  308 + all_good_price += item.goods_price * item.goods_num;
  309 + var gitem={
  310 + goods_id:item.goods_id,
  311 + goods_num:item.goods_num,
  312 + goods_price:item.goods_price
  313 + }
  314 + post_gd.push(gitem);
  315 + }
  316 + //要进行优惠的计算
  317 + if (all_good_price - item.actual_price) {
  318 + if (cart_item.prom_pt_json) {
  319 + cart_item.prom_pt_json.push({
  320 + "zhprom_id": prom_id,
  321 + "dis": (all_good_price - item.actual_price).toFixed(2),
  322 + "ispt": 0
  323 + })
  324 + } else {
  325 + cart_item.prom_pt_json = [{
  326 + "zhprom_id": prom_id,
  327 + "dis": (all_good_price - item.actual_price).toFixed(2),
  328 + "ispt": 0
  329 + }];
  330 + }
  331 + }
  332 +
  333 + //-- 如果系统要平摊到单品 --
  334 + var pt_data = {
  335 + 'prom_id': prom_id,
  336 + 'dis': parseFloat(all_good_price - item.actual_price).toFixed(2),
  337 + 'goods': post_gd
  338 + }
  339 + var pt_res = null;
  340 + await getApp().request.promisePost("/api/weshop/order/getGoodsSplit", {
  341 + is_json: 1,
  342 + data: pt_data
  343 + }).then(res => {
  344 + if (res.data.code == 0) {
  345 + pt_res = res.data.data;
  346 + }
  347 + })
  348 + if (pt_res) {
  349 + for (var io in glist) {
  350 + var goods_id = glist[io].goods_id;
  351 + item_map[goods_id]={};
  352 + //平摊赋值
  353 + item_map[goods_id].account_fir = th.arr_get_goods(goods_id, pt_res).fisrt_account;
  354 + item_map[goods_id].account_yu_fir = th.arr_get_goods(goods_id, pt_res).fisrt_account_yu;
  355 + if (!th.data.ispt_goods) {
  356 + item_map[goods_id].account = item_map[goods_id].account_fir;
  357 + item_map[goods_id].account_yu = item_map[goods_id].account_yu_fir;
  358 + }
  359 + }
  360 + }
  361 + }
  362 +
  363 + //--------循环计算商品是不是包邮,是不是使用优惠券,此时循环是商品从表-----------
  364 + for (var jj = 0; jj < ord_goods.length; jj++) {
  365 + if (ord_goods[jj].is_gift) continue;
  366 + if (ord_goods[jj].prom_type == 7 && item_map[ord_goods[jj].goods_id]) {
  367 + ord_goods[jj].account_fir = item_map[ord_goods[jj].goods_id].account_fir;
  368 + ord_goods[jj].account_yu_fir = item_map[ord_goods[jj].goods_id].account_yu_fir;
  369 + ord_goods[jj].account = item_map[ord_goods[jj].goods_id].account;
  370 + ord_goods[jj].account_yu = item_map[ord_goods[jj].goods_id].account_yu;
  371 + }
  372 + }
  373 + }
  374 +
  375 +
  376 + }
  377 +
  378 +
  379 +}
... ...
packageC/pages/presell/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 + <text wx:if="{{!prom_integral && !prom_price}}">0积分</text>
  15 + </view>
  16 + </view>
  17 +
  18 +
  19 + <view class="flex">
  20 + <view class="spec-goods-stock">已售:{{prom_act.buy_num}}</view>
  21 + <view class="spec-goods-stock">可售:{{prom_act.limitqty-prom_act.buy_num}}</view>
  22 + </view>
  23 +
  24 + </view>
  25 +
  26 + <!-- 选择门店模块 -->
  27 + <view class="flex-space-between address ai_end xc-width ">
  28 +
  29 + <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}">
  30 + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
  31 + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
  32 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  33 +
  34 + </view>
  35 + </view>
  36 +
  37 + <!-- 没有门店的时候 -->
  38 + <view class="flex" bindtap="choice_store" wx:else>
  39 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  40 + <view class="fs30" style="color:black;">选择门店</view>
  41 + </view>
  42 +
  43 + <view class="red-co fs28" bindtap="choice_store" >
  44 + 更多门店
  45 + <text class="right-arrow"></text>
  46 + </view>
  47 + </view>
  48 + <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>
  49 + <block wx:else>
  50 + <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
  51 + <block wx:else>
  52 + <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view>
  53 + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view>
  54 + </block>
  55 + </block>
  56 +
  57 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{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="{{goodsInputNum <= 1 ? '':'subCartNum_inte'}}" class="sub {{goodsInputNum <= 1 ? 'active':''}}">-</view>
  74 + <input bindblur="inputCartNum_inte" type="number" value="{{goodsInputNum}}"></input>
  75 + <view bindtap="addCartNum_inte" class="add">+</view>
  76 + </view>
  77 + </view>
  78 + </view>
  79 +
  80 + <!-- 按钮部分 -->
  81 + <view class="spec-cart-btns">
  82 + <!-- 根本就找不到门店 -->
  83 + <block wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">
  84 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">配送不匹配</view>
  85 + </block>
  86 +
  87 + <block wx:else>
  88 +
  89 + <!-- 根本就找不到门店 -->
  90 + <block wx:if="{{!only_pk && !def_pickpu_list}}">
  91 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  92 + </block>
  93 + <block wx:else>
  94 +
  95 +
  96 + <block wx:if="{{only_pk.length && !only_pk.length}}">
  97 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  98 + </block>
  99 + <block wx:else>
  100 + <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">
  101 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  102 + </block>
  103 + <block wx:else>
  104 + <block wx:if="{{!def_pick_store}}">
  105 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view>
  106 + </block>
  107 + <block wx:else>
  108 + <block wx:if="{{data.store_count<=0}}">
  109 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  110 + </block>
  111 + <block wx:else>
  112 + <view bindtap="addCart_inte" class="spec-cart-btn spec-buy" data-action="buy">立即兑换</view>
  113 + </block>
  114 +
  115 + </block>
  116 + </block>
  117 + </block>
  118 + </block>
  119 + </block>
  120 + </view>
  121 +
  122 +
  123 + </view>
  124 + </view>
  125 + <view class="clear"></view>
0 126 \ No newline at end of file
... ...
packageC/pages/presell/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 && def_pick_store.pickup_name}}">
  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 class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view>
  55 + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view>
  56 + </block>
  57 + </block>
  58 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view>
  59 +
  60 +
  61 + <!--商品的属性项目-->
  62 + <view class="xc-goods-attribute">
  63 + <view hidden="{{ismend==1}}" class="spec-name">商品规格</view>
  64 + <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">
  65 + <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-nor="1" data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g">
  66 + {{item.gg}}
  67 + </view>
  68 + </view>
  69 + </view>
  70 +
  71 + <view class="b_num">
  72 + <view>购买数量</view>
  73 + <view class="count">
  74 + <view bindtap="{{goodsInputNum <= 1 ? '':'subCartNum'}}" class="sub {{goodsInputNum <= 1 ? 'active':''}}">-</view>
  75 + <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input>
  76 + <view bindtap="addCartNum" class="add">+</view>
  77 + </view>
  78 + </view>
  79 + </view>
  80 +
  81 +
  82 + <!-- 提示再买多少优惠 -->
  83 + <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition}}">
  84 + 再买{{hui_condition.need}}
  85 + <text wx:if="{{hui_condition.money}}">,免{{hui_condition.money}}元</text>
  86 + <text wx:if="{{hui_condition.sale}}">,打{{hui_condition.sale}}折</text>
  87 + <text wx:if="{{hui_condition.past==1}}">,包邮</text>
  88 + <text wx:if="{{hui_condition.intValue>0}}">,送{{hui_condition.intValue}}积分</text>
  89 + <text wx:if="{{hui_condition.couponId>0}}">,送优惠券</text>
  90 + <text wx:if="{{hui_condition.gift_id>0}}">,送赠品</text>
  91 + <text wx:if="{{hui_condition.lb_id>0}}">,送礼包</text>
  92 + </view>
  93 +
  94 +
  95 + <!-- 按钮部分 -->
  96 + <view class="spec-cart-btns">
  97 +
  98 +
  99 + <!-- 根本就找不到门店 -->
  100 + <block wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">
  101 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">配送不匹配</view>
  102 + </block>
  103 + <block wx:else>
  104 + <!-- 根本就找不到门店 -->
  105 + <block wx:if="{{!only_pk && !def_pickpu_list}}">
  106 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  107 + </block>
  108 + <block wx:else>
  109 +
  110 +
  111 + <block wx:if="{{only_pk.length && !only_pk.length}}">
  112 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  113 + </block>
  114 + <block wx:else>
  115 + <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">
  116 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  117 + </block>
  118 + <block wx:else>
  119 + <block wx:if="{{!def_pick_store}}">
  120 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view>
  121 + </block>
  122 + <block wx:else>
  123 + <block wx:if="{{data.store_count<=0}}">
  124 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  125 + </block>
  126 + <block wx:else>
  127 + <view class="flex jc_sb">
  128 + <view class="spec-cart-btn spec-buy w40" bindtap="addCart"
  129 + data-action="add" style="background-color: #ffb03f;">加入购物车</view>
  130 + <view class="spec-cart-btn spec-buy w40" bindtap="addCart"
  131 + data-action="buy">立即购买</view>
  132 + </view>
  133 + </block>
  134 +
  135 + </block>
  136 + </block>
  137 + </block>
  138 + </block>
  139 + </block>
  140 + </view>
  141 +
  142 +
  143 + </view>
  144 + </view>
  145 + <view class="clear"></view>
0 146 \ No newline at end of file
... ...
packageC/pages/presell/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 && def_pick_store.pickup_name}}">
  51 + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
  52 +
  53 +
  54 + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
  55 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  56 +
  57 + </view>
  58 + </view>
  59 +
  60 + <!-- 没有门店的时候 -->
  61 + <view class="flex" bindtap="choice_store" wx:else>
  62 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  63 + <view class="fs28 xc-ash-9f">选择门店</view>
  64 + </view>
  65 +
  66 + <view class="red-co fs28" bindtap="choice_store" >
  67 + 更多门店
  68 + <text class="right-arrow"></text>
  69 + </view>
  70 + </view>
  71 + <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view>
  72 + <view class="no_store" wx:elif="{{is_normal && def_pick_store && def_pick_store.CanOutQty<=0}}">(库存不足)</view>
  73 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.pickup_name}}">地址:{{def_pick_store.fulladdress}}</view>
  74 + </view>
  75 + <!----商品的属性项目---->
  76 + <view>
  77 + <view hidden="{{ismend==1}}" class="spec-name">商品规格</view>
  78 + <block wx:if="{{is_normal==0}}">
  79 + <view hidden="{{ismend==1}}" class="flex">
  80 + <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}}
  81 + </view>
  82 + </view>
  83 + </block>
  84 +
  85 + <block wx:else>
  86 + <view hidden="{{ismend==1}}" class="flex">
  87 + <view class="spec_bt {{sele_g.goods_id==item.goods_id?'act':''}}"
  88 + bindtap="sele_spec" data-nor="1" data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g">{{item.gg}}</view>
  89 + </view>
  90 + </block>
  91 + <view class="clear"></view>
  92 + </view>
  93 +
  94 +
  95 + <view>
  96 + <!--<view bindtap="getmendian" class="quhuo logistics-item" hidden="{{ismend==1}}">-->
  97 + <!--<view wx:if="{{sto_sele_name==''}}">取货门店-->
  98 + <!--<text class='small'>(选择门店)</text>-->
  99 + <!--</view>-->
  100 + <!--<view wx:else>{{sto_sele_name}}</view>-->
  101 + <!--<view class="item-img">-->
  102 + <!--<image class="wh100" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image>-->
  103 + <!--</view>-->
  104 + <!--</view>-->
  105 +
  106 +
  107 + <view class="b_num" hidden="{{ismend==1}}" style="margin-top: 20rpx">
  108 + <view>购买数量</view>
  109 + <view class="count">
  110 + <view bindtap="{{goodsInputNum <= 1 ? '':'subCartNum'}}" class="sub {{goodsInputNum <= 1 ? 'active':''}}">-</view>
  111 + <input bindblur="inputCartNum" class="xc-val-fream" type="number" value="{{goodsInputNum}}"></input>
  112 + <view bindtap="addCartNum" class="add">+</view>
  113 + </view>
  114 + </view>
  115 +
  116 +
  117 + <!-- 提示再买多少优惠 -->
  118 + <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition && is_normal==1}}">
  119 + 再买{{hui_condition.need}}
  120 + <text wx:if="{{hui_condition.money}}">,免{{hui_condition.money}}元</text>
  121 + <text wx:if="{{hui_condition.sale}}">,打{{hui_condition.sale}}折</text>
  122 + <text wx:if="{{hui_condition.past==1}}">,包邮</text>
  123 + <text wx:if="{{hui_condition.intValue>0}}">,送{{hui_condition.intValue}}积分</text>
  124 + <text wx:if="{{hui_condition.couponId>0}}">,送优惠券</text>
  125 + <text wx:if="{{hui_condition.gift_id>0}}">,送赠品</text>
  126 + <text wx:if="{{hui_condition.lb_id>0}}">,送礼包</text>
  127 + </view>
  128 +
  129 +
  130 + <view class="clear"></view>
  131 + <!---当选取门店的时候会显示门店的选项---->
  132 + <view hidden="{{ismend==0}}" class="sto_v">
  133 + <view class="title" hidden="{{is_sec_mend==1}}" bindtap="hidemend">
  134 + <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>选择门店
  135 + </view>
  136 + <!-----第一级显示------>
  137 + <view class="itemlists" hidden="{{is_sec_mend==1}}">
  138 + <block wx:if="{{is_show_sto_cat>0}}">
  139 + <view wx:for="{{all_sto}}" wx:key="all_sto" class="item" bindtap="show_sec" data-index="{{index}}">{{item.name}}</view>
  140 + </block>
  141 + <block wx:else>
  142 + <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}}
  143 + </view>
  144 + </block>
  145 + </view>
  146 + <!-----第二级显示------>
  147 + <view class="stitle" hidden="{{is_sec_mend==0}}" bindtap="hide_sec_mend">
  148 + <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>{{sec_sto.name}}</view>
  149 + <view class="itemlists" hidden="{{is_sec_mend==0}}">
  150 + <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}}
  151 + </view>
  152 + </view>
  153 + </view>
  154 + </view>
  155 + </view>
  156 + <view class="pt_qd">
  157 + <block wx:if="{{is_normal==1}}">
  158 + <!-- 按钮部分 -->
  159 + <view class="spec-cart-btns">
  160 + <!-- 根本就找不到门店 -->
  161 + <block wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">
  162 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">配送不匹配</view>
  163 + </block>
  164 + <block wx:else>
  165 +
  166 + <!-- 根本就找不到门店 -->
  167 + <block wx:if="{{!only_pk && !def_pickpu_list}}">
  168 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  169 + </block>
  170 + <block wx:else>
  171 +
  172 +
  173 + <block wx:if="{{only_pk.length && !only_pk.length}}">
  174 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  175 + </block>
  176 + <block wx:else>
  177 + <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">
  178 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  179 + </block>
  180 + <block wx:else>
  181 + <block wx:if="{{!def_pick_store}}">
  182 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view>
  183 + </block>
  184 + <block wx:else>
  185 + <block wx:if="{{data.store_count<=0}}">
  186 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  187 + </block>
  188 + <block wx:else>
  189 + <view bindtap="addCart_pt" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view>
  190 + </block>
  191 +
  192 + </block>
  193 + </block>
  194 + </block>
  195 + </block>
  196 + </block>
  197 + </view>
  198 +
  199 + </block>
  200 + <block wx:else>
  201 + <!-- 根本就找不到门店 -->
  202 + <block wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">
  203 + <view class="spec-cart-btn spec-buy w100" style="background-color: #dcdcdc;color: #999;">配送不匹配</view>
  204 + </block>
  205 + <block wx:else>
  206 + <view bindtap="addCart_pt" class="spec-cart-btn spec-buy w100" data-action="buy">确定</view>
  207 + </block>
  208 + </block>
  209 +
  210 +
  211 + </view>
  212 + </view>
  213 +
0 214 \ No newline at end of file
... ...
packageC/pages/presell/goodsInfo/filter.wxs 0 → 100644
  1 +var is_has = function (text,val) {
  2 + if(text.indexOf(","+val+",")==-1) return false;
  3 + return true
  4 +}
  5 +function format_tt(ts) {
  6 + if(ts==null || ts==undefined || ts=='') return "";
  7 + var d = getDate(ts*1000)
  8 + var fm=(d.getMonth()+1)+"月"+ d.getDate()+"日";
  9 + return fm;
  10 +}
  11 +module.exports = {
  12 + is_has: is_has,
  13 + format_tt:format_tt
  14 +}
... ...
packageC/pages/presell/goodsInfo/g_filter.wxs 0 → 100644
  1 +var g_filters = {
  2 + //-- 判断是不是有等级价 --
  3 + is_has_rank:function(rank_switch,item){
  4 + if(!rank_switch) return false;
  5 + if(item.cardprice1 || item.cardprice2 || item.cardprice3) {return true}
  6 + return false;
  7 + },
  8 +
  9 + //-- 判断,不是等级会员时候,要显示的最低等级价和名称 --
  10 + get_card_price:function(goods,all_card,type){
  11 + var price1=parseFloat(goods['cardprice1']);
  12 + var price2=parseFloat(goods['cardprice2']);
  13 + var price3=parseFloat(goods['cardprice3']);
  14 + if(!all_card){
  15 + if(type==0) return 0;
  16 + return "";
  17 + }
  18 +
  19 + var arr=[];
  20 + var min_price= 0;
  21 + var min_name="";
  22 +
  23 + var min_price=null;
  24 + var min_name=null;
  25 + //---设置对应的价格名字----
  26 + for(var i=0;i<3;i++) {
  27 + var vl=all_card[i];
  28 + if(!vl) continue;
  29 + if(vl['CorrPrice']=="Price1" && price1>0)
  30 + {
  31 + if(min_price==null) {
  32 + min_price=price1;min_name=vl['CardName'];
  33 + }
  34 + else if(price1<min_price) {
  35 + min_price=price1;min_name=vl['CardName'];
  36 + }
  37 + }
  38 + if(vl['CorrPrice']=="Price2" && price2>0)
  39 + {
  40 + if(min_price==null) {
  41 + min_price=price2;min_name=vl['CardName'];
  42 + }
  43 + else if(price2<min_price) {
  44 + min_price=price2;min_name=vl['CardName'];
  45 + }
  46 + }
  47 +
  48 + if(vl['CorrPrice']=="Price3" && price3>0)
  49 + {
  50 + if(min_price==null) {
  51 + min_price=price3;min_name=vl['CardName'];
  52 + }
  53 + else if(price3<min_price) {
  54 + min_price=price3;min_name=vl['CardName'];
  55 + }
  56 + }
  57 +
  58 + }
  59 + if(min_price==null){
  60 + if(type==0) return 0;
  61 + return "";
  62 + }
  63 +
  64 + //if(type==0) return arr.length;
  65 + //--进行排序,升序---
  66 + /*---
  67 + arr.sort(function(a,b){
  68 + if (a.price < b.price) {
  69 + return -1;
  70 + } else if (a.fee == b.fee) {
  71 + return 0;
  72 + } else {
  73 + return 1;
  74 + }
  75 + })--*/
  76 + //-- 获取最下价钱,和相应的卡的名称 --
  77 + //min_price=min.price;
  78 + //min_name=min.name;
  79 + if(type==0) return min_price.toFixed(2);
  80 + if(min_name.length>4) min_name=min_name.substring(0, 8);
  81 + return min_name;
  82 + },
  83 +
  84 + toFix: function (val, count,set) {
  85 + if(val===undefined) return 0;
  86 + if(val===null) return 0;
  87 + if(val==='') return 0;
  88 + val = parseFloat(val);
  89 + if(set==1 && val==0) return val;
  90 + return val.toFixed(count)
  91 + },
  92 +
  93 + //折扣数值处理,小数位数为1时,只显示1位;小数位数为2时,才显示2位;
  94 + num: function(value) {
  95 + if(value != 0) {
  96 + return parseFloat(value);
  97 + } else {
  98 + return value.toFixed(0);
  99 + };
  100 + },
  101 +}
  102 +module.exports = {
  103 + is_has_rank:g_filters.is_has_rank,
  104 + get_card_price:g_filters.get_card_price,
  105 + num:g_filters.num,
  106 +}
0 107 \ No newline at end of file
... ...
packageC/pages/presell/goodsInfo/goodsInfo.js 0 → 100644
Changes suppressed. Click to show
  1 +var t = require("../../../../utils/util.js"),
  2 + ut = t,
  3 + e = require("../../../../utils/common.js"),
  4 + a = require("../../../../utils/wxParse/wxParse.js"),
  5 + s = getApp(),
  6 + i = s.request,
  7 + rq = i,
  8 + oo = s.globalData,
  9 + o = s.globalData.setting,
  10 + os = o;
  11 +//评价加载更多
  12 +var more = function(e) {
  13 + return e && e.__esModule ? e : {
  14 + default: e
  15 + };
  16 + }(require("../../../../utils/LoadMore.js")),
  17 + n = new more.default();
  18 +var utils = require('../../../../utils/util.js');
  19 +var regeneratorRuntime = require('../../../../utils/runtime.js');
  20 +
  21 +Page({
  22 + data: {
  23 + start_stop: 2, //秒杀开始 结束 的控制(1正在进行,2即将开始)
  24 + color_type: 0, //线条控制
  25 + color_type_one: 0,
  26 + color_type_two: 1,
  27 +
  28 + gid: "",
  29 + stoid: o.stoid,
  30 + url: o.url,
  31 + resourceUrl: o.h5_url, //公众号那边的图片文件域名
  32 + iurl: o.imghost,
  33 + defaultAvatar: o.resourceUrl + "/static/images/user68.jpg",
  34 +
  35 + data: null,
  36 + content: "", //商品详情
  37 + comments: null, //商品评论
  38 + c_curr_p: 1, //评论分页
  39 + com_num: 0, //评论人数
  40 + gallery: null, //图片滚动
  41 + is_collect: 0,
  42 + collect_id: 0,
  43 + cartGoodsNum: 0,
  44 + specSelect: 0,
  45 + optionItemId: 0,
  46 + goodsInputNum: 1,
  47 + openSpecModal: !1,
  48 + openSpecModal_pt: !1, //拼单的弹起,
  49 + openPromModal: !1,
  50 + activeCategoryId: 0,
  51 + supportPageScroll: !1,
  52 + address: {
  53 + address: "",
  54 + district: 0
  55 + },
  56 + shipping: "",
  57 + shippingCost: 0,
  58 + enterAddressPage: !1,
  59 + categories: [{
  60 + name: "商品",
  61 + id: 0
  62 + }, {
  63 + name: "详情",
  64 + id: 1
  65 + }, {
  66 + name: "评价",
  67 + id: 2
  68 + }],
  69 + activeCategoryId2: 0,
  70 + categories2: [{
  71 + name: "商品详情",
  72 + id: 0
  73 + }, {
  74 + name: "规格参数",
  75 + id: 1
  76 + }],
  77 + activeCategoryId3: 1,
  78 + categories3: [{
  79 + name: "全部",
  80 + id: 1,
  81 + num: 0
  82 + },
  83 + {
  84 + name: "有图",
  85 + id: 5,
  86 + num: 0
  87 + },
  88 +
  89 + {
  90 + name: "好评",
  91 + id: 2,
  92 + num: 0
  93 + }, {
  94 + name: "中评",
  95 + id: 3,
  96 + num: 0
  97 + }, {
  98 + name: "差评",
  99 + id: 4,
  100 + num: 0
  101 + },
  102 + ],
  103 +
  104 + select: {
  105 + price: 0,
  106 + stock: 0,
  107 + specName: "",
  108 + activity: null
  109 + },
  110 +
  111 + //已选的商品(属性)
  112 + sele_g_spec_name: '',
  113 + sele_g_id: '',
  114 + sele_g: null,
  115 + //门店相关
  116 + ismend: 0,
  117 + is_sec_mend: 0,
  118 + sto_sele_name: "", //选中的门店名称
  119 + sto_sele_id: "", //选中的门店id
  120 + sto_sele_distr: "", //选择的门店的配送方式
  121 + is_show_sto_cat: 1, //是否显示门店分类
  122 + only_pk: null,
  123 + all_sto: null,
  124 + sec_sto: null, //选择了的门店分类
  125 + pickpu_list: null, //读出的所有门店list
  126 + def_pickpu_list: null, //一开始5个门店list
  127 + sec_pick_index: 0, //第二级门店选择ID
  128 + fir_pick_index: 0, //第一级门店选择ID
  129 + all_pick_list:null,//所有的门店先记录起来
  130 + //同一条形码的所有商品
  131 + sku_g: null,
  132 + sku_g_pt: null, //---拼单的普通购买---
  133 + //联系电话
  134 + mobile: '',
  135 + //分类,品牌,国别名称
  136 + cat_name: '',
  137 + brand_name: '',
  138 + nation_name: '',
  139 +
  140 + //商品的活动类型 0普通 1秒杀 2团购 3优惠 4 积分购 6拼单
  141 + prom_type: 0,
  142 + prom_time_text: "",
  143 + prom_price: null,
  144 + prom_buy_limit: 0,
  145 + djs: null,
  146 + prom_st: 0,
  147 + prom_r_null: 0,
  148 + prom_end_time: null,
  149 + prom_start_time: null,
  150 + prom_act: null,
  151 + pd_xx: 0,
  152 + is_normal: 0, //是否普通购买
  153 + teamgroup: null, //有多少人开团
  154 + grounp_tatal: 0, //有几个人开团
  155 + timer: [],
  156 +
  157 + //商品的购买次数
  158 + prom_buy_num: -1,
  159 + g_buy_num: null,
  160 + prom_goods_num: 0, //活动商品数量
  161 + prom_buy_num: 0, //活动商品购买数量
  162 + prom_redis_num: 0, //活动商品redis数量
  163 +
  164 + //拼单的规则显示
  165 + is_show_gz: 0,
  166 + //会员自己的购买的拼单商品的情况
  167 + user_order_pt_state: 0,
  168 + //购买的订单
  169 + buy_order: null,
  170 + //1加入购物车 2立即购买
  171 + openSpecModal_ind: 0,
  172 +
  173 + //---计时器开关----
  174 + is_timer: 1,
  175 + isshow: 0,
  176 + bconfig: null, //基础配置
  177 +
  178 + fir_comments: null, //详情页上的评价
  179 + fir_quan: null, //详情页上的券
  180 + quan_list: null, //券列表
  181 +
  182 + coupon: 0,
  183 + //会员分享的头像
  184 + share_head: "",
  185 + share_goods_img: "",
  186 +
  187 + //----------视频图片data参数---------
  188 + current: 0, //图片计数
  189 + swiperCurrent: 0, //轮播的下标
  190 + hiddenn: 0, //控制轮播计数显示
  191 +
  192 + currentTab: 0, // 选择器控制参数
  193 + mapurl: "",
  194 + mapurl_f_img: "",
  195 + videopicture: 0, //视频图片的控制
  196 +
  197 + video: 0, //视频图片切换器
  198 + index: 0,
  199 + noon: 0, //开始视频的隐藏
  200 +
  201 + screenWidth: 0,
  202 + canvasHidden: 1,
  203 +
  204 + //--推荐--
  205 + store_config: null,
  206 + is_show_pl: 0, //是否品类
  207 + is_show_pp: 0, //是否品牌
  208 + is_show_gb: 0, //是否国别
  209 + is_closecoupon: 0,
  210 +
  211 + //是否点赞中
  212 + iszaning: 0,
  213 +
  214 + select_store: 0, //选择更多
  215 + index: 1,
  216 + more_store: 0, //选择门店
  217 + sort_store: 0, //门店分类
  218 + choice_sort_store: 0, //选择分类门店
  219 + new_user: 0, //新用户
  220 +
  221 + def_pick_store: null, // 默认的门店
  222 + fir_def_store:null, //客户默认的门店的
  223 + lat: null, //维度
  224 + lon: null, //经度
  225 +
  226 + is_get_local_ok: 0, //获取坐标是否完成
  227 + region_name: "门店分类", //区域的名字
  228 + is_gps: 1,
  229 + open_ind_store: 0, //哪里打开的门店列表的控制属性
  230 + default_store: {}, //创建添加默认门店地址的对象
  231 +
  232 + comments_no_more:0,
  233 + get_c:0, //获取评价是不是成
  234 + is_collect_load:0, //是不是处理
  235 + is_newsales_rules:0, //是否开启最新的门店规则,此时会新读门店,当点击选择门店时会触发读取线下库存
  236 + sales_rules:1, //默认是线上销售
  237 +
  238 + wait_for_user_store:null,
  239 + prom_goods:null, //商品优惠列表
  240 + order_prom:null, //订单优惠
  241 + collocationGoods:null, //搭配购
  242 +
  243 + poster:null, //自定义海报
  244 + share_b_img:'', //自定义分享的背景
  245 +
  246 + showPoster: false,
  247 + hui_condition:null,
  248 + sto_sele_name_1:'',//分享的门店名称
  249 + fir_goods:null,
  250 +
  251 + share_hidden: false,
  252 + },
  253 +
  254 + //------初始化加载----------
  255 + onLoad: function(t) {
  256 +
  257 +
  258 +
  259 + var ee = this,
  260 + that = ee,
  261 + th = ee,
  262 + gid = t.goods_id,
  263 + first_leader=t.first_leader,
  264 + room_id=t.room_id,
  265 + room_user_share=t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id
  266 +
  267 + //-- 自定义海报 --
  268 + getApp().request.promiseGet("/api/weshop/goods/poster/page", {
  269 + data:{store_id:os.stoid, type:1, is_use:1}
  270 + }).then(res=>{
  271 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0]){
  272 +
  273 + var poster_data=res.data.data.pageData[0];
  274 + var json_str=poster_data.jsonStr;
  275 +
  276 + if(json_str){
  277 + var json_data=JSON.parse(json_str);
  278 + if(json_data.bg_img){
  279 +
  280 + //-- 把图片那到本地 --
  281 + wx.getImageInfo({
  282 + src:json_data.bg_img,
  283 + success: function(res) {
  284 + var path= res.path;
  285 + th.setData({share_b_img:path})
  286 + },
  287 + fail: function(res) {}
  288 + });
  289 + }
  290 + th.setData({poster:json_data})
  291 +
  292 + }
  293 + }
  294 + })
  295 +
  296 + //---获取手机地址坐标--
  297 + //--如果tg_id是空的话,分享回来--
  298 + if (gid == undefined || gid == null || gid == "") {
  299 + var gid_str = decodeURIComponent(t.scene);
  300 + gid_str=gid_str.split("_");
  301 + gid=gid_str[0];
  302 + if(gid_str.length>1){
  303 + first_leader=gid_str[1];
  304 + }
  305 + //-- 如果有room_id的获取 --
  306 + if(gid_str.length>2 && gid_str[2]){
  307 + room_id=gid_str[2];
  308 + room_user_share=1;
  309 + }
  310 +
  311 + }
  312 + ee.setData({ gid: gid});
  313 + if(first_leader){
  314 + console.log("log---".first_leader);
  315 + getApp().globalData.first_leader=first_leader;
  316 + //调用接口判断是不是会员
  317 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
  318 + if(res.data.code==0){
  319 + getApp().globalData.guide_id=res.data.data.id;
  320 + }
  321 + })
  322 + }
  323 +
  324 + //-- 如果有房间号 --
  325 + if(room_id){
  326 + getApp().globalData.room_id=room_id;
  327 + getApp().globalData.room_goods_id=gid;
  328 + //如果是会员分享过来的要记录
  329 + if(room_user_share)
  330 + getApp().globalData.room_user_share=room_user_share;
  331 + }
  332 +
  333 + var c_guide_id=t.c_guide_id;
  334 + if(c_guide_id){
  335 + th.data.c_guide_id=c_guide_id;
  336 + }
  337 +
  338 + getApp().getConfig(function(e) {
  339 + ee.setData({sto_sele_name_1:e.store_name})
  340 + })
  341 +
  342 + //----获取系统参数-----
  343 + getApp().getConfig2(function(e) {
  344 + ee.setData({
  345 + bconfig: e,
  346 + sales_rules:e.sales_rules,
  347 + });
  348 +
  349 + if (e.categoryset.indexOf("," + 1 + ",") != -1) {
  350 + ee.setData({
  351 + is_show_pl: 1
  352 + });
  353 + }
  354 + if (e.categoryset.indexOf("," + 3 + ",") != -1) {
  355 + ee.setData({
  356 + is_show_pp: 1
  357 + });
  358 + }
  359 + if (e.categoryset.indexOf("," + 2 + ",") != -1) {
  360 + ee.setData({
  361 + is_show_gb: 1
  362 + });
  363 + }
  364 +
  365 + var json_d = JSON.parse(e.switch_list);
  366 + ee.setData({
  367 + store_config: e,
  368 + sys_switch:json_d,
  369 + is_closecoupon: json_d.is_closecoupon,
  370 + is_newsales_rules:json_d.is_newsales_rules
  371 + });
  372 + ee.init(gid);
  373 + //------几人评价-------
  374 + //n.init(th, "", "comments");
  375 +
  376 + th.requestCardNum(), wx.pageScrollTo && th.setData({
  377 + supportPageScroll: !0
  378 + });
  379 +
  380 + //计算等级价相关
  381 + var swithc_list=e.switch_list;
  382 + var sw_arr=JSON.parse(swithc_list);
  383 + //---如果后台又开等级卡的开关---
  384 + if(sw_arr.rank_switch && sw_arr.rank_switch=="2"){
  385 + th.setData({rank_switch:true});
  386 + //---回调卡的列表---
  387 + th.getPlusCardType(function(ob){
  388 + th.setData({card_list:ob.card_list});
  389 + var ti = setInterval(function () {
  390 + var user = getApp().globalData.userInfo;
  391 + if (!user) return false;
  392 + clearInterval(ti);
  393 +
  394 + if(user.card_field && user['card_expiredate']){
  395 + var str = user['card_expiredate'].replace(/-/g, '/');
  396 + var end = new Date(str);
  397 + end = Date.parse(end) / 1000;
  398 + var now = ut.gettimestamp();
  399 + //--- 判断是等级会员,且在有效期范围内 ---
  400 + if(user.card_field && now<end){
  401 + var card_name=ob.name_map.get(user.card_field);
  402 + //if(card_name.length>6) card_name=card_name.substring(0,6);
  403 +
  404 + var is_near_date=0;
  405 + if(end-now<60*60*30*24) is_near_date=1; //如果小于30天
  406 + th.setData({card_field:user.card_field,card_name:card_name,card_list:ob.card_list,is_near_date:is_near_date});
  407 + }
  408 + }
  409 + }, 500)
  410 + })
  411 + }
  412 +
  413 + },1);
  414 +
  415 + //获取用户设备信息,屏幕宽度
  416 + wx.getSystemInfo({
  417 + success: res => {
  418 + that.setData({
  419 + screenWidth: res.screenWidth
  420 + })
  421 + }
  422 + });
  423 +
  424 + //获取用户的默认门店
  425 + getApp().get_user_store(function(e) {
  426 + if(!e) {
  427 + th.data.fir_def_store={}; //赋值空对象
  428 + return false;
  429 + }
  430 + var ee=JSON.parse(JSON.stringify(e));
  431 + //--定时器推迟一下--
  432 + setTimeout(function () {
  433 + if(th.data.fir_goods) var g_distr_type=th.data.fir_goods.distr_type;
  434 + //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
  435 + if(ee.distr_type!=0 && g_distr_type!=0 && ee.distr_type!=g_distr_type ){
  436 + //th.data.fir_def_store={}; //赋值空对象
  437 + //return false;
  438 + //th.data.fir_def_store.is_no_dis=1;
  439 + ee.is_no_dis=1;
  440 + }
  441 +
  442 + var appd=getApp().globalData;
  443 + var w_time = setInterval(function() {
  444 + if (that.data.is_get_local_ok == 0) return false;
  445 + clearInterval(w_time);
  446 + var distance = null;
  447 + var e=JSON.parse(JSON.stringify(ee));
  448 +
  449 + //如果有开启近距离的话,同时距离优不一样了
  450 + if (that.data.lat != null) {
  451 + //如果经纬度有变化的话
  452 + if(e && appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){
  453 + //that.data.fir_def_store=e;
  454 + // that.setData({
  455 + // def_pick_store: e,
  456 + // sto_sele_name: e.pickup_name,
  457 + // sto_sele_id: e.pickup_id,
  458 + // sto_sele_distr: e.distr_type
  459 + // })
  460 + that.set_def_storage(e);
  461 +
  462 + }else{
  463 + //要用接口是获取距离,js的计算不准
  464 + getApp().request.promiseGet("/api/weshop/pickup/list",{
  465 + data:{store_id:os.stoid,pickup_id:e.pickup_id,lat:th.data.lat,lon: th.data.lon},
  466 + }).then(res=>{
  467 + if(res.data.code==0){
  468 + e=res.data.data.pageData[0];
  469 + if (e){
  470 + e.is_no_dis=ee.is_no_dis;
  471 + appd.pk_store=e;
  472 + // that.data.fir_def_store=e;
  473 + // that.setData({
  474 + // def_pick_store: e,
  475 + // sto_sele_name: e.pickup_name,
  476 + // sto_sele_id: e.pickup_id,
  477 + // sto_sele_distr: e.distr_type
  478 + // })
  479 + that.set_def_storage(e);
  480 + }
  481 +
  482 + }
  483 + })
  484 + }
  485 + //e.distance = distance;
  486 + appd.lat=that.data.lat;
  487 + appd.lon=that.data.lon;
  488 +
  489 + }else{
  490 + if (e) {
  491 + e.distance = null;
  492 + // that.data.fir_def_store=e;
  493 + // that.setData({
  494 + // def_pick_store: e,
  495 + // sto_sele_name: e.pickup_name,
  496 + // sto_sele_id: e.pickup_id,
  497 + // sto_sele_distr: e.distr_type
  498 + // })
  499 + that.set_def_storage(e);
  500 + }
  501 + }
  502 + }, 500)
  503 + },700)
  504 + });
  505 +
  506 + //更新点击量
  507 + getApp().request.put("/api/weshop/goods/updateClick",{
  508 + data:{store_id:os.stoid,goods_id:gid}
  509 + })
  510 + },
  511 +
  512 +
  513 + //--- 设置一下默认库存的数量 ----
  514 + set_def_storage(ee){
  515 + var that=this,th=this;
  516 + getApp().getConfig2(function(e){
  517 + var sales_rules=e.sales_rules;
  518 + if(sales_rules==2){
  519 + getApp().waitfor2(that,"wait_for_user_store","fir_goods",function(){
  520 + var lock=0,plist=null;
  521 + var gd=that.data.fir_goods;
  522 + //先读取门店的lock,采用链式写法,少用await
  523 + getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{
  524 + data:{store_id:os.stoid,wareId:that.data.fir_goods.goods_id,storageId:ee.pickup_id,pageSize:1000}
  525 + }).then(res=>{
  526 + if(res.data.code==0 && res.data.data.total>0){
  527 + for(var i in res.data.data.pageData)
  528 + lock+=res.data.data.pageData[i].outQty
  529 + }
  530 + //---通过接口获取门店的线下库存信息--
  531 + return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{
  532 + data:{storageNos:ee.pickup_no,wareIds:encodeURIComponent(th.data.data.erpwareid),storeId:os.stoid}
  533 + })
  534 + }).then(res=>{
  535 + if(res.data.code==0 && res.data.data.total>0){
  536 + plist=res.data.data.pageData[0];
  537 + }
  538 + if(plist && plist.CanOutQty-lock>0){
  539 + ee.CanOutQty=plist.CanOutQty-lock;
  540 + }else{
  541 + ee.CanOutQty=0;
  542 + }
  543 + //--给门店赋值线下库存--
  544 + that.data.fir_def_store=ee;
  545 + that.setData({
  546 + def_pick_store: ee,
  547 + sto_sele_name: ee.pickup_name,
  548 + sto_sele_id: ee.pickup_id,
  549 + sto_sele_distr: ee.distr_type
  550 + })
  551 + })
  552 + })
  553 + }else{
  554 + that.data.fir_def_store=ee;
  555 + that.setData({
  556 + def_pick_store: ee,
  557 + sto_sele_name: ee.pickup_name,
  558 + sto_sele_id: ee.pickup_id,
  559 + sto_sele_distr: ee.distr_type
  560 + })
  561 + }
  562 + })
  563 +
  564 + },
  565 +
  566 +
  567 + //------------程序初始化入口-------------
  568 + async init(gid) {
  569 + var ee = this,
  570 + th = ee,
  571 + gallery = null,
  572 + is_collect = 0,
  573 + collect_id = 0,
  574 + categories3 = ee.data.categories3,
  575 + fir_com = null,
  576 + fir_quan = null,
  577 + mapurl = null,
  578 + mapurl_f_img = null;
  579 +
  580 +
  581 + //------图片滚动----------
  582 + await getApp().request.promiseGet("/api/weshop/goodsimages/page", {
  583 + data: {
  584 + store_id: os.stoid,
  585 + goods_id: gid,
  586 + },
  587 + }).then(res => {
  588 +
  589 + var t = res;
  590 + var g = t.data.data.pageData;
  591 + if (g.length == 0) {
  592 + var ie = {
  593 + "image_url": o.imghost + "/public/images/default_goods_image_240.gif"
  594 + };
  595 + g.push(ie);
  596 + gallery = g;
  597 + return;
  598 + }
  599 + for (var i = 0; i < g.length; i++) {
  600 + if (g[i].image_url.indexOf(o.imghost) == -1)
  601 + g[i].image_url = o.imghost + g[i].image_url;
  602 + }
  603 + gallery = g;
  604 + })
  605 + //------是否收藏----------
  606 + await getApp().request.promiseGet("/api/weshop/goodscollect/page", {
  607 + data: {
  608 + store_id: os.stoid,
  609 + goods_id: gid,
  610 + user_id: oo.user_id,
  611 + }
  612 + }).then(res => {
  613 + var t = res;
  614 + var data = t.data.data.pageData;
  615 + if (data.length > 0) {
  616 + //ee.setData({ is_collect: 1, collect_id: data[0].collect_id, });
  617 + is_collect = 1;
  618 + collect_id = data[0].collect_id;
  619 + }
  620 + })
  621 +
  622 + //------获取评价的统计数量----
  623 + await getApp().request.promiseGet("/api/weshop/comment/countlist/", {
  624 + data: {
  625 + store_id: os.stoid,
  626 + goods_id: gid
  627 + },
  628 + //failRollback: !0,
  629 +
  630 + }).then(res => {
  631 + var t = res;
  632 + var g = t.data.data[0];
  633 + if (g != null && g != undefined) {
  634 + var allnum = g.c0 + g.c1 + g.c2 + g.c3 + g.c4 + g.c5;
  635 + var num2 = g.c4 + g.c5;
  636 + var num3 = g.c3;
  637 + var num4 = g.c0 + g.c1 + g.c2;
  638 +
  639 + var dd = ee.data.categories3;
  640 + dd[0].num = allnum;
  641 + dd[1].num = g.cimg;
  642 + dd[2].num = num2;
  643 + dd[3].num = num3;
  644 + dd[4].num = num4;
  645 +
  646 + categories3 = dd;
  647 + }
  648 + })
  649 +
  650 + //----获取详情页的评价----
  651 + await getApp().request.promiseGet("/api/weshop/comment/pageComment", {
  652 + data: {
  653 + store_id: os.stoid,
  654 + goods_id: gid,
  655 + pageSize: 3,
  656 + parent_id: 0,
  657 + page:1,
  658 + is_show:1,
  659 + },
  660 + }).then(res => {
  661 + fir_com = res.data.data.pageData;
  662 + })
  663 +
  664 + if (fir_com) {
  665 + for (var ind in fir_com) {
  666 + if (fir_com[ind].head_pic == "") fir_com[ind].head_pic = ee.data.iurl + "/miniapp/images/hui_hear_pic.png";
  667 + if (fir_com[ind].img) fir_com[ind].img = ut.unserialize(fir_com[ind].img);
  668 + if (fir_com[ind].weapp_img) fir_com[ind].weapp_img = JSON.parse(fir_com[ind].weapp_img);
  669 + }
  670 + }
  671 +
  672 + if (th.data.is_closecoupon != 1) {
  673 + //----获取详情页的券的数量----
  674 + await getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", {
  675 + data: {
  676 + store_id: os.stoid,
  677 + type: 1,
  678 + pageSize: 3,
  679 + page: 1,
  680 + is_share:0,
  681 + },
  682 + }).then(res1 => {
  683 + fir_quan = res1.data.data.pageData;
  684 + })
  685 + }
  686 +
  687 + //--------获取视频图片---------
  688 + await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, {
  689 + 1: 1
  690 + }).then(res1 => {
  691 + if (res1.data.code == 0) {
  692 + mapurl = res1.data.data.video_url;
  693 + mapurl_f_img = res1.data.data.video_img;
  694 + }
  695 + })
  696 +
  697 + ee.setData({
  698 + gallery: gallery,
  699 + is_collect: is_collect,
  700 + collect_id: collect_id,
  701 + categories3: categories3,
  702 + fir_quan: fir_quan,
  703 + fir_comments: fir_com,
  704 + mapurl_f_img: mapurl_f_img,
  705 + mapurl: mapurl,
  706 + });
  707 +
  708 + },
  709 +
  710 + //---展示---
  711 + onShow: function() {
  712 + console.log('djfijsaoifjoisadjfoij');
  713 + var goods_list = null,th = this,that=this;
  714 + var show_prew_img= this.data.show_prew_img
  715 + if(show_prew_img){
  716 + show_prew_img=0;
  717 + return false;
  718 + }
  719 +
  720 + //优惠券要实时更新
  721 + getApp().getConfig2(function(e) {
  722 + var json_d = JSON.parse(e.switch_list);
  723 + th.setData({is_closecoupon: json_d.is_closecoupon})
  724 + th.setData({is_open_offline: json_d.is_pricing_open})
  725 + },1)
  726 +
  727 +
  728 + var ui = setInterval(function () {
  729 + goods_list = th.selectComponent("#goods_list");
  730 + if (goods_list) {
  731 + clearInterval(ui);
  732 + goods_list.init();
  733 + return false
  734 + }
  735 + }, 300)
  736 +
  737 + this.data.is_timer = 1;
  738 + var ee = this,
  739 + gid = this.data.gid,
  740 + i = getApp().request;
  741 +
  742 + this.wait_for_store_config();
  743 +
  744 + i.get("/api/weshop/goods/get/" + o.stoid + "/" + ee.data.gid, {
  745 + failRollback: !0,
  746 + success: function(t) {
  747 + if (t.data.code == 0) {
  748 + if (t.data.data.is_on_sale != 1) {
  749 + wx.showModal({
  750 + title: '商品已经下架',
  751 + showCancel: !1,
  752 + complete: function() {
  753 + wx.navigateBack();
  754 + }
  755 + });
  756 + }
  757 +
  758 + var timestamp = Date.parse(new Date());
  759 + timestamp = timestamp / 1000;
  760 + if (t.data.data.on_time > timestamp) {
  761 + wx.showModal({
  762 + title: '商品还未上架',
  763 + showCancel: !1,
  764 + complete: function() {
  765 + wx.navigateBack();
  766 + }
  767 + });
  768 + }
  769 +
  770 + if (t.data.data.down_time > 0) {
  771 + if (t.data.data.down_time < timestamp) {
  772 + wx.showModal({
  773 + title: '商品已经到期下架',
  774 + showCancel: !1,
  775 + complete: function() {
  776 + wx.navigateBack();
  777 + }
  778 + });
  779 + }
  780 + }
  781 + //动态获取商品名称
  782 + wx.setNavigationBarTitle({
  783 + title: t.data.data.goods_name,
  784 + });
  785 +
  786 + //-- 判断是不是组合购活动,必须要登录后才能判断 --
  787 + if(getApp().globalData.userInfo && t.data.data.prom_type==7 ){
  788 + //获取活动信息
  789 + var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" +
  790 + t.data.data.prom_id+"/"+getApp().globalData.userInfo.user_id;
  791 + getApp().request.get(url, {
  792 + success:function (e) {
  793 + if (e.data.code == 0 && e.data.data) {
  794 + if(ut.gettimestamp()<e.data.data.start_time){
  795 + return false;
  796 + }
  797 + if (e.data.data.is_end == 0 && ut.gettimestamp()<e.data.data.end_time ) {
  798 + //-- 获取商品列表 --
  799 + th.setData({zh_act:e.data.data });
  800 + }
  801 +
  802 + }
  803 + }
  804 + });
  805 + }
  806 +
  807 + //-- 把商品的赋值 --
  808 + ee.data.fir_goods=JSON.parse(JSON.stringify(t.data.data));
  809 + ee.check_is_youhui(ee.data.gid);
  810 +
  811 + t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss');
  812 +
  813 + var cur_price=t.data.data.shop_price;
  814 + if(getApp().globalData.userInfo && getApp().globalData.userInfo.card_field){
  815 + var cfile=getApp().globalData.userInfo.card_field;
  816 + if(t.data.data[cfile]){
  817 + cur_price=t.data.data[cfile];
  818 + }
  819 + }
  820 + var txt =(cur_price / t.data.data.market_price * 10).toFixed(2).toString();
  821 + txt=parseFloat(txt);
  822 +
  823 + t.data.data['disc'] = txt;
  824 +
  825 + if (t.data.data.original_img.indexOf(o.imghost) == -1)
  826 + t.data.data.original_img = o.imghost + t.data.data.original_img;
  827 +
  828 + if (t.data.data.goods_content == null) t.data.data.goods_content = "";
  829 +
  830 + //-----商品详情---
  831 + if(!t.data.data.goods_content) t.data.data.goods_content=" ";
  832 + a.wxParse("content", "html", t.data.data.goods_content, ee, 6);
  833 + e.wxParseAddFullImageUrl(ee, "content");
  834 +
  835 + ee.setData({
  836 + data: t.data.data,
  837 + sele_g: t.data.data,
  838 + userInfo:getApp().globalData.userInfo
  839 + });
  840 +
  841 +
  842 + //获取统一条形码,普通商品和优惠促销的商品
  843 + 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 || ee.data.data.prom_type == 7){
  844 + //默认门店要拿下门店库存
  845 + if(that.data.sales_rules==2 && that.data.is_newsales_rules){
  846 + //获取门店
  847 + ee.get_sto();
  848 + //--等待某个值只运行---,这里有可能因为导航的时间太久,而不能计算门店库存
  849 + /*---
  850 + getApp().waitfor2(that,"wait_for_user_store","fir_def_store",function(){
  851 + if(th.data.fir_def_store && th.data.fir_def_store.pickup_id ){
  852 + var lock=0,plist=null;
  853 + //先读取门店的lock,采用链式写法,少用await
  854 + getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{
  855 + data:{store_id:os.stoid,wareId:ee.data.data.goods_id,storageId:that.data.fir_def_store.pickup_id,pageSize:1000}
  856 + }).then(res=>{
  857 + if(res.data.code==0 && res.data.data.total>0){
  858 + for(var i in res.data.data.pageData)
  859 + lock+=res.data.data.pageData[i].outQty
  860 + }
  861 + //---通过接口获取门店的线下库存信息--
  862 + return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{
  863 + data:{storageNos:that.data.fir_def_store.pickup_no,wareIds:encodeURIComponent(th.data.data.erpwareid),storeId:os.stoid}
  864 + })
  865 + }).then(res=>{
  866 + if(res.data.code==0 && res.data.data.total>0){
  867 + plist=res.data.data.pageData[0];
  868 + }
  869 + if(plist && plist.CanOutQty-lock>0){
  870 + that.data.fir_def_store.CanOutQty=plist.CanOutQty-lock;
  871 + }else{
  872 + that.data.fir_def_store.CanOutQty=0;
  873 + }
  874 + //--给门店赋值线下库存--
  875 + th.setData({def_pick_store:that.data.fir_def_store});
  876 + })
  877 + }
  878 + })--*/
  879 + }else{
  880 + //获取门店
  881 + ee.get_sto();
  882 + }
  883 +
  884 + ee.get_sku(o.stoid, t.data.data, gid);
  885 + }
  886 + else {
  887 + var gg = "", item = t.data.data;
  888 +
  889 + if(item.goods_spec=="null" || item.goods_spec==null ) item.goods_spec="";
  890 + if(item.goods_color=="null" || item.goods_color==null) item.goods_color="";
  891 +
  892 + if (item.goods_spec != "" && item.goods_color != "") {
  893 + gg = item.goods_spec + "/" + item.goods_color;
  894 + } else if (item.goods_spec != "" || item.goods_color != "") {
  895 + gg = item.goods_spec + item.goods_color;
  896 + } else {
  897 + gg = "规格1";
  898 + }
  899 + t.data.data.gg = gg;
  900 + var uu = [];
  901 + uu.push(t.data.data);
  902 + ee.setData({
  903 + sku_g: uu,
  904 + });
  905 + }
  906 + ee.data.g_buy_num = new Map();
  907 + ee.check_prom(gid, ee.data.data.prom_type, ee.data.data.prom_id);
  908 +
  909 + var th = ee;
  910 + if (ee.data.cat_name == '') {
  911 + //过去国别,分类,品牌的名称
  912 + i.get("/api/weshop/goodscategory/get/" + o.stoid + "/" + th.data.data.cat_id, {
  913 + success: function(t) {
  914 + var dd = t.data.data;
  915 + if (t.data.code == 0) {
  916 + th.setData({
  917 + cat_name: dd.name
  918 + });
  919 + }
  920 + }
  921 + });
  922 + //过去国别,分类,品牌的名称
  923 + i.get("/api/weshop/brand/get/" + o.stoid + "/" + th.data.data.brand_id, {
  924 + success: function(t) {
  925 + var dd = t.data.data;
  926 + if (t.data.code == 0) {
  927 + th.setData({
  928 + brand_name: dd.name
  929 + });
  930 + }
  931 + }
  932 + });
  933 + //过去国别,分类,品牌的名称
  934 + i.get("/api/weshop/nation/get/" + o.stoid + "/" + th.data.data.nation_id, {
  935 + success: function(t) {
  936 + var dd = t.data.data;
  937 + if (t.data.code == 0) {
  938 + th.setData({
  939 + nation_name: dd.name
  940 + });
  941 + }
  942 + }
  943 + });
  944 + }
  945 +
  946 + }
  947 + else{
  948 + wx.showModal({
  949 + title: t.data.msg,
  950 + showCancel: !1,
  951 + complete: function() {
  952 + wx.navigateBack();
  953 + }
  954 + });
  955 + }
  956 + }
  957 + });
  958 + this.data.enterAddressPage && (this.data.enterAddressPage = !1);
  959 +
  960 + },
  961 + enterAddress: function() {
  962 + this.data.enterAddressPage = !0, wx.navigateTo({
  963 + url: "/pages/user/address_list/address_list?operate=selectAddress"
  964 + });
  965 + },
  966 + onUnload: function() {
  967 + for(var i = 1; i < 100; i++) {
  968 + clearInterval(i);
  969 + }
  970 + },
  971 + onHide: function() {
  972 + this.data.is_timer = 0;
  973 + for(var i = 1; i < 100; i++) {
  974 + clearInterval(i);
  975 + }
  976 + },
  977 + //----------三个选项按钮-----------
  978 + tabClick: function(t) {
  979 + var e = t.currentTarget.id;
  980 + this.setData({
  981 + activeCategoryId: e
  982 + }), 1 == e ? this.tabGoodsContent() : 2 == e && this.tabComment();
  983 + },
  984 + tabClick2: function(t) {
  985 + this.setData({
  986 + activeCategoryId2: t.currentTarget.id
  987 + });
  988 + },
  989 +
  990 + tabClick3: function(t) {
  991 + var e = this;
  992 + if (t.currentTarget.id != this.data.activeCategoryId3) {
  993 + e.data.c_curr_p = 1;
  994 + this.setData({
  995 + activeCategoryId3: t.currentTarget.id,
  996 + comments: null,comments_no_more:0,get_c:0,
  997 + });
  998 + this.requestComments_new();
  999 + }
  1000 + },
  1001 +
  1002 + doScrollTop: function() {
  1003 + wx.pageScrollTo({
  1004 + scrollTop: 0
  1005 + });
  1006 + },
  1007 +
  1008 + tabComment: function() {
  1009 + this.setData({
  1010 + activeCategoryId: 2,comments_no_more:0,get_c:0
  1011 + }), this.data.comments || this.requestComments_new();
  1012 + },
  1013 +
  1014 + //商品详情的时候调用
  1015 + tabGoodsContent: function() {
  1016 + var th = this,
  1017 + i = getApp().request;
  1018 + this.setData({
  1019 + activeCategoryId: 1
  1020 + });
  1021 +
  1022 + if (th.data.cat_name == '') {
  1023 + //过去国别,分类,品牌的名称
  1024 + i.get("/api/weshop/goodscategory/get/" + o.stoid + "/" + th.data.data.cat_id, {
  1025 + success: function(t) {
  1026 + var dd = t.data.data;
  1027 + if (t.data.code == 0) {
  1028 + th.setData({
  1029 + cat_name: dd.name
  1030 + });
  1031 + }
  1032 + }
  1033 + });
  1034 + //过去国别,分类,品牌的名称
  1035 + i.get("/api/weshop/brand/get/" + o.stoid + "/" + th.data.data.brand_id, {
  1036 + success: function(t) {
  1037 + var dd = t.data.data;
  1038 + if (t.data.code == 0) {
  1039 + th.setData({
  1040 + brand_name: dd.name
  1041 + });
  1042 + }
  1043 + }
  1044 + });
  1045 + //过去国别,分类,品牌的名称
  1046 + i.get("/api/weshop/nation/get/" + o.stoid + "/" + th.data.data.nation_id, {
  1047 + success: function(t) {
  1048 + var dd = t.data.data;
  1049 + if (t.data.code == 0) {
  1050 + th.setData({
  1051 + nation_name: dd.name
  1052 + });
  1053 + }
  1054 + }
  1055 + });
  1056 + }
  1057 + },
  1058 +
  1059 + //获取redis中的数量
  1060 + async getactLen(func) {
  1061 + var r_num = 0,
  1062 + prom_type = this.data.prom_type,
  1063 + prom_id = this.data.prom_id;
  1064 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
  1065 + 1: 1
  1066 + }).then(res => {
  1067 + var em = res;
  1068 + if (em.data.code == 0) {
  1069 + r_num = em.data.data;
  1070 + }
  1071 + })
  1072 + func(r_num);
  1073 + },
  1074 +
  1075 + //------------加入购物车--------------
  1076 + addCart: function(t) {
  1077 + var th = this;
  1078 + var ind = t.currentTarget.dataset.openSpecModal_ind;
  1079 + if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind;
  1080 + th.setData({
  1081 + open_ind_store: ind
  1082 + });
  1083 + //如果是秒杀的话,要看redis够不够
  1084 + if (this.data.prom_type == 1) {
  1085 + this.getactLen(function(num) {
  1086 + if (num < th.data.goodsInputNum) {
  1087 + getApp().my_warnning("秒杀库存不足!", 0, th);
  1088 + return false;
  1089 + } else {
  1090 + th.add_cart_func(t);
  1091 + }
  1092 + });
  1093 + } else {
  1094 + th.add_cart_func(t);
  1095 + }
  1096 + },
  1097 +
  1098 +
  1099 +
  1100 + //-- 加入购物的函数 --
  1101 + add_cart_func_inte: function(t) {
  1102 + var i = getApp().request;
  1103 + if (oo.user_id == null) {
  1104 + return s.my_warnning("还未登录!", 0, this);
  1105 + }
  1106 + if(!getApp().globalData.userInfo){
  1107 + return s.my_warnning("还未登录!", 0, this);
  1108 + }
  1109 +
  1110 + var e = this,
  1111 + th = e,
  1112 + a = 0,
  1113 + o = this.data.data;
  1114 + a = o.goods_id;
  1115 +
  1116 + //----------添加到购物车时,要判断限购数量,--------
  1117 + e.get_buy_num(o, function(ee) {
  1118 + //---判断商品是否超出限购---
  1119 + if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
  1120 + if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {
  1121 + wx.showModal({
  1122 + title: '提示',
  1123 + content: '超出商品限购'
  1124 + });
  1125 + return false;
  1126 + }
  1127 + }
  1128 + //---判断商品是否超出活动限购---
  1129 + if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
  1130 + if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {
  1131 + wx.showModal({
  1132 + title: '提示',
  1133 + content: '超出商品活动限购'
  1134 + });
  1135 + return false;
  1136 + }
  1137 + }
  1138 +
  1139 + if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);
  1140 + if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)
  1141 + this.setData({
  1142 + sto_sele_name: ""
  1143 + });
  1144 + if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);
  1145 +
  1146 + //--------------此时操作的数据------------
  1147 + var newd = {
  1148 + goods_id: o.goods_id,
  1149 + goods_num: th.data.goodsInputNum,
  1150 + pick_id: th.data.sto_sele_id,
  1151 + user_id: oo.user_id,
  1152 + store_id: th.data.stoid,
  1153 + goods_price: th.data.prom_price,
  1154 + integral:th.data.prom_integral,
  1155 + member_goods_price: o.shop_price,
  1156 + goods_name: o.goods_name,
  1157 + goods_sn: o.goods_sn,
  1158 + sku: o.sku,
  1159 + };
  1160 +
  1161 + //---是不是从收藏夹出来的---
  1162 + if(th.data.c_guide_id){
  1163 + newd['guide_id'] = th.data.c_guide_id;
  1164 + newd['guide_type']=2;
  1165 + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=3;
  1166 + }else{
  1167 + if(getApp().globalData.guide_id){
  1168 + newd['guide_id'] = getApp().globalData.guide_id;
  1169 + newd['guide_type']=0;
  1170 + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=1;
  1171 + }
  1172 + }
  1173 +
  1174 + //让商品带上房间号
  1175 + //让商品带上房间号
  1176 + if(th.data.sys_switch.is_skuroom_id==1){
  1177 + if(th.data.data.goods_id==getApp().globalData.room_goods_id){
  1178 + newd.room_id=getApp().globalData.room_id;
  1179 + }
  1180 + }else{
  1181 + if(newd.goods_id==getApp().globalData.room_goods_id) newd.room_id=getApp().globalData.room_id;
  1182 + }
  1183 +
  1184 + //如果是积分够,is_integral_normal就要有积分购普通购买字段
  1185 + //if(o.prom_type==4){
  1186 + //newd.is_integral_normal=1;
  1187 + //}
  1188 +
  1189 + //-----如果是秒杀,团购,积分购,拼团-----
  1190 + newd.prom_type = th.data.prom_type;
  1191 + newd.prom_id = th.data.prom_id;
  1192 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
  1193 + if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
  1194 +
  1195 +
  1196 + th.add_cart_next(e,t,a,o,newd); //立即购买下一步
  1197 +
  1198 + })
  1199 + },
  1200 +
  1201 + //-- 加入购物的函数 --
  1202 + add_cart_func: function(t) {
  1203 + var i = getApp().request;
  1204 + if (oo.user_id == null) {
  1205 + return s.my_warnning("还未登录!", 0, this);
  1206 + }
  1207 +
  1208 + if(!getApp().globalData.userInfo){
  1209 + return s.my_warnning("还未登录!", 0, this);
  1210 + }
  1211 +
  1212 + var e = this,
  1213 + th = e,
  1214 + a = 0,
  1215 + o = this.data.sele_g;
  1216 + a = o.goods_id;
  1217 +
  1218 + //----------添加到购物车时,要判断限购数量,--------
  1219 + e.get_buy_num(o, function(ee) {
  1220 + //---判断商品是否超出限购---
  1221 + if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
  1222 + if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {
  1223 + wx.showModal({
  1224 + title: '提示',
  1225 + content: '超出商品限购'
  1226 + });
  1227 + return false;
  1228 + }
  1229 + }
  1230 + //---判断商品是否超出活动限购---
  1231 + if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
  1232 + if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {
  1233 + wx.showModal({
  1234 + title: '提示',
  1235 + content: '超出商品活动限购'
  1236 + });
  1237 + return false;
  1238 + }
  1239 + }
  1240 +
  1241 + if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);
  1242 + if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)
  1243 + this.setData({
  1244 + sto_sele_name: ""
  1245 + });
  1246 + if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);
  1247 +
  1248 + //--------------此时操作的数据------------
  1249 + var newd = {
  1250 + goods_id: o.goods_id,
  1251 + goods_num: th.data.goodsInputNum,
  1252 + pick_id: th.data.sto_sele_id,
  1253 + user_id: oo.user_id,
  1254 + store_id: th.data.stoid,
  1255 + goods_price: o.shop_price,
  1256 + member_goods_price: o.shop_price,
  1257 + goods_name: o.goods_name,
  1258 + goods_sn: o.goods_sn,
  1259 + sku: o.sku,
  1260 + };
  1261 +
  1262 + //---是不是从收藏夹出来的---
  1263 + if(th.data.c_guide_id){
  1264 + newd['guide_id'] = th.data.c_guide_id;
  1265 + newd['guide_type']=2;
  1266 + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=3;
  1267 + }else{
  1268 + if(getApp().globalData.guide_id){
  1269 + newd['guide_id'] = getApp().globalData.guide_id;
  1270 + newd['guide_type']=0;
  1271 + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=1;
  1272 + }
  1273 + }
  1274 +
  1275 + //让商品带上房间号
  1276 + //让商品带上房间号
  1277 + if(th.data.sys_switch.is_skuroom_id==1){
  1278 + if(th.data.data.goods_id==getApp().globalData.room_goods_id){
  1279 + newd.room_id=getApp().globalData.room_id;
  1280 + }
  1281 + }else{
  1282 + if(newd.goods_id==getApp().globalData.room_goods_id) newd.room_id=getApp().globalData.room_id;
  1283 + }
  1284 +
  1285 + //如果是积分够,is_integral_normal就要有积分购普通购买字段
  1286 + if(o.prom_type==4){
  1287 + newd.is_integral_normal=1;
  1288 + }
  1289 +
  1290 + //如果有线下取价
  1291 + if(o.offline_price){
  1292 + newd.offline_price=o.offline_price;
  1293 + newd.pricing_type=o.pricing_type;
  1294 + }
  1295 +
  1296 + //-----如果是秒杀,团购,积分购,拼团-----
  1297 + if (th.data.prom_type == 1) {
  1298 + newd.goods_price = th.data.prom_price;
  1299 + newd.member_goods_price = th.data.prom_price,
  1300 + newd.prom_type = th.data.prom_type;
  1301 + newd.prom_id = th.data.prom_id;
  1302 +
  1303 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
  1304 + if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
  1305 +
  1306 + th.add_cart_next(e,t,a,o,newd); //加入购物车下一步
  1307 +
  1308 + }else if(o.prom_type==7){
  1309 +
  1310 + //判断进行中的活动,是不是要判断线下库存
  1311 + th.check_zh_acting(function (ee){
  1312 + newd.prom_id = 0;
  1313 + newd.prom_type = 0;
  1314 + if(ee && th.data.sele_g.act){
  1315 + newd.prom_id = th.data.sele_g.act.id;
  1316 + newd.prom_type = 7;
  1317 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
  1318 + if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
  1319 + th.add_cart_next(e,t,a,o,newd); //加入购物车下一步
  1320 + return false;
  1321 + }else{
  1322 + //---如果是线下门店销售的时候---
  1323 + if(th.data.sales_rules==2){
  1324 + var pick=th.get_pick_from_list(th.data.sto_sele_id)
  1325 + //---通过接口获取门店的线下库存信息--
  1326 + getApp().request.get("/api/weshop/goods/getWareStorages",{
  1327 + data:{storageNos:pick.pickup_no,wareIds:encodeURIComponent(th.data.sele_g.erpwareid),storeId:os.stoid},
  1328 + success:function(res){
  1329 + if(res.data.code==0){
  1330 + if(res.data.data.pageData.length>0){
  1331 + var CanOutQty=res.data.data.pageData[0].CanOutQty;
  1332 + if(CanOutQty<e.data.goodsInputNum){
  1333 + return s.my_warnning("库存不足!", 0, th);
  1334 + }
  1335 + //在调一次接口,读取商品的预出库的数量,lock
  1336 + getApp().request.get("/api/weshop/order/ware/lock/page",{
  1337 + data:{store_id:os.stoid,wareId:th.data.sele_g.goods_id,storageId:pick.pickup_id,pageSize:1000},
  1338 + success:function(res_data){
  1339 + if(res_data.data.code==0 && res_data.data.data.total>0){
  1340 +
  1341 + var lock=0;
  1342 + for(var i in res_data.data.data.pageData){
  1343 + lock+=res_data.data.data.pageData[i].outQty;
  1344 + }
  1345 +
  1346 + if(CanOutQty<=lock){
  1347 + return s.my_warnning("库存不足!", 0, th);
  1348 + }
  1349 + th.add_cart_next(e,t,a,o,newd,CanOutQty-lock);
  1350 + }else{
  1351 + th.add_cart_next(e,t,a,o,newd,CanOutQty);
  1352 + }
  1353 + }
  1354 + })
  1355 + }else{
  1356 + return s.my_warnning("库存不足!", 0, th);
  1357 + }
  1358 +
  1359 + }
  1360 + }
  1361 + })
  1362 + }else{
  1363 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
  1364 + if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
  1365 + th.add_cart_next(e,t,a,o,newd); //加入购物车下一步
  1366 + }
  1367 + }
  1368 + })
  1369 +
  1370 + }
  1371 + else if ( th.data.prom_type == 0 || th.data.prom_type == 3 || th.data.prom_type == 2 || th.data.prom_type == 4 || th.data.prom_type == 5) {
  1372 + newd.prom_type = 0;
  1373 + newd.prom_id = 0;
  1374 +
  1375 + //---如果是线下门店销售的时候---
  1376 + if(th.data.sales_rules==2){
  1377 + var pick=th.get_pick_from_list(th.data.sto_sele_id)
  1378 + //---通过接口获取门店的线下库存信息--
  1379 + getApp().request.get("/api/weshop/goods/getWareStorages",{
  1380 + data:{storageNos:pick.pickup_no,wareIds:encodeURIComponent(th.data.sele_g.erpwareid),storeId:os.stoid},
  1381 + success:function(res){
  1382 + if(res.data.code==0){
  1383 + if(res.data.data.pageData.length>0){
  1384 + var CanOutQty=res.data.data.pageData[0].CanOutQty;
  1385 + if(CanOutQty<e.data.goodsInputNum){
  1386 + return s.my_warnning("库存不足!", 0, th);
  1387 + }
  1388 + //在调一次接口,读取商品的预出库的数量,lock
  1389 + getApp().request.get("/api/weshop/order/ware/lock/page",{
  1390 + data:{store_id:os.stoid,wareId:th.data.sele_g.goods_id,storageId:pick.pickup_id,pageSize:1000},
  1391 + success:function(res_data){
  1392 + if(res_data.data.code==0 && res_data.data.data.total>0){
  1393 +
  1394 + var lock=0;
  1395 + for(var i in res_data.data.data.pageData){
  1396 + lock+=res_data.data.data.pageData[i].outQty;
  1397 + }
  1398 +
  1399 + if(CanOutQty<=lock){
  1400 + return s.my_warnning("库存不足!", 0, th);
  1401 + }
  1402 + th.add_cart_next(e,t,a,o,newd,CanOutQty-lock);
  1403 + }else{
  1404 + th.add_cart_next(e,t,a,o,newd,CanOutQty);
  1405 + }
  1406 + }
  1407 + })
  1408 + }else{
  1409 + return s.my_warnning("库存不足!", 0, th);
  1410 + }
  1411 +
  1412 + }
  1413 + }
  1414 + })
  1415 + }else{
  1416 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
  1417 + if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
  1418 + th.add_cart_next(e,t,a,o,newd); //加入购物车下一步
  1419 + }
  1420 + }
  1421 + })
  1422 + },
  1423 +
  1424 + //---加入购物车的最后一步---
  1425 + add_cart_next(e,t,a,o,newd,CanOutQty){
  1426 + var th=this,i=getApp().request;
  1427 + //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------
  1428 + if(o.prom_type!=1 && ((o.prom_type!=6 && o.prom_type!=4) || th.data.is_normal)){
  1429 + var conf=th.data.bconfig;
  1430 + if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']){
  1431 + var s_list=JSON.parse(conf.switch_list);
  1432 + var now=ut.gettimestamp();
  1433 +
  1434 +
  1435 + var str = getApp().globalData.userInfo['card_expiredate'].replace(/-/g, '/');
  1436 + var end = new Date(str);
  1437 + end = Date.parse(end) / 1000;
  1438 +
  1439 + //--如果后台有开启等级价的功能,而且会员的等级没有过期的情况下--
  1440 + if(parseInt(s_list.rank_switch)==2 && end>now){
  1441 + var card_price=o[getApp().globalData.userInfo['card_field']];
  1442 + //如果会员有等级价
  1443 + if(getApp().globalData.userInfo['card_field']!=undefined && getApp().globalData.userInfo['card_field']!=null
  1444 + && getApp().globalData.userInfo['card_field']!="" && card_price>0){
  1445 + newd.goods_price=card_price;
  1446 + newd.member_goods_price=card_price;
  1447 + }
  1448 + }
  1449 + }
  1450 + }
  1451 +
  1452 + //if (this.data.data.goods.is_virtual) return this.buyVirtualGoods(d);
  1453 + if ("add" == t.currentTarget.dataset.action) {
  1454 +
  1455 + if(th.data.prom_goods){
  1456 + newd.prom_type = 3;
  1457 + newd.prom_id = th.data.prom_goods[0].prom_id;
  1458 + }
  1459 +
  1460 + //----先看会员在购物车中是否加入了该商品-----
  1461 + i.get("/api/weshop/cart/page", {
  1462 + data: {
  1463 + store_id: e.data.stoid,
  1464 + user_id: oo.user_id,
  1465 + goods_id: a,
  1466 + pick_id: e.data.sto_sele_id,
  1467 + },
  1468 + success: function(re) {
  1469 +
  1470 + //-------如果购物车中有相关的数据---------
  1471 + if (re.data.data.total > 0) {
  1472 +
  1473 + var item = re.data.data.pageData[0];
  1474 +
  1475 + //判断数量,要看下购物车中有没有该商品
  1476 + if(CanOutQty){
  1477 + if(item.goods_num+ th.data.goodsInputNum>CanOutQty){
  1478 + return s.my_warnning("库存不足!", 0, th);
  1479 + }
  1480 + }else{
  1481 + if(item.goods_num+ th.data.goodsInputNum>o.store_count){
  1482 + return s.my_warnning("库存不足!", 0, th);
  1483 + }
  1484 + }
  1485 +
  1486 + var updata = {
  1487 + id: item.id,
  1488 + goods_num: e.data.goodsInputNum + item.goods_num,
  1489 + goods_price: newd.goods_price,
  1490 + member_goods_price:newd.goods_price,
  1491 + store_id: th.data.stoid,
  1492 + };
  1493 +
  1494 + //---是不是从收藏夹出来的---
  1495 + if(th.data.c_guide_id){
  1496 + updata['guide_id'] = th.data.c_guide_id;
  1497 + updata['guide_type']=3; //加入购物车之后就变成了3
  1498 + }else {
  1499 + if (getApp().globalData.guide_id) {
  1500 + updata['guide_id'] = getApp().globalData.guide_id;
  1501 + updata['guide_type'] = 0;
  1502 + }
  1503 + }
  1504 +
  1505 + i.put("/api/weshop/cart/update", {
  1506 + data: updata,
  1507 + success: function(t) {
  1508 + getApp().my_warnning('加入购物车成功', 1, th, 450);
  1509 + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
  1510 + th.setData({
  1511 + cartGoodsNum: c_num
  1512 + });
  1513 + th.closeSpecModal();
  1514 + }
  1515 + });
  1516 + } else {
  1517 +
  1518 +
  1519 + i.post("/api/weshop/cart/save", {
  1520 + data: newd,
  1521 + success: function(t) {
  1522 + getApp().my_warnning('加入购物车成功', 1, th, 450);
  1523 + var c_num = th.data.cartGoodsNum + e.data.goodsInputNum;
  1524 + th.setData({
  1525 + cartGoodsNum: c_num
  1526 + });
  1527 + th.closeSpecModal();
  1528 + }
  1529 + });
  1530 + }
  1531 + }
  1532 + });
  1533 +
  1534 + }
  1535 + //else "exchange" == t.currentTarget.dataset.action ? this.exchange(d) : this.buyNow(d);
  1536 + else {
  1537 +
  1538 + if(th.data.prom_goods){
  1539 + var prom_d=th.data.prom_goods;
  1540 + for(var i in prom_d){
  1541 + //判断活动有俩种条件,0元 1件
  1542 + var condition_t=prom_d[i].prom_type;
  1543 + switch(condition_t) {
  1544 + case 0: //按钱
  1545 + if(newd.goods_price>=condition_t){
  1546 + newd.prom_type = 3;
  1547 + newd.prom_id = prom_d[i].prom_id;
  1548 + }
  1549 + break
  1550 + case 1://按购买数量
  1551 + if(newd.goods_num>=condition_t){
  1552 + newd.prom_type = 3;
  1553 + newd.prom_id = prom_d[i].prom_id;
  1554 + }
  1555 + break;
  1556 + }
  1557 + }
  1558 +
  1559 + }
  1560 +
  1561 + newd['pick_name'] = th.data.sto_sele_name;
  1562 + newd['pick_dis'] = th.data.sto_sele_distr;
  1563 + th.buyNow(newd);
  1564 + }
  1565 + },
  1566 +
  1567 +
  1568 + //----------购买虚拟商品------
  1569 + buyVirtualGoods: function(e) {
  1570 + Object.assign(e, {
  1571 + goods_name: this.data.data.goods.goods_name,
  1572 + spec_name: this.data.select.specName,
  1573 + price: this.data.select.price
  1574 + }), wx.navigateTo({
  1575 + url: "/pages/virtual/buy_step/buy_step?" + t.Obj2Str(e)
  1576 + });
  1577 + },
  1578 + //----------积分兑换---------
  1579 + exchange: function(e) {
  1580 + this.data.shippingCost < 0 || this.data.select.stock <= 0 || wx.navigateTo({
  1581 + url: "/pages/cart/integral/integral?" + t.Obj2Str(e)
  1582 + });
  1583 + },
  1584 +
  1585 +
  1586 + //----------立即购买-----------
  1587 + buyNow: function(e) {
  1588 + // this.data.shippingCost < 0 || this.data.select.stock <= 0 || (Object.assign(e, {
  1589 + // action: "buy_now"
  1590 + // }),
  1591 + this.setData({
  1592 + openSpecModal:0,
  1593 + openSpecModal_inte:0,
  1594 + openSpecModal_inte_normal:0,
  1595 + openSpecModal_pt:0,
  1596 + })
  1597 +
  1598 + if(e.prom_type==4){
  1599 + s.set_b_now(e);
  1600 + var url="/pages/cart/cart2_inte/cart2_inte?is_bnow=1&goods_id=" + e.goods_id;
  1601 + getApp().goto(url);
  1602 + }else{
  1603 + //要判断积分购的普通购买有没有参加优惠活动
  1604 + if(e.is_integral_normal==1){
  1605 + this.check_nor_promgood(e.goods_id,function(res){
  1606 + if(res && res.cat_id){
  1607 + e.prom_type=3;
  1608 + e.prom_id=res.cat_id
  1609 + }
  1610 + s.set_b_now(e);
  1611 + /*--
  1612 + wx.redirectTo({
  1613 + url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id,
  1614 + });--*/
  1615 + getApp().goto("/packageC/pages/presell/cart/cart?is_bnow=1&goods_id=" + e.goods_id)
  1616 +
  1617 + })
  1618 + }else{
  1619 + s.set_b_now(e);
  1620 + /*--
  1621 + wx.redirectTo({
  1622 + url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id,
  1623 + });--*/
  1624 + getApp().goto("/packageC/pages/presell/cart/cart?is_bnow=1&goods_id=" + e.goods_id)
  1625 + }
  1626 +
  1627 + }
  1628 + },
  1629 +
  1630 + //----------增加购买数量-----------
  1631 + addCartNum: function(t) {
  1632 + this.checkCartNum(this.data.goodsInputNum + 1);
  1633 + },
  1634 + //----------减少购买数量-----------
  1635 + subCartNum: function(t) {
  1636 + this.checkCartNum(this.data.goodsInputNum - 1);
  1637 + },
  1638 + //----------输入框输入购买数量-----------
  1639 + inputCartNum: function(t) {
  1640 + this.checkCartNum(Number(t.detail.value));
  1641 + },
  1642 +
  1643 + //----------增加购买数量-----------
  1644 + addCartNum_inte: function(t) {
  1645 + this.checkCartNum_inte(this.data.goodsInputNum + 1);
  1646 + },
  1647 + //----------减少购买数量-----------
  1648 + subCartNum_inte: function(t) {
  1649 + this.checkCartNum_inte(this.data.goodsInputNum - 1);
  1650 + },
  1651 + //----------输入框输入购买数量-----------
  1652 + inputCartNum_inte: function(t) {
  1653 + this.checkCartNum_inte(Number(t.detail.value));
  1654 + },
  1655 +
  1656 +
  1657 + //------检查数量是不是超出限购------
  1658 + checkCartNum: function(t) {
  1659 + var th = this;
  1660 + this.get_buy_num(this.data.sele_g, async function() {
  1661 +
  1662 + //--判断商品是否超出限购--
  1663 + if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
  1664 +
  1665 + var gd_buy_num=th.data.g_buy_num.get(th.data.sele_g.goods_id);
  1666 +
  1667 + if (t + gd_buy_num > th.data.sele_g.viplimited) {
  1668 + wx.showModal({
  1669 + title: '超出商品限购',
  1670 + });
  1671 +
  1672 + var num= th.data.sele_g.viplimited-gd_buy_num;
  1673 + if(num<0) num=0;
  1674 + th.setData({goodsInputNum:num})
  1675 + return false;
  1676 + }
  1677 + }
  1678 +
  1679 + //--判断商品是否超出活动限购--
  1680 + if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && !th.data.is_normal) {
  1681 + if (t + th.data.prom_buy_num > th.data.prom_buy_limit) {
  1682 + wx.showModal({
  1683 + title: '超出商品活动限购',
  1684 + });
  1685 +
  1686 + var num=th.data.prom_buy_limit- th.data.prom_buy_num ;
  1687 + if(num<0) num=0;
  1688 + th.setData({goodsInputNum:num})
  1689 + return false;
  1690 + }
  1691 + }
  1692 +
  1693 + if (th.data.sele_g.prom_type == 1 || th.data.sele_g.prom_type == 6) {
  1694 + var redis_num = 0;
  1695 + //------判断活动是否抢光-----
  1696 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  1697 + os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, {
  1698 + 1: 1
  1699 + }).then(res => {
  1700 + redis_num = res.data.data;
  1701 + });
  1702 +
  1703 + if (t > redis_num) {
  1704 + wx.showModal({
  1705 + title: '超出商品活动库存',
  1706 + });
  1707 + th.setData({goodsInputNum:redis_num})
  1708 + return false;
  1709 + }
  1710 + }
  1711 + var e = th.data.sele_g.store_count;
  1712 + var p_type=th.data.prom_type; //&& p_type!=1 && p_type!=4
  1713 + if(th.data.sales_rules==2 && (p_type!=1 && p_type!=4 && p_type!=6 || th.data.openSpecModal_inte_normal==1 || th.data.is_normal== 1) ){
  1714 + if(!th.data.def_pick_store){
  1715 + wx.showModal({ title: '请选择门店', });
  1716 + return false;
  1717 + }else{
  1718 + e=th.data.def_pick_store.CanOutQty;
  1719 + }
  1720 + }
  1721 + if(!e) e=0;
  1722 + //库存不足,不增加
  1723 + if(e<t){ wx.showModal({ title: '库存不足', });
  1724 + if(e<0) e=0;
  1725 + th.setData({ goodsInputNum: e }); return false;
  1726 + }
  1727 + t > e || 0 == e ? t = e : t < 1 && (t = 1);
  1728 + th.setData({ goodsInputNum: t });
  1729 + th.is_show_more_buy();
  1730 +
  1731 + })
  1732 + },
  1733 +
  1734 + //----- 检查一下积分购的限购之类的问题 -----
  1735 + checkCartNum_inte: function(t) {
  1736 + var th = this;
  1737 + this.get_buy_num(this.data.data, async function() {
  1738 +
  1739 + //--判断商品是否超出限购--
  1740 + if (th.data.g_buy_num != null && th.data.data.viplimited > 0) {
  1741 +
  1742 + var gd_buy_num=th.data.g_buy_num.get(th.data.sele_g.goods_id);
  1743 +
  1744 + if (t + gd_buy_num > th.data.sele_g.viplimited) {
  1745 + wx.showModal({
  1746 + title: '超出商品限购',
  1747 + });
  1748 +
  1749 + var num= th.data.sele_g.viplimited-gd_buy_num;
  1750 + if(num<0) num=0;
  1751 + th.setData({goodsInputNum:num})
  1752 + return false;
  1753 + }
  1754 + }
  1755 +
  1756 + //--判断商品是否超出活动限购--
  1757 + if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
  1758 + if (t + th.data.prom_buy_num > th.data.prom_buy_limit) {
  1759 + wx.showModal({
  1760 + title: '超出商品活动限购',
  1761 + });
  1762 +
  1763 + var num=th.data.prom_buy_limit- th.data.prom_buy_num ;
  1764 + if(num<0) num=0;
  1765 + th.setData({goodsInputNum:num})
  1766 + return false;
  1767 + }
  1768 + }
  1769 +
  1770 + if (th.data.sele_g.prom_type == 1 || th.data.sele_g.prom_type == 6) {
  1771 + var redis_num = 0;
  1772 + //------判断活动是否抢光-----
  1773 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  1774 + os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, {
  1775 + 1: 1
  1776 + }).then(res => {
  1777 + redis_num = res.data.data;
  1778 + });
  1779 +
  1780 + if (t > redis_num) {
  1781 + wx.showModal({
  1782 + title: '超出商品活动库存',
  1783 + });
  1784 + th.setData({goodsInputNum:redis_num})
  1785 + return false;
  1786 + }
  1787 +
  1788 + }
  1789 +
  1790 + var e = th.data.sele_g.store_count;
  1791 + var p_type=th.data.prom_type; //&& p_type!=1 && p_type!=4
  1792 + if(th.data.sales_rules==2 && (p_type!=1 && p_type!=4 && p_type!=6 || th.data.openSpecModal_inte_normal==1 || th.data.is_normal== 1) ){
  1793 + if(!th.data.def_pick_store){
  1794 + wx.showModal({ title: '请选择门店', });
  1795 + return false;
  1796 + }else{
  1797 + e=th.data.def_pick_store.CanOutQty;
  1798 + }
  1799 + }
  1800 + if(!e) e=0;
  1801 + //库存不足,不增加
  1802 + if(e<t){ wx.showModal({ title: '库存不足', });
  1803 + if(e<0) e=0;
  1804 + th.setData({ goodsInputNum: e }); return false;
  1805 + }
  1806 + t > e || 0 == e ? t = e : t < 1 && (t = 1);
  1807 + th.setData({ goodsInputNum: t });
  1808 + })
  1809 + },
  1810 +
  1811 +
  1812 + closeSpecModal: function() {
  1813 + if(this.data.openSpecModal_pt && this.data.is_normal){
  1814 + this.get_sto();
  1815 + this.setData({
  1816 + sele_g:this.data.data,
  1817 + gid:this.data.data.goods_id
  1818 + })
  1819 +
  1820 + this.sele_spec_chech_activity();
  1821 +
  1822 + }
  1823 +
  1824 + this.setData({
  1825 + openSpecModal: !1,
  1826 + openSpecModal_pt: !1
  1827 + });
  1828 + },
  1829 +
  1830 + openSpecModel: function(t) {
  1831 + var th=this;
  1832 + var open_store = t.currentTarget.dataset.ind;
  1833 + this.setData({
  1834 + store: 0,
  1835 + choice_sort_store: 0,
  1836 + sort_store: 0,
  1837 + open_ind_store: open_store,
  1838 + })
  1839 + //--先判断会员状态--
  1840 + var user_info = getApp().globalData.userInfo;
  1841 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  1842 + wx.navigateTo({
  1843 + url: '/pages/togoin/togoin',
  1844 + })
  1845 + return false;
  1846 + }
  1847 +
  1848 + var ind = t.currentTarget.dataset.ind;
  1849 +
  1850 + //回调。判断是不是优惠促销
  1851 + th.check_is_prom_goods(function (){
  1852 + th.setData({
  1853 + openSpecModal: !0,
  1854 + openSpecModal_ind: ind,
  1855 + });
  1856 + //var is_open=th.data.config
  1857 + th.get_off_price();
  1858 + })
  1859 + },
  1860 +
  1861 + //判断是不是优惠促销
  1862 + check_is_prom_goods:function(callback){
  1863 + var th=this;
  1864 + var usr=getApp().globalData.userInfo;
  1865 + if(this.data.sele_g.prom_type!=0 && this.data.sele_g.prom_type!=3){
  1866 + callback();
  1867 + }else{
  1868 + //-- 判断有没有优惠活动 --
  1869 + getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+th.data.sele_g.goods_id+"/0", {}).then(res => {
  1870 + if(res.data.code==0){
  1871 + var r_data=res.data.data;
  1872 + th.data.prom_goods=r_data.promGoodsLists;
  1873 + if(!th.data.prom_goods){
  1874 + callback();
  1875 + return false;
  1876 + }
  1877 +
  1878 + ///api/weshop/order/getWPayOrder?store_id=1&user_id=5682366&prom_id=1&goods_id=1
  1879 + getApp().promiseGet("/api/weshop/order/getWPayOrder",{
  1880 + data:{store_id:os.stoid,user_id:usr.user_id,goods_id:th.data.sele_g.goods_id,prom_id:th.data.prom_goods[0].prom_id}
  1881 + }).then(res=>{
  1882 + if(res.data.code==0){
  1883 + wx.showToast({
  1884 + title: "您已经购买了该商品待支付中",
  1885 + icon: 'none',
  1886 + duration: 2000
  1887 + })
  1888 + setTimeout(function (){
  1889 + getApp().goto("/pages/user/order_detail/order_detail?order_id=" + res.data.data.order_id,)
  1890 + },1000)
  1891 + }
  1892 + //未找到相关记录
  1893 + else{
  1894 + callback();
  1895 + }
  1896 + })
  1897 + }
  1898 +
  1899 + })
  1900 +
  1901 + }
  1902 + },
  1903 +
  1904 +
  1905 +
  1906 + //----获取线下价格-------
  1907 + get_off_price(){
  1908 + var th=this;
  1909 + //没有开启就返回
  1910 + if(!th.data.is_open_offline) return false;
  1911 + //先看下购买的功能有没有到期
  1912 + getApp().request.promiseGet("/store/storemoduleendtime/page?store_id=" +os.stoid + "&type=6",{}).then(res=>{
  1913 + //未购买
  1914 + if(res.data.code!=0 || !res.data.data || !res.data.data.pageData || !res.data.data.pageData.length){
  1915 + return false;
  1916 + }else{
  1917 + //已经过期
  1918 + var item=res.data.data.pageData[0];
  1919 + if(item.end_time<ut.gettimestamp()){
  1920 + return false;
  1921 + }
  1922 + }
  1923 +
  1924 +
  1925 + var cur_goods=this.data.sele_g;
  1926 + var cur_price=cur_goods.shop_price;
  1927 + if(th.data.card_field && cur_goods[th.data.card_field]>0){
  1928 + cur_price=cur_goods[th.data.card_field];
  1929 + }
  1930 +
  1931 + var user_info = getApp().globalData.userInfo;
  1932 + //获取一下接口,判断是不是有线下接口,必须是普通商品,全局优惠活动也是不行
  1933 + if(cur_goods.prom_type==0 && !this.data.prom_goods){
  1934 + cur_goods.offline_price=null;
  1935 + //如果没有门店,不用计算线下价格
  1936 + var def_pick_store=this.data.def_pick_store;
  1937 + if(!def_pick_store) return false;
  1938 + getApp().request.get("/api/weshop/goods/listWarePrice", {
  1939 + data:{VIPId:encodeURIComponent(user_info.erpvipid),
  1940 + store_id:os.stoid,
  1941 + PickupId:def_pick_store.pickup_id,
  1942 + WareIds:encodeURIComponent(cur_goods.erpwareid)},
  1943 + success:function(res){
  1944 + if(res.data.code==0 && res.data.data && res.data.data.length>0){
  1945 + var datalist=res.data.data;
  1946 + if(datalist[0].WarePrice<cur_price){
  1947 + cur_goods.offline_price=datalist[0].WarePrice; //存储线下活动的价格
  1948 + cur_goods.pricing_type=datalist[0].PriceType; //存储线下活动的类型
  1949 + }
  1950 + }
  1951 + th.setData({sele_g:cur_goods});
  1952 + }
  1953 +
  1954 + })
  1955 + }
  1956 +
  1957 + })
  1958 +
  1959 +
  1960 + },
  1961 +
  1962 +
  1963 + //---------点击收藏和不收藏------------
  1964 + collectGoods: function() {
  1965 + var t = this,
  1966 + i = getApp().request;
  1967 + var user_id = s.globalData.user_id;
  1968 + if (user_id == '') {
  1969 + getApp().getUserFir(function() {});
  1970 + getApp().showWarning("未登录");
  1971 + return false;
  1972 + } else {
  1973 +
  1974 + if(t.data.is_collect_load) return false;
  1975 + t.data.is_collect_load=1;
  1976 +
  1977 + if (t.data.is_collect == 1) { //删除收藏
  1978 + i.delete("/api/weshop/goodscollect/del/" + o.stoid + "/" + t.data.collect_id, {
  1979 + success: function(e) {
  1980 + t.data.is_collect_load=0;
  1981 + if (e.data.code == 0) {
  1982 + t.setData({
  1983 + is_collect: 0,
  1984 + collect_id: 0,
  1985 + });
  1986 + }
  1987 + }
  1988 + });
  1989 + } else {
  1990 + var timestamp = Date.parse(new Date());
  1991 + timestamp = timestamp / 1000;
  1992 + var d = {
  1993 + goods_id: t.data.data.goods_id,
  1994 + user_id: s.globalData.user_id,
  1995 + store_id: o.stoid,
  1996 + add_time: timestamp,
  1997 + };
  1998 + //加入收藏夹就是导购的ID
  1999 + if(getApp().globalData.guide_id){
  2000 + d.guide_id=getApp().globalData.guide_id;
  2001 + d.guide_type=2;
  2002 + }
  2003 +
  2004 + i.post("/api/weshop/goodscollect/save", { //添加收藏
  2005 + data: d,
  2006 + success: function(e) {
  2007 + t.data.is_collect_load=0;
  2008 + if (e.data.code == 0) {
  2009 + t.setData({
  2010 + is_collect: 1,
  2011 + collect_id: e.data.data.collect_id,
  2012 + });
  2013 + }
  2014 + }
  2015 + });
  2016 + }
  2017 + }
  2018 + },
  2019 +
  2020 + //---------联系客服------------
  2021 + contactService: function() {
  2022 + s.getConfig(function(t) {
  2023 + if (t.store_tel == undefined) {
  2024 + getApp().request.get("/api/weshop/store/get/" + os.stoid, {
  2025 + isShowLoading: 1,
  2026 + data: {},
  2027 + success: function(rs) {
  2028 + getApp().globalData.config = rs.data.data;
  2029 + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
  2030 + getApp().my_warnning("商家未设置电话", 0, th);
  2031 + return false;
  2032 + }
  2033 + s.confirmBox("请联系客服:" + rs.data.data.store_tel);
  2034 + }
  2035 + })
  2036 + } else {
  2037 + s.confirmBox("请联系客服:" + t.store_tel);
  2038 + }
  2039 + });
  2040 + },
  2041 + //-------获取购物车数量----------
  2042 + requestCardNum: function() {
  2043 + var t = this;
  2044 + getApp().request.get("/api/weshop/cart/page", {
  2045 + data: {
  2046 + store_id: o.stoid,
  2047 + user_id: s.globalData.user_id,
  2048 + state:0,
  2049 + is_gift:0
  2050 + },
  2051 + success: function(e) {
  2052 + var num = 0;
  2053 + for (var i = 0; i < e.data.data.pageData.length; i++) {
  2054 + num += e.data.data.pageData[i].goods_num;
  2055 + }
  2056 +
  2057 + //-- 读取服务卡的数量 --
  2058 + getApp().promiseGet("/api/weshop/cartService/page",{
  2059 + data:{
  2060 + store_id: s.globalData.setting.stoid,
  2061 + user_id: s.globalData.user_id,
  2062 + }
  2063 + }).then(res=>{
  2064 + for (var i = 0; i < res.data.data.pageData.length; i++) {
  2065 + num += res.data.data.pageData[i].goods_num;
  2066 + }
  2067 + t.setData({cartGoodsNum:num});
  2068 + })
  2069 + }
  2070 + });
  2071 + },
  2072 +
  2073 + previewCommentImgs: function(t) {
  2074 + var e = this.data.comments[t.currentTarget.dataset.cidx].img;
  2075 + var b = e.slice()
  2076 + for(var i in b){
  2077 + b[i] = this.data.iurl + e[i];
  2078 + }
  2079 + this.data.show_prew_img=1;
  2080 +
  2081 + wx.previewImage({
  2082 + current: b[t.currentTarget.dataset.id],
  2083 + urls: b
  2084 + });
  2085 + },
  2086 +
  2087 + previewCommentImgs_w: function(t) {
  2088 + var e = this.data.comments[t.currentTarget.dataset.cidx].weapp_img;
  2089 + var b = e.slice()
  2090 + for (var i in b) {
  2091 + b[i] = this.data.iurl + e[i];
  2092 + }
  2093 + this.data.show_prew_img=1;
  2094 + wx.previewImage({
  2095 + current: b[t.currentTarget.dataset.id],
  2096 + urls: b
  2097 + });
  2098 + },
  2099 +
  2100 + previewGoodsCommentImgs: function(t) {
  2101 + var e = this,
  2102 + a = this.data.data.comment[t.currentTarget.dataset.cidx].img;
  2103 + a = a.map(function(t) {
  2104 + return e.data.url + t;
  2105 + }), wx.previewImage({
  2106 + current: a[t.currentTarget.dataset.id],
  2107 + urls: a
  2108 + });
  2109 + this.data.show_prew_img=1;
  2110 + },
  2111 + closePromModal: function() {
  2112 + this.setData({
  2113 + openPromModal: !1
  2114 + });
  2115 + },
  2116 + openPromModal: function() {
  2117 + this.setData({
  2118 + openPromModal: !0
  2119 + });
  2120 + },
  2121 +
  2122 + //--点击分享事件---
  2123 + onShareAppMessage: function(t) {
  2124 +
  2125 + var th = this;
  2126 + var price = th.data.data.shop_price;
  2127 + if (th.data.prom_act) {
  2128 + price = th.data.prom_act.price;
  2129 +
  2130 + }
  2131 + var title= th.data.data.goods_name;
  2132 + var img=th.data.data.original_img;
  2133 + if(th.data.prom_type==6 || th.data.prom_type==1 || th.data.prom_type==4){
  2134 + title=th.data.prom_act.share_title;
  2135 + if(!title) title=th.data.prom_act.title;
  2136 + if(th.data.prom_type==4) title=th.data.prom_act.name;
  2137 +
  2138 + if(th.data.prom_act.share_imgurl)
  2139 + img=th.data.iurl+th.data.prom_act.share_imgurl;
  2140 + }
  2141 +
  2142 +
  2143 + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid;
  2144 + if(getApp().globalData.user_id){
  2145 + url+="&first_leader="+getApp().globalData.user_id;
  2146 + }
  2147 +
  2148 + //-- 如果房间分享,且不是会员分享的 --
  2149 + if(getApp().globalData.room_id &&
  2150 + th.data.data.goods_id==getApp().globalData.room_goods_id &&
  2151 + !getApp().globalData.room_user_share
  2152 + ){
  2153 + url+="&room_id="+getApp().globalData.room_id+"&room_user_share=1";
  2154 + }
  2155 +
  2156 + var ob={
  2157 + title: price + "元 " +title,
  2158 + path:url,
  2159 + imageUrl: img,
  2160 + };
  2161 + if(th.data.prom_type==6){
  2162 + title+='\n'+th.data.prom_act.share_remark;
  2163 + ob.title=title;
  2164 + ob.desc=th.data.prom_act.share_remark;
  2165 + }
  2166 +
  2167 + //如果是积分购的时候
  2168 + if(th.data.prom_type==4){
  2169 + var name = th.data.prom_act.name;
  2170 + //-- 积分购的 --
  2171 + var pri0 = th.data.prom_act.addmoney;
  2172 + var integral=th.data.prom_act.integral;
  2173 + var text="";
  2174 + if(integral){text=integral+"积分"; }
  2175 + if(pri0 && integral){ text+="+";}
  2176 + if(pri0){ text+="¥"+pri0;}
  2177 +
  2178 + ob.title= text+" "+name;
  2179 + }
  2180 +
  2181 + return ob;
  2182 +
  2183 + },
  2184 +
  2185 + //-----图片失败,默认图片-----
  2186 + bind_bnerr: function(e) {
  2187 + var _errImg = e.target.dataset.errorimg;
  2188 + var _errObj = {};
  2189 + _errObj[_errImg] = this.data.iurl + "/miniapp/images/default_g_img.gif";
  2190 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  2191 + },
  2192 +
  2193 + //-----图片失败,默认图片-----
  2194 + bind_bnerr2: function(e) {
  2195 +
  2196 + var _errImg = e.target.dataset.errorimg;
  2197 + var _errObj = {};
  2198 + _errObj[_errImg] = this.data.iurl + "/miniapp/images/hui_hear_pic.png"
  2199 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  2200 + },
  2201 +
  2202 + //----------装载同一条形码的商品----------
  2203 + async get_sku(stoid, gd, g_id, is_normal, func) {
  2204 + var tt = this,arrdata=null;
  2205 + var now=ut.gettimestamp();
  2206 + await getApp().request.promiseGet("/api/weshop/goods/page", {
  2207 + data: {
  2208 + store_id: o.stoid,
  2209 + sku: gd.sku,
  2210 + more_spec:gd.more_spec,
  2211 + isonsale: 1,
  2212 + is_on_sale: 1,
  2213 + pageSize:500,
  2214 + orderField: 'sort'
  2215 + }
  2216 + }).then(res => {
  2217 + var e = res;
  2218 + if (e.data.code == 0) arrdata = e.data.data.pageData;
  2219 + })
  2220 + if(!arrdata) return false;
  2221 +
  2222 + var arrsku = new Array();
  2223 + var gitem = null;
  2224 + var gb = 1,gg = "";
  2225 + for (var i = 0; i < arrdata.length; i++) {
  2226 + var goodsinfo=arrdata[i],prom=null;
  2227 + if (goodsinfo.goods_id != g_id) {
  2228 +
  2229 + switch(goodsinfo.prom_type){
  2230 + case 1:
  2231 + await getApp().request.promiseGet("/api/ms/flash_sale/get/"+os.stoid+"/"+goodsinfo.prom_id,{
  2232 + }).then(res=>{
  2233 + if(res.data.code==0) prom=res.data.data;
  2234 + })
  2235 +
  2236 + break;
  2237 + case 6:
  2238 + await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+goodsinfo.prom_id,{
  2239 + }).then(res=>{
  2240 + if(res.data.code==0) prom=res.data.data;
  2241 + })
  2242 +
  2243 + break;
  2244 + case 2:
  2245 + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/"+os.stoid+"/"+goodsinfo.goods_id+"/"+goodsinfo.prom_id,{
  2246 + }).then(res=>{
  2247 + if(res.data.code==0) prom=res.data.data;
  2248 + })
  2249 + break;
  2250 + case 4:
  2251 + await getApp().request.promiseGet("/api/weshop/integralbuy/getActInfo/"+os.stoid+"/"+goodsinfo.goods_id+"/"+goodsinfo.prom_id,{
  2252 + }).then(res=>{
  2253 + if(res.data.code==0) prom=res.data.data;
  2254 + })
  2255 + break
  2256 +
  2257 + }
  2258 +
  2259 +
  2260 + }
  2261 + //---如果有活动,不算在一起---
  2262 + if(prom){
  2263 + if(goodsinfo.prom_type==1 || goodsinfo.prom_type==6){
  2264 + if(prom.is_end==0 && prom.end_time>now && prom.start_time<now) continue;
  2265 + }else{
  2266 + continue;
  2267 + }
  2268 + }
  2269 +
  2270 +
  2271 + var item = arrdata[i],gg = "";
  2272 + if(item.goods_spec=="null" || item.goods_spec==null) item.goods_spec="";
  2273 + if(item.goods_color=="null" || item.goods_color==null) item.goods_color="";
  2274 +
  2275 + if (item.goods_spec != "" && item.goods_color != "") {
  2276 + gg = item.goods_spec + "/" + item.goods_color;
  2277 + } else if (item.goods_spec != "" || item.goods_color != "") {
  2278 + gg = item.goods_spec + item.goods_color;
  2279 + } else {
  2280 + gg = "规格" + gb;
  2281 + gb++;
  2282 + }
  2283 + item.gg = gg;
  2284 +
  2285 + if(item.spec_img)
  2286 + item.original_img=os.imghost+item.spec_img;
  2287 + else
  2288 + item.original_img=os.imghost+item.original_img;
  2289 +
  2290 +
  2291 + if (item.goods_id == g_id) {
  2292 + gitem = item;
  2293 + } else {
  2294 + arrsku.push(item);
  2295 + }
  2296 + }
  2297 + //-----------排列在最前面-------------
  2298 + arrsku.splice(0, 0, gitem);
  2299 + if (is_normal == 1) {
  2300 + tt.setData({
  2301 + sku_g_pt: arrsku,
  2302 + sele_g: gitem
  2303 + });
  2304 + func();
  2305 + } else {
  2306 + tt.setData({
  2307 + sku_g: arrsku,
  2308 + sele_g: gitem
  2309 + });
  2310 + }
  2311 + },
  2312 +
  2313 + //-----------选择属性的按钮事件----------
  2314 + sele_spec: function(e) {
  2315 + var that=this,ee=this,th=this;
  2316 + var gid = e.currentTarget.dataset.gid;
  2317 + var nor=e.currentTarget.dataset.nor;
  2318 +
  2319 + var sku_g = this.data.sku_g;
  2320 + if(nor){
  2321 + sku_g = this.data.sku_g_pt;
  2322 + }
  2323 +
  2324 + var item = null;
  2325 + for (var i in sku_g) {
  2326 + if (sku_g[i].goods_id == gid) {
  2327 + item = sku_g[i];
  2328 + break
  2329 + }
  2330 + }
  2331 + if (item) this.setData({
  2332 + sele_g: item,
  2333 + gid: gid
  2334 + });
  2335 +
  2336 +
  2337 +
  2338 + that.check_is_youhui(gid,that.data.is_normal);
  2339 +
  2340 + var ty=0;
  2341 + this.get_sto(that.data.is_normal);
  2342 +
  2343 +
  2344 + //默认门店要拿下门店库存
  2345 + if(that.data.sales_rules==2 && that.data.def_pick_store){
  2346 + var lock=0,plist=null;
  2347 + //先读取门店的lock,采用链式写法,少用await
  2348 + getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{
  2349 + data:{store_id:os.stoid,wareId:ee.data.sele_g.goods_id,storageId:that.data.def_pick_store.pickup_id,pageSize:1000}
  2350 + }).then(res=>{
  2351 + if(res.data.code==0 && res.data.data.total>0){
  2352 + for(var i in res.data.data.pageData)
  2353 + lock+=res.data.data.pageData[i].outQty
  2354 + }
  2355 + //---通过接口获取门店的线下库存信息--
  2356 + return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{
  2357 + data:{storageNos:that.data.def_pick_store.pickup_no,wareIds:encodeURIComponent(th.data.sele_g.erpwareid),storeId:os.stoid}
  2358 + })
  2359 + }).then(res=>{
  2360 + if(res.data.code==0 && res.data.data.total>0){
  2361 + plist=res.data.data.pageData[0];
  2362 + }
  2363 + if(plist && plist.CanOutQty-lock>0){
  2364 + that.data.def_pick_store.CanOutQty=plist.CanOutQty-lock;
  2365 + }else{
  2366 + that.data.def_pick_store.CanOutQty=0;
  2367 + }
  2368 + //--给门店赋值线下库存--
  2369 + th.setData({def_pick_store:that.data.def_pick_store});
  2370 + })
  2371 + }
  2372 +
  2373 +
  2374 + this.sele_spec_chech_activity();
  2375 + },
  2376 +
  2377 + //选择了不同的规格的时候要判断是不是有活动正在进行中
  2378 + async sele_spec_chech_activity(){
  2379 + //---如果是活动的时候---
  2380 + var prom=null,goodsinfo=this.data.sele_g,th=this;
  2381 + if(goodsinfo.prom_type==1){
  2382 + await getApp().request.promiseGet("/api/ms/flash_sale/get/"+os.stoid+"/"+goodsinfo.prom_id,{
  2383 + }).then(res=>{
  2384 + if(res.data.code==0){
  2385 + prom=res.data.data;
  2386 + }
  2387 + })
  2388 + }
  2389 + if(goodsinfo.prom_type==6){
  2390 + await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+goodsinfo.prom_id,{
  2391 + }).then(res=>{
  2392 + if(res.data.code==0){
  2393 + prom=res.data.data;
  2394 + }
  2395 + })
  2396 + }
  2397 +
  2398 + if(goodsinfo.prom_type==4){
  2399 + await getApp().request.promiseGet("/api/weshop/integralbuy/getActInfo/"+os.stoid+"/"+goodsinfo.goods_id+"/"+goodsinfo.prom_id,{
  2400 + }).then(res=>{
  2401 + if(res.data.code==0){
  2402 + prom=res.data.data;
  2403 + }
  2404 + })
  2405 + }
  2406 +
  2407 + //----------如果有活动,并且在进行中,就不计算线下库存---------------
  2408 + var now=ut.gettimestamp();
  2409 + if(prom){
  2410 + if(prom.is_end==0 && prom.end_time>now && prom.start_time<now){
  2411 + th.setData({
  2412 + prom_type:goodsinfo.prom_type,
  2413 + prom_price:prom.price,
  2414 + prom_buy_limit:prom.buy_limit,
  2415 + prom_end_time:prom.end_time,
  2416 + prom_start_time:prom.start_time,
  2417 + prom_st:1,
  2418 + })
  2419 + return false;
  2420 + }
  2421 + }
  2422 + //---设置普通商品---
  2423 + th.setData({
  2424 + prom_type:0,
  2425 + prom_price:null,
  2426 + prom_buy_limit:null,
  2427 + prom_end_time:null,
  2428 + prom_start_time:null,
  2429 + prom_st:null,
  2430 + })
  2431 +
  2432 + },
  2433 +
  2434 +
  2435 + //---------拿出门店分类和门店------------
  2436 + get_sto(e) {
  2437 + var th = this,that=this;
  2438 + var is_normal=e;
  2439 +
  2440 + if(e==1){
  2441 + th.setData({is_normal:1})
  2442 + }else{
  2443 + th.setData({is_normal:0})
  2444 + }
  2445 +
  2446 + var timer_get = setInterval(function() {
  2447 + if (th.data.is_get_local_ok == 0) return false;
  2448 + var dd = null,i = getApp().request;
  2449 + if (!th.data.sele_g) return false;
  2450 +
  2451 + var g_distr_type = th.data.sele_g.distr_type;
  2452 + if (g_distr_type != 0) {
  2453 + dd = {
  2454 + store_id: o.stoid,
  2455 + distr_type: g_distr_type,
  2456 + isstop: 0,
  2457 + pageSize: 2000
  2458 + }
  2459 + } else {
  2460 + dd = {
  2461 + store_id: o.stoid,
  2462 + isstop: 0,
  2463 + pageSize: 2000
  2464 + }
  2465 + }
  2466 + //如果有距离的话
  2467 + if (th.data.lat != null) {
  2468 + dd.lat = th.data.lat;
  2469 + dd.lon = th.data.lon;
  2470 + }
  2471 + clearInterval(timer_get);
  2472 +
  2473 + //如果会员是有默认的门店话
  2474 + if(!th.data.def_pick_store && th.data.fir_def_store){
  2475 + th.setData({def_pick_store:th.data.fir_def_store});
  2476 + }
  2477 +
  2478 + /*--最新的,不用这里筛选配送方式
  2479 + 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 ){
  2480 + th.setData({def_pick_store:null});
  2481 + }--*/
  2482 +
  2483 +
  2484 + wx.showLoading({
  2485 + title:'加载中.'
  2486 + });
  2487 + //----------获取门店----------------
  2488 + getApp().request.promiseGet("/api/weshop/pickup/list", {
  2489 + data: dd,
  2490 + }).then(res => {
  2491 + var e = res;
  2492 +
  2493 + if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length>0) {
  2494 +
  2495 + //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店
  2496 + if(dd.lat && (!th.data.def_pick_store || JSON.stringify(th.data.def_pick_store)=='{}') && th.data.bconfig && th.data.bconfig.is_sort_storage){
  2497 + th.setData({
  2498 + def_pick_store:e.data.data.pageData[0],
  2499 + sto_sele_name: e.data.data.pageData[0].pickup_name,
  2500 + sto_sele_id: e.data.data.pageData[0].pickup_id,
  2501 + sto_sele_distr: e.data.data.pageData[0].distr_type
  2502 + });
  2503 + th.data.fir_def_store=e.data.data.pageData[0];
  2504 + }
  2505 +
  2506 + //-- 如果有默认选择门店的时候,要把默认门店放在第一位,修改不要配送方式的判断 --
  2507 + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store)!='{}'){
  2508 + for (var k = 0; k < e.data.data.pageData.length; k++) {
  2509 + if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) {
  2510 + e.data.data.pageData.splice(k, 1); //删除
  2511 + break;
  2512 + }
  2513 + }
  2514 + e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加
  2515 + }
  2516 +
  2517 +
  2518 + th.setData({all_pick_list:e.data.data.pageData});
  2519 +
  2520 + //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购--
  2521 + 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)){
  2522 + setTimeout(function(){
  2523 + th.deal_pickup_dline(e);
  2524 + },800)
  2525 + }else{
  2526 + setTimeout(function(){
  2527 + th.deal_pickup(e); //--普通门店排版--
  2528 + },800)
  2529 + }
  2530 + }
  2531 + })
  2532 + }, 200)
  2533 +
  2534 + },
  2535 +
  2536 +
  2537 + //------------处理门店---------------
  2538 + deal_pickup(e){
  2539 + var th=this;
  2540 + if(!th.data.sele_g) return false
  2541 +
  2542 + var g_distr_type=th.data.sele_g.distr_type;
  2543 + wx.hideLoading();
  2544 +
  2545 + //单总量超出5个的时候
  2546 + if (e.data.data.total > 5) {
  2547 + getApp().request.get("/api/weshop/storagecategory/page", {
  2548 + data: {
  2549 + store_id: o.stoid,
  2550 + is_show: 1,
  2551 + pageSize: 1000,
  2552 + orderField:"sort",
  2553 + orderType:'asc',
  2554 + },
  2555 + success: function(ee) {
  2556 + if (ee.data.code == 0) {
  2557 +
  2558 + if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0) {
  2559 + var def_arr = new Array();
  2560 + var ishas = 0;
  2561 + //-- 开始就看5个门店 --
  2562 + for (var k = 0; k < 5; k++) {
  2563 + if (k == e.data.data.pageData.length) break;
  2564 + def_arr.push(e.data.data.pageData[k]);
  2565 + }
  2566 +
  2567 + th.setData({
  2568 + def_pickpu_list: def_arr,
  2569 + pickpu_list: ee.data.data.pageData
  2570 + });
  2571 + var sto_cate = ee.data.data.pageData;
  2572 + var sto_arr = e.data.data.pageData;
  2573 + var newarr = new Array();
  2574 + var qita = new Array();
  2575 +
  2576 + //----要进行门店分组--------
  2577 + for (var i = 0; i < sto_arr.length; i++) {
  2578 + //找一下这个门店有没有在分类数组内
  2579 + var find2 = 0, find2name = "",sort=0;
  2580 + for (var m = 0; m < sto_cate.length; m++) {
  2581 + if (sto_arr[i].category_id == sto_cate[m].cat_id) {
  2582 + find2 = sto_cate[m].cat_id;
  2583 + find2name = sto_cate[m].cat_name;
  2584 + sort = sto_cate[m].sort;
  2585 + break;
  2586 + }
  2587 + }
  2588 +
  2589 + if (newarr.length > 0) {
  2590 + var find = 0;
  2591 + //如果有找到,那门店就在这个分组内,否则,分类就要排在其他
  2592 + if (find2 != 0) {
  2593 + for (var ii = 0; ii < newarr.length; ii++) {
  2594 + if (sto_arr[i].category_id == newarr[ii].cat_id) {
  2595 + newarr[ii].s_arr.push(sto_arr[i]);
  2596 + find = 1;
  2597 + break;
  2598 + }
  2599 + }
  2600 + if (find == 0) {
  2601 + var arr0 = new Array();
  2602 + arr0.push(sto_arr[i]);
  2603 + var item = {
  2604 + cat_id: find2,
  2605 + name: find2name,
  2606 + sort:sort,
  2607 + s_arr: arr0
  2608 + };
  2609 + newarr.push(item);
  2610 + }
  2611 + } else {
  2612 + qita.push(sto_arr[i]);
  2613 + }
  2614 + } else {
  2615 + //如果有找到,那门店就在这个分组内,否则,分类就要排在其他
  2616 + if (find2 != 0) {
  2617 + var arr0 = new Array();
  2618 + arr0.push(sto_arr[i]);
  2619 + var item = {
  2620 + cat_id: find2,
  2621 + name: find2name,
  2622 + sort:sort,
  2623 + s_arr: arr0
  2624 + };
  2625 + newarr.push(item);
  2626 + } else {
  2627 + qita.push(sto_arr[i]);
  2628 + }
  2629 + }
  2630 + }
  2631 +
  2632 + //门店分类要排序下
  2633 + function compare(property){
  2634 + return function(a,b){
  2635 + var value1 = a[property];
  2636 + var value2 = b[property];
  2637 + return value1 - value2;
  2638 + }
  2639 + }
  2640 + if(newarr.length>0)
  2641 + newarr.sort(compare("sort"));
  2642 +
  2643 +
  2644 + //----安排其他的分类-----
  2645 + if (qita.length > 0) {
  2646 + var item = {
  2647 + cat_id: -1,
  2648 + name: "其他",
  2649 + s_arr: qita
  2650 + };
  2651 + newarr.push(item);
  2652 + }
  2653 +
  2654 + th.setData({
  2655 + is_show_sto_cat: 1,
  2656 + all_sto: newarr
  2657 + });
  2658 +
  2659 + } else {
  2660 + th.setData({
  2661 + is_show_sto_cat: -1,
  2662 + only_pk: e.data.data.pageData
  2663 + });
  2664 + //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------
  2665 + if (!th.data.def_pick_store) {
  2666 + th.setData({def_pick_store:e.data.data.pageData[0]})
  2667 + }
  2668 + }
  2669 + } else {
  2670 + th.setData({
  2671 + is_show_sto_cat: -1,
  2672 + only_pk: e.data.data.pageData
  2673 + });
  2674 + //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------
  2675 + if (!th.data.def_pick_store) {
  2676 + th.setData({def_pick_store:e.data.data.pageData[0]})
  2677 + }
  2678 +
  2679 + }
  2680 + }
  2681 + });
  2682 + } else {
  2683 + th.setData({
  2684 + is_show_sto_cat: 0,
  2685 + only_pk: e.data.data.pageData
  2686 + });
  2687 + //-----如果没有默认门店,要取第一个门店作为默认店------
  2688 + if (!th.data.def_pick_store && th.data.bconfig && th.data.bconfig.is_sort_storage) {
  2689 + th.setData({
  2690 + def_pick_store:e.data.data.pageData[0],
  2691 + sto_sele_name: e.data.data.pageData[0].pickup_name,
  2692 + sto_sele_id: e.data.data.pageData[0].pickup_id,
  2693 + sto_sele_distr: e.data.data.pageData[0].distr_type
  2694 + })
  2695 + }
  2696 + }
  2697 + },
  2698 +
  2699 + //------------处理线下门店库存--------
  2700 + deal_pickup_dline(e){
  2701 + var pkno=[],th=this;
  2702 + if(!th.data.sele_g) return false;
  2703 +
  2704 + if(this.data.def_pick_store){
  2705 + pkno.push(this.data.def_pick_store.pickup_no);
  2706 + }
  2707 + for(var i in e.data.data.pageData){
  2708 + var item=e.data.data.pageData[i];
  2709 + if(pkno.indexOf(item.pickup_no)<0)
  2710 + pkno.push(item.pickup_no);
  2711 + }
  2712 + pkno.sort();
  2713 + var pkno_str=pkno.join(",");
  2714 + var o_plist=e.data.data.pageData;
  2715 + var new_list=[];
  2716 + var is_find_def_store=0;
  2717 +
  2718 +
  2719 + var g_distr_type=th.data.sele_g.distr_type;
  2720 + var lock=[];
  2721 + //先读取门店的lock,采用链式写法,少用await
  2722 + getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{
  2723 + data:{store_id:os.stoid,wareId:th.data.sele_g.goods_id,pageSize:1000}
  2724 + }).then(res=>{
  2725 + if(res.data.code==0 && res.data.data.total>0){
  2726 + lock=res.data.data.pageData
  2727 + }
  2728 + //---通过接口获取门店的线下库存信息--
  2729 + return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{
  2730 + data:{storageNos:pkno_str,wareIds:encodeURIComponent(th.data.sele_g.erpwareid),storeId:os.stoid,pageSize:2000}
  2731 + })
  2732 + }).then(res=>{
  2733 +
  2734 + wx.hideLoading();
  2735 + if(res.data.code==0){
  2736 + if(res.data.data.pageData && res.data.data.pageData.length>0){
  2737 + var plist=res.data.data.pageData;
  2738 + var def_pick_store=th.data.def_pick_store;
  2739 + //以原来的数组为外循环,保证距离的顺序
  2740 + for(var kk in o_plist){
  2741 + for(var ii in plist){
  2742 + //线下的门店小心
  2743 + var n_item=plist[ii];
  2744 + if(n_item.StorageNo==o_plist[kk].pickup_no){
  2745 +
  2746 + //拿到锁库的数量
  2747 + var lock_num=th.find_lock_num(o_plist[kk].pickup_id,lock);
  2748 + //可出库数大于预出库库存的数量,可以判断为有库存
  2749 + if(n_item.CanOutQty>lock_num){
  2750 + o_plist[kk].CanOutQty=n_item.CanOutQty-lock_num;
  2751 + new_list.push(o_plist[kk]);
  2752 + //--如果找到默认门店,同时也应该判断配送方式对不对--
  2753 + if(th.data.fir_def_store && n_item.StorageNo==th.data.fir_def_store.pickup_no && (g_distr_type==0 || th.data.fir_def_store.distr_type==0 || th.data.def_pick_store.distr_type==g_distr_type ) ){
  2754 + th.data.fir_def_store.CanOutQty=n_item.CanOutQty-lock_num;
  2755 + if(def_pick_store.pickup_id==th.data.fir_def_store.pickup_id)
  2756 + th.setData({def_pick_store:th.data.fir_def_store})
  2757 + is_find_def_store=1;
  2758 + }
  2759 + }
  2760 + break;
  2761 + }
  2762 + }
  2763 + }
  2764 +
  2765 + //数据组装下
  2766 + var em={};em.data={};em.data.data={};
  2767 + em.data.data.total=new_list.length;
  2768 + em.data.data.pageData=new_list;
  2769 +
  2770 + //--如果找到默认门店,同时也应该判断配送方式对不对--
  2771 + if(th.data.fir_def_store && !is_find_def_store && th.data.fir_def_store.pickup_id && (g_distr_type==0 || th.data.fir_def_store.distr_type==0 || th.data.def_pick_store.distr_type==g_distr_type ) ){
  2772 + th.data.fir_def_store.CanOutQty=0;
  2773 + //--当选择的门店是客户默认的门店的时候--
  2774 + if(th.data.def_pick_store && th.data.fir_def_store.pickup_id==th.data.def_pick_store.pickup_id) {
  2775 + th.setData({def_pick_store:th.data.fir_def_store});
  2776 + em.data.data.pageData.unshift(th.data.def_pick_store);
  2777 + }else{
  2778 + em.data.data.pageData.splice(1,0,th.data.fir_def_store);
  2779 + }
  2780 + }
  2781 +
  2782 + //---把数组组装进去---
  2783 + th.deal_pickup(em);
  2784 + }else{
  2785 + th.setData({def_pick_store:null,all_sto:null,only_pk:null,def_pickpu_list:null})
  2786 + }
  2787 + }else{
  2788 + th.setData({def_pick_store:null,all_sto:null,only_pk:null,def_pickpu_list:null})
  2789 + }
  2790 + })
  2791 + },
  2792 +
  2793 + find_lock_num(pick_id,lock){
  2794 + var lock_num=0;
  2795 + if(!lock) return 0;
  2796 + if(lock.length<0) return 0;
  2797 + for(var i in lock){
  2798 + if(pick_id==lock[i].pickupId){
  2799 + lock_num+=lock[i].outQty;
  2800 + }
  2801 + }
  2802 + return lock_num;
  2803 + },
  2804 +
  2805 + //----------取货门店被点击的效果------
  2806 + getmendian: function(t) {
  2807 + this.setData({
  2808 + ismend: 1,
  2809 + });
  2810 + },
  2811 +
  2812 + //----------隐藏取货门店,选取门店----------
  2813 + hidemend: function(e) {
  2814 + var pid = e.target.dataset.p_id;
  2815 + var pname = e.target.dataset.p_name;
  2816 + var p_distr_t = e.target.dataset.p_dis;
  2817 + this.setData({
  2818 + ismend: 0,
  2819 + is_sec_mend: 0,
  2820 + sto_sele_id: pid,
  2821 + sto_sele_name: pname,
  2822 + sto_sele_distr: p_distr_t
  2823 + });
  2824 + },
  2825 +
  2826 + //------显示取货2级----------
  2827 + show_sec: function(t) {
  2828 + var index = t.target.dataset.index;
  2829 + var item = this.data.all_sto[index];
  2830 + this.setData({
  2831 + is_sec_mend: 1,
  2832 + sec_sto: item
  2833 + });
  2834 + },
  2835 +
  2836 + //------隐藏取货门店2级----
  2837 + hide_sec_mend: function() {
  2838 + this.setData({
  2839 + is_sec_mend: 0,
  2840 + });
  2841 + },
  2842 +
  2843 + //评论的调用
  2844 + requestComments_new: async function(){
  2845 + var e = this, th = e,ee=e; var tp = e.data.activeCategoryId3;
  2846 + var t = '/api/weshop/comment/pageComment?page=' + e.data.c_curr_p;
  2847 +
  2848 + wx.showLoading();
  2849 + var req_where = {
  2850 + store_id: o.stoid, pageSize: 5,is_show:1,
  2851 + parent_id: 0, goods_id: th.data.gid, commenttype: tp,
  2852 + }
  2853 + if (getApp().globalData.userInfo) {
  2854 + req_where.userId = getApp().globalData.userInfo.user_id;
  2855 + }
  2856 +
  2857 + var rs_data=null;
  2858 + await getApp().request.promiseGet(t, { data: req_where}).then(res=>{
  2859 + var tot = res.data.data.total;
  2860 + e.data.c_curr_p++;
  2861 + e.setData({
  2862 + com_num: tot, //已经有加载
  2863 + });
  2864 + if (res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  2865 + rs_data=res.data.data.pageData;
  2866 + }else{
  2867 + th.setData({comments_no_more:1,auto:1});
  2868 + }
  2869 + })
  2870 +
  2871 + if (rs_data){
  2872 + //var cda = th.data.comments;
  2873 + var cda = rs_data,com_data=th.data.comments;
  2874 + for (var ind in cda) {
  2875 + var ep = cda[ind];
  2876 + if (cda[ind].head_pic == '') {
  2877 + cda[ind].head_pic = th.data.iurl + "/miniapp/images/hui_hear_pic.png";
  2878 + }
  2879 + if (ep.weapp_img != "" && ut.isString(ep.weapp_img)) {
  2880 + cda[ind].weapp_img = JSON.parse(ep.weapp_img);
  2881 + }
  2882 + if (ep.img != "" && ut.isString(ep.img)) {
  2883 + cda[ind].img = ut.unserialize(ep.img);
  2884 + }
  2885 +
  2886 + //--测量多有字的宽带,计算有多少行--
  2887 + var widh=ut.measureText(ep.content,30);
  2888 + var lines=widh/712;
  2889 + cda[ind].seeMore=false;
  2890 + if(lines>3) cda[ind].seeMore=true;
  2891 +
  2892 + await getApp().request.promiseGet("/api/weshop/comment/pageComment", {
  2893 + data: {store_id: o.stoid, parent_id: ep.comment_id }
  2894 + }).then(res => {
  2895 + if (res.data.data.pageData && res.data.data.pageData.length > 0) {
  2896 + cda[ind].replay_list = res.data.data.pageData;
  2897 + }
  2898 + })
  2899 + }
  2900 +
  2901 + if (!com_data) com_data = cda;
  2902 + else com_data = com_data.concat(cda);
  2903 +
  2904 + th.setData({ comments: com_data});
  2905 + }
  2906 + th.setData({get_c: 1});
  2907 + wx.hideLoading();
  2908 + },
  2909 +
  2910 + //加载更多是靠这个函数
  2911 + onReachBottom: function() {
  2912 + if (this.data.activeCategoryId == 2){
  2913 + if(!this.data.comments_no_more) this.requestComments_new();
  2914 + }
  2915 +
  2916 + var goods_list = this.selectComponent("#goods_list"); //组件的id
  2917 + if (goods_list) goods_list.get_list();
  2918 + },
  2919 +
  2920 + //--------检查是否活动,活动是否开始,或者是否结束-------
  2921 + async check_prom(gid, prom_type, prom_id) {
  2922 + var ee = this,
  2923 + th = ee;
  2924 + if (prom_type == 3 || prom_type == 0 || prom_type == 2 || prom_type == 5 || prom_type == 7) {
  2925 + this.setData({
  2926 + prom_type: 0,
  2927 + isshow: 1,
  2928 + });
  2929 + return false;
  2930 + }
  2931 +
  2932 +
  2933 +
  2934 + //if (prom_type != 3 && prom_type!=0){
  2935 + //---判断秒杀----
  2936 + if (prom_type == 1) {
  2937 + //-------判断活动是否抢光---------
  2938 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
  2939 + 1: 1
  2940 + }).then(res => {
  2941 + var em = res;
  2942 + if (em.data.code == 0) {
  2943 +
  2944 + if (em.data.data <= 0) ee.setData({
  2945 + prom_r_null: 1
  2946 + });
  2947 + //拿取价格并且判断时间--
  2948 + getApp().request.get("/api/ms/flash_sale/get/" +
  2949 + os.stoid + "/" + prom_id, {
  2950 + success: function(t) {
  2951 + if (t.data.code != 0) {
  2952 + ee.setData({
  2953 + prom_type: 0,
  2954 + isshow: 1,
  2955 + });
  2956 + ee.get_sku(os.stoid, ee.data.data, gid);
  2957 + return false;
  2958 + }
  2959 + //----已经结束-----
  2960 + if (t.data.data.is_end == 1) {
  2961 + ee.setData({
  2962 + prom_type: 0,
  2963 + isshow: 1,
  2964 + });
  2965 + ee.get_sku(os.stoid, ee.data.data, gid);
  2966 + ee.get_sto();
  2967 + return false;
  2968 + }
  2969 + //----已经过期-----
  2970 + var now = ut.gettimestamp();
  2971 + if (t.data.data.end_time < now) {
  2972 + ee.setData({
  2973 + prom_type: 0,
  2974 + isshow: 1,
  2975 + });
  2976 + ee.get_sku(os.stoid, ee.data.data, gid);
  2977 + return false;
  2978 + }
  2979 +
  2980 + /*-- 还没有开始预热的也不显示 --*/
  2981 + if (t.data.data.show_time > now) {
  2982 + ee.setData({
  2983 + prom_type: 0,
  2984 + isshow: 1,
  2985 + });
  2986 + ee.get_sku(os.stoid, ee.data.data, gid);
  2987 + ee.get_sto();
  2988 + return false;
  2989 + }
  2990 +
  2991 + var t_gd = ee.data.data;
  2992 + var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss");
  2993 + var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss");
  2994 +
  2995 + ee.setData({
  2996 + prom_price: t.data.data.price,
  2997 + prom_type: 1,
  2998 + prom_id: prom_id,
  2999 + prom_buy_limit: t.data.data.buy_limit,
  3000 + prom_act: t.data.data,
  3001 + prom_end_time: prom_end_time,
  3002 + prom_start_time: prom_start_time,
  3003 + isshow: 1,
  3004 + });
  3005 +
  3006 + ee.get_sto();
  3007 +
  3008 +
  3009 + var newTime = ut.gettimestamp();
  3010 + var endTime2 = t.data.data.end_time;
  3011 + var endTime1 = t.data.data.start_time;
  3012 +
  3013 + //---苹果机不兼容---
  3014 + /*----
  3015 + var endTime2 = new Date(prom_end_time).getTime();
  3016 + var endTime1 = new Date(prom_start_time).getTime();----*/
  3017 +
  3018 + if (endTime1 > newTime) {
  3019 + ee.setData({
  3020 + prom_time_text: '距秒杀开始还有'
  3021 + })
  3022 + ee.countDown(endTime1, 0);
  3023 + } else {
  3024 + if (endTime2 > newTime) {
  3025 + ee.setData({
  3026 + prom_time_text: '距秒杀结束还有',
  3027 + prom_st: 1
  3028 + })
  3029 + ee.countDown(endTime2);
  3030 + }
  3031 + }
  3032 + }
  3033 + });
  3034 + }
  3035 + })
  3036 + }
  3037 +
  3038 + if(prom_type==4){
  3039 + //th.setData({is_integral_normal:1});
  3040 + var rdata={
  3041 + store_id:o.stoid,stype:1,stypeup:1,goods_id:gid
  3042 + }
  3043 +
  3044 + var integrals=0;
  3045 + var get_datas= {
  3046 + user_id:getApp().globalData.user_id, store_id:o.stoid,
  3047 + };
  3048 + await getApp().request.promiseGet("/api/weshop/users/getAllPoints", {
  3049 + data: get_datas
  3050 + }).then(res => {
  3051 + if(res.data.code==0){
  3052 + integrals=res.data.data.Integral;
  3053 + }
  3054 + })
  3055 +
  3056 + //获取一下积分活动
  3057 + await getApp().request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList", {
  3058 + data: rdata
  3059 + }).then(res => {
  3060 + //调用接口有数据的时候
  3061 + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0) {
  3062 + var inte_data=res.data.data.pageData[0];
  3063 + var can_integral=(parseFloat(integrals)>=parseFloat(inte_data.integral));
  3064 + ee.setData({
  3065 + prom_price:parseFloat(inte_data.addmoney),
  3066 + prom_integral:parseFloat(inte_data.integral),
  3067 + prom_type: 4,
  3068 + prom_id: inte_data.id,
  3069 + prom_buy_limit: inte_data.limitvipqty,
  3070 + prom_act: inte_data,
  3071 + isshow: 1,
  3072 + can_integral:can_integral,
  3073 + is_shopbuy: parseInt(inte_data.is_shopbuy?inte_data.is_shopbuy:0)
  3074 + });
  3075 + ee.get_sto();
  3076 +
  3077 + }else{
  3078 + ee.setData({prom_type: 0, isshow: 1,});
  3079 + ee.get_sku(os.stoid, ee.data.data, gid);
  3080 + ee.get_sto();
  3081 + return false;
  3082 + }
  3083 + })
  3084 +
  3085 + }
  3086 +
  3087 +
  3088 + //---判断拼单----
  3089 + if (prom_type == 6) {
  3090 + //-------判断活动是否抢光---------
  3091 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
  3092 + 1: 1
  3093 + }).then(res => {
  3094 + var em = res;
  3095 + if (em.data.code == 0) {
  3096 +
  3097 +
  3098 + if (em.data.data <= 0) ee.setData({
  3099 + prom_r_null: 1
  3100 + });
  3101 + //拿取价格并且判断时间--
  3102 + getApp().request.get("/api/weshop/teamlist/get/" +
  3103 + os.stoid + "/" + prom_id, {
  3104 + success: function(t) {
  3105 + if (t.data.code != 0) {
  3106 + ee.setData({
  3107 + prom_type: 0,
  3108 + isshow: 1,
  3109 + });
  3110 + ee.get_sku(os.stoid, ee.data.data, gid);
  3111 + ee.get_sto();
  3112 + return false;
  3113 + }
  3114 + //----已经结束-----
  3115 + if (t.data.data.is_end == 1) {
  3116 + ee.setData({
  3117 + prom_type: 0,
  3118 + isshow: 1,
  3119 + });
  3120 + ee.get_sku(os.stoid, ee.data.data, gid);
  3121 + return false;
  3122 + }
  3123 + //----已经过期-----
  3124 + var now = ut.gettimestamp();
  3125 + if (t.data.data.end_time < now) {
  3126 + ee.setData({
  3127 + prom_type: 0,
  3128 + isshow: 1,
  3129 + });
  3130 + ee.get_sku(os.stoid, ee.data.data, gid);
  3131 + ee.get_sto();
  3132 + return false;
  3133 + }
  3134 +
  3135 + /*-- 还没有开始预热的也不显示 --*/
  3136 + if (t.data.data.show_time > now) {
  3137 + ee.setData({
  3138 + prom_type: 0,
  3139 + isshow: 1,
  3140 + });
  3141 + ee.get_sku(os.stoid, ee.data.data, gid);
  3142 + ee.get_sto();
  3143 + return false;
  3144 + }
  3145 +
  3146 + //-------查看自己是不是有买过该团的商品,并还为支付,或者在进行中-------
  3147 + getApp().request.get("/api/weshop/order/page", {
  3148 + data: {
  3149 + pt_prom_id: prom_id,
  3150 + user_id: oo.user_id,
  3151 + store_id: os.stoid,
  3152 + pageSize: 1,
  3153 + page: 1
  3154 + },
  3155 + success: function(e) {
  3156 + if (e.data.code == 0 && e.data.data.pageData.length > 0) {
  3157 + var odr = e.data.data.pageData[0];
  3158 + th.data.buy_order = odr;
  3159 + if (odr.pt_status == 0 && odr.order_status == 1) {
  3160 + th.setData({
  3161 + user_order_pt_state: 1
  3162 + });
  3163 + }
  3164 + if (odr.pt_status == 1 && odr.order_status == 1) {
  3165 + if (odr.is_zsorder == 4) {
  3166 + getApp().request.promiseGet("/api/weshop/teamgroup/page/", {
  3167 + data: {
  3168 + store_id: os.stoid,
  3169 + team_id: odr.pt_prom_id,
  3170 + listno: odr.pt_listno
  3171 + }
  3172 + }).then(res => {
  3173 + var now = ut.gettimestamp();
  3174 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  3175 + var tgr = res.data.data.pageData[0];
  3176 + //如果团的时间已经到了
  3177 + if (now >= tgr.kt_end_time) {
  3178 + th.update_jiti(tgr.id);
  3179 + } else {
  3180 + th.setData({
  3181 + user_order_pt_state: 2
  3182 + });
  3183 + }
  3184 + }
  3185 + })
  3186 +
  3187 + } else {
  3188 + th.setData({
  3189 + user_order_pt_state: 2
  3190 + });
  3191 + }
  3192 + }
  3193 +
  3194 + if (odr.pt_status == 2 && odr.is_zsorder == 4) {
  3195 + th.setData({
  3196 + user_order_pt_state: 3,
  3197 + });
  3198 + th.data.wk_order_id = odr.order_id;
  3199 + }
  3200 + }
  3201 + },
  3202 + });
  3203 +
  3204 + //----------查看阶梯团------------
  3205 + if (t.data.data.ct_rylist != "null" && t.data.data.ct_rylist != "" && t.data.data.ct_rylist != null && t.data.data.ct_rylist != undefined) {
  3206 + t.data.data.ct_rylist = JSON.parse(t.data.data.ct_rylist);
  3207 + var max_num = 0;
  3208 + t.data.data.ct_rylist.forEach(function(val, ind) {
  3209 + if (parseInt(val.rynum) > max_num) max_num = parseInt(val.rynum);
  3210 + })
  3211 + t.data.data.max_ct_num = max_num;
  3212 + }
  3213 +
  3214 + var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss");
  3215 + var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss");
  3216 + ee.setData({
  3217 + prom_price: t.data.data.price,
  3218 + prom_type: 6,
  3219 + prom_id: prom_id,
  3220 + prom_buy_limit: t.data.data.buy_limit,
  3221 + prom_act: t.data.data,
  3222 + prom_end_time: prom_end_time,
  3223 + prom_start_time: prom_start_time,
  3224 + isshow: 1,
  3225 + });
  3226 +
  3227 + ee.get_sto();
  3228 +
  3229 + var newTime = now;
  3230 + var endTime2 = t.data.data.end_time;
  3231 + var endTime1 = t.data.data.start_time;
  3232 +
  3233 + if (endTime1 > newTime) {
  3234 + ee.setData({
  3235 + prom_time_text: '距拼单开始还剩:'
  3236 + })
  3237 + ee.countDown(endTime1, 0);
  3238 + } else {
  3239 + if (endTime2 > newTime) {
  3240 + ee.setData({
  3241 + prom_time_text: '距拼单结束还剩:',
  3242 + prom_st: 1
  3243 + })
  3244 + ee.countDown(endTime2);
  3245 + }
  3246 + }
  3247 + //-------查看有多少人在开这个团-------
  3248 + th.get_team_group(prom_id);
  3249 + }
  3250 + });
  3251 + }
  3252 + })
  3253 + }
  3254 +
  3255 + },
  3256 +
  3257 + //--获取有多少人在开团--
  3258 + async get_team_group(prom_id) {
  3259 + var teamgroup = [],
  3260 + th = this,
  3261 + grounp_tatal = 0;
  3262 + //如果活动是开团不是商家团
  3263 + if (this.data.prom_act.kttype > 1) {
  3264 +
  3265 + var req_data={
  3266 + store_id: os.stoid,
  3267 + pageSize: 3,
  3268 + page: 1,
  3269 + state: 2,
  3270 + team_id: prom_id,
  3271 + ordernum:1
  3272 + };
  3273 +
  3274 + if(this.data.prom_act.kttype==3 && this.data.prom_act.max_ct_num ){
  3275 + req_data.max_num=this.data.prom_act.max_ct_num;
  3276 + }
  3277 +
  3278 + //获取活动从表信息team_id
  3279 + await getApp().request.promiseGet("/api/weshop/teamgroup/page", {
  3280 + data: req_data
  3281 + }).then(res => {
  3282 + teamgroup = res.data.data.pageData;
  3283 + grounp_tatal = res.data.data.total;
  3284 + })
  3285 + //获取订单的总数这个接口不能用
  3286 + for (i = 0; i < teamgroup.length; i++) {
  3287 + await getApp().request.promiseGet("/api/weshop/order/page", {
  3288 + data: {
  3289 + store_id: os.stoid,
  3290 + pt_status: 1,
  3291 + pt_listno: teamgroup[i].listno
  3292 + }
  3293 + }).then(res => {
  3294 + var order = res.data.data.pageData;
  3295 + teamgroup[i].open_num = order.length;
  3296 + })
  3297 + await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + teamgroup[i].openvipid, {}).then(res => {
  3298 + var user = res.data.data;
  3299 + teamgroup[i].user = user;
  3300 + })
  3301 + }
  3302 +
  3303 + if (teamgroup.length > 0) {
  3304 + th.setData({
  3305 + teamgroup: teamgroup,
  3306 + grounp_tatal: grounp_tatal
  3307 + });
  3308 + th.countDown2();
  3309 + }
  3310 + }
  3311 + },
  3312 +
  3313 + //---小于10的格式化函数----
  3314 + timeFormat(param) {
  3315 + return param < 10 ? '0' + param : param;
  3316 + },
  3317 +
  3318 + //----倒计时函数-----
  3319 + countDown(time, prom_st) {
  3320 + if (!this.data.is_timer) return false;
  3321 + var th = this;
  3322 + // 获取当前时间,同时得到活动结束时间数组
  3323 + var endTime = time;
  3324 + var newTime = ut.gettimestamp();
  3325 + // 对结束时间进行处理渲染到页面
  3326 + var obj = null;
  3327 + // 如果活动未结束,对时间进行处理
  3328 + if (endTime - newTime > 0) {
  3329 + var time = (endTime - newTime);
  3330 + // 获取天、时、分、秒
  3331 + var day = parseInt(time / (60 * 60 * 24));
  3332 + var hou = parseInt(time % (60 * 60 * 24) / 3600);
  3333 + var min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  3334 + var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
  3335 + obj = {
  3336 + day: this.timeFormat(day),
  3337 + hou: this.timeFormat(hou),
  3338 + min: this.timeFormat(min),
  3339 + sec: this.timeFormat(sec)
  3340 + }
  3341 + } else {
  3342 + if (th.data.prom_st == 0) {
  3343 + //var endTime2 = new Date(th.data.prom_end_time).getTime();
  3344 + var endTime2 = th.data.prom_act.end_time;
  3345 + th.setData({
  3346 + prom_time_text: '距结束还剩:',
  3347 + prom_st: 1
  3348 + })
  3349 + setTimeout(function() {
  3350 + th.countDown(endTime2)
  3351 + }, 1000);
  3352 + return false;
  3353 +
  3354 + } else {
  3355 + //活动已结束,全部设置为'00'
  3356 + obj = {
  3357 + day: '00',
  3358 + hou: '00',
  3359 + min: '00',
  3360 + sec: '00'
  3361 + }
  3362 + th.setData({
  3363 + prom_time_text: '活动已经结束:',
  3364 + prom_st: 3
  3365 + })
  3366 + th.setData({
  3367 + djs: obj
  3368 + });
  3369 + return false;
  3370 + }
  3371 + }
  3372 +
  3373 + th.setData({
  3374 + djs: obj
  3375 + });
  3376 + setTimeout(function() {
  3377 + th.countDown(endTime)
  3378 + }, 1000);
  3379 + },
  3380 +
  3381 +
  3382 + //-------------获取购买数量的总函数----------------
  3383 + get_buy_num: function(gd, func) {
  3384 + var map = this.data.g_buy_num,
  3385 + th = this,
  3386 + user_id = getApp().globalData.user_id;
  3387 + if (user_id == null) {
  3388 + map.set(gd.goods_id, 0);
  3389 + th.setData({
  3390 + g_buy_num: map,
  3391 + prom_buy_num: 0,
  3392 + });
  3393 + "function" == typeof func && func();
  3394 + return false;
  3395 + }
  3396 +
  3397 + if (map.has(gd.goods_id)) {
  3398 + "function" == typeof func && func();
  3399 + } else {
  3400 + //----获取商品购买数----
  3401 + getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", {
  3402 + data: {
  3403 + store_id: os.stoid,
  3404 + user_id: user_id,
  3405 + goods_id: gd.goods_id
  3406 + },
  3407 + success: function(t) {
  3408 + if (t.data.code == 0) {
  3409 + var g_buy_num = t.data.data.goodsbuynum;
  3410 + if (gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6) {
  3411 + //----获取活动购买数----
  3412 + getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", {
  3413 + data: {
  3414 + store_id: os.stoid,
  3415 + user_id: user_id,
  3416 + goods_id: gd.goods_id,
  3417 + prom_type: gd.prom_type,
  3418 + prom_id: gd.prom_id
  3419 + },
  3420 + //-----获取-----
  3421 + success: function(tt) {
  3422 + if (tt.data.code == 0) {
  3423 + map.set(gd.goods_id, g_buy_num);
  3424 + th.setData({
  3425 + g_buy_num: map,
  3426 + prom_buy_num: tt.data.data.goodsbuynum,
  3427 + });
  3428 + "function" == typeof func && func();
  3429 + }
  3430 + }
  3431 + });
  3432 + } else {
  3433 + map.set(gd.goods_id, g_buy_num);
  3434 + th.setData({
  3435 + g_buy_num: map
  3436 + });
  3437 + "function" == typeof func && func();
  3438 + }
  3439 + }
  3440 + }
  3441 + });
  3442 + }
  3443 + },
  3444 +
  3445 + //--拼单推荐的显示---
  3446 + tj_Click: function(e) {
  3447 + var ind = parseInt(e.target.dataset.ind);
  3448 + this.setData({
  3449 + is_show_gz: ind
  3450 + });
  3451 + },
  3452 +
  3453 + //--------拼团玩法显示详情--------
  3454 + show_pt_xx: function(e) {
  3455 + this.setData({
  3456 + pd_xx: 1,
  3457 + })
  3458 + },
  3459 + close_pt_xx: function() {
  3460 + this.setData({
  3461 + pd_xx: 0,
  3462 + })
  3463 + },
  3464 +
  3465 + //--点击弹起拼单--
  3466 + openSpecModel_pt: function(e) {
  3467 +
  3468 +
  3469 + this.setData({ open_ind_store: 4,goodsInputNum:1});//拼团直接给4
  3470 +
  3471 +
  3472 + //--先判断会员状态--
  3473 + var user_info = getApp().globalData.userInfo;
  3474 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  3475 + wx.navigateTo({
  3476 + url: '/pages/togoin/togoin',
  3477 + })
  3478 + return false;
  3479 + }
  3480 +
  3481 + var th = this;
  3482 + var ind = parseInt(e.currentTarget.dataset.it);
  3483 + //如果是拼单活动的普通购买
  3484 + if (ind == 1) {
  3485 + //如果拼单的sku data是空的,就要先获取一下
  3486 + if (th.data.sku_g_pt) {
  3487 + th.get_sto(1);
  3488 + th.setData({
  3489 + is_normal: ind,
  3490 + openSpecModal_pt: 1
  3491 + });
  3492 + } else {
  3493 + th.get_sto(1);
  3494 + th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function() {
  3495 + th.setData({
  3496 + is_normal: ind,
  3497 + openSpecModal_pt: 1
  3498 + });
  3499 + });
  3500 + }
  3501 + th.check_is_youhui(th.data.gid,1);
  3502 + } else {
  3503 +
  3504 + //拼单商品从这里进,先判断有没有买过商品,
  3505 + getApp().request.get("/api/weshop/order/page", {
  3506 + data: {
  3507 + pt_prom_id: th.data.prom_act.id,
  3508 + user_id: oo.user_id,
  3509 + store_id: os.stoid,
  3510 + pageSize: 1,
  3511 + page: 1
  3512 + },
  3513 + success: function(e) {
  3514 + //--跳转到已经购买的情况--
  3515 + if (e.data.data.pageData.length > 0) {
  3516 + var odr = e.data.data.pageData[0];
  3517 + //还未支付
  3518 + if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) {
  3519 + wx.showModal({
  3520 + title: "您已经购买了该商品待支付中",
  3521 + success: function(a) {
  3522 + if (a.confirm) {
  3523 + wx.navigateTo({
  3524 + url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,
  3525 + });
  3526 + }
  3527 + }
  3528 + });
  3529 + } else if (odr.pt_status == 1 && odr.order_status == 1) {
  3530 +
  3531 + if(this.data.is_go_to_team_show) return false;
  3532 + this.data.is_go_to_team_show=1;
  3533 + wx.showLoading();
  3534 +
  3535 + /*---
  3536 + wx.redirectTo({
  3537 + url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,
  3538 + });--*/
  3539 + getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn);
  3540 +
  3541 + } else {
  3542 + th.setData({
  3543 + is_normal: ind,
  3544 + openSpecModal_pt: 1
  3545 + });
  3546 + }
  3547 +
  3548 + } else {
  3549 + th.setData({
  3550 + is_normal: ind,
  3551 + openSpecModal_pt: 1
  3552 + });
  3553 + }
  3554 + }
  3555 + });
  3556 + }
  3557 + },
  3558 +
  3559 + //-----------------拼单生成方法---------------------
  3560 + addCart_pt: function() {
  3561 + var th = this;
  3562 + if (this.data.is_normal == 0) {
  3563 + //看一下有没有起购数,如果有起购数,要计算起购数
  3564 + var qnum = parseFloat(th.data.prom_act.minbuynum);
  3565 + if (qnum > 0 && th.data.goodsInputNum < qnum) {
  3566 + getApp().confirmBox("拼团商品至少要买" + qnum + "件!");
  3567 + return false;
  3568 + }
  3569 +
  3570 + th.addcart_pt_func();
  3571 + } else {
  3572 + th.addcart_pt_func();
  3573 + }
  3574 + },
  3575 +
  3576 + addcart_pt_func: function() {
  3577 + if (oo.user_id == null) {
  3578 + s.my_warnning("还未登录!", 0, this);
  3579 + return;
  3580 + }
  3581 + var e = this,
  3582 + th = e,
  3583 + o = this.data.sele_g;
  3584 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
  3585 +
  3586 + //----------添加到购物车时,要判断限购数量,--------
  3587 + e.get_buy_num(o, async function(ee) {
  3588 +
  3589 + //---判断商品是否超出限购---
  3590 + if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
  3591 + if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {
  3592 + wx.showModal({
  3593 + title: '提示',
  3594 + content: '超出商品限购'
  3595 + });
  3596 +
  3597 + var num=th.data.prom_buy_limit-th.data.prom_buy_num;
  3598 + if(num<0) num=0;
  3599 + th.setData({goodsInputNum:num})
  3600 + return false;
  3601 + }
  3602 + }
  3603 + //---判断商品是否超出活动限购,拼团的普通购买不计算活动的限购---
  3604 + if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal!=1) {
  3605 + if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {
  3606 + wx.showModal({
  3607 + title: '提示',
  3608 + content: '超出商品活动限购'
  3609 + });
  3610 +
  3611 + var num=th.data.prom_buy_limit-th.data.prom_buy_num;
  3612 + if(num<0) num=0;
  3613 + th.setData({goodsInputNum:num})
  3614 + return false;
  3615 + }
  3616 + }
  3617 +
  3618 + var redis_num = 0
  3619 + //不是普通购买的时候
  3620 + if(th.data.is_normal!=1){
  3621 + //-------判断活动是否抢光---------
  3622 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/6/" + th.data.sele_g.prom_id, {
  3623 + 1: 1
  3624 + }).then(res => {
  3625 + redis_num = res.data.data;
  3626 + })
  3627 +
  3628 + if (th.data.goodsInputNum > redis_num) {
  3629 + wx.showModal({
  3630 + title: '提示',
  3631 + content: '超出商品活动库存'
  3632 + });
  3633 +
  3634 + th.setData({goodsInputNum:redis_num})
  3635 +
  3636 + return false;
  3637 + }
  3638 + }
  3639 +
  3640 + if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);
  3641 + if (th.data.goodsInputNum > o.store_count) {
  3642 + th.setData({goodsInputNum:o.store_count})
  3643 + return s.my_warnning("超出商品库存", 0, th);
  3644 + }
  3645 +
  3646 + if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)
  3647 + this.setData({
  3648 + sto_sele_name: ""
  3649 + });
  3650 + if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);
  3651 + //--------------此时操作的数据------------
  3652 + var newd = {
  3653 + goods_id: o.goods_id,
  3654 + goods_num: th.data.goodsInputNum,
  3655 + pick_id: th.data.sto_sele_id,
  3656 + user_id: oo.user_id,
  3657 + store_id: th.data.stoid,
  3658 + goods_price: o.shop_price,
  3659 + goods_name: o.goods_name,
  3660 + goods_sn: o.goods_sn,
  3661 + sku: o.sku,
  3662 + };
  3663 +
  3664 + //---是不是从收藏夹出来的---
  3665 + if(th.data.c_guide_id){
  3666 + newd['guide_id'] = th.data.c_guide_id;
  3667 + newd['guide_type']=2;
  3668 +
  3669 + }else{
  3670 + if(getApp().globalData.guide_id){
  3671 + newd['guide_id'] = getApp().globalData.guide_id;
  3672 + newd['guide_type']=0;
  3673 +
  3674 + }
  3675 + }
  3676 +
  3677 + //让商品带上房间号
  3678 + if(th.data.sys_switch.is_skuroom_id==1){
  3679 + if(th.data.data.goods_id==getApp().globalData.room_goods_id){
  3680 + newd.room_id=getApp().globalData.room_id;
  3681 + }
  3682 + }else{
  3683 + if(newd.goods_id==getApp().globalData.room_goods_id){
  3684 + newd.room_id=getApp().globalData.room_id;
  3685 + }
  3686 + }
  3687 +
  3688 + //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------
  3689 +
  3690 + if(th.data.is_normal == 1){
  3691 + var conf=th.data.bconfig;
  3692 + if(conf.switch_list){
  3693 + var s_list=JSON.parse(conf.switch_list);
  3694 + //如果后台有开启等级价的功能
  3695 + if(parseInt(s_list.rank_switch)==2){
  3696 + var card_price=o[getApp().globalData.userInfo['card_field']];
  3697 + //如果会员有等级价
  3698 + if(getApp().globalData.userInfo['card_field']!=undefined && getApp().globalData.userInfo['card_field']!=null
  3699 + && getApp().globalData.userInfo['card_field']!="" && card_price>0){
  3700 + newd.goods_price=card_price;
  3701 + }
  3702 + }
  3703 + }
  3704 + }
  3705 +
  3706 +
  3707 + //-----如果是秒杀,团购,积分购,拼团,且不是普通购买-----
  3708 + if (th.data.prom_type == 6 && th.data.is_normal!= 1) {
  3709 + newd.goods_price = th.data.prom_price;
  3710 + newd.prom_type = th.data.prom_type;
  3711 + newd.prom_id = th.data.prom_id;
  3712 + newd.kt_type = th.data.prom_act.kttype; //开团类型
  3713 + newd.is_pt_tz = 0;
  3714 + //th.data.sto_sele_distr=1; //直接用自提的方式提交
  3715 + if (newd.kt_type > 1) {
  3716 + newd.is_pt_tz = 1; //开团类型
  3717 + }
  3718 + if (newd.kt_type == 3) {
  3719 + th.data.sto_sele_distr = 1;
  3720 + }
  3721 +
  3722 + } else if (th.data.prom_type == 3) {
  3723 + newd.prom_type = 0;
  3724 + newd.prom_id = 0;
  3725 + }
  3726 +
  3727 + newd['pick_name'] = th.data.sto_sele_name;
  3728 + newd['pick_dis'] = th.data.sto_sele_distr;
  3729 + newd['is_normal'] = th.data.is_normal;
  3730 +
  3731 + if(newd['is_normal']){
  3732 + newd['is_pd_normal']=1;
  3733 + //判断一下有没有全局优惠活动
  3734 + th.check_nor_promgood(newd.goods_id,function(e){
  3735 + if(e && e.act_id){
  3736 + newd['prom_type']=3;
  3737 + newd['prom_id']=e.act_id;
  3738 + }
  3739 + th.buyNow(newd)
  3740 + })
  3741 + }
  3742 + else th.buyNow_pt(newd);
  3743 + })
  3744 + },
  3745 + //----------立即购买_pt-----------
  3746 + buyNow_pt: function(e) {
  3747 + s.set_b_now(e);
  3748 + wx.navigateTo({
  3749 + url: "/pages/cart/cart2_pt/cart2_pt?is_bnow=1&goods_id=" + e.goods_id,
  3750 + });
  3751 + },
  3752 +
  3753 + //-------跳转pt商品-------
  3754 + go_to_nopay: function() {
  3755 + var th = this;
  3756 + url="/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id;
  3757 + getApp().goto(url);
  3758 +
  3759 + },
  3760 + //-------跳转pt teamshow-------
  3761 + go_to_team_show: function() {
  3762 +
  3763 + if(this.data.is_go_to_team_show) return false;
  3764 + this.data.is_go_to_team_show=1;
  3765 + wx.showLoading();
  3766 +
  3767 + var th = this;
  3768 + var url="/pages/team/team_success/team_success?ordersn=" + th.data.buy_order.order_sn;
  3769 + /*--
  3770 + wx.redirectTo({
  3771 + url:url,
  3772 + })--*/
  3773 + getApp().goto(url);
  3774 +
  3775 + },
  3776 +
  3777 + //---拼团倒计时---
  3778 + countDown2() {
  3779 + if (!this.data.is_timer) return false;
  3780 + var th = this;
  3781 + // 获取当前时间,同时得到活动结束时间数组
  3782 + var newTime = ut.gettimestamp();
  3783 + var List = th.data.teamgroup;
  3784 + for (var j = 0; j < List.length; j++) {
  3785 + // 对结束时间进行处理渲染到页面
  3786 + var endTime = List[j].kt_end_time;
  3787 + let obj = null;
  3788 + // 如果活动未结束,对时间进行处理
  3789 + if (endTime - newTime > 0) {
  3790 + let time = (endTime - newTime);
  3791 + // 获取天、时、分、秒
  3792 + let day = parseInt(time / (60 * 60 * 24));
  3793 + let hou = parseInt(time % (60 * 60 * 24) / 3600);
  3794 + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  3795 + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
  3796 + obj = {
  3797 + day: this.timeFormat(day),
  3798 + hou: this.timeFormat(hou),
  3799 + min: this.timeFormat(min),
  3800 + sec: this.timeFormat(sec)
  3801 + }
  3802 + } else {
  3803 + //活动已结束,全部设置为'00'
  3804 + obj = {
  3805 + day: '00',
  3806 + hou: '00',
  3807 + min: '00',
  3808 + sec: '00'
  3809 + }
  3810 + }
  3811 + var txt = "timer[" + j + "]";
  3812 + th.setData({
  3813 + [txt]: obj
  3814 + });
  3815 + }
  3816 + setTimeout(th.countDown2, 1000);
  3817 + },
  3818 + //跳转参加团
  3819 + go_cj_team: function(e) {
  3820 + var ind = e.currentTarget.dataset.ind;
  3821 + var item = this.data.teamgroup[ind];
  3822 + var id = item.id;
  3823 + var th = this;
  3824 +
  3825 + getApp().request.get("/api/weshop/order/page", {
  3826 + data: {
  3827 + pt_prom_id: item.team_id,
  3828 + user_id: oo.user_id,
  3829 + store_id: os.stoid,
  3830 + pageSize: 1,
  3831 + page: 1
  3832 + },
  3833 + success: function(e) {
  3834 + if (e.data.code != 0) {
  3835 + getApp().my_warnning("读取订单失败", 0, th);
  3836 + return fasle;
  3837 + }
  3838 + //--跳转到已经购买的情况--
  3839 + if (e.data.data.pageData.length > 0) {
  3840 + var odr = e.data.data.pageData[0];
  3841 + //还未支付
  3842 + if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) {
  3843 + wx.showModal({
  3844 + title: "您已经购买了该商品待支付中",
  3845 + success: function(a) {
  3846 + if (a.confirm) {
  3847 + wx.navigateTo({
  3848 + url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,
  3849 + });
  3850 + }
  3851 + }
  3852 + });
  3853 + } else if (odr.pt_status == 1 && odr.order_status == 1) {
  3854 +
  3855 + if(this.data.is_go_to_team_show) return false;
  3856 + this.data.is_go_to_team_show=1;
  3857 + wx.showLoading();
  3858 + /*--
  3859 + wx.redirectTo({
  3860 + url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,
  3861 + });--*/
  3862 +
  3863 + getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn);
  3864 +
  3865 + } else {
  3866 + wx.navigateTo({
  3867 + url: "/pages/team/team_show/team_show?tg_id=" + id,
  3868 + });
  3869 + }
  3870 + }
  3871 + //--跳转到参团--
  3872 + else {
  3873 + wx.navigateTo({
  3874 + url: "/pages/team/team_show/team_show?tg_id=" + id,
  3875 + });
  3876 + }
  3877 + }
  3878 + })
  3879 +
  3880 + },
  3881 +
  3882 + //跳到团更多
  3883 + go_t_more: function() {
  3884 + var team_id = this.data.prom_id;
  3885 + wx.navigateTo({
  3886 + url: "/pages/team/team_more/team_more?team_id=" + team_id,
  3887 + });
  3888 + },
  3889 +
  3890 + //--点赞功能--
  3891 + click_zan: function(e) {
  3892 + var com_id = e.currentTarget.dataset.com_id;
  3893 + var item_id = e.currentTarget.dataset.item_id;
  3894 + var app = getApp(),
  3895 + th = this;
  3896 +
  3897 + if (app.globalData.userInfo == null || app.globalData.userInfo == undefined) {
  3898 + app.confirmBox("您还未登录");
  3899 + return false;
  3900 + }
  3901 +
  3902 + var iszan = th.data.comments[item_id].userZanNum;
  3903 + if (this.data.iszaning) return false;
  3904 + this.data.iszaning = 1;
  3905 +
  3906 +
  3907 + app.request.post("/api/weshop/commentZan/save", {
  3908 + data: {
  3909 + store_id: o.stoid,
  3910 + user_id: app.globalData.user_id,
  3911 + goods_id: th.data.gid,
  3912 + comment_id: com_id
  3913 + },
  3914 + success: function(ee) {
  3915 +
  3916 + if (ee.data.code == "-1") {
  3917 + app.my_warnning("不能给自己点赞", 0, th);
  3918 + th.data.iszaning = 0;
  3919 + return;
  3920 + }
  3921 +
  3922 + if (ee.data.code == 0 && iszan != 1) {
  3923 + var num = th.data.comments[item_id].zan_num;
  3924 + num++;
  3925 + var text = "comments[" + item_id + "].zan_num";
  3926 + var text1 = "comments[" + item_id + "].userZanNum";
  3927 + var _errObj = {};
  3928 + _errObj[text] = num;
  3929 + _errObj[text1] = 1;
  3930 + th.setData(_errObj);
  3931 +
  3932 + } else {
  3933 + var num = th.data.comments[item_id].zan_num;
  3934 + num--;
  3935 + var text = "comments[" + item_id + "].zan_num";
  3936 + var text1 = "comments[" + item_id + "].userZanNum";
  3937 + var _errObj = {};
  3938 + _errObj[text] = num;
  3939 + _errObj[text1] = 0;
  3940 + th.setData(_errObj);
  3941 + }
  3942 +
  3943 + setTimeout(function() {
  3944 + th.data.iszaning = 0;
  3945 + }, 500)
  3946 +
  3947 + }
  3948 + })
  3949 + },
  3950 +
  3951 + /*----券的开关---*/
  3952 + switchCoupon: async function(event) {
  3953 + var coupon = event.currentTarget.dataset.coupon;
  3954 + var app = getApp();
  3955 + var url = "/api/weshop/prom/coupon/pageCouponList";
  3956 + var quan_list = this.data.quan_list;
  3957 + var th = this;
  3958 +
  3959 + //当开启,且列表为空的情况下要
  3960 + if (!quan_list && coupon == "1") {
  3961 + wx.showLoading();
  3962 + await app.request.promiseGet(url, {
  3963 + data: {
  3964 + store_id: os.stoid,
  3965 + type: 1,
  3966 + pageSize: 100,
  3967 + page: 1,
  3968 + user_id: app.globalData.user_id,
  3969 + is_share:0
  3970 + }
  3971 + }).then(res => {
  3972 + wx.hideLoading();
  3973 + quan_list = res.data.data.pageData;
  3974 + })
  3975 +
  3976 + if (quan_list) {
  3977 + for (var ind in quan_list) {
  3978 + var ep = quan_list[ind];
  3979 + var start = ut.formatTime(ep.use_start_time, "yyyy-MM-dd");
  3980 + var end = ut.formatTime(ep.use_end_time, "yyyy-MM-dd");
  3981 + start = start.replace("00:00:00", "");
  3982 + end = end.replace("00:00:00", "");
  3983 + quan_list[ind].start = start;
  3984 + quan_list[ind].end = end;
  3985 + }
  3986 + }
  3987 +
  3988 + th.setData({
  3989 + coupon: coupon,
  3990 + quan_list: quan_list
  3991 + });
  3992 + } else {
  3993 + th.setData({
  3994 + coupon: coupon
  3995 + });
  3996 + }
  3997 + },
  3998 +
  3999 + //--查看评价--
  4000 + look_pj: function() {
  4001 + this.tabComment();
  4002 + this.doScrollTop();
  4003 + },
  4004 +
  4005 + //-----领取券-----
  4006 + get_quan: function(e) {
  4007 + var cid = e.currentTarget.dataset.cid;
  4008 + var index = e.currentTarget.dataset.ind;
  4009 + var item = this.data.quan_list[index];
  4010 +
  4011 +
  4012 + //--先判断会员状态--
  4013 + var user_info = getApp().globalData.userInfo;
  4014 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  4015 + wx.navigateTo({
  4016 + url: '/pages/togoin/togoin',
  4017 + })
  4018 + return false;
  4019 + }
  4020 +
  4021 +
  4022 + //如果券还在领取中,不能再点
  4023 + if (item.linging == 1) {
  4024 + getApp().my_warnning('领取中..', 0, this);
  4025 + return false;
  4026 + }
  4027 +
  4028 + //如果领取的次数到了
  4029 + if (item.everyone_num > 0 && item.lqnum >= item.everyone_num) {
  4030 + getApp().my_warnning('领取失败,您已领完该券', 0, this);
  4031 + return false;
  4032 + }
  4033 +
  4034 + var lq_num = item.lqnum;
  4035 +
  4036 + var pdata = {
  4037 + 'uid': oo.user_id,
  4038 + 'cid': cid,
  4039 + 'store_id': os.stoid,
  4040 + 'type': 5
  4041 + };
  4042 +
  4043 + //-- 导购ID --
  4044 + if(getApp().globalData.guide_id){
  4045 + pdata.guide_id=getApp().globalData.guide_id;
  4046 + }
  4047 +
  4048 + var app = getApp(),
  4049 + th = this;
  4050 + app.request.post("/api/weshop/couponList/saveCouponList", {
  4051 + data: pdata,
  4052 + success: function(res) {
  4053 + if (res.data.code == 0) {
  4054 + app.my_warnning("领取成功", 1, th);
  4055 + lq_num++;
  4056 + var text = "quan_list[" + index + "].lqnum";
  4057 + var text2 = "quan_list[" + index + "].linging";
  4058 + var obj = {};
  4059 + obj[text] = lq_num;
  4060 + obj[text2] = 0;
  4061 + th.setData(obj);
  4062 + } else {
  4063 + app.confirmBox(res.data.msg);
  4064 + var text2 = "quan_list[" + index + "].linging";
  4065 + var obj = {};
  4066 + obj[text2] = 0;
  4067 + th.setData(obj);
  4068 + }
  4069 + }
  4070 + })
  4071 + },
  4072 +
  4073 + //--定义的保存图片方法,分享团---
  4074 + saveImageToPhotosAlbum: function() {
  4075 + //--先判断会员状态--
  4076 + var user_info = getApp().globalData.userInfo;
  4077 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  4078 + //getApp().my_warnning("请先登录",0,this);
  4079 + wx.navigateTo({ url: '/pages/togoin/togoin', })
  4080 + return false;
  4081 + }
  4082 +
  4083 + if(this.data.share_hidden) {
  4084 + this.setData({
  4085 + share_hidden: false,
  4086 + });
  4087 + };
  4088 +
  4089 + //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团
  4090 + var type = this.data.prom_type;
  4091 + if (type == 6) type = 2;
  4092 + if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3;
  4093 +
  4094 + wx.showLoading({
  4095 + title: '生成中...',
  4096 + })
  4097 + var that = this,
  4098 + th = that;
  4099 + //设置画板显示,才能开始绘图
  4100 + that.setData({
  4101 + canvasHidden: false
  4102 + })
  4103 +
  4104 + var app = getApp();
  4105 + var unit = that.data.screenWidth / 750 * 1.35; //基础单位,
  4106 + var path2 = that.data.data.original_img;
  4107 + var scene = th.data.gid+"";
  4108 + var user_id = getApp().globalData.user_id?getApp().globalData.user_id:0;
  4109 + if(user_id>0) {
  4110 + scene+="_"+user_id;
  4111 + }
  4112 + //-- 如果不是会员分享过来的要分享给别人 --
  4113 + if(getApp().globalData.room_id && th.data.data.goods_id==getApp().globalData.room_goods_id && !getApp().globalData.room_user_share) {
  4114 + //固定房间是第3个字符
  4115 + if(!user_id) scene+="_0";
  4116 + scene+="_"+getApp().globalData.room_id ;
  4117 + }
  4118 + ///二微码
  4119 + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
  4120 + os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo";
  4121 +
  4122 + console.log(path3);
  4123 +
  4124 + //读取文件成功则OK--
  4125 + wx.getImageInfo({
  4126 + src: path3,
  4127 + success: function(res) {
  4128 + //回调写法
  4129 + th.get_head_temp(th.get_goods_temp, function() {
  4130 + var vpath = res.path;
  4131 + var context = wx.createCanvasContext('share');
  4132 + //先画背景
  4133 + var pg_path = "../../../../images/share/share_bg.png";
  4134 +
  4135 + // context.fillStyle="#FFFFFF";
  4136 + // context.fillRect(0,0,554 * unit, 899 * unit);
  4137 +
  4138 + //-- 如果有自定义海报的时候,判断背景的图片 --
  4139 + if(th.data.share_b_img){
  4140 + pg_path=th.data.share_b_img;
  4141 + }
  4142 + context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
  4143 +
  4144 + //-- 是自定义海报的情况下 --
  4145 + if(th.data.poster && parseInt(th.data.poster.style)==2) {
  4146 + //在线上分享人的情况下
  4147 + if(parseInt(th.data.poster.show_headpic)){
  4148 + //获取坐标
  4149 + var x=parseFloat(th.data.poster.head_x)*2;
  4150 + var y=parseFloat(th.data.poster.head_y)*2;
  4151 + var x1=(x+90) *unit;
  4152 + var y1=(y+50) *unit;
  4153 + //--昵称---
  4154 + context.setFontSize(24 * unit)
  4155 + context.setFillStyle("black")
  4156 + context.fillText(app.globalData.userInfo.nickname, x1, y1);
  4157 + var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
  4158 + //强烈推荐 改许程
  4159 + var tj_path = "../../../../images/share/q_tj.png";
  4160 + context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit);
  4161 + context.setFontSize(16 * unit)
  4162 + context.setLineJoin('round'); //交点设置成圆角
  4163 + context.setFillStyle("white")
  4164 + context.fillText('强烈推荐', x1 + width+8*unit, y1-1*unit);
  4165 +
  4166 + //context.setFillStyle("black")
  4167 + //context.setFontSize(24 * unit)
  4168 + //context.fillText(getApp().globalData.config.store_name, 40 * unit, 130 * unit);
  4169 + }
  4170 + } else {
  4171 + //--昵称---
  4172 + context.setFontSize(24 * unit)
  4173 + context.setFillStyle("black")
  4174 + context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);
  4175 + var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
  4176 + //强烈推荐 改许程
  4177 + var tj_path = "../../../../images/share/q_tj.png";
  4178 + context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
  4179 + context.setFontSize(16 * unit);
  4180 + context.setLineJoin('round'); //交点设置成圆角
  4181 + context.setFillStyle("white");
  4182 + context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 75 * unit);
  4183 + }
  4184 +
  4185 + var share_title=th.data.data.goods_name;
  4186 + if(th.data.prom_type==1 || th.data.prom_type==6 || th.data.prom_type==4){
  4187 + share_title=th.data.prom_act.share_title;
  4188 + if(!share_title) share_title=th.data.prom_act.title;
  4189 + if(th.data.prom_type==4) share_title=th.data.prom_act.name;
  4190 + }
  4191 +
  4192 + //---产品名称---
  4193 + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
  4194 + if(type!=4){
  4195 + context.setFillStyle("black");
  4196 + context.setFontSize(21.3 * unit)
  4197 + th.draw_Text(context, share_title,
  4198 + 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit);
  4199 +
  4200 + //------产品的价格-------
  4201 + context.setFontSize(23 * unit)
  4202 + context.setFillStyle("red")
  4203 +
  4204 +
  4205 + var pri0 = th.data.data.shop_price;
  4206 + if (th.data.prom_act)
  4207 + pri0 = th.data.prom_act.price;
  4208 + pri0 = parseFloat(pri0).toFixed(2);
  4209 + var wd1=th.data.screenWidth-ut.measureText(pri0, 31 * unit)-25;
  4210 + context.fillText("¥", wd1-15, 185 * unit);
  4211 + context.setFontSize(31 * unit)
  4212 + context.fillText(pri0, wd1, 185 * unit);
  4213 +
  4214 + //---市场价划掉---
  4215 + context.setFillStyle("gray")
  4216 + context.setFontSize(22 * unit)
  4217 + pri0="¥" + th.data.data.market_price.toFixed(2);
  4218 + var wd2=th.data.screenWidth-ut.measureText(pri0, 22 * unit)-25;
  4219 + context.fillText(pri0, wd2, 213 * unit);
  4220 +
  4221 + context.setStrokeStyle('gray');
  4222 + context.setLineWidth(1 * unit);
  4223 + context.moveTo(wd2-5, 206 * unit);
  4224 + context.lineTo(wd2+ut.measureText(pri0, 22 * unit)+5, 206 * unit);
  4225 + context.stroke();
  4226 +
  4227 + }else{
  4228 + context.setFillStyle("black");
  4229 + context.setFontSize(21.3 * unit)
  4230 + th.draw_Text(context, share_title,
  4231 + 38 * unit, 170 * unit, 20 * unit, 300*unit, unit);
  4232 + //------ 产品的价格 -----
  4233 + var pri0 = th.data.prom_act.addmoney;
  4234 + var integral=th.data.prom_act.integral;
  4235 + var text= "";
  4236 + if(integral){text=integral+"积分"; }
  4237 + if(pri0 && integral){ text+="+";}
  4238 + if(pri0){ text+="¥"+pri0;}
  4239 +
  4240 + if(!pri0 && !integral){ text="0积分";}
  4241 + context.setFillStyle("red");
  4242 + context.fillText(text, 38 * unit, 235 * unit);
  4243 +
  4244 + }
  4245 +
  4246 + //---中间大图---
  4247 + context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit);
  4248 + //-------大图后面就不一样了-----------
  4249 + switch (type) {
  4250 + case 0: //普通商品的展示
  4251 + case 4:
  4252 + //中间的几个字
  4253 + if(th.data.poster && parseInt(th.data.poster.style)==2 ){
  4254 + if(parseInt(th.data.poster.show_quality)){
  4255 + var g_path = "../../../../images/share/s_gou.png";
  4256 + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
  4257 + context.setFillStyle("red")
  4258 + context.setFontSize(18 * unit)
  4259 + context.fillText("正品保证", 84 * unit, 690 * unit);
  4260 +
  4261 + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
  4262 + context.setFillStyle("red")
  4263 + context.setFontSize(18 * unit)
  4264 + context.fillText("纯实体店", 246 * unit, 690 * unit);
  4265 +
  4266 + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
  4267 + context.setFillStyle("red")
  4268 + context.setFontSize(18 * unit)
  4269 + context.fillText("官方验证", 420 * unit, 690 * unit);
  4270 + }
  4271 +
  4272 + }else{
  4273 + var g_path = "../../../../images/share/s_gou.png";
  4274 + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
  4275 + context.setFillStyle("red")
  4276 + context.setFontSize(18 * unit)
  4277 + context.fillText("正品保证", 84 * unit, 690 * unit);
  4278 +
  4279 + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
  4280 + context.setFillStyle("red")
  4281 + context.setFontSize(18 * unit)
  4282 + context.fillText("纯实体店", 246 * unit, 690 * unit);
  4283 +
  4284 + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
  4285 + context.setFillStyle("red")
  4286 + context.setFontSize(18 * unit)
  4287 + context.fillText("官方验证", 420 * unit, 690 * unit);
  4288 + }
  4289 +
  4290 +
  4291 + //---画线---
  4292 + context.setLineWidth(1 * unit)
  4293 + context.moveTo(32 * unit, 710 * unit)
  4294 + context.lineTo(520 * unit, 710 * unit)
  4295 + context.stroke();
  4296 +
  4297 + //---文字---
  4298 + context.setFillStyle("black")
  4299 + context.setFontSize(22 * unit)
  4300 +
  4301 + if(type==0){
  4302 + // 原来start --->
  4303 + context.setFontSize(24 * unit)
  4304 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 766 * unit);
  4305 +
  4306 + context.setFontSize(22 * unit)
  4307 + context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 806 * unit);
  4308 + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 846 * unit);
  4309 +
  4310 + }else{
  4311 + context.setFontSize(24 * unit)
  4312 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 766 * unit);
  4313 + context.setFontSize(22 * unit)
  4314 + context.fillText("长按识别二维码", 40 * unit, 806 * unit);
  4315 + context.fillText("立即开始兑换", 40 * unit, 846 * unit);
  4316 +
  4317 +
  4318 + }
  4319 +
  4320 + //---二维吗图---
  4321 + //-- 自定义海报 --
  4322 + if(th.data.poster){
  4323 + var erm_x= parseFloat(th.data.poster.ewm_x)*2;
  4324 + var erm_y= parseFloat(th.data.poster.ewm_y)*2;
  4325 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);
  4326 + }else{
  4327 + //---二维吗图---
  4328 + context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);
  4329 + }
  4330 +
  4331 + break;
  4332 + case 1: //秒杀商品的展示
  4333 + //---画线---
  4334 + context.setLineWidth(1 * unit)
  4335 + context.moveTo(32 * unit, 670 * unit)
  4336 + context.lineTo(520 * unit, 670 * unit)
  4337 + context.stroke();
  4338 +
  4339 + //画秒杀的图片
  4340 + var miaos_path = '../../../../images/share/miao_share.png';
  4341 + context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit);
  4342 +
  4343 + context.setFillStyle("black")
  4344 + context.setFontSize(24 * unit)
  4345 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 786 * unit);
  4346 + //---文字---
  4347 + context.setFontSize(22 * unit)
  4348 + context.setFillStyle("black")
  4349 + context.fillText("特惠好物,限时秒杀", 40 * unit, 826 * unit);
  4350 + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 866 * unit);
  4351 +
  4352 +
  4353 + //---二维吗图---
  4354 + //-- 自定义海报 --
  4355 + if(th.data.poster){
  4356 + var erm_x= parseFloat(th.data.poster.ewm_x)*2;
  4357 + var erm_y= parseFloat(th.data.poster.ewm_y)*2;
  4358 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 135 * unit, 135 * unit);
  4359 + }else{
  4360 + //---二维吗图---
  4361 + context.drawImage(vpath, 390 * unit, 726 * unit, 135 * unit, 135 * unit);
  4362 + }
  4363 + break;
  4364 +
  4365 + case 2: //会员团和商家团的展示
  4366 + //---画线---
  4367 + context.setLineWidth(1 * unit)
  4368 + context.moveTo(32 * unit, 670 * unit)
  4369 + context.lineTo(520 * unit, 670 * unit)
  4370 + context.stroke();
  4371 + //---文字---
  4372 +
  4373 + context.setFillStyle("black")
  4374 + context.setFontSize(24 * unit)
  4375 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit);
  4376 +
  4377 + //绘制成团图片
  4378 + var ct_img = "../../../../images/share/ct_num.png";
  4379 + context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit);
  4380 + var ct_num = th.data.prom_act.ct_num;
  4381 + context.setFontSize(14 * unit)
  4382 + context.font = 'normal';
  4383 + context.setFillStyle("red")
  4384 + if (ct_num < 10) {
  4385 + context.fillText(ct_num + "人拼团", 92 * unit, 760 * unit);
  4386 + } else {
  4387 + context.fillText(ct_num + "人拼团", 86 * unit, 760 * unit);
  4388 + }
  4389 + context.setFontSize(22 * unit)
  4390 + context.fillText("已拼" + th.data.prom_act.buy_num + "份", 166 * unit, 763 * unit);
  4391 +
  4392 + context.setFillStyle("gray")
  4393 + context.fillText("快来和我一起拼团吧!", 40 * unit, 806 * unit);
  4394 + context.setFillStyle("black")
  4395 + context.font = 'normal bold 18px sans-serif';
  4396 + context.setFontSize(21.3 * unit)
  4397 + context.fillText("长按识别二维码,立即参团", 40 * unit, 836 * unit);
  4398 +
  4399 +
  4400 + //---二维吗图---
  4401 + //-- 自定义海报 --
  4402 + if(th.data.poster){
  4403 + var erm_x= parseFloat(th.data.poster.ewm_x)*2;
  4404 + var erm_y= parseFloat(th.data.poster.ewm_y)*2;
  4405 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);
  4406 + }else{
  4407 + //---二维吗图---
  4408 + context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);
  4409 + }
  4410 + break
  4411 + case 3: //阶梯团的展示
  4412 + //---画线---
  4413 + context.setLineWidth(1 * unit)
  4414 + context.moveTo(32 * unit, 670 * unit)
  4415 + context.lineTo(520 * unit, 670 * unit)
  4416 + context.stroke();
  4417 + //---文字---
  4418 +
  4419 + context.setFillStyle("black")
  4420 + context.setFontSize(24 * unit)
  4421 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit);
  4422 +
  4423 + //---绘制中间阶梯的价格---
  4424 + var list = th.data.prom_act.ct_rylist;
  4425 + for (var i = 0; i < list.length; i++) {
  4426 + var item = list[i];
  4427 + var wi = i * 90 * unit;
  4428 + context.font = 'normal';
  4429 + context.setFontSize(16 * unit)
  4430 + context.setFillStyle("red")
  4431 + context.fillText("¥", 40 * unit + wi, 756 * unit);
  4432 + context.setFontSize(22 * unit)
  4433 + var pri = parseFloat(item.price).toFixed(2);
  4434 + context.fillText(pri, 56 * unit + wi, 756 * unit);
  4435 + context.setFillStyle("gray")
  4436 + context.fillText("满" + item.rynum + "人", 40 * unit + wi, 786 * unit);
  4437 + }
  4438 + //----------------下面部分----------------
  4439 + // context.setFillStyle("gray")
  4440 + // context.fillText("快来和我一起拼团吧!", 40 * unit, 830 * unit);
  4441 + // context.setFillStyle("black")
  4442 + // context.font = 'normal bold 18px sans-serif';
  4443 + // context.setFontSize(22 * unit)
  4444 + // context.fillText("长按识别二维码,立即参团", 40 * unit, 860 * unit);
  4445 + //context.setFillStyle("gray")
  4446 + context.setFillStyle("black")
  4447 + context.fillText("快来和我一起拼团吧!", 40 * unit, 820 * unit);
  4448 + //context.font = 'normal bold 18px sans-serif';
  4449 + context.setFontSize(21 * unit)
  4450 + context.fillText("长按识别二维码,立即参团", 40 * unit, 850 * unit);
  4451 +
  4452 +
  4453 + //-- 自定义海报 --
  4454 + if(th.data.poster){
  4455 + var erm_x= parseFloat(th.data.poster.ewm_x)*2;
  4456 + var erm_y= parseFloat(th.data.poster.ewm_y)*2;
  4457 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);
  4458 + }else{
  4459 + //---二维吗图---
  4460 + context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);
  4461 + }
  4462 + break
  4463 +
  4464 +
  4465 + }
  4466 +
  4467 +
  4468 + //--- 如果是自定义海报的时候 ---
  4469 + if(th.data.poster && parseInt(th.data.poster.style)==2){
  4470 +
  4471 + //如果显示会员信息的话
  4472 + if(parseInt(th.data.poster.show_headpic)){
  4473 + //获取坐标
  4474 + var x= parseFloat(th.data.poster.head_x)*2;
  4475 + var y=parseFloat(th.data.poster.head_y)*2;
  4476 + //---绘制圆形要放在最后----
  4477 + context.save();
  4478 + context.beginPath();
  4479 + var h_x = x* unit;
  4480 + var h_y = y * unit;
  4481 + var h_r = 40 * unit;
  4482 + var cx = h_x + h_r;
  4483 + var cy = h_y + h_r;
  4484 + context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
  4485 + context.closePath();
  4486 + context.fill();
  4487 + context.clip();
  4488 + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
  4489 + context.restore();
  4490 + }
  4491 +
  4492 + }else{
  4493 + //---绘制圆形要放在最后----
  4494 + context.save();
  4495 + context.beginPath();
  4496 + var h_x = 60 * unit;
  4497 + var h_y = 24 * unit;
  4498 + var h_r = 40 * unit;
  4499 + var cx = h_x + h_r;
  4500 + var cy = h_y + h_r;
  4501 + context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
  4502 + context.closePath();
  4503 + context.fill();
  4504 + context.clip();
  4505 + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
  4506 + context.restore();
  4507 + }
  4508 +
  4509 +
  4510 + //把画板内容绘制成图片,并回调 画板图片路径
  4511 + context.draw(false, function() {
  4512 + setTimeout(function() {
  4513 + wx.canvasToTempFilePath({
  4514 + x: 0,
  4515 + y: 0,
  4516 + width: 750,
  4517 + height: 1217,
  4518 + destWidth: 1.2 * 750 * 750 / that.data.screenWidth,
  4519 + destHeight: 1.2 * 1217 * 750 / that.data.screenWidth,
  4520 + canvasId: 'share',
  4521 + success: function (res) {
  4522 +
  4523 + that.setData({
  4524 + shareImgPath: res.tempFilePath,
  4525 + canvasHidden: true
  4526 + })
  4527 +
  4528 + if (!res.tempFilePath) {
  4529 + wx.showModal({
  4530 + title: '提示',
  4531 + content: '图片绘制中,请稍后重试',
  4532 + showCancel: false
  4533 + })
  4534 + return false;
  4535 + }
  4536 +
  4537 + // wx.previewImage({
  4538 + // //将图片预览出来
  4539 + // urls: [that.data.shareImgPath]
  4540 + // });
  4541 + that.setData({
  4542 + showPoster: true,
  4543 + });
  4544 + wx.hideLoading();
  4545 + }
  4546 + })
  4547 + }, 500)
  4548 +
  4549 + });
  4550 + });
  4551 + },
  4552 + fail: function(res) {
  4553 + console.log(res);
  4554 + wx.hideLoading();
  4555 +
  4556 + }
  4557 + });
  4558 + },
  4559 +
  4560 +
  4561 + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
  4562 + draw_Text: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) {
  4563 + var lineWidth = 0;
  4564 + var lastSubStrIndex = 0; //每次开始截取的字符串的索引
  4565 + var han = 0;
  4566 + for (let i = 0; i < str.length; i++) {
  4567 + if (han == 2) return;
  4568 + //lineWidth += ctx.measureText(str[i]).width;
  4569 + lineWidth += ut.measureText(str[i], 21.3 * unit);
  4570 + if (lineWidth > canvasWidth) {
  4571 + han++;
  4572 +
  4573 + if (han == 2)
  4574 + ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分
  4575 + else
  4576 + ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight);
  4577 +
  4578 + initHeight += 22; //22为字体的高度
  4579 + lineWidth = 0;
  4580 + lastSubStrIndex = i;
  4581 + titleHeight += 20;
  4582 + }
  4583 + if (i == str.length - 1) { //绘制剩余部分
  4584 + ctx.fillText(str.substring(lastSubStrIndex, i + 1), leftWidth, initHeight);
  4585 + }
  4586 + }
  4587 + },
  4588 +
  4589 + // ----视频图片----
  4590 + // 图片计数器
  4591 + swiperChange: function(e) {
  4592 + var that = this;
  4593 + if (e.detail.current > 0) {
  4594 + that.setData({
  4595 + hiddenn: 1,
  4596 + videopicture: 1,
  4597 + })
  4598 + } else {
  4599 + that.setData({
  4600 + hiddenn: 0,
  4601 + videopicture: 0,
  4602 + })
  4603 + }
  4604 + if (e.detail.source == 'touch') {
  4605 + that.setData({
  4606 + current: e.detail.current
  4607 + })
  4608 + }
  4609 + },
  4610 +
  4611 + /*---视频相关--*/
  4612 + videopicture: function(e) {
  4613 + var vipi = e.currentTarget.dataset.vipi;
  4614 + this.setData({
  4615 + videopicture: vipi,
  4616 + swiperCurrent: vipi,
  4617 + noon: 0,
  4618 + current: 1
  4619 + });
  4620 + },
  4621 +
  4622 + videoPlay: function(e) {
  4623 + var _index = e.currentTarget.id
  4624 + this.setData({
  4625 + _index: _index,
  4626 + noon: 1
  4627 + })
  4628 +
  4629 + setTimeout(function() {
  4630 + //将点击视频进行播放
  4631 + var videoContext = wx.createVideoContext(_index)
  4632 + videoContext.play();
  4633 + }, 500)
  4634 + },
  4635 +
  4636 +
  4637 +
  4638 + //--获取头像的本地缓存,回调写法--
  4639 + get_head_temp: function(tt, func) {
  4640 + var ee = this;
  4641 + if (ee.data.share_head) {
  4642 + tt(func);
  4643 + return false;
  4644 + }
  4645 + //---获取分享图片的本地地址,头像和商品图片----
  4646 + var path2 = getApp().globalData.userInfo.head_pic;
  4647 + if (path2 == "") {
  4648 + ee.data.share_head = "../../../../images/share/hui_hear_pic.png";
  4649 + tt(func);
  4650 + } else {
  4651 + path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn");
  4652 + path2 = path2.replace("https://thirdwx.qlogo.cn", "https://wx.qlogo.cn");
  4653 + wx.getImageInfo({
  4654 + src: path2,
  4655 + success: function(res) {
  4656 + //res.path是网络图片的本地地址
  4657 + ee.data.share_head = res.path;
  4658 + tt(func);
  4659 + },
  4660 + fail: function(res) {
  4661 + ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的
  4662 + tt(func);
  4663 + }
  4664 + });
  4665 + }
  4666 + },
  4667 + //--获取商品图片的本地缓存,回调写法--
  4668 + get_goods_temp: function(tt) {
  4669 + var ee = this;
  4670 + if (ee.data.share_goods_img) {
  4671 + tt();
  4672 + return false;
  4673 + }
  4674 +
  4675 + var img_url=ee.data.data.original_img;
  4676 + if((this.data.prom_type==1 || this.data.prom_type==6) && this.data.prom_act.share_imgurl){
  4677 + img_url=this.data.iurl+this.data.prom_act.share_imgurl;
  4678 + }
  4679 +
  4680 + //获取商品是分享图信息
  4681 + wx.getImageInfo({
  4682 + src: img_url,
  4683 + success: function(res) {
  4684 + //res.path是网络图片的本地地址
  4685 + ee.data.share_goods_img = res.path;
  4686 + tt();
  4687 + },
  4688 + fail: function(res) {
  4689 + ee.data.share_goods_img = "../../../../images/share/default_g_img.gif"; //分享的图片不能用网络的
  4690 + tt();
  4691 + }
  4692 + });
  4693 + },
  4694 +
  4695 + //--外侧评价的点击效果---
  4696 + clik_evaluate: function(e) {
  4697 + var val = e.currentTarget.dataset.val;
  4698 + this.setData({
  4699 + activeCategoryId: 2,
  4700 + activeCategoryId3: val,
  4701 + comments: null
  4702 + });
  4703 + this.requestComments_new();
  4704 + },
  4705 +
  4706 + //--跳转到商品详情页面--
  4707 + go_goods: function(e) {
  4708 + var gid = e.currentTarget.dataset.gid;
  4709 + var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + gid;
  4710 + getApp().goto(url);
  4711 + },
  4712 +
  4713 + //--跳转到支付尾款界面--
  4714 + go_pay_wk: function() {
  4715 + var url = "/pages/cart/cart_wk/cart_wk?order_id=" + this.data.wk_order_id;
  4716 + getApp().goto(url);
  4717 + },
  4718 +
  4719 + pop_err_img: function(e) {
  4720 + var txt = e.currentTarget.dataset.errorimg;
  4721 + var ob = {};
  4722 + ob[txt] = this.data.iurl + "/miniapp/images/default_g_img.gif";
  4723 + this.setData(ob);
  4724 + },
  4725 +
  4726 + //--调用更新阶梯团的接口--
  4727 + update_jiti: function(id) {
  4728 + var th = this;
  4729 + //--更新阶梯团--
  4730 + getApp().request.put("/api/weshop/teamgroup/updateTeamOrder/" + os.stoid + "/" + id, {
  4731 + success: function(ee) {
  4732 + //--等于0是要去支付尾款,接口调用失败,就要去查看参团详情--
  4733 + if (ee.data.code == 0) {
  4734 + th.setData({
  4735 + user_order_pt_state: 3,
  4736 + });
  4737 + } else if (ee.data.code == -1) {
  4738 + th.setData({
  4739 + user_order_pt_state: 2,
  4740 + });
  4741 + }
  4742 + }
  4743 + })
  4744 + },
  4745 + // 选择门店
  4746 + choice_store: function(ee) {
  4747 + var th = this;
  4748 + var ind=ee.currentTarget.dataset.ind;
  4749 + var bconfig = th.data.bconfig;
  4750 +
  4751 + if(!th.data.only_pk && !th.data.def_pickpu_list){
  4752 + getApp().confirmBox("门店库存不足", null, 25000, !1);
  4753 + return false;
  4754 + }
  4755 +
  4756 + if(th.data.only_pk && !th.data.only_pk.length){
  4757 + getApp().confirmBox("门店库存不足", null, 25000, !1);
  4758 + return false;
  4759 + }
  4760 + if(th.data.def_pickpu_list && !th.data.def_pickpu_list.length){
  4761 + getApp().confirmBox("门店库存不足", null, 25000, !1);
  4762 + return false;
  4763 + }
  4764 +
  4765 +
  4766 + if (bconfig && bconfig.is_sort_storage) {
  4767 + wx.getLocation({
  4768 + type: 'gcj02',
  4769 + success: function(res) {
  4770 +
  4771 + th.data.lat = res.latitude;
  4772 + th.data.lon = res.longitude;
  4773 + th.data.is_get_local_ok = 1;
  4774 + th.setData({
  4775 + is_gps: 1
  4776 + });
  4777 + //th.onShow();
  4778 + th.get_sto(th.data.is_normal);
  4779 + },
  4780 + fail: function(res) {
  4781 + //th.onShow();
  4782 + th.data.is_get_local_ok = 1;
  4783 + th.get_sto(th.data.is_normal);
  4784 + if (res.errCode == 2) {
  4785 + th.setData({
  4786 + is_gps: 0
  4787 + });
  4788 + if (th.data.is_gps == 0) {
  4789 + getApp().confirmBox("请开启GPS定位", null, 25000, !1);
  4790 + }
  4791 + } else {
  4792 + th.setData({
  4793 + is_gps: "3"
  4794 + });
  4795 + }
  4796 +
  4797 + }
  4798 + })
  4799 + }else{
  4800 + th.data.is_get_local_ok = 1;
  4801 + th.get_sto(th.data.is_normal);
  4802 + }
  4803 +
  4804 + if(ind!=undefined && ind!=null ){
  4805 + this.setData({
  4806 + open_ind_store: ind,
  4807 + store: 1,
  4808 + openSpecModal: !1,
  4809 + openSpecModal_pt: !1
  4810 + })
  4811 + }else{
  4812 + this.setData({
  4813 + store: 1,
  4814 + openSpecModal: !1,
  4815 + openSpecModal_pt: !1
  4816 + })
  4817 + }
  4818 + },
  4819 + //关闭选择门店
  4820 + close_popup: function(e) {
  4821 + var th=this;
  4822 + this.setData({
  4823 + store: 0,
  4824 + choice_sort_store: 0,
  4825 + sort_store: 0,
  4826 + fir_pick_index:0,
  4827 + sec_pick_index:0
  4828 + })
  4829 +
  4830 + var openindstore=this.data.open_ind_store;
  4831 + if (openindstore == 1) {
  4832 + th.setData({
  4833 + openSpecModal: !0,
  4834 + openSpecModal_ind: openindstore,
  4835 + });
  4836 + } else if (openindstore == 2) {
  4837 + th.setData({
  4838 + openSpecModal: !0,
  4839 + openSpecModal_ind: openindstore,
  4840 + });
  4841 + }
  4842 + else if (openindstore == 4) { //4就是拼团
  4843 + th.setData({
  4844 + openSpecModal_pt: 1, //打开拼团购买界面
  4845 + store: 0, //关闭门店
  4846 + choice_sort_store: 0, //关闭门店2级
  4847 + sort_store: 0, //关闭门店2级
  4848 + });
  4849 + }
  4850 + else {
  4851 + th.setData({
  4852 + store: 0,
  4853 + choice_sort_store: 0,
  4854 + sort_store: 0
  4855 + })
  4856 + }
  4857 +
  4858 +
  4859 + },
  4860 +
  4861 + //选择更多门店
  4862 + more_store: function() {
  4863 + this.setData({
  4864 + sort_store: 1
  4865 + });
  4866 + },
  4867 + sort_store: function() {
  4868 +
  4869 + },
  4870 + // 返回按钮
  4871 + returns: function() {
  4872 + this.setData({
  4873 + sort_store: 0,
  4874 + choice_sort_store: 0
  4875 + });
  4876 + },
  4877 + //---选择分类门店---
  4878 + choice_sort_store: function(e) {
  4879 + var index = e.currentTarget.dataset.index;
  4880 + var region_name = e.currentTarget.dataset.region;
  4881 + var item = this.data.all_sto[index];
  4882 + this.setData({
  4883 + region_name: region_name,
  4884 + sort_store: 0,
  4885 + choice_sort_store: 1,
  4886 + sec_sto: item,
  4887 + sec_pick_index: 0
  4888 + });
  4889 + },
  4890 +
  4891 + choose_for_store_fir: function(e) {
  4892 + var index_c = e.currentTarget.dataset.ind;
  4893 + var th=this;
  4894 + th.setData({
  4895 + fir_pick_index: index_c
  4896 + })
  4897 +
  4898 + },
  4899 +
  4900 + //如果开启线下库存,已经急速库存才会使用
  4901 + async check_the_pick(item,func){
  4902 + var th=this;
  4903 + var goodsinfo=th.data.sele_g;
  4904 + var erpwareid=goodsinfo.erpwareid;
  4905 + var plist=null;
  4906 + var lock=0;
  4907 +
  4908 + //---如果是活动的时候,同时不是普通购买---
  4909 + if((th.data.prom_type==1 || th.data.prom_type==6 || th.data.prom_type==4) && !th.data.is_normal ) {
  4910 + func(); return false;
  4911 + }
  4912 +
  4913 + if(this.data.sales_rules!=2){
  4914 + func();
  4915 + }else{
  4916 +
  4917 + //先读取门店的lock
  4918 + await getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{
  4919 + data:{store_id:os.stoid,wareId:goodsinfo.goods_id,storageId:item.pickup_id,pageSize:1000}
  4920 + }).then(res=>{
  4921 + if(res.data.code==0 && res.data.data.total>0){
  4922 + for(var i in res.data.data.pageData )
  4923 + lock+=res.data.data.pageData[i].outQty;
  4924 + }
  4925 + })
  4926 + //读取线下的门店库存
  4927 + await getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{
  4928 + data:{storageNos:item.pickup_no,wareIds:encodeURIComponent(erpwareid),storeId:os.stoid}
  4929 + }).then(res=>{
  4930 + if(res.data.code==0 && res.data.data.total>0){
  4931 + plist=res.data.data.pageData[0];
  4932 + }
  4933 + })
  4934 +
  4935 + if(plist && plist.CanOutQty-lock>0){
  4936 + item.CanOutQty=plist.CanOutQty-lock;
  4937 + func();
  4938 + return false;
  4939 + }
  4940 + getApp().my_warnning(item.pickup_name+"库存不足!", 0, th);
  4941 +
  4942 + }
  4943 + },
  4944 +
  4945 +
  4946 + //确定def_pick为选择的门店
  4947 + sure_pick: function(e) {
  4948 + var th = this;
  4949 + var item = null;
  4950 + var openindstore = th.data.open_ind_store;
  4951 +
  4952 + if (th.data.choice_sort_store == 0) {
  4953 + var index = th.data.fir_pick_index;
  4954 + if (th.data.is_show_sto_cat == 1) {
  4955 + item = th.data.def_pickpu_list[index];
  4956 + } else {
  4957 + item = th.data.only_pk[index]; //当没有门店分类的时候
  4958 + }
  4959 +
  4960 + } else {
  4961 + var index = th.data.sec_pick_index;
  4962 + item = th.data.sec_sto.s_arr[index];
  4963 + }
  4964 +
  4965 + if(!th.data.sele_g) return false;
  4966 + //判断门店的配送方式是不是匹配
  4967 + var g_distr_type = th.data.sele_g.distr_type;
  4968 + if(item.distr_type!=0 && g_distr_type!=0 && item.distr_type!=g_distr_type){
  4969 + wx.showToast({
  4970 + title: "门店配送方式不匹配",
  4971 + icon: 'none',
  4972 + duration: 2000
  4973 + });
  4974 + return false;
  4975 + }
  4976 +
  4977 + //--回调函数的用法--
  4978 + th.check_the_pick(item,function(){
  4979 + th.setData({
  4980 + def_pick_store: item,
  4981 + sto_sele_name: item.pickup_name,
  4982 + sto_sele_id: item.pickup_id,
  4983 + sto_sele_distr: item.distr_type,
  4984 + store: 0,
  4985 + choice_sort_store: 0,
  4986 + fir_pick_index: 0
  4987 + });
  4988 +
  4989 + if (openindstore == 1) {
  4990 + th.setData({
  4991 + openSpecModal: !0,
  4992 + openSpecModal_ind: openindstore,
  4993 + });
  4994 + } else if (openindstore == 2) {
  4995 + th.setData({
  4996 + openSpecModal: !0,
  4997 + openSpecModal_ind: openindstore,
  4998 + });
  4999 + }
  5000 + else if (openindstore == 4) { //4就是拼团
  5001 + th.setData({
  5002 + openSpecModal_pt: 1, //打开拼团购买界面
  5003 + store: 0, //关闭门店
  5004 + choice_sort_store: 0, //关闭门店2级
  5005 + sort_store: 0, //关闭门店2级
  5006 + });
  5007 + }
  5008 + else {
  5009 + th.setData({
  5010 + store: 0,
  5011 + choice_sort_store: 0,
  5012 + sort_store: 0
  5013 + })
  5014 + }
  5015 + //如果商品没有其他活动,要取一下线下价格
  5016 + th.get_off_price();
  5017 + })
  5018 + },
  5019 + //---点击二级之后的选择---
  5020 + choose_for_store: function(e) {
  5021 + var index_c = e.currentTarget.dataset.ind;
  5022 + var th=this;
  5023 + th.setData({
  5024 + sec_pick_index: index_c,
  5025 + fir_pick_index: index_c
  5026 + })
  5027 +
  5028 + },
  5029 + //把选择的门店设置成默认的门店def_pick
  5030 + set_def_pick: function(e) {
  5031 + var th = this;
  5032 + var item = null;
  5033 + if (th.data.choice_sort_store == 0) {
  5034 + var index = th.data.fir_pick_index;
  5035 + if (th.data.is_show_sto_cat == 1) {
  5036 + item = th.data.def_pickpu_list[index];
  5037 + } else {
  5038 + item = th.data.only_pk[index]; //当没有门店分类的时候
  5039 + }
  5040 + } else {
  5041 + var index = th.data.sec_pick_index;
  5042 + item = th.data.sec_sto.s_arr[index];
  5043 + }
  5044 +
  5045 + //判断门店的配送方式是不是匹配
  5046 + var g_distr_type = th.data.sele_g.distr_type;
  5047 + if(item.distr_type!=0 && g_distr_type!=0 && item.distr_type!=g_distr_type){
  5048 + wx.showToast({
  5049 + title: "门店配送方式不匹配",
  5050 + icon: 'none',
  5051 + duration: 2000
  5052 + });
  5053 + return false;
  5054 + }
  5055 +
  5056 + //先设置之前,要判断是不是有库存
  5057 + th.check_the_pick(item,function(){
  5058 + var store_id = o.stoid;
  5059 + var user_id = getApp().globalData.user_id;
  5060 + var def_pickup_id = item.pickup_id;
  5061 +
  5062 + getApp().request.put('/api/weshop/users/update', {
  5063 + data: {
  5064 + user_id:user_id,
  5065 + def_pickup_id:def_pickup_id
  5066 + },
  5067 + success: function(res) {
  5068 + if (res.data.code == 0) {
  5069 + if (th.data.choice_sort_store == 0) th.setData({
  5070 + fir_pick_index: 0
  5071 + });
  5072 + getApp().globalData.pk_store = item;
  5073 + } else {
  5074 + //s.showWarning("设置默认门店地址失败", null, 500, !1);
  5075 + getApp().my_warnning("设置默认门店地址失败",0,th)
  5076 + }
  5077 +
  5078 + }
  5079 + });
  5080 +
  5081 + th.setData({
  5082 + def_pick_store: item,
  5083 + sto_sele_name: item.pickup_name,
  5084 + sto_sele_id: item.pickup_id,
  5085 + sto_sele_distr: item.distr_type,
  5086 + store: 0,
  5087 + choice_sort_store: 0
  5088 + });
  5089 +
  5090 + var openindstore = th.data.open_ind_store;
  5091 + if (openindstore == 1) {
  5092 + th.setData({
  5093 + openSpecModal: !0,
  5094 + openSpecModal_ind: openindstore,
  5095 + store: 0,
  5096 + choice_sort_store: 0,
  5097 + sort_store: 0,
  5098 + });
  5099 + } else if (openindstore == 2) {
  5100 + th.setData({
  5101 + openSpecModal: !0,
  5102 + openSpecModal_ind: openindstore,
  5103 + store: 0,
  5104 + choice_sort_store: 0,
  5105 + sort_store: 0,
  5106 + });
  5107 + }
  5108 + else if (openindstore == 4) { //4就是拼团
  5109 + th.setData({
  5110 + openSpecModal_pt: 1, //打开拼团购买界面
  5111 + store: 0, //关闭门店
  5112 + choice_sort_store: 0, //关闭门店2级
  5113 + sort_store: 0, //关闭门店2级
  5114 + });
  5115 + }
  5116 +
  5117 + else {
  5118 + th.setData({
  5119 + store: 0,
  5120 + choice_sort_store: 0,
  5121 + sort_store: 0,
  5122 + })
  5123 + }
  5124 +
  5125 + //如果商品没有其他活动,要取一下线下价格
  5126 + th.get_off_price();
  5127 +
  5128 + })
  5129 + },
  5130 +
  5131 + wait_for_store_config: function() {
  5132 + var th = this;
  5133 + var t_time = setInterval(function() {
  5134 + if (th.data.bconfig == null) false;
  5135 + var e = th.data.bconfig;
  5136 + if (e && e.is_sort_storage) {
  5137 + wx.getLocation({
  5138 + type: 'gcj02',
  5139 + success: function(res) {
  5140 + th.data.lat = res.latitude;
  5141 + th.data.lon = res.longitude;
  5142 + th.data.is_get_local_ok = 1;
  5143 + },
  5144 + fail: function(res) {
  5145 + if (res.errCode == 2) {
  5146 + th.setData({
  5147 + is_gps: 0
  5148 + });
  5149 + if (th.data.is_gps == 0) {
  5150 + getApp().confirmBox("请开启GPS定位", null, 10000, !1);
  5151 + }
  5152 +
  5153 + } else {
  5154 + th.setData({
  5155 + is_gps: "3"
  5156 + });
  5157 + }
  5158 +
  5159 + th.data.is_get_local_ok = 1;
  5160 + }
  5161 + })
  5162 + } else {
  5163 + th.data.is_get_local_ok = 1;
  5164 + }
  5165 + clearInterval(t_time);
  5166 + }, 500)
  5167 + },
  5168 + //显示全部
  5169 + toggleHandler: function(e) {
  5170 + var that = this,
  5171 + index = e.currentTarget.dataset.index;
  5172 + for (var i = 0; i < that.data.comments.length; i++) {
  5173 + if (index == i) {
  5174 + for (var i = 0; i < that.data.comments.length; i++) {
  5175 + that.data.comments[index].auto = true;
  5176 + that.data.comments[index].seeMore = false;
  5177 + }
  5178 + }
  5179 + }
  5180 + that.setData({
  5181 + comments: that.data.comments
  5182 + })
  5183 + },
  5184 +
  5185 + //收起更多
  5186 + toggleContent: function(e) {
  5187 + var that = this,
  5188 + index = e.currentTarget.dataset.index;
  5189 + for (var i = 0; i < that.data.comments.length; i++) {
  5190 + if (index == i) {
  5191 + that.data.comments[index].auto = true;
  5192 + that.data.comments[index].seeMore = true;
  5193 + }
  5194 + }
  5195 + that.setData({
  5196 + comments: that.data.comments
  5197 + })
  5198 + },
  5199 +
  5200 + //--- 获取卡类列表 ---
  5201 + getPlusCardType: function (func) {
  5202 + var storid = os.stoid;
  5203 + var th = this;
  5204 + var user=getApp().globalData.userInfo;
  5205 + if(!user) return false;
  5206 + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {
  5207 + var plusCard = res.data.data;
  5208 + var arr = [1219, 2089, 3031];
  5209 + var new_arr = new Array();
  5210 + var card_name_map=new Map();
  5211 +
  5212 + var list=[];
  5213 + for (var i = 0; i < plusCard.length; i++) {
  5214 + if((!user || user.card_field==null || user.card_field=="") && plusCard[i].IsStopBuy==true) continue;
  5215 + var name="card"+plusCard[i].CorrPrice.toLowerCase();
  5216 + card_name_map.set(name,plusCard[i].CardName);
  5217 + list.push(plusCard[i]);
  5218 + }
  5219 +
  5220 + var ob={"card_list":list,"name_map":card_name_map};
  5221 + func(ob);
  5222 + })
  5223 + },
  5224 +
  5225 + go_plus:function(){
  5226 + getApp().goto("/pages/user/plus/plus");
  5227 + },
  5228 + go_card_info:function(){
  5229 + getApp().goto("/pages/user/cardinfo/cardinfo");
  5230 + },
  5231 + //-- 根据ID拿出门店 --
  5232 + get_pick_from_list(pid){
  5233 + var all_pick_list=this.data.all_pick_list;
  5234 + for(var i in all_pick_list){
  5235 + var item=all_pick_list[i];
  5236 + if(item.pickup_id==pid){
  5237 + return item;
  5238 + }
  5239 + }
  5240 + },
  5241 + //-----显示优惠券的时候情况-----
  5242 + show_more_cx:function () {
  5243 + if(this.data.is_more_cx){
  5244 + this.setData({is_more_cx:0});
  5245 + }else{
  5246 + this.setData({is_more_cx:1});
  5247 + }
  5248 + },
  5249 +
  5250 + //----跳转到搭配购买----
  5251 + go_prom_list:function () {
  5252 +
  5253 + var url= "../../../../packageA/pages/prom_list/prom_list?goods_id="+this.data.gid;
  5254 + var room_id= getApp().globalData.room_id;
  5255 + if(room_id && this.data.gid==getApp().globalData.room_goods_id){
  5256 + url+="&room_id="+room_id;
  5257 + }
  5258 + wx.navigateTo({ url: url,})
  5259 + },
  5260 +
  5261 + //---检查有没有优惠活动---
  5262 + check_is_youhui:function(gid,is_nor){
  5263 + var th=this;
  5264 + //如果是普通购买的时候,要进行调用
  5265 + if(is_nor){
  5266 + getApp().request.get("/api/weshop/goods/getGoodsPromNormal/" + os.stoid+"/"+gid, {
  5267 + success:function(res){
  5268 + if(res.data.code==0){
  5269 + var r_data=res.data.data;
  5270 + th.setData({
  5271 + prom_goods:r_data.promGoodsLists,
  5272 + })
  5273 + th.is_show_more_buy();
  5274 + }
  5275 + },
  5276 + })
  5277 +
  5278 + }else{
  5279 + //调用接口判断订单优惠,
  5280 + getApp().request.get("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+gid+"/0", {
  5281 + success:function(res){
  5282 + if(res.data.code==0){
  5283 + var r_data=res.data.data;
  5284 + var max=0,min=0;
  5285 + if(r_data.collocationList){
  5286 + for(var i in r_data.collocationList){
  5287 + if(max==0) max=r_data.collocationList[i].price;
  5288 + if(min==0) min=r_data.collocationList[i].price;
  5289 +
  5290 + if(max<parseFloat(r_data.collocationList[i].price)) max=r_data.collocationList[i].price;
  5291 + if(min>parseFloat(r_data.collocationList[i].price)) min=r_data.collocationList[i].price;
  5292 + }
  5293 + r_data.collocationPromList.max=(max+th.data.data.shop_price).toFixed(2);
  5294 + r_data.collocationPromList.min=(min+th.data.data.shop_price).toFixed(2);
  5295 + }
  5296 + th.setData({
  5297 + order_prom:r_data.promOrder,
  5298 + collocationGoods:r_data.collocationPromList,
  5299 + prom_goods:r_data.promGoodsLists,
  5300 + })
  5301 + th.is_show_more_buy();
  5302 + }
  5303 + }
  5304 +
  5305 + })
  5306 + }
  5307 +
  5308 +
  5309 + },
  5310 +
  5311 + closePoster() {
  5312 + this.setData({
  5313 + showPoster: false,
  5314 + });
  5315 + },
  5316 +
  5317 + // 保存图片到手机
  5318 + savePic() {
  5319 + console.log('保存图片');
  5320 + var self = this;
  5321 + // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限
  5322 + this.getSetting().then((res) => {
  5323 + // 判断用户是否授权了保存到相册的权限,如果没有发起授权
  5324 + if (!res.authSetting['scope.writePhotosAlbum']) {
  5325 + this.authorize().then(() => {
  5326 + // 同意授权后保存下载文件
  5327 + this.saveImage(self.data.shareImgPath)
  5328 + .then(() => {
  5329 + self.setData({
  5330 + showPoster: false
  5331 + });
  5332 + });
  5333 + })
  5334 + } else {
  5335 + // 如果已经授权,保存下载文件
  5336 + this.saveImage(self.data.shareImgPath)
  5337 + .then(() => {
  5338 + self.setData({
  5339 + showPoster: false
  5340 + });
  5341 + });
  5342 + }
  5343 +
  5344 + })
  5345 + },
  5346 +
  5347 + // 获取用户已经授予了哪些权限
  5348 + getSetting() {
  5349 + return new Promise((resolve, reject) => {
  5350 + wx.getSetting({
  5351 + success: res => {
  5352 + resolve(res)
  5353 + }
  5354 + })
  5355 + })
  5356 + },
  5357 +
  5358 + // 发起首次授权请求
  5359 + authorize() {
  5360 + // isFirst 用来记录是否为首次发起授权,
  5361 + // 如果首次授权拒绝后,isFirst赋值为1
  5362 + let isFirst = wx.getStorageSync('isFirst') || 0;
  5363 + return new Promise((resolve, reject) => {
  5364 + wx.authorize({
  5365 + scope: 'scope.writePhotosAlbum',
  5366 + // 同意授权
  5367 + success: () => {
  5368 + resolve();
  5369 + },
  5370 + // 拒绝授权,这里是用户拒绝授权后的回调
  5371 + fail: res => {
  5372 + if(isFirst === 0) {
  5373 + wx.setStorageSync('isFirst', 1);
  5374 + wx.showToast({
  5375 + title: '保存失败',
  5376 + icon: 'none',
  5377 + duration: 1000
  5378 + })
  5379 + } else {
  5380 + this.showModal();
  5381 + }
  5382 + console.log('拒绝授权');
  5383 + reject();
  5384 + }
  5385 + })
  5386 + })
  5387 + },
  5388 +
  5389 +
  5390 + // 保存图片到系统相册
  5391 + saveImage(saveUrl) {
  5392 + var self = this;
  5393 + return new Promise((resolve, reject) => {
  5394 + wx.saveImageToPhotosAlbum({
  5395 + filePath: saveUrl,
  5396 + success: (res) => {
  5397 + wx.showToast({
  5398 + title: '保存成功',
  5399 + duration: 1000,
  5400 + });
  5401 + self.setData({
  5402 + showPlaybill: 'true'
  5403 + });
  5404 + resolve();
  5405 + },
  5406 + fail: () => {
  5407 + wx.showToast({
  5408 + title: '保存失败',
  5409 + duration: 1000,
  5410 + });
  5411 + }
  5412 + })
  5413 + })
  5414 + },
  5415 +
  5416 + previewImage() {
  5417 + this.data.show_prew_img=1;
  5418 + wx.previewImage({
  5419 + //将图片预览出来
  5420 + urls: [this.data.shareImgPath]
  5421 + });
  5422 + },
  5423 +
  5424 + is_show_more_buy:function(){
  5425 + var prom_goods=this.data.prom_goods;
  5426 + var per_price=this.data.sele_g.shop_price
  5427 + if(this.data.card_field && this.data.sele_g[this.data.card_field]>0){
  5428 + per_price=this.data.sele_g[this.data.card_field];
  5429 + }
  5430 + var all_price=per_price*this.data.goodsInputNum;
  5431 + var con=null;
  5432 + for(var i in prom_goods){
  5433 + var item=prom_goods[i];
  5434 + if(item.prom_type==1){
  5435 + if(item.condition>this.data.goodsInputNum) {
  5436 + con=item;
  5437 + con.need=(item.condition-this.data.goodsInputNum).toFixed(2)+"件";
  5438 + break;
  5439 + }
  5440 + }else{
  5441 + if(item.condition>all_price){
  5442 + con=item;
  5443 + con.need=(item.condition-all_price).toFixed(2)+"元";
  5444 + break;
  5445 + }
  5446 + }
  5447 + }
  5448 +
  5449 + this.setData({hui_condition:con});
  5450 +
  5451 + },
  5452 +
  5453 + //-- 积分购 --
  5454 + go_pay_integral:function(){
  5455 + this.get_sto(0)
  5456 + this.setData({openSpecModal_inte:1,goodsInputNum:1});
  5457 + },
  5458 + //-- 积分购普通购买 --
  5459 + go_pay_integral_normal:function(){
  5460 + var th=this;
  5461 + if (th.data.sku_g_pt) {
  5462 + this.get_sto(1)
  5463 + this.setData({openSpecModal_inte_normal:1});
  5464 + }else{
  5465 + th.get_sto(1);
  5466 + th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function() {
  5467 + th.setData({
  5468 + is_normal: 1,
  5469 + openSpecModal_inte_normal:1
  5470 + });
  5471 + });
  5472 + }
  5473 + this.check_is_youhui(th.data.gid,1);
  5474 + },
  5475 +
  5476 + closeSpecModal_inte:function(){
  5477 + this.setData({openSpecModal_inte:0});
  5478 + } ,
  5479 + closeSpecModal_inte_normal:function(){
  5480 + this.setData({openSpecModal_inte_normal:0});
  5481 + //要进行还原
  5482 + this.get_sto();
  5483 + this.setData({
  5484 + sele_g:this.data.data,
  5485 + gid:this.data.data.goods_id
  5486 + })
  5487 +
  5488 + this.sele_spec_chech_activity();
  5489 + },
  5490 +
  5491 + addCart_inte:function(t){
  5492 + this.add_cart_func_inte(t);
  5493 + },
  5494 +
  5495 +
  5496 +
  5497 +
  5498 + onShareTimeline() {
  5499 + var store_name=getApp().globalData.config?getApp().globalData.config.store_name:'';
  5500 + if(!store_name)
  5501 + store_name=getApp().globalData.setting.appName;
  5502 + return {
  5503 + title:this.data.data.goods_name + '-' + store_name,
  5504 + imageUrl:this.data.gallery[0].image_url,
  5505 + }
  5506 + },
  5507 +
  5508 +
  5509 + clickCollapse() {
  5510 + this.setData({
  5511 + flag: !this.data.flag,
  5512 + })
  5513 + },
  5514 +
  5515 + clickShare() {
  5516 + this.setData({
  5517 + share_hidden: true,
  5518 + });
  5519 + },
  5520 +
  5521 + send() {
  5522 + this.setData({
  5523 + share_hidden:false,
  5524 + });
  5525 + },
  5526 +
  5527 + cancel() {
  5528 + this.setData({
  5529 + share_hidden:false,
  5530 + });
  5531 + },
  5532 +
  5533 + //积分购和拼团的普通购买的的时候,要判断有没有全场优惠活动
  5534 + check_nor_promgood(goods_id,back){
  5535 + getApp().request.get("/api/weshop/goods/getGoodsPromNormal/"+os.stoid+"/"+goods_id,{
  5536 + success:function(res){
  5537 + if(res.data.code==0 && res.data.data && res.data.data.promGoodsLists && res.data.data.promGoodsLists.length>0){
  5538 + var obj={
  5539 + act_id:res.data.data.promGoodsLists[0].prom_id,
  5540 + }
  5541 + back(obj);
  5542 + }else{
  5543 + back(0)
  5544 + }
  5545 + }
  5546 + })
  5547 + },
  5548 +
  5549 + go_zh:function (e) {
  5550 + var id=e.currentTarget.dataset.id;
  5551 + getApp().goto("/packageB/pages/zuhegou/index/index?id="+id);
  5552 + },
  5553 +
  5554 + check_zh_acting:function (func) {
  5555 + var isok = 1,item=this.data.sele_g;
  5556 + //如果有组合购
  5557 + var url="/api/weshop/prom/zhbuy/get/"+os.stoid+"/"+item.prom_id+"/"+getApp().globalData.userInfo.user_id;
  5558 + getApp().request.promiseGet(url, {}).then(res => {
  5559 + if(res.data.code==0 && res.data.data){
  5560 + if(res.data.data.is_show!=1){
  5561 + isok=0;
  5562 + }
  5563 + //如果活动已经结束
  5564 + if(res.data.data.is_end==1){
  5565 + isok=0;
  5566 + }
  5567 + //已经结束
  5568 + if(ut.gettimestamp()>res.data.data.end_time){
  5569 + isok=0;
  5570 + }
  5571 + //还未开始
  5572 + if(ut.gettimestamp()<res.data.data.start_time){
  5573 + isok=0;
  5574 + }
  5575 +
  5576 + }else{
  5577 + //未找到商品的活动
  5578 + isok = 0;
  5579 + }
  5580 + item.act=res.data.data;
  5581 + func(isok);
  5582 + })
  5583 + }
  5584 +
  5585 +
  5586 +
  5587 +
  5588 +
  5589 +
  5590 +});
... ...
packageC/pages/presell/goodsInfo/goodsInfo.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "商品详情",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "nav_box": "/components/nav_box/nav_box",
  6 + "warn": "/components/long_warn/long_warn",
  7 + "goods_recommend": "/components/goods_list/goods_list",
  8 + "share": "/components/share/share"
  9 + }
  10 +}
0 11 \ No newline at end of file
... ...
packageC/pages/presell/goodsInfo/goodsInfo.wxml 0 → 100644
  1 +<import src="../../../utils/wxParse/wxParse.wxml"></import>
  2 +<wxs module="filters" src="../../../utils/filter.wxs"></wxs>
  3 +<wxs module="g_filters" src="g_filter.wxs"></wxs>
  4 +<wxs module="tool" src="filter.wxs"></wxs>
  5 +
  6 +<!-- 商品内容区域,普通商品,秒杀,拼团 -->
  7 +<block wx:if="{{isshow}}">
  8 + <view class="container">
  9 + <view class="type-navbar">
  10 + <view class="type-box" wx:for="{{categories}}" wx:key="categories">
  11 + <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}">
  12 + {{item.name}}
  13 + </view>
  14 + </view>
  15 + </view>
  16 +
  17 + <view class="goods-detail">
  18 + <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}">
  19 + <!-- 视频 -->
  20 + <!-- <swiper bindchange="swiperChange"class="xc-pictures swiperContainer rel" current="{{swiperCurrent}}"
  21 + indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}"> -->
  22 + <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove">
  23 +
  24 + <view class="xc-videos-picture rel">
  25 + <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}" indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange">
  26 +
  27 + <swiper-item wx:if="{{mapurl}}">
  28 + <view wx:if="{{noon == 0}}">
  29 + <image class="xc-picturess" src="{{iurl+mapurl_f_img}}" mode="aspectFit">
  30 + <image id="{{index}}" class="xc-play" src="{{iurl}}/miniapp/images/pofang.png" bindtap="videoPlay"></image>
  31 + </image>
  32 + </view>
  33 + <view wx:else>
  34 + <video class="xc-videos" src="{{iurl+mapurl}}" id="{{index}}" wx:if="{{_index == index}}"> </video>
  35 + </view>
  36 + </swiper-item>
  37 +
  38 + <swiper-item wx:for="{{gallery}}" wx:key="gallery">
  39 + <!-- <image class="wh100" src="{{item.image_url}}" mode="aspectFit" binderror="bind_bnerr" lazy-load="true" data-errorimg="gallery[{{index}}].image_url"></image> -->
  40 + <view class="wh100 g_img_box" style="background-image:url({{item.image_url}});"></view>
  41 + </swiper-item>
  42 + </swiper>
  43 + <block wx:if="{{mapurl}}">
  44 + <view wx:if="{{hiddenn==1}}">
  45 + <view class="xc-imageCount">{{current}}/{{gallery.length}}</view>
  46 + </view>
  47 + <view class="xc-video-picture abs">
  48 + <view class="xc-video" data-vipi="0" bindtap="videopicture">
  49 + <view class="{{videopicture==0 ? 'xc-video-button':'xc-video-buttons'}} {{videopicture==0 ? 'xc-sn':''}}">
  50 + 视频
  51 + </view>
  52 + </view>
  53 + <view class="xc-picture {{videopicture==1 ? 'xc-sn':''}}" data-vipi="1" bindtap="videopicture">
  54 + <view>
  55 + 图片
  56 + </view>
  57 + </view>
  58 + </view>
  59 + </block>
  60 + </view>
  61 + </view>
  62 +
  63 +
  64 + <!----显示秒杀价,团购,积分购---->
  65 + <view class="prom_show rel" wx:if="{{prom_type==1}}">
  66 +
  67 + <image class="secondkill-img" src='{{prom_st==1? iurl+"/miniapp/images/red_jx.png":iurl+"/miniapp/images/blue_ks.png"}}'></image>
  68 + <!-- <image class="abs spike-img" src="{{iurl}}/miniapp/images/xsmiaosha.png"></image> -->
  69 + <view class="abs price-container">
  70 + <view class="fs28">预售价</view>
  71 + <view>
  72 + <text class="rmb">99.99</text>
  73 + <text class="rmb line-through fs24 no-bold">125.00</text>
  74 + </view>
  75 + </view>
  76 + <view class="stop fs26 abs" wx:if="{{prom_st==1}}">距活动结束还有</view>
  77 + <view class="start fs26 abs" wx:if="{{prom_st==2}}">距活动开始还有</view>
  78 + <view class="secview flex abs fs24 xc-miaosha-time">
  79 + <block wx:if="djs.day">
  80 + <view class='day-val' style="color:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.day}}</view>
  81 + <view class="day white" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">天</view>
  82 + </block>
  83 + <view class='time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.hou}}</view>
  84 + <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">时</view>
  85 + <view class='time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.min}}</view>
  86 + <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}"> 分</view>
  87 + <view class='time-val white t-c' style=";background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.sec}}</view>
  88 + <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view>
  89 + </view>
  90 + </view>
  91 +
  92 + <!----拼单---->
  93 + <view class="pt_show " wx:if="{{prom_type==6}}">
  94 + <view class="pt_view rel">
  95 + <!--许程 7. 24 -->
  96 + <image class="secondkill-img" src="{{prom_st==1? iurl+'/miniapp/images/red_jx.png':iurl+'/miniapp/images/blue_ks.png'}}"></image>
  97 + <view class="abs xc-qt-price">
  98 + <view class="flex" style='height:40rpx; margin-top:5rpx'>
  99 + <view class="flex fs35 xc-qtsign">¥</view>
  100 + <view class="fs50 val">{{prom_price}}</view>
  101 + </view>
  102 + <view class="word-line fs20 xc-qtunit-price">零售价¥{{filters.toFix(data.market_price,2)}}</view>
  103 + </view>
  104 + <view class="abs white xc-nanber">
  105 + <text class="fs22">已拼{{prom_act.buy_num}}件</text>
  106 + <view class="flex" style='margin-top:-34rpx'>
  107 + <view class="xc-people-img">
  108 + <image class="imgs" src="{{prom_st==1? iurl+'/miniapp/images/r_logo_red.png':iurl+'/miniapp/images/r_logo.png'}}"></image>
  109 + </view>
  110 + <view class="t-s fs20 xc-people-val">
  111 + {{prom_act.ct_num}}人拼
  112 + </view>
  113 + </view>
  114 + </view>
  115 + <view class="hy-stop word-color fs26 abs" wx:if="{{prom_st==1}}">距活动结束还有</view>
  116 + <view class="hy-stop word-color-lan fs26 abs" wx:if="{{prom_st==0}}">距活动开始还有</view>
  117 + <view class="secview flex abs fs24 " style="color: black;right: 3px; top:46rpx;">
  118 + <block wx:if="djs.day">
  119 + <view class='day-val' style="color:{{prom_st==1?'#d40022':'#0097e0'}};margin-top:-34rpx;">{{djs.day}}</view>
  120 + <view class="day white" style="margin-top:-34rpx;margin-right:10rpx;color: {{prom_st==1?'#d40022':'#0097e0'}}">天</view>
  121 + </block>
  122 + <view class='xc-time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.hou}}</view>
  123 + <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">时</view>
  124 + <view class='xc-time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.min}}</view>
  125 + <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}"> 分</view>
  126 + <view class='xc-time-val white t-c' style=";background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.sec}}</view>
  127 + <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view>
  128 + </view>
  129 + </view>
  130 +
  131 + <view class="pt_fir pd20">
  132 + <!----显示团类型和团价格---->
  133 + <view class="pt_fir_title ">
  134 + <!-- 许程 商家团主页 -->
  135 + <view class="xc-goods-explain flex-vertical-between">
  136 + <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 }}">
  137 + {{data.goods_name}}
  138 + </view>
  139 +
  140 + <!-- 这个是分享按钮 -->
  141 + <view class="xc-share-frame t-c" bindtap="clickShare">
  142 + <view class="iconfont icon-share fs60"></view>
  143 + <view class="fs22 c-7b">分享</view>
  144 + </view>
  145 + </view>
  146 + </view>
  147 +
  148 + <!----显示价格,阶梯团---->
  149 + <block wx:if="{{prom_act.kttype==3}}">
  150 + <view class="jie_price flex">
  151 + <view style='margin-right:26rpx' wx:for="{{prom_act.ct_rylist}}">
  152 + <view class="fs35 word-color">
  153 + <text class="fs24">¥</text>{{item.price}}</view>
  154 + <view class="fs24 t-c xc-person-number ">满{{item.rynum}}人</view>
  155 + </view>
  156 + </view>
  157 + </block>
  158 + </view>
  159 +
  160 + <view class="t_gz" wx:if="{{is_show_gz==1}}">
  161 + {{prom_act.remark}}
  162 + </view>
  163 +
  164 + <!----------正有多少人在开团---------->
  165 + <view class="pt_fir se2 bdt16" wx:if="{{teamgroup}}">
  166 + <view class="xc-partner-frame">
  167 + <view class="zzk-1 flex jc_sb" bindtap="go_t_more">
  168 + <view class="pdl10">以下小伙伴正在拼单,可直接参与</view>
  169 + <view class="ckgd flex ai_c">查看详细
  170 + <view class="bg_right arrow-one"></view>
  171 + </view>
  172 + </view>
  173 + </view>
  174 + <view class='group' wx:for="{{teamgroup}}" wx:for-index="t_ind" wx:key="teamgroup">
  175 + <view class='group-list' bindtap="go_cj_team" data-ind="{{t_ind}}">
  176 + <!-- <view class="flex ai_c"> -->
  177 + <!--//选项框头像-->
  178 + <view class='gtou'>
  179 + <image src='{{item.user.head_pic}}'></image>
  180 + </view>
  181 + <!--//等你来拼-->
  182 + <view class='gdn ellipsis-1'>{{item.user.nickname}}</view>
  183 + <!-- </view> -->
  184 +
  185 + <!--//还差几人,剩余时间-->
  186 + <view class="rel">
  187 + <view class='ghaicha ellipsis-2'>
  188 + <text class='gred' wx:if="{{prom_act.max_ct_num >0}}"><text class="flex" wx:if="{{prom_act.max_ct_num - item.open_num>0}}">还差<text class="word-color">{{prom_act.max_ct_num - item.open_num}}</text>人享最低优惠</text><text wx:else>您已经享最低优惠</text></text>
  189 + <text class='gred' wx:else>还差<text style='color:#ff2753'>{{prom_act.ct_num - item.open_num}}</text>人成团 </text>
  190 + <view class="t_show">
  191 + 剩余
  192 + <text wx:if="{{timer[t_ind].day}}">{{timer[t_ind].day}}天:</text>
  193 + <text>{{timer[t_ind].hou}}</text>:
  194 + <text>{{timer[t_ind].min}}</text>:
  195 + <text>{{timer[t_ind].sec}}</text>
  196 + </view>
  197 + </view>
  198 + </view>
  199 + <!--//参加团-->
  200 + <view class='cjt t-c'>
  201 + 去参团
  202 + </view>
  203 + <!-- <view class="clear"></view> -->
  204 + </view>
  205 + </view>
  206 + </view>
  207 +
  208 +
  209 + </view>
  210 +
  211 + <!-- 积分购 -->
  212 + <view wx:if="{{prom_type==4}}">
  213 + <view class="goods-price">
  214 + <!-- 价格显示 -->
  215 + <view class="co-red flex jc_sb ai-center">
  216 + <view class="market-price" style="overflow: hidden; height: 66rpx;display: flex; align-items: flex-end;">
  217 + <image class="rel_img" src="{{iurl}}/miniapp/images/integral/integral_red.png"></image>
  218 + <block wx:if="{{prom_integral}}"><text style="position: relative;top:10rpx">{{prom_integral}}</text><text class="rel_txt">积分</text></block>
  219 + <text class="rel_txt" wx:if="{{prom_integral && prom_price}}">+</text>
  220 + <text class="rel_txt" wx:if="{{prom_price}}" >{{filters.toFix(prom_price,2)}}元</text>
  221 + <text class="rel_txt" wx:if="{{!prom_integral && !prom_price}}">0积分</text>
  222 + <text class="rel_txt fs22" decode="{{true}}" space="{{true}}" style="color: #999; text-decoration: line-through;">&nbsp;&nbsp;&nbsp;零售价:¥{{filters.toFix(data.market_price,2)}}</text>
  223 + </view>
  224 +
  225 + <!-- 这个是分享按钮 -->
  226 + <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> -->
  227 + <view class="xc-share-frame t-c" bindtap="clickShare">
  228 + <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> -->
  229 + <view class="iconfont icon-share fs60"></view>
  230 + <!-- <view class="share-font">1分享</view> -->
  231 + <view class="fs22 c-7b">分享</view>
  232 + </view>
  233 + </view>
  234 +
  235 +
  236 +
  237 + <view class="goods-title">
  238 + <view class="goods-name elli">{{data.goods_name}}</view>
  239 + </view>
  240 +
  241 + <view class="goods-num">
  242 + <view class="sales">销量:{{prom_act.buy_num}}件</view>
  243 + <view class="stock">折扣:{{g_filters.num((prom_price?prom_price:0)*10/data.shop_price)}}折</view>
  244 + <view class="stock">{{categories3[0].num}}人评价</view>
  245 + </view>
  246 + </view>
  247 + </view>
  248 +
  249 + <!-- 不是拼团,不是积分购 -->
  250 + <block wx:if="{{prom_type!=6 && prom_type!=4}}">
  251 + <view class="goods-price">
  252 +
  253 + <view class="flex jc_sb">
  254 + <view class="co-red" style="" wx:if="{{prom_type==0 || prom_type==3}}">
  255 + <view class="market-price flex" style="align-items: baseline;">
  256 + <block wx:if="{{card_field && data[card_field]>0}}">
  257 + <view class="flex ai-center grade-card-frame">
  258 + <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>
  259 + <view class="fs24 white view card-name ellipsis-1">{{card_name}}</view>
  260 + </view>
  261 + <text class="rel yuan">¥</text>{{filters.toFix(data[card_field],2)}}
  262 + <view class='yj' style="top:35rpx">
  263 + <text>零售价:¥{{filters.toFix(data.market_price,2)}}</text>
  264 + </view>
  265 + </block>
  266 + <block wx:else>
  267 + <text class="yuan">¥</text>{{filters.toFix(data.shop_price,2)}}
  268 + <view class='yj'><text>零售价:¥{{filters.toFix(data.market_price,2)}}</text></view>
  269 + </block>
  270 + </view>
  271 +
  272 + </view>
  273 +
  274 + <!-- 这个是分享按钮 -->
  275 + <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> -->
  276 + <view class="xc-share-frame t-c" bindtap="clickShare" wx:if="{{prom_type != 1}}">
  277 + <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> -->
  278 + <view class="iconfont icon-share fs60"></view>
  279 + <!-- <view class="share-font">1分享</view> -->
  280 + <view class="fs22 c-7b">分享</view>
  281 + </view>
  282 + </view>
  283 +
  284 +
  285 +
  286 + <!-- 不是秒杀 -->
  287 + <!-- 等级卡的价格,不是等级卡会员,且商品又有设置等级级价,商家后台有开通升级卡同能 -->
  288 + <view class="flex ai_and" wx:if="{{!card_field && g_filters.is_has_rank(rank_switch,data) && prom_type!=1 && card_list && card_list.length>0}}">
  289 +
  290 + <view class="flex ai-center grade-card-frame card-frame" >
  291 + <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>
  292 + <view class="fs24 white view card-name ellipsis-1">{{g_filters.get_card_price(data,card_list,1)}}</view>
  293 + </view>
  294 + <view class="fs32 xc-black3 ai_and carde_frame">
  295 + <text class="fs26">
  296 + ¥</text>{{g_filters.get_card_price(data,card_list,0)}}
  297 + </view>
  298 + </view>
  299 +
  300 + <!-- 等级卡的显示,购买, 等级卡近30天要显示续费-->
  301 +
  302 + <block wx:if="{{g_filters.is_has_rank(rank_switch,data)}}">
  303 +
  304 + <!-- 不是秒杀,且会员不是等级会员 -->
  305 + <view wx:if="{{!card_field && prom_type!=1 && card_list && card_list.length>0}}">
  306 + <view class="beauty-makeup-frame flex ai-center">
  307 + <view class="left flex ai-center jc_sa">
  308 + <view class="flex ai-center grade-card-frame card-frame advert-card">
  309 + <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>
  310 + <view class="fs24 white view card-name ellipsis-1">{{g_filters.get_card_price(data,card_list,1)}}</view>
  311 + </view>
  312 + <view class="card-effect">
  313 + <view class="fs24 xc-black3">成为{{g_filters.get_card_price(data,card_list,1)}}立<text class="co-red">省{{filters.toFix(data.shop_price-g_filters.get_card_price(data,card_list,0),2)}}</text>元</view>
  314 + <view class="fs22 xc-ash"> 开通会员 尽享更多优惠 </view>
  315 + </view>
  316 + </view>
  317 + <view class="right flex jc-center ai-center" bindtap="go_plus">
  318 + <view class="at_once_carde xc-black3 fs28">立即开卡</view>
  319 + <view class="bg_right"></view>
  320 + </view>
  321 +
  322 + </view>
  323 + </view>
  324 + <!-- 立即续费的显示 -->
  325 + <view wx:elif="{{is_near_date && data[card_field]>0 && prom_type!=1}}">
  326 + <view class="beauty-makeup-frame flex ai-center">
  327 + <view class="left flex ai-center jc_sa">
  328 + <view class="flex ai-center grade-card-frame card-frame advert-card">
  329 + <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>
  330 + <view class="fs24 white view card-name ellipsis-1">{{card_name}}</view>
  331 + </view>
  332 + <view class="card-effect">
  333 + <view class="fs24 xc-black3">成为{{card_name}}立<text class="co-red">省{{filters.toFix(data.shop_price[card_field],2)}}</text>元</view>
  334 + <view class="fs22 xc-ash"> 开通会员 尽享更多优惠 </view>
  335 + </view>
  336 + </view>
  337 + <view class="right flex jc-center ai-center" bindtap="go_card_info">
  338 + <view class="at_once_carde xc-black3 fs28">立即续费</view>
  339 + <view class="bg_right"></view>
  340 + </view>
  341 +
  342 + </view>
  343 +
  344 + </view>
  345 +
  346 + </block>
  347 + <!--许程商品名字-->
  348 +
  349 + <view wx:if="{{prom_type!=1}}">
  350 + <view class="goods-title">
  351 + <view class="goods-name elli">{{data.goods_name}}</view>
  352 + </view>
  353 + </view>
  354 +
  355 + <view class="goods-num" wx:if="{{prom_type!=1}}">
  356 + <view class="sales">销量:{{data.sales_sum}}件</view>
  357 + <view class="stock">折扣:{{data.disc}}折</view>
  358 + <view class="stock">{{categories3[0].num}}人评价</view>
  359 + </view>
  360 + <view wx:if="{{prom_type==1}}">
  361 + <view class="flex jc_sb">
  362 + <view class="flex" style="align-items: baseline;">
  363 + <view class="flex xc-price-frame"><text class="fs30">¥</text>{{prom_price}}</view>
  364 + <view class="word-line fs24">零售价¥{{filters.toFix(data.market_price,2)}}</view>
  365 + </view>
  366 +
  367 + <!-- 这个是分享按钮 -->
  368 + <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> -->
  369 + <view class="xc-share-frame t-c" bindtap="clickShare">
  370 + <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> -->
  371 + <view class="iconfont icon-share fs60"></view>
  372 + <!-- <view class="share-font">1分享</view> -->
  373 + <view class="fs22 c-7b">分享</view>
  374 + </view>
  375 + <!-- <view class="xc-val-price">
  376 + <view class="fs30" style='padding-left:13rpx;' wx:if="{{prom_st==1}}" >已抢:{{prom_act.buy_num+prom_act.virtual}}件</view>
  377 + <view class="fs30" style='padding-left:13rpx;' wx:else >已抢:0件</view>
  378 + <view class="fs30 save t-c">秒杀立省¥{{filters.toFix(data.market_price-prom_price,2)}}</view>
  379 + </view> -->
  380 + </view>
  381 + </view>
  382 +
  383 + <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4}}">
  384 + {{data.goods_name}}
  385 + </view>
  386 +
  387 + <!-- <view wx:if="{{prom_type==1}}" style='height:58rpx'></view> -->
  388 + <!-- 许程 7.24 暂时注释 -->
  389 + <view wx:if="{{prom_type==1}}">
  390 + <view class="goods-num" wx:if="{{prom_type==1}}">
  391 +
  392 + <block wx:if="prom_st>0" >
  393 + <view class="stock">总数量:{{prom_act.goods_num+prom_act.virtual}}件</view>
  394 + <view class="stock">限购:{{prom_act.buy_limit}}件</view>
  395 + <block wx:if="{{prom_st==0}}">
  396 + <view class="sales">已购:0件</view>
  397 + </block>
  398 + <block wx:else>
  399 + <view class="sales">已购:{{prom_act.buy_num+prom_act.virtual}}件</view>
  400 + </block>
  401 + </block>
  402 +
  403 + <block wx:else>
  404 + <view class="stock">总数量:{{prom_act.goods_num}}件</view>
  405 + <view class="stock">限购:{{prom_act.buy_limit}}件</view>
  406 + <view class="sales">已购:{{prom_act.buy_num}}件</view>
  407 + </block>
  408 +
  409 + </view>
  410 + </view>
  411 +
  412 + </view>
  413 + </block>
  414 +
  415 + <!-- 门店收货地址 -->
  416 + <view class="xc-address_frame bdt16 flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}" >
  417 + <view class="address_frame" bindtap="choice_store" data-ind="0">
  418 + <view class="flex-vertical-between ">
  419 + <view class="flex-vertical select_store_height">
  420 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  421 + <view class="fs30" style="color:black;">选择门店</view>
  422 + </view>
  423 + <view class="red_bb fs26">
  424 + 更多门店
  425 + <text class="bg_jj"></text>
  426 + </view>
  427 + </view>
  428 +
  429 + <view wx:if="{{def_pick_store && def_pick_store.pickup_name}}">
  430 + <view class="flex-space-between address ai_end pdv10">
  431 + <view>
  432 + <text class="fs30 xc-black3 shop_name bold">{{def_pick_store.pickup_name}}</text>
  433 + </view>
  434 + <view class="distance fs24"wx:if="{{def_pick_store.distance!=null}}">
  435 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  436 +
  437 + </view>
  438 + </view>
  439 +
  440 +
  441 + <view class="no_store" wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>
  442 + <block wx:else>
  443 + <view class="no_store" wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
  444 + <block wx:else>
  445 + <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">(配送不匹配)</view>
  446 + <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view>
  447 + </block>
  448 + </block>
  449 +
  450 + <view class="fs24 xc-ash-9f">地址:{{def_pick_store.fulladdress}}</view>
  451 + </view>
  452 + </view>
  453 +
  454 + </view>
  455 +
  456 + <!--许程 7.24暂时注释 -->
  457 + <view class="bdt16" wx:if="{{prom_type!=1&&prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1}}">
  458 + <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}">
  459 + <view class="cx-sizs fs30">领券</view>
  460 + <view class="flex ai_c f1 pdh20">
  461 + <view class="xc-coupon-fram" wx:for="{{fir_quan}}" wx:key="{{index}}">
  462 + <view class="circle xc-circular xc-one"></view>
  463 + <view class="xc-coupon t-c four-level-word">满{{item.condition}}减{{item.money}}</view>
  464 + <view class="circle xc-circular xc-two"></view>
  465 + </view>
  466 + </view>
  467 +
  468 + <view data-coupon="1" bindtap="switchCoupon" class="cx-obtain-coupon wsize">
  469 + <text class="bg_jj"></text>
  470 + </view>
  471 + </view>
  472 + </view>
  473 +
  474 +
  475 +
  476 +
  477 + <!-- 要判断是不是有促销活动 -->
  478 + <block wx:if="{{prom_goods}}">
  479 + <view class="cx-frame flex" style="position: relative; height: auto" >
  480 + <view class="cx-sizs fs30">促销</view>
  481 + <!-- 中间显示层 -->
  482 + <view class="f1 pdh20">
  483 +
  484 + <view class="cx_show_view flex fs28" wx:for="{{prom_goods}}">
  485 + <view class="prom_condition">消费满{{item.condition}}<text wx:if="{{item.prom_type==1}}">件</text><text wx:else>元</text></view>
  486 + <view class="word {{is_more_cx?'':'ellipsis-1'}}">
  487 + <text wx:if="{{item.money>0}}">减价{{item.money}}元;</text>
  488 + <text wx:if="{{item.sale>0}}">打{{item.sale}}折;</text>
  489 + <text wx:if="{{item.past==1}}">包邮;</text>
  490 + <text wx:if="{{item.intValue>0}}">送{{tem.intValue}}积分;</text>
  491 + <text wx:if="{{item.couponId>0}}">送{{item.couponMoney}}元优惠券;</text>
  492 + <text wx:if="{{item.gift_id>0}}">送商品{{item.goods_name}};</text>
  493 + <text wx:if="{{item.lb_id>0}}">送{{item.lbtitle}};</text>
  494 + </view>
  495 + </view>
  496 + </view>
  497 + <view data-coupon="1" bindtap="show_more_cx" class="cx-obtain-coupon wsize">
  498 + <text class="bg_jj {{is_more_cx?'down1':''}}"></text>
  499 + </view>
  500 + </view>
  501 + </block>
  502 +
  503 + <!-- 要判断是不是有订单优惠 -->
  504 + <block wx:if="{{order_prom}}">
  505 + <view class="cx-frame flex" style="position: relative; height: auto" >
  506 + <view class="cx-sizs wsize" style="width: 144rpx">订单优惠</view>
  507 + <!-- 中间显示层 -->
  508 + <view class="flex ai-center">
  509 + <image class="hui_img" src="{{iurl}}/miniapp//images/hui.png"></image>
  510 + <view class="order_hui">
  511 + <view class="fs28 ellipsis-1">{{order_prom.name}}</view>
  512 + <view class="fs26" >(活动时间:{{tool.format_tt(order_prom.start_time)}} - {{tool.format_tt(order_prom.end_time)}})</view>
  513 + </view>
  514 + </view>
  515 + </view>
  516 + </block>
  517 +
  518 +
  519 + <!-- 要判断是不是有组合优惠 -->
  520 + <block wx:if="{{zh_act}}">
  521 + <view class="cx-frame flex" style="position: relative; height: auto" >
  522 + <view class="cx-sizs wsize" style="width: 144rpx">组合购</view>
  523 + <!-- 中间显示层 -->
  524 + <view class="flex ai-center jc_sb" style="width: 570rpx" bindtap="go_zh" data-id="{{zh_act.id}}" >
  525 + <view class="flex">
  526 + <image class="hui_img" src="{{iurl}}/miniapp//images/hui.png"></image>
  527 + <view class="order_hui">
  528 + <view class="fs28 ellipsis-1">{{zh_act.name}}</view>
  529 + <view class="fs26" >(活动时间:{{tool.format_tt(zh_act.start_time)}} - {{tool.format_tt(zh_act.end_time)}})</view>
  530 + </view>
  531 + </view>
  532 + <view><text class="bg_jj is_more_cx" style="position: relative;top:-10rpx"></text></view>
  533 + </view>
  534 + </view>
  535 + </block>
  536 +
  537 +
  538 + <view class="bz_view flex bdt16" wx:if="{{bconfig}}" style="">
  539 + <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image>
  540 + <view class="flex f1 ai_c rel">
  541 + <view class="bz-content {{flag ? '':'ellipsis-1'}} f1">{{bconfig.service_bz}}</view>
  542 + <view bindtap="clickCollapse" class="cx-obtain-coupon wsize arrow">
  543 + <text class="bg_jj {{flag?'down1':''}}"></text>
  544 + </view>
  545 + <!-- <text class="bg_jj" bindtap="clickCollapse"></text> -->
  546 + <!-- <text class="iconfont icon-shuangjiantouxia c-db"></text> -->
  547 + </view>
  548 +
  549 + </view>
  550 +
  551 +
  552 + <!--- 搭配促销 ---->
  553 + <view class="dp_cx_view" wx:if="{{collocationGoods}}">
  554 + <view class="bb_view">
  555 + <view>优惠热配</view>
  556 + <view class="red_bb" bindtap="go_prom_list">查看全部
  557 + <text class="bg_jj"></text>
  558 + </view>
  559 + </view>
  560 +
  561 + <!-- 搭配的显示 -->
  562 + <view class="flex" bindtap="go_prom_list">
  563 + <image class="dp_img" src="{{iurl+collocationGoods.img_url}}"></image>
  564 + <view class="act_content">
  565 + <view class="fs32">{{collocationGoods.title}}</view>
  566 + <view class="fs30 color_b" wx:if="{{collocationGoods.max!=collocationGoods.min}}">搭配价¥{{collocationGoods.min}}-{{collocationGoods.max}}</view>
  567 + <view class="fs30 color_b" wx:else>搭配价¥{{collocationGoods.min}}</view>
  568 + <view class="fs30 color-gray">活动至{{filters.format_time(collocationGoods.end_time,1)}}</view>
  569 + </view>
  570 + </view>
  571 + </view>
  572 +
  573 +
  574 + <!--- 宝贝评价 ---->
  575 + <view class="bdt16">
  576 + <view class="bb_view">
  577 + <view class="bold">宝贝评价({{categories3[0].num}})</view>
  578 + <view class="red_bb fs26" bindtap="look_pj">查看全部
  579 + <text class="bg_jj"></text>
  580 + </view>
  581 + </view>
  582 +
  583 + <view class="xc_comment">
  584 + <view class="xc_comment-have-pictures" data-val="5" bindtap="clik_evaluate">有图({{categories3[1].num}}) </view>
  585 + <view class="xc_comment-discuss" data-val="2" bindtap="clik_evaluate">好评({{categories3[2].num}}) </view>
  586 + <view class="xc_comment-discuss" data-val="3" bindtap="clik_evaluate">中评({{categories3[3].num}}) </view>
  587 + <view class="xc_comment-discuss" data-val="4"bindtap="clik_evaluate">差评({{categories3[4].num}}) </view>
  588 + </view>
  589 +
  590 + <scroll-view scroll-x="true" class="pj_scroll">
  591 + <view class="flex">
  592 + <view class="xc_comment-detail" style="" wx:for="{{fir_comments}}" wx:key="fir_comments">
  593 + <view class="xc_comment-left">
  594 + <view class="xc_comment-user">
  595 + <view class="xc_user-img">
  596 + <image class="xc_imgs" src='{{item.is_anonymous!=1?item.head_pic:iurl+"/miniapp/images/hui_hear_pic.png"}}' binderror="bind_bnerr2" data-errorimg="fir_comments[{{index}}].head_pic"></image>
  597 + </view>
  598 +
  599 + <view class="xc_user">
  600 + <view class="xc_user-name five-level-word">{{item.is_anonymous!=1?item.username:'匿名'}}</view>
  601 + <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image>
  602 + </view>
  603 + </view>
  604 + <view class="xc_comment-font pj_word_size ellipsis-1 pdt12">
  605 + <text class="ellipsis-1">{{item.content?item.content:'此用户没有填写评价。'}} </text>
  606 + </view>
  607 + <view class="xc_comment-val">
  608 + <view class="xc_comment-time">{{item.add_time}}</view>
  609 +
  610 + </view>
  611 + </view>
  612 + <view class="xc_goods-img-frame">
  613 + <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image>
  614 + <image wx:elif="{{item.weapp_img[0]!=undefined && item.weapp_img[0]!=null}}" class="xc_goods-img" src='{{item.weapp_img[0]}}'></image>
  615 + <image wx:else class="xc_goods-img" src='{{gallery[0].image_url}}'></image>
  616 + </view>
  617 + </view>
  618 + </view>
  619 + </scroll-view>
  620 + </view>
  621 +
  622 + <!-- 图文详情 -->
  623 + <view class="bdt16">
  624 + <!-- <view class="tuwen_title">
  625 + <view class="g_line"></view>
  626 + <view class="center_s">
  627 + <image src="{{iurl}}/miniapp/images/tuwen_c.png"></image>
  628 + <text>详情</text>
  629 + </view>
  630 + </view> -->
  631 + <view class="t_g_info">
  632 + <view class="red_shu"></view>
  633 + <view class="fs30 bold">商品详情</view>
  634 + </view>
  635 + <view class="pd20">
  636 + <view class="table_s">
  637 + <view class="tb_item tb-l">
  638 + <view class="item_left">
  639 + <text>商品名称</text>
  640 + </view>
  641 + <view class="item_right">
  642 + <text>{{data.goods_name}}</text>
  643 + </view>
  644 + </view>
  645 + <view class="tb_item tb-l">
  646 + <view class="item_left">
  647 + <text>商品编号</text>
  648 + </view>
  649 + <view class="item_right">
  650 + <text>{{data.goods_sn}}</text>
  651 + </view>
  652 + </view>
  653 + <view class="tb_item tb-l">
  654 + <view class="item_left">
  655 + <text>商品条码</text>
  656 + </view>
  657 + <view class="item_right">
  658 + <text>{{data.sku}}</text>
  659 + </view>
  660 + </view>
  661 + <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}">
  662 + <view class="item_left">
  663 + <text>品类</text>
  664 + </view>
  665 + <view class="item_right">
  666 + <text>{{cat_name}}</text>
  667 + </view>
  668 + </view>
  669 + <view class="tb_item tb-l" wx:if="{{brand_name && is_show_pp}}">
  670 + <view class="item_left">
  671 + <text>品牌</text>
  672 + </view>
  673 + <view class="item_right">
  674 + <text>{{brand_name}}</text>
  675 + </view>
  676 + </view>
  677 + <view class="tb_item tb-l" wx:if="{{nation_name && is_show_gb}}">
  678 + <view class="item_left">
  679 + <text>国别</text>
  680 + </view>
  681 + <view class="item_right">
  682 + <text>{{nation_name}}</text>
  683 + </view>
  684 + </view>
  685 + <view class="tb_item tb-l">
  686 + <view class="item_left">
  687 + <text>规格</text>
  688 + </view>
  689 + <view class="item_right">
  690 + <text>{{filters.show_gui_ge(data.goods_spec,data.goods_color)}}</text>
  691 + </view>
  692 + </view>
  693 + <view class="tb_item tb-l">
  694 + <view class="item_left">
  695 + <text>上架时间</text>
  696 + </view>
  697 + <view class="item_right">
  698 + <text>{{data.on_time}}</text>
  699 + </view>
  700 + </view>
  701 + </view>
  702 + </view>
  703 +
  704 + <!--详情图片-->
  705 + <view class="wxParse">
  706 + <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
  707 + </view>
  708 + </view>
  709 +
  710 + <!-- 推荐商品 -->
  711 + <view class="flex-center rel xc-linellae-frame">
  712 + <view class="xc-linellae"></view>
  713 + <view class="abs flex-center xc-recommend-frame ">
  714 + <image class=" xc-recommend" src="{{iurl}}/miniapp/images/diamond.png">
  715 + </image>
  716 + <view class="xc-recommend-word">推荐</view>
  717 + </view>
  718 + </view>
  719 +
  720 + <goods_recommend id="goods_list"></goods_recommend>
  721 +
  722 + </view>
  723 +
  724 + <!------------商品详情图片页面---------------->
  725 + <view class="goods-norms" hidden="{{activeCategoryId==1?false:true}}">
  726 + <view class="table_s">
  727 + <view class="tb_item tb-l">
  728 + <view class="item_left">
  729 + <text>商品名称</text>
  730 + </view>
  731 + <view class="item_right">
  732 + <text>{{data.goods_name}}</text>
  733 + </view>
  734 + </view>
  735 + <view class="tb_item tb-l">
  736 + <view class="item_left">
  737 + <text>商品编号</text>
  738 + </view>
  739 + <view class="item_right">
  740 + <text>{{data.goods_sn}}</text>
  741 + </view>
  742 + </view>
  743 + <view class="tb_item tb-l">
  744 + <view class="item_left">
  745 + <text>商品条码</text>
  746 + </view>
  747 + <view class="item_right">
  748 + <text>{{data.sku}}</text>
  749 + </view>
  750 + </view>
  751 + <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}">
  752 + <view class="item_left">
  753 + <text>品类</text>
  754 + </view>
  755 + <view class="item_right">
  756 + <text>{{cat_name}}</text>
  757 + </view>
  758 + </view>
  759 + <view class="tb_item tb-l" wx:if="{{brand_name && is_show_pp}}">
  760 + <view class="item_left">
  761 + <text>品牌</text>
  762 + </view>
  763 + <view class="item_right">
  764 + <text>{{brand_name}}</text>
  765 + </view>
  766 + </view>
  767 + <view class="tb_item tb-l" wx:if="{{nation_name && is_show_gb}}">
  768 + <view class="item_left">
  769 + <text>国别</text>
  770 + </view>
  771 + <view class="item_right">
  772 + <text>{{nation_name}}</text>
  773 + </view>
  774 + </view>
  775 + <view class="tb_item tb-l">
  776 + <view class="item_left">
  777 + <text>规格</text>
  778 + </view>
  779 + <view class="item_right">
  780 + <text>{{data.goods_spec==""?"规格1":data.goods_spec}}</text>
  781 + </view>
  782 + </view>
  783 + <view class="tb_item tb-l">
  784 + <view class="item_left">
  785 + <text>上架时间</text>
  786 + </view>
  787 + <view class="item_right">
  788 + <text>{{data.on_time}}</text>
  789 + </view>
  790 + </view>
  791 + </view>
  792 +
  793 + <view class="wxParse">
  794 + <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
  795 + </view>
  796 + </view>
  797 + <!---------------评价页面-------------->
  798 + <view class="goods-comment" hidden="{{activeCategoryId==2?false:true}}">
  799 + <view class="topframe">
  800 + <view class="topframe-top">
  801 + <view class="topframe-top-content">
  802 + <view>宝贝评价</view>
  803 + <view class="topframe-top-val">({{categories3[0].num}})</view>
  804 + </view>
  805 + <view class="topframe-praise" wx:if="{{categories3[0].num}}">好评{{ filters.toFix(categories3[2].num/categories3[0].num*100,2) }}%</view>
  806 + <view wx:else>好评 0%</view>
  807 + </view>
  808 + <view class="buttem-list">
  809 + <view bindtap="tabClick3" id="{{item.id}}" wx:for="{{categories3}}" wx:key="categories3" class="item {{activeCategoryId3==item.id?'red':''}}">{{item.name}}({{item.num}})</view>
  810 + </view>
  811 + </view>
  812 +
  813 + <block wx:for="{{comments}}" wx:for-index="cIdx" wx:key="{{cIdx}}">
  814 + <view style='border-bottom:4rpx solid #eee;'>
  815 + <view class="middle">
  816 + <view class="middle-img-frame">
  817 + <image class="middle-img" src="{{item.is_anonymous!=1?item.head_pic:iurl+'/miniapp/images/hui_hear_pic.png'}}" binderror="bind_bnerr2" data-errorimg="comments[{{cIdx}}].head_pic"></image>
  818 + <view class="middle-user-frame">
  819 + <view class="middle-user">{{item.username==''||item.is_anonymous==1 ?'匿名用户':item.username}}</view>
  820 + <image class="star" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image>
  821 + </view>
  822 + </view>
  823 + <view class="xc-pirces">
  824 + <view class="middle-font {{item.seeMore==true?'ellipsis-3':''}}" >
  825 + {{item.content?item.content:'此用户没有填写评价。'}}
  826 + </view>
  827 + </view>
  828 + <view wx:if='{{item.seeMore}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleHandler'>全部显示</view>
  829 + <view wx:if='{{!item.seeMore && item.auto}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleContent'>收起</view>
  830 + <view class="img-ul">
  831 +
  832 + <block wx:if="{{item.source_type==0}}">
  833 + <view class="img-li" wx:for="{{item.img}}" wx:key="{{index}}">
  834 + <image bindtap="previewCommentImgs" class="wh100" data-cidx="{{cIdx}}" data-img="{{iurl}}{{item}}"
  835 + data-id="{{index}}" src="{{iurl}}{{item}}"></image>
  836 + </view>
  837 + </block>
  838 + <block wx:if="{{item.source_type==1}}">
  839 + <view class="img-li" wx:for="{{item.weapp_img}}" wx:if="{{aitem.length>10}}" wx:key="{{index}}" wx:for-item="aitem">
  840 + <image bindtap="previewCommentImgs_w" class="wh100" data-cidx="{{cIdx}}" data-img="{{aitem}}"
  841 + data-id="{{index}}" src="{{aitem}}"></image>
  842 + </view>
  843 + </block>
  844 + </view>
  845 +
  846 + <view class="z_parameter">
  847 + <view class="parameter-font">{{item.add_time}}</view>
  848 + <view class="parameter-dian" bindtap="click_zan" data-com_id="{{item.comment_id}}" data-item_id="{{cIdx}}">
  849 + <image wx:if="{{item.userZanNum==1}}" class="parameter-img" src="{{iurl}}/miniapp/images/zan_red.png"></image>
  850 + <image wx:else class="parameter-img" src="{{iurl}}/miniapp/images/dianzan.png"></image>
  851 + <view class="parameter-val" style='color:{{item.userZanNum==1? "#d60022":"#999" }}' >{{item.zan_num}}</view>
  852 + </view>
  853 + </view>
  854 +
  855 + </view>
  856 + <view class="reply rel" wx:if="{{item.replay_list}}">
  857 + <view class="line_bulge"></view>
  858 + <view class="shop-reply">店家回复: </view>
  859 + <view class="shop-font" wx:for="{{item.replay_list}}" wx:for-item="r_item" wx:key="{{index}}">
  860 + {{r_item.content}}
  861 + </view>
  862 + </view>
  863 + </view>
  864 + </block>
  865 + <block wx:if="{{(!comments || comments.length==0) && get_c }}">
  866 + <text class="no_pj_list">暂无评价</text>
  867 + </block>
  868 + <block wx:if="{{comments.length>10 && comments_no_more}}">
  869 + <text class="no_pj_list">已经加载到底部</text>
  870 + </block>
  871 + </view>
  872 + </view>
  873 + </view>
  874 + <!---滚动到顶部---->
  875 + <view bindtap="doScrollTop" class="toTop" wx:if="{{supportPageScroll}}">
  876 + <image class="wh100" src="{{iurl}}/miniapp/images/topup.png"></image>
  877 + </view>
  878 +
  879 + <!-------------------底部按钮-------------------->
  880 + <view class="join-cart">
  881 + <!-- bindtap="contactService" -->
  882 + <button wx:if="{{sys_switch.weapp_customertype}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
  883 + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
  884 + <view>客服</view>
  885 + </button>
  886 + <view wx:else class="custom-service cart-ico new_split" bindtap="contactService">
  887 + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
  888 + <view>客服</view>
  889 + </view>
  890 +
  891 + <view bindtap="collectGoods" class="custom-service cart-ico new_split">
  892 + <image hidden="{{is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart.png"></image>
  893 + <image hidden="{{!is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart-h.png"></image>
  894 + <view>收藏</view>
  895 + </view>
  896 + <view class="shopping-cart cart-ico new_split">
  897 + <navigator open-type="switchTab" url="/pages/cart/cart/cart">
  898 + <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image>
  899 + <view class="cart-num ellipsis-1"> {{cartGoodsNum}} </view>
  900 + <view>购物车</view>
  901 + </navigator>
  902 + </view>
  903 + <view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{data.goods.is_virtual}}">立即购买</view>
  904 +
  905 + <!-- 普通商品购买 -->
  906 + <block wx:if="{{prom_type==0 || prom_type==2 || prom_type==3}}">
  907 +
  908 + <!-- 线上销售的时候,要判断库存量, 线下库存的时候不用判断 -->
  909 + <block wx:if="{{(sele_g.store_count>0 && sales_rules==1) || sales_rules==2 }}">
  910 + <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view>
  911 + <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view>
  912 + </block>
  913 + <block wx:else>
  914 + <view class="is_stock cart-btn is_stock xc-ash-b " style="width:55.5%">库存不足</view>
  915 + </block>
  916 +
  917 + </block>
  918 +
  919 + <!-------秒杀-------->
  920 + <block wx:if="{{prom_type==1}}">
  921 + <view class="fs24 f1 flex ai-center bg-FF4732 t-c white">
  922 + <view class="pdh20">
  923 + <view class="">08.30 23:59:59 预售结束</view>
  924 + <!-- <view class="">08.30 23:59:59 开始发货</view> -->
  925 + <view class="">付款3天后发货</view>
  926 + </view>
  927 + <view class="pdh20 line" bindtap="openSpecModel" data-ind="2">
  928 + <view class="">支付定金</view>
  929 + <view class="">定金<text class="rmb">9.9</text></view>
  930 + </view>
  931 + </view>
  932 + <!-- <block wx:if="{{prom_st==1 && !prom_r_null}}">
  933 + <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view>
  934 + <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即抢购</view>
  935 + </block>
  936 + <block wx:if="{{prom_st==0 && !prom_r_null}}">
  937 + <view class="buy-btn cart-btn cart-btn-lg lanse set_width">即将开始</view>
  938 + </block>
  939 + <block wx:if="{{prom_r_null}}">
  940 + <view class="buy-btn cart-btn cart-btn-lg huise set_width">已抢光</view>
  941 + </block>
  942 + <block wx:if="{{prom_st==3 && !prom_r_null}}">
  943 + <view class="buy-btn cart-btn cart-btn-lg lanse set_width">活动已经结束</view>
  944 + </block> -->
  945 + </block>
  946 +
  947 + <!-------拼单-------->
  948 + <block wx:if="{{prom_type==6}}">
  949 + <view bindtap="openSpecModel_pt" data-it="1" data-ind="1" class="join-btn cart-btn line-h">
  950 + <view class="fir-v">
  951 + <!-- ¥{{data.shop_price,2)}} -->
  952 + <block wx:if="{{card_field && sele_g[card_field]>0}}">
  953 + {{filters.toFix(sele_g[card_field],2)}}
  954 + </block>
  955 + <block wx:else>
  956 + {{filters.toFix(sele_g.shop_price,2)}}
  957 + </block>
  958 + </view>
  959 + <view>单独购买</view>
  960 + </view>
  961 +
  962 + <block wx:if="{{user_order_pt_state==0}}">
  963 + <!----商家团---->
  964 + <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==1}}" class="buy-btn cart-btn line-h">
  965 + <view class="fir-v">¥{{prom_act.price}}</view>
  966 + <view>去参团</view>
  967 + </view>
  968 + <!----会员团---->
  969 + <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==2}}" class="buy-btn cart-btn line-h">
  970 + <!--<view class="fir-v">¥{{prom_act.price}}</view>-->
  971 + <view class="pd_top1" wx:if="{{prom_act.tz_yhjgtype>1}}">
  972 + <view>一键开团</view>
  973 + <view wx:if="{{prom_act.tz_yhjgtype==3}}">佣金<text style="font-size: 23rpx">¥</text>{{filters.toFix(prom_act.tz_yyhjg,2)}}</view>
  974 + <view wx:if="{{prom_act.tz_yhjgtype==2}}">团长免单</view>
  975 + </view>
  976 + <view wx:else>
  977 + <view class="fir-v">¥{{ filters.toFix(prom_act.price,2)}}</view>
  978 + <view>一键开团</view>
  979 + </view>
  980 +
  981 + </view>
  982 + <!---阶梯团---->
  983 + <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==3 && user_order_pt_state!=3 }}" class="buy-btn cart-btn line-h">
  984 + <view class="fir-v">¥{{filters.toFix(prom_act.yf_price,2)}}</view>
  985 + <view>支付定金</view>
  986 + </view>
  987 +
  988 + <view wx:if="{{prom_st==0}}" class="buy-btn cart-btn lanse">即将开始</view>
  989 + <view wx:if="{{prom_r_null}}" class="buy-btn cart-btn huise">已抢光</view>
  990 + <view wx:if="{{prom_st==3 && !prom_r_null}}" class="buy-btn cart-btn lanse">活动已经结束</view>
  991 + </block>
  992 + <block wx:else>
  993 + <view bindtap="go_to_nopay" wx:if="{{user_order_pt_state==1}}" class="buy-btn cart-btn huise">您还未支付</view>
  994 + <view bindtap="go_to_team_show" wx:if="{{user_order_pt_state==2}}" class="buy-btn cart-btn">查看支付详情</view>
  995 + <view wx:if="{{user_order_pt_state==3}}" bindtap="go_pay_wk" class="buy-btn cart-btn">支付尾款</view>
  996 + </block>
  997 + </block>
  998 +
  999 +
  1000 + <!-------积分购-------->
  1001 + <block wx:if="{{prom_type==4}}">
  1002 +
  1003 + <block wx:if="{{is_shopbuy}}">
  1004 + <view bindtap="go_pay_integral_normal" class="join-btn cart-btn line-h">
  1005 + <view class="fir-v">
  1006 + <block wx:if="{{card_field && sele_g[card_field]>0}}">
  1007 + {{filters.toFix(sele_g[card_field],2)}}
  1008 + </block>
  1009 + <block wx:else>
  1010 + {{filters.toFix(sele_g.shop_price,2)}}
  1011 + </block>
  1012 + </view>
  1013 + <view>单独购买</view>
  1014 + </view>
  1015 + <view bindtap="go_pay_integral" class="buy-btn cart-btn" wx:if="{{can_integral}}" >立即兑换</view>
  1016 + <view class="buy-btn cart-btn" style="background-color: #aaa;" wx:else >积分不足</view>
  1017 + </block>
  1018 +
  1019 + <block wx:else>
  1020 + <view bindtap="go_pay_integral" class="buy-btn-all cart-btn" style="width: 58%; margin-left:1%;" wx:if="{{can_integral}}" >立即兑换</view>
  1021 + <view class="buy-btn-all cart-btn" style="background-color: #aaa; width: 58%;margin-left:1%" wx:else >积分不足</view>
  1022 + </block>
  1023 +
  1024 + </block>
  1025 +
  1026 + <!---<view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:else>立即兑换</view>-->
  1027 + </view>
  1028 +
  1029 + <!-- 制作一个圆球导航 -->
  1030 + <nav_box></nav_box>
  1031 +
  1032 +</block>
  1033 +
  1034 +<!----弹起来,选择规格数量,普通商品购买和秒杀------>
  1035 +<view hidden="{{!openSpecModal}}">
  1036 + <view bindtap="closeSpecModal" class="cover-layer"></view>
  1037 + <view class="spec-model">
  1038 + <view class="pding">
  1039 + <icon bindtap="closeSpecModal" class="modal-close" color="black" size="22" type="cancel"></icon>
  1040 + <view class="spec-goods">
  1041 + <image class="wh100 spec-img xc-distance-bottom" src="{{sele_g.original_img}}" binderror="pop_err_img" data-errorimg="sele_g.original_img"></image>
  1042 + <view class="spec-goods-info">
  1043 + <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view>
  1044 + <view class="flex ai_end xc-val-money" >
  1045 + <view class="spec-goods-price" wx:if="{{prom_price==null}}" >
  1046 + <text class="fs20">¥</text>
  1047 + <!-- 如果是等级会员,且有等级价 -->
  1048 + <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}} </block>
  1049 + <block wx:else>{{sele_g.shop_price}}</block>
  1050 + </view>
  1051 + <view class="spec-goods-price tag" wx:else><text class="fs20">¥</text>{{prom_price}}</view>
  1052 + <!-- 显示线下价格 -->
  1053 + <view wx:if="{{sele_g.offline_price}}" class="quan_price flex ai-center jc-center">
  1054 + 券后¥<text class="fs32">{{sele_g.offline_price}}</text>
  1055 + </view>
  1056 + </view>
  1057 +
  1058 + <block wx:if="{{prom_type==0}}">
  1059 + <view class="flex">
  1060 + <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>
  1061 + <block wx:if="{{sales_rules==2}}">
  1062 + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view>
  1063 + <view class="spec-goods-stock" wx:else>可售:0</view>
  1064 + </block>
  1065 + <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block>
  1066 + </view>
  1067 + </block>
  1068 + <block wx:if="{{prom_type==1}}">
  1069 + <view class="flex">
  1070 + <view class="spec-goods-stock" wx:if="{{prom_st>0}}">已售:{{prom_act.buy_num+prom_act.virtual}}</view>
  1071 + <view class="spec-goods-stock" wx:else >已售:{{prom_act.buy_num}}</view>
  1072 + <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view>
  1073 + </view>
  1074 + </block>
  1075 + </view>
  1076 +
  1077 + <!-- 选择门店模块 -->
  1078 + <view class="flex-space-between address ai_end xc-width ">
  1079 +
  1080 + <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}">
  1081 + <text class="fs30 xc-black3 shop_name bold">{{def_pick_store.pickup_name}}</text>
  1082 + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
  1083 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  1084 +
  1085 + </view>
  1086 + </view>
  1087 +
  1088 + <!-- 没有门店的时候 -->
  1089 + <view class="flex" bindtap="choice_store" wx:else>
  1090 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  1091 + <view class="fs30" style="color:black;">选择门店</view>
  1092 + </view>
  1093 +
  1094 + <view class="red-co fs28" bindtap="choice_store" >
  1095 + 更多门店
  1096 + <text class="right-arrow"></text>
  1097 + </view>
  1098 + </view>
  1099 + <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>
  1100 + <block wx:else>
  1101 + <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
  1102 + <block wx:else>
  1103 + <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view>
  1104 + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view>
  1105 + </block>
  1106 + </block>
  1107 +
  1108 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view>
  1109 + </view>
  1110 +
  1111 + <!--商品的属性项目-->
  1112 + <view class="xc-goods-attribute">
  1113 + <view hidden="{{ismend==1}}" class="spec-name">商品规格</view>
  1114 + <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">
  1115 + <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">
  1116 + {{item.gg}}
  1117 + </view>
  1118 + </view>
  1119 + </view>
  1120 +
  1121 +
  1122 + <view class="b_num">
  1123 + <view>购买数量</view>
  1124 + <view class="count">
  1125 + <view bindtap="{{goodsInputNum <= 1 ? '':'subCartNum'}}" class="sub {{goodsInputNum <= 1 ? 'active':''}}">-</view>
  1126 + <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input>
  1127 + <view bindtap="addCartNum" class="add">+</view>
  1128 + </view>
  1129 + </view>
  1130 +
  1131 + <!-- 提示再买多少优惠 -->
  1132 + <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition && openSpecModal_ind==2}}">
  1133 + 再买{{hui_condition.need}}
  1134 + <text wx:if="{{hui_condition.money}}">,免{{hui_condition.money}}元</text>
  1135 + <text wx:if="{{hui_condition.sale}}">,打{{hui_condition.sale}}折</text>
  1136 + <text wx:if="{{hui_condition.past==1}}">,包邮</text>
  1137 + <text wx:if="{{hui_condition.intValue>0}}">,送{{hui_condition.intValue}}积分</text>
  1138 + <text wx:if="{{hui_condition.couponId>0}}">,送优惠券</text>
  1139 + <text wx:if="{{hui_condition.gift_id>0}}">,送赠品</text>
  1140 + <text wx:if="{{hui_condition.lb_id>0}}">,送礼包</text>
  1141 + </view>
  1142 +
  1143 +
  1144 + </view>
  1145 +
  1146 + <view class="spec-cart-btns">
  1147 + <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add" style="background-color:#FF4835;color:white;" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" data-action="buy">支付定金(¥9.9)</view>
  1148 + <block wx:else>
  1149 +
  1150 + <!-- 根本就找不到门店 -->
  1151 + <block wx:if="{{!only_pk && !def_pickpu_list}}">
  1152 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  1153 + </block>
  1154 + <block wx:else>
  1155 +
  1156 +
  1157 + <block wx:if="{{only_pk.length && !only_pk.length}}">
  1158 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  1159 + </block>
  1160 + <block wx:else>
  1161 + <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">
  1162 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  1163 + </block>
  1164 + <block wx:else>
  1165 + <block wx:if="{{!def_pick_store}}">
  1166 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view>
  1167 + </block>
  1168 + <block wx:else>
  1169 + <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 -->
  1170 + <block wx:if="{{sales_rules==2 && prom_type==0}}">
  1171 + <block wx:if="{{!def_pick_store.CanOutQty}}">
  1172 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  1173 + </block>
  1174 + <block wx:else>
  1175 + <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"
  1176 + class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view>
  1177 + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"
  1178 + class="spec-cart-btn spec-buy" data-action="buy">
  1179 + {{sele_g.offline_price?"券后购买":"立即购买"}}
  1180 + </view>
  1181 + </block>
  1182 + </block>
  1183 + <!-- 线上销售 -->
  1184 + <block wx:else>
  1185 + <block wx:if="{{sele_g.store_count<=0}}">
  1186 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  1187 + </block>
  1188 + <block wx:else>
  1189 + <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"
  1190 + class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view>
  1191 + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}"
  1192 + class="spec-cart-btn spec-buy" data-action="buy">
  1193 + {{sele_g.offline_price?"券后购买":"立即购买"}}
  1194 + </view>
  1195 + </block>
  1196 + </block>
  1197 + </block>
  1198 + </block>
  1199 + </block>
  1200 + </block>
  1201 +
  1202 + </block>
  1203 + </view>
  1204 +
  1205 + <view class="clear"></view>
  1206 + <!-- 选择门店的列表 -->
  1207 + <view hidden="{{ismend==0}}" class="sto_v">
  1208 + <view class="title" hidden="{{is_sec_mend==1}}" bindtap="hidemend">
  1209 + <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>选择门店
  1210 + </view>
  1211 + <!-----第一级显示------>
  1212 + <view class="itemlists" hidden="{{is_sec_mend==1}}">
  1213 + <block wx:if="{{is_show_sto_cat}}">
  1214 + <view wx:for="{{all_sto}}" wx:key="all_sto" class="item" bindtap="show_sec" data-index="{{index}}">{{item.name}}</view>
  1215 + </block>
  1216 + <block wx:else>
  1217 + <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}}</view>
  1218 + </block>
  1219 + </view>
  1220 + <!-----第二级显示------>
  1221 + <view class="stitle" hidden="{{is_sec_mend==0}}" bindtap="hide_sec_mend">
  1222 + <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>{{sec_sto.name}}
  1223 + </view>
  1224 + <view class="itemlists" hidden="{{is_sec_mend==0}}">
  1225 + <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}}
  1226 + </view>
  1227 + </view>
  1228 + </view>
  1229 + </view>
  1230 +</view>
  1231 +
  1232 +<!-- 弹起来,购买积分购 -->
  1233 +<view hidden="{{!openSpecModal_inte}}">
  1234 + <include src="buy_integral.wxml" />
  1235 +</view>
  1236 +<!-- 弹起来,购买积分购的普通购买 -->
  1237 +<view hidden="{{!openSpecModal_inte_normal}}">
  1238 + <include src="buy_integral_normal.wxml" />
  1239 +</view>
  1240 +
  1241 +<!----弹起来,选择规格数量,拼单商品购买------>
  1242 +<view hidden="{{!openSpecModal_pt}}">
  1243 + <include src="buy_pt.wxml" />
  1244 +</view>
  1245 +
  1246 +<!----弹起来优惠信息------>
  1247 +<view hidden="{{!openPromModal}}">
  1248 + <view bindtap="closePromModal" class="cover-layer"></view>
  1249 + <view class="prom-model">
  1250 + <icon bindtap="closePromModal" class="modal-close" color="gray" size="22" type="cancel"></icon>
  1251 + <view class="prom-title">优惠信息</view>
  1252 + <view class="logistics-item" wx:for="{{select.activity.data}}" wx:key="{{index}}">
  1253 + <view class="item-title">
  1254 + <text class="prom-item">{{item.title}}</text>
  1255 + </view>
  1256 + <view class="item-mes ellipsis-1">{{item.content}}</view>
  1257 + </view>
  1258 + </view>
  1259 +</view>
  1260 +<!----弹起的---->
  1261 +<block wx:if="{{pd_xx==1}}">
  1262 + <view class="bview"></view>
  1263 + <view class="juzhong">
  1264 + <view class="xq">
  1265 + <view class="title" bindtap="close_pt_xx">拼团玩法介绍
  1266 + <image src="{{iurl}}/miniapp/images/gbi.png" class="close"></image>
  1267 + </view>
  1268 + <view>1.开团:
  1269 + <text class="hs1">选择心仪商品,点击“发起X人团”按钮,付款后即为开团成功;</text>
  1270 + </view>
  1271 + <view>2.参团:
  1272 + <text class="hs1">进入朋友分享的页面,点击“立即参团”按钮,付款后即为参团成功,若多人同时支付,支付成功时间较早的人获得参团资格;</text>
  1273 + </view>
  1274 + <view>3.成团:
  1275 + <text class="hs1">在开团或参团成功后,点击“邀请小伙伴参团”将页面分享给好友,在有效时间内凑齐人数即为成团,此时商家会开始发货;</text>
  1276 + </view>
  1277 + <view>4.组团失败:
  1278 + <text class="hs1">在有效时间内未凑齐人数,即为组团失败,此时付款项会原路退回到支付账户;</text>
  1279 + </view>
  1280 + <view>5.
  1281 + <text class="hs1">组团有效期间内,拼购商品订单不允许取消。 </text>
  1282 + </view>
  1283 + </view>
  1284 + </view>
  1285 +</block>
  1286 +<!----弹起领券---->
  1287 +<view wx:if='{{coupon==1}}'>
  1288 + <view class="cover-layer flex-center" data-coupon='0' bindtap="switchCoupon"></view>
  1289 + <view class="cx-popup {{coupon== true ? 'up' : 'down'}} ">
  1290 + <view class="top-frame">
  1291 + <!-- <view class="top two-level-word t-c"> -->
  1292 + <view class="top t-c">优惠券领取</view>
  1293 + </view>
  1294 + <!-- <view class="top-frame">
  1295 + <view class="xc-valid-coupon four-level-word">可以领优惠券</view>
  1296 + </view> -->
  1297 + <view class="xc-frame">
  1298 + <view class="top-frame">
  1299 + <view class="xc-coupon-frame ">
  1300 + <!---单张的券--->
  1301 + <view class="rel" wx:for="{{quan_list}}" wx:key="{{index}}">
  1302 + <view class="coupon flex">
  1303 + <view class="circle xc-circular-one"></view>
  1304 + <view class="xc-coupon-left ">
  1305 + <view class="flex ai_c xc-money-frame">
  1306 + <text class="xc-money two-level-word xc-rmb">¥</text>
  1307 + <text class="one-level-word xc-money">{{item.money}}</text>
  1308 + </view>
  1309 + <view class="xc-money four-level-word xc-spacing">
  1310 + 满{{item.condition}}元可用
  1311 + </view>
  1312 + </view>
  1313 + <view class="xc-coupon-right flex">
  1314 + <view class="xc-detail-coupon">
  1315 + <view class="four-level-word">订单金额满{{item.condition}}元可用</view>
  1316 + <view class="four-level-word xc-below">{{filters.replace_time2(item.start)}} 至 {{filters.replace_time2(item.end)}}</view>
  1317 + </view>
  1318 + <view class="flex-vertical">
  1319 + <view class="three-level-word xc-get background {{item.everyone_num>0 && item.lqnum>=item.everyone_num?'nouse':''}}"
  1320 + data-ind="{{index}}" data-cid="{{item.id}}" bindtap="get_quan">{{ item.linging==1?'领取中':'领取'}}</view>
  1321 + </view>
  1322 + </view>
  1323 + <view class="circle xc-circular-two"></view>
  1324 + </view>
  1325 + </view>
  1326 + </view>
  1327 + </view>
  1328 + </view>
  1329 + <view class="cx-confirm pd20" data-coupon='0' bindtap="switchCoupon">
  1330 + <view class="confirm t-c">关闭</view>
  1331 + </view>
  1332 + </view>
  1333 +</view>
  1334 +
  1335 +<!-- 选择门店的弹框,1.1版最新的 -->
  1336 +<block wx:if="{{store==1}}">
  1337 + <view class="mongolia-layer" bindtap="close_popup"></view>
  1338 + <view class="popup-frame">
  1339 + <block wx:if="{{sort_store==0}}">
  1340 + <!-- 头部 标题 -->
  1341 + <view class="popup-top flex-space-between">
  1342 + <text class="fs32 nearby_store">{{choice_sort_store==0?'附近的门店':region_name}}</text>
  1343 + <view>
  1344 + <view>
  1345 + <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon>
  1346 + </view>
  1347 + <view class="felx choose_more" bindtap="more_store">
  1348 + <text class="fs26 red-co" wx:if="{{is_show_sto_cat}}">{{choice_sort_store==0?'更多门店':'返回'}}</text>
  1349 + <view class="bg_rights" wx:if="{{is_show_sto_cat}}"></view>
  1350 + </view>
  1351 + </view>
  1352 + </view>
  1353 + <!-- 门店列表,最外层的门店列表,一开始 -->
  1354 + <view class="store-list">
  1355 + <!--如果还没有点击更多门店的时候 -->
  1356 + <block wx:if="{{choice_sort_store==0}}">
  1357 + <!-- 需要for循环 -->
  1358 + <block wx:if="{{is_show_sto_cat==1}}">
  1359 + <view class="store_choose flex" wx:for="{{def_pickpu_list}}" bindtap="choose_for_store_fir" data-ind="{{index}}">
  1360 + <view class="store flex-vertical">
  1361 + <!-- 需要点击事件 -->
  1362 + <block wx:if="{{index==fir_pick_index}}">
  1363 + <view class="circle white xc-hook fs20 red-b">Г</view>
  1364 + </block>
  1365 + <block wx:else>
  1366 + <view class="circle xc-hooks"></view>
  1367 + </block>
  1368 + <view class="address-frame xc-ash">
  1369 + <view class="flex-vertical-between butttem5">
  1370 + <view class="flex xc-ash">
  1371 + <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view>
  1372 + </view>
  1373 + <view>
  1374 + <view class="distance fs24 address-val"wx:if="{{item.distance!=null}}">
  1375 + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+'km':filters.toFix(item.distance,0)+"m"}}</view>
  1376 + </view>
  1377 + </view>
  1378 + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
  1379 + </view>
  1380 + </view>
  1381 + </view>
  1382 + </block>
  1383 + <block wx:else>
  1384 + <view class="store_choose flex" wx:for="{{only_pk}}" bindtap="choose_for_store_fir" data-ind="{{index}}">
  1385 + <view class="store flex-vertical">
  1386 + <!-- 需要点击事件 -->
  1387 + <block wx:if="{{index==fir_pick_index}}" >
  1388 + <view class="circle white xc-hook fs20 red-b">Г</view>
  1389 + </block>
  1390 + <block wx:else>
  1391 + <view class="circle xc-hooks"></view>
  1392 + </block>
  1393 +
  1394 + <view class="address-frame xc-ash">
  1395 + <view class="flex-vertical-between ">
  1396 + <view class="flex xc-ash">
  1397 + <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view>
  1398 + </view>
  1399 + <view>
  1400 + <view class="distance fs24 address-val"
  1401 + wx:if="{{item.distance!=null}}">距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}
  1402 + </view>
  1403 + </view>
  1404 + </view>
  1405 + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
  1406 + </view>
  1407 + </view>
  1408 + </view>
  1409 + </block>
  1410 + </block>
  1411 + <block wx:else> <!-- 如果是点击选择门店分类后显示分类下的门店 -->
  1412 + <view class="store_choose flex" wx:for="{{sec_sto.s_arr}}" data-ind="{{index}}" bindtap="choose_for_store">
  1413 + <view class="store flex-vertical">
  1414 + <!-- 需要点击事件 -->
  1415 + <block wx:if="{{index==sec_pick_index}}">
  1416 + <view class="circle white xc-hook fs20 red-b">Г</view>
  1417 + </block>
  1418 + <block wx:else>
  1419 + <view class="circle xc-hooks"></view>
  1420 + </block>
  1421 +
  1422 + <view class="address-frame xc-ash">
  1423 + <view class="flex-vertical-between ">
  1424 + <view class="flex xc-ash">
  1425 + <view class="fs28 xc-black3 address_name">{{item.pickup_name}}</view>
  1426 + </view>
  1427 + <view>
  1428 + <view class="distance fs24 address-val"wx:if="{{item.distance!=null}}">
  1429 + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}</view>
  1430 + </view>
  1431 + </view>
  1432 + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
  1433 + </view>
  1434 + </view>
  1435 + </view>
  1436 + </block>
  1437 +
  1438 + </view>
  1439 +
  1440 + <!-- 门店列表底部 -->
  1441 + <view class="store-bottom-frame">
  1442 + <view class="store-bottom flex-vertical-between">
  1443 + <view class="determine red-b fs28 white t-c" bindtap="sure_pick"
  1444 + data-openindstore="{{open_ind_store}}">确定</view>
  1445 + <view class="default t-c fs28" bindtap="set_def_pick"data-openindstore="{{open_ind_store}}">设为默认</view>
  1446 + </view>
  1447 + </view>
  1448 +
  1449 + </block>
  1450 +
  1451 +
  1452 + <block wx:else>
  1453 + <view class="popup-top flex-space-between">
  1454 + <text class="fs32 nearby_store">门店分类选择</text>
  1455 + <view>
  1456 + <view>
  1457 + <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon>
  1458 + </view>
  1459 + <view class="felx choose_mores" bindtap="returns">
  1460 + <text class="fs26 red-co">返回</text>
  1461 + </view>
  1462 + </view>
  1463 + </view>
  1464 + <view class="sort_store_list">
  1465 +
  1466 + <view class="sort-store-frame" wx:for="{{all_sto}}" data-index="{{index}}" bindtap="choice_sort_store" data-region="{{item.name}}">
  1467 + <view class="sort-store flex-vertical-between" >
  1468 + <view class="fs30" di>{{item.name}}</view>
  1469 + <view class="black_rights-frame">
  1470 + <view class="black_rights"></view>
  1471 + </view>
  1472 + </view>
  1473 + </view>
  1474 +
  1475 + </view>
  1476 + </block>
  1477 + </view>
  1478 +</block>
  1479 +<!-- ---------------分享弹窗--------------- -->
  1480 +<!--二维码显示页面-->
  1481 +<canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas>
  1482 +<warn id="warn"></warn>
  1483 +
  1484 +
  1485 +<!-- 分享控件,底部弹出 -->
  1486 +<share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{share_hidden}}"></share>
  1487 +
  1488 +
  1489 +<view wx:if="{{showPoster}}">
  1490 + <view class="mask" catchtap="closePoster"></view>
  1491 + <view class="poster-container">
  1492 + <view class="poster-wrapper">
  1493 + <view class="poster">
  1494 + <!-- <view class="poster" bindtap="previewImage"> -->
  1495 + <image src="{{shareImgPath}}" class="poster-img" show-menu-by-longpress></image>
  1496 + <view class="btn-close" catchtap="closePoster"><text class="iconfont icon-close"></text></view>
  1497 + </view>
  1498 + <!-- <view class="btn-container">
  1499 + <button class="btn-share" open-type="share" bindtap="">微信好友分享</button>
  1500 + <button class="btn-share" bindtap="savePic">保存到相册</button>
  1501 + </view> -->
  1502 + </view>
  1503 + </view>
  1504 +</view>
  1505 +
... ...
packageC/pages/presell/goodsInfo/goodsInfo.wxss 0 → 100644
  1 +@import "../../../../utils/wxParse/wxParse.wxss";
  2 +.container { margin-bottom: 100rpx; overflow: hidden;padding-top: 80rpx;}
  3 +image {
  4 + vertical-align: top;
  5 +}
  6 +.goods-detail{overflow: hidden}
  7 +
  8 +.type-navbar {
  9 + display: flex;
  10 + justify-content: center;
  11 + width: 100%;
  12 + position: fixed;
  13 + top: 0;
  14 + z-index: 999;
  15 + /* height: 80rpx; */
  16 + /* margin-bottom: 20rpx; */
  17 + background-color: #fff;
  18 + border-top: 2rpx solid #ebedf0;
  19 + /* border-bottom: 1rpx #fafafa solid; */
  20 +}
  21 +.type-box {
  22 + width: 25%;
  23 + box-sizing: border-box;
  24 + font-size: 32rpx;
  25 + line-height: 76rpx;
  26 + padding: 0 20rpx;
  27 + text-align: center;
  28 + display: inline-block;
  29 + overflow: hidden;
  30 +}
  31 +.type-navbar-item {
  32 + /* border-bottom: 4rpx solid #fff; */
  33 + display: flex;
  34 + justify-content: center;
  35 + width: 100%;
  36 + font-size: 26rpx;
  37 +}
  38 +.type-item-on {
  39 + color: #F95D74;
  40 + font-weight: bold;
  41 + /* border-bottom: 4rpx solid #F95D74; */
  42 + position: relative;
  43 + font-size: 30rpx;
  44 +}
  45 +.type-item-on:after {
  46 + content: '';
  47 + position: absolute;
  48 + width: 50%;
  49 + height: 4rpx;
  50 + background-color: #F95D74;
  51 + left: 0;
  52 + right: 0;
  53 + bottom: 0;
  54 + margin: 0 auto;
  55 +}
  56 +.swiper_box {
  57 + width: 100%;
  58 + height: 750rpx;
  59 +}
  60 +.goods-title {
  61 + display: flex;
  62 + justify-content: space-between;
  63 + /* overflow: hidden; */
  64 + /* height: 108rpx; */
  65 +}
  66 +.goods-name {
  67 + /* width: 560rpx; */
  68 + /* line-height: 46rpx; */
  69 + font-size: 32rpx;
  70 + font-weight: bold;
  71 + color: #333;
  72 + /* margin-top: 30rpx;
  73 + margin-bottom:30rpx; */
  74 + flex: 1;
  75 + text-align: justify;
  76 + margin: 10rpx 0 20rpx;
  77 +}
  78 +
  79 +.goods-collect {
  80 + width: 112rpx;
  81 + padding-top: 30rpx;
  82 +}
  83 +
  84 +.collect-img {
  85 + width: 50rpx;
  86 + height: 44rpx;
  87 + margin: 0 auto;
  88 + overflow: hidden;
  89 +}
  90 +
  91 +.collect-des {
  92 + text-align: center;
  93 + font-size: 24rpx;
  94 + color: #333;
  95 +}
  96 +
  97 +.goods-price {
  98 + font-size: 60rpx;
  99 + /* padding: 20rpx 34rpx; */
  100 + /* padding:0rpx 34rpx; */
  101 + /* line-height: 60rpx; */
  102 + color: #999;
  103 + padding: 20rpx;
  104 + /* margin-top: 46rpx; */
  105 + /* margin-top:26rpx;
  106 + padding-bottom:20rpx; */
  107 +}
  108 +
  109 +.prom-info {
  110 + margin: 10rpx 0;
  111 + color: #f23030;
  112 +}
  113 +
  114 +.prom-info>.prom-type {
  115 + color: white;
  116 + background-color: #f23030;
  117 + margin-right: 14rpx;
  118 + padding: 2rpx 8rpx;
  119 + border-radius: 4rpx;
  120 +}
  121 +.market-price {
  122 + /* display: flex;
  123 + margin-left: -5rpx; */
  124 +}
  125 +
  126 +.market-price .yuan{
  127 + /* top:24rpx; */
  128 + font-size: 30rpx
  129 +}
  130 +
  131 +.market-price>view>text {
  132 + text-decoration: line-through;
  133 +}
  134 +
  135 +.market-price>.yj{
  136 + color: #999999; font-size: 24rpx;/* margin-left: 16rpx;position: relative;top:30rpx; */
  137 + display: inline-block;
  138 +}
  139 +
  140 +.goods-price>.tm{ color: #999999; font-size: 26rpx;margin-top: 10rpx;}
  141 +
  142 +.goods-num {
  143 + display: flex;
  144 + font-size: 24rpx;
  145 + justify-content: space-between;
  146 +}
  147 +
  148 +.goods-detail .twen{
  149 + background: #fff;height: 60rpx; line-height: 60rpx; font-size: 30rpx;padding-left: 30rpx;display: flex;
  150 +}
  151 +.goods-detail .twen .img{ width: 32rpx; height: 32rpx; margin-left: 200rpx; background: #fff}
  152 +.goods-detail .twen image.img{vertical-align:auto;}
  153 +
  154 +
  155 +.logistics-item {
  156 + display: flex;
  157 + justify-content: space-between;
  158 + align-items: center;
  159 + height: 90rpx;
  160 + /*border-bottom: 1px solid #f5f5f5;*/
  161 + font-size: 32rpx;
  162 + color: #666;
  163 +}
  164 +.logistics-item .small{color: #999; font-size: 24rpx;}
  165 +
  166 +.item-title { width: 180rpx;}
  167 +.item-mes {
  168 + color: #333; width: 420rpx;
  169 + height: 90rpx; line-height: 90rpx;
  170 +}
  171 +.item-img { width: 32rpx; height: 32rpx;}
  172 +.prom-item {
  173 + color: #f23030;
  174 + border: 1px solid #f23030;
  175 + border-radius: 18rpx;
  176 + line-height: 40rpx;
  177 + height: 40rpx;
  178 + padding: 2rpx 8rpx;
  179 +}
  180 +
  181 +.guarantee {
  182 + justify-content: space-around;
  183 +}
  184 +
  185 +.ico-item {
  186 + width: 32rpx;
  187 + height: 32rpx;
  188 + margin-right: 10rpx;
  189 +}
  190 +
  191 +.guarantee>view {
  192 + display: flex;
  193 + align-items: center;
  194 + height: 32rpx;
  195 + color: #666;
  196 +}
  197 +
  198 +.user-comment {
  199 + margin: 10rpx 0;
  200 + font-size: 28rpx;
  201 +}
  202 +
  203 +.good-comment,.comment-num {
  204 + display: flex;
  205 +}
  206 +
  207 +.recommend {
  208 + background-color: #fff;
  209 + border-bottom: 1px solid #ddd;
  210 + padding-bottom: 20rpx;
  211 +}
  212 +
  213 +.recommend-title {
  214 + height: 70rpx;
  215 + line-height: 70rpx;
  216 + font-size: 28rpx;
  217 + padding: 0 30rpx;
  218 +}
  219 +
  220 +.recommend-ul {
  221 + display: flex;
  222 + justify-content: flex-start;
  223 +}
  224 +
  225 +.recommend-ul .li {
  226 + width: 25%;
  227 + box-sizing: border-box;
  228 + text-align: center;
  229 + font-size: 28rpx;
  230 + color: #333;
  231 +}
  232 +
  233 +.li-img {
  234 + width: 120rpx;
  235 + height: 120rpx;
  236 + margin: 0 auto;
  237 +}
  238 +
  239 +.li-title {
  240 + height: 58rpx;
  241 + line-height: 30rpx;
  242 + margin: 10rpx 0;
  243 +}
  244 +
  245 +.comment-item {
  246 + background-color: #fff;
  247 + font-size: 28rpx;
  248 +}
  249 +
  250 +.comment-title {
  251 + display: flex;
  252 + justify-content: space-between;
  253 + align-items: center;
  254 + height: 102rpx;
  255 + margin: 0 30rpx;
  256 + color: #333;
  257 + border-bottom: 1px solid #eee;
  258 +}
  259 +
  260 +.user-name {
  261 + display: flex;
  262 + align-items: center;
  263 +}
  264 +
  265 +.user-pic {
  266 + width: 54rpx;
  267 + height: 54rpx;
  268 + margin-right: 10rpx;
  269 + border-radius: 50%;
  270 + overflow: hidden;
  271 +}
  272 +
  273 +.stars {
  274 + float: left;
  275 + display: flex;
  276 + height: 42rpx;
  277 + line-height: 42rpx;
  278 + margin: 15rpx 0;
  279 + width: 200rpx;
  280 +}
  281 +
  282 +.star {
  283 + width: 26rpx;
  284 + height: 26rpx;
  285 + margin-right: 5rpx;
  286 +}
  287 +
  288 +.state-spec {
  289 + margin: 15rpx 0;
  290 + float: right;
  291 + font-size: 24rpx;
  292 + color: #666;
  293 + width: 460rpx;
  294 + text-align: right;
  295 +}
  296 +
  297 +.comment-cont {
  298 + padding: 0 30rpx 30rpx;
  299 + border-bottom: 1px solid #eee;
  300 +}
  301 +
  302 +.comment-mes {
  303 + line-height: 42rpx;
  304 +}
  305 +
  306 +.img-ul {
  307 + display: flex;
  308 + flex-wrap: wrap;
  309 +}
  310 +
  311 +.img-li {
  312 + width: 150rpx;
  313 + height: 150rpx;
  314 + margin-top: 8rpx;
  315 + margin-right: 10rpx;
  316 +}
  317 +
  318 +.comment-btn {
  319 + height: 60rpx;
  320 + padding: 20rpx 30rpx;
  321 +}
  322 +
  323 +.comment-btn .btn {
  324 + display: flex;
  325 + justify-content: center;
  326 + align-items: center;
  327 + height: 60rpx;
  328 + width: 45%;
  329 + border: 1px solid #eee;
  330 +}
  331 +
  332 +.comment-btn .btn-img {
  333 + width: 30rpx;
  334 + height: 28rpx;
  335 + margin: 0 10rpx;
  336 +}
  337 +
  338 +.reply-ul {
  339 + margin-top: 20rpx;
  340 +}
  341 +
  342 +.reply-li {
  343 + color: #aaa;
  344 +}
  345 +
  346 +.join-cart {
  347 + position: fixed;
  348 + left: 0;
  349 + bottom: 0;
  350 + display: flex;
  351 + width: 100%;
  352 + height: 100rpx;
  353 + background-color: #fff;
  354 + z-index: 9;
  355 + border-top: 4rpx solid #eee;
  356 +
  357 +}
  358 +
  359 +.join-cart>view {
  360 + width: 29%;
  361 +}
  362 +
  363 +.join-cart>.new_split {
  364 + width: 13%;
  365 + text-align: center;
  366 + padding: 0;
  367 + margin: 0;
  368 +}
  369 +
  370 +.cart-ico {
  371 + font-size: 24rpx;
  372 + color: #333;
  373 +}
  374 +
  375 +.shopping-cart {
  376 + position: relative;
  377 +}
  378 +
  379 +.cs-img {
  380 + width: 45rpx;
  381 + height: 40rpx;
  382 + margin-top: 15rpx;
  383 +}
  384 +
  385 +.sc-img {
  386 + width: 42rpx;
  387 + height: 40rpx;
  388 + margin-top: 15rpx;
  389 +}
  390 +
  391 +.cart-num {
  392 + position: absolute;
  393 + left: 50%;
  394 + top: 1rpx;
  395 + width: 40rpx;
  396 + height: 40rpx;
  397 + line-height: 40rpx;
  398 + text-align: center;
  399 + border-radius: 50%;
  400 + color: #fff;
  401 + background-color: rgba(217,81,99,0.9);
  402 +}
  403 +
  404 +.cart-btn {
  405 + font-size: 28rpx;
  406 + color: #fff;
  407 + line-height: 70rpx;
  408 + margin-top: 16rpx;
  409 + text-align: center;
  410 +
  411 +
  412 +}
  413 +
  414 +.join-btn {
  415 + background-color: #ffb03f;
  416 + height: 70rpx;
  417 +border-radius: 55rpx 0rpx 0rpx 55rpx;
  418 +margin-top: 16rpx;
  419 +
  420 +
  421 +}
  422 +
  423 +view.cart-btn-lg {
  424 + width: 50%;
  425 +}
  426 +
  427 +.buy-btn {
  428 + background-color: #f23030;
  429 + height: 70rpx;
  430 +border-radius: 0 56rpx 55rpx 0;
  431 +
  432 +}
  433 +
  434 +.buy-btn-all{
  435 + background-color: #f23030;
  436 + height: 70rpx;
  437 + border-radius: 56rpx;
  438 +}
  439 +
  440 +
  441 +.toTop {
  442 + position: fixed;
  443 + z-index: 3;
  444 + right: 20rpx;
  445 + bottom: 160rpx;
  446 + width: 68rpx;
  447 + height: 68rpx;
  448 + border: 1px solid #ddd;
  449 + border-radius: 50%;
  450 + overflow: hidden;
  451 + cursor: pointer;
  452 +}
  453 +
  454 +.comment-more {
  455 + height: 56rpx;
  456 + line-height: 56rpx;
  457 + font-size: 26rpx;
  458 + color: #999;
  459 + text-align: center;
  460 + background-color: #eee;
  461 +}
  462 +
  463 +.goods-more {
  464 + background-color: #fff;
  465 +}
  466 +
  467 +.goods-norms {
  468 + background-color: #fff;
  469 +}
  470 +
  471 +.type-navbar2 {
  472 + display: flex;
  473 + height: 72rpx;
  474 + border-top: 1px solid #ddd;
  475 + border-bottom: 1px solid #ddd;
  476 +}
  477 +
  478 +.type-box2 {
  479 + width: 50%;
  480 + font-size: 26rpx;
  481 + line-height: 72rpx;
  482 + text-align: center;
  483 + overflow: hidden;
  484 +}
  485 +
  486 +.type-item2-on {
  487 + color: #f23030;
  488 +}
  489 +
  490 +.parameter {
  491 + padding: 40rpx 0;
  492 +}
  493 +
  494 +.table {
  495 + width: 698rpx;
  496 + margin: 0 auto;
  497 + border: 1px solid #ddd;
  498 + border-bottom: none;
  499 +}
  500 +
  501 +.tb {
  502 + width: 100%;
  503 + min-height: 69rpx;
  504 + line-height: 69rpx;
  505 + border-bottom: 1px solid #ddd;
  506 + font-size: 28rpx;
  507 + text-align: center;
  508 + color: #333;
  509 +}
  510 +
  511 +.th-thitle {
  512 + font-weight: bold;
  513 + background-color: #f5fafe;
  514 +}
  515 +
  516 +.td-cont {
  517 + display: flex;
  518 +}
  519 +
  520 +.td-title {
  521 + width: 259rpx;
  522 + background-color: #f5fafe;
  523 + border-right: 1px solid #ddd;
  524 +}
  525 +
  526 +.td-text {
  527 + width: 439rpx;
  528 +}
  529 +
  530 +.goods-comment {
  531 + background-color: #fff;
  532 +}
  533 +
  534 +.type-navbar3 {
  535 + display: flex;
  536 + height: 88rpx;
  537 + border-top: 1px solid #ddd;
  538 + border-bottom: 1px solid #ddd;
  539 + padding: 10rpx 0;
  540 +}
  541 +
  542 +.type-box3 {
  543 + width: 20%;
  544 + font-size: 30rpx;
  545 + line-height: 44rpx;
  546 + text-align: center;
  547 + overflow: hidden;
  548 +}
  549 +
  550 +.type-item3-on {
  551 + color: #f23030;
  552 +}
  553 +
  554 +.spec-model {
  555 + position: fixed;
  556 + bottom: 0;
  557 + z-index: 20;
  558 + background: white;
  559 + width: 100%;
  560 + /* padding: 0 30rpx; */
  561 + font-size: 32rpx;
  562 + box-sizing: border-box;
  563 + border-radius: 20rpx 20rpx 0 0;
  564 + /* height: 72%; */
  565 +}
  566 +
  567 +.spec-model .pding{padding: 0 20rpx;}
  568 +
  569 +.spec-goods {
  570 + padding: 30rpx 0 20rpx;
  571 + /* float: left; */
  572 + width: 100%;
  573 + /* border-bottom:2rpx solid #eee; */
  574 +}
  575 +
  576 +.spec-img {
  577 + float: left;
  578 + height: 186rpx;
  579 + width: 186rpx;
  580 + border: 4rpx solid #eee
  581 +}
  582 +
  583 +.spec-goods-info {
  584 + float: left;
  585 + padding: 0 25rpx;
  586 + width: 400rpx;
  587 +}
  588 +
  589 +.spec-goods-name {
  590 + font-size: 30rpx;
  591 + line-height: 35rpx;
  592 + height: 70rpx;
  593 + margin: 15rpx 20rpx 25rpx 0;
  594 + overflow: hidden;
  595 + text-overflow: ellipsis;color: #333;
  596 +}
  597 +
  598 +.spec-goods-price {
  599 + color: #d60021;
  600 + font-size: 33rpx;
  601 + font-weight: bold;
  602 +
  603 +}
  604 +
  605 +.spec-goods-price.tag {
  606 + position: relative;
  607 +}
  608 +
  609 +.spec-goods-price.tag::before {
  610 + content: '预售';
  611 + color: white;
  612 + background-color: #FF4732;
  613 + font-size: 24rpx;
  614 + border-radius: 4rpx;
  615 + padding: 0 6rpx;
  616 +}
  617 +
  618 +.spec-goods-stock {
  619 + margin-top: 3rpx;
  620 + font-size: 24rpx;
  621 + color: #999999;
  622 + margin-right: 15rpx;
  623 +}
  624 +
  625 +.spec-name {
  626 + clear: both;
  627 + padding: 20rpx 0;
  628 + font-size: 30rpx;color: #333;
  629 +}
  630 +
  631 +.quhuo{font-size: 30rpx; color: #000}
  632 +.b_num{
  633 + display: flex;font-size: 30rpx; color: #333;
  634 + justify-content: space-between;
  635 + align-items: center;
  636 + padding: 20rpx 0;
  637 +}
  638 +
  639 +.count {
  640 + /* position: fixed; */
  641 + display: flex;
  642 + height: 50rpx;
  643 + /* border: 1rpx solid #000; */
  644 + font-size: 28rpx;
  645 + right: 30rpx;
  646 +}
  647 +
  648 +
  649 +.count>view,.count>input {
  650 + width: 60rpx;
  651 + height: 50rpx;
  652 + line-height: 50rpx;
  653 + text-align: center;
  654 +}
  655 +.spec_bt{
  656 + background: fff;color: #333; margin-left: 10rpx;padding: 4rpx 15rpx 4rpx; display: inline-block;
  657 + border-radius:30rpx;font-size: 24rpx;border: 1rpx solid #ccc; margin: 10rpx; height: 40rpx; line-height: 40rpx;
  658 +}
  659 +.spec_bt.act{background: #d60021;color: #fff;border: 1rpx solid #d60021;}
  660 +.sub, .add, .count>input {
  661 + /* border-right: 1px solid #000; */
  662 + background-color: #f8f8f8;
  663 + border-radius: 8rpx;
  664 +}
  665 +.sub.active {
  666 + /* background-color: #ddd; */
  667 + color: #ccc;
  668 +}
  669 +.count>input {
  670 + margin: 0 10rpx;
  671 +}
  672 +
  673 +.add {
  674 + /* background-color: #f8f8f8; */
  675 + /* border-left: 1px solid #000; */
  676 +}
  677 +
  678 +.spec-btn {
  679 + color: black;
  680 + background-color: white;
  681 + padding: 10rpx 10rpx;
  682 + font-size: 26rpx;
  683 + line-height: 28rpx;
  684 + float: left;
  685 + border: 1rpx solid #dedede;
  686 + margin: 4rpx 10rpx 4rpx 0;
  687 + border-radius: 4rpx;
  688 +}
  689 +
  690 +.spec-btn-click {
  691 + color: white;
  692 + background-color: #f23030;
  693 + border: 1rpx solid #f23030;
  694 +}
  695 +
  696 +.spec-cart-btns {
  697 + /* width: 92%; */
  698 + line-height: 70rpx;
  699 + /* margin: 0rpx auto;
  700 + margin-top: 160rpx; */
  701 + /* border-radius: 20rpx; */
  702 +/* position: fixed; */
  703 +/* bottom: 50rpx; */
  704 +/* left: 4%; */
  705 + padding: 20rpx;
  706 +}
  707 +
  708 +.spec-cart-btn {
  709 +
  710 + width:100%;
  711 + font-size: 30rpx;
  712 + text-align: center;
  713 + color: white;
  714 + border-radius: 40rpx;
  715 +}
  716 +
  717 +.spec-cart-btn.w40 {
  718 + width: 46%;
  719 +}
  720 +
  721 +.spec-add-cart {
  722 + background-color: #ffb03f;
  723 +}
  724 +
  725 +.spec-buy {
  726 + background-color: #f23030;
  727 + /* margin-left: 34rpx; */
  728 +}
  729 +
  730 +.spec-cart-disable {
  731 + background: #bbbbbb;
  732 +}
  733 +
  734 +.spec-cart-btn-lg {
  735 + width: 614rpx;
  736 +}
  737 +
  738 +.prom-model {
  739 + position: fixed;
  740 + bottom: 0;
  741 + z-index: 20;
  742 + background: white;
  743 + width: 100%;
  744 + padding: 0 30rpx 30rpx;
  745 + font-size: 32rpx;
  746 + box-sizing: border-box;
  747 + overflow-x: hidden;
  748 +}
  749 +
  750 +.prom-model .prom-title {text-align: center;margin: 30rpx 0;}
  751 +.prom-model .logistics-item {border: 0;}
  752 +.prom-model .item-mes {width: 500rpx;}
  753 +.integral-btn {width: 100%; padding: 0rpx;margin: 0rpx;}
  754 +.clear{clear: both;}
  755 +.sto_v .title,.sto_v .stitle{ border-top: 1rpx solid #dedede;border-bottom: 1rpx solid #dedede; height: 78rpx; line-height: 78rpx;}
  756 +.sto_v .title .tubiao,.sto_v .stitle .tubiao{width: 32rpx; height: 32rpx; margin-top: 23rpx;}
  757 +.itemlists .item{border-bottom: 1rpx solid #dedede; height: 72rpx; line-height: 72rpx;font-size: 28rpx; margin: 0 10rpx;}
  758 +
  759 +.cshu{margin-bottom: 30rpx; margin-top: 20rpx;}
  760 +.cshu view{color: #999; font-size: 30rpx; margin-left: 26rpx;}
  761 +
  762 +
  763 +/*---活动特殊显示---*/
  764 +.prom_show{height: 120rpx; display: flex;}
  765 +.prom_show .secondkill-img{width: 100%; height: 100%;}
  766 +.prom_show .spike-img{width: 283rpx; height: 57rpx; top:35rpx;
  767 +left:31rpx;}
  768 +.prom_show .stop{ color:#d81731;top: 17rpx;right:65rpx; font-weight:600;}
  769 +.prom_show .start{ color:#009ae2;top: 17rpx;right:65rpx; font-weight:600;}
  770 +.prom_show .timeac { font-size: 32rpx; height: 120rpx; color: #333; }
  771 +.prom_show .timeac.left{width: 66%; color: #fff;background:#f23030;}
  772 +.prom_show .timeac.right{width: 34%;background-color: #d7d7d7; text-align: center}
  773 +
  774 +.prom_show .secview .day{padding-right:10rpx;}
  775 +.prom_show .secview .time-val{width:36rpx;height:36rpx;border-radius:7rpx; line-height: 36rpx;}
  776 +.prom_show .secview .time{margin-right:10rpx; margin-left:10rpx;}
  777 +
  778 +
  779 +.prom_show .timeac.left view{ margin-left: 20rpx}
  780 +.prom_show .timeac.left view.firview{margin-top: 10rpx}
  781 +.prom_show .timeac.left view .tr_line{ text-decoration: line-through; font-size: 28rpx;}
  782 +.prom_show .timeac.left view .bprice{ font-size: 50rpx; }
  783 +
  784 +.prom_show .timeac.right view.firview{margin-top:12rpx; margin-bottom: 10rpx}
  785 +.prom_show .timeac.right view.secview{display: flex; text-align: center; justify-content:center; flex-direction: row;}
  786 +.prom_show .timeac.right view .tui-conutdown-box{
  787 + /* background: #6b6b6b; */
  788 + width: auto;
  789 + /* min-width: 45rpx; */
  790 + height: 45rpx; color: #c4182e; font-size: 27rpx; text-align: center; line-height: 46rpx;}
  791 +
  792 +.huise{ background:gray}
  793 +.lanse{background:#0199e2}
  794 +
  795 +
  796 +/*------拼单------*/
  797 +.pt_view{ text-align: center; width: 100%; height: 100rpx; line-height: 100rpx; font-size: 26rpx}
  798 +.pt_view .secondkill-img{width: 100%;height: 100%;}
  799 +.pt_fir{ background: #fff;/* margin-bottom: 10rpx; */}
  800 +.pt_fir .pt_fir_title{display: flex; align-items: center; /* margin-left: 10rpx; margin-top: 20rpx; */ font-size: 28rpx; position: relative;}
  801 +.pt_fir .pt_fir_title .kt_type{ color: #fff;background:#e9030d; width: 100rpx; line-height: 40rpx; border-radius: 6rpx; margin: 0 10rpx;
  802 + height: 40rpx; font-size: 24rpx; text-align: center;}
  803 +.pt_fir .pt_fir_title .price{color: #e9030d;font-size: 26rpx;}
  804 +.pt_fir .pt_fir_title .bigw{font-size: 36rpx;}
  805 +.pt_fir .pt_fir_title .tprice{text-decoration: line-through;color: #949494}
  806 +.pt_fir .pt_fir_title .tprice.ml50{margin-left: 50rpx}
  807 +
  808 +.pt_fir .pt_fir_title .js{padding: 0 15rpx;height: 40rpx;background:#e9030d; text-align: center; border-radius: 8rpx; color: #fff; margin-left: 10rpx;}
  809 +.pt_fir .pt_fir_title .tuannum{color: #e9030d; position: absolute; right: 20rpx; font-size: 26rpx;}
  810 +.pding{padding-top: 20rpx;padding-left: 20rpx;height: 81%;
  811 + padding-right: 20rpx;font-size: 26rpx;color: #ea120f}
  812 +.pdres{margin-left: 10rpx;color: #8f8f94}
  813 +.ptgz{position: relative;font-size: 30rpx;padding-left: 20rpx;margin-top: 10rpx; overflow: hidden }
  814 +.shuxian{width: 6rpx;height: 28rpx; background: #ea120f; display: inline-block;top: 5rpx;position: relative; margin-right: 5rpx}
  815 +.ptgz_an{position: absolute;top:5rpx; right: 6rpx}
  816 +.ptgz_an .arrow-two{width:18rpx;height:18rpx;border-color:#da0b31; margin-top:30rpx;}
  817 +
  818 +.pt_fir.se{height: auto; margin-bottom: 10rpx}
  819 +.t_gz{padding: 10rpx 20rpx; font-size:28rpx }
  820 +
  821 +.pt_fir.se1{height: auto; margin: 0}
  822 +.pt_fir.se2{height: auto; margin: 0;/* border-top:6rpx solid #eeeeee;border-bottom:2rpx solid #eeeeee; */}
  823 +
  824 +.pt_hb{height:78rpx; line-height: 75rpx; position: relative; font-size: 32rpx;overflow: hidden;width:695rpx;margin-left:28rpx;
  825 + border-bottom: 1rpx solid #E5E5E5 }
  826 +.ptgz_an.xq{font-size: 32rpx; color:#d40024}
  827 +.wf{display: flex; padding: 20rpx 0;}
  828 +.wf .item{width: 24.5%; text-align: center; font-size: 26rpx; color: #666}
  829 +.wf .item .item_txy{position: relative;width: 60rpx; height: 60rpx; background: #ea120f; border-radius: 50%;left: 50%;margin-left: -30rpx;
  830 + border: 3px #dfdfdf solid; text-align: center;line-height: 60rpx; color: #fff; margin-bottom: 10rpx;}
  831 +.wf .item .item_txy.hs{ background: #cbcbcb;}
  832 +.po{margin-bottom: 20rpx;}
  833 +
  834 +.cart-btn.line-h{ line-height: 26rpx;}
  835 +.cart-btn .fir-v{ margin-top: 10rpx;}
  836 +
  837 +.hyt{ padding: 0 20rpx; font-size: 30rpx; display: flex; align-items:center; margin-top: 10rpx;}
  838 +.hyt .r_f{color: #e9120f;font-size: 26rpx;position: relative;top:3rpx}
  839 +.hyt .byj{color: #e9120f;font-size: 32rpx;position: relative;top:5rpx}
  840 +
  841 +.pt_fir .pt_fir_title.no-mar-b{margin-bottom: 0;padding-bottom: 10rpx; margin-left: 20rpx}
  842 +.pt_fir .pt_fir_title.boder-1{border-bottom: 1rpx #e7e7e7 solid}
  843 +
  844 +.jie_price{/* padding: 10rpx 30rpx; */}
  845 +.jie_price_title{font-size: 30rpx; color: #a26270; margin-bottom: 10rpx}
  846 +.price_list{display: flex; width: 100%;}
  847 +.price_item{width: 25%;font-size: 28rpx; color: #4c336c}
  848 +
  849 +.pt_fir.se2 .zzk-1{/* margin-top: 23rpx; */ font-size: 30rpx;position: relative; /* margin-bottom: 30rpx; */ border-left:4rpx solid red;/* margin-left:14rpx; */height:30rpx;line-height:30rpx;/* padding-left:5rpx; */}
  850 +.ckgd{/* position: absolute;top:0;right:57rpx; */ color:#d70025; font-size: 26rpx;}
  851 +.ckgd .arrow-one{width:14rpx;height:14rpx;border-color:#da0b31;/* margin-top:5rpx; */ margin:auto;}
  852 +.bview{
  853 + position: fixed; top:0; left:0; width: 100%; height: 100%;
  854 + background-color: rgba(0, 0, 0, 0.5);
  855 +}
  856 +.juzhong{
  857 + position: fixed; top:0; left:0; width: 100%; height: 100%;
  858 + display: flex;
  859 + flex-direction:row;
  860 + justify-content: center;
  861 + align-items: center;
  862 +}
  863 +
  864 +.juzhong .xq{ padding: 0 20rpx; background: #fff; font-size: 30rpx; padding-bottom: 20rpx;}
  865 +.juzhong .xq .title{text-align: center; margin: 20rpx 0; position: relative; height: 50rpx;}
  866 +.juzhong .xq .hs1{font-size: 28rpx; color: #ab8f9e}
  867 +.juzhong .xq .title .close{position: absolute;top: 0; right: 0; width: 45rpx; height: 45rpx;}
  868 +
  869 +.pt_qd{/* margin-top: 40rpx; height: auto; */padding: 20rpx;}
  870 +.spec-cart-btn.w100{width: 95%; margin-left: 0; height: 75rpx; line-height:75rpx;margin: auto; }
  871 +
  872 +.sto_v{color: #333;}
  873 +.ellipsis{overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
  874 +
  875 +
  876 +/*---多少人参加团--*/
  877 +.group {
  878 + padding-top:20rpx;
  879 + padding-bottom:20rpx;
  880 + width: 100%;
  881 + /* min-height: 92rpx; */
  882 + border-bottom: 2rpx solid #ebedf0;
  883 +
  884 +}
  885 +
  886 +.group .group-list {
  887 + display: flex;
  888 + align-items: center;
  889 + justify-content: space-around;
  890 + /* height: 90rpx; */
  891 + /* padding: 0 130rpx 0 100rpx; */
  892 + /* width: 470rpx;
  893 +
  894 + position: absolute; */
  895 +}
  896 +
  897 +.group .group-list .gtou {
  898 + width: 70rpx;
  899 + height: 70rpx;
  900 + /* float: left;
  901 + position: relative;
  902 + top: 6rpx;
  903 + left: -96rpx; */
  904 +}
  905 +
  906 +.group .group-list .gtou image {
  907 + display: block;
  908 + width: 100%;
  909 + height: 100%;
  910 + border-radius: 50%;
  911 + background-color: #f0f0f0;
  912 +}
  913 +
  914 +.group .group-list .gdn {
  915 + width: 140rpx;
  916 + text-align: center;
  917 + /* float: left; */
  918 + font-size: 26rpx;
  919 + /* padding-left: 20rpx; */
  920 + /* line-height: 48rpx;
  921 + height: 48rpx;
  922 + width: 168rpx;
  923 + position: relative;
  924 + left: -80rpx;
  925 + top:20rpx; */
  926 + font-weight:bold;
  927 +}
  928 +
  929 +.group .group-list .ghaicha {
  930 + /* width:300rpx; */
  931 + font-size: 27rpx;
  932 + /* margin-left:180rpx;
  933 + top:13rpx;
  934 + left:-3rpx; */
  935 + font-weight: bold;
  936 +
  937 +
  938 +}
  939 +
  940 +.group .group-list .ghaicha .gred {
  941 + /* height: 48rpx;
  942 + width: 300rpx; */
  943 +}
  944 +
  945 +.gsj {
  946 + float: left;
  947 + color: #8f8f94;
  948 +}
  949 +
  950 +.group .group-list .cjt {
  951 + height:42rpx;
  952 + width: 137rpx;
  953 + /* position: absolute;
  954 + right: 4rpx;
  955 + top:25rpx; */
  956 + line-height: 42rpx;
  957 + font-size: 24rpx;
  958 + color: #fff;
  959 + border:2rpx solid #d60024;
  960 + background-color:#d60024;
  961 + border-radius:25rpx;
  962 +
  963 +}
  964 +
  965 +.gbody {
  966 + background-color: white;
  967 +}
  968 +.t_show{/* overflow: hidden; */ display: flex; /* width: 300rpx; */ color: #292929; /* line-height: 36rpx; */font-size:26rpx;
  969 +}
  970 +.join-cart>view.set_width {
  971 + width:58%;
  972 +}
  973 +
  974 +/*秒杀样式zwp*/
  975 +#zwpMs{
  976 + width: 31%;
  977 + color: #fff;
  978 + background: url(https://mshopimg.yolipai.net/miniapp/images/user/bgred.png) no-repeat;
  979 + background-size: 100% 60px;
  980 +}
  981 +
  982 +
  983 +/*--------- 修改后的样式 -----------*/
  984 +.elli{
  985 + overflow : hidden;
  986 + text-overflow: ellipsis;
  987 + display: -webkit-box;
  988 + -webkit-line-clamp: 2;
  989 + -webkit-box-orient: vertical;
  990 +}
  991 +.one_elli{
  992 + overflow : hidden;
  993 + text-overflow: ellipsis;
  994 + white-space:nowrap;
  995 +}
  996 +
  997 +.tuwen_title{ /* height: 86rpx; */ background-color:#eeeeee; /* margin-bottom: 32rpx; */ position: relative;
  998 + display: flex; justify-content: center;align-items: center; padding: 20rpx;}
  999 +
  1000 +.tuwen_title .g_line{
  1001 + width:496rpx;
  1002 + height:1rpx;
  1003 + border-bottom:#ababab 1rpx solid;
  1004 +}
  1005 +.tuwen_title .center_s{
  1006 + width: 124rpx; position: absolute; height: 34rpx; background-color:#eeeeee; font-size: 32rpx; display: flex;
  1007 + overflow: hidden; justify-content: center;align-items: center;
  1008 +}
  1009 +.tuwen_title .center_s image{ width: 34rpx; height: 26rpx; margin-right: 10rpx}
  1010 +.t_g_info{ /* margin: 0 34rpx;margin-bottom: 20rpx; */ display: flex; align-items: center;padding: 20rpx; }
  1011 +.red_shu{ width: 10rpx; height: 36rpx; background-color:#da0035; margin-right: 8rpx; }
  1012 +
  1013 +.tb-l{ /* line-height: 96rpx; */}
  1014 +.table_s{ border:#e4e4e4 1rpx solid; box-sizing: border-box;font-size: 26rpx;}
  1015 +.tb_item{display: flex; /* height: 96rpx; */ border-bottom: 1rpx solid #e4e4e4 }
  1016 +.item_left{width: 210rpx; height: 100%; box-sizing:border-box; text-align: center;padding: 20rpx; background: #f9f9f9 ;border-right:2rpx solid #e4e4e4} .item_left text{ /* margin-left: 44rpx; */}
  1017 +.item_right{flex:1; height: 100%; overflow : hidden;white-space:nowrap;text-overflow: ellipsis; padding: 20rpx;}
  1018 +.item_right text{ /* margin-left: 66rpx; */}
  1019 +
  1020 +.table_s .tb-l:last-child {border-bottom: none;}
  1021 +
  1022 +.bzfu_img{ width: 164rpx; height:34rpx; /* margin-right: 18rpx; margin-left: 12rpx */ }
  1023 + .bz_view{ /* height:100rpx; padding: 0 34rpx 0 13rpx; */ color: #333; font-size: 28rpx; padding: 20rpx 20rpx 20rpx 10rpx;
  1024 + /* border-bottom: 3rpx solid #eee; */
  1025 + /* border-top: 3rpx solid #eee; */}
  1026 + .bz_view view{ width: 460rpx; /* max-height: 70rpx; */ /* overflow: hidden; */}
  1027 +
  1028 +.bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 20rpx; color: #333;
  1029 + font-size: 30rpx; /* height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx */ }
  1030 +.red_bb{ color: #d70026; /* min-width:158rpx;width: auto; */}
  1031 +.bg_jj{ width: 14rpx; height:14rpx;
  1032 + border-top: 2rpx solid #d70026;
  1033 + border-right: 2rpx solid #d70026;
  1034 + transform: rotate(45deg);display:inline-block;
  1035 + margin-bottom:3rpx;
  1036 +}
  1037 +.bg_jj.down1{transform: rotate(135deg);}
  1038 +
  1039 +.bz-content {
  1040 + flex-grow: 1;
  1041 + text-align: justify;
  1042 + padding: 0 30rpx 0 20rpx;
  1043 +}
  1044 +
  1045 +/* 顶部边框 */
  1046 +.topframe{
  1047 + width: 100%;
  1048 + height: 172rpx;
  1049 + flex-direction: row;
  1050 + justify-content: space-between;
  1051 + border-bottom: 6rpx solid #eeeeee;
  1052 + overflow: hidden;
  1053 +}
  1054 +/* 评价人边框*/
  1055 +.topframe .topframe-top{
  1056 + display: flex;
  1057 + margin-top: 40rpx;
  1058 + margin-bottom: 36rpx;
  1059 + color: #7d7d7d;
  1060 + padding-left: 20rpx;
  1061 + font-size: 32rpx;
  1062 +}
  1063 +/*评价人数量*/
  1064 +.topframe .topframe-top .topframe-top-val{
  1065 + margin-left: 15rpx;
  1066 +
  1067 +}
  1068 +.topframe-top-content{
  1069 + display: flex;
  1070 + width: 36%;
  1071 +}
  1072 +/* 好评 */
  1073 +.topframe-praise{
  1074 + width: 61%;
  1075 + text-align: right;
  1076 + color: #dc4355;
  1077 + font-size: 28rpx;
  1078 +}
  1079 +/* 按钮列表 */
  1080 +.buttem-list{
  1081 + width: 100%;
  1082 + display: flex;
  1083 + font-size: 20rpx;
  1084 + overflow: hidden;
  1085 +}
  1086 +
  1087 +.buttem-list .item{
  1088 + min-width: 17%;
  1089 + font-size: 24rpx;
  1090 + border-radius: 20rpx;
  1091 + background:#ffe3e2;
  1092 + height:38rpx;
  1093 + text-align: center;
  1094 + line-height: 38rpx;
  1095 + margin-left: 20rpx;
  1096 +}
  1097 +
  1098 +.buttem-list .item.red{
  1099 + color: #fff;
  1100 + background: #d60022;
  1101 +}
  1102 +
  1103 +/* 用户评价 */
  1104 +.middle{
  1105 + width: 95%;
  1106 + margin:0 auto;
  1107 +}
  1108 +.middle-img-frame{
  1109 + height:65rpx;
  1110 + display: flex;
  1111 + margin-top: 32rpx;
  1112 +
  1113 +}
  1114 +/* 评价的用户图片 */
  1115 +.middle-img{
  1116 + width:60rpx;
  1117 + height:60rpx;
  1118 + border-radius: 50%;
  1119 + -moz-border-radius: 50%;
  1120 + -webkit-border-radius: 50%;
  1121 + margin-right: 15rpx;
  1122 +}
  1123 +/* 评价的用户边框 */
  1124 +.middle-user-frame{
  1125 + height: 65rpx;
  1126 + overflow: hidden;
  1127 +}
  1128 +.middle-user{
  1129 + height: 25;
  1130 + font-size: 28rpx;
  1131 +}
  1132 +/* 评价图片 */
  1133 +.middle-img-two{
  1134 + width: 115rpx;
  1135 + height: 25rpx;
  1136 + text-align: center;
  1137 + margin-bottom:20rpx;
  1138 + margin-left:5rpx;
  1139 +}
  1140 +.xc-pirces{
  1141 + margin-top: 14rpx;
  1142 +}
  1143 +/* 评价文字 */
  1144 +.middle-font{
  1145 + font-size: 30rpx;
  1146 +
  1147 +}
  1148 +.iddle-goods-img{
  1149 + width: 100%;
  1150 + display: flex;
  1151 + margin-top:22rpx;
  1152 +}
  1153 +/* 商品图片 */
  1154 +.goods-img{
  1155 + width: 156rpx;
  1156 + height: 156rpx;
  1157 + margin-left: 22rpx;
  1158 + height: 100%;
  1159 +}
  1160 +.parameter-frame{
  1161 + margin-top:14rxp;
  1162 + margin-bottom: 14rpx;
  1163 + width:50%;
  1164 + height: 30rpx;
  1165 +}
  1166 +.z_parameter{
  1167 + width:98%;
  1168 + height: 45rpx;
  1169 + display:flex;
  1170 + line-height: 45rpx;
  1171 + margin-top: 20rpx;
  1172 + margin-bottom: 14rpx;
  1173 + justify-content : space-between;
  1174 +}
  1175 +.parameter-font{
  1176 + font-size: 26rpx;
  1177 +
  1178 +}
  1179 +/* 规格 */
  1180 +.parameter-state{
  1181 + width: 100rpx;
  1182 + font-size: 24rpx;
  1183 + color: #c4c4c4;
  1184 +}
  1185 +.parameter-dian{
  1186 + display: flex;
  1187 + width: 94rpx;
  1188 + height: 33rpx;
  1189 + font-size: 20rpx;
  1190 + border-radius: 20rpx;
  1191 + line-height:33rpx;
  1192 + padding-left: 25rpx;
  1193 + border:4rpx solid #eeeeee;
  1194 +
  1195 +}
  1196 +/* 点赞图片 */
  1197 +.parameter-img{
  1198 + width: 27rpx;
  1199 + height: 27rpx;
  1200 + margin-top: 3rpx;
  1201 +}
  1202 +.parameter-val{
  1203 + margin-left:25rpx;
  1204 + font-size: 26rpx;
  1205 + color: #999;
  1206 +}
  1207 +/* 回复 */
  1208 +.reply{
  1209 + width: 95%;
  1210 + height: 120rpx;
  1211 + padding-top: 14rpx;
  1212 + border-top:3rpx solid #eeeeee;
  1213 + margin:0 auto;
  1214 +
  1215 +}
  1216 +.shop-reply{
  1217 + height: 30rpx;
  1218 + color:#d60022;
  1219 + font-size:24rpx;
  1220 + overflow: hidden;
  1221 +}
  1222 +.shop-font{
  1223 + width: 94%;
  1224 + font-size: 24rpx;
  1225 + padding-top: 10rpx;
  1226 +
  1227 +}
  1228 +.line_bulge{
  1229 + width: 17rpx;
  1230 + height: 17rpx;
  1231 + border-top: 1rpx solid #eeeeee;
  1232 + border-left: 1rpx solid #eeeeee;
  1233 + transform:rotate(45deg);
  1234 + position: absolute;
  1235 + top: -12rpx;
  1236 + left:50rpx;
  1237 + background:#fff;
  1238 +}
  1239 +
  1240 +
  1241 +.xc_comment{
  1242 + display: flex;
  1243 + justify-content: space-around;
  1244 + width: 100%;
  1245 + box-sizing: border-box;
  1246 + padding: 10rpx 20rpx;
  1247 + /* height: 42rpx;
  1248 + padding-left: 34rpx; */
  1249 + color: #333;
  1250 +
  1251 +}
  1252 +.xc_comment-have-pictures{
  1253 + width: 153rpx;
  1254 + /* height: 42rpx; */
  1255 + line-height: 42rpx;
  1256 + text-align: center;
  1257 + background: #ffe3e2;
  1258 + color: 28rpx;
  1259 + border-radius:21rpx;
  1260 + font-size: 24rpx;
  1261 +}
  1262 +.xc_comment-discuss{
  1263 + width: 152rpx;
  1264 + height: 42rpx;
  1265 + line-height: 42rpx;
  1266 + text-align: center;
  1267 + background: #ffe3e2;
  1268 + color: 28rpx;
  1269 + border-radius:20rpx;
  1270 + font-size: 24rpx;
  1271 + margin-left: 28rpx
  1272 +}
  1273 +
  1274 +.xc_comment-detail{
  1275 + display: flex;
  1276 + /* margin-top: 40rpx; */
  1277 + /* width: 524rpx; */
  1278 + /* margin-left: 34rpx; */
  1279 + border-radius: 24rpx;
  1280 + border: 2rpx solid #ebedf0;
  1281 + margin-left: 20rpx;
  1282 + box-sizing: border-box;
  1283 + /* overflow: hidden; */
  1284 +}
  1285 +
  1286 +.xc_user-img{
  1287 + border-radius:50%;
  1288 + margin: auto 0;
  1289 +}
  1290 +
  1291 +.xc_comment-user{
  1292 + display: flex;
  1293 + /* margin-top: 22rpx;
  1294 + margin-left: 22rpx; */
  1295 +}
  1296 +.xc_user{
  1297 + width: 170rpx;
  1298 + height: 60rpx;
  1299 + margin-left: 6rpx;
  1300 + overflow: hidden;
  1301 +}
  1302 +.xc_user-name{ /* height: 25rpx; */}
  1303 +.xc_comment-img{
  1304 + width: 22rpx;
  1305 + height: 22rpx;
  1306 + /* margin-top: 14rpx; */
  1307 + margin-right: 5rpx
  1308 +}
  1309 +.xc_comment-font{
  1310 + /* height: 75rpx; */
  1311 + /* margin-left: 22rpx; */
  1312 + white-space:normal;
  1313 + overflow: hidden;
  1314 + /* margin-top: 8rpx;
  1315 + line-height: 38rpx; */
  1316 +
  1317 +}
  1318 +.xc_comment-val{
  1319 + /* width: 88%;
  1320 + height: 30rpx;
  1321 + margin-left: 22rpx;
  1322 + display: flex;
  1323 + margin-top: 15rpx;
  1324 + margin-bottom:15rpx; */
  1325 +}
  1326 +
  1327 +.xc_comment-time{
  1328 + /* height: 30rpx; */
  1329 + font-size: 22rpx;
  1330 + color: #a5a5a5;
  1331 + overflow: hidden;
  1332 +}
  1333 +
  1334 +.xc_goods-img{
  1335 + width: 180rpx;height: 180rpx;
  1336 +}
  1337 +.xc_comment-left{
  1338 + display:inline-block;
  1339 + width: 312rpx;
  1340 + padding: 20rpx;
  1341 +}
  1342 +.xc_goods-img-frame{
  1343 + border-radius: 0 22rpx 22rpx 0;
  1344 + overflow: hidden;
  1345 + /* display:inline-block; */
  1346 + /* width: 40%;
  1347 + height: 90%;
  1348 + text-align: center;
  1349 + padding-top: 30rpx;
  1350 + vertical-align: top; */
  1351 +}
  1352 +.xc_imgs{
  1353 + width: 50rpx;
  1354 + height:50rpx;
  1355 + border-radius:50%;
  1356 + margin-right: 5rpx;
  1357 +}
  1358 +
  1359 +.pj_word_size{ font-size: 28rpx}
  1360 +.pj_scroll{
  1361 + /* white-space: nowrap; */
  1362 + /* height: 324rpx; */
  1363 + /* margin-bottom: 50rpx; */
  1364 + display: flex;
  1365 + align-items: center;
  1366 + padding: 20rpx 0;
  1367 + /* box-sizing: border-box; */
  1368 + /* box-shadow: 0 8px 12px #e7e9eb; */
  1369 +}
  1370 +
  1371 +
  1372 +/*领券*/
  1373 +.three-level-word{
  1374 + font-size: 25rpx;
  1375 +}
  1376 +.four-level-word{
  1377 + font-size: 23rpx;
  1378 +}
  1379 +.cx-frame{
  1380 + /* border-top:3rpx solid #eee; */
  1381 + /* width:99%;
  1382 + height: 95rpx;
  1383 + line-height: 95rpx;
  1384 + padding-left:24rpx; */
  1385 + padding: 20rpx;
  1386 +}
  1387 +.cx-frame .cx-sizs{
  1388 + /* width: 68rpx; */
  1389 + /* height: 100%; */
  1390 + /* line-height: 100rpx; */
  1391 + /* overflow: hidden; */
  1392 + /* margin-left: 10rpx; */
  1393 +}
  1394 +.xc-coupon-fram{
  1395 + position: relative;
  1396 + margin-right: 16rpx;
  1397 + /* width:200rpx; */
  1398 + /* padding-top:30rpx; */
  1399 +
  1400 +}
  1401 +.xc-coupon-fram .xc-coupon{
  1402 + /* width:175rpx ;
  1403 + height: 40rpx;
  1404 + line-height: 40rpx; */
  1405 + background-color:#d60021 ;
  1406 + /* margin:0 auto; */
  1407 + color:#fff;
  1408 + padding: 6rpx 20rpx;
  1409 +
  1410 +}
  1411 +.xc-coupon-fram .xc-circular{
  1412 + width: 16rpx;
  1413 + height:16rpx;
  1414 + background-color: white;
  1415 + position:absolute;
  1416 + top: 50%;
  1417 + /* left: -10rpx; */
  1418 + transform: translateY(-50%);
  1419 +}
  1420 +.xc-coupon-fram .xc-one{
  1421 + left: -8rpx;
  1422 +}
  1423 +.xc-coupon-fram .xc-two{
  1424 + right: -8rpx;
  1425 +}
  1426 +
  1427 +.cx-obtain-coupon{
  1428 + /* width: 65rpx;
  1429 + height: 100%;
  1430 + padding-left:15rpx; */
  1431 + color: #d70025;
  1432 + display: flex;
  1433 + align-items: center;
  1434 + /* position: absolute;
  1435 + right: 5rpx; */
  1436 +}
  1437 +
  1438 +/* 自定义弹出窗口 */
  1439 +.cx-popup{
  1440 + width:100%;
  1441 + background: #fff;
  1442 + z-index: 35;
  1443 + border-top-left-radius: 25rpx;
  1444 + border-top-right-radius: 25rpx;
  1445 + position:fixed;
  1446 + bottom:0;
  1447 +}
  1448 +
  1449 +.cx-popup .top{
  1450 + /* width: 90%;
  1451 + height:85rpx; */
  1452 + font-size: 32rpx;
  1453 + padding: 20rpx 0;
  1454 + border-bottom: 2rpx solid #ebedf0;
  1455 + /* padding-top: 50rpx;
  1456 + font-weight:600; */
  1457 +
  1458 +}
  1459 +.cx-popup .top-frame{
  1460 + /* width: 100%;
  1461 + display: flex;
  1462 + justify-content: center;
  1463 + overflow: hidden; */
  1464 +}
  1465 +.xc-valid-coupon{
  1466 + width: 90%;
  1467 + height:40rpx;
  1468 + padding-top: 24rpx;
  1469 + overflow: hidden;
  1470 +}
  1471 +.xc-frame{
  1472 + position: relative;
  1473 +}
  1474 +.xc-coupon-frame {
  1475 + width: 100%;
  1476 + max-height: 560rpx;
  1477 + overflow: auto;
  1478 +
  1479 +}
  1480 +.xc-coupon-frame .rel:not(:first-child) {
  1481 + margin-top: 20rpx;
  1482 +}
  1483 +.xc-coupon-frame .coupon {
  1484 + width:100%;
  1485 + height: 168rpx;
  1486 + border-radius: 25rpx;
  1487 + border:2rpx solid #ffdcdc;
  1488 + overflow: hidden;
  1489 + /* margin-top:16rpx; */
  1490 + box-sizing: border-box;
  1491 +
  1492 +}
  1493 +/* .xc-coupon-frame .coupon ~ .coupon {
  1494 + margin-top:16rpx;
  1495 +} */
  1496 +.xc-coupon-left{
  1497 + width: 216rpx;
  1498 + /* height: 100%; */
  1499 + background-color: #ffeeef;
  1500 + border-right: 4rpx dashed #ffdbd9;
  1501 + overflow: hidden;
  1502 + /* line-height: 100%; */
  1503 + display: flex;
  1504 + flex-direction: column;
  1505 + justify-content: center;
  1506 + align-items: center;
  1507 + flex-shrink: 0;
  1508 +}
  1509 +.xc-money{
  1510 + color: #f30026;
  1511 + text-align:center;
  1512 +}
  1513 +.xc-rmb{
  1514 + /* width:44rpx;
  1515 + padding-top:7rpx; */
  1516 +}
  1517 +.xc-money-frame{
  1518 + /* margin-left:35rpx;
  1519 + margin-top:48rpx; */
  1520 +
  1521 +}
  1522 +.xc-spacing{
  1523 + letter-spacing:4rpx;
  1524 +}
  1525 +.xc-circular-one{
  1526 + position: absolute;
  1527 + top:-15rpx;
  1528 + left:205rpx;
  1529 + width: 30rpx;
  1530 + height: 30rpx;
  1531 + background: #fff;
  1532 + overflow: hidden;
  1533 +}
  1534 +.xc-circular-two{
  1535 + position: absolute;
  1536 + bottom: -15rpx;
  1537 + /* top:150rpx; */
  1538 + left:205rpx;
  1539 + width: 30rpx;
  1540 + height:30rpx;
  1541 + background: #fff;
  1542 +}
  1543 +.xc-detail-coupon{
  1544 + /* margin-left: 22rpx;
  1545 + overflow: hidden;
  1546 + padding-top: 43rpx; */
  1547 + /* display: flex;
  1548 + align-items: center; */
  1549 +}
  1550 +.xc-coupon-right{
  1551 + /* width: 455rpx;
  1552 + height: 100%; */
  1553 + background: #fffaf9;
  1554 + padding: 20rpx;
  1555 + box-sizing: border-box;
  1556 + width: 100%;
  1557 + justify-content: space-between;
  1558 + align-items: center;
  1559 +}
  1560 +.xc-below{
  1561 + margin-top:20rpx;
  1562 +
  1563 +}
  1564 +.xc-get{
  1565 +
  1566 + width: 140rpx;
  1567 + /* height: 48rpx; */
  1568 + color: #fff;
  1569 + text-align: center;
  1570 + border-radius:27rpx;
  1571 + line-height:54rpx;
  1572 + /* margin-left:20rpx; */
  1573 +}
  1574 +
  1575 +.background{
  1576 + background:#f40028;
  1577 +}
  1578 +/*--不可使用--*/
  1579 +.background.nouse{
  1580 + background:gainsboro;
  1581 +}
  1582 +
  1583 +.xc-background{
  1584 + background:#b9b9b9;
  1585 +}
  1586 +
  1587 +
  1588 +.cx-confirm{
  1589 + width: 100%;
  1590 + padding: 20rpx;
  1591 + box-sizing: border-box;
  1592 + /* height: 160rpx; */
  1593 +
  1594 +}
  1595 +.cx-confirm .confirm{
  1596 + /* width: 372rpx;
  1597 + height: 60rpx; */
  1598 + background-color: #f40026;
  1599 + color: #fff;
  1600 + border-radius:10rpx;
  1601 + line-height: 80rpx;
  1602 + font-size: 28rpx;
  1603 +
  1604 +}
  1605 +
  1606 +.up{ animation: up .7s; }
  1607 +.down{ animation: down 1s; }
  1608 +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } }
  1609 +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } }
  1610 +
  1611 +
  1612 +/* 分享 */
  1613 +.icon-share {
  1614 + font-size: 46rpx;
  1615 + color: #d60021;
  1616 +}
  1617 +.xc-share-frame{
  1618 + /* width: 129rpx;
  1619 + height: 48rpx;
  1620 + border-top-left-radius: 18rpx;
  1621 + border-bottom-left-radius: 18rpx; */
  1622 + /* background: #d60021; */
  1623 + /* position:absolute;
  1624 + left:622rpx;
  1625 + top:-37rpx;
  1626 + line-height:50rpx;
  1627 + margin-top:52rpx; */
  1628 +}
  1629 +.xc-share-frame-jieti{
  1630 + width: 129rpx;
  1631 + height: 48rpx;
  1632 + border-top-left-radius: 18rpx;
  1633 + border-bottom-left-radius: 18rpx;
  1634 + background: #d60021;
  1635 + line-height:50rpx;
  1636 +}
  1637 +
  1638 +.xc-share-frame .share-font,.xc-share-frame-jieti .share-font{
  1639 + font-size: 32rpx;
  1640 + color:#fff;
  1641 + margin-left:10rpx;
  1642 +
  1643 +}
  1644 +
  1645 +
  1646 +.xc-share-frame .share-frame,.xc-share-frame-jieti .share-frame{
  1647 + width: 30rpx;
  1648 + height: 30rpx;
  1649 + margin-top:9rpx;
  1650 + margin-left: 10rpx;
  1651 +
  1652 +}
  1653 +.xc-share {
  1654 + width:90%;
  1655 + height:800rpx;
  1656 + background:#fff;
  1657 + z-index:35;
  1658 +}
  1659 +.img-frame{
  1660 + position: absolute;
  1661 + top: 175rpx;
  1662 + left:100rpx;
  1663 + z-index: 55;
  1664 + overflow:hidden;
  1665 +
  1666 +}
  1667 +.img-frame .img{
  1668 + width: 100rpx;
  1669 + height: 100rpx;
  1670 +
  1671 +}
  1672 +.xc-share .top{
  1673 + height: 85rpx;
  1674 + width: 100%;
  1675 + border-bottom: 4rpx dashed #f5f5f5;
  1676 + overflow:hidden;
  1677 +
  1678 +}
  1679 +.xc-share .name{
  1680 + font-size: 25rpx;
  1681 + margin-left:180rpx;
  1682 + color:#000;
  1683 +
  1684 +}
  1685 +
  1686 +.xc-share .recommend{
  1687 + width: 110rpx;
  1688 + height: 12rpx;
  1689 + color: #fff;
  1690 + background: #d60021;
  1691 + font-size: 20rpx;
  1692 + border-radius:25rpx;
  1693 + margin-left:10rpx;
  1694 + line-height:37rpx;
  1695 +}
  1696 +.xc-left-circle{
  1697 + width: 40rpx;
  1698 + height: 25rpx;
  1699 + position: absolute;
  1700 + top:280rpx;
  1701 + left:29rpx;
  1702 + z-index: 55;
  1703 + background:#727272;
  1704 + border-radius:50rpx 50rpx 0 0;
  1705 + transform:rotate(90deg);
  1706 +
  1707 +}
  1708 +.xc-right-circle{
  1709 + width: 40rpx;
  1710 + height: 25rpx;
  1711 + position: absolute;
  1712 + top: 280rpx;
  1713 + left:683rpx;
  1714 + z-index: 55;
  1715 + background:#727272;
  1716 + border-radius:50rpx 50rpx 0 0;
  1717 + transform:rotate(270deg);
  1718 +
  1719 +}
  1720 +.xc-circle-frame{
  1721 + width: 25rpx;
  1722 + height: 40rpx;
  1723 + overflow: hidden;
  1724 +}
  1725 +.xc-goods-name{
  1726 + width: 95%;
  1727 + font-size: 35rpx;
  1728 + padding-left: 75rpx;
  1729 + height: 50rpx;
  1730 + padding-top: 10rpx;
  1731 + color:#000;
  1732 +
  1733 +}
  1734 +.xc-good-img{
  1735 + width: 100%;
  1736 + height: 381rpx;
  1737 + margin-top:5rpx;
  1738 +
  1739 +}
  1740 +.xc-good-img .img{
  1741 + width: 90%;
  1742 + height: 381rpx;
  1743 +}
  1744 +.xc-ensure-frame{
  1745 + width: 90%;
  1746 + height: 60rpx;
  1747 + border-bottom: 2rpx solid #d8d6d7;
  1748 +}
  1749 +.xc-ensure{
  1750 + width: 30%;
  1751 + height: 60rpx;
  1752 + line-height: 60rpx;
  1753 +}
  1754 +xc-ensure-div{
  1755 + width: 100%;
  1756 + height: 60rpx;
  1757 +}
  1758 +.xc-ensure .word{
  1759 + font-size: 25rpx;
  1760 + color: #d30025;
  1761 + margin-left:9rpx;
  1762 +
  1763 +}
  1764 +.xc-ensure .img{
  1765 + width: 25rpx;
  1766 + height: 25rpx;
  1767 + margin-top:18rpx;
  1768 +
  1769 +}
  1770 +
  1771 +.xc-bottmon{
  1772 + width: 100%;
  1773 +}
  1774 +.xc-bottmon .xc-left{
  1775 + width: 55%;
  1776 + margin-top:30rpx;
  1777 + padding-left:20rpx;
  1778 +
  1779 +}
  1780 +.xc-left .xc-top{
  1781 + font-size: 25rpx;
  1782 + height:40rpx;
  1783 + line-height:40rpx;
  1784 + color:#000;
  1785 +}
  1786 +.xc-left .xc-middle{
  1787 + font-size: 25rpx;
  1788 + color: #b2b2b2;
  1789 + height:30rpx;
  1790 + line-height:30rpx;
  1791 +}
  1792 +.xc-left .xc-buttem{
  1793 + font-size: 25rpx;
  1794 + height:100rpx;
  1795 + line-height:100rpx;
  1796 + color:#000;
  1797 +}
  1798 +.xc-ensure-right{
  1799 + width: 30%;
  1800 +}
  1801 +.xc-qrcode{
  1802 + width:120rpx;
  1803 + height: 120rpx;
  1804 + margin-top:43rpx;
  1805 + margin-left:80rpx;
  1806 +
  1807 +}
  1808 +.xc-close{
  1809 + width:50rpx;
  1810 + height:50rpx;
  1811 + border-radius:50%;
  1812 + border:3rpx solid #fff;
  1813 + text-align:center;
  1814 + line-height: 41rpx;
  1815 + font-size:50rpx;
  1816 + color:#fff;
  1817 + font-weight: lighter;
  1818 + font-family:MingLiU;
  1819 + transform:rotate(270deg);
  1820 + overflow:auto;
  1821 + margin-top:6rpx;
  1822 + margin-bottom:1rpx;
  1823 +
  1824 +}
  1825 +.xc-close-frame{
  1826 + position:absolute;
  1827 + margin-top:30rpx;
  1828 + width:90%;
  1829 + display:flex;
  1830 + justify-content:center;
  1831 + overflow: auto;
  1832 +
  1833 +}
  1834 +.xc-guanbi{
  1835 + width: 100%;
  1836 + height: 80rpx;
  1837 + overflow: hidden;
  1838 +}
  1839 +
  1840 +
  1841 +/* 自定义弹出窗口 */
  1842 +.cx-popup{
  1843 + width:100%;
  1844 + background: #fff;
  1845 + z-index: 35;
  1846 + border-top-left-radius: 10rpx;
  1847 + border-top-right-radius: 10rpx;
  1848 + position:fixed;
  1849 + bottom:0;
  1850 +}
  1851 +
  1852 +.xc-top-content{
  1853 + width: 88%;
  1854 + height:85rpx;
  1855 + padding-top: 50rpx;
  1856 + font-size: 36rpx;
  1857 +}
  1858 +
  1859 +
  1860 +.xc-valid-coupon{
  1861 + width: 90%;
  1862 + height:40rpx;
  1863 + padding-top: 24rpx;
  1864 + overflow: hidden;
  1865 +}
  1866 +.xc-frame {
  1867 + /* width: 100%;
  1868 + margin-top:20rpx; */
  1869 + padding: 20rpx;
  1870 +}
  1871 +
  1872 +.xc-frame .list-frame{
  1873 + width: 90%;
  1874 + height: 100%;
  1875 + overflow-y:scroll;
  1876 +
  1877 + margin-top:20rpx;
  1878 +
  1879 +}
  1880 +.xc-close-frame{
  1881 + margin-top:30rpx;
  1882 + width:15%;
  1883 + display:flex;
  1884 +}
  1885 +
  1886 +.xc-close{
  1887 + width:70rpx;
  1888 + height:70rpx;
  1889 + border-radius:50%;
  1890 + border:5rpx solid #a5a5a7;
  1891 + text-align:center;
  1892 + line-height: 55rpx;
  1893 + font-size:80rpx;
  1894 + color:#a5a5a7;
  1895 + font-family:"微软正黑体";
  1896 + margin-top:8rpx;
  1897 +
  1898 +}
  1899 +.xc-money{
  1900 + color: #ff0013;
  1901 +}
  1902 +
  1903 +.xc-money-frame{
  1904 + /* margin-left:35rpx; */
  1905 +
  1906 +}
  1907 +.xc-coupon-effect{
  1908 + width: 99%;
  1909 + height: 128rpx;
  1910 + border-bottom:3rpx solid #ddd;
  1911 +
  1912 +
  1913 +}
  1914 +.xc-goods-coupon{
  1915 + width: 80%;
  1916 + height:100%;
  1917 +
  1918 +}
  1919 +.xc-title{
  1920 + width:50%;
  1921 + margin-left:222rpx;
  1922 +
  1923 +}
  1924 +.xc-coupon-money{
  1925 + color: #c91e31;
  1926 + font-size: 35rpx;
  1927 + margin-top:20rpx;
  1928 +
  1929 +}
  1930 +.xc-coupon-time{
  1931 + height: 50rpx;
  1932 + font-size: 27rpx;
  1933 + color: #a4a4a4;
  1934 +}
  1935 +.xc-coupon-time .time{
  1936 + margin-left: 15rpx;
  1937 + font-size: 27rpx;
  1938 +}
  1939 +.xc-coupon-selection{
  1940 + width:99%;
  1941 + height:100%;
  1942 +
  1943 +
  1944 +}
  1945 +.xc-confirm {
  1946 + width: 90%;
  1947 + height: 75rpx;
  1948 + margin:0 auto;
  1949 + background:#c41830;
  1950 + color:#fff;
  1951 + border-radius:10rpx;
  1952 + font-size:30rpx;
  1953 + margin-top: 50rpx;
  1954 +}
  1955 +.xc-not-Selection{
  1956 + width: 60rpx;
  1957 + height: 60rpx;
  1958 + background: #eeeeee;
  1959 +}
  1960 +
  1961 +/*---------------视频图片---------------*/
  1962 +.xc-imageCount {
  1963 + width:95rpx;
  1964 + height:50rpx;
  1965 + background-color: rgba(0, 0, 0, 0.3);
  1966 + border-radius:40rpx;
  1967 + line-height:50rpx;
  1968 + color:#fff;
  1969 + text-align:center;
  1970 + font-size:26rpx;
  1971 + position:absolute;
  1972 +
  1973 + right:23rpx;
  1974 + bottom:21rpx;
  1975 +}
  1976 +
  1977 +
  1978 +/* 视频图片的边框 */
  1979 +.xc-videos-picture{
  1980 + width: 100%;
  1981 + height: 750rpx;
  1982 +}
  1983 +/* 视频 */
  1984 +.xc-videos{
  1985 + width: 100%;
  1986 + height:544rpx;
  1987 +
  1988 +
  1989 +}
  1990 +/* 点击视频或图片 */
  1991 +.xc-video-picture{
  1992 +
  1993 + bottom: 20rpx;
  1994 + left: 0rpx;
  1995 + display: flex;
  1996 + align-items: center;
  1997 + justify-content:center;
  1998 + width: 45%;
  1999 + height: 60rpx;
  2000 + margin-left: 215rpx;
  2001 +
  2002 +}
  2003 +.xc-video-button:before{
  2004 + content: "";
  2005 + position: absolute;
  2006 + left: 48%;
  2007 + top: 40%;
  2008 + width: 0;
  2009 + height: 0;
  2010 + margin-left: -36rpx;
  2011 + margin-top: -10rpx;
  2012 + border-width:13rpx;
  2013 + border-style: dashed;
  2014 + border-color: transparent transparent transparent #fff;
  2015 + font-size: 0;
  2016 + line-height: 0;
  2017 + z-index: 2;
  2018 + -webkit-backface-visibility: hidden;
  2019 +}
  2020 +.xc-video-buttons:before{
  2021 + content: "";
  2022 + position: absolute;
  2023 + left: 50%;
  2024 + top:41%;
  2025 + width: 0;
  2026 + height: 0;
  2027 + margin-left: -36rpx;
  2028 + margin-top: -10rpx;
  2029 + border-width:13rpx;
  2030 + border-style: dashed;
  2031 + border-color: transparent transparent transparent #000;
  2032 + font-size: 0;
  2033 + line-height: 0;
  2034 + z-index: 2;
  2035 + -webkit-backface-visibility: hidden;
  2036 +}
  2037 +
  2038 +.xc-video{
  2039 + /* width:100rpx; */
  2040 + /* height: 50rpx;
  2041 + line-height: 50rpx; */
  2042 + text-align: center;
  2043 + /* margin-left:-30rpx; */
  2044 +
  2045 +
  2046 +}
  2047 +/* 图片 */
  2048 +.xc-picture{
  2049 + color: #000;
  2050 + background: #dcdcdc;
  2051 + width: 94rpx;
  2052 + height: 45rpx;
  2053 + font-size: 25rpx;
  2054 + border-radius: 25rpx;
  2055 + font-family: 'SimHei',Arial;
  2056 + text-align: center;
  2057 + line-height: 45rpx;
  2058 + margin-left:53rpx
  2059 +
  2060 +}
  2061 +/* 点击视频 */
  2062 +.xc-video-button{
  2063 + position: relative;
  2064 + color: #000;
  2065 + background: #dcdcdc;
  2066 + width: 85rpx;
  2067 + height: 45rpx;
  2068 + line-height: 45rpx;
  2069 + font-size: 30rpx;
  2070 + border-radius: 25rpx;
  2071 + font-family: 'SimHei',Arial;
  2072 + padding-left: 11rpx;
  2073 +}
  2074 +
  2075 +
  2076 +.xc-sn{
  2077 + color: #fff;
  2078 + background: #c7161e;
  2079 + border-color: transparent transparent transparent #fff;
  2080 +}
  2081 +/* 图片 */
  2082 +.xc-pictures{
  2083 + width: 100%;
  2084 + height:529rpx;
  2085 +
  2086 +}
  2087 +/*视频封面的图片 */
  2088 +.xc-picturess{
  2089 + position: relative;
  2090 + width: 100%;
  2091 + height:529rpx;
  2092 +}
  2093 +/* 播放 */
  2094 +.xc-play{
  2095 + width: 130rpx;
  2096 + height: 130rpx;
  2097 + position: absolute;
  2098 + top:207rpx;
  2099 + left:309rpx;
  2100 +}
  2101 +
  2102 +.xc-video-buttons{
  2103 + position: relative;
  2104 + color: #000;
  2105 + background: #dcdcdc;
  2106 + width: 85rpx;
  2107 + height: 45rpx;
  2108 + line-height: 45rpx;
  2109 + font-size: 30rpx;
  2110 + border-radius: 25rpx;
  2111 + font-family: 'SimHei',Arial;
  2112 + padding-left: 11rpx;
  2113 +}
  2114 +
  2115 +
  2116 +.wsize{font-size: 32rpx}
  2117 +.five-level-word{font-size: 24rpx;}
  2118 +
  2119 +
  2120 +/*-- 推荐商品 --*/
  2121 +.xc-goods{
  2122 + height: auto;
  2123 + background: #f2f2f2;
  2124 + padding: 0 20rpx;
  2125 + margin-top: -25rpx;
  2126 + padding-bottom: 20rpx
  2127 +}
  2128 +
  2129 +.xc-goods-recommend {
  2130 + border-radius: 20rpx;
  2131 + width:345rpx;
  2132 + height: 450rpx;
  2133 + margin-top: 25rpx;
  2134 + display: inline-block;
  2135 +
  2136 +}
  2137 +
  2138 +.xc-goods-recommend.ml{ margin-left: 22rpx}
  2139 +
  2140 +.xc-goods-recommend .xc-goods-imgs{
  2141 + width: 100%;
  2142 + height: 325rpx;
  2143 + border-radius:20rpx 20rpx 0 0;
  2144 +}
  2145 +
  2146 +.xc-goods-bottom{
  2147 + width: 345rpx;
  2148 + height: 134rpx;
  2149 + background: #fff;
  2150 + border-radius:0 0 20rpx 20rpx;
  2151 + bottom:-8rpx;
  2152 + left:0rpx;
  2153 +}
  2154 +.xc-goods-bottom .monry-frame{
  2155 + width:283rpx;
  2156 +height:52rpx;
  2157 +padding-left:24rpx;
  2158 +
  2159 +}
  2160 +.xc-good-explain{
  2161 + width: 283rpx;
  2162 + height:60rpx;
  2163 + word-break: normal;
  2164 + margin-left:30rpx;
  2165 + font-size: 26rpx;
  2166 + line-height: 30rpx;
  2167 + margin-top: 5rpx;
  2168 +}
  2169 +.money-color-val{
  2170 + color: #c6172f;
  2171 +}
  2172 +.rmb-symbol{
  2173 + line-height:81rpx;
  2174 + height:53rpx;
  2175 + font-size: 28rpx;
  2176 +}
  2177 +.xc-original-price{
  2178 + color: #c0c0c0;
  2179 +}
  2180 +/* 文字中间加线条 */
  2181 +.word-lines{
  2182 + text-decoration:line-through;
  2183 + line-height:90rpx;
  2184 + margin-left:10rpx;
  2185 + font-size: 20rpx;
  2186 +}
  2187 +
  2188 + .xc-linellae-frame{
  2189 + width: 100%;
  2190 + height: 70rpx;
  2191 + background: #f2f2f2;
  2192 +}
  2193 +.xc-linellae-frame .xc-linellae{
  2194 + width: 386rpx;
  2195 + height: 1rpx;
  2196 + border-bottom: 1rpx solid #ebedf0;
  2197 +}
  2198 +.xc-recommend-frame{
  2199 +background:#f2f2f2;
  2200 +width:97rpx;
  2201 +height:100%;
  2202 +padding-left: 10rpx;
  2203 +}
  2204 +.xc-recommend-frame .xc-recommend{
  2205 + width: 35rpx;
  2206 + height: 27rpx;
  2207 +}
  2208 +.xc-recommend-frame .xc-recommend-word{
  2209 + width:58rpx;
  2210 +font-size:24rpx;
  2211 +color: #a9a9a9;
  2212 +margin-left: 5rpx;
  2213 +margin-bottom: 5rpx;
  2214 +margin-top: 1rpx;
  2215 +
  2216 +}
  2217 +.xc-price-frame{
  2218 + color: #ec0022;
  2219 + align-items: baseline;
  2220 +/* height:44rpx; */
  2221 +}
  2222 +.xc-price-frame .sign{
  2223 +margin-top:19rpx;
  2224 +margin-left:-4px;
  2225 +}
  2226 +.xc-val-price{
  2227 +margin-left:24rpx;
  2228 +color: #ec0022;
  2229 +padding-top:13rpx;
  2230 +}
  2231 +.xc-val-price .save{
  2232 + border-radius:10rpx;
  2233 + margin-top:5rpx;
  2234 + background:#fed2d9;
  2235 + min-width:230rpx;
  2236 + height:40rpx;
  2237 + line-height:40rpx;
  2238 + width: auto;
  2239 + padding-left:12rpx;
  2240 + padding-right:12rpx;
  2241 +
  2242 +}
  2243 +.xc-unit-price{
  2244 + margin-top:25rpx;
  2245 +padding-left:-4rpx;
  2246 +
  2247 +}
  2248 +.xc-explain{
  2249 + color:#292929;
  2250 + width:542rpx;
  2251 + margin: 10rpx 0 20rpx;
  2252 + width: 100%;
  2253 + font-weight: bold;
  2254 +}
  2255 +.xc-item{width: 16%; font-size: 26rpx; color: #666;margin-right:5rpx;}
  2256 +.xc-item .yuan{
  2257 + width: 38rpx;
  2258 + height: 38rpx;
  2259 + line-height: 38rpx;
  2260 + border:1rpx solid #f3f1f2;
  2261 +margin-left:33rpx;
  2262 +
  2263 +}
  2264 +.xc-item .word{
  2265 + width:104rpx;
  2266 + margin-top:16rpx;
  2267 + color:#363636;
  2268 + font-weight:600;
  2269 +
  2270 +}
  2271 +.xc-item .circle-color{
  2272 + background: #d60024;
  2273 + color: #fff;
  2274 +}
  2275 +.xc-item .circle-color1{
  2276 + background: #fefefe;
  2277 + color: #666666;
  2278 +}
  2279 +.link{
  2280 +height:6rpx;
  2281 +width:180rpx;
  2282 +top:54rpx;
  2283 +left:32px;
  2284 +}
  2285 +.link1{
  2286 +height:6rpx;
  2287 +width:166rpx;
  2288 +top:54rpx;
  2289 +left:264rpx;
  2290 +}
  2291 +.link2{
  2292 + height:6rpx;
  2293 +width:157rpx;
  2294 +top:54rpx;
  2295 +right:87rpx;
  2296 +}
  2297 +.link-color-red{
  2298 + background: #d60024;}
  2299 +.link-color{
  2300 + background: #e5e5e5;
  2301 +}
  2302 +.xc-qt-price{
  2303 + top:-15rpx;
  2304 +left:25rpx;
  2305 + color: #fff;
  2306 +}
  2307 +.xc-qt-price .xc-qtunit-price{
  2308 + margin-left:6rpx;
  2309 +margin-top:-4rpx;
  2310 +}
  2311 +.xc-nanber{
  2312 + top:-25rpx;
  2313 +left:289rpx;
  2314 +
  2315 +}
  2316 +.xc-qtsign{
  2317 +margin-top:5rpx;
  2318 +
  2319 +}
  2320 +.xc-people-img{
  2321 + height: 36rpx;
  2322 + width: 36rpx;
  2323 + background: #fff;
  2324 + border-radius: 7rpx;
  2325 +
  2326 +}
  2327 +.xc-people-img .imgs{
  2328 + width: 28rpx;
  2329 + height: 28rpx;
  2330 + margin-top:4rpx;
  2331 +
  2332 +}
  2333 +.xc-people-val{
  2334 +
  2335 + height: 32rpx;
  2336 + border-top: 1rpx solid #fff;
  2337 + border-bottom: 1rpx solid #fff;
  2338 + border-right: 1rpx solid #fff;
  2339 + border-radius:0 7rpx 7rpx 0;
  2340 + line-height:32rpx;
  2341 + margin-left:-6rpx;
  2342 + padding: 0 12rpx;
  2343 +}
  2344 +.word-color{
  2345 + color:#d70024;
  2346 +}
  2347 +.word-color-lan{
  2348 + color:#0393e1;
  2349 +}
  2350 +.pt_view .hy-stop{
  2351 + top: -23rpx;
  2352 + right: 56rpx;
  2353 +}
  2354 +.xc-time-val{width:36rpx;height:36rpx;border-radius:7rpx; line-height: 36rpx;}
  2355 +.xc-time{margin-right:10rpx; margin-left:10rpx; margin-top:-32rpx;
  2356 +}
  2357 +.xc-goods-explain{
  2358 + width:100%;
  2359 + /* padding-left:30rpx;
  2360 + margin-left:-9rpx;
  2361 + height: 150rpx */
  2362 +}
  2363 +.xc-partner-frame{
  2364 +border-bottom:2rpx solid #eee;
  2365 +width:100%;
  2366 +padding:20rpx;
  2367 +/* height:56rpx; */
  2368 +box-sizing: border-box;
  2369 +}
  2370 +.xc-person-number{
  2371 + width:120rpx;
  2372 + color: #999999;
  2373 + padding-left:8rpx;
  2374 + text-align: left
  2375 +}
  2376 +
  2377 +.xc-miaosha-time{
  2378 +right:17rpx; top:55rpx;
  2379 +}
  2380 +.pd_top1{padding-top: 10rpx}
  2381 +.s_ms_bth{margin-top: 85rpx}
  2382 +
  2383 +
  2384 +.no_pj_list{text-align: center; width: 100%; color: #999; margin: 30rpx 0; display: inline-block; font-size: 28rpx}
  2385 +/* 门店地址 */
  2386 +.xc-address_frame{
  2387 + /* border-top:1rpx solid #eee; */
  2388 + width: 100%;
  2389 + height: auto;
  2390 + padding: 20rpx;
  2391 + box-sizing: border-box;
  2392 +}
  2393 +.on_height{
  2394 +height: 90rpx;
  2395 +}
  2396 +.sn_height{
  2397 + /* min-height: 170rpx; height: auto;padding: 10rpx 0; */
  2398 +}
  2399 +.xc-address_frame .address_frame{
  2400 + width: 100%;
  2401 +/* padding-left: 10rpx;
  2402 +margin: auto; */
  2403 +
  2404 +}
  2405 +.shop_name{
  2406 +
  2407 +}
  2408 +.stores-img{
  2409 + width: 28rpx;
  2410 + height: 28rpx;
  2411 + margin-right: 10rpx;
  2412 +}
  2413 +.shop_name{
  2414 + margin-right: 10rpx;
  2415 +}
  2416 +.address{
  2417 + /* width: 100%;
  2418 + margin-top: 5rpx;
  2419 + margin-bottom: 5rpx; */
  2420 +}
  2421 +.distance{
  2422 + padding-left: 20rpx;
  2423 + padding-right: 20rpx;
  2424 + background: #eee;
  2425 + border-radius: 20rpx;
  2426 + /* margin-right: 5rpx; */
  2427 + color: #999;
  2428 + height: 38rpx;
  2429 +line-height: 38rpx;
  2430 +
  2431 +}
  2432 +/* 选择门店的弹窗 */
  2433 +.mongolia-layer{
  2434 + position: fixed;
  2435 +left: 0;
  2436 +top: 0;
  2437 +right: 0;
  2438 +bottom: 0;
  2439 +z-index: 11;
  2440 +background: rgba(0,0,0,0.4);
  2441 +width: 100%;
  2442 +height: 91.9%;
  2443 +
  2444 +}
  2445 +
  2446 +.popup-frame{
  2447 +position: fixed;
  2448 +z-index: 20;
  2449 +background: white;
  2450 +width: 100%;
  2451 +border-radius: 20rpx 20rpx 0 0;
  2452 +height: auto;
  2453 +bottom: 0;
  2454 +}
  2455 +.popup-top{
  2456 + border-bottom: 1rpx solid #eee;
  2457 + height: 155rpx;
  2458 + width: 95%;
  2459 + margin: auto;
  2460 + line-height: 155rpx;
  2461 +
  2462 +}
  2463 +.bg_rights{
  2464 + border-top: 2rpx solid ;
  2465 + border-right: 2rpx solid ;
  2466 + transform: rotate(45deg);
  2467 + display:inline-block;
  2468 + width:15rpx;height:15rpx;
  2469 + border-color:#da0b31;
  2470 +}
  2471 +.modal-closes {
  2472 + position: absolute;
  2473 + right: 30rpx;
  2474 + top: -15rpx;
  2475 + height: 25rpx;
  2476 +
  2477 +}
  2478 +.choose_more{
  2479 + margin-top: 40rpx;
  2480 + margin-right: 20rpx;
  2481 +
  2482 +}
  2483 +.choose_mores{
  2484 + margin-top: 30rpx;
  2485 + margin-right: 15rpx;
  2486 +
  2487 +}
  2488 +.store-list{
  2489 + width: 95%;
  2490 + min-height: 300rpx;
  2491 + overflow-y: scroll;
  2492 + margin: auto;
  2493 + max-height: 610rpx;
  2494 +}
  2495 +.store-list .store_choose{
  2496 + width: 100%;
  2497 + height: 120rpx;
  2498 + line-height: 125rpx;
  2499 + border-bottom: 1rpx solid #eee;
  2500 +
  2501 +}
  2502 +.store-list .store_choose .store{
  2503 +width: 100%;
  2504 +margin: auto;
  2505 +line-height: 37rpx;
  2506 +padding-left: 20rpx;
  2507 +
  2508 +}
  2509 +.xc-hook{
  2510 + width: 35rpx;
  2511 + height: 35rpx;
  2512 + transform: rotate(-145deg);
  2513 +line-height: 37rpx;
  2514 +text-align: center;
  2515 +}
  2516 + .xc-hooks{
  2517 + width: 30rpx;
  2518 + height: 30rpx;
  2519 + border: 1rpx solid #999;
  2520 + }
  2521 + .address-frame{
  2522 + width: 93%;
  2523 +margin-left: 7rpx;
  2524 +
  2525 + }
  2526 + .nearby_store{
  2527 +margin-left: 17rpx;
  2528 + }
  2529 + .address_name{
  2530 + margin-right: 10rpx;
  2531 +
  2532 + }
  2533 + .address-val{
  2534 + height: 38rpx;
  2535 +line-height: 38rpx;
  2536 +
  2537 + }
  2538 + .store-bottom{
  2539 + width: 85%;
  2540 + margin: auto;
  2541 + height: 90rpx;
  2542 + }
  2543 + .determine{
  2544 + width: 260rpx;
  2545 + height: 55rpx;
  2546 + border-radius: 50rpx;
  2547 + line-height: 55rpx;
  2548 + }
  2549 + .default{
  2550 + width: 260rpx;
  2551 + height: 55rpx;
  2552 + border:3rpx solid #c8c8c8;
  2553 + border-radius: 50rpx;
  2554 + line-height: 55rpx;
  2555 + }
  2556 + .store-bottom-frame{
  2557 + width: 95%;
  2558 + margin: auto;
  2559 +
  2560 + }
  2561 + /* 门店分类列表 */
  2562 +.sort_store_list{
  2563 + height: 82%;
  2564 + overflow: hidden;
  2565 + overflow-y: scroll;
  2566 + width: 95%;
  2567 + margin: auto;
  2568 +}
  2569 +.sort_store_list .sort-store-frame{
  2570 + width: 100%;
  2571 +height: 100rpx;
  2572 +line-height:100rpx;
  2573 +border-bottom: 1rpx solid #eee;
  2574 +
  2575 +}
  2576 +.sort_store_list .sort-store-frame .sort-store{
  2577 + width: 94.5%;
  2578 + margin: auto;
  2579 +}
  2580 +.black_rights-frame{
  2581 +width: 50%;
  2582 +}
  2583 +.black_rights-frame .black_rights{
  2584 + border-top: 3rpx solid;
  2585 +border-right: 3rpx solid;
  2586 +transform: rotate(45deg);
  2587 +display: inline-block;
  2588 +width: 20rpx;
  2589 +height: 20rpx;
  2590 +}
  2591 +.xc-val-money{
  2592 + height:55rpx;
  2593 +}
  2594 +
  2595 +.xc-distance-bottom{
  2596 + margin-bottom: 40rpx;
  2597 +}
  2598 +.xc-distance-top{
  2599 +margin-top: 10rpx;
  2600 +}
  2601 +.xc-width{
  2602 + width: 100%;
  2603 +}
  2604 +.right-arrow{ width: 15rpx; height:15rpx;
  2605 + border-top: 2rpx solid #d70026;
  2606 + border-right: 2rpx solid #d70026;
  2607 + transform: rotate(45deg);display:inline-block;
  2608 + margin-bottom:3rpx;
  2609 +}
  2610 +.xc-goods-attribute{
  2611 + border-bottom: 1px solid #eee;
  2612 +padding-bottom: 20rpx;
  2613 +/* margin-bottom:40rpx; */
  2614 +}
  2615 +.xc-val-fream{
  2616 + width: 105rpx;
  2617 +}
  2618 +.is_stock{
  2619 +width: 58%;
  2620 +height: 70rpx;
  2621 +border-radius: 55rpx;
  2622 +}
  2623 +.select_store_height{
  2624 + height: 50rpx;
  2625 +}
  2626 +.butttem5{
  2627 + margin-bottom: 5rpx;
  2628 +}
  2629 +
  2630 +.no_pj_list{text-align: center; width: 100%; color: #999; margin-top: 30rpx; display: inline-block; font-size: 28rpx}
  2631 +
  2632 +
  2633 +.join-cart>view.no_store {
  2634 + width: 58%; background-color: #adadad;
  2635 +}
  2636 +
  2637 +.s_btn{ margin-top: 25rpx; }
  2638 +/* 美妆价的样式 */
  2639 +.beauty-makeup-frame{
  2640 + /* width: 101.5%;
  2641 + margin: auto; */
  2642 + height: 120rpx;
  2643 + border-radius: 15rpx;
  2644 + margin-top: 10px;
  2645 +
  2646 +}
  2647 +.beauty-makeup-frame .left{
  2648 + width: 80%;
  2649 + height: 100%;
  2650 + background:#f7f7f7;
  2651 + border-radius: 20rpx 0rpx 0rpx 20rpx;
  2652 + /* padding: 0 10rpx; */
  2653 +}
  2654 + .card-frame{
  2655 + margin-top: 0rpx;
  2656 + /* padding-right: 23rpx;
  2657 + margin-right: 15rpx; */
  2658 +}
  2659 +.advert-card{
  2660 + margin-top: 0rpx!important;
  2661 +
  2662 +}
  2663 +.beauty-makeup-frame .right{
  2664 + width: 20%;
  2665 + height: 100%;
  2666 + background:#f3efe3;
  2667 + border-radius: 0rpx 20rpx 20rpx 0rpx;
  2668 + }
  2669 +.grade-card-frame{
  2670 +
  2671 + /* height:45rpx ; */
  2672 + background: #3c300a;
  2673 + border-radius: 20rpx;
  2674 + /* margin-top: 10px;
  2675 + margin-left: 7rpx; */
  2676 + justify-content: center;
  2677 + padding: 4rpx 12rpx;
  2678 +}
  2679 +.grade-card-frame .img{
  2680 + width: 24rpx;
  2681 + height: 24rpx;
  2682 + margin-top: 2px;
  2683 +
  2684 +}
  2685 +.grade-card-frame .card-name{
  2686 + margin-left: 8rpx;
  2687 + /* max-width: 120rpx; */
  2688 + max-width: 165rpx;
  2689 +}
  2690 +.card-effect{
  2691 + /* margin-left: 15rpx; */
  2692 +}
  2693 +.at_once_carde{
  2694 + width:65rpx;
  2695 + height: 75rpx;
  2696 + line-height:38rpx;
  2697 +}
  2698 +.bg_right{ width: 18rpx; height:18rpx;
  2699 + border-top: 2rpx solid #333;
  2700 + border-right: 2rpx solid #333;
  2701 + transform: rotate(45deg);display:inline-block;
  2702 + margin-bottom:3rpx;
  2703 +
  2704 +}
  2705 +.carde_frame{
  2706 + height: 50rpx;
  2707 + line-height: 18rpx
  2708 +}
  2709 +
  2710 +button.custom-service { line-height: normal; border: 0;}
  2711 +button.custom-service::after{
  2712 + border: 0;
  2713 +}
  2714 +.no_store{color:#d60021; font-size: 26rpx;}
  2715 +.cx_show_view{ width: 580rpx; /* line-height: 30rpx; margin-bottom: 6rpx; */ }
  2716 +.cx_show_view .word{ width: 400rpx}
  2717 +.prom_condition {
  2718 + color: #d60021;
  2719 + /* width: 180rpx; */
  2720 + /* height: 30rpx; */
  2721 + font-size: 20rpx;
  2722 + /* padding-top: 0.01rpx; */
  2723 + /* display: flex;
  2724 + justify-content: center;
  2725 + align-items: center; */
  2726 + border: 2rpx solid #d60021;
  2727 + border-radius: 10rpx;
  2728 + margin-right:10rpx ;
  2729 + /* margin-left: 10rpx; */
  2730 + font-size: 24rpx;
  2731 + padding: 0 10rpx;
  2732 +}
  2733 +.hui_img{ width: 44rpx; height: 44rpx; margin-right: 8rpx}
  2734 +.order_hui{color: #444; width: 420rpx}
  2735 +.order_hui view{ height: 34rpx; line-height: 34rpx;}
  2736 +.dp_img{width: 240rpx; height: 240rpx; margin: 0 40rpx}
  2737 +.dp_cx_view{border-bottom: 0.02rpx solid #eee; padding-bottom: 40rpx}
  2738 +.act_content{ margin-top: 40rpx}
  2739 +.act_content view{ margin-bottom: 12rpx}
  2740 +.color_b{color: #ff9c00}
  2741 +
  2742 +.poster-container {
  2743 + box-sizing: border-box;
  2744 + position: fixed;
  2745 + top: 50%;
  2746 + left: 50%;
  2747 + transform: translate(-50%, -50%);
  2748 + width: calc(100% - 120rpx);
  2749 + z-index: 1000;
  2750 +}
  2751 +.mask {
  2752 + position: fixed;
  2753 + top: 0;
  2754 + left: 0;
  2755 + width: 100%;
  2756 + height: 100%;
  2757 + z-index: 999;
  2758 + background-color: rgba(0,0,0,.4);
  2759 +}
  2760 +.poster-wrapper {
  2761 + width: 100%;
  2762 +}
  2763 +
  2764 +.poster {
  2765 + box-sizing: border-box;
  2766 + width: 100%;
  2767 + height: 1055rpx;
  2768 + border-radius: 20rpx;
  2769 + /* box-shadow: 0 8px 12px #666; */
  2770 + position: relative;
  2771 + z-index: 999;
  2772 + overflow: hidden;
  2773 +}
  2774 +.poster-img {
  2775 + display: block;
  2776 + width: 100%;
  2777 + height: 100%;
  2778 +}
  2779 +.btn-container {
  2780 + display: flex;
  2781 + justify-content: space-around;
  2782 +}
  2783 +.btn-share {
  2784 + display: block;
  2785 + background-color: #FE6867;
  2786 + color: white;
  2787 + border-radius: 8rpx;
  2788 + line-height: 80rpx;
  2789 + margin-top: 28rpx;
  2790 + padding: 0 60rpx;
  2791 +}
  2792 +/* .btn-close {
  2793 + background-color: rgba(0,0,0,.5);
  2794 + color: white;
  2795 + width: 40rpx;
  2796 + height: 40rpx;
  2797 + line-height: 40rpx;
  2798 + text-align: center;
  2799 + border-radius: 50%;
  2800 + position: absolute;
  2801 + right: 20rpx;
  2802 + top: 10rpx;
  2803 +} */
  2804 +
  2805 +.goods-price .rel_txt{
  2806 + /* position: relative; top: 32rpx; */
  2807 + font-size: 30rpx;
  2808 +}
  2809 +.goods-price .rel_img{width: 62rpx; height: 62rpx;position: relative; top: 8rpx;}
  2810 +
  2811 +.btn-close {
  2812 + /* background-color: rgba(0,0,0,.5); */
  2813 + color: #ccc;
  2814 + width: 50rpx;
  2815 + height: 50rpx;
  2816 + line-height: 50rpx;
  2817 + text-align: center;
  2818 + border-radius: 50%;
  2819 + position: absolute;
  2820 + right: 20rpx;
  2821 + top: 20rpx;
  2822 +}
  2823 +
  2824 +.icon-close {
  2825 + font-size: 48rpx;
  2826 +}
  2827 +.quan_price{
  2828 + background-color: #ff4700; color: #fff; padding: 10rpx 25rpx; margin-left: 10rpx; border-radius: 30rpx;
  2829 +}
  2830 +
  2831 +/*--闪白屏--*/
  2832 +.g_img_box{
  2833 + background-position: center center;
  2834 + background-repeat: no-repeat;
  2835 + -webkit-background-size: cover;
  2836 + -moz-background-size: cover;
  2837 + background-size: cover;
  2838 +}
  2839 +
  2840 +
  2841 +
  2842 +.arrow {
  2843 + width: auto !important;
  2844 + position: absolute;
  2845 + right: 0;
  2846 + top: 10rpx;
  2847 +}
  2848 +
  2849 +
  2850 +
  2851 +
  2852 +
  2853 +
  2854 +
  2855 +/* 支付预售定金 */
  2856 +.price-container {
  2857 + top: 50%;
  2858 + padding-left: 40rpx;
  2859 + transform: translateY(-50%);
  2860 + color: white;
  2861 + font-weight: bold;
  2862 +}
  2863 +
  2864 +.rmb {
  2865 + display: relative;
  2866 +}
  2867 +
  2868 +.rmb::before {
  2869 + content: '¥';
  2870 + font-size: 24rpx;
  2871 +}
  2872 +
  2873 +.no-bold {
  2874 + font-weight: normal;
  2875 +}
  2876 +
  2877 +.bg-FF4732 {
  2878 + background-color: #FF4732;
  2879 +}
  2880 +
  2881 +.line {
  2882 + position: relative;
  2883 +}
  2884 +
  2885 +.line::before {
  2886 + position: absolute;
  2887 + left: 0;
  2888 + top: 50%;
  2889 + transform: translateY(-50%);
  2890 + content: '';
  2891 + width: 2rpx;
  2892 + height: 60%;
  2893 + background-color: rgba(255,255,255,.4);
  2894 +}
  2895 +
... ...
packageC/pages/presell/list/g_filter.wxs 0 → 100644
  1 +var g_filters = {
  2 + has_char:function(url,key){
  3 + if(!url) return -1;
  4 + return url.indexOf(key);
  5 + },
  6 + beg_time:function(beg_date){
  7 + var fmt1 = beg_date.substring(0, 19);
  8 + var reg = getRegExp("-", "g");
  9 + var fmt2 = fmt1.replace(reg, '/');
  10 + var t1 = getDate(fmt2);
  11 + var tnow=getDate();
  12 + if(t1<=tnow) return 1;
  13 + return 0;
  14 + },
  15 + end_time:function(end_date){
  16 + var fmt1 = end_date.substring(0, 19);
  17 + var reg = getRegExp("-", "g");
  18 + var fmt2 = fmt1.replace(reg, '/');
  19 + var t1 = getDate(fmt2);
  20 + var tnow=getDate();
  21 + if(t1>=tnow) return 1;
  22 + return 0;
  23 + }
  24 +}
  25 +module.exports = {
  26 + has_char: g_filters.has_char,
  27 + beg_time: g_filters.beg_time,
  28 + end_time: g_filters.end_time,
  29 +}
0 30 \ No newline at end of file
... ...
packageC/pages/presell/list/list.js 0 → 100644
  1 +var e = getApp(), i = e.request, a = e.globalData.setting,os=a,ut = require("../../../../utils/util.js");
  2 +var regeneratorRuntime = require('../../../../utils/runtime.js');
  3 +
  4 +Page({
  5 + data: {
  6 + url: a.imghost,
  7 + killtime: null,
  8 + currentPage: 1,
  9 + goodlist: null,
  10 + type:1,
  11 + timer:null,
  12 + ismore:1, //是否可以加载更多
  13 + isshow:0,
  14 + ad_data:null,
  15 + max_sw_height:200,
  16 + },
  17 +
  18 + //------初始化加载----------
  19 + onLoad: function(t) {
  20 + // wx.setNavigationBarTitle({ title: "商品秒杀",})
  21 + var first_leader = t.first_leader;
  22 + var type=t.type;
  23 + if(type!=undefined){
  24 + this.setData({type:type});
  25 + }
  26 +
  27 + var th=this;
  28 +
  29 + console.log("------------");
  30 + console.log(first_leader);
  31 + getApp().getConfig();
  32 +
  33 + if (first_leader) {
  34 + getApp().globalData.first_leader = first_leader;
  35 + //调用接口判断是不是会员
  36 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  37 + if (res.data.code == 0) {
  38 + getApp().globalData.guide_id = res.data.data.id;
  39 + }
  40 + })
  41 + }
  42 +
  43 + getApp().request.promiseGet("/api/weshop/ad/page?pid=701&store_id=" + os.stoid, {
  44 + data: {
  45 + enabled: 1
  46 + }
  47 + }).then(res => {
  48 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  49 + var a = res.data.data.pageData;
  50 + var narr=[];
  51 + for(var i in a){
  52 + var tt = {
  53 + 'ad_code': os.imghost + a[i].ad_code,
  54 + 'media_link': '',
  55 + 'ad_weapplink':a[i].ad_weapplink
  56 + };
  57 + narr.push(tt);
  58 + }
  59 + th.setData({ad_data:narr});
  60 + }
  61 + })
  62 +
  63 + },
  64 +
  65 +
  66 + onShow: function(t) {
  67 + this.data.ismore=1;
  68 + this.data.is_timer=1;
  69 + this.data.currentPage=1;
  70 + var th=this;th.setData({goodlist:null,})
  71 + this.requestSalelist();
  72 + //设置全局定时器
  73 + th.data.timer=setInterval(function () {
  74 + th.countDown();
  75 + },1000);
  76 + },
  77 + onHide:function(){
  78 + //--清理定时器--
  79 + clearInterval(this.timer);
  80 + this.setData({isshow:0});
  81 + },
  82 + //---小于10的格式化函数----
  83 + timeFormat(param) {
  84 + return param < 10 ? '0' + param : param;
  85 + },
  86 +
  87 + //----倒计时函数-----
  88 + countDown() {
  89 + if(!this.data.is_timer) return false;
  90 + var th=this;
  91 + // 获取当前时间,同时得到活动结束时间数组
  92 + let newTime =ut.gettimestamp();
  93 + var endTimeList = this.data.goodlist;
  94 + if(endTimeList==null) return null
  95 + // 对结束时间进行处理渲染到页面
  96 + for (var i = 0; i < endTimeList.length;i++){
  97 + var o = endTimeList[i];
  98 + var endTime = o.end_time;
  99 + if(th.data.type==0) endTime = o.start_time;
  100 + let obj = null;
  101 + // 如果活动未结束,对时间进行处理
  102 + if (endTime - newTime > 0){
  103 + let time = (endTime - newTime);
  104 + // 获取天、时、分、秒
  105 + let day = parseInt(time / (60 * 60 * 24));
  106 + let hou = parseInt(time % (60 * 60 * 24) / 3600);
  107 + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  108 + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
  109 + obj = {
  110 + day: this.timeFormat(day), hou: this.timeFormat(hou), min: this.timeFormat(min), sec: this.timeFormat(sec), hide: 1
  111 + }
  112 + }else{
  113 + //活动已结束,全部设置为'00'
  114 + obj = { day: '00', hou: '00', min: '00', sec: '00' }
  115 + }
  116 + var txt ="goodlist["+i+"].djs";
  117 + th.setData({ [txt]: obj});
  118 + }
  119 + },
  120 +
  121 + async requestSalelist() {
  122 + //--没有更多就不调用--
  123 + if(!this.data.ismore) return false;
  124 + var e = this,th=e, i = "/api/ms/flash_sale/spikepage?page=" + e.data.currentPage;
  125 + var plist=null,alllist=th.data.goodlist;
  126 + if(!alllist) alllist=[];
  127 +
  128 + await getApp().request.promiseGet(i,
  129 + {isShowLoading:1,data:{store_id:os.stoid,timetype:th.data.type,is_end:0,is_show:1}}
  130 + ).then(res=>{
  131 + plist=res.data.data.pageData;
  132 + console.log("是什么即将开始",plist);
  133 + });
  134 +
  135 + if(plist.length<=0){
  136 +
  137 + getApp().showWarning("没有更多数据");
  138 + th.data.ismore=0;
  139 + if(e.data.currentPage==1 && this.data.type==1){
  140 + setTimeout(function () {
  141 + th.data.ismore=1;
  142 + th.setData({type:0});
  143 + th.requestSalelist();
  144 + },1000);
  145 + }
  146 + return false;
  147 + }
  148 +
  149 + //--循环读取接口---
  150 + for(var i=0;i<plist.length;i++) {
  151 + var prom_id = plist[i].id;
  152 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  153 + os.stoid + "/1/" + prom_id, {}
  154 + ).then(res=>{
  155 + if(res.data.code==0){
  156 + plist[i].status=1;
  157 + if(res.data.data<=0) plist[i].status=3;
  158 + }
  159 + })
  160 + alllist.push(plist[i]);
  161 + }
  162 + e.data.currentPage++;
  163 + console.log("秒杀商品列表", alllist);
  164 + th.setData({goodlist:alllist,isshow:1});
  165 +
  166 + },
  167 + onPullDownRefresh: function() {
  168 + this.reloadGoodList();
  169 + },
  170 + reloadGoodList: function() {
  171 + this.data.goodlist = null, this.data.currentPage = 1, this.requestSalelist();
  172 + },
  173 +
  174 + onReachBottom: function() {
  175 + this.requestSalelist();
  176 + },
  177 +
  178 + //点击tab事件
  179 + tip:function(e){
  180 + var a=e.currentTarget.dataset.ty,th=this;th.data.ismore=1;
  181 + this.setData({type:a,goodlist:null});
  182 + this.reloadGoodList();
  183 + },
  184 +
  185 +
  186 + //---------分享配置--------
  187 + onShareAppMessage: function (e) {
  188 + var curPage=this;
  189 + var pagePath = curPage.route; //当前页面url
  190 + if (pagePath.indexOf('/') != 0) {
  191 + pagePath = '/' + pagePath;
  192 + }
  193 + if(getApp().globalData.user_id){
  194 +
  195 + if(pagePath.indexOf("?")>0){
  196 + pagePath+="&first_leader="+getApp().globalData.user_id;
  197 + }else{
  198 + pagePath+="?first_leader="+getApp().globalData.user_id;
  199 + }
  200 + }
  201 +
  202 + console.log("11"+pagePath);
  203 + return {
  204 + title: "限时秒杀",
  205 + path:pagePath,
  206 + }
  207 + },
  208 +
  209 + //图片失败,默认图片
  210 + bind_bnerr2: function (e) {
  211 + var _errImg = e.target.dataset.errorimg;
  212 + var val = e.target.dataset.val;
  213 + if(val!=undefined && val!=null && val!='null' ){
  214 + var _errObj = {};
  215 + _errObj[_errImg] = "/public/images/default_goods_image_240.gif";
  216 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  217 + }
  218 + },
  219 +
  220 + onShareTimeline() {
  221 + var store_name=getApp().globalData.config?getApp().globalData.config.store_name:'';
  222 + if(!store_name)
  223 + store_name=getApp().globalData.setting.appName;
  224 + return {
  225 + title: '秒杀活动-' + store_name,
  226 + }
  227 + },
  228 +
  229 + imageLoad:function(e){
  230 + var imgwidth = e.detail.width;
  231 + var imgheight = e.detail.height;
  232 + //宽高比
  233 + var ratio = imgwidth / imgheight;
  234 + //计算的高度值
  235 + var viewHeight = 750 / ratio;
  236 + var hei=this.data.max_sw_height;
  237 +
  238 + if (hei< viewHeight) {
  239 + this.setData({ max_sw_height: viewHeight });
  240 + }
  241 + }
  242 +
  243 +});
... ...
packageC/pages/presell/list/list.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "预售活动列表",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "share_box": "/components/share_box/share_box"
  6 + }
  7 +}
0 8 \ No newline at end of file
... ...
packageC/pages/presell/list/list.wxml 0 → 100644
  1 +<wxs module="filters" src="../../../../utils/filter.wxs"></wxs>
  2 +<wxs module="g_filter" src="g_filter.wxs"></wxs>
  3 +<view class=" body_frame">
  4 +
  5 +<block wx:if="{{ad_data}}">
  6 +
  7 + <swiper class="swiper" circular="true" autoplay="true"
  8 + indicator-dots="true" interval="2500"
  9 + style="height:{{max_sw_height}}rpx" >
  10 + <block wx:for="{{ad_data}}">
  11 +
  12 + <navigator url="{{item.ad_weapplink}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(item.ad_weapplink,'plugin')>=0}}">
  13 + <swiper-item>
  14 + <image src="{{item.ad_code}}" style="width: 100%;" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
  15 + </swiper-item>
  16 + </navigator>
  17 +
  18 + <view data-url="{{item.ad_weapplink}}" class="s1_gk_a1" bindtap="go_url" wx:else>
  19 + <swiper-item>
  20 + <image src="{{item.ad_code}}" style="width: 100%;" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
  21 + </swiper-item>
  22 + </view>
  23 +
  24 + </block>
  25 + </swiper>
  26 +
  27 +
  28 +</block>
  29 +<block wx:else>
  30 + <image class="xc-top-img" src="{{url}}/miniapp/images/seckill_top_img.jpg"></image>
  31 +</block>
  32 +
  33 +
  34 +<view class="kill-list seckill_list">
  35 + <view class="kill-item" wx:for="{{goodlist}}" wx:if="{{item.djs.hide}}" >
  36 + <navigator class="kill-pic rel" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">
  37 + <!-- <image class="abs xc-miaosha" src="{{url}}/miniapp/images/zms.png"></image> -->
  38 + <image class="wh100" src="{{url+item.original_img}}" data-val="{{item.original_img}}"
  39 + data-errorimg="goodlist[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"></image>
  40 + </navigator>
  41 + <view class="kill-cont">
  42 + <navigator class="goods-name ellipsis-2" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">{{item.title}}</navigator>
  43 + <view class="flex-vertical xc-strip-frame">
  44 + <view class="xc-strip-blank rel">
  45 +
  46 + <view class="flex-vertical rel total">
  47 + <view class="t-c abs xc-fill"style="width:{{type==1?(100-(item.buy_num+item.virtual) /(item.goods_num+item.virtual)*100)>3?(100-(item.buy_num+item.virtual) /(item.goods_num+item.virtual)*100):'3':'100'}}%;background:{{type==1?'#e4374d':'#059de5'}};">
  48 + </view>
  49 + <text class="fs20 white abs xc-fill-text" style="">已预售{{type==1?filters.toFix(100-(item.buy_num+item.virtual)/(item.goods_num+item.virtual)*100,0):'100'}}%</text>
  50 + </view>
  51 +
  52 + </view>
  53 + <view class=" ml10 fs20 " wx:if="{{type==1}}">库存还剩{{item.buy_num+item.virtual}}件</view>
  54 + <!-- <view class=" ml10 fs20 " wx:else> 已抢0件</view> -->
  55 + </view>
  56 +
  57 +
  58 + <view class="goods-num">
  59 + <view>
  60 + <view class="{{type==1?'xc-wc':'blue_c'}}">
  61 + <!-- <text>剩余:</text>
  62 + <text class='tui-conutdown-box'> {{item.djs.day}}</text>天
  63 + <text class='tui-conutdown-box'>{{item.djs.hou}}</text>时
  64 + <text class='tui-conutdown-box'>{{item.djs.min}}</text>分
  65 + <text class='tui-conutdown-box tui-countdown-bg'>{{item.djs.sec}}</text>秒 -->
  66 + </view>
  67 + <view class="fs40 flex xc-buttom-money {{type==1?'xc-wc':'blue_c'}}" >
  68 + <view class="fs28" style="line-height: 16px;">¥</view>
  69 + <text>{{item.price}}</text>
  70 + <span class="underline fs20">零售价¥{{item.market_price}}</span></view>
  71 +
  72 + </view>
  73 + <view class="kill-btn ">
  74 + <navigator url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">去抢购</navigator>
  75 + <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:if="{{item.status==1 && type==1}}">马上抢</navigator>
  76 + <navigator class="huise"url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:if="{{item.status==3 && type==1}}">已抢光</navigator> -->
  77 + </view>
  78 + </view>
  79 + </view>
  80 + </view>
  81 + <!-- <view style="height:120rpx"></view> -->
  82 +</view>
  83 +<!-- <view class="kill-time xc-seckill-bottom">
  84 + <view class="theader" >
  85 + <view bindtap='tip' data-ty="1" class="xc-border-right flex-center timeac left {{type==1?'active':''}}">
  86 + <image class="xc-bottom"
  87 + src="{{url}}{{type==1?'/miniapp/images/fire-red.png':'/miniapp/images/fire-black.png'}}"></image>
  88 + 火热进行中</view>
  89 + <view bindtap='tip' data-ty="0" class=" flex-center timeac right {{type==0?'active':''}}">
  90 + <image class="xc-bottom"
  91 + src="{{url}}{{type==0?'/miniapp/images/clock-rad.png':'/miniapp/images/clock-black.png'}}"></image>
  92 + 即将开始</view>
  93 + </view>
  94 +</view> -->
  95 +
  96 +
  97 +<view class="no-more" wx:if="{{goodlist.length==0}}">没有相关内容</view>
  98 +</view>
  99 +
  100 +
  101 +
  102 +<!-- <share_box id="share"></share_box> -->
... ...
packageC/pages/presell/list/list.wxss 0 → 100644
  1 + page{
  2 + background: #eee;
  3 + color: #333;
  4 + }
  5 + .body_frame{
  6 + width: 100%;
  7 + height: 100%;
  8 +
  9 + }
  10 +.xc-top-img{
  11 + width: 100%;
  12 + height: 333rpx;
  13 + display: block;
  14 + /* margin-top: 5rpx; */
  15 +}
  16 +.kill-list{
  17 + /* height: 807rpx; */
  18 + /* overflow-y: scroll; */
  19 + padding: 0 20rpx;
  20 +}
  21 +.seckill_list{
  22 +/* margin-top: -10rpx;
  23 +left: 2%; */
  24 +}
  25 +.seckill{
  26 + width: 100%;
  27 +margin: auto;
  28 +
  29 +}
  30 +.kill-time {
  31 + text-align: center;
  32 + justify-content: space-around;
  33 + align-items: center;
  34 + /* height: 101rpx; */
  35 + border-bottom: 1px solid #ddd;
  36 + border-top: 1px solid #ddd;
  37 + background-color: #f6f6f6;
  38 +}
  39 +.kill-time .theader{
  40 + display: flex; margin: 0 auto; align-items: center;
  41 + height: 100rpx;
  42 +
  43 +}
  44 +.kill-time .theader .timeac {
  45 + font-size: 32rpx; height:100%; width: 50%;
  46 + color: #333; background-color: #fff;
  47 +
  48 +}
  49 +/* .kill-time .theader .timeac.left{border-top-left-radius: 86rpx; border-bottom-left-radius: 86rpx;}
  50 +.kill-time .theader .timeac.right{border-top-right-radius: 86rpx; border-bottom-right-radius: 86rpx;} */
  51 +.kill-time .theader .timeac.active{color: #c4182e}
  52 +
  53 +.kill-item {
  54 + display: flex;
  55 + justify-content: space-between;
  56 + background-color: #fff;
  57 + padding: 20rpx;
  58 + /* margin-bottom: 10rpx; */
  59 + border-radius: 10rpx;
  60 + /* height: 249rpx; */
  61 + align-items: center;
  62 + margin-top: 20rpx;
  63 +}
  64 +
  65 +.kill-pic {
  66 + width: 215rpx;
  67 + height: 215rpx;
  68 +}
  69 +
  70 +.kill-pic::before {
  71 + position: absolute;
  72 + content: '预售';
  73 + left: 0;
  74 + top: 0;
  75 + background-color: #e23245;
  76 + color: white;
  77 + font-size: 22rpx;
  78 + padding: 0 10rpx;
  79 + border-radius: 4rpx 4rpx 4rpx 0;
  80 +}
  81 +
  82 +.kill-cont {
  83 + width: 465rpx;
  84 + margin-left:20rpx;
  85 + margin-right: 5rpx;
  86 +}
  87 +
  88 +.goods-name {
  89 + height: 60rpx;
  90 + font-size: 27rpx;
  91 + color: #555;
  92 + line-height: 30rpx;
  93 +
  94 +}
  95 +
  96 +.goods-num {
  97 + padding-top: 30rpx;
  98 + display: flex;
  99 + align-items: center;
  100 + justify-content: space-between;
  101 + line-height: 42rpx;
  102 + font-size: 24rpx;
  103 + color: #999;
  104 +}
  105 +
  106 +.goods-num .co-red {
  107 + font-size: 30rpx;
  108 + font-weight: bold;
  109 +}
  110 +
  111 +.underline {
  112 + text-decoration: line-through;
  113 + color:#999999; font-size: 20rpx;
  114 + margin-left: 10rpx;
  115 + line-height: 30rpx;
  116 +}
  117 +
  118 +.kill-btn {
  119 + text-align: right;
  120 + display: flex;
  121 +height: 100%;
  122 +align-items: flex-end;
  123 +padding-top: 4rpx;
  124 +
  125 +}
  126 +
  127 +.kill-btn>navigator {
  128 + padding: 0 20rpx;
  129 + background: #e23245;
  130 + color: #fff;
  131 + border-radius: 20rpx;
  132 + /* margin-top: 37px; */
  133 +
  134 +}
  135 +
  136 +.kill-btn .gray {
  137 + background-color: #555;
  138 +}
  139 +
  140 +.no-more {
  141 + font-size: 30rpx;
  142 + line-height: 2;
  143 + text-align: center;
  144 + color: #333;
  145 +}
  146 +
  147 +.kill-btn>navigator.huise{background-color: #999;}
  148 +.xc-seckill-bottom{
  149 + position: fixed;
  150 +bottom: 0rpx;
  151 +width: 100%;
  152 +
  153 +}
  154 +.xc-bottom{
  155 + width: 45rpx;
  156 + height: 45rpx;
  157 + margin-right: 13rpx;
  158 +}
  159 +.xc-border-right{
  160 + border-right: 4rpx solid #eee;
  161 +
  162 +}
  163 +.ml10{
  164 +margin-left: 45rpx;
  165 +}
  166 +.total{
  167 + width:215rpx;height:26rpx;border-radius:20rpx;
  168 + background: #ffe3e2;
  169 +}
  170 +.xc-buttom-money{
  171 + align-items: baseline;
  172 +/* padding-top: 43rpx; */
  173 +}
  174 +
  175 +.xc-miaosha{
  176 +width: 68rpx;
  177 +height: 40rpx;
  178 +
  179 +}
  180 +.xc-strip-frame{
  181 + width:440rpx;margin-top: 10rpx;
  182 +}
  183 +.xc-strip-blank{
  184 + width:180rpx;
  185 +height: 26rpx;
  186 +}
  187 +.xc-fill{
  188 +border-radius:20rpx;height:26rpx;
  189 +}
  190 +.xc-fill-text{
  191 + left:34%;
  192 + line-height: 26rpx;
  193 +
  194 +}
0 195 \ No newline at end of file
... ...
pages/index/index/index.wxml
... ... @@ -83,12 +83,6 @@
83 83 <!---导航-->
84 84 <view class="venues_box">
85 85 <view class="venues_list">
86   - <!-- <view class="venues_item">
87   - <navigator url="/pages/activity/group_list/group_list">
88   - <image src="{{url}}/miniapp/images/index/tuangou.png"></image>
89   - <view>团购</view>
90   - </navigator>
91   - </view> -->
92 86 <view class="venues_item">
93 87 <navigator url="/packageA/pages/jfbuy/jfbuy" hover-class="none">
94 88 <image src="{{url}}/miniapp/images/index/jifen.png"></image>
... ... @@ -184,6 +178,48 @@
184 178 </view> -->
185 179 </view>
186 180 </view>
  181 +
  182 +
  183 + <!--预售-->
  184 + <view class="seckill" wx:if="{{saleGoods!=null && pindGoods.length!=0 }}">
  185 + <navigator url="/packageC/pages/presell/list/list" hover-class="none">
  186 + <view class="seckill-time">
  187 + <view class="classname flex ai_c">
  188 + <i class="iconfont icon-presell"></i>
  189 + <text class="bold fs30">惊喜预售</text>
  190 + </view>
  191 + <view class="flex ai_c seckill-list">
  192 + <text class="fs24 xc-marfin-right">查看全部</text>
  193 + <image class="arrow-right" src="{{url}}/miniapp/images/icon-arrowdown.png"></image>
  194 + </view>
  195 + </view>
  196 + </navigator>
  197 + <view class="seckill-list">
  198 + <swiper class="s_prom" indicator-dots="{{false}}" bindchange="flashSwiperChange" next-margin="25rpx">
  199 + <swiper-item wx:for="{{saleGoods}}" wx:key="{{index}}" class="p_swiper" wx:key="saleGoods">
  200 + <navigator class="nav" hover-class="none" url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&title={{aitem.goods_name}}" wx:for="{{item}}" wx:key="item" wx:for-item="aitem" wx:for-index="aind">
  201 + <view class="imgview presell">
  202 + <image src="{{url+aitem.original_img}}" mode="aspectFill" lazy-load="true" data-errorimg="saleGoods[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3" data-img="{{aitem.original_img}}"></image>
  203 + </view>
  204 + <view class="ellipsis-2 mar-top10" style="height: 70rpx;">{{aitem.title}}</view>
  205 + <view class="co-red mar-top10 flex jc_sb ali-c">
  206 + <view>
  207 + <text><text class="fs20">¥</text>{{aitem.price}}</text>
  208 + <text class="un_line">¥{{aitem.market_price}}</text>
  209 + </view>
  210 + <view class="btn-buy">去抢购</view>
  211 + </view>
  212 + </navigator>
  213 +
  214 + </swiper-item>
  215 +
  216 + </swiper>
  217 + <!-- <view class="flex-center-around translation">
  218 + <view class="circle spot" wx:for="{{saleGoods}}" wx:key="{{index}}" style="background:{{index==flash_index?'#fff':'#999'}}">
  219 + </view>
  220 + </view> -->
  221 + </view>
  222 + </view>
187 223  
188 224  
189 225 <!----拼单---->
... ...
pages/index/index/index.wxss
... ... @@ -2,6 +2,39 @@
2 2 background: #ff7295;
3 3 }
4 4  
  5 +.icon-presell {
  6 + color: #ED6064;
  7 + font-size: 18px;
  8 + margin-right: 4rpx;
  9 +}
  10 +
  11 +.presell {
  12 + position: relative;
  13 +}
  14 +
  15 +.presell::after {
  16 + position: absolute;
  17 + top: 0;
  18 + left: 0;
  19 + content: '预售';
  20 + background-color: #E9030D;
  21 + color: white;
  22 + font-size: 22rpx;
  23 + padding: 2rpx 10rpx;
  24 + border-radius: 4rpx;
  25 +}
  26 +
  27 +.btn-buy {
  28 + width: reverse !important;
  29 + font-size: 22rpx !important;
  30 + background-color: #E9030D;
  31 + border-radius: 4rpx;
  32 + color: white;
  33 + padding: 0 6rpx;
  34 + /* line-height: 1; */
  35 + text-align: center;
  36 +}
  37 +
5 38 .top-bar {
6 39 position: fixed;
7 40 top: 0;
... ... @@ -289,7 +322,7 @@
289 322 line-height: 33rpx; */
290 323 overflow: hidden;
291 324 font-size: 26rpx;
292   - width: 200rpx;
  325 + /* width: 200rpx; */
293 326 word-break: break-all;
294 327 }
295 328  
... ...