Commit be8598009b4270e1545cc587c26f84e6067c33d6

Authored by yvan.ni
1 parent 7cb56377

订单支付的页面

packageC/pages/presell/cart/cart2_pre.js 0 → 100644
  1 +var t = getApp(),app=t, a = t.request, ut = require("../../../../utils/util.js");
  2 +var os=t.globalData.setting;
  3 +var regeneratorRuntime = require('../../../../utils/runtime.js');
  4 +var util_pay = require("../../../../utils/pay.js");
  5 +
  6 +Page({
  7 + data: {
  8 + url: t.globalData.setting.url,
  9 + resourceUrl: t.globalData.setting.resourceUrl,
  10 + imgUrl: t.globalData.setting.imghost,
  11 + goods: null,
  12 + order: null,
  13 + orderPrices: null,
  14 + coupons: null,
  15 + coupon: null,
  16 + invoiceToggle: !0,
  17 + payWithUserMoney: !0,
  18 + payWithPoints: !0,
  19 + maxWord: 0,
  20 + enterAddressPage: !1,
  21 + firstEnter: !0,
  22 + //页面获取的参数
  23 + param:null,
  24 + postdata:null,
  25 + //提交订单的格式
  26 + formData: {
  27 + order_amount:0,//支付金额
  28 + total_amount:0,//总价
  29 + all_price:0,//商品卖的总价
  30 + pay_points: 0,//使用积分
  31 + user_money: 0,//使用余额
  32 + couponCode: "",//使用优惠券(多单就用逗号隔开)
  33 + shipping_price:0,//物流费用
  34 + },
  35 +
  36 + /*----------------立即购买---------------------*/
  37 + is_b_now:0, //0是购物车结算 1立即购买
  38 + bn_goods:null, //立即购买时候的调用商品
  39 + bn_use_money:0,//是否使用余额
  40 + bn_exp_type:1, //0是物流 1自提
  41 + bn_pick:0, //选择的门店
  42 + bn_pickname: "", //选择的门店名称
  43 + bn_t_exp_t:0, //判断商品和门店一起决定的物流自提的方式0 都可以 1自提 2物流
  44 + /*------------------------*/
  45 + user_addr:null,//物流
  46 + userinfo:null, //获取会员
  47 + /*----------物流选择--------*/
  48 + wu_arr:null,
  49 + index:0,
  50 +
  51 + //判断页面是返回回来的还是 首次进入的
  52 + isclose:1,
  53 + is_express:0,//选择物流的控制器
  54 + yuer:0,
  55 +
  56 + },
  57 + onLoad: function(t) {
  58 + var th = this; this.setData({ is_b_now: 1});
  59 + th.data.postdata=getApp().get_b_now();
  60 + th.data.param=t;
  61 +
  62 + },
  63 + onUnload: function () { this.setData({ isclose: 1 })},
  64 +
  65 + //------获取会员信息-----先获取用户信息,在进行下一步---
  66 + get_info:function(func){
  67 + var user_id = t.globalData.user_id;
  68 + app.auth.get_u(func);
  69 + },
  70 +
  71 + //-------------------获取物流---------------
  72 + get_wuliu(func) {
  73 + var th = this;
  74 + app.getwuliu(function (e) {
  75 + if (th.data.is_default_logistics) {
  76 + //如果第一个不是开启默认,说明要让用户自己选
  77 + if (!e[0].is_default) {
  78 + th.setData({ is_default_logistics: 0 });
  79 + }
  80 + }
  81 + th.setData({ wu_arr: e })
  82 + typeof func == "function" && func();
  83 + })
  84 + },
  85 +
  86 + //------获取会员收货地址-----
  87 + getuser_addr:function(func){
  88 + if (app.globalData.baddr!=null){
  89 + var user_addr =app.globalData.baddr;
  90 + app.globalData.baddr=null;
  91 + func(user_addr);
  92 + }else{
  93 + a.get("/api/weshop/useraddress/page", {
  94 + data: { user_id:app.globalData.user_id, store_id: os.stoid, pageSize: 600 },
  95 + success: function (su) {
  96 +
  97 + var user_addr = su.data.data.pageData;
  98 + var item = null;
  99 + var def_item=null;
  100 + for (var i = 0; i < user_addr.length; i++) {
  101 + if (user_addr[i]['is_default'] == 1) { def_item = user_addr[i]; }
  102 + if (user_addr[i]['is_pickup'] == 1) { item = user_addr[i]; }
  103 + }
  104 + if (item == null) item = def_item;
  105 + if (item == null) item = user_addr[0];
  106 + if (item == undefined) item = null;
  107 + func(item);
  108 + }
  109 + });
  110 + }
  111 + },
  112 + //----------------展示页面,是再获取用户信息之后--------------
  113 + show_page:function(){
  114 + var th=this;
  115 + var user=getApp().globalData.userInfo;
  116 + getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + user.user_id, {
  117 + data:{r:Math.random()},
  118 + success: function (e) {
  119 +
  120 + getApp().globalData.userInfo = e.data.data;
  121 + th.setData({userinfo:e.data.data});
  122 + //获取立即购买的商品信息
  123 + th.get_buy_goods();
  124 +
  125 + //获取提现金额
  126 + getApp().request.get("/api/weshop/withdrawals/summoney", {
  127 + data: { user_id:app.globalData.user_id, store_id: os.stoid, status: 0 },
  128 + success: function (su) {
  129 + if (su.data.code == 0) {
  130 + var yuer = parseFloat(th.data.userinfo.user_money -
  131 + (th.data.userinfo.frozen_money>0?th.data.userinfo.frozen_money:0) - su.data.data.summoney).toFixed(2);
  132 + if(yuer<0) yuer=0;
  133 + th.setData({ txmon: su.data.data.summoney, yuer: yuer });
  134 + }
  135 + }
  136 + });
  137 + }
  138 + });
  139 + },
  140 +
  141 + //-----获取立即购买的商品信息----
  142 + get_buy_goods: async function () {
  143 + var th = this, a = getApp().request;
  144 + //定义变量
  145 + var gg = th.data.postdata,act = null,prelist = null;
  146 + var url = "/api/weshop/marketing/marketingPresellForm/get/" + os.stoid + "/" + gg.prom_id;
  147 + await getApp().request.promiseGet(url, {}).then(res => {
  148 + if (res.data.code == 0) {
  149 + act = res.data.data;
  150 + }
  151 + })
  152 + if (!act) {
  153 + wx.showToast({title: "未找到活动", icon: 'none', duration: 3000});
  154 + return false;
  155 + }
  156 + if (act.is_end==1 ) {
  157 + wx.showToast({title:'活动已经结束' , icon: 'none', duration: 3000});
  158 + return false;
  159 + }
  160 + if( ut.gettimestamp()>act.end_time){
  161 + wx.showToast({title:"活动定金支付时间已过期" , icon: 'none', duration: 3000});
  162 + return false;
  163 + }
  164 +
  165 + var url = "/api/weshop/marketing/marketingPresellList/get/" + os.stoid + "/" + gg.presell_list_id;
  166 + await getApp().request.promiseGet(url, {}).then(res => {
  167 + if (res.data.code == 0) {
  168 + prelist = res.data.data;
  169 + }
  170 + })
  171 + if (!prelist) {
  172 + wx.showToast({title: "未找到商品", icon: 'none', duration: 3000});
  173 + return false;
  174 + }
  175 + //-- 调用商品 --
  176 + a.get("/api/weshop/goods/get/" + os.stoid + "/" + gg.goods_id, {
  177 + success: function (t) {
  178 + var gd = t.data.data;
  179 + if (!gd) return false;
  180 +
  181 + t.data.data.original_img = os.imghost + t.data.data.original_img;
  182 + t.data.data['buynum'] = gg.goods_num;
  183 +
  184 + var distr_t = 0, et = 0;
  185 + if (t.data.data.distr_type == 0) {
  186 + distr_t = gg.pick_dis;
  187 + } else {
  188 + distr_t = t.data.data.distr_type;
  189 + }
  190 +
  191 + if(act.presell_type==1){
  192 + switch (distr_t) {
  193 + case 0:
  194 + et = 1;
  195 + //-- 系统后台有设置要默认的 --
  196 + if (th.data.json_d.pickupway && th.data.json_d.pickupway == 1) et = 0;
  197 + break;
  198 + case 1:
  199 + et = 1;
  200 + break;
  201 + case 2:
  202 + et = 0;
  203 + break;
  204 + }
  205 + }else{
  206 + et=1; //要付定金的时候
  207 + }
  208 +
  209 + t.data.data.shop_price = prelist.presell_money;
  210 + th.setData({
  211 + bn_goods: t.data.data, bn_pickname: gg.pick_name,prelist:prelist,act:act,
  212 + bn_pick: gg.pick_id, bn_t_exp_t: distr_t, bn_exp_type: et
  213 + });
  214 + //计算价格
  215 + th.calculatePrice2();
  216 + }
  217 + });
  218 + },
  219 +
  220 + //----------子页返回父页触发----------
  221 + onShow: function () {
  222 + var th = this;
  223 + if (th.data.isclose == 0) {
  224 + wx.navigateTo({
  225 + url: "/pages/index/index/index"
  226 + })
  227 + } else {
  228 + this.getuser_addr(function (ie) {
  229 + //更换地址回来要重新调用计算价钱的接口
  230 + th.setData({ user_addr: ie });
  231 + if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) {
  232 + th.setData({ add_back: 1 });
  233 + if (this.data.bn_goods) th.calculatePrice2();
  234 + }
  235 + })
  236 + //--更新默认地址--,看一下是不是跳到地址页面
  237 + if (!getApp().globalData.is_cart_old) {
  238 + this.update_code();
  239 + } else {
  240 + getApp().globalData.is_cart_old = 0;
  241 + }
  242 + }
  243 +
  244 +
  245 + //先获取是否有关闭使用优惠券
  246 + getApp().getConfig2(function (ee) {
  247 + var json_d = JSON.parse(ee.switch_list);
  248 + th.data.json_d = json_d;
  249 + th.data.ispt_goods = json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
  250 + var is_default_logistics = json_d.is_default_logistics;
  251 +
  252 + th.setData({ is_close_quan: json_d.is_close_quan, sales_rules: ee.sales_rules, rank_switch: json_d.rank_switch, is_default_logistics: is_default_logistics });
  253 +
  254 + var rank_switch = json_d.rank_switch;
  255 + var max_price = -1;
  256 + var show_card = null;
  257 + var name = "";
  258 + //如果有开等级卡的时候,
  259 + //因为都是调接口,要返回在计算
  260 + if (rank_switch == 2) {
  261 + //-- 获取所有的等级卡, --
  262 + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?storeId=" + os.stoid,
  263 + {}).then(res => {
  264 + if (res.data.code == 0) {
  265 + var plusCard = res.data.data;
  266 + //-- 循环判断,拿到最贵的那张卡 --
  267 + for (var ih in plusCard) {
  268 + if (plusCard[ih].IsStopBuy == true) { continue; }
  269 + if (max_price < 0) {
  270 + max_price = plusCard[ih].CardFee;
  271 + name = 'card' + plusCard[ih]['CorrPrice'];
  272 + show_card = plusCard[ih];
  273 + } else {
  274 + if (max_price < plusCard[ih].CardFee) {
  275 + max_price = plusCard[ih].CardFee;
  276 + name = 'card' + plusCard[ih]['CorrPrice'];
  277 + show_card = plusCard[ih];
  278 + }
  279 + }
  280 + }
  281 +
  282 + if (show_card) {
  283 + name = name.toLowerCase();
  284 + th.setData({ card_name: name, show_card: show_card })
  285 + }
  286 + }
  287 + //-----先获取物流,再获取用户信息,再展示页面-----
  288 + th.get_wuliu(th.get_info(th.show_page));
  289 + })
  290 + } else {
  291 + //-----先获取物流,再获取用户信息,再展示页面-----
  292 + th.get_wuliu(th.get_info(th.show_page));
  293 + }
  294 + }, 1)
  295 +
  296 + },
  297 + //---------------检查是否有收货地址-------------------
  298 + checkAddressList: function() {
  299 + var t = this;
  300 + return !(!this.data.order || null == this.data.order.userAddress) || (wx.showModal({
  301 + title: "请先填写或选择收货地址~",
  302 + success: function(a) {
  303 + a.confirm ? t.enterAddressPage() : wx.navigateBack();
  304 + },
  305 + fail: function() {
  306 + wx.navigateBack();
  307 + }
  308 + }), !1);
  309 + },
  310 + showInvoice: function() {
  311 + this.setData({
  312 + invoiceToggle: !this.data.invoiceToggle
  313 + });
  314 + },
  315 + keyUpChangePay1: function(t) {
  316 + this.setData({
  317 + payWithUserMoney: !(t.detail.value.length > 0)
  318 + });
  319 + },
  320 + keyUpChangePay2: function(t) {
  321 + this.setData({
  322 + payWithPoints: !(t.detail.value.length > 0)
  323 + });
  324 + },
  325 + keyUpChangeNum: function(t) {
  326 + this.setData({
  327 + maxWord: t.detail.value.length
  328 + });
  329 + },
  330 + //---------计算立即购买----------
  331 + calculatePrice2: function () {
  332 + console.log('calculatePrice2');
  333 + var th = this, good = this.data.bn_goods;
  334 + //-----------计算商品总价--------------
  335 + var allpice = good.shop_price * good.buynum;
  336 + allpice=parseFloat(allpice).toFixed(2);
  337 + var txt = "formData.all_price";
  338 + th.setData({ [txt]: allpice, });
  339 + console.log(th.data.formData);
  340 +
  341 + app.getConfig2(function (ee) {
  342 + app.getwuliuprice(function (rs) {
  343 + var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
  344 + //-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格----------
  345 + if (th.data.user_addr != null && th.data.bn_exp_type == 0
  346 + && good.is_free_shipping == 0 && (th.data.kt_type!=3 || th.data.bn_goods.is_normal==1) ){
  347 + switch (good['exp_sum_type']) {
  348 + case 1:
  349 + //统一运费
  350 + o_shipping_price += good['uniform_exp_sum']; break;
  351 + case 2:
  352 + if (goods_weight < 0) goods_weight = 0;
  353 + //累积商品重量 每种商品的重量 * 数量
  354 + goods_weight += good['weight'] * good['buynum'];break;
  355 + case 3:
  356 + if (goods_piece < 0) goods_piece = 0;
  357 + //累积商品数量
  358 + goods_piece += good['buynum']; break;
  359 + }
  360 +
  361 + var code = th.data.wu_arr[th.data.index].code;
  362 + var freight_free = ee.freight_free; //全场满多少包邮
  363 + var shipping_price=
  364 + th.calculatewuliu(code, o_shipping_price, goods_weight,
  365 + goods_piece, th.data.user_addr, freight_free, allpice, rs);
  366 +
  367 + shipping_price = parseFloat(shipping_price).toFixed(2);
  368 + var wl_txt = "formData.shipping_price";
  369 + th.setData({ [wl_txt]: shipping_price, })
  370 +
  371 + }else{
  372 + var wl_txt = "formData.shipping_price";
  373 + th.setData({ [wl_txt]: 0, })
  374 + }
  375 + //-----------------总价-----------------
  376 + var total_m = parseFloat(allpice) + parseFloat( th.data.formData.shipping_price);
  377 + total_m = parseFloat(total_m).toFixed(2);
  378 +
  379 + var atxt= "formData.total_amount";
  380 + th.setData({ [atxt]: total_m, })
  381 + var order_m = total_m;
  382 +
  383 + var txt = "formData.user_money";
  384 + var txt2 = "formData.order_amount";
  385 + //--------------如果使用余额---------------------
  386 + if (th.data.bn_use_money == 1 && th.data.yuer>0) {
  387 + if ( parseFloat(th.data.yuer) > total_m) {
  388 + th.setData({ [txt]: total_m, [txt2]:0 })
  389 + }else{
  390 + order_m = parseFloat(order_m) - parseFloat(th.data.yuer);
  391 + order_m = order_m.toFixed(2);
  392 + th.setData({ [txt]: th.data.yuer, [txt2]: order_m })
  393 + }
  394 + }else{
  395 + th.setData({ [txt]: 0, [txt2]: order_m })
  396 + }
  397 +
  398 + });
  399 + });
  400 + },
  401 + //--------------------提交订单-----------------------
  402 + submitForm: async function(t){
  403 + if(this.data.is_summit_ing==1) return false; //--提交中退出--
  404 + this.data.is_summit_ing=1;
  405 +
  406 + var th=this,pdata=new Array();
  407 + var ff=true;
  408 + //------------立即购买-------------
  409 +
  410 + //如果不是阶梯团,或者是普通购买,商家选择了物流,以及地址为空的时候
  411 + if(th.data.bn_exp_type == 0 && th.data.user_addr==null && (th.data.kt_type!=3 || th.data.bn_goods.is_normal==1) ){
  412 + ff = false;
  413 + getApp().my_warnning("请选择收货地址",0,this);
  414 + this.data.is_summit_ing = 0;
  415 + }
  416 + if (!ff) return false;
  417 + var addr = th.data.user_addr;
  418 + if (th.data.bn_exp_type == 1) addr=null;
  419 +
  420 + if(th.data.bn_exp_type==0 && (th.data.kt_type!=3)) {
  421 + if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) {
  422 + getApp().my_warnning("读取物流失败",0,this);
  423 + this.data.is_summit_ing = 0;
  424 + return false;
  425 + }
  426 + }
  427 +
  428 + //阶梯团强制带1,自提~~~
  429 + if(th.data.kt_type==3 ){
  430 + th.data.bn_exp_type=1;
  431 + }
  432 +
  433 + var item={
  434 + 'user_id':app.globalData.user_id,
  435 + 'consignee': addr == null ? "" : addr.consignee,
  436 + 'province': addr == null ? 0 : addr.province,
  437 + 'city': addr == null ? 0 : addr.city,
  438 + 'district': addr == null ? 0 : addr.district,
  439 + 'twon': addr == null ? 0 : addr.twon,
  440 + 'address': addr == null ? "": addr.address,
  441 + 'more_address': addr == null ? "" : addr.more_address,
  442 + 'mobile': addr == null ? th.data.userinfo.mobile:addr.mobile,
  443 + 'email':'',
  444 + 'invoice_title':'',
  445 + 'goods_price': th.data.formData.all_price, //商品总价
  446 + 'shipping_price': th.data.formData.shipping_price, //物流金额
  447 + 'user_money': th.data.formData.user_money, //使用余额
  448 + 'total_amount': th.data.formData.total_amount, //订单总价
  449 + 'order_amount': th.data.formData.order_amount, //应付
  450 + 'user_note': t.detail.value.user_note, //用户备注
  451 + 'store_id':os.stoid, //商家
  452 + 'pickup_id': th.data.bn_pick, //门店
  453 + 'prom_type':th.data.bn_goods.prom_type, //促销活动类型
  454 + 'prom_id': th.data.bn_goods.prom_id, //促销活动id
  455 + 'order_goods':new Array(),
  456 + };
  457 +
  458 + //老会员成为分销下线需要的参数
  459 + if(getApp().globalData.first_leader && !getApp().globalData.userInfo.first_leader){
  460 + //判断一下分享人是不是分享商
  461 + await app.request.promiseGet("/api/weshop/users/get/" + os.stoid+"/"+getApp().globalData.first_leader,{}).then(res=>{
  462 + if(res.data.code==0){
  463 + var user= res.data.data;
  464 + if(user.is_distribut==1){
  465 + item.first_leader=parseInt(getApp().globalData.first_leader);
  466 + }
  467 + }
  468 + })
  469 + }
  470 +
  471 + if(th.data.qh!='')
  472 + {
  473 + item.team_qh=th.data.qh;
  474 + item.pt_listno=th.data.qh;
  475 + }
  476 +
  477 + var gg =app.get_b_now();
  478 + var goods={
  479 + 'goods_id': gg.goods_id,
  480 + 'goods_name': gg.goods_name,
  481 + 'goods_sn': gg.goods_sn,
  482 + 'goods_num': gg.goods_num,
  483 + 'market_price': th.data.bn_goods.market_price,
  484 + 'goods_price': th.data.bn_goods.shop_price,
  485 + 'member_goods_price': th.data.bn_goods.shop_price,
  486 + 'store_id': os.stoid,
  487 + 'prom_type':th.data.bn_goods.prom_type, //促销活动类型
  488 + 'prom_id': th.data.bn_goods.prom_id, //促销活动id
  489 + };
  490 +
  491 + //--导购分享过来的id--
  492 + if(gg.guide_id){
  493 + goods.guide_id=gg.guide_id;
  494 + goods.guide_type=gg.guide_type;
  495 + //调用接口判断是不是会员
  496 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/"+os.stoid+"/"+gg.guide_id,{}).then(res=>{
  497 + if(res.data.code==0){
  498 + goods.guide_name=res.data.data.salesman;
  499 + goods.guide_sn=res.data.data.salesman_no;
  500 + }
  501 + })
  502 + }
  503 +
  504 + //--商品的房间号--
  505 + if(gg.room_id && gg.room_id>0){
  506 + item.room_ids=gg.room_id;
  507 + goods.room_id=gg.room_id;
  508 + }
  509 +
  510 + if(th.data.bn_goods.is_normal){goods.is_pd_normal=1;}
  511 +
  512 + item.order_goods.push(goods);
  513 + pdata.push(item);
  514 +
  515 + if (pdata.length==0) return;
  516 + var str = JSON.stringify(pdata);
  517 + wx.showLoading({title: "加载中"});
  518 + wx.request({
  519 + url: os.url + '/api/weshop/order/createWxdOrder',
  520 + data: str,
  521 + method: 'POST',
  522 + header: {
  523 + 'content-type': 'application/json'
  524 + },// 设置请求的 header
  525 + success: function (res) {
  526 +
  527 + wx.hideLoading();
  528 + if (res.statusCode == 200) {
  529 + var data=res.data;
  530 + if(data.code==0){
  531 + console.log(th.data.is_b_now);
  532 + //如果是购物车结算,还要删除购物车
  533 + if (th.data.is_b_now == 0) {
  534 + console.log(th.data.cartlist_y);
  535 + var list = th.data.cartlist_y;
  536 + for (var i = 0; i < list.length; i++) {
  537 + //删除购物车
  538 + getApp().request.delete("/api/weshop/cart/del/" + os.stoid + "/" + list[i].id, {});
  539 + }
  540 + }
  541 + var order_amount = 0;
  542 + pdata.forEach(function (em, ind) {
  543 + order_amount += em.order_amount;
  544 + })
  545 + //要进行判断,如果是用微信支付,就要跳转到支付界面
  546 + if (order_amount > 0) {
  547 + th.setData({ isclose: 0 });
  548 + //void e.jumpToCart4({
  549 + // order_sn: data.data,
  550 + // type:1,
  551 + // }, 1);
  552 + util_pay.pay(data.data, function() {
  553 + setTimeout(function () {
  554 + wx.reLaunch({
  555 + //url: "/pages/payment/pay_success/pay_success?type=1&order_sn="+data.data,
  556 + url: "/pages/team/team_success/team_success?ordersn=" + data.data,
  557 + })
  558 + },1000)
  559 + }, function () {
  560 + //支付失败
  561 + setTimeout(function () {
  562 + //wx.navigateBack({ delta: 1 })
  563 + wx.reLaunch({
  564 + url: "/pages/user/order_list/order_list",
  565 + })
  566 + },1000)
  567 +
  568 + },os.stoid,1);
  569 +
  570 + } else {
  571 + var dd = {
  572 + parent_sn: data.data,
  573 + store_id: os.stoid,
  574 + type: 1,
  575 + };
  576 + //return false;
  577 + getApp().request.post("/api/weshop/order/pay/createOrder", {
  578 + data: dd,
  579 + success: function (t) {
  580 + console.log(t);
  581 + app.my_warnning("支付成功",1,th);
  582 + setTimeout(function () {
  583 + th.setData({ isclose: 0 });
  584 +
  585 + if(th.data.is_normal==1){
  586 + /*--
  587 + wx.navigateTo({
  588 + url: "/pages/user/order_list/order_list",
  589 + })--*/
  590 + var url="/pages/payment/pay_success/pay_success?type=1&order_sn="+data.data;
  591 + wx.reLaunch({
  592 + url: url
  593 + })
  594 +
  595 + }else{
  596 + wx.reLaunch({
  597 + url: "/pages/team/team_success/team_success?ordersn=" + data.data,
  598 + })
  599 + }
  600 +
  601 + }, 1000)
  602 + }
  603 + });
  604 + }
  605 + }
  606 + else{
  607 + th.data.is_summit_ing=0; //是否提交中
  608 + getApp().confirmBox(data.msg);
  609 + }
  610 + } else {
  611 + th.data.is_summit_ing=0; //是否提交中
  612 + console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode);
  613 + }
  614 + },
  615 + fail: function () {
  616 + th.data.is_summit_ing=0; //是否提交中
  617 + wx.hideLoading();
  618 + console.log("index.js wx.request CheckCallUser fail");
  619 + },
  620 + complete: function () {}
  621 + })
  622 + },
  623 + useCoupon: function() {
  624 + if (this.data.order.couponNum <= 0) {
  625 + //return t.showWarning("无可用优惠券");
  626 + getApp().my_warnning("无可用优惠券",0,this);
  627 + return;
  628 + }
  629 + var a = {
  630 + lid: this.data.coupon ? this.data.coupon.id : "0"
  631 + };
  632 + wx.navigateTo({
  633 + url: "/pages/user/checkcoupon/checkcoupon?" + s.Obj2Str(a)
  634 + });
  635 + },
  636 + enterAddressPage: function() {
  637 + getApp().globalData.is_cart_old=1;
  638 + this.data.enterAddressPage = !0, wx.navigateTo({
  639 + url: "/pages/user/address_list/address_list"
  640 + });
  641 + },
  642 +
  643 + //--------立即购买时,选择自提和物流-----------
  644 + setexptype_w:function(t){
  645 + var th=this;
  646 + var ty = t.currentTarget.dataset.t,txt = t.currentTarget.dataset.txt;
  647 + th.setData({ [txt]: ty });
  648 + var iszt=1;
  649 + if(ty==0){
  650 + th.setData({ is_all_zt: 0 });
  651 + }else{
  652 + for(var i=0;i<th.data.cartlist.length;i++){
  653 + var item = th.data.cartlist[i];
  654 + if (item.exp_type==0){ iszt=0;break;}
  655 + }
  656 + th.setData({ is_all_zt: iszt });
  657 + }
  658 + //----计算此时购物车的价格----
  659 + th.calculatePrice();
  660 + },
  661 +
  662 + //--------立即购买时,选择自提和物流----------
  663 + setexptype:function(t){
  664 + var th=this;
  665 + var ty = t.currentTarget.dataset.t;
  666 + th.setData({ bn_exp_type:ty});
  667 + //当物流为空的时候。
  668 + if (ty == 0 && th.data.wu_arr==null){
  669 + return th.get_wuliu(th.calculatePrice2());
  670 + }
  671 + th.calculatePrice2()
  672 + console.log('setexptype');
  673 + },
  674 +
  675 + //--------立即购买时,使用余额--------
  676 + set_bn_useyuer:function(){
  677 + var th=this;
  678 + th.setData({ bn_use_money: !th.data.bn_use_money});
  679 + th.calculatePrice2();
  680 + },
  681 + set_js_useyuer:function(){
  682 + var th = this;
  683 + th.setData({ js_use_money: !th.data.js_use_money });
  684 + th.calculatePrice();
  685 + },
  686 +
  687 + //-------------------计算物流---------------
  688 + calculatewuliu:function(code, o_shipping_price, goods_weight,
  689 + goods_piece,user_addr, freight_free, o_price, rs){
  690 + var price =0,th=this;
  691 + price +=parseFloat(o_shipping_price);
  692 + //如果是包邮
  693 + if (freight_free > 0 && o_price > freight_free){ return 0;}
  694 + if (user_addr==null) { return 0; }
  695 + //计算物流的config item;
  696 + var item=null;
  697 + //先根据 镇 县 区找计算的config
  698 + item = th.get_wuliu_config(user_addr.district,code,rs);
  699 + if (item==null) item = th.get_wuliu_config(user_addr.city, code, rs);
  700 + if (item==null) item = th.get_wuliu_config(user_addr.province, code, rs);
  701 + if (item == null) item = th.get_wuliu_default(code,rs);
  702 + if (item == null) return o_shipping_price;
  703 + var fw_price = 0, fp_price=0;
  704 + item=item.config;
  705 + if (item == null) return o_shipping_price;
  706 + //------按重量----------
  707 + if (goods_weight>0) {
  708 + fw_price =parseFloat(item['money']);
  709 + if (goods_weight > item['first_weight']){
  710 + var fw = goods_weight - item['first_weight'];
  711 + var n = Math.ceil(fw/item['second_weight'])
  712 + fw_price = fw_price + n * parseFloat(item['add_money']);
  713 + }
  714 + }
  715 + //------按件数----------
  716 + if (goods_piece > 0) {
  717 + fp_price = parseFloat(item['piecemoney']);
  718 + if (goods_piece > item['first_piece']) {
  719 + var fp = goods_piece - item['first_piece'];
  720 + var m = Math.ceil(fp / item['second_piece'])
  721 + fp_price = fp_price + m * parseFloat(item['add_piecemoney']);
  722 + }
  723 + }
  724 + var rspice =parseFloat(price + fw_price + fp_price);
  725 + return rspice;
  726 + },
  727 +
  728 + //------------循环获取config-----------
  729 + get_wuliu_config:function(region_id,code,rs){
  730 + var item=null,rslist = rs.pageData;
  731 + for (var i = 0; i < rslist.length;i++){
  732 + if (rslist[i].code == code && rslist[i].region_id == region_id) { item = rslist[i];}
  733 + }
  734 + return item;
  735 + },
  736 + //-------循环获取config,code default-------
  737 + get_wuliu_default: function (code, rs) {
  738 + var item = null, rslist=rs.pageData;
  739 + for (var i = 0; i < rslist.length; i++) {
  740 + if (rslist[i].shipping_code == code && rslist[i].is_default == 1) { item = rslist[i]; }
  741 + }
  742 + return item;
  743 + },
  744 +
  745 + //----------立即购买,选择物流-------------
  746 + bindPickerChange:function(e){
  747 + var ind = e.detail.value
  748 + this.setData({ index: ind });
  749 + this.calculatePrice2();
  750 + },
  751 +
  752 + //----------购物车结算,选择物流-------------
  753 + bindPickerChange_w: function (e) {
  754 + var ind=e.detail.value, txt = e.currentTarget.dataset.txt;
  755 + this.setData({ [txt]: ind });
  756 + this.calculatePrice();
  757 + },
  758 +
  759 + cart_set_err: function (e) {
  760 + var txt = e.currentTarget.dataset.err;
  761 + var ob = {};
  762 + ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif";
  763 + this.setData(ob);
  764 + },
  765 +
  766 + //// 开启物流的弹窗
  767 + show_wu_arr:function(e){
  768 + this.setData({ open_express: 1});
  769 + },
  770 +
  771 + //更新下默认,在onshow里面
  772 + update_code(){
  773 + var th=this,m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code;
  774 +
  775 + var uii=setInterval(function () {
  776 + if(th.data.wu_arr){
  777 + clearInterval(uii);
  778 + for (var k = 0; k < th.data.wu_arr.length; k++) {
  779 + var item = th.data.wu_arr[k];
  780 + if (def_exp_code == item.code) {
  781 + m_wind = k;
  782 + }
  783 + }
  784 + //--如果是立即购买--
  785 + th.setData({ index: m_wind, is_express: m_wind});
  786 + }
  787 + },500)
  788 + },
  789 +
  790 + // 关闭物流的弹窗
  791 + close_express:function(){
  792 + this.setData({ open_express:0 });
  793 + },
  794 + // 选择物流
  795 + click_express_name:function(e){
  796 + var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode;
  797 + var index=e.currentTarget.dataset.idxe;
  798 + var ob={ is_express: index, is_shipping_code: shippingcode,index:index};
  799 + this.setData(ob);
  800 + },
  801 +
  802 + //点击确定物流
  803 + determine_expres:function(e){
  804 + this.setData({ open_express: 0});
  805 + this.calculatePrice2();
  806 + },
  807 + //设置默认物流
  808 + select_default_logistics: function () {
  809 + var th=this;
  810 + var is_shipping_code=this.data.is_shipping_code
  811 + getApp().request.put("/api/weshop/users/update",{
  812 + data: { user_id: getApp().globalData.user_id, store_id: os.stoid, def_exp_code: is_shipping_code},
  813 + success:function(rse){
  814 + if (rse.data.code==0){
  815 + getApp().globalData.userInfo.def_exp_code=is_shipping_code;
  816 + th.setData({ open_express: 0 });
  817 + //----计算此时购物车的价格,这个页面没有calculatePrice(),2021.7.19----
  818 + //if(th.data.is_b_now==1) th.calculatePrice2();
  819 + //else th.calculatePrice();
  820 + th.calculatePrice2();
  821 + }
  822 + }
  823 + })
  824 + },
  825 +
  826 +
  827 + //跳转到购买卡
  828 + buycard:function(){
  829 + getApp().goto("/pages/user/plus/plus");
  830 + getApp().globalData.plus_buy_back=1;
  831 + }
  832 +});
... ...
packageC/pages/presell/cart/cart2_pre.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/cart2_pre.wxml 0 → 100644
  1 +<wxs module="filters" src="../../../utils/filter.wxs"></wxs>
  2 +<form bindsubmit="submitForm">
  3 + <view class="container">
  4 + <view class="tab-container" wx:if="{{act.presell_type==1}}">
  5 + <view class="tab-wrapper">
  6 + <view hidden="{{bn_t_exp_t==2}}" bindtap='setexptype' data-t='1' class="tab {{bn_exp_type == 1? 'active':''}}"
  7 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view>
  8 +
  9 + <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}"
  10 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view>
  11 +
  12 + </view>
  13 + </view>
  14 +
  15 + <block wx:if="{{act.presell_type==1}}">
  16 + <!--要进行判断地址是否显示---->
  17 + <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{bn_exp_type==0}}'>
  18 + <!---默认地址显示------>
  19 + <block wx:if="{{user_addr!=null}}">
  20 + <view class="user-contact">收货人:{{user_addr.consignee}}{{'  '}}{{user_addr.mobile}}</view>
  21 + <view class="location">
  22 + <view class="address">{{user_addr.more_address}}{{' '}}{{user_addr.address}}</view>
  23 + <view class="pos-icon">
  24 + <image class="wh100 bdr14" src="{{imgUrl}}/miniapp/images/goodscategory/new_position.png"></image>
  25 + </view>
  26 + </view>
  27 + <view class="update-logistics">
  28 + <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/icon-arrowdown.png"></image>
  29 + </view>
  30 + </block>
  31 + <!---先增地址------>
  32 + <block wx:else>
  33 + <view class="add_new">
  34 + <image class="addr_jia" src="{{imgUrl}}/miniapp/images/jia.png"></image>添加地址
  35 + </view>
  36 + </block>
  37 + <!-- <view class="border-img"><image class="wh100 bdr14" src="{{imgUrl}}/miniapp/images/tt.png"></image></view> -->
  38 + </view>
  39 + </block>
  40 +
  41 + <!------立即购买-------->
  42 + <block>
  43 + <!-- <view class="xc-border main-top"></view> -->
  44 + <view class="use-item bfff bdr_t-14 mgt20">
  45 + <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image> <view>{{bn_pickname}}</view></view>
  46 + <view class="order-detail">
  47 + <view class="goods-img">
  48 + <image class="wh100 bdr14" src="{{bn_goods.original_img}}"
  49 + binderror='cart_set_err' data-err="bn_goods.original_img"></image>
  50 + </view>
  51 + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}">
  52 + <view class="goods-name ellipsis-2">{{bn_goods.goods_name}}</view>
  53 + <!-- 商品属性 -->
  54 + <view class="flex-vertical fs28 color-gray n_guige">
  55 + <view class="goods-color"><text>{{filters.show_gui_ge(bn_goods.goods_spec,bn_goods.goods_color)}}</text>
  56 + </view></view>
  57 +
  58 + <!-----商品名称规格------>
  59 + <view class="order-num flex-space-between">
  60 + <view class="co-red">¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></view>
  61 + <view class="goods-num">x{{bn_goods.buynum}}</view>
  62 + </view>
  63 + </navigator>
  64 + <!-- <view class="order-num">
  65 + <view class="co-red">¥{{bn_goods.shop_price}}</view>
  66 + <view class="goods-num">x{{bn_goods.buynum}}</view>
  67 + </view> -->
  68 + </view>
  69 +
  70 + <!-- 如果是等级卡的商品,会员没有注册,要提醒注册 -->
  71 + <view class="plus_buy fs28" wx:if="{{card_cut_price>0}}">
  72 + <view class="flex">
  73 + <view class="card_bg ellipsis-1" style="margin-right: 10rpx;">
  74 + <image src="{{imgUrl}}/miniapp/images/plus/dj_icon.png"></ image>
  75 + <text class="card_name">{{show_card.CardName}}</text>
  76 + </view>
  77 + <view>立减 <text style="color:#f23030;">{{filters.toFix(card_cut_price,2) }}</text> 元</view>
  78 + </view>
  79 + <view>
  80 + <text style="color: #999;margin-left: 4rpx;">vip超级会员仅需{{show_card.CardFee}}元</text>
  81 + </view>
  82 + <!-- 三角形 -->
  83 + <view class="car_tri_up"></view>
  84 + <!-- 立即开通跳转 -->
  85 + <view bindtap="buycard" class="card_op">立即开通</view>
  86 + </view>
  87 +
  88 +
  89 + <view class="set-mes bdr_b-14">
  90 + <view wx:if="{{order.store_prom}}"><icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}}
  91 + </view>
  92 +
  93 + <!--阶梯团是不显示的-->
  94 + <block wx:if="{{bn_exp_type==0 && !is_default_logistics}}">
  95 + <view class="use-item flex-space-between" wx:if="{{kt_type!=3 || is_normal==1}}">
  96 + <view>选择物流</view>
  97 + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index' style="margin-right: 8rpx;">
  98 + <view class="logistics-name">{{wu_arr[index].name}}</view><view class="xc-right"></view>
  99 + </view>
  100 + </view>
  101 + </block>
  102 +
  103 + <!--阶梯团是不显示的
  104 + <block wx:if="{{kt_type!=3 || is_normal==1 }}">
  105 + <view class="use-item" hidden='{{bn_exp_type==1}}'>
  106 + <view>使用物流:</view>
  107 + <picker bindchange="bindPickerChange" value="{{index}}" range="{{wu_arr}}" range-key="name">
  108 + <view >{{wu_arr[index].name}}</view>
  109 + </picker>
  110 + </view>
  111 + </block>-->
  112 +
  113 + </view>
  114 +
  115 +
  116 + <view class="coupon-mes flex-vertical">
  117 + <view>留言</view>
  118 + <view class="leave-word">
  119 + <input placeholder-class="fs28" placeholder='给商家留言,最多100字'bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="100" name="user_note"></input>
  120 +
  121 + </view>
  122 + </view>
  123 + </block>
  124 +
  125 + <view class="information bdr14">
  126 + <!-----使用余额------>
  127 + <view class="set-mes" wx:if="{{userinfo.user_money>0 && yuer>0}}">
  128 + <view class="use-item" bindtap='set_bn_useyuer' style="padding-left:0;padding-right:0;">
  129 + <icon color="{{bn_use_money?'red':'gray'}}" size="16" type="success"></icon>
  130 + <view class="yu_er">使用余额 :¥{{yuer}} </view>
  131 + </view>
  132 + </view>
  133 + <view class="item" wx:if="{{kt_type<3 || is_normal==1}}">
  134 + <view>商品金额</view>
  135 + <view class="co-red">¥ {{formData.all_price}}元</view>
  136 + </view>
  137 +
  138 + <view class="item" wx:else>
  139 + <view>定金金额</view>
  140 + <view class="co-red">¥ {{formData.all_price}}元</view>
  141 + </view>
  142 +
  143 + <view class="item" wx:if="{{formData.shipping_price>0}}">
  144 + <view>配送费用</view>
  145 + <view class="co-red">¥ {{formData.shipping_price}}元</view>
  146 + </view>
  147 + <view class="item" wx:if="{{formData.user_money>0}}">
  148 + <view>使用余额</view>
  149 + <view class="co-red">- ¥ {{formData.user_money}}元</view>
  150 + </view>
  151 +
  152 + </view>
  153 + </view>
  154 +
  155 + <view class="btn-wrap">
  156 + <view class="pay-amount">
  157 + <view class="payable">应付金额:<text class="co-red">¥{{formData.order_amount}}</text></view>
  158 + <!-- <view class="co-red big"></view> -->
  159 + </view>
  160 + <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button>
  161 + </view>
  162 +</form>
  163 +
  164 +<!----弹起选择物流名的列表---->
  165 +<view wx:if='{{open_express==1}}' >
  166 + <view class="cover-layer flex-center " bindtap='close_express'>
  167 + </view>
  168 +
  169 + <view class="cx-popup radius {{open_express==1?'up' : 'down'}}" >
  170 + <view class="tops flex">
  171 + <view class="top-content fs32">
  172 + <view>
  173 + 选择物流名字
  174 + </view>
  175 + </view>
  176 + <view class="close-frame" bindtap='close_express' >
  177 + <view class="xc-close-express">×</view>
  178 + </view>
  179 + </view>
  180 + <view class="express_list">
  181 + <view wx:for="{{wu_arr}}" wx:for-item="express_list" wx:for-index="idx">
  182 + <view class="express_list_frame" bindtap="click_express_name"
  183 + data-shippingcode="{{express_list.shipping_code}}"
  184 + data-name="{{express_list.name}}" data-idxe="{{idx}}">
  185 +
  186 + <block wx:if="{{is_express==idx}}">
  187 + <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view>
  188 + </block>
  189 + <block wx:else>
  190 + <view class="circle xc-hooks"></view>
  191 + </block>
  192 + <view class="fs30">{{express_list.name}}</view>
  193 +
  194 + </view>
  195 + </view>
  196 + </view>
  197 + <view class="flex click-buttem" >
  198 + <view class="xc-determine flex-center" bindtap="determine_expres">
  199 + <view class="flex-vertical t-c">确定</view>
  200 + </view>
  201 + <view class="xc-confirms flex-center" bindtap="select_default_logistics">
  202 + <view class="flex-vertical t-c">设为默认</view>
  203 + </view>
  204 + </view>
  205 +
  206 + </view >
  207 +</view>
  208 +
  209 +<warn id="warn"></warn>
... ...
packageC/pages/presell/cart/cart2_pre.wxss 0 → 100644
  1 +.bdr_t-14 {
  2 + border-top-left-radius: 14rpx;
  3 + border-top-right-radius: 14rpx;
  4 +}
  5 +.bdr_b-14 {
  6 + border-bottom-left-radius: 14rpx;
  7 + border-bottom-right-radius: 14rpx;
  8 +}
  9 +.bdr14 {
  10 + border-radius: 14rpx;
  11 +}
  12 +.mgt20 {
  13 + margin-top: 20rpx;
  14 +}
  15 +.shadow {
  16 + box-shadow: 0 4rpx 12px #e7e9eb;
  17 +}
  18 +.shadow-1 {
  19 + box-shadow: 16rpx 0px 12px #e7e9eb;
  20 +}
  21 +
  22 +
  23 +page {
  24 + /* background-color: #FAFAFA; */
  25 + background-color: #F0F0F0;
  26 + padding: 0 22rpx;
  27 + box-sizing: border-box;
  28 +}
  29 +.container {
  30 + background-color: #F0F0F0;
  31 + /* padding-top: 28rpx; */
  32 + padding-bottom: 120rpx;
  33 +}
  34 +.user-mes {
  35 + position: relative;
  36 + background-color: #fff;
  37 + font-size: 32rpx;
  38 + color: #444;
  39 + /* margin-top: 28rpx; */
  40 + border-radius: 14rpx;
  41 +}
  42 +.user-contact {
  43 + padding: 24rpx 26rpx;
  44 + font-weight: 600;
  45 +}
  46 +
  47 +.location {
  48 + position: relative;
  49 + padding: 0 70rpx 24rpx;
  50 +}
  51 +
  52 +.pos-icon {
  53 + position: absolute;
  54 + left: 28rpx;
  55 + top: 6rpx;
  56 + width: 30rpx;
  57 + height: 36rpx;
  58 +}
  59 +
  60 +.border-img {
  61 + width: 100%;
  62 + height: 12rpx;
  63 +}
  64 +
  65 +.update-logistics {
  66 + position: absolute;
  67 + right: 0;
  68 + top: 0;
  69 + width: 80rpx;
  70 + height: 100%;
  71 + display: flex;
  72 + align-items: center;
  73 + justify-content: center;
  74 +}
  75 +
  76 +.arrow-rigth {
  77 + width: 32rpx;
  78 + height: 32rpx;
  79 +}
  80 +
  81 +.order-meg {
  82 + margin-bottom: 20rpx;
  83 + font-size: 28rpx;
  84 +
  85 +}
  86 +
  87 +.order-detail {
  88 + padding: 30rpx 0;
  89 + border-bottom: 2rpx solid #eee;
  90 + color: #777;
  91 + min-height: 190rpx;
  92 + background-color: #fff;
  93 +
  94 +}
  95 +
  96 +.goods-img {
  97 + float: left;
  98 + width: 200rpx;
  99 + height: 200rpx;
  100 + margin: 0 20rpx;
  101 +}
  102 +
  103 +.order-cont {
  104 + float: left;
  105 + width: 438rpx;
  106 +}
  107 +
  108 +.goods-name {
  109 + height: 74rpx;
  110 + line-height: 40rpx;
  111 + overflow: hidden;
  112 + margin-bottom: 16rpx;
  113 + font-size: 28rpx;
  114 + color: #333;
  115 +
  116 +}
  117 +
  118 +.goods-color {
  119 + font-size: 24rpx;
  120 +}
  121 +
  122 +.order-num {
  123 + margin-top: 25rpx;
  124 + font-size: 24rpx;
  125 + line-height: 42rpx;
  126 +}
  127 +
  128 +.set-mes{
  129 + background-color: #fff;
  130 + /* margin-top: 20rpx; */
  131 +}
  132 +.use-item{
  133 + display: flex;
  134 + align-items: center;
  135 + height: 80rpx;
  136 + /* border-bottom: 1px solid #ddd; */
  137 + font-size: 30rpx;
  138 + /* width:95%;
  139 +margin:auto; */
  140 + padding: 0 26rpx;
  141 +}
  142 +.use-item>view{
  143 + display: flex;
  144 + /* margin-right: 12rpx; */
  145 +}
  146 +.use-item.bfff{
  147 + background-color: #fff;
  148 +}
  149 +.use-item .dp{
  150 + display: block;
  151 + width: 50rpx;
  152 + height: 50rpx;
  153 + margin-left: -6rpx;
  154 +}
  155 +
  156 +.set-item {
  157 + justify-content: space-between;
  158 + background-color: #fff;
  159 +}
  160 +
  161 +.set-btn {
  162 + display: flex;
  163 + font-size: 24rpx;
  164 +}
  165 +
  166 +.set-mes input {
  167 + width: 380rpx;
  168 + height: 50rpx;
  169 + line-height: 50rpx;
  170 + border: 1px solid #ddd;
  171 +}
  172 +
  173 +.use-btn {
  174 + width: 100rpx;
  175 + height: 50rpx;
  176 + margin-left: 20rpx;
  177 + line-height: 50rpx;
  178 + text-align: center;
  179 + background-color: #f23030;
  180 + color: #fff;
  181 +}
  182 +
  183 +.coupon-mes {
  184 + /* box-sizing: border-box; */
  185 + height:95rpx;
  186 + padding: 0 26rpx;
  187 + background-color: #fff;
  188 + font-size: 30rpx;
  189 + color: #444;
  190 + /* width: 100%; */
  191 + border-radius: 14rpx;
  192 + margin-top: 20rpx;
  193 + margin-bottom: 20rpx;
  194 +}
  195 +
  196 +.coupon-title {
  197 + display: flex;
  198 + justify-content: space-between;
  199 + align-items: center;
  200 + height: 92rpx;
  201 +}
  202 +
  203 +.coupon-title>view {
  204 + display: flex;
  205 +}
  206 +
  207 +.coupon-num {
  208 + height: 36rpx;
  209 + margin-left: 20rpx;
  210 + padding: 0 16rpx;
  211 + line-height: 36rpx;
  212 + text-align: center;
  213 + background-color: #f23030;
  214 + color: #fff;
  215 + font-size: 24rpx;
  216 +}
  217 +
  218 +.leave-word {
  219 + position: relative;
  220 + font-size: 24rpx;
  221 + margin-left: 20rpx;
  222 + flex-grow: 1;
  223 +}
  224 +
  225 +.word-box {
  226 + font-size: 26rpx;
  227 + /* width: 600rpx; */
  228 + padding: 10rpx;
  229 + height: 28rpx;
  230 + line-height: 40rpx;
  231 +}
  232 +
  233 +.max-word {
  234 + position: absolute;
  235 + right: 0;
  236 + bottom: 0;
  237 +}
  238 +
  239 +.information {
  240 + padding: 0 26rpx;
  241 + background-color: #fff;
  242 + /* margin-bottom: 120rpx; */
  243 +}
  244 +
  245 +.information .item {
  246 + display: flex;
  247 + justify-content: space-between;
  248 + height: 60rpx;
  249 + line-height: 60rpx;
  250 + font-size: 26rpx;
  251 + color: #777;
  252 +}
  253 +
  254 +.btn-wrap {
  255 + height: 94rpx;
  256 + box-sizing: border-box;
  257 + display: flex;
  258 + justify-content: space-between;
  259 + background-color: white;
  260 + align-items: center;
  261 + position: fixed;
  262 + bottom: 0;
  263 + left: 0;
  264 + width: 100%;
  265 + padding: 0 30rpx;
  266 +}
  267 +
  268 +.tips-btn {
  269 + /* float: right;
  270 + width: 200rpx;
  271 + height: 100rpx;
  272 + line-height: 100rpx;
  273 + text-align: center;
  274 + font-size: 30rpx;
  275 + color: #fff;
  276 + background-color: #f23030; */
  277 + color: white;
  278 + background-color: #FE4445;
  279 + height: 72rpx;
  280 + line-height: 72rpx;
  281 + padding: 0 42rpx;
  282 + border-radius: 36rpx;
  283 + margin-left: 0;
  284 + margin-right: 0;
  285 +}
  286 +
  287 +.pay-amount {
  288 + /* float: right;
  289 + display: flex;
  290 + align-items: center;
  291 + height: 100rpx;
  292 + font-size: 26rpx;
  293 + margin-right: 40rpx; */
  294 +}
  295 +
  296 +.payable {
  297 + color: #444;
  298 + /* margin-right: 20rpx; */
  299 +}
  300 +
  301 +.shipping-modal {
  302 + z-index: 20;
  303 + position: fixed;
  304 + bottom: 0;
  305 + left: 0;
  306 + right: 0;
  307 + overflow-y: hidden;
  308 + color: #666666;
  309 + background-color: white;
  310 +}
  311 +
  312 +.shipping-nav {
  313 + text-align: center;
  314 + font-size: 35rpx;
  315 + padding-top: 30rpx;
  316 +}
  317 +
  318 +.shipping-list {
  319 + padding: 20rpx 30rpx 40rpx;
  320 + font-size: 28rpx;
  321 +}
  322 +
  323 +.shipping-item {
  324 + display: block;
  325 + padding: 20rpx 0;
  326 +}
  327 +
  328 +.shipping-btn {
  329 + width: 100%;
  330 + color: white;
  331 + background-color: #f23030;
  332 + line-height: 90rpx;
  333 + text-align: center;
  334 + font-size: 40rpx;
  335 +}
  336 +
  337 +/*----------nyf新增,地址---------*/
  338 +.add_new{
  339 + height: 90rpx;
  340 + display: flex;
  341 + align-items: center;
  342 + padding: 0 26rpx;
  343 +}
  344 +.addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd;
  345 + margin-right: 15rpx;vertical-align: middle;}
  346 +.yu_er{
  347 + margin-left: 10rpx;
  348 + /* margin-right: 60rpx; */
  349 +}
  350 +.wuliu{margin-left: 20rpx;}
  351 +
  352 +
  353 +/*---- 优惠券列表 -----*/
  354 +.xc-coupon-frame{
  355 + width: 100%;
  356 + height: 92rpx;
  357 +
  358 +}
  359 +.xc-coupon-frame .work-frame{
  360 + width: 100%;
  361 + height: 100%;
  362 + border-bottom:3rpx solid #eee;
  363 + padding: 0 26rpx;
  364 + background-color: white;
  365 +}
  366 +.xc-right{
  367 + width:20rpx;
  368 + height:20rpx;
  369 + border-top:2rpx solid #000;
  370 + border-right:2rpx solid #000;
  371 + transform:rotate(45deg);
  372 + display:inline-block;
  373 +}
  374 +
  375 +.xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; }
  376 +.xc-right-frame{font-size: 30rpx;line-height: 92rpx; margin-right: 10rpx }
  377 +
  378 +/* 自定义弹出窗口 */
  379 +.cx-popup{
  380 + width:100%;
  381 + height:880rpx;
  382 + background: #fff;
  383 + z-index: 35;
  384 + border-top-left-radius: 20rpx;
  385 + border-top-right-radius: 20rpx;
  386 + position:fixed;
  387 + bottom:0;
  388 + left: 0;
  389 + /* padding-bottom: 25rpx; */
  390 +}
  391 +
  392 +.cx-popup .top{
  393 + width:95%;
  394 + height:100rpx;
  395 + border-bottom:3rpx solid #ddd;
  396 + margin: auto;
  397 + margin-top: 30rpx;
  398 +
  399 +}
  400 +.xc-top-content{
  401 + width: 93%;
  402 + height:85rpx;
  403 + padding-top: 30rpx;
  404 + font-size: 34rpx;
  405 + font-weight: 600;
  406 +
  407 +}
  408 +
  409 +
  410 +.xc-valid-coupon{
  411 + width: 90%;
  412 + height:40rpx;
  413 + padding-top: 24rpx;
  414 + overflow: hidden;
  415 +}
  416 +.xc-frame{
  417 + width: 100%;
  418 + height:60%;
  419 +}
  420 +
  421 +.xc-frame .list-frame{
  422 + width: 95%;
  423 + height: 100%;
  424 + overflow-y:scroll;
  425 +
  426 +}
  427 +.xc-close-frame{
  428 + margin-top:-10rpx;
  429 +
  430 +}
  431 +
  432 +.xc-close{
  433 + width: 37rpx;
  434 +height: 37rpx;
  435 +border-radius: 50%;
  436 +border: 3rpx solid #333;
  437 +text-align: center;
  438 +line-height: 34rpx;
  439 +font-size: 29rpx;
  440 +color: #333;
  441 +
  442 +}
  443 +.xc-money{
  444 + color: #af2346;
  445 + font-size: 35rpx;
  446 +}
  447 +
  448 +.xc-money-frame{
  449 + margin-left:35rpx;
  450 +
  451 +}
  452 +.xc-coupon-effect{
  453 + width: 99%;
  454 + min-height: 100rpx;
  455 + border-bottom:3rpx solid #ddd;
  456 +
  457 +
  458 +}
  459 +.xc-goods-coupon{
  460 + width: 85%;
  461 + height:100%;
  462 +
  463 +}
  464 +.xc-title{
  465 + width:50%;
  466 + margin-left:222rpx;
  467 +
  468 +}
  469 +.xc-coupon-money0{
  470 + color: #c91e31;
  471 + font-size: 35rpx;
  472 + line-height: 40rpx;
  473 +
  474 +}
  475 +.xc-coupon-money{
  476 + color: #c91e31;
  477 + font-size: 35rpx;
  478 + line-height: 40rpx;
  479 + padding-top: 10px;
  480 +
  481 +}
  482 +.xc-coupon-money1{
  483 + color: #444;
  484 + font-size: 28rpx;
  485 + line-height: 60rpx;
  486 +
  487 +
  488 +}
  489 +.xc-coupon-time{
  490 + height: 50rpx;
  491 + font-size: 27rpx;
  492 + color: #a4a4a4;
  493 +}
  494 +.xc-coupon-time .time{
  495 + margin-left: 15rpx;
  496 + font-size: 27rpx;
  497 +}
  498 +.xc-coupon-selection{
  499 + height:100%;
  500 +}
  501 +
  502 +.xc-confirm {
  503 + width: 50%;
  504 + border-radius: 50rpx;
  505 + height: 80rpx;
  506 + margin:0 auto;
  507 + background:#d60021;
  508 + color:#fff;
  509 + font-size:28rpx;
  510 + margin-top: 28rpx;
  511 +}
  512 +
  513 +.up{ animation: up .7s; }
  514 +.down{ animation: down 1s; }
  515 +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } }
  516 +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } }
  517 +
  518 +.xc-not-Selection{
  519 + width: 40rpx;
  520 +height: 40rpx;
  521 + background: #eeeeee;
  522 +}
  523 +
  524 +
  525 +.xc-close-express{
  526 + width: 40rpx;
  527 +height: 40rpx;
  528 +border-radius: 50%;
  529 +border: 3rpx solid #333;
  530 +text-align: center;
  531 +font-size:32rpx;
  532 +line-height: 38rpx;
  533 +color: #333;
  534 +margin-top: 5rpx;
  535 +}
  536 +.cx-popup .tops{
  537 + width: 100%;
  538 +height: 145rpx;
  539 +border-bottom: 3rpx solid #eee;
  540 +
  541 +}
  542 +.top-content {
  543 + width: 82%;
  544 +padding-top: 33px;
  545 +height: 100%;
  546 +padding-left: 40rpx;
  547 +}
  548 +.close-frame{
  549 + margin-top: 30rpx;
  550 +
  551 +}
  552 +
  553 +.xc-hook {
  554 +width: 33rpx;
  555 +height: 33rpx;
  556 +transform: rotate(-135deg);
  557 +line-height: 35rpx;
  558 +text-align: center;
  559 +margin-right: 20rpx
  560 +
  561 +
  562 +}
  563 +.xc-hooks {
  564 +width: 30rpx;
  565 +height: 30rpx;
  566 +border: 1rpx solid #999;
  567 +margin-right: 20rpx;
  568 +}
  569 +.express_list_frame{
  570 + display: flex;
  571 +height: 80rpx;
  572 +align-items: center;
  573 +padding-left: 40rpx;
  574 +border-bottom: 1rpx solid #eee;
  575 +
  576 +}
  577 +.express_list{
  578 + width: 100%;
  579 + height: 65%;
  580 + overflow-y: auto;
  581 + margin-bottom: 40rpx;
  582 +
  583 +}
  584 +.xc-confirms {
  585 + box-sizing: border-box;
  586 + width: 40%;
  587 + border-radius: 50rpx;
  588 + height: 80rpx;
  589 + margin:0 auto;
  590 + font-size:28rpx;
  591 + background: #fff;
  592 + color: #333;
  593 + border: 2rpx solid #333;
  594 +}
  595 +
  596 +
  597 +/* 优惠券的改版样式 */
  598 +.xc-coupon-frame{
  599 + /* width: 710rpx; */
  600 + width: 100%;
  601 + height:auto;
  602 + margin: 0 auto;
  603 +
  604 +}
  605 +.xc-coupon-frame .coupon-frame{
  606 + width: 100%;
  607 + height: 200rpx;
  608 + margin-top:10rpx;
  609 + border-bottom: 1rpx solid #eee;
  610 +
  611 +}
  612 +.xc-coupon-frame .coupon-frame .coupon-left{
  613 + width: 215rpx;
  614 + height:100%;
  615 + overflow: hidden;
  616 +}
  617 +.xc-money-frames{
  618 + width:96%;
  619 + margin-top: -10px;
  620 +}
  621 +
  622 +.xc-rmb-symbol{
  623 + font-size:40rpx;
  624 +
  625 +}
  626 +
  627 +.xc-rmb-val{
  628 + font-size:60rpx;
  629 +
  630 +}
  631 +.coupon-explain{
  632 + font-size:25rpx;
  633 +width:100%;
  634 +
  635 +
  636 +}
  637 +.xc-valuer{
  638 + margin-top:39rpx;
  639 + margin-left:28rpx;
  640 + font-size:25rpx;
  641 +}
  642 +.coupon-frame .oval{
  643 + width:155rpx;
  644 + height:83rpx;
  645 + border-radius: 50%;
  646 + right:-78rpx;
  647 + top:-37rpx;
  648 +}
  649 +.coupon-right{
  650 + /* width:490rpx; */
  651 + height: 99%;
  652 + border-top: 1rpx solid #eaeaea;
  653 + /* //border-bottom: 1rpx solid #eaeaea; */
  654 + border-right: 1rpx solid #eaeaea;
  655 + flex-grow: 1;
  656 +}
  657 +.coupon-annotation{
  658 + width: 95%;
  659 + height: 100%;
  660 +
  661 +}
  662 +.xc-brand{
  663 + width:100rpx;
  664 + height:35rpx;
  665 + line-height: 35rpx;
  666 + font-size:21rpx;
  667 + border-radius:10rpx; position: relative; top:-1px;
  668 + margin-right: 8rpx
  669 +}
  670 +.top-frame{
  671 + width:82%;
  672 + height: 75rpx;
  673 + margin-top:10rpx;
  674 +}
  675 +.top-frame .coupon-wode{
  676 + font-size: 25rpx;
  677 + margin-left:10rpx;
  678 + width:340rpx;
  679 + height:88rpx;
  680 +}
  681 +.coupon-code{
  682 + width:60rpx;
  683 + height:60rpx;
  684 + margin-top:5rpx;
  685 +
  686 +}
  687 +.frame{
  688 + width: 100%
  689 +}
  690 +.coupon-time{
  691 + font-size: 23rpx;
  692 + line-height:33rpx;
  693 + color: #333;
  694 +}
  695 +
  696 +.clik-get{
  697 + width:125rpx;
  698 + height:45rpx;
  699 + border-radius: 25rpx;
  700 + line-height: 45rpx;
  701 + font-size:25rpx;
  702 + bottom:67rpx;
  703 + right:6px;
  704 +}
  705 +
  706 +.code-img{
  707 + margin-left:20rpx;
  708 +}
  709 +.bottmo-explain{
  710 +top:145rpx;
  711 +width:94%;
  712 +border-top:1rpx dashed #eee;
  713 +padding-top:8rpx;
  714 +height:38rpx;
  715 +line-height: 51rpx;
  716 +
  717 +}
  718 +.font-word{
  719 + font-size: 22rpx;
  720 +}
  721 +.circle-size{
  722 + background: #a0a0a0;
  723 + width: 27rpx;
  724 + height: 27rpx;
  725 + margin-top:13rpx;
  726 +margin-left:8rpx;
  727 +display: flex;
  728 +
  729 +align-items: center;
  730 +}
  731 +.xc-jiantou{
  732 + /* width: 9rpx;
  733 + height: 9rpx; */
  734 + /* border-top: 2rpx solid #fff;
  735 + border-right: 2rpx solid #fff; */
  736 + transform: rotate(-90deg);
  737 + color: #fff;
  738 + font-size: 15rpx;
  739 + /* display:inline-block;
  740 + margin-top: 6.5rpx; */
  741 + text-align: center;
  742 +width: 24rpx;
  743 +}
  744 +.xc-buttom{
  745 + box-sizing: border-box;
  746 + width:100%;
  747 + min-height:76rpx;
  748 + height:auto;
  749 + line-height:40rpx;
  750 + border-left:1rpx solid #eee;
  751 + border-right:1rpx solid #eee;
  752 + border-bottom:1rpx solid #eee;
  753 +/* margin-left: 6rpx; */
  754 +}
  755 +
  756 +.goods-num{
  757 + font-size: 28rpx;
  758 + color: #333;
  759 +}
  760 +
  761 +.explain-coupon{
  762 + font-size:25rpx;
  763 + padding: 10rpx 10rpx
  764 +}
  765 +.circle-frame{
  766 + width: 20rpx;
  767 + height: auto;
  768 + z-index:1;
  769 + left:210rpx;
  770 +
  771 +}
  772 +.circle-sawtooth{
  773 + width: 11rpx;
  774 + height: 11rpx;
  775 + background: #fff;
  776 +}
  777 +
  778 +.red{background-color: #fe7496;}
  779 +.green{ background-color: #22c7c1;}
  780 +.blue{background-color:#5e82e3;}
  781 +.g_gray{background-color: #aaaaaa}
  782 +
  783 +.f_text{text-align: center; height:96rpx; }
  784 +.xc-hook.sn {
  785 + margin-top:12%;
  786 +width:45rpx;
  787 +height:45rpx;
  788 +font-size:28rpx;
  789 +line-height:44rpx;
  790 +
  791 +
  792 +}
  793 +.xc-hooks.on{
  794 + margin-top:12%;
  795 +width:42rpx;
  796 +height:42rpx;
  797 +}
  798 +.may_use_coupon{
  799 + /* width: 95%; */
  800 + /* height: 68rpx; */
  801 + line-height:78rpx;
  802 + padding: 0 26rpx;
  803 + justify-content: space-between;
  804 + align-items: center;
  805 +}
  806 +.determine-frame{
  807 + width: 100%;
  808 + height: 130rpx;
  809 +
  810 +}
  811 +.xc-determine{
  812 + height: 80rpx;
  813 + width: 40%;
  814 + border-radius: 50rpx;
  815 +background: #d60021;
  816 +color: #fff;
  817 +font-size: 28rpx;
  818 +margin: 0 auto;
  819 +
  820 +}
  821 +.click-buttem{
  822 +width: 90%;
  823 +margin: auto;
  824 +}
  825 +.logistics-name{
  826 + margin-right:20rpx;
  827 +}
  828 +.xc-border{
  829 + border-top:8rpx solid #eee;
  830 +width: 100%
  831 +}
  832 +.main-top{
  833 +margin-top: 20rpx;
  834 +
  835 +}
  836 +.xc-hookts{
  837 +border: 1rpx solid #999;
  838 +
  839 +}
  840 +.xc-hookts.on{
  841 + width:30rpx;
  842 +height:30rpx;
  843 +
  844 +}
  845 +.xc-hookt.sn{
  846 + width: 32rpx;
  847 +height: 32rpx;
  848 +font-size: 28rpx;
  849 +line-height: 34rpx;
  850 +}
  851 +.xc-hookt{
  852 + transform: rotate(-135deg);
  853 +text-align: center;
  854 +
  855 +}
  856 +.main-bottom{
  857 + margin-bottom: 20rpx;
  858 +
  859 +}
  860 +.xc-hookst{
  861 + border: 1rpx solid #999;
  862 +
  863 +}
  864 +.xc-hookst.ons{
  865 + width: 42rpx;
  866 +height: 42rpx;
  867 +margin-left: 20rpx;
  868 +
  869 +}
  870 +.is_use_coupon{
  871 + width: 65%;
  872 +justify-content: flex-end;
  873 +padding-top: 10rpx;
  874 +
  875 +
  876 +}
  877 +.xc-hooka{
  878 + transform: rotate(-135deg);
  879 +text-align: center;
  880 +
  881 +}
  882 +.xc-hooka.sn{
  883 + width: 45rpx;
  884 +height: 45rpx;
  885 +font-size: 28rpx;
  886 +line-height: 44rpx;
  887 +margin-left: 20rpx;
  888 +
  889 +}
  890 +.color-gray{
  891 + color: #808080;
  892 +}
  893 +.n_guige{ display: inline-block; background:rgb(236, 236, 236); color: rgb(63,63,63); padding: 3rpx 10rpx; border-radius: 3rpx }
  894 +.gift_image{ width: 60rpx; height: 60rpx; position: absolute; top: 0; left: 0}
  895 +
  896 +.quan_num_show{ padding: 4rpx 6rpx; background-color:#ea5551; color:#fff; border-radius: 6rpx;margin-left:10rpx;font-size:24rpx;}
  897 +
  898 +.navigator-hover {
  899 + background: none;
  900 + opacity: 1;
  901 +}
  902 +
  903 +.plus_buy{
  904 + background-color: #fff;
  905 + margin:15rpx 0;
  906 + padding: 20rpx 10rpx;
  907 + position: relative;
  908 +}
  909 +
  910 +
  911 +.card_bg {
  912 + box-sizing: border-box;
  913 + padding: 2rpx 10rpx;
  914 + height: 28rpx;
  915 + border-radius: 26rpx;
  916 + font-size: 18rpx;
  917 + line-height: 28rpx;
  918 + max-width: 210rpx;
  919 + background: #333;
  920 + color: #fff;
  921 + margin-left: 8rpx;
  922 + position:relative;
  923 + top:7rpx;
  924 +}
  925 +
  926 +.card_bg image {
  927 + width: 19rpx;
  928 + height: 19rpx;
  929 + margin-right: 8rpx;
  930 +}
  931 +
  932 +/* .card_bg .card_name {
  933 + max-width: 76rpx;
  934 + width: auto;
  935 + overflow: hidden;
  936 + white-space: nowrap;
  937 +} */
  938 +
  939 +.card_name {
  940 + position: relative;
  941 + top: -4rpx;
  942 + margin-left: 6px;
  943 +}
  944 +
  945 +.car_tri_up {
  946 + width: 0;height: 0;
  947 + border-left: 20rpx solid transparent;
  948 + border-right: 20rpx solid transparent;
  949 + border-bottom: 20rpx solid #fff;
  950 + position: absolute;
  951 + right: 20rpx;
  952 + top:-10rpx
  953 +}
  954 +.card_op{
  955 + position: absolute;
  956 + right: 20rpx;
  957 + top:36rpx
  958 +}
  959 +
  960 +
  961 +.tab-container {
  962 + font-size: 28rpx;
  963 + margin-top: 20rpx;
  964 + display: flex;
  965 +}
  966 +
  967 +.tab-wrapper {
  968 + background-color: #ccc;
  969 + display: flex;
  970 + border-radius: 40rpx;
  971 + overflow: hidden;
  972 +}
  973 +
  974 +.tab {
  975 + padding: 20rpx 30rpx;
  976 +
  977 +}
  978 +
  979 +
  980 +.tab.active {
  981 + background-color: white;
  982 + border-radius: 40rpx;
  983 +}
... ...