Commit 9e8a9b753ad5035f7312439f2446494d820c9a36
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
12 changed files
with
4316 additions
and
293 deletions
app.json
| @@ -160,6 +160,8 @@ | @@ -160,6 +160,8 @@ | ||
| 160 | "pages": [ | 160 | "pages": [ |
| 161 | "pages/presell/list/list", | 161 | "pages/presell/list/list", |
| 162 | "pages/presell/cart/cart", | 162 | "pages/presell/cart/cart", |
| 163 | + "pages/presell/cart/cart2", | ||
| 164 | + "pages/presell/cart/cart2_pre", | ||
| 163 | "pages/presell/goodsInfo/goodsInfo", | 165 | "pages/presell/goodsInfo/goodsInfo", |
| 164 | "pages/goods/distributionCategoryList/index", | 166 | "pages/goods/distributionCategoryList/index", |
| 165 | "pages/goods/goodsList/goodsList", | 167 | "pages/goods/goodsList/goodsList", |
packageC/pages/presell/cart/cart.js
| @@ -492,23 +492,34 @@ Page({ | @@ -492,23 +492,34 @@ Page({ | ||
| 492 | } | 492 | } |
| 493 | } | 493 | } |
| 494 | 494 | ||
| 495 | - | ||
| 496 | - var g_url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+order_goods.goods_id+"&pre_id="+pre_arr.id; | ||
| 497 | - if(act.is_end || th.data.act.end_time<ut.gettimestamp()) { | ||
| 498 | - g_url="/pages/goods/goodsInfo/goodsInfo?goods_id="+order_goods.goods_id; | ||
| 499 | - getApp().request.put("/api/weshop/goods/update", | ||
| 500 | - { data:{goods_id:order_goods.goods_id,store_id:os.stoid,prom_id:0,prom_type:0}, | ||
| 501 | - success: function(e) {} | ||
| 502 | - }); | ||
| 503 | - } | ||
| 504 | - | ||
| 505 | - | ||
| 506 | //---获取商品--- | 495 | //---获取商品--- |
| 507 | await getApp().request.promiseGet("/api/weshop/goods/get/" + oo.stoid + "/" + order_goods.goods_id, {}).then(res => { | 496 | await getApp().request.promiseGet("/api/weshop/goods/get/" + oo.stoid + "/" + order_goods.goods_id, {}).then(res => { |
| 508 | goods = res.data.data; | 497 | goods = res.data.data; |
| 509 | order.market_price = goods.market_price; | 498 | order.market_price = goods.market_price; |
| 510 | order.show_img = oo.imghost + goods.original_img; | 499 | order.show_img = oo.imghost + goods.original_img; |
| 511 | }); | 500 | }); |
| 501 | + | ||
| 502 | + | ||
| 503 | + var g_url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+order_goods.goods_id+"&pre_id="+pre_arr.id; | ||
| 504 | + if(act.is_end || th.data.act.end_time<ut.gettimestamp()) { | ||
| 505 | + | ||
| 506 | + if(goods.prom_type==8 && goods.prom_id==act.id){ | ||
| 507 | + g_url="/pages/goods/goodsInfo/goodsInfo?goods_id="+order_goods.goods_id; | ||
| 508 | + getApp().request.put("/api/weshop/goods/update", | ||
| 509 | + { data:{goods_id:order_goods.goods_id,store_id:os.stoid,prom_id:0,prom_type:0}, | ||
| 510 | + success: function(e) {} | ||
| 511 | + }); | ||
| 512 | + }else{ | ||
| 513 | + g_url="/pages/goods/goodsInfo/goodsInfo?goods_id="+order_goods.goods_id; | ||
| 514 | + if(goods.prom_type==8){ | ||
| 515 | + g_url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+order_goods.goods_id+"&prom_id="+goods.prom_id; | ||
| 516 | + } | ||
| 517 | + | ||
| 518 | + } | ||
| 519 | + | ||
| 520 | + } | ||
| 521 | + | ||
| 522 | + | ||
| 512 | //判断使用优惠券的接口需要 | 523 | //判断使用优惠券的接口需要 |
| 513 | th.data.check_quan_ware_list = goods.erpwareid; | 524 | th.data.check_quan_ware_list = goods.erpwareid; |
| 514 | //---获取门店--- | 525 | //---获取门店--- |
| @@ -643,12 +654,19 @@ Page({ | @@ -643,12 +654,19 @@ Page({ | ||
| 643 | quan_price = res.data.data[0].WareCashSum; | 654 | quan_price = res.data.data[0].WareCashSum; |
| 644 | } | 655 | } |
| 645 | }) | 656 | }) |
| 657 | + }else{ | ||
| 658 | + th.setData({quan_price:0}); | ||
| 659 | + if(th.data.using_quan[bn_pick].isby==1){ | ||
| 660 | + var txt="using_quan["+bn_pick+"]"; | ||
| 661 | + th.setData({[txt]:{}}); | ||
| 662 | + } | ||
| 663 | + | ||
| 646 | } | 664 | } |
| 647 | 665 | ||
| 648 | if(quan_price>0){ | 666 | if(quan_price>0){ |
| 649 | - if (quan_price < o_condition) th.setData({quan_price: quan_price}) | 667 | + if (quan_price < th.data.tail_pay) th.setData({quan_price: quan_price}) |
| 650 | else { | 668 | else { |
| 651 | - th.setData({quan_price: o_condition}) | 669 | + th.setData({quan_price: th.data.tail_pay}) |
| 652 | } | 670 | } |
| 653 | o_condition=o_condition-quan_price; | 671 | o_condition=o_condition-quan_price; |
| 654 | 672 | ||
| @@ -659,21 +677,22 @@ Page({ | @@ -659,21 +677,22 @@ Page({ | ||
| 659 | 677 | ||
| 660 | //如果同意参与订单优惠 | 678 | //如果同意参与订单优惠 |
| 661 | if (o_condition > 0 && this.data.pre_arr.is_useorderyh) { | 679 | if (o_condition > 0 && this.data.pre_arr.is_useorderyh) { |
| 662 | - th.check_is_order_prom(o_condition, function () { | 680 | + th.check_is_order_prom(o_condition, function (ord_price) { |
| 663 | var bn_pick=th.data.pickup.pickup_id | 681 | var bn_pick=th.data.pickup.pickup_id |
| 664 | var order_prom_amount = 0; | 682 | var order_prom_amount = 0; |
| 665 | var order_prom_id = 0; | 683 | var order_prom_id = 0; |
| 684 | + var o_condition1=0; | ||
| 666 | if (th.data.order_prom[bn_pick]) { | 685 | if (th.data.order_prom[bn_pick]) { |
| 667 | var ord_prom = th.data.order_prom[bn_pick]; | 686 | var ord_prom = th.data.order_prom[bn_pick]; |
| 668 | order_prom_id = ord_prom['id']; | 687 | order_prom_id = ord_prom['id']; |
| 669 | switch (ord_prom['type']) { | 688 | switch (ord_prom['type']) { |
| 670 | case 0: | 689 | case 0: |
| 671 | var all_1=o_condition; | 690 | var all_1=o_condition; |
| 672 | - o_condition = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | ||
| 673 | - order_prom_amount = (all_1 - o_condition).toFixed(2); | 691 | + o_condition1 = Math.round(ord_price * ord_prom['expression']) / 100;//满额打折 |
| 692 | + order_prom_amount = (all_1 - o_condition1).toFixed(2); | ||
| 674 | break; | 693 | break; |
| 675 | case 1: | 694 | case 1: |
| 676 | - o_condition = o_condition - ord_prom['expression'];//满额优惠金额 | 695 | + o_condition1 = ord_price - ord_prom['expression'];//满额优惠金额 |
| 677 | order_prom_amount = ord_prom['expression']; | 696 | order_prom_amount = ord_prom['expression']; |
| 678 | break; | 697 | break; |
| 679 | } | 698 | } |
| @@ -684,9 +703,14 @@ Page({ | @@ -684,9 +703,14 @@ Page({ | ||
| 684 | var order_prom_txt2 = "order_prom_amount"; | 703 | var order_prom_txt2 = "order_prom_amount"; |
| 685 | th.setData({[order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount}) | 704 | th.setData({[order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount}) |
| 686 | } | 705 | } |
| 687 | - th.setData({ exp_price: 0, order_m: o_condition }) | 706 | + |
| 707 | + o_condition1=parseFloat(o_condition1)-parseFloat(th.data.presell.presell_deposit); | ||
| 708 | + if(o_condition1<0) o_condition1=0; | ||
| 709 | + th.setData({ exp_price: 0, order_m: o_condition1 }) | ||
| 688 | }) | 710 | }) |
| 689 | }else{ | 711 | }else{ |
| 712 | + o_condition=parseFloat(o_condition)-parseFloat(th.data.presell.presell_deposit); | ||
| 713 | + if(o_condition<0) o_condition=0; | ||
| 690 | th.setData({ exp_price: 0, order_m: o_condition }) | 714 | th.setData({ exp_price: 0, order_m: o_condition }) |
| 691 | } | 715 | } |
| 692 | } | 716 | } |
| @@ -727,168 +751,6 @@ Page({ | @@ -727,168 +751,6 @@ Page({ | ||
| 727 | }); | 751 | }); |
| 728 | }, | 752 | }, |
| 729 | 753 | ||
| 730 | - calc_per: async function (c_arr) { | ||
| 731 | - var th = this; | ||
| 732 | - //-- 循环处理 -- | ||
| 733 | - for (var i in c_arr) { | ||
| 734 | - var cart_item = c_arr[i]; //就是每一单的意思 | ||
| 735 | - var pickid = cart_item.pickup_id; | ||
| 736 | - var ord_goods = c_arr[i].goods; //就是每一单的从表的意思 | ||
| 737 | - var o_price = 0, q_conditin = 0; | ||
| 738 | - //--------循环计算总价----------- | ||
| 739 | - for (var j = 0; j < ord_goods.length; j++) { | ||
| 740 | - o_price += ord_goods[j].goods_price * ord_goods[j].goods_num; | ||
| 741 | - } | ||
| 742 | - | ||
| 743 | - //---如果该门店的相关活动,就要算一下减价-- | ||
| 744 | - if (th.data.prom_goods_map[pickid]) { | ||
| 745 | - var ob = th.data.prom_goods_map[pickid]; | ||
| 746 | - for (var ii in ob) { | ||
| 747 | - var item_map = ob[ii]; | ||
| 748 | - if (item_map.bs == undefined || item_map.bs == null) { | ||
| 749 | - //等待,获取一下优惠活动的信息 | ||
| 750 | - await getApp().request.promiseGet("/api/weshop/goods/getDiscount", { | ||
| 751 | - data: { | ||
| 752 | - price: item_map.price, prom_id: item_map.prom_id, | ||
| 753 | - goods_num: item_map.goods_num, user_id: getApp().globalData.user_id, | ||
| 754 | - is_bz: item_map.is_bz | ||
| 755 | - } | ||
| 756 | - }).then(res => { | ||
| 757 | - if (res.data.code == 0 && res.data.data.condition) { | ||
| 758 | - var get_data = res.data.data; | ||
| 759 | - item_map.is_bz = get_data.is_bz; //是不是倍增 | ||
| 760 | - item_map.bs = get_data.bs; //是不是倍数 | ||
| 761 | - item_map.is_past = get_data.is_past; //是不是包邮 | ||
| 762 | - item_map.prom_price = get_data.price >= 0 ? get_data.price : item_map.price; | ||
| 763 | - item_map.s_intValue = get_data.intValue; | ||
| 764 | - item_map.s_coupon_id = get_data.coupon_id; | ||
| 765 | - item_map.s_coupon_num = get_data.coupon_num; | ||
| 766 | - if (get_data.gift_id && get_data.goodsinfo) { | ||
| 767 | - item_map.gift_id = get_data.gift_id; | ||
| 768 | - item_map.gift_goods_id = get_data.goods_id; | ||
| 769 | - item_map.gift_goods_name = get_data.goods_name; | ||
| 770 | - item_map.gift_goods_color = get_data.goodsinfo.goods_color ? get_data.goodsinfo.goods_color : ''; | ||
| 771 | - item_map.gift_goods_spec = get_data.goodsinfo.goods_spec ? get_data.goodsinfo.goods_spec : ''; | ||
| 772 | - item_map.gift_original_img = get_data.goodsinfo.original_img; | ||
| 773 | - item_map.gift_limit_num = get_data.limit_num; | ||
| 774 | - item_map.gift_storecount = get_data.gift_storecount; | ||
| 775 | - item_map.gift_weight = get_data.goodsinfo.weight; | ||
| 776 | - item_map.gift_exp_sum_type = get_data.goodsinfo.exp_sum_type; | ||
| 777 | - item_map.uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum; | ||
| 778 | - | ||
| 779 | - } | ||
| 780 | - item_map.s_libao = get_data.libao; | ||
| 781 | - item_map.s_lb_num = get_data.lb_num; | ||
| 782 | - } | ||
| 783 | - }) | ||
| 784 | - } | ||
| 785 | - | ||
| 786 | - //有活动,且优惠活动并没有限制使用优惠券,且有减价 | ||
| 787 | - //--看有没有减价-- | ||
| 788 | - //if(item_map.prom_price>=0 && item_map.price-item_map.prom_price){ | ||
| 789 | - if (item_map.price - item_map.prom_price && item_map.prom_price !== null) { | ||
| 790 | - if (cart_item.prom_pt_json) { | ||
| 791 | - cart_item.prom_pt_json.push({ | ||
| 792 | - "prom_id": item_map.prom_id, | ||
| 793 | - "dis": (item_map.price - item_map.prom_price).toFixed(2), | ||
| 794 | - "ispt": 0 | ||
| 795 | - }) | ||
| 796 | - } else { | ||
| 797 | - cart_item.prom_pt_json = [{ | ||
| 798 | - "prom_id": item_map.prom_id, | ||
| 799 | - "dis": (item_map.price - item_map.prom_price).toFixed(2), | ||
| 800 | - "ispt": 0 | ||
| 801 | - }]; | ||
| 802 | - } | ||
| 803 | - | ||
| 804 | - //-- 如果系统要平摊到单品 -- | ||
| 805 | - | ||
| 806 | - var pt_data = { | ||
| 807 | - 'prom_id': item_map.prom_id, | ||
| 808 | - 'dis': parseFloat((item_map.price - item_map.prom_price).toFixed(2)), | ||
| 809 | - 'goods': item_map.goods | ||
| 810 | - } | ||
| 811 | - | ||
| 812 | - var pt_res = null; | ||
| 813 | - await getApp().request.promisePost("/api/weshop/order/getGoodsSplit", { | ||
| 814 | - is_json: 1, | ||
| 815 | - data: pt_data | ||
| 816 | - }).then(res => { | ||
| 817 | - if (res.data.code == 0) { | ||
| 818 | - pt_res = res.data.data; | ||
| 819 | - } | ||
| 820 | - }) | ||
| 821 | - if (pt_res) { | ||
| 822 | - for (var io in item_map.goods) { | ||
| 823 | - //平摊赋值 | ||
| 824 | - item_map.goods[io].account_fir = th.arr_get_goods(item_map.goods[io].goods_id, pt_res).fisrt_account; | ||
| 825 | - item_map.goods[io].account_yu_fir = th.arr_get_goods(item_map.goods[io].goods_id, pt_res).fisrt_account_yu; | ||
| 826 | - if (!th.data.ispt_goods) { | ||
| 827 | - item_map.goods[io].account = item_map.goods[io].account_fir; | ||
| 828 | - item_map.goods[io].account_yu = item_map.goods[io].account_yu_fir; | ||
| 829 | - } | ||
| 830 | - } | ||
| 831 | - } | ||
| 832 | - | ||
| 833 | - | ||
| 834 | - o_price -= (item_map.price - item_map.prom_price); | ||
| 835 | - //如果有限制使用优惠券,就要减掉参与的活动商品的钱 | ||
| 836 | - if (!item_map.is_xz_yh) q_conditin = o_price; | ||
| 837 | - } | ||
| 838 | - | ||
| 839 | - //--------循环计算商品是不是包邮,是不是使用优惠券,此时循环是商品从表----------- | ||
| 840 | - for (var j = 0; j < ord_goods.length; j++) { | ||
| 841 | - if (ord_goods[j].is_gift) continue; | ||
| 842 | - if (ord_goods[j].prom_type == 3 && ord_goods[j].prom_id == item_map.prom_id) { | ||
| 843 | - ord_goods[j].is_xz_yh = item_map.is_xz_yh; | ||
| 844 | - ord_goods[j].is_past = item_map.is_past; | ||
| 845 | - ord_goods[j].account_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_fir; | ||
| 846 | - ord_goods[j].account_yu_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_yu_fir; | ||
| 847 | - ord_goods[j].account = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account; | ||
| 848 | - ord_goods[j].account_yu = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_yu; | ||
| 849 | - } | ||
| 850 | - } | ||
| 851 | - | ||
| 852 | - | ||
| 853 | - //--优惠多少钱-- | ||
| 854 | - if (!cart_item.cut_price) cart_item.cut_price = 0; | ||
| 855 | - //-- -- | ||
| 856 | - if (item_map.price != undefined && item_map.price != null | ||
| 857 | - && item_map.prom_price != undefined && item_map.prom_price != null) | ||
| 858 | - cart_item.cut_price += (item_map.price - item_map.prom_price); | ||
| 859 | - //---如果有送积分--- | ||
| 860 | - if (item_map.s_intValue) { | ||
| 861 | - if (!cart_item.s_intValue) cart_item.s_intValue = 0; | ||
| 862 | - cart_item.s_intValue += item_map.s_intValue; | ||
| 863 | - } | ||
| 864 | - //-- 如果有送优惠券的情况 -- | ||
| 865 | - if (item_map.s_coupon_id) { | ||
| 866 | - if (!cart_item.s_coupon_id) { | ||
| 867 | - cart_item.s_coupon_id = item_map.s_coupon_id + ""; | ||
| 868 | - cart_item.g_coupon_num = [{'c_id': item_map.s_coupon_id, "num": item_map.s_coupon_num}]; | ||
| 869 | - } | ||
| 870 | - else { | ||
| 871 | - cart_item.s_coupon_id += "," + item_map.s_coupon_id; | ||
| 872 | - cart_item.g_coupon_num.push({'c_id': item_map.s_coupon_id, "num": item_map.s_coupon_num}) | ||
| 873 | - } | ||
| 874 | - } | ||
| 875 | - | ||
| 876 | - //-- 如果有送优包邮券的情况 -- | ||
| 877 | - if (item_map.s_libao) { | ||
| 878 | - if (!cart_item.s_libao) { | ||
| 879 | - cart_item.s_libao = item_map.s_libao + ""; | ||
| 880 | - cart_item.g_lb_num = [{'l_id': item_map.s_libao, "num": item_map.s_lb_num}]; | ||
| 881 | - } | ||
| 882 | - else { | ||
| 883 | - cart_item.s_libao += "," + item_map.s_libao; | ||
| 884 | - cart_item.g_lb_num.push({'l_id': item_map.s_libao, "num": item_map.s_lb_num}) | ||
| 885 | - } | ||
| 886 | - } | ||
| 887 | - } | ||
| 888 | - } | ||
| 889 | - } | ||
| 890 | - }, | ||
| 891 | - | ||
| 892 | set_can_num: function () { | 754 | set_can_num: function () { |
| 893 | var th = this; | 755 | var th = this; |
| 894 | //-- 这个地方,循环计算几张优惠券可用-- | 756 | //-- 这个地方,循环计算几张优惠券可用-- |
| @@ -1242,20 +1104,13 @@ Page({ | @@ -1242,20 +1104,13 @@ Page({ | ||
| 1242 | var txt = ""; | 1104 | var txt = ""; |
| 1243 | var txt1 = ""; | 1105 | var txt1 = ""; |
| 1244 | var quan_item = null; | 1106 | var quan_item = null; |
| 1245 | - if (th.data.is_b_now) { | 1107 | + |
| 1246 | quan_item = this.data.get_by_quan_list[ind]; | 1108 | quan_item = this.data.get_by_quan_list[ind]; |
| 1247 | txt = "get_by_quan_list[" + ind + "].show_red"; | 1109 | txt = "get_by_quan_list[" + ind + "].show_red"; |
| 1248 | var obj = {}; | 1110 | var obj = {}; |
| 1249 | obj[txt] = 1; | 1111 | obj[txt] = 1; |
| 1250 | this.setData(obj); | 1112 | this.setData(obj); |
| 1251 | - } else { | ||
| 1252 | - txt = "by_quan_list_cart[" + ind + "].show_red"; | ||
| 1253 | - quan_item = th.data.by_quan_list_cart[ind]; | ||
| 1254 | - var obj = {}; | ||
| 1255 | - obj[txt] = 1; | ||
| 1256 | - this.setData(obj); | ||
| 1257 | - th.data.get_by_quan_list_cart[pickid] = JSON.parse(JSON.stringify(th.data.by_quan_list_cart)); //要把选中的弄回数组 | ||
| 1258 | - } | 1113 | + |
| 1259 | 1114 | ||
| 1260 | if (using_quan[th.data.selected_quan_pick]) { | 1115 | if (using_quan[th.data.selected_quan_pick]) { |
| 1261 | using_quan[th.data.selected_quan_pick].is_nouse_red = 0; | 1116 | using_quan[th.data.selected_quan_pick].is_nouse_red = 0; |
| @@ -1679,8 +1534,10 @@ Page({ | @@ -1679,8 +1534,10 @@ Page({ | ||
| 1679 | if (res.data.code == 0) { | 1534 | if (res.data.code == 0) { |
| 1680 | var data = res.data.data; | 1535 | var data = res.data.data; |
| 1681 | th.data.order_prom[pick] = data; | 1536 | th.data.order_prom[pick] = data; |
| 1682 | - } | ||
| 1683 | - func(); | 1537 | + }else{ |
| 1538 | + th.data.order_prom[pick] = null; | ||
| 1539 | + } | ||
| 1540 | + func(condition); | ||
| 1684 | }) | 1541 | }) |
| 1685 | }, | 1542 | }, |
| 1686 | 1543 | ||
| @@ -1871,14 +1728,17 @@ Page({ | @@ -1871,14 +1728,17 @@ Page({ | ||
| 1871 | } | 1728 | } |
| 1872 | }) | 1729 | }) |
| 1873 | 1730 | ||
| 1874 | - if(quan_price>0) { | ||
| 1875 | - if (quan_price < allpice) th.setData({quan_price: quan_price}) | 1731 | + if (quan_price > 0) { |
| 1732 | + if (quan_price < th.data.tail_pay) th.setData({quan_price: quan_price}) | ||
| 1876 | else { | 1733 | else { |
| 1877 | - th.setData({quan_price: allpice}) | 1734 | + th.setData({quan_price: th.data.tail_pay}) |
| 1735 | + quan_price = th.data.tail_pay; | ||
| 1878 | } | 1736 | } |
| 1879 | - }else{ | 1737 | + } else { |
| 1880 | th.setData({quan_price: 0}) | 1738 | th.setData({quan_price: 0}) |
| 1881 | } | 1739 | } |
| 1740 | + }else{ | ||
| 1741 | + th.setData({quan_price: 0}) | ||
| 1882 | } | 1742 | } |
| 1883 | }else{ | 1743 | }else{ |
| 1884 | th.setData({quan_price: 0}) | 1744 | th.setData({quan_price: 0}) |
| @@ -1887,7 +1747,7 @@ Page({ | @@ -1887,7 +1747,7 @@ Page({ | ||
| 1887 | //-----------当地址不为空,且是物流时,计算物流费用---------- | 1747 | //-----------当地址不为空,且是物流时,计算物流费用---------- |
| 1888 | if (th.data.user_addr != null && th.data.exp_type == 0 && good.is_free_shipping == 0) { | 1748 | if (th.data.user_addr != null && th.data.exp_type == 0 && good.is_free_shipping == 0) { |
| 1889 | //看是不是有调用过包邮券,如果活动可以使用优化券的情况下 | 1749 | //看是不是有调用过包邮券,如果活动可以使用优化券的情况下 |
| 1890 | - if (!th.data.isget_by_quan[bn_pick] && th.data.is_usecoupon) { | 1750 | + if (!th.data.isget_by_quan[bn_pick] && th.data.act.is_usecoupon) { |
| 1891 | var condition = allpice - quan_price; | 1751 | var condition = allpice - quan_price; |
| 1892 | //--判断要不要显示包邮券,链式调用接口,调取包邮券,已经是减了优惠的金额,见到优惠券的钱--- | 1752 | //--判断要不要显示包邮券,链式调用接口,调取包邮券,已经是减了优惠的金额,见到优惠券的钱--- |
| 1893 | getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", { | 1753 | getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", { |
| @@ -1957,7 +1817,7 @@ Page({ | @@ -1957,7 +1817,7 @@ Page({ | ||
| 1957 | if(o_condition<0) o_condition=0; | 1817 | if(o_condition<0) o_condition=0; |
| 1958 | //如果同意参与订单优惠 | 1818 | //如果同意参与订单优惠 |
| 1959 | if (o_condition > 0 && this.data.pre_arr.is_useorderyh) { | 1819 | if (o_condition > 0 && this.data.pre_arr.is_useorderyh) { |
| 1960 | - th.check_is_order_prom(o_condition, function () { | 1820 | + th.check_is_order_prom(o_condition, function (ord_price) { |
| 1961 | var bn_pick=th.data.pickup.pickup_id | 1821 | var bn_pick=th.data.pickup.pickup_id |
| 1962 | var order_prom_amount = 0; | 1822 | var order_prom_amount = 0; |
| 1963 | var order_prom_id = 0; | 1823 | var order_prom_id = 0; |
| @@ -1967,15 +1827,15 @@ Page({ | @@ -1967,15 +1827,15 @@ Page({ | ||
| 1967 | order_prom_id = ord_prom['id']; | 1827 | order_prom_id = ord_prom['id']; |
| 1968 | switch (ord_prom['type']) { | 1828 | switch (ord_prom['type']) { |
| 1969 | case 0: | 1829 | case 0: |
| 1970 | - order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | ||
| 1971 | - order_prom_amount = (o_condition - order_m).toFixed(2); | 1830 | + order_m = Math.round(ord_price * ord_prom['expression']) / 100;//满额打折 |
| 1831 | + order_prom_amount = (ord_price - order_m).toFixed(2); | ||
| 1972 | break; | 1832 | break; |
| 1973 | case 1: | 1833 | case 1: |
| 1974 | - order_m = o_condition - ord_prom['expression'];//满额优惠金额 | 1834 | + order_m = ord_price - ord_prom['expression'];//满额优惠金额 |
| 1975 | order_prom_amount = ord_prom['expression']; | 1835 | order_prom_amount = ord_prom['expression']; |
| 1976 | break; | 1836 | break; |
| 1977 | } | 1837 | } |
| 1978 | - o_condition=order_m; | 1838 | + ord_price=order_m; |
| 1979 | } | 1839 | } |
| 1980 | 1840 | ||
| 1981 | //--订单优惠的显示-- | 1841 | //--订单优惠的显示-- |
| @@ -1983,13 +1843,23 @@ Page({ | @@ -1983,13 +1843,23 @@ Page({ | ||
| 1983 | var order_prom_txt1 = "order_prom_id"; | 1843 | var order_prom_txt1 = "order_prom_id"; |
| 1984 | var order_prom_txt2 = "order_prom_amount"; | 1844 | var order_prom_txt2 = "order_prom_amount"; |
| 1985 | th.setData({[order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount}) | 1845 | th.setData({[order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount}) |
| 1986 | - } | ||
| 1987 | - | ||
| 1988 | - th.setData({ exp_price: exp_price, order_m: parseFloat(o_condition) +parseFloat(exp_price) }) | 1846 | + }else{ |
| 1847 | + var order_prom_txt1 = "order_prom_id"; | ||
| 1848 | + var order_prom_txt2 = "order_prom_amount"; | ||
| 1849 | + th.setData({[order_prom_txt1]: 0, [order_prom_txt2]: 0}) | ||
| 1850 | + } | ||
| 1851 | + | ||
| 1852 | + | ||
| 1853 | + ord_price=parseFloat(ord_price)-parseFloat(th.data.presell.presell_deposit); | ||
| 1854 | + if(ord_price<0) ord_price=0; | ||
| 1855 | + th.setData({ exp_price: exp_price, order_m: ord_price +parseFloat(exp_price) }) | ||
| 1989 | 1856 | ||
| 1990 | }) | 1857 | }) |
| 1991 | }else{ | 1858 | }else{ |
| 1992 | - th.setData({ exp_price: exp_price, order_m: parseFloat(o_condition)+parseFloat(exp_price) }) | 1859 | + |
| 1860 | + var o_condition1=parseFloat(o_condition)-parseFloat(th.data.presell.presell_deposit); | ||
| 1861 | + if(o_condition1<0) o_condition1=0; | ||
| 1862 | + th.setData({ exp_price: exp_price, order_m: parseFloat(o_condition1)+parseFloat(exp_price) }) | ||
| 1993 | } | 1863 | } |
| 1994 | }, | 1864 | }, |
| 1995 | 1865 | ||
| @@ -2042,7 +1912,13 @@ Page({ | @@ -2042,7 +1912,13 @@ Page({ | ||
| 2042 | 1912 | ||
| 2043 | //显示支付选择 | 1913 | //显示支付选择 |
| 2044 | show_pay: function () { | 1914 | show_pay: function () { |
| 2045 | - this.setData({show_pay_type: 1}); | 1915 | + //不用钱直接支付 |
| 1916 | + if(this.data.order_m<=0){ | ||
| 1917 | + this.to_pay_type(1); | ||
| 1918 | + }else{ | ||
| 1919 | + this.setData({show_pay_type: 1}); | ||
| 1920 | + } | ||
| 1921 | + | ||
| 2046 | }, | 1922 | }, |
| 2047 | //关闭支付 | 1923 | //关闭支付 |
| 2048 | close_show_pay: function () { | 1924 | close_show_pay: function () { |
| @@ -2110,7 +1986,7 @@ Page({ | @@ -2110,7 +1986,7 @@ Page({ | ||
| 2110 | if(th.data.user_note){ | 1986 | if(th.data.user_note){ |
| 2111 | dd.user_note=th.data.user_note; | 1987 | dd.user_note=th.data.user_note; |
| 2112 | } | 1988 | } |
| 2113 | - dd.order_amount= parseFloat(th.data.order_m-th.data.presell.presell_deposit).toFixed(2); | 1989 | + dd.order_amount= parseFloat(th.data.order_m).toFixed(2); |
| 2114 | 1990 | ||
| 2115 | console.log(JSON.stringify(dd)); | 1991 | console.log(JSON.stringify(dd)); |
| 2116 | wx.request({ | 1992 | wx.request({ |
| @@ -2195,7 +2071,6 @@ Page({ | @@ -2195,7 +2071,6 @@ Page({ | ||
| 2195 | this.calculatePrice2(); | 2071 | this.calculatePrice2(); |
| 2196 | }, | 2072 | }, |
| 2197 | 2073 | ||
| 2198 | - | ||
| 2199 | //--------立即支付---------- | 2074 | //--------立即支付---------- |
| 2200 | async jumpToCart4(e) { | 2075 | async jumpToCart4(e) { |
| 2201 | var th=this; | 2076 | var th=this; |
| @@ -2572,7 +2447,6 @@ Page({ | @@ -2572,7 +2447,6 @@ Page({ | ||
| 2572 | 2447 | ||
| 2573 | }, | 2448 | }, |
| 2574 | 2449 | ||
| 2575 | - | ||
| 2576 | //--------取消订单--------- | 2450 | //--------取消订单--------- |
| 2577 | cancelOrder: function(e) { | 2451 | cancelOrder: function(e) { |
| 2578 | var t = this,th=t, ord_id = this.data.order.order_id,order=this.data.order; | 2452 | var t = this,th=t, ord_id = this.data.order.order_id,order=this.data.order; |
packageC/pages/presell/cart/cart.wxml
| @@ -10,7 +10,8 @@ | @@ -10,7 +10,8 @@ | ||
| 10 | <view class="pdr20"> | 10 | <view class="pdr20"> |
| 11 | <text class="iconfont icon-qianbao fs60"></text> | 11 | <text class="iconfont icon-qianbao fs60"></text> |
| 12 | </view> | 12 | </view> |
| 13 | - | 13 | + |
| 14 | + | ||
| 14 | <view wx:if="{{wait_dj}}"> | 15 | <view wx:if="{{wait_dj}}"> |
| 15 | <view>等待买家付定金</view> | 16 | <view>等待买家付定金</view> |
| 16 | <view>{{filters.format_time(act.start_time,1)}} - {{filters.format_time(act.end_time,1)}} </view> | 17 | <view>{{filters.format_time(act.start_time,1)}} - {{filters.format_time(act.end_time,1)}} </view> |
| @@ -30,7 +31,7 @@ | @@ -30,7 +31,7 @@ | ||
| 30 | <view>等待买家付尾款</view> | 31 | <view>等待买家付尾款</view> |
| 31 | <view class="fs22">请于{{days}}天{{hours}}小时{{minutes}}分{{seconds}}秒内付款完成,超时订单将自动取消</view> | 32 | <view class="fs22">请于{{days}}天{{hours}}小时{{minutes}}分{{seconds}}秒内付款完成,超时订单将自动取消</view> |
| 32 | </view> | 33 | </view> |
| 33 | - <view wx:if="{{wait_fh}}"> | 34 | + <view wx:if="{{wait_fh && order.order_status!=6}}"> |
| 34 | <view>等待商家发货</view> | 35 | <view>等待商家发货</view> |
| 35 | <view class="fs22">将在{{filters.format_time(send_time,1)}}后发货</view> | 36 | <view class="fs22">将在{{filters.format_time(send_time,1)}}后发货</view> |
| 36 | </view> | 37 | </view> |
| @@ -220,7 +221,7 @@ | @@ -220,7 +221,7 @@ | ||
| 220 | </view> | 221 | </view> |
| 221 | 222 | ||
| 222 | 223 | ||
| 223 | - <view class="set-mes bdr_b-14" wx:if="{{presell.deposit_pay_time>0 && presell.tail_pay_state==0 && !no_start && !wait_dj && order.order_status<2}}"> | 224 | + <view class="set-mes bdr_b-14" wx:if="{{presell.presell_type==0 && presell.deposit_pay_time>0 && presell.tail_pay_state==0 && !no_start && !wait_dj && order.order_status<2}}"> |
| 224 | <view wx:if="{{order.store_prom}}"> | 225 | <view wx:if="{{order.store_prom}}"> |
| 225 | <icon color="#f23030" size="16" type="info"></icon> | 226 | <icon color="#f23030" size="16" type="info"></icon> |
| 226 | {{order.store_prom}} | 227 | {{order.store_prom}} |
| @@ -293,21 +294,42 @@ | @@ -293,21 +294,42 @@ | ||
| 293 | <view>商品金额</view> | 294 | <view>商品金额</view> |
| 294 | <view class="co-red">¥ {{filters.toFix(allpice,2)}}元</view> | 295 | <view class="co-red">¥ {{filters.toFix(allpice,2)}}元</view> |
| 295 | </view> | 296 | </view> |
| 296 | - <view class="item" wx:if="{{exp_price>0}}"> | ||
| 297 | - <view>配送费用</view> | ||
| 298 | - <view class="co-red">¥ {{filters.toFix(exp_price,2)}}元</view> | ||
| 299 | - </view> | ||
| 300 | - | ||
| 301 | - <view class="item" wx:if="{{quan_price>0}}"> | ||
| 302 | - <view>优惠券优惠</view> | ||
| 303 | - <view class="co-red">¥ -{{filters.toFix(quan_price,2)}}元</view> | ||
| 304 | - </view> | ||
| 305 | - | ||
| 306 | - <view class="item" wx:if="{{order_prom_amount>0}}"> | ||
| 307 | - <view>订单优惠</view> | ||
| 308 | - <view class="co-red">¥ -{{filters.toFix(order_prom_amount,2)}}元</view> | ||
| 309 | - </view> | ||
| 310 | - | 297 | + |
| 298 | + <!-- 未支付订单,没有取消的 --> | ||
| 299 | + <block wx:if="{{order.pay_status<1 && order.order_status<2}}"> | ||
| 300 | + <view class="item" wx:if="{{exp_price>0}}"> | ||
| 301 | + <view>配送费用</view> | ||
| 302 | + <view class="co-red">¥ {{filters.toFix(exp_price,2)}}元</view> | ||
| 303 | + </view> | ||
| 304 | + | ||
| 305 | + <view class="item" wx:if="{{quan_price>0}}"> | ||
| 306 | + <view>优惠券优惠</view> | ||
| 307 | + <view class="co-red">¥ -{{filters.toFix(quan_price,2)}}元</view> | ||
| 308 | + </view> | ||
| 309 | + | ||
| 310 | + <view class="item" wx:if="{{order_prom_amount>0}}"> | ||
| 311 | + <view>订单优惠</view> | ||
| 312 | + <view class="co-red">¥ -{{filters.toFix(order_prom_amount,2)}}元</view> | ||
| 313 | + </view> | ||
| 314 | + </block> | ||
| 315 | + | ||
| 316 | + <block else> | ||
| 317 | + <view class="item" wx:if="{{order.shipping_status>0}}"> | ||
| 318 | + <view>配送费用</view> | ||
| 319 | + <view class="co-red">¥ {{filters.toFix(order.shipping_status,2)}}元</view> | ||
| 320 | + </view> | ||
| 321 | + | ||
| 322 | + <view class="item" wx:if="{{order.coupon_price>0}}"> | ||
| 323 | + <view>优惠券优惠</view> | ||
| 324 | + <view class="co-red">¥ -{{filters.toFix(order.coupon_price,2)}}元</view> | ||
| 325 | + </view> | ||
| 326 | + | ||
| 327 | + <view class="item" wx:if="{{order.order_prom_amount>0}}"> | ||
| 328 | + <view>订单优惠</view> | ||
| 329 | + <view class="co-red">¥ -{{filters.toFix(order.order_prom_amount,2)}}元</view> | ||
| 330 | + </view> | ||
| 331 | + | ||
| 332 | + </block> | ||
| 311 | </view> | 333 | </view> |
| 312 | 334 | ||
| 313 | <view class="information bdr14 mgt20"> | 335 | <view class="information bdr14 mgt20"> |
| @@ -337,11 +359,11 @@ | @@ -337,11 +359,11 @@ | ||
| 337 | <view class="btn-wrap"> | 359 | <view class="btn-wrap"> |
| 338 | <view class="pay-amount"> | 360 | <view class="pay-amount"> |
| 339 | <view class="payable">应付金额: | 361 | <view class="payable">应付金额: |
| 340 | - <text class="co-red"> <text class="fs24">¥</text>{{filters.toFix(order_m-presell.presell_deposit,2)}}</text> | 362 | + <text class="co-red"> <text class="fs24">¥</text>{{filters.toFix(order_m,2)}}</text> |
| 341 | </view> | 363 | </view> |
| 342 | </view> | 364 | </view> |
| 343 | - <button wx:if="{{no_start || is_end || is_complete}}" class="tips-btn gray">提交订单</button> | ||
| 344 | - <button wx:else class="tips-btn" bindtap="show_pay">提交订单</button> | 365 | + <button wx:if="{{no_start || is_end || is_complete}}" class="tips-btn gray">支付尾款</button> |
| 366 | + <button wx:else class="tips-btn" bindtap="show_pay">支付尾款</button> | ||
| 345 | <!-- 预售 --> | 367 | <!-- 预售 --> |
| 346 | <!-- <button class="tips-btn" formType="submit" id="submitOrder">立即支付</button> --> | 368 | <!-- <button class="tips-btn" formType="submit" id="submitOrder">立即支付</button> --> |
| 347 | </view> | 369 | </view> |
| @@ -461,7 +483,7 @@ | @@ -461,7 +483,7 @@ | ||
| 461 | <include src="remark_part.wxml"/> | 483 | <include src="remark_part.wxml"/> |
| 462 | </view> | 484 | </view> |
| 463 | <!-- 包邮券的显示,立即购买 --> | 485 | <!-- 包邮券的显示,立即购买 --> |
| 464 | - <block wx:if="{{ is_b_now && bn_exp_type==0}}"> | 486 | + <block wx:if="{{exp_type==0}}"> |
| 465 | <view wx:for="{{get_by_quan_list}}" bindtap="sele_quan_item_by" wx:if="{{!item.is_using}}" | 487 | <view wx:for="{{get_by_quan_list}}" bindtap="sele_quan_item_by" wx:if="{{!item.is_using}}" |
| 466 | data-ind="{{byq_index}}" | 488 | data-ind="{{byq_index}}" |
| 467 | wx:for-item="item" wx:for-index="byq_index"> | 489 | wx:for-item="item" wx:for-index="byq_index"> |
| @@ -472,9 +494,7 @@ | @@ -472,9 +494,7 @@ | ||
| 472 | <!-- 左边 --> | 494 | <!-- 左边 --> |
| 473 | <view class="coupon-left rel {{filter.setcolor(item.UseObjectType)}} flex-center"> | 495 | <view class="coupon-left rel {{filter.setcolor(item.UseObjectType)}} flex-center"> |
| 474 | <view class="white xc-money-frames"> | 496 | <view class="white xc-money-frames"> |
| 475 | - <view class="f_text"> | ||
| 476 | - <text class="xc-rmb-val">包邮券</text> | ||
| 477 | - </view> | 497 | + <view class="f_text"><text class="xc-rmb-val">包邮券</text></view> |
| 478 | <view class="coupon-explain t-c" wx:if="{{item.condition>0}}"> | 498 | <view class="coupon-explain t-c" wx:if="{{item.condition>0}}"> |
| 479 | 满{{item.condition}}元可用 | 499 | 满{{item.condition}}元可用 |
| 480 | </view> | 500 | </view> |
| @@ -487,9 +507,7 @@ | @@ -487,9 +507,7 @@ | ||
| 487 | <view class="flex top-frame"> | 507 | <view class="flex top-frame"> |
| 488 | <view class="frame"> | 508 | <view class="frame"> |
| 489 | <view class="coupon-wode ib flex ellipsis-2 "> | 509 | <view class="coupon-wode ib flex ellipsis-2 "> |
| 490 | - <text class="xc-brand t-c ib white {{filter.setcolor(item.UseObjectType)}}"> | ||
| 491 | - {{filter.get_type_card(0)}} | ||
| 492 | - </text> | 510 | + <text class="xc-brand t-c ib white {{filter.setcolor(item.UseObjectType)}}">{{filter.get_type_card(0)}}</text> |
| 493 | <block>包邮券</block> | 511 | <block>包邮券</block> |
| 494 | </view> | 512 | </view> |
| 495 | <view class="coupon-time"> | 513 | <view class="coupon-time"> |
packageC/pages/presell/cart/cart2.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, to = getApp(); | ||
| 3 | +var oo = t.globalData.setting, os = oo; | ||
| 4 | +var regeneratorRuntime = require('../../../../utils/runtime.js'); | ||
| 5 | +var util_pay = require("../../../../utils/pay.js"); | ||
| 6 | + | ||
| 7 | + | ||
| 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: 1, //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 | + in_zhact_gdmap:{}, //不同门店参与同一活动的限购 | ||
| 125 | + hid_inp:1, | ||
| 126 | + user_note:{}, | ||
| 127 | + }, | ||
| 128 | + onLoad: function (t) { | ||
| 129 | + wx.setNavigationBarTitle({title: "填写订单",}) | ||
| 130 | + var th = this; | ||
| 131 | + //清理一下,确保最新的系统配置 | ||
| 132 | + getApp().globalData.config2 = null; | ||
| 133 | + //清空is_pick_up | ||
| 134 | + getApp().request.put("/api/weshop/useraddress/updatePickUp", { | ||
| 135 | + data: {user_id: getApp().globalData.user_id, is_pickup: 0}, | ||
| 136 | + success: function (s) { | ||
| 137 | + } | ||
| 138 | + }); | ||
| 139 | + | ||
| 140 | + }, | ||
| 141 | + onUnload: function () { | ||
| 142 | + this.setData({isclose: 1}) | ||
| 143 | + }, | ||
| 144 | + onHide: function () { | ||
| 145 | + this.setData({ | ||
| 146 | + isget_by_quan: {}, | ||
| 147 | + is_no_by: {}, | ||
| 148 | + is_by: {} | ||
| 149 | + }) | ||
| 150 | + }, | ||
| 151 | + | ||
| 152 | + //----------子页返回父页触发---------- | ||
| 153 | + onShow: function () { | ||
| 154 | + var th = this; | ||
| 155 | + th.setData({show_submit: 0}); //让提交先掩藏 | ||
| 156 | + th.data.g_cart_q_time = null; | ||
| 157 | + | ||
| 158 | + if (th.data.isclose == 0) { | ||
| 159 | + wx.navigateTo({ | ||
| 160 | + url: "/pages/index/index/index" | ||
| 161 | + }) | ||
| 162 | + | ||
| 163 | + } else { | ||
| 164 | + this.getuser_addr(function (ie) { | ||
| 165 | + | ||
| 166 | + //地址切换要把包邮券清空 | ||
| 167 | + if (!th.data.user_addr || !ie || th.data.user_addr.address_id != ie.address_id) { | ||
| 168 | + var using_quan = th.data.using_quan; | ||
| 169 | + for (var i in using_quan) { | ||
| 170 | + var item = using_quan[i]; | ||
| 171 | + if (item.isby == 1) { | ||
| 172 | + var ob = {}, txt = "using_quan[" + i + "]"; | ||
| 173 | + ob[txt] = {}; | ||
| 174 | + th.setData(ob); | ||
| 175 | + } | ||
| 176 | + } | ||
| 177 | + th.data.isget_by_quan = {}; | ||
| 178 | + } | ||
| 179 | + | ||
| 180 | + | ||
| 181 | + th.data.prom_goods_map = {}; | ||
| 182 | + th.data.is_summit_ing = 0; | ||
| 183 | + //更换地址回来要重新调用计算价钱的接口 | ||
| 184 | + if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) { | ||
| 185 | + th.setData({user_addr: ie}); | ||
| 186 | + if (th.data.is_b_now == 1) { | ||
| 187 | + if (th.data.bn_goods) { | ||
| 188 | + th.setData({add_back: 1}); | ||
| 189 | + //th.calculatePrice2(); | ||
| 190 | + } | ||
| 191 | + } else { | ||
| 192 | + if (th.data.cartlist) { | ||
| 193 | + th.setData({add_back: 1}); | ||
| 194 | + //th.calculatePrice(); | ||
| 195 | + } | ||
| 196 | + } | ||
| 197 | + } else { | ||
| 198 | + th.setData({user_addr: ie}); | ||
| 199 | + } | ||
| 200 | + var going = 0; | ||
| 201 | + | ||
| 202 | + }); | ||
| 203 | + var is_card_back = getApp().globalData.is_card_back; | ||
| 204 | + //--更新默认地址--,看一下是不是跳到地址页面,同时也不是购买等级卡返回的,这里很重要,否则会重新更新收货物流公司 | ||
| 205 | + if (!getApp().globalData.is_cart_old && !is_card_back && !getApp().globalData.plus_buy_back) { | ||
| 206 | + this.update_code(); | ||
| 207 | + } else { | ||
| 208 | + getApp().globalData.is_cart_old = 0; | ||
| 209 | + getApp().globalData.plus_buy_back = 0; | ||
| 210 | + } | ||
| 211 | + } | ||
| 212 | + | ||
| 213 | + //先获取是否有关闭使用优惠券 | ||
| 214 | + getApp().getConfig2(function (ee) { | ||
| 215 | + var json_d = JSON.parse(ee.switch_list); | ||
| 216 | + th.data.json_d = json_d; | ||
| 217 | + th.data.ispt_goods = json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 | ||
| 218 | + var is_default_logistics = json_d.is_default_logistics; | ||
| 219 | + | ||
| 220 | + th.setData({ | ||
| 221 | + is_close_quan: json_d.is_close_quan, | ||
| 222 | + sales_rules: ee.sales_rules, | ||
| 223 | + rank_switch: json_d.rank_switch, | ||
| 224 | + is_default_logistics: is_default_logistics | ||
| 225 | + }); | ||
| 226 | + | ||
| 227 | + var rank_switch = json_d.rank_switch; | ||
| 228 | + var max_price = -1; | ||
| 229 | + var show_card = null; | ||
| 230 | + var name = ""; | ||
| 231 | + //如果有开等级卡的时候, | ||
| 232 | + //因为都是调接口,要返回在计算 | ||
| 233 | + if (rank_switch == 2) { | ||
| 234 | + //-- 获取所有的等级卡, -- | ||
| 235 | + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?storeId=" + os.stoid, | ||
| 236 | + {}).then(res => { | ||
| 237 | + if (res.data.code == 0) { | ||
| 238 | + var plusCard = res.data.data; | ||
| 239 | + //-- 循环判断,拿到最贵的那张卡 -- | ||
| 240 | + for (var ih in plusCard) { | ||
| 241 | + if (plusCard[ih].IsStopBuy == true) { | ||
| 242 | + continue; | ||
| 243 | + } | ||
| 244 | + if (max_price < 0) { | ||
| 245 | + max_price = plusCard[ih].CardFee; | ||
| 246 | + name = 'card' + plusCard[ih]['CorrPrice']; | ||
| 247 | + show_card = plusCard[ih]; | ||
| 248 | + } else { | ||
| 249 | + if (max_price < plusCard[ih].CardFee) { | ||
| 250 | + max_price = plusCard[ih].CardFee; | ||
| 251 | + name = 'card' + plusCard[ih]['CorrPrice']; | ||
| 252 | + show_card = plusCard[ih]; | ||
| 253 | + } | ||
| 254 | + } | ||
| 255 | + } | ||
| 256 | + | ||
| 257 | + if (show_card) { | ||
| 258 | + name = name.toLowerCase(); | ||
| 259 | + th.setData({card_name: name, show_card: show_card}) | ||
| 260 | + } | ||
| 261 | + } | ||
| 262 | + //-----先获取物流,再获取用户信息,再展示页面----- | ||
| 263 | + th.get_wuliu(th.get_info(th.show_page)); | ||
| 264 | + }) | ||
| 265 | + } else { | ||
| 266 | + //-----先获取物流,再获取用户信息,再展示页面----- | ||
| 267 | + th.get_wuliu(th.get_info(th.show_page)); | ||
| 268 | + } | ||
| 269 | + | ||
| 270 | + }, 1); | ||
| 271 | + | ||
| 272 | + //值在这里换 | ||
| 273 | + getApp().globalData.plus_buy_back = 0; | ||
| 274 | + }, | ||
| 275 | + | ||
| 276 | + //-------------------获取物流--------------- | ||
| 277 | + get_wuliu(func) { | ||
| 278 | + var th = this; | ||
| 279 | + to.getwuliu(function (e) { | ||
| 280 | + //系统是是否开启了默认的物流 | ||
| 281 | + if (th.data.is_default_logistics) { | ||
| 282 | + //如果第一个不是开启默认,说明要让用户自己选 | ||
| 283 | + if (!e[0].is_default) { | ||
| 284 | + th.setData({is_default_logistics: 0}); | ||
| 285 | + } | ||
| 286 | + } | ||
| 287 | + th.setData({wu_arr: e}) | ||
| 288 | + typeof func == "function" && func(); | ||
| 289 | + }) | ||
| 290 | + }, | ||
| 291 | + //------获取会员信息-----先获取用户信息,在进行下一步--- | ||
| 292 | + get_info: function (func) { | ||
| 293 | + var user_id = t.globalData.user_id; | ||
| 294 | + to.auth.get_u(func); | ||
| 295 | + }, | ||
| 296 | + | ||
| 297 | + //------获取会员收货地址----- | ||
| 298 | + getuser_addr: function (func) { | ||
| 299 | + var th = this; | ||
| 300 | + a.get("/api/weshop/useraddress/page", { | ||
| 301 | + data: {user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600, t: Math.random()}, | ||
| 302 | + success: function (su) { | ||
| 303 | + /*--- | ||
| 304 | + var user_addr=[ | ||
| 305 | + { 'address_id': 882, 'user_id': 2661, 'consignee': '测试测试测', 'province': 3102, 'city': 3431, 'district': 3466, | ||
| 306 | + 'address': 'ed', 'more_address': '山西-长治市-襄垣县-虎(音si)亭镇', 'mobile': 13012345678,'is_default':1}, | ||
| 307 | + ];---*/ | ||
| 308 | + var item = null; | ||
| 309 | + if (su.data.code == 0 && su.data.data && su.data.data.pageData) { | ||
| 310 | + var user_addr = su.data.data.pageData; | ||
| 311 | + var def_item = null; | ||
| 312 | + for (var i = 0; i < user_addr.length; i++) { | ||
| 313 | + if (user_addr[i]['is_default'] == 1) { | ||
| 314 | + def_item = user_addr[i]; | ||
| 315 | + } | ||
| 316 | + if (user_addr[i]['is_pickup'] == 1) { | ||
| 317 | + item = user_addr[i]; | ||
| 318 | + } | ||
| 319 | + } | ||
| 320 | + | ||
| 321 | + if (item == null) item = def_item; | ||
| 322 | + if (item == null) item = user_addr[0]; | ||
| 323 | + } | ||
| 324 | + | ||
| 325 | + if (item == undefined) item = null; | ||
| 326 | + if (!item) th.setData({user_addr: null}); //地址为空的时候,要清空,因为返回的时候,有缓存 | ||
| 327 | + | ||
| 328 | + func(item); | ||
| 329 | + } | ||
| 330 | + }); | ||
| 331 | + }, | ||
| 332 | + | ||
| 333 | + //----------------展示页面,是再获取用户信息之后-------------- | ||
| 334 | + show_page: function () { | ||
| 335 | + var th = this; | ||
| 336 | + //th.setData({ userinfo: getApp().globalData.userInfo,}); //这个余额被缓存了 | ||
| 337 | + | ||
| 338 | + //会员的信息,要获取最新 | ||
| 339 | + var user = getApp().globalData.userInfo; | ||
| 340 | + getApp().request.get("/api/weshop/users/get/" + oo.stoid + "/" + user.user_id, { | ||
| 341 | + data: {r: Math.random()}, | ||
| 342 | + success: function (e) { | ||
| 343 | + getApp().globalData.userInfo = e.data.data; | ||
| 344 | + th.setData({userinfo: e.data.data}); | ||
| 345 | + | ||
| 346 | + //选获取地址 | ||
| 347 | + th.getuser_addr(function (addr) { | ||
| 348 | + th.setData({user_addr: addr}); | ||
| 349 | + //--------------------------立即购买------------------ | ||
| 350 | + //读取门店 | ||
| 351 | + to.get_allsto(function (e) { | ||
| 352 | + th.setData({allsto: e}); | ||
| 353 | + //获取立即购买的商品信息 | ||
| 354 | + th.get_buy_goods(); | ||
| 355 | + }); | ||
| 356 | + | ||
| 357 | + }); | ||
| 358 | + | ||
| 359 | + //获取提现金额 | ||
| 360 | + getApp().request.get("/api/weshop/withdrawals/summoney", { | ||
| 361 | + data: {user_id: to.globalData.user_id, store_id: oo.stoid, status: 0}, | ||
| 362 | + success: function (su) { | ||
| 363 | + if (su.data.code == 0) { | ||
| 364 | + var yuer = parseFloat(th.data.userinfo.user_money - | ||
| 365 | + (th.data.userinfo.frozen_money > 0 ? th.data.userinfo.frozen_money : 0) - su.data.data.summoney).toFixed(2); | ||
| 366 | + th.setData({txmon: su.data.data.summoney, yuer: yuer}); | ||
| 367 | + } | ||
| 368 | + } | ||
| 369 | + }); | ||
| 370 | + | ||
| 371 | + }, | ||
| 372 | + }); | ||
| 373 | + | ||
| 374 | + }, | ||
| 375 | + | ||
| 376 | + //-----获取立即购买的商品信息,入口---- | ||
| 377 | + get_buy_goods: function (e) { | ||
| 378 | + var th = this; | ||
| 379 | + th.data.gg = to.get_b_now(); | ||
| 380 | + //--------如果goods_id一样,就是要立即购买----- | ||
| 381 | + getApp().request.get("/api/weshop/goods/get/" + oo.stoid + "/" + th.data.gg.goods_id, { | ||
| 382 | + success: async function (t) { | ||
| 383 | + var gd = t.data.data; | ||
| 384 | + if (!gd) return false; | ||
| 385 | + | ||
| 386 | + t.data.data.original_img = oo.imghost + t.data.data.original_img; | ||
| 387 | + t.data.data['buynum'] = th.data.gg.goods_num; | ||
| 388 | + var distr_t = 0, et = 0 | ||
| 389 | + if (t.data.data.distr_type == 0) { | ||
| 390 | + distr_t = th.data.gg.pick_dis; | ||
| 391 | + } else { | ||
| 392 | + distr_t = t.data.data.distr_type; | ||
| 393 | + } | ||
| 394 | + | ||
| 395 | + switch (distr_t) { | ||
| 396 | + case 0: | ||
| 397 | + et = 1; | ||
| 398 | + //-- 系统后台有设置要默认的 -- | ||
| 399 | + if (th.data.json_d.pickupway && th.data.json_d.pickupway == 1) et = 0; | ||
| 400 | + break; | ||
| 401 | + case 1: | ||
| 402 | + et = 1; | ||
| 403 | + break; | ||
| 404 | + case 2: | ||
| 405 | + et = 0; | ||
| 406 | + break; | ||
| 407 | + } | ||
| 408 | + | ||
| 409 | + | ||
| 410 | + var m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; | ||
| 411 | + if (et == 0 && def_exp_code) { | ||
| 412 | + for (var k = 0; k < th.data.wu_arr.length; k++) { | ||
| 413 | + var item = th.data.wu_arr[k]; | ||
| 414 | + if (def_exp_code == item.code) { | ||
| 415 | + m_wind = k; | ||
| 416 | + } | ||
| 417 | + } | ||
| 418 | + } | ||
| 419 | + | ||
| 420 | + if (th.data.bn_goods) { | ||
| 421 | + et = th.data.bn_exp_type; | ||
| 422 | + m_wind = th.data.index; | ||
| 423 | + } | ||
| 424 | + | ||
| 425 | + //---是不是购买等级卡成功的返回---等级卡显示的判断--- | ||
| 426 | + var is_card_back = getApp().globalData.is_card_back; | ||
| 427 | + if (is_card_back) { | ||
| 428 | + th.data.card_name = th.data.userinfo.card_field; | ||
| 429 | + th.data.gg.goods_price = gd[th.data.card_name]; | ||
| 430 | + getApp().globalData.is_card_back = 0; | ||
| 431 | + th.setData({card_cut_price: 0}); | ||
| 432 | + //如果是秒杀的返回 | ||
| 433 | + if (gd.prom_type == 1) gd.prom_type = 0; | ||
| 434 | + } else { | ||
| 435 | + //--- 商家等级卡开通的情况下, 会员不是等级会员的情况, 商品有设置等级卡价格,同时等级卡价格小于商品的价格 | ||
| 436 | + //-- 搭配购的商品也可以单独购买,所以此时搭配购的商品要进行计算优惠 -- | ||
| 437 | + if (!th.data.gg.collocation_goods && gd['prom_type'] != 6 && th.data.card_name && gd[th.data.card_name] > 0 && th.data.gg.goods_price > gd[th.data.card_name] && !th.data.userinfo.card_field) { | ||
| 438 | + var cut_p = (th.data.gg.goods_price - gd[th.data.card_name]) * th.data.gg.goods_num; | ||
| 439 | + th.setData({card_cut_price: cut_p}); | ||
| 440 | + } | ||
| 441 | + } | ||
| 442 | + | ||
| 443 | + //定义变量 | ||
| 444 | + var gg = th.data.gg,act = null,prelist = null; | ||
| 445 | + var url = "/api/weshop/marketing/marketingPresellForm/get/" + os.stoid + "/" + gg.prom_id; | ||
| 446 | + await getApp().request.promiseGet(url, {}).then(res => { | ||
| 447 | + if (res.data.code == 0) { | ||
| 448 | + act = res.data.data; | ||
| 449 | + } | ||
| 450 | + }) | ||
| 451 | + if (!act) { | ||
| 452 | + wx.showToast({title: "未找到活动", icon: 'none', duration: 3000}); | ||
| 453 | + return false; | ||
| 454 | + } | ||
| 455 | + if (act.is_end==1 ) { | ||
| 456 | + wx.showToast({title:'活动已经结束' , icon: 'none', duration: 3000}); | ||
| 457 | + return false; | ||
| 458 | + } | ||
| 459 | + if( ut.gettimestamp()>act.end_time){ | ||
| 460 | + wx.showToast({title:"活动定金支付时间已过期" , icon: 'none', duration: 3000}); | ||
| 461 | + return false; | ||
| 462 | + } | ||
| 463 | + | ||
| 464 | + var url = "/api/weshop/marketing/marketingPresellList/get/" + os.stoid + "/" + gg.presell_list_id; | ||
| 465 | + await getApp().request.promiseGet(url, {}).then(res => { | ||
| 466 | + if (res.data.code == 0) { | ||
| 467 | + prelist = res.data.data; | ||
| 468 | + } | ||
| 469 | + }) | ||
| 470 | + if (!prelist) { | ||
| 471 | + wx.showToast({title: "未找到商品", icon: 'none', duration: 3000}); | ||
| 472 | + return false; | ||
| 473 | + } | ||
| 474 | + | ||
| 475 | + //这个位置要拿活动的预售价 | ||
| 476 | + t.data.data.shop_price = prelist.presell_money; | ||
| 477 | + th.setData({ | ||
| 478 | + bn_goods: t.data.data, | ||
| 479 | + bn_pickname: gg.pick_name, | ||
| 480 | + bn_exp_type: et, | ||
| 481 | + index: m_wind, | ||
| 482 | + bn_pick: gg.pick_id, | ||
| 483 | + bn_t_exp_t: distr_t, | ||
| 484 | + bn_exp_type: et, | ||
| 485 | + act:act | ||
| 486 | + }); | ||
| 487 | + | ||
| 488 | + if(act.is_usecoupon==1){ | ||
| 489 | + th.data.ckeck_quan_price = t.data.data.shop_price * gg.goods_num; | ||
| 490 | + th.data.check_quan_price_list = t.data.data.shop_price * gg.goods_num + ""; | ||
| 491 | + th.data.check_quan_ware_list = t.data.data.erpwareid + ""; | ||
| 492 | + } | ||
| 493 | + | ||
| 494 | + | ||
| 495 | + //计算价格 | ||
| 496 | + th.calculatePrice2(); | ||
| 497 | + //获取优惠券,如果有券的钱,就调用 | ||
| 498 | + if(th.data.ckeck_quan_price>0) th.get_buy_now_quan(); | ||
| 499 | + | ||
| 500 | + | ||
| 501 | + }, | ||
| 502 | + }); | ||
| 503 | + | ||
| 504 | + }, | ||
| 505 | + | ||
| 506 | + //---------------检查是否有收货地址------------------- | ||
| 507 | + checkAddressList: function () { | ||
| 508 | + var t = this; | ||
| 509 | + return !(!this.data.order || null == this.data.order.userAddress) || (wx.showModal({ | ||
| 510 | + title: "请先填写或选择收货地址~", | ||
| 511 | + success: function (a) { | ||
| 512 | + a.confirm ? t.enterAddressPage() : wx.navigateBack(); | ||
| 513 | + }, | ||
| 514 | + fail: function () { | ||
| 515 | + wx.navigateBack(); | ||
| 516 | + } | ||
| 517 | + }), !1); | ||
| 518 | + }, | ||
| 519 | + showInvoice: function () { | ||
| 520 | + this.setData({ | ||
| 521 | + invoiceToggle: !this.data.invoiceToggle | ||
| 522 | + }); | ||
| 523 | + }, | ||
| 524 | + keyUpChangePay1: function (t) { | ||
| 525 | + this.setData({ | ||
| 526 | + payWithUserMoney: !(t.detail.value.length > 0) | ||
| 527 | + }); | ||
| 528 | + }, | ||
| 529 | + keyUpChangePay2: function (t) { | ||
| 530 | + this.setData({ | ||
| 531 | + payWithPoints: !(t.detail.value.length > 0) | ||
| 532 | + }); | ||
| 533 | + }, | ||
| 534 | + keyUpChangeNum: function (t) { | ||
| 535 | + var index = t.currentTarget.dataset.index; | ||
| 536 | + var txt="user_note."+index; | ||
| 537 | + this.setData({ | ||
| 538 | + maxWord: t.detail.value.length, | ||
| 539 | + [txt]: t.detail.value | ||
| 540 | + }); | ||
| 541 | + }, | ||
| 542 | + set_can_num: function () { | ||
| 543 | + var th = this; | ||
| 544 | + //-- 这个地方,循环计算几张优惠券可用-- | ||
| 545 | + for (var iter in th.data.cartlist) { | ||
| 546 | + var num = 0; | ||
| 547 | + var c_item = th.data.cartlist[iter]; | ||
| 548 | + var pkid = c_item.pickup_id; | ||
| 549 | + //-- 普通券 -- | ||
| 550 | + if (c_item.quan_list) { | ||
| 551 | + for (var iter1 in c_item.quan_list) { | ||
| 552 | + //判断是不是其他订单有选用 | ||
| 553 | + var is_other_is_use = th.check_other_use(c_item.quan_list[iter1], pkid); | ||
| 554 | + if (!is_other_is_use) num++; | ||
| 555 | + } | ||
| 556 | + } | ||
| 557 | + //-- 包邮券 -- | ||
| 558 | + var by_quan = th.data.get_by_quan_list_cart[pkid]; | ||
| 559 | + if (by_quan) { | ||
| 560 | + for (var iter2 in by_quan) { | ||
| 561 | + //判断是不是其他订单有选用 | ||
| 562 | + var is_other_is_use = th.check_other_use_by(by_quan[iter2], pkid); | ||
| 563 | + if (!is_other_is_use) num++; | ||
| 564 | + } | ||
| 565 | + } | ||
| 566 | + var set_txt = "cartlist[" + iter + "].can_num"; | ||
| 567 | + th.setData({[set_txt]: num}); | ||
| 568 | + } | ||
| 569 | + }, | ||
| 570 | + | ||
| 571 | + | ||
| 572 | + //---------计算立即购买---------- | ||
| 573 | + calculatePrice2: function () { | ||
| 574 | + var th = this, good = this.data.bn_goods; | ||
| 575 | + if (!good) return false; | ||
| 576 | + | ||
| 577 | + //搭配的计算要用购物的车计算方法 | ||
| 578 | + if (good.prom_type == 5) { | ||
| 579 | + th.calculatePrice(); | ||
| 580 | + return false; | ||
| 581 | + } | ||
| 582 | + | ||
| 583 | + wx.showLoading({ | ||
| 584 | + title: "处理中." | ||
| 585 | + }) | ||
| 586 | + //-----------计算商品总价-------------- | ||
| 587 | + var allpice = good.shop_price * good.buynum; | ||
| 588 | + var cut_price = 0; | ||
| 589 | + var allpice1 = allpice; | ||
| 590 | + | ||
| 591 | + | ||
| 592 | + if (good.prom_type == 3 && good.prom_price !== null) { | ||
| 593 | + cut_price = allpice - good.prom_price; | ||
| 594 | + } | ||
| 595 | + | ||
| 596 | + allpice = parseFloat(allpice).toFixed(2); | ||
| 597 | + var txt = "formData.all_price"; | ||
| 598 | + th.setData({[txt]: allpice,}); | ||
| 599 | + if (cut_price) { | ||
| 600 | + var c_txt = "formData.cut_price"; | ||
| 601 | + th.setData({[c_txt]: cut_price,}); | ||
| 602 | + | ||
| 603 | + } | ||
| 604 | + | ||
| 605 | + //如果有线下取价的时候 | ||
| 606 | + if (good.is_offline) { | ||
| 607 | + allpice = good.offline_price * good.buynum; | ||
| 608 | + } | ||
| 609 | + | ||
| 610 | + | ||
| 611 | + to.getConfig2(function (ee) { | ||
| 612 | + to.getwuliuprice(async function (rs) { | ||
| 613 | + | ||
| 614 | + var o_shipping_price = 0, goods_weight = -1, goods_piece = -1; | ||
| 615 | + | ||
| 616 | + //---如果有选择优惠券的情况下--- | ||
| 617 | + var quan_price = 0, bn_pick = th.data.bn_pick; | ||
| 618 | + var quan_no = null; | ||
| 619 | + if (th.data.using_quan[bn_pick] != null && th.data.using_quan[bn_pick] != undefined) | ||
| 620 | + quan_no = th.data.using_quan[bn_pick].coupon_no; | ||
| 621 | + | ||
| 622 | + if (quan_no) { | ||
| 623 | + if (th.data.using_quan[bn_pick].isby != 1) { | ||
| 624 | + //---获取优惠券优惠--- | ||
| 625 | + await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", { | ||
| 626 | + data: { | ||
| 627 | + storeId: oo.stoid, | ||
| 628 | + CashRepNo: quan_no, | ||
| 629 | + WaresSum: th.data.ckeck_quan_price, | ||
| 630 | + WareIds: th.data.check_quan_ware_list | ||
| 631 | + } | ||
| 632 | + }).then(res => { | ||
| 633 | + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { | ||
| 634 | + quan_price = res.data.data[0].WareCashSum; | ||
| 635 | + } | ||
| 636 | + }) | ||
| 637 | + } | ||
| 638 | + } | ||
| 639 | + | ||
| 640 | + //-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮---------- | ||
| 641 | + if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && good.is_past != 1) { | ||
| 642 | + //看是不是有调用过包邮券 | ||
| 643 | + if (!th.data.isget_by_quan[th.data.bn_pick] && good.is_xz_yh != 1) { | ||
| 644 | + var condition = allpice - cut_price - quan_price; | ||
| 645 | + //--判断要不要显示包邮券,链式调用接口,调取包邮券,已经是减了优惠的金额,见到优惠券的钱--- | ||
| 646 | + getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", { | ||
| 647 | + data: { | ||
| 648 | + store_id: os.stoid, | ||
| 649 | + isuse: 0, | ||
| 650 | + condition: condition, | ||
| 651 | + user_id: getApp().globalData.user_id, | ||
| 652 | + pageSize: 2000 | ||
| 653 | + } | ||
| 654 | + }).then(res => { | ||
| 655 | + if (res.data.code == 0 && res.data.data.total > 0) { | ||
| 656 | + //此时要循环判断包邮的地区,不包邮商品是不是符合 | ||
| 657 | + var arr = [], quanlist = res.data.data.pageData; | ||
| 658 | + quanlist = th.check_is_frozenQuan(quanlist, th.data.frozenQuan, 1); | ||
| 659 | + for (var i in quanlist) { | ||
| 660 | + var item = quanlist[i]; | ||
| 661 | + if (item.region_list && th.check_by_area(item.region_list)) continue; //如果是不包邮区域 | ||
| 662 | + if (item.goods_list && th.check_by_goods(item.goods_list)) continue; //如果是不包邮商品 | ||
| 663 | + arr.push(item); | ||
| 664 | + } | ||
| 665 | + if (arr) { | ||
| 666 | + th.setData({get_by_quan_list: arr}); | ||
| 667 | + } | ||
| 668 | + th.data.isget_by_quan[th.data.bn_pick] = 1; | ||
| 669 | + } | ||
| 670 | + }) | ||
| 671 | + } | ||
| 672 | + | ||
| 673 | + switch (good['exp_sum_type']) { | ||
| 674 | + case 1: | ||
| 675 | + //统一运费 | ||
| 676 | + o_shipping_price += good['uniform_exp_sum']; | ||
| 677 | + break; | ||
| 678 | + case 2: | ||
| 679 | + if (goods_weight < 0) goods_weight = 0; | ||
| 680 | + //累积商品重量 每种商品的重量 * 数量 | ||
| 681 | + goods_weight += good['weight'] * good['buynum']; | ||
| 682 | + break; | ||
| 683 | + case 3: | ||
| 684 | + if (goods_piece < 0) goods_piece = 0; | ||
| 685 | + //累积商品数量 | ||
| 686 | + goods_piece += good['buynum']; | ||
| 687 | + break; | ||
| 688 | + } | ||
| 689 | + | ||
| 690 | + var code = ""; | ||
| 691 | + if (th.data.wu_arr && th.data.wu_arr[th.data.index]) code = th.data.wu_arr[th.data.index].code; | ||
| 692 | + var freight_free = ee.freight_free; //全场满多少包邮 | ||
| 693 | + var no_ex_id = ee.no_ex_id; | ||
| 694 | + th.data.is_no_by[th.data.bn_pick] = 0; | ||
| 695 | + | ||
| 696 | + var no_by_data = null; | ||
| 697 | + var gift_freight_free = freight_free; | ||
| 698 | + | ||
| 699 | + | ||
| 700 | + //有不包邮区域,且不免运费 | ||
| 701 | + if (no_ex_id && freight_free > 0 && freight_free <= parseFloat(allpice) - cut_price - quan_price) { | ||
| 702 | + //-----------获取不包邮区域,不包邮商品------- | ||
| 703 | + await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", { | ||
| 704 | + data: {store_id: os.stoid, id: no_ex_id} | ||
| 705 | + }).then(res => { | ||
| 706 | + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { | ||
| 707 | + no_by_data = res.data.data[0]; | ||
| 708 | + //如果有设置不包邮区域的时候 | ||
| 709 | + if (res.data.data[0].region_list) { | ||
| 710 | + if (th.check_by_area(res.data.data[0].region_list)) { | ||
| 711 | + freight_free = 0; | ||
| 712 | + th.data.is_no_by[th.data.bn_pick] = 1; | ||
| 713 | + } | ||
| 714 | + } | ||
| 715 | + //如果有设置不包邮商品 | ||
| 716 | + if (res.data.data[0].goods_list && freight_free) { | ||
| 717 | + if (th.check_by_goods(res.data.data[0].goods_list)) { | ||
| 718 | + freight_free = 0; | ||
| 719 | + th.data.is_no_by[th.data.bn_pick] = 1; | ||
| 720 | + } | ||
| 721 | + } | ||
| 722 | + } | ||
| 723 | + }) | ||
| 724 | + } | ||
| 725 | + | ||
| 726 | + th.data.is_by[th.data.bn_pick] = 0; | ||
| 727 | + //--------------开始计算物流------------------ | ||
| 728 | + var shipping_price = | ||
| 729 | + th.calculatewuliu(code, o_shipping_price, goods_weight, | ||
| 730 | + goods_piece, th.data.user_addr, freight_free, parseFloat(allpice) - cut_price - quan_price, rs); | ||
| 731 | + | ||
| 732 | + //如果有赠品的时候,也要计算赠品的物流费用 | ||
| 733 | + if (th.data.buy_now_gift_goods) { | ||
| 734 | + shipping_price = th.get_now_gift_goods_wuliu(code, o_shipping_price, th.data.user_addr, gift_freight_free, | ||
| 735 | + parseFloat(allpice) - cut_price - quan_price, rs, shipping_price, no_by_data, goods_weight, goods_piece); | ||
| 736 | + } | ||
| 737 | + | ||
| 738 | + if (shipping_price <= 0) { | ||
| 739 | + th.data.is_by[th.data.bn_pick] = 1; //已经是包邮了,就不要选择包邮券 | ||
| 740 | + } | ||
| 741 | + | ||
| 742 | + shipping_price = parseFloat(shipping_price).toFixed(2); | ||
| 743 | + var wl_txt = "formData.shipping_price"; | ||
| 744 | + th.setData({[wl_txt]: shipping_price,}) | ||
| 745 | + | ||
| 746 | + } else { | ||
| 747 | + var wl_txt = "formData.shipping_price"; | ||
| 748 | + th.setData({[wl_txt]: 0,}) | ||
| 749 | + } | ||
| 750 | + | ||
| 751 | + if (quan_no) { | ||
| 752 | + if (th.data.using_quan[bn_pick].isby == 1) { | ||
| 753 | + shipping_price = 0; | ||
| 754 | + var wl_txt = "formData.shipping_price"; | ||
| 755 | + th.setData({[wl_txt]: 0,}) | ||
| 756 | + } | ||
| 757 | + } | ||
| 758 | + //-----------------支付价,优惠券不减物流----------------- | ||
| 759 | + var total_m = (parseFloat(allpice1)).toFixed(2); | ||
| 760 | + var order_m = (parseFloat(allpice - cut_price) - quan_price).toFixed(2); | ||
| 761 | + var coupon_price = quan_price; //优惠券优惠了多少钱 | ||
| 762 | + if (order_m < 0) { | ||
| 763 | + order_m = 0; | ||
| 764 | + coupon_price = parseFloat(order_m).toFixed(2); | ||
| 765 | + } | ||
| 766 | + //--看一下有没有订单优惠-- | ||
| 767 | + var o_condition = parseFloat(order_m); | ||
| 768 | + if (o_condition > 0 && th.data.act.is_useorderyh) { | ||
| 769 | + th.check_is_order_prom(o_condition, function () { | ||
| 770 | + var order_prom_amount = 0; | ||
| 771 | + var order_prom_id = 0; | ||
| 772 | + if (th.data.order_prom[th.data.bn_pick]) { | ||
| 773 | + var ord_prom = th.data.order_prom[th.data.bn_pick]; | ||
| 774 | + order_prom_id = ord_prom['id']; | ||
| 775 | + switch (ord_prom['type']) { | ||
| 776 | + case 0: | ||
| 777 | + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | ||
| 778 | + order_prom_amount = (o_condition - order_m).toFixed(2); | ||
| 779 | + break; | ||
| 780 | + case 1: | ||
| 781 | + order_m = o_condition - ord_prom['expression'];//满额优惠金额 | ||
| 782 | + order_prom_amount = ord_prom['expression']; | ||
| 783 | + break; | ||
| 784 | + } | ||
| 785 | + } | ||
| 786 | + //--订单优惠的显示-- | ||
| 787 | + if (order_prom_id > 0) { | ||
| 788 | + var order_prom_txt1 = "formData.order_prom_id"; | ||
| 789 | + var order_prom_txt2 = "formData.order_prom_amount"; | ||
| 790 | + th.setData({[order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount}) | ||
| 791 | + } | ||
| 792 | + | ||
| 793 | + total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price); | ||
| 794 | + order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price); | ||
| 795 | + | ||
| 796 | + total_m = total_m.toFixed(2); | ||
| 797 | + order_m = order_m.toFixed(2); | ||
| 798 | + | ||
| 799 | + var atxt = "formData.total_amount"; | ||
| 800 | + th.setData({[atxt]: total_m,}) | ||
| 801 | + | ||
| 802 | + var txt = "formData.user_money"; | ||
| 803 | + var txt2 = "formData.order_amount"; | ||
| 804 | + var txt3 = "formData.coupon_price"; | ||
| 805 | + var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money); | ||
| 806 | + //--------------如果使用余额--------------------- | ||
| 807 | + if (th.data.bn_use_money == 1) { | ||
| 808 | + if (amoney > order_m) { | ||
| 809 | + order_m = parseFloat(order_m).toFixed(2); | ||
| 810 | + th.setData({[txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1}) | ||
| 811 | + } else { | ||
| 812 | + order_m = parseFloat(order_m) - parseFloat(amoney); | ||
| 813 | + order_m = order_m.toFixed(2); | ||
| 814 | + th.setData({[txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1}) | ||
| 815 | + } | ||
| 816 | + } else { | ||
| 817 | + th.setData({[txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1}) | ||
| 818 | + } | ||
| 819 | + //优惠活动送积分 | ||
| 820 | + if (good.s_intValue) { | ||
| 821 | + txt = "formData.give_integral"; | ||
| 822 | + th.setData({[txt]: good.s_intValue}); | ||
| 823 | + } | ||
| 824 | + //优惠送券 | ||
| 825 | + if (good.s_coupon_id) { | ||
| 826 | + var i_txt = "formData.give_coupon_id"; | ||
| 827 | + //这个是json格式的 | ||
| 828 | + var i_txt1 = "formData.g_coupon_num"; | ||
| 829 | + var ob = [{"num": good.s_coupon_num, "c_id": good.s_coupon_id}]; | ||
| 830 | + ob = JSON.stringify(ob); | ||
| 831 | + th.setData({[i_txt]: good.s_coupon_id, [i_txt1]: ob}); | ||
| 832 | + } | ||
| 833 | + //优惠礼包 | ||
| 834 | + if (good.s_libao) { | ||
| 835 | + var l_txt = "formData.give_lb_id"; | ||
| 836 | + //这个是json格式的 | ||
| 837 | + var l_txt1 = "formData.g_lb_num"; | ||
| 838 | + var ob = [{"num": good.s_lb_num, "l_id": good.s_libao}]; | ||
| 839 | + ob = JSON.stringify(ob); | ||
| 840 | + th.setData({[l_txt]: good.s_libao, [l_txt1]: ob}); | ||
| 841 | + } | ||
| 842 | + }) | ||
| 843 | + } else { | ||
| 844 | + var order_prom_txt1 = "formData.order_prom_id"; | ||
| 845 | + var order_prom_txt2 = "formData.order_prom_amount"; | ||
| 846 | + th.setData({[order_prom_txt1]: 0, [order_prom_txt2]: 0}) | ||
| 847 | + | ||
| 848 | + total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price); | ||
| 849 | + order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price); | ||
| 850 | + var atxt = "formData.total_amount"; | ||
| 851 | + | ||
| 852 | + total_m = total_m.toFixed(2); | ||
| 853 | + order_m = order_m.toFixed(2); | ||
| 854 | + | ||
| 855 | + th.setData({[atxt]: total_m,}) | ||
| 856 | + | ||
| 857 | + var txt = "formData.user_money"; | ||
| 858 | + var txt2 = "formData.order_amount"; | ||
| 859 | + var txt3 = "formData.coupon_price"; | ||
| 860 | + var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money); | ||
| 861 | + //--------------如果使用余额--------------------- | ||
| 862 | + if (th.data.bn_use_money == 1) { | ||
| 863 | + if (amoney > order_m) { | ||
| 864 | + order_m = parseFloat(order_m).toFixed(2); | ||
| 865 | + th.setData({[txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1}) | ||
| 866 | + } else { | ||
| 867 | + order_m = parseFloat(order_m) - parseFloat(amoney); | ||
| 868 | + order_m = order_m.toFixed(2); | ||
| 869 | + th.setData({[txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1}) | ||
| 870 | + } | ||
| 871 | + } else { | ||
| 872 | + th.setData({[txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1}) | ||
| 873 | + } | ||
| 874 | + //优惠活动送积分 | ||
| 875 | + if (good.s_intValue) { | ||
| 876 | + txt = "formData.give_integral"; | ||
| 877 | + th.setData({[txt]: good.s_intValue}); | ||
| 878 | + } | ||
| 879 | + //优惠送券 | ||
| 880 | + if (good.s_coupon_id) { | ||
| 881 | + var i_txt = "formData.give_coupon_id"; | ||
| 882 | + //这个是json格式的 | ||
| 883 | + var i_txt1 = "formData.g_coupon_num"; | ||
| 884 | + var ob = [{"num": good.s_coupon_num, "c_id": good.s_coupon_id}]; | ||
| 885 | + ob = JSON.stringify(ob); | ||
| 886 | + th.setData({[i_txt]: good.s_coupon_id, [i_txt1]: ob}); | ||
| 887 | + } | ||
| 888 | + //优惠礼包 | ||
| 889 | + if (good.s_libao) { | ||
| 890 | + var l_txt = "formData.give_lb_id"; | ||
| 891 | + //这个是json格式的 | ||
| 892 | + var l_txt1 = "formData.g_lb_num"; | ||
| 893 | + var ob = [{"num": good.s_lb_num, "l_id": good.s_libao}]; | ||
| 894 | + ob = JSON.stringify(ob); | ||
| 895 | + th.setData({[l_txt]: good.s_coupon_id, [l_txt1]: ob}); | ||
| 896 | + } | ||
| 897 | + } | ||
| 898 | + | ||
| 899 | + wx.hideLoading(); | ||
| 900 | + | ||
| 901 | + }); | ||
| 902 | + }); | ||
| 903 | + }, | ||
| 904 | + | ||
| 905 | + //--------------------提交订单----------------------- | ||
| 906 | + async submitForm(t){ | ||
| 907 | + var sub_value = t; | ||
| 908 | + | ||
| 909 | + if (this.data.is_summit_ing == 1) return false; //--提交中退出-- | ||
| 910 | + this.data.is_summit_ing = 1; | ||
| 911 | + var th = this, pdata = new Array(); | ||
| 912 | + var ff = true; | ||
| 913 | + th.data.is_b_now = 1; | ||
| 914 | + //------------立即购买------------- | ||
| 915 | + if (th.data.is_b_now == 1 && th.data.bn_goods.prom_type != 5) { | ||
| 916 | + | ||
| 917 | + if (th.data.bn_exp_type == 0 && th.data.user_addr == null) { | ||
| 918 | + ff = false; | ||
| 919 | + getApp().my_warnning("请选择收货地址", 0, th); | ||
| 920 | + th.data.is_summit_ing = 0; | ||
| 921 | + } | ||
| 922 | + if (!ff) return false; | ||
| 923 | + var addr = th.data.user_addr; | ||
| 924 | + if (th.data.bn_exp_type == 1) addr = null; | ||
| 925 | + | ||
| 926 | + if (th.data.bn_exp_type == 0) | ||
| 927 | + if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) { | ||
| 928 | + getApp().my_warnning("读取物流失败", 0, th); | ||
| 929 | + th.data.is_summit_ing = 0; | ||
| 930 | + return false; | ||
| 931 | + } | ||
| 932 | + | ||
| 933 | + var item = { | ||
| 934 | + 'user_id': to.globalData.user_id, | ||
| 935 | + 'consignee': addr == null ? "" : addr.consignee, | ||
| 936 | + 'province': addr == null ? 0 : addr.province, | ||
| 937 | + 'city': addr == null ? 0 : addr.city, | ||
| 938 | + 'district': addr == null ? 0 : addr.district, | ||
| 939 | + 'twon': addr == null ? 0 : addr.twon, | ||
| 940 | + 'address': addr == null ? "" : addr.address, | ||
| 941 | + 'more_address': addr == null ? "" : addr.more_address, | ||
| 942 | + //'mobile': th.data.userinfo.mobile, | ||
| 943 | + 'mobile': addr == null ? th.data.userinfo.mobile : addr.mobile, | ||
| 944 | + 'email': '', | ||
| 945 | + 'shipping_code': th.data.bn_exp_type == 1 ? 0 : th.data.wu_arr[th.data.index].code, | ||
| 946 | + 'shipping_name': th.data.bn_exp_type == 1 ? '' : th.data.wu_arr[th.data.index].name, | ||
| 947 | + 'invoice_title': '', | ||
| 948 | + 'goods_price': th.data.formData.all_price, //商品总价 | ||
| 949 | + 'shipping_price': th.data.formData.shipping_price, //物流金额 | ||
| 950 | + 'user_money': th.data.formData.user_money, //使用余额 | ||
| 951 | + 'total_amount': th.data.formData.total_amount, //订单总价 | ||
| 952 | + 'order_amount': th.data.formData.order_amount, //应付 | ||
| 953 | + 'user_note': t.detail.value.user_note, //用户备注 | ||
| 954 | + 'store_id': oo.stoid, //商家 | ||
| 955 | + 'pickup_id': th.data.bn_pick, //门店 | ||
| 956 | + 'exp_type': th.data.bn_exp_type, //配送方式 | ||
| 957 | + 'order_goods': new Array(), | ||
| 958 | + }; | ||
| 959 | + //是不是重新提交 | ||
| 960 | + if (th.data.is_continue == 1) item.is_continue = 1; | ||
| 961 | + | ||
| 962 | + //获取立即购买的商品的信息 | ||
| 963 | + var gg = to.get_b_now(); | ||
| 964 | + //--商品的房间号-- | ||
| 965 | + if (gg.room_id && gg.room_id > 0) { | ||
| 966 | + item.room_ids = gg.room_id; | ||
| 967 | + } | ||
| 968 | + | ||
| 969 | + var order_prom_list = {}; | ||
| 970 | + //--判断有没有优惠活动-- | ||
| 971 | + if (th.data.order_prom[item.pickup_id]) { | ||
| 972 | + if (th.data.formData.order_prom_amount > 0) { | ||
| 973 | + order_prom_list.order_prom_id = th.data.formData.order_prom_id; | ||
| 974 | + order_prom_list.order_prom_amount = th.data.formData.order_prom_amount; | ||
| 975 | + } | ||
| 976 | + } | ||
| 977 | + | ||
| 978 | + //--判断优惠活动的提交-- | ||
| 979 | + if (th.data.formData.cut_price > 0 ) { | ||
| 980 | + order_prom_list.discount_amount = th.data.formData.cut_price.toFixed(2); | ||
| 981 | + var ob = [{ | ||
| 982 | + "prom_id": th.data.bn_goods.prom_id, | ||
| 983 | + "dis": parseFloat(th.data.formData.cut_price).toFixed(2), | ||
| 984 | + "ispt": 0 | ||
| 985 | + }] | ||
| 986 | + order_prom_list.prom_pt_json = JSON.stringify(ob); | ||
| 987 | + } | ||
| 988 | + if (th.data.formData.give_integral > 0) { | ||
| 989 | + order_prom_list.give_integral = th.data.formData.give_integral; | ||
| 990 | + } | ||
| 991 | + if (th.data.formData.give_coupon_id > 0) { | ||
| 992 | + order_prom_list.give_coupon_id = th.data.formData.give_coupon_id; | ||
| 993 | + order_prom_list.g_coupon_num = th.data.formData.g_coupon_num; | ||
| 994 | + } | ||
| 995 | + if (th.data.formData.give_lb_id > 0) { | ||
| 996 | + order_prom_list.give_lb_id = th.data.formData.give_lb_id; | ||
| 997 | + order_prom_list.g_lb_num = th.data.formData.g_lb_num; | ||
| 998 | + } | ||
| 999 | + item.order_prom_list = order_prom_list; | ||
| 1000 | + | ||
| 1001 | + //组装优惠券的钱 | ||
| 1002 | + if (parseFloat(th.data.formData.coupon_price) > 0) { | ||
| 1003 | + item.coupon_price = th.data.formData.coupon_price; | ||
| 1004 | + item.coupon_no = th.data.using_quan[th.data.bn_pick].coupon_no; | ||
| 1005 | + } | ||
| 1006 | + 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) { | ||
| 1007 | + item.coupon_no = th.data.using_quan[th.data.bn_pick].coupon_no; | ||
| 1008 | + item.coupon_price = 0; | ||
| 1009 | + } | ||
| 1010 | + | ||
| 1011 | + //老会员成为分销下线需要的参数 | ||
| 1012 | + if (getApp().globalData.first_leader && !getApp().globalData.userInfo.first_leader) { | ||
| 1013 | + //判断一下分享人是不是分享商 | ||
| 1014 | + await app.request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.first_leader, {}).then(res => { | ||
| 1015 | + if (res.data.code == 0) { | ||
| 1016 | + var user = res.data.data; | ||
| 1017 | + if (user.is_distribut == 1) { | ||
| 1018 | + item.first_leader = parseInt(getApp().globalData.first_leader); | ||
| 1019 | + } | ||
| 1020 | + } | ||
| 1021 | + }) | ||
| 1022 | + } | ||
| 1023 | + | ||
| 1024 | + var goods = { | ||
| 1025 | + 'goods_id': gg.goods_id, | ||
| 1026 | + 'goods_name': gg.goods_name, | ||
| 1027 | + 'goods_sn': gg.goods_sn, | ||
| 1028 | + 'goods_num': gg.goods_num, | ||
| 1029 | + 'market_price': th.data.bn_goods.market_price, | ||
| 1030 | + 'goods_price': th.data.bn_goods.shop_price, | ||
| 1031 | + 'member_goods_price': th.data.bn_goods.shop_price, | ||
| 1032 | + 'store_id': oo.stoid, | ||
| 1033 | + 'prom_type': th.data.bn_goods.prom_type, //促销活动类型 | ||
| 1034 | + 'prom_id': th.data.bn_goods.prom_id, //促销活动id | ||
| 1035 | + }; | ||
| 1036 | + | ||
| 1037 | + //-- 把导购的信息填入-- | ||
| 1038 | + if (gg.guide_id) { | ||
| 1039 | + goods.guide_id = gg.guide_id; | ||
| 1040 | + goods.guide_type = gg.guide_type; | ||
| 1041 | + //调用接口判断是不是会员 | ||
| 1042 | + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(res => { | ||
| 1043 | + if (res.data.code == 0) { | ||
| 1044 | + goods.guide_name = res.data.data.salesman; | ||
| 1045 | + goods.guide_sn = res.data.data.salesman_no; | ||
| 1046 | + } | ||
| 1047 | + }) | ||
| 1048 | + } | ||
| 1049 | + | ||
| 1050 | + //--商品的房间号-- | ||
| 1051 | + if (gg.room_id && gg.room_id > 0) { | ||
| 1052 | + goods.room_id = gg.room_id; | ||
| 1053 | + } | ||
| 1054 | + | ||
| 1055 | + //积分购,先要带is_integral_normal=1 | ||
| 1056 | + if (gg.is_integral_normal) goods.is_integral_normal = 1; | ||
| 1057 | + | ||
| 1058 | + //先要带is_pd_normal=1 | ||
| 1059 | + if (gg.is_pd_normal) goods.is_pd_normal = 1; | ||
| 1060 | + | ||
| 1061 | + //如果不立即购买或者秒杀,如果是线下库存购买的时候 | ||
| 1062 | + if (goods.prom_type != 1 && goods.prom_type != 6 && th.data.sales_rules == 2) { | ||
| 1063 | + var isok = 1; | ||
| 1064 | + await th.check_store_num(goods.goods_id, th.data.bn_pick, gg.goods_num, function (res) { | ||
| 1065 | + isok = res; | ||
| 1066 | + }); | ||
| 1067 | + if (!isok) { | ||
| 1068 | + getApp().confirmBox("商品的门店库存不足"); | ||
| 1069 | + th.data.is_summit_ing = 0; | ||
| 1070 | + return false; | ||
| 1071 | + } | ||
| 1072 | + } | ||
| 1073 | + | ||
| 1074 | + //-- 如果有线下取价的话 -- | ||
| 1075 | + if (th.data.bn_goods.is_offline) { | ||
| 1076 | + item.sum_offline_cut = (th.data.bn_goods.shop_price - th.data.bn_goods.offline_price).toFixed(2); | ||
| 1077 | + goods.offline_cut = item.sum_offline_cut; | ||
| 1078 | + goods.pricing_type = th.data.bn_goods.pricing_type; | ||
| 1079 | + goods.goods_price = th.data.bn_goods.offline_price; | ||
| 1080 | + goods.member_goods_price = th.data.bn_goods.offline_price; | ||
| 1081 | + } | ||
| 1082 | + | ||
| 1083 | + //--- 如果有优惠促销的金额,要把金额先平摊下去 --- | ||
| 1084 | + if (th.data.formData.cut_price > 0 && !th.data.ispt_goods) { | ||
| 1085 | + var g_arr = new Array(); | ||
| 1086 | + g_arr.push(goods); | ||
| 1087 | + var pt_data = { | ||
| 1088 | + 'prom_id': goods.prom_id, | ||
| 1089 | + 'dis': parseFloat(th.data.formData.cut_price), | ||
| 1090 | + 'goods': g_arr, | ||
| 1091 | + } | ||
| 1092 | + | ||
| 1093 | + var pt_res = null; | ||
| 1094 | + await getApp().request.promisePost("/api/weshop/order/getGoodsSplit", { | ||
| 1095 | + is_json: 1, | ||
| 1096 | + data: pt_data | ||
| 1097 | + }).then(res => { | ||
| 1098 | + if (res.data.code == 0) { | ||
| 1099 | + pt_res = res.data.data; | ||
| 1100 | + } | ||
| 1101 | + }) | ||
| 1102 | + if (pt_res) { | ||
| 1103 | + //平摊赋值 | ||
| 1104 | + goods.account = pt_res[0].fisrt_account; | ||
| 1105 | + goods.account_yu = pt_res[0].fisrt_account_yu; | ||
| 1106 | + item.is_discount_amount = 1; | ||
| 1107 | + } | ||
| 1108 | + } | ||
| 1109 | + | ||
| 1110 | + //--组装优惠券的钱-- | ||
| 1111 | + if (th.data.formData.coupon_price) { | ||
| 1112 | + item.coupon_price = th.data.formData.coupon_price; | ||
| 1113 | + item.coupon_no = th.data.using_quan[th.data.bn_pick].coupon_no; | ||
| 1114 | + goods.quan_num = th.data.formData.coupon_price; | ||
| 1115 | + goods.quan_no = item.coupon_no; | ||
| 1116 | + } | ||
| 1117 | + | ||
| 1118 | + item.order_goods.push(goods); | ||
| 1119 | + | ||
| 1120 | + //--如果有赠品的时候,赠品也要提交--- | ||
| 1121 | + if (th.data.buy_now_gift_goods) { | ||
| 1122 | + var gift_gg = th.data.buy_now_gift_goods; | ||
| 1123 | + var g_goods = { | ||
| 1124 | + 'goods_id': gift_gg.goods_id, | ||
| 1125 | + 'goods_name': gift_gg.goods_name, | ||
| 1126 | + 'goods_sn': gift_gg.goods_sn, | ||
| 1127 | + 'goods_num': gift_gg.buynum, | ||
| 1128 | + 'market_price': gift_gg.market_price, | ||
| 1129 | + 'goods_price': 0, | ||
| 1130 | + 'member_goods_price': 0, | ||
| 1131 | + 'store_id': oo.stoid, | ||
| 1132 | + 'is_gift': 1, | ||
| 1133 | + 'gift_id': gift_gg.gift_id, | ||
| 1134 | + 'prom_id': gift_gg.prom_id, | ||
| 1135 | + }; | ||
| 1136 | + item.order_goods.push(g_goods); | ||
| 1137 | + } | ||
| 1138 | + pdata.push(item); | ||
| 1139 | + | ||
| 1140 | + console.log(pdata); | ||
| 1141 | + } else { | ||
| 1142 | + //---------购物车的结算--------- | ||
| 1143 | + if (th.data.is_all_zt == 0 && th.data.user_addr == null) { | ||
| 1144 | + th.data.is_summit_ing = 0; | ||
| 1145 | + ff = false; | ||
| 1146 | + getApp().confirmBox("请新建收货地址"); | ||
| 1147 | + } | ||
| 1148 | + if (!ff) return false; | ||
| 1149 | + | ||
| 1150 | + var addr = th.data.user_addr; | ||
| 1151 | + if (th.data.is_all_zt == 1) addr = null; | ||
| 1152 | + var val_arr = t.detail.value; | ||
| 1153 | + | ||
| 1154 | + if (th.data.is_all_zt != 1) | ||
| 1155 | + if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) { | ||
| 1156 | + th.data.is_summit_ing = 0; | ||
| 1157 | + getApp().confirmBox("读取物流失败"); | ||
| 1158 | + return false; | ||
| 1159 | + } | ||
| 1160 | + | ||
| 1161 | + var order_prom_list_cart = th.data.order_prom_list_cart; | ||
| 1162 | + | ||
| 1163 | + //--组装推送数据-- | ||
| 1164 | + for (var i = 0; i < order_prom_list_cart.length; i++) { | ||
| 1165 | + var t_item = order_prom_list_cart[i]; | ||
| 1166 | + var item = { | ||
| 1167 | + 'user_id': to.globalData.user_id, | ||
| 1168 | + 'consignee': addr == null ? th.data.userinfo.mobile : addr.consignee, | ||
| 1169 | + 'province': addr == null ? 0 : addr.province, | ||
| 1170 | + 'city': addr == null ? 0 : addr.city, | ||
| 1171 | + 'district': addr == null ? 0 : addr.district, | ||
| 1172 | + 'twon': addr == null ? 0 : addr.twon, | ||
| 1173 | + 'address': addr == null ? "" : addr.address, | ||
| 1174 | + 'more_address': addr == null ? "" : addr.more_address, | ||
| 1175 | + 'mobile': addr == null ? th.data.userinfo.mobile : addr.mobile, | ||
| 1176 | + 'email': '', | ||
| 1177 | + 'shipping_code': th.data.is_all_zt == 1 ? 0 : th.data.wu_arr[t_item.wind].code, | ||
| 1178 | + 'shipping_name': th.data.is_all_zt == 1 ? '' : th.data.wu_arr[t_item.wind].name, | ||
| 1179 | + 'invoice_title': '', | ||
| 1180 | + 'goods_price': t_item.goods_price, //商品总价 | ||
| 1181 | + 'shipping_price': t_item.shipping_price, //物流金额 | ||
| 1182 | + 'user_money': t_item.user_money, //使用余额 | ||
| 1183 | + 'total_amount': t_item.total_amount, //订单总价 | ||
| 1184 | + 'order_amount': t_item.order_amount, //应付 | ||
| 1185 | + 'user_note': val_arr['user_note_' + t_item.pickup_id], //用户备注 | ||
| 1186 | + 'store_id': oo.stoid, //商家 | ||
| 1187 | + 'pickup_id': t_item.pickup_id, //门店 | ||
| 1188 | + 'exp_type': t_item.exp_type, //配送方式 | ||
| 1189 | + 'order_goods': new Array(), | ||
| 1190 | + }; | ||
| 1191 | + //是不是重新提交 | ||
| 1192 | + if (th.data.is_continue == 1) item.is_continue = 1; | ||
| 1193 | + //----- 如果有线下取价的话 ---- | ||
| 1194 | + if (t_item.is_offline == 1) { | ||
| 1195 | + item.sum_offline_cut = t_item.offline_price.toFixed(2); | ||
| 1196 | + } | ||
| 1197 | + | ||
| 1198 | + //组装优惠券的钱 | ||
| 1199 | + if (t_item.coupon_price) { | ||
| 1200 | + item.coupon_price = t_item.coupon_price; | ||
| 1201 | + item.coupon_no = th.data.using_quan[t_item.pickup_id].coupon_no; | ||
| 1202 | + } else if (t_item.quan_no) { | ||
| 1203 | + item.coupon_no = t_item.quan_no; | ||
| 1204 | + item.coupon_price = 0; | ||
| 1205 | + } | ||
| 1206 | + | ||
| 1207 | + var order_prom_list = {}; | ||
| 1208 | + //--判断有没有优惠活动-- | ||
| 1209 | + if (t_item.order_prom_amount > 0) { | ||
| 1210 | + order_prom_list.order_prom_id = t_item.order_prom_id; | ||
| 1211 | + order_prom_list.order_prom_amount = t_item.order_prom_amount; | ||
| 1212 | + } | ||
| 1213 | + | ||
| 1214 | + order_prom_list.discount_amount =0; | ||
| 1215 | + //--判断优惠活动的提交-- | ||
| 1216 | + if (t_item.cut_price > 0) { | ||
| 1217 | + order_prom_list.discount_amount += t_item.cut_price; | ||
| 1218 | + order_prom_list.prom_pt_json = JSON.stringify(t_item.prom_pt_json); | ||
| 1219 | + } | ||
| 1220 | + //--判断组合优惠活动的提交-- | ||
| 1221 | + if (t_item.zh_cut_price > 0 || t_item.zh_cut_price<0) { | ||
| 1222 | + order_prom_list.discount_amount += t_item.zh_cut_price; | ||
| 1223 | + order_prom_list.zh_pt_json = JSON.stringify(t_item.zh_pt_json); | ||
| 1224 | + } | ||
| 1225 | + if (t_item.s_intValue > 0) { | ||
| 1226 | + order_prom_list.give_integral = t_item.s_intValue; | ||
| 1227 | + } | ||
| 1228 | + if (t_item.s_coupon_id) { | ||
| 1229 | + order_prom_list.give_coupon_id = t_item.s_coupon_id; | ||
| 1230 | + order_prom_list.g_coupon_num = JSON.stringify(t_item.g_coupon_num); | ||
| 1231 | + } | ||
| 1232 | + if (t_item.s_libao) { | ||
| 1233 | + order_prom_list.give_lb_id = t_item.s_libao; | ||
| 1234 | + order_prom_list.g_lb_num = JSON.stringify(t_item.g_lb_num); | ||
| 1235 | + } | ||
| 1236 | + if (Object.keys(order_prom_list).length > 0){ | ||
| 1237 | + if(order_prom_list.discount_amount) | ||
| 1238 | + order_prom_list.discount_amount= parseFloat(order_prom_list.discount_amount).toFixed(2); | ||
| 1239 | + if(order_prom_list.order_prom_amount) | ||
| 1240 | + order_prom_list.order_prom_amount= parseFloat(order_prom_list.order_prom_amount).toFixed(2); | ||
| 1241 | + item.order_prom_list = order_prom_list; | ||
| 1242 | + } | ||
| 1243 | + | ||
| 1244 | + | ||
| 1245 | + //老会员成为分销下线需要的参数 | ||
| 1246 | + if (getApp().globalData.first_leader && !getApp().globalData.userInfo.first_leader) { | ||
| 1247 | + //判断一下分享人是不是分享商 | ||
| 1248 | + await app.request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.first_leader, {}).then(res => { | ||
| 1249 | + if (res.data.code == 0) { | ||
| 1250 | + var user = res.data.data; | ||
| 1251 | + if (user.is_distribut == 1) { | ||
| 1252 | + item.first_leader = parseInt(getApp().globalData.first_leader); | ||
| 1253 | + } | ||
| 1254 | + } | ||
| 1255 | + }) | ||
| 1256 | + } | ||
| 1257 | + | ||
| 1258 | + | ||
| 1259 | + //房间号的ids | ||
| 1260 | + var room_ids = ""; | ||
| 1261 | + //-------------让商品添加到商品列表-------------------- | ||
| 1262 | + for (var k = 0; k < t_item.goods.length; k++) { | ||
| 1263 | + var g_item = t_item.goods[k]; | ||
| 1264 | + if(g_item.goods_num<=0) continue; | ||
| 1265 | + var goods = { | ||
| 1266 | + 'goods_id': g_item.goods_id, | ||
| 1267 | + 'goods_name': g_item.goods_name, | ||
| 1268 | + 'goods_sn': g_item.goods_sn, | ||
| 1269 | + 'goods_num': g_item.goods_num, | ||
| 1270 | + 'market_price': g_item.market_price, | ||
| 1271 | + 'goods_price': g_item.goods_price, | ||
| 1272 | + 'member_goods_price': g_item.goods_price, | ||
| 1273 | + 'store_id': oo.stoid, | ||
| 1274 | + }; | ||
| 1275 | + | ||
| 1276 | + //-- 线下取价也要写入,组合购的商品不能去线下价格 -- | ||
| 1277 | + if (g_item.offline_price && t_item.is_offline == 1 && g_item.prom_type!=7) { | ||
| 1278 | + goods.goods_price = g_item.offline_price; | ||
| 1279 | + goods.member_goods_price = g_item.offline_price; | ||
| 1280 | + goods.offline_cut = (g_item.goods_price - g_item.offline_price).toFixed(2); | ||
| 1281 | + goods.pricing_type = g_item.pricing_type; | ||
| 1282 | + } | ||
| 1283 | + | ||
| 1284 | + //--把券的钱,写入从表--- | ||
| 1285 | + if (t_item.quan_youhui_list && t_item.coupon_price) { | ||
| 1286 | + for (var kk in t_item.quan_youhui_list) { | ||
| 1287 | + var you_item = t_item.quan_youhui_list[kk]; | ||
| 1288 | + if (g_item.prom_type!=7 && g_item.erpwareid == you_item.WareId) { | ||
| 1289 | + goods.quan_num = you_item.WareCashSum; | ||
| 1290 | + goods.quan_no = you_item.CashRepNo; | ||
| 1291 | + } | ||
| 1292 | + } | ||
| 1293 | + } | ||
| 1294 | + | ||
| 1295 | + //--判断活动的类型-- | ||
| 1296 | + switch (g_item.prom_type) { | ||
| 1297 | + case 1: | ||
| 1298 | + goods.prom_type = g_item.prom_type; | ||
| 1299 | + goods.prom_id = g_item.prom_id; | ||
| 1300 | + break; | ||
| 1301 | + case 3: | ||
| 1302 | + goods.prom_type = 3; | ||
| 1303 | + goods.prom_id = g_item.prom_id; | ||
| 1304 | + if (g_item.is_gift) { | ||
| 1305 | + goods.is_gift = g_item.is_gift; | ||
| 1306 | + goods.gift_id = g_item.gift_id; | ||
| 1307 | + } | ||
| 1308 | + break; | ||
| 1309 | + case 5: | ||
| 1310 | + goods.prom_type = 5; | ||
| 1311 | + goods.prom_id = g_item.prom_id; | ||
| 1312 | + if (g_item.is_collocation) { | ||
| 1313 | + goods.is_collocation = g_item.is_collocation; | ||
| 1314 | + } | ||
| 1315 | + break | ||
| 1316 | + case 7: | ||
| 1317 | + goods.prom_type = 7; | ||
| 1318 | + goods.prom_id = g_item.prom_id; | ||
| 1319 | + break | ||
| 1320 | + default: | ||
| 1321 | + goods.prom_type = 0; | ||
| 1322 | + goods.prom_id = 0; | ||
| 1323 | + } | ||
| 1324 | + | ||
| 1325 | + //如果不立即购买或者秒杀,如果是线下库存购买的时候 | ||
| 1326 | + if (goods.prom_type == 0 && th.data.sales_rules == 2) { | ||
| 1327 | + var isok = 1; | ||
| 1328 | + await th.check_store_num(goods.goods_id, t_item.pickup_id, goods.goods_num, function (res) { | ||
| 1329 | + isok = res; | ||
| 1330 | + }); | ||
| 1331 | + if (!isok) { | ||
| 1332 | + getApp().confirmBox(goods.goods_name + "的门店库存不足"); | ||
| 1333 | + th.data.is_summit_ing = 0; | ||
| 1334 | + return false; | ||
| 1335 | + } | ||
| 1336 | + } | ||
| 1337 | + | ||
| 1338 | + //把优惠的平摊结果写进去 | ||
| 1339 | + if (g_item.account >= 0 || (g_item.account_yu != 0 && g_item.account!=undefined)) { | ||
| 1340 | + if (g_item.account >= 0) goods.account = g_item.account; | ||
| 1341 | + if (g_item.account_yu != 0) goods.account_yu = g_item.account_yu; | ||
| 1342 | + item.is_discount_amount = 1; | ||
| 1343 | + } | ||
| 1344 | + | ||
| 1345 | + //导购ID | ||
| 1346 | + if (g_item.guide_id) { | ||
| 1347 | + goods.guide_id = g_item.guide_id; | ||
| 1348 | + goods.guide_type = g_item.guide_type; | ||
| 1349 | + //调用接口判断是不是会员 | ||
| 1350 | + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + g_item.guide_id, {}).then(res => { | ||
| 1351 | + if (res.data.code == 0) { | ||
| 1352 | + goods.guide_name = res.data.data.salesman; | ||
| 1353 | + goods.guide_sn = res.data.data.salesman_no; | ||
| 1354 | + } | ||
| 1355 | + }) | ||
| 1356 | + } | ||
| 1357 | + //如果房间号不为空的时候 | ||
| 1358 | + if (g_item.room_id) { | ||
| 1359 | + goods.room_id = g_item.room_id; | ||
| 1360 | + room_ids += g_item.room_id + ","; | ||
| 1361 | + } | ||
| 1362 | + item.order_goods.push(goods); | ||
| 1363 | + } | ||
| 1364 | + | ||
| 1365 | + //如果房间号不为空的时候 | ||
| 1366 | + if (room_ids != "") item.room_ids = ut.sub_last(room_ids); | ||
| 1367 | + pdata.push(item); | ||
| 1368 | + } | ||
| 1369 | + | ||
| 1370 | + | ||
| 1371 | + } | ||
| 1372 | + | ||
| 1373 | + if (pdata.length == 0) return; | ||
| 1374 | + var str = JSON.stringify(pdata); | ||
| 1375 | + | ||
| 1376 | + wx.showLoading({title: "加载中"}); | ||
| 1377 | + wx.request({ | ||
| 1378 | + url: oo.url + '/api/weshop/order/createWxdOrder', | ||
| 1379 | + data: str, | ||
| 1380 | + method: 'POST', | ||
| 1381 | + header: { | ||
| 1382 | + 'content-type': 'application/json' | ||
| 1383 | + },// 设置请求的 header | ||
| 1384 | + success: function (res) { | ||
| 1385 | + | ||
| 1386 | + | ||
| 1387 | + wx.hideLoading(); | ||
| 1388 | + if (res.statusCode == 200) { | ||
| 1389 | + var data = res.data; | ||
| 1390 | + if (data.code == 0) { | ||
| 1391 | + console.log(th.data.is_b_now); | ||
| 1392 | + //如果是购物车结算,还要删除购物车 | ||
| 1393 | + if (th.data.is_b_now == 0) { | ||
| 1394 | + console.log(th.data.cartlist_y); | ||
| 1395 | + var list = th.data.cartlist_y; | ||
| 1396 | + for (var i = 0; i < list.length; i++) { | ||
| 1397 | + //删除购物车 | ||
| 1398 | + a.delete("/api/weshop/cart/del/" + oo.stoid + "/" + list[i].id, {}); | ||
| 1399 | + } | ||
| 1400 | + } | ||
| 1401 | + var order_amount = 0; | ||
| 1402 | + pdata.forEach(function (em, ind) { | ||
| 1403 | + order_amount += em.order_amount; | ||
| 1404 | + }) | ||
| 1405 | + //要进行判断,如果是用微信支付,就要跳转到支付界面 | ||
| 1406 | + if (order_amount > 0) { | ||
| 1407 | + th.setData({isclose: 0}); | ||
| 1408 | + //void e.jumpToCart4({ | ||
| 1409 | + // order_sn: data.data, | ||
| 1410 | + //}, 1); | ||
| 1411 | + util_pay.pay(data.data, function () { | ||
| 1412 | + //app.my_warnning("支付成功",1,th); | ||
| 1413 | + //setTimeout(function () { | ||
| 1414 | + wx.redirectTo({ | ||
| 1415 | + url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data | ||
| 1416 | + }) | ||
| 1417 | + //},1000) | ||
| 1418 | + | ||
| 1419 | + }, function () { | ||
| 1420 | + //支付失败 | ||
| 1421 | + setTimeout(function () { | ||
| 1422 | + var cps=getCurrentPages(); | ||
| 1423 | + if(cps.length>1){ | ||
| 1424 | + wx.navigateBack({delta: 1}) | ||
| 1425 | + }else{ | ||
| 1426 | + getApp().goto("/pages/index/index/index"); | ||
| 1427 | + } | ||
| 1428 | + | ||
| 1429 | + }, 1000) | ||
| 1430 | + }, oo.stoid); | ||
| 1431 | + | ||
| 1432 | + } else { | ||
| 1433 | + var dd = { | ||
| 1434 | + parent_sn: data.data, | ||
| 1435 | + store_id: oo.stoid, | ||
| 1436 | + type: 2, | ||
| 1437 | + }; | ||
| 1438 | + a.post("/api/weshop/order/pay/createOrder", { | ||
| 1439 | + data: dd, | ||
| 1440 | + success: function (t) { | ||
| 1441 | + //console.log(t); | ||
| 1442 | + if (t.data.code == 0) { | ||
| 1443 | + //app.my_warnning("支付成功",1,th); | ||
| 1444 | + //setTimeout(function () { | ||
| 1445 | + th.setData({isclose: 0}); | ||
| 1446 | + wx.redirectTo({ | ||
| 1447 | + url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, | ||
| 1448 | + }) | ||
| 1449 | + //}, 1000) | ||
| 1450 | + } | ||
| 1451 | + }, | ||
| 1452 | + fail: function () { | ||
| 1453 | + | ||
| 1454 | + } | ||
| 1455 | + }); | ||
| 1456 | + } | ||
| 1457 | + | ||
| 1458 | + } | ||
| 1459 | + else { | ||
| 1460 | + //--内容换行-- | ||
| 1461 | + var msg = data.msg; | ||
| 1462 | + //赠品活动已经取消,无法赠送,是否继续买单? | ||
| 1463 | + if (msg.indexOf("是否继续买单") > 0) { | ||
| 1464 | + wx.showModal({ | ||
| 1465 | + title: "提示", | ||
| 1466 | + content: data.msg, | ||
| 1467 | + cancelText: '取消', | ||
| 1468 | + confirmText: '确定', | ||
| 1469 | + showCancel: true, | ||
| 1470 | + success(res){ | ||
| 1471 | + if (res.cancel) { | ||
| 1472 | + return; | ||
| 1473 | + } else if (res.confirm) { | ||
| 1474 | + th.data.is_continue = 1; | ||
| 1475 | + th.data.is_summit_ing = 0; //是否提交中 | ||
| 1476 | + th.submitForm(sub_value); | ||
| 1477 | + } | ||
| 1478 | + } | ||
| 1479 | + }) | ||
| 1480 | + return; | ||
| 1481 | + } | ||
| 1482 | + if (msg.length > 13) { | ||
| 1483 | + msg = msg.slice(0, 13) + "\r\n" + msg.slice(13); | ||
| 1484 | + } | ||
| 1485 | + getApp().confirmBox(msg); | ||
| 1486 | + th.data.is_summit_ing = 0; //是否提交中 | ||
| 1487 | + } | ||
| 1488 | + } else { | ||
| 1489 | + th.data.is_summit_ing = 0; //是否提交中 | ||
| 1490 | + console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode); | ||
| 1491 | + } | ||
| 1492 | + }, | ||
| 1493 | + fail: function () { | ||
| 1494 | + th.data.is_summit_ing = 0; | ||
| 1495 | + wx.hideLoading(); | ||
| 1496 | + console.log("index.js wx.request CheckCallUser fail"); | ||
| 1497 | + }, | ||
| 1498 | + complete: function () { | ||
| 1499 | + } | ||
| 1500 | + }) | ||
| 1501 | + | ||
| 1502 | + }, | ||
| 1503 | + //---确认线下门店的数量足不足--- | ||
| 1504 | + async check_store_num(goods_id, pick, goods_num, func){ | ||
| 1505 | + var lock = 0, pick_no, plist, erpwareid; | ||
| 1506 | + //先读取门店的lock | ||
| 1507 | + await getApp().request.promiseGet("/api/weshop/order/ware/lock/page", { | ||
| 1508 | + data: {store_id: os.stoid, wareId: goods_id, storageId: pick, pageSize: 1000} | ||
| 1509 | + }).then(res => { | ||
| 1510 | + if (res.data.code == 0 && res.data.data.total > 0) { | ||
| 1511 | + for (var i in res.data.data.pageData) | ||
| 1512 | + lock += res.data.data.pageData[i].outQty; | ||
| 1513 | + } | ||
| 1514 | + }) | ||
| 1515 | + //先获取门店的编号 | ||
| 1516 | + await getApp().request.promiseGet("/api/weshop/pickup/get/" + os.stoid + "/" + pick, { | ||
| 1517 | + data: {storeId: os.stoid, goodsId: t.goods_id, pickupId: pick} | ||
| 1518 | + }).then(res => { | ||
| 1519 | + if (res.data.code == 0) { | ||
| 1520 | + pick_no = res.data.data.pickup_no; | ||
| 1521 | + } | ||
| 1522 | + }) | ||
| 1523 | + //先获取商品的线下库存 | ||
| 1524 | + await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + goods_id, { | ||
| 1525 | + data: {storeId: os.stoid, goodsId: t.goods_id, pickupId: pick} | ||
| 1526 | + }).then(res => { | ||
| 1527 | + if (res.data.code == 0) { | ||
| 1528 | + erpwareid = res.data.data.erpwareid; | ||
| 1529 | + } | ||
| 1530 | + }) | ||
| 1531 | + //读取线下的门店库存 | ||
| 1532 | + await getApp().request.promiseGet("/api/weshop/goods/getWareStorages", { | ||
| 1533 | + data: {storageNos: pick_no, wareIds: encodeURIComponent(erpwareid), storeId: os.stoid, pageSize: 2000} | ||
| 1534 | + }).then(res => { | ||
| 1535 | + if (res.data.code == 0) { | ||
| 1536 | + plist = res.data.data.pageData[0]; | ||
| 1537 | + } | ||
| 1538 | + }) | ||
| 1539 | + var isok = 1; | ||
| 1540 | + if (goods_num > plist.CanOutQty - lock) { | ||
| 1541 | + isok = 0; | ||
| 1542 | + } | ||
| 1543 | + func(isok); | ||
| 1544 | + }, | ||
| 1545 | + | ||
| 1546 | + useCoupon: function () { | ||
| 1547 | + if (this.data.order.couponNum <= 0) { | ||
| 1548 | + getApp().my_warnning("无可用优惠券", 0, this); | ||
| 1549 | + return; | ||
| 1550 | + } | ||
| 1551 | + | ||
| 1552 | + var a = { | ||
| 1553 | + lid: this.data.coupon ? this.data.coupon.id : "0" | ||
| 1554 | + }; | ||
| 1555 | + wx.navigateTo({ | ||
| 1556 | + url: "/pages/user/checkcoupon/checkcoupon?" + s.Obj2Str(a) | ||
| 1557 | + }); | ||
| 1558 | + }, | ||
| 1559 | + enterAddressPage: function () { | ||
| 1560 | + getApp().globalData.is_cart_old = 1; | ||
| 1561 | + this.data.isget_by_quan = {}; | ||
| 1562 | + this.data.enterAddressPage = !0, wx.navigateTo({ | ||
| 1563 | + url: "/pages/user/address_list/address_list" | ||
| 1564 | + }); | ||
| 1565 | + }, | ||
| 1566 | + | ||
| 1567 | + //--------购物车购买时,选择自提和物流----------- | ||
| 1568 | + setexptype_w: function (t) { | ||
| 1569 | + | ||
| 1570 | + var def_exp_code = getApp().globalData.userInfo.def_exp_code, th = this; | ||
| 1571 | + var ty = t.currentTarget.dataset.t, txt = t.currentTarget.dataset.txt, | ||
| 1572 | + wl_txt = t.currentTarget.dataset.wl_txt, | ||
| 1573 | + ont = t.currentTarget.dataset.ont; | ||
| 1574 | + | ||
| 1575 | + th.setData({[txt]: ty}); | ||
| 1576 | + var iszt = 1; | ||
| 1577 | + | ||
| 1578 | + if (ty == 0) { | ||
| 1579 | + th.setData({is_all_zt: 0}); | ||
| 1580 | + } else { | ||
| 1581 | + for (var i = 0; i < th.data.cartlist.length; i++) { | ||
| 1582 | + var item = th.data.cartlist[i]; | ||
| 1583 | + if (item.exp_type == 0) { | ||
| 1584 | + iszt = 0; | ||
| 1585 | + break; | ||
| 1586 | + } | ||
| 1587 | + } | ||
| 1588 | + | ||
| 1589 | + th.setData({is_all_zt: iszt}); | ||
| 1590 | + | ||
| 1591 | + var ind = t.currentTarget.dataset.ind; | ||
| 1592 | + var c_item = th.data.cartlist[ind]; | ||
| 1593 | + var pickid = c_item.pickup_id; | ||
| 1594 | + | ||
| 1595 | + if (th.data.using_quan[pickid] && th.data.using_quan[pickid].isby == 1) { | ||
| 1596 | + th.data.using_quan[pickid] = {}; | ||
| 1597 | + th.setData({using_quan: th.data.using_quan}); | ||
| 1598 | + } | ||
| 1599 | + | ||
| 1600 | + | ||
| 1601 | + } | ||
| 1602 | + //判断有没有默认的物流地址值 | ||
| 1603 | + if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined) { | ||
| 1604 | + var wu_arr = this.data.wu_arr; | ||
| 1605 | + if (wu_arr != null && wu_arr != "") { | ||
| 1606 | + for (var i = 0; i < wu_arr.length; i++) { | ||
| 1607 | + if (wu_arr[i].shipping_code == def_exp_code) { | ||
| 1608 | + var set_txt = "cartlist" | ||
| 1609 | + th.setData({wl_txt: i}); | ||
| 1610 | + } | ||
| 1611 | + } | ||
| 1612 | + } | ||
| 1613 | + } | ||
| 1614 | + //----计算此时购物车的价格---- | ||
| 1615 | + th.calculatePrice(); | ||
| 1616 | + }, | ||
| 1617 | + | ||
| 1618 | + //--------立即购买时,选择自提和物流---------- | ||
| 1619 | + setexptype: function (t) { | ||
| 1620 | + var th = this; | ||
| 1621 | + var ty = t.currentTarget.dataset.t, def_exp_code = getApp().globalData.userInfo.def_exp_code; | ||
| 1622 | + th.setData({bn_exp_type: ty}); | ||
| 1623 | + if (ty == 0) { | ||
| 1624 | + th.setData({is_all_zt: 0}); | ||
| 1625 | + } | ||
| 1626 | + | ||
| 1627 | + //当物流为空的时候。 | ||
| 1628 | + if (ty == 0 && th.data.wu_arr == null) { | ||
| 1629 | + th.data.isget_by_quan = {}; | ||
| 1630 | + return th.get_wuliu(th.calculatePrice2()); | ||
| 1631 | + } | ||
| 1632 | + | ||
| 1633 | + //--自提就要把包邮券清理掉-- | ||
| 1634 | + if (ty == 1) { | ||
| 1635 | + th.data.isget_by_quan = {}; | ||
| 1636 | + if (th.data.using_quan[th.data.bn_pick] && th.data.using_quan[th.data.bn_pick].isby == 1) { | ||
| 1637 | + th.setData({using_quan: {}}); | ||
| 1638 | + } | ||
| 1639 | + } | ||
| 1640 | + | ||
| 1641 | + //判断有没有默认的物流地址值 | ||
| 1642 | + if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined) { | ||
| 1643 | + var wu_arr = this.data.wu_arr; | ||
| 1644 | + if (wu_arr != null && wu_arr != "") { | ||
| 1645 | + for (var i = 0; i < wu_arr.length; i++) { | ||
| 1646 | + if (wu_arr[i].shipping_code == def_exp_code) { | ||
| 1647 | + th.setData({index: i}); | ||
| 1648 | + } | ||
| 1649 | + } | ||
| 1650 | + } | ||
| 1651 | + } | ||
| 1652 | + th.calculatePrice2() | ||
| 1653 | + | ||
| 1654 | + }, | ||
| 1655 | + | ||
| 1656 | + //--------立即购买时,使用余额-------- | ||
| 1657 | + set_bn_useyuer: function () { | ||
| 1658 | + var th = this; | ||
| 1659 | + th.setData({bn_use_money: !th.data.bn_use_money}); | ||
| 1660 | + th.calculatePrice2(); | ||
| 1661 | + }, | ||
| 1662 | + set_js_useyuer: function () { | ||
| 1663 | + var th = this; | ||
| 1664 | + th.setData({js_use_money: !th.data.js_use_money}); | ||
| 1665 | + th.calculatePrice(); | ||
| 1666 | + }, | ||
| 1667 | + //-------------------计算物流--------------- | ||
| 1668 | + calculatewuliu: function (code, o_shipping_price, goods_weight, | ||
| 1669 | + goods_piece, user_addr, freight_free, o_price, rs) { | ||
| 1670 | + var price = 0, th = this; | ||
| 1671 | + price += parseFloat(o_shipping_price); | ||
| 1672 | + //如果是包邮 | ||
| 1673 | + if (freight_free > 0 && o_price >= freight_free) { | ||
| 1674 | + return 0; | ||
| 1675 | + } | ||
| 1676 | + if (user_addr == null) { | ||
| 1677 | + return 0; | ||
| 1678 | + } | ||
| 1679 | + //计算物流的config item; | ||
| 1680 | + var item = null; | ||
| 1681 | + //先根据 镇 县 区找计算的config | ||
| 1682 | + item = th.get_wuliu_config(user_addr.district, code, rs); | ||
| 1683 | + if (item == null) item = th.get_wuliu_config(user_addr.city, code, rs); | ||
| 1684 | + if (item == null) item = th.get_wuliu_config(user_addr.province, code, rs); | ||
| 1685 | + if (item == null) item = th.get_wuliu_default(code, rs); | ||
| 1686 | + if (item == null) return o_shipping_price; | ||
| 1687 | + var fw_price = 0, fp_price = 0; | ||
| 1688 | + item = item.config; | ||
| 1689 | + if (item == null) return o_shipping_price; | ||
| 1690 | + //------按重量---------- | ||
| 1691 | + if (goods_weight >= 0 && item['money']) { | ||
| 1692 | + fw_price = parseFloat(item['money']); | ||
| 1693 | + if (goods_weight > item['first_weight']) { | ||
| 1694 | + var fw = goods_weight - item['first_weight']; | ||
| 1695 | + var n = Math.ceil(fw / item['second_weight']) | ||
| 1696 | + fw_price = fw_price + n * parseFloat(item['add_money']); | ||
| 1697 | + } | ||
| 1698 | + } | ||
| 1699 | + //------按件数---------- | ||
| 1700 | + if (goods_piece > 0 && item['piecemoney']) { | ||
| 1701 | + fp_price = parseFloat(item['piecemoney']); | ||
| 1702 | + if (goods_piece > item['first_piece']) { | ||
| 1703 | + var fp = goods_piece - item['first_piece']; | ||
| 1704 | + var m = Math.ceil(fp / item['second_piece']) | ||
| 1705 | + fp_price = fp_price + m * parseFloat(item['add_piecemoney']); | ||
| 1706 | + } | ||
| 1707 | + } | ||
| 1708 | + var rspice = parseFloat(price + fw_price + fp_price); | ||
| 1709 | + return rspice; | ||
| 1710 | + }, | ||
| 1711 | + | ||
| 1712 | + //------------循环获取config----------- | ||
| 1713 | + get_wuliu_config: function (region_id, code, rs) { | ||
| 1714 | + var item = null, rslist = rs.pageData; | ||
| 1715 | + for (var i = 0; i < rslist.length; i++) { | ||
| 1716 | + if (rslist[i].code == code && rslist[i].region_id == region_id) { | ||
| 1717 | + item = rslist[i]; | ||
| 1718 | + } | ||
| 1719 | + } | ||
| 1720 | + return item; | ||
| 1721 | + }, | ||
| 1722 | + //-------循环获取config,code default------- | ||
| 1723 | + get_wuliu_default: function (code, rs) { | ||
| 1724 | + var item = null, rslist = rs.pageData; | ||
| 1725 | + for (var i = 0; i < rslist.length; i++) { | ||
| 1726 | + if (rslist[i].shipping_code == code && rslist[i].is_default == 1) { | ||
| 1727 | + item = rslist[i]; | ||
| 1728 | + } | ||
| 1729 | + } | ||
| 1730 | + return item; | ||
| 1731 | + }, | ||
| 1732 | + | ||
| 1733 | + //----------立即购买,选择物流------------- | ||
| 1734 | + bindPickerChange: function (e) { | ||
| 1735 | + var ind = e.detail.value | ||
| 1736 | + this.setData({index: ind}); | ||
| 1737 | + this.calculatePrice2(); | ||
| 1738 | + }, | ||
| 1739 | + //----------购物车结算,选择物流------------- | ||
| 1740 | + bindPickerChange_w: function (e) { | ||
| 1741 | + var ind = e.detail.value, txt = e.currentTarget.dataset.txt; | ||
| 1742 | + this.setData({[txt]: ind}); | ||
| 1743 | + this.calculatePrice(); | ||
| 1744 | + }, | ||
| 1745 | + | ||
| 1746 | + /*----券的所有操作----*/ | ||
| 1747 | + open_coupon_list: function (e) { | ||
| 1748 | + var th = this; | ||
| 1749 | + var pickid = e.currentTarget.dataset.pickid; | ||
| 1750 | + var bn = e.currentTarget.dataset.bn; | ||
| 1751 | + var cindx = e.currentTarget.dataset.cind; | ||
| 1752 | + var get_by_quan_list_cart = th.data.get_by_quan_list_cart[pickid]; | ||
| 1753 | + | ||
| 1754 | + | ||
| 1755 | + if (bn == 1) { | ||
| 1756 | + th.setData({open_quan: 1, selected_quan_pick: pickid, disabled: 1}); | ||
| 1757 | + } else { | ||
| 1758 | + //---多单打开券的时候,就要判断券在其他门店是否有使用--- | ||
| 1759 | + var quanlist = th.data.cartlist[cindx].quan_list; | ||
| 1760 | + var exp_type = th.data.cartlist[cindx].exp_type; | ||
| 1761 | + | ||
| 1762 | + | ||
| 1763 | + //对于在其他门店已经选择了的券 要判断是否显示到界面 | ||
| 1764 | + var t_user = th.data.using_quan[pickid]; | ||
| 1765 | + | ||
| 1766 | + for (var i in quanlist) { | ||
| 1767 | + quanlist[i].is_using = th.check_in_sele(quanlist[i].CashRepNo, pickid); | ||
| 1768 | + if (t_user && quanlist[i].CashRepNo == t_user.coupon_no) | ||
| 1769 | + quanlist[i].show_red = 1; | ||
| 1770 | + else | ||
| 1771 | + quanlist[i].show_red = 0; | ||
| 1772 | + } | ||
| 1773 | + | ||
| 1774 | + if (get_by_quan_list_cart) { | ||
| 1775 | + for (var i in get_by_quan_list_cart) { | ||
| 1776 | + get_by_quan_list_cart[i].is_using = th.check_in_sele(get_by_quan_list_cart[i].no, pickid); | ||
| 1777 | + if (t_user && get_by_quan_list_cart[i].no == t_user.coupon_no) | ||
| 1778 | + get_by_quan_list_cart[i].show_red = 1; | ||
| 1779 | + else | ||
| 1780 | + get_by_quan_list_cart[i].show_red = 0; | ||
| 1781 | + } | ||
| 1782 | + th.setData({by_quan_list_cart: get_by_quan_list_cart}); | ||
| 1783 | + } else { | ||
| 1784 | + th.setData({by_quan_list_cart: null}); | ||
| 1785 | + } | ||
| 1786 | + | ||
| 1787 | + console.log("2222222券的列表", quanlist); | ||
| 1788 | + th.setData({ | ||
| 1789 | + sele_cart_ind: cindx, | ||
| 1790 | + sele_exp_type: exp_type, | ||
| 1791 | + open_quan: 1, | ||
| 1792 | + selected_quan_pick: pickid, | ||
| 1793 | + selected_quan_list: quanlist, | ||
| 1794 | + disabled: 1 | ||
| 1795 | + }); | ||
| 1796 | + } | ||
| 1797 | + }, | ||
| 1798 | + close_coupon: function (e) { | ||
| 1799 | + var th = this; | ||
| 1800 | + th.setData({open_quan: 0, disabled: 0}); | ||
| 1801 | + }, | ||
| 1802 | + | ||
| 1803 | + //---判断券时候在已经选择的列表中--- | ||
| 1804 | + check_in_sele: function (no, pick_id) { | ||
| 1805 | + var th = this; | ||
| 1806 | + if (th.data.using_quan.length <= 0) return false; | ||
| 1807 | + for (var i in th.data.using_quan) { | ||
| 1808 | + //--如果键值等于本身就要跳出-- | ||
| 1809 | + if (parseInt(i) == parseInt(pick_id)) continue; | ||
| 1810 | + var item = th.data.using_quan[i]; | ||
| 1811 | + if (item.coupon_no == no) { | ||
| 1812 | + return true; | ||
| 1813 | + } | ||
| 1814 | + } | ||
| 1815 | + return false; | ||
| 1816 | + }, | ||
| 1817 | + | ||
| 1818 | + /*--点击选择券--*/ | ||
| 1819 | + sele_quan_item: function (e) { | ||
| 1820 | + | ||
| 1821 | + var ind = e.currentTarget.dataset.ind; | ||
| 1822 | + var quan_item = this.data.selected_quan_list[ind]; | ||
| 1823 | + var pickid = this.data.selected_quan_pick; //现在选择的是哪一个门店 | ||
| 1824 | + //--如果券是单品使用的时候-- | ||
| 1825 | + if (quan_item && quan_item.UseObjectType && quan_item.UseObjectType == "20") { | ||
| 1826 | + //---只有多件购买的时候才要计算,//购物车购买和搭配勾的时候--- | ||
| 1827 | + var gg = getApp().get_b_now(); | ||
| 1828 | + if (this.data.is_b_now == 0 || gg.prom_type == 5) { | ||
| 1829 | + var arr = this.data.order_prom_list_cart; | ||
| 1830 | + var t_pk_item = null; | ||
| 1831 | + for (var ii in arr) { | ||
| 1832 | + var ep = arr[ii]; | ||
| 1833 | + if (pickid == ep.pickup_id) { | ||
| 1834 | + t_pk_item = ep; | ||
| 1835 | + break; | ||
| 1836 | + } | ||
| 1837 | + } | ||
| 1838 | + //--寻找券指定的商品-- | ||
| 1839 | + var gd = null; | ||
| 1840 | + if (t_pk_item) { | ||
| 1841 | + var goods = t_pk_item.goods; | ||
| 1842 | + for (var gid in goods) { | ||
| 1843 | + if (quan_item.UseObjectID == goods[gid].erpwareid) { | ||
| 1844 | + gd = goods[gid]; | ||
| 1845 | + } | ||
| 1846 | + } | ||
| 1847 | + } | ||
| 1848 | + if (!gd) { | ||
| 1849 | + getApp().my_warnning("未找到指定商品使用", 0, this, 600); | ||
| 1850 | + return false; | ||
| 1851 | + } | ||
| 1852 | + //计算价格,如果有平摊的实收要计算实收的金额 | ||
| 1853 | + var item_price = gd.goods_price * gd.goods_num; | ||
| 1854 | + //-- 如果有平摊下去,有实收价格的时候,就要用account_fir来计算价格 -- | ||
| 1855 | + if (gd.account_fir != null && gd.account_fir != undefined) { | ||
| 1856 | + item_price = gd.account_fir * gd.goods_num; | ||
| 1857 | + } | ||
| 1858 | + | ||
| 1859 | + if (item_price < parseFloat(quan_item.BuySum)) { | ||
| 1860 | + getApp().my_warnning("该单品金额没有大于等于" + quan_item.BuySum + "元时不能使用优惠券", 0, this, 600); | ||
| 1861 | + return false; | ||
| 1862 | + } | ||
| 1863 | + } | ||
| 1864 | + } | ||
| 1865 | + | ||
| 1866 | + var no_use = e.currentTarget.dataset.no, quanlist = this.data.selected_quan_list; | ||
| 1867 | + //---所有的券的显示红色选择都清理一遍--- | ||
| 1868 | + for (var i in quanlist) { | ||
| 1869 | + quanlist[i].show_red = 0; | ||
| 1870 | + } | ||
| 1871 | + this.setData({selected_quan_list: quanlist}); | ||
| 1872 | + var by_quanlist = this.data.get_by_quan_list; | ||
| 1873 | + if (by_quanlist) { | ||
| 1874 | + //---所有的券的显示红色选择都清理一遍--- | ||
| 1875 | + for (var inb in by_quanlist) { | ||
| 1876 | + by_quanlist[inb].show_red = 0; | ||
| 1877 | + } | ||
| 1878 | + this.setData({get_by_quan_list: by_quanlist}); | ||
| 1879 | + } | ||
| 1880 | + | ||
| 1881 | + var by_cart_list = this.data.by_quan_list_cart; | ||
| 1882 | + if (by_cart_list) { | ||
| 1883 | + //---所有的券的显示红色选择都清理一遍--- | ||
| 1884 | + for (var inc in by_cart_list) { | ||
| 1885 | + by_cart_list[inc].show_red = 0; | ||
| 1886 | + } | ||
| 1887 | + this.setData({by_quan_list_cart: by_cart_list}); | ||
| 1888 | + } | ||
| 1889 | + | ||
| 1890 | + var using_quan = this.data.using_quan; | ||
| 1891 | + var th = this; | ||
| 1892 | + //---如果是不使用优惠券--- | ||
| 1893 | + if (no_use == 1) { | ||
| 1894 | + console.log("有进来吗券", no_use); | ||
| 1895 | + if (using_quan[th.data.selected_quan_pick]) { | ||
| 1896 | + using_quan[th.data.selected_quan_pick].is_nouse_red = 1; | ||
| 1897 | + } | ||
| 1898 | + else { | ||
| 1899 | + using_quan[th.data.selected_quan_pick] = {is_nouse_red: 1}; | ||
| 1900 | + } | ||
| 1901 | + this.setData({using_quan: using_quan, is_coupon: 2222}); | ||
| 1902 | + return; | ||
| 1903 | + } | ||
| 1904 | + | ||
| 1905 | + | ||
| 1906 | + var txt = "selected_quan_list[" + ind + "].show_red"; | ||
| 1907 | + var obj = {}; | ||
| 1908 | + obj[txt] = 1; | ||
| 1909 | + if (quan_item.show_red) { | ||
| 1910 | + obj[txt] = 0; | ||
| 1911 | + } | ||
| 1912 | + this.setData(obj); | ||
| 1913 | + console.log(this.data.selected_quan_list, "选中的券的下标", quan_item, "数据都在这里", txt); | ||
| 1914 | + if (using_quan[th.data.selected_quan_pick]) { | ||
| 1915 | + using_quan[th.data.selected_quan_pick].is_nouse_red = 0; | ||
| 1916 | + } | ||
| 1917 | + else { | ||
| 1918 | + using_quan[th.data.selected_quan_pick] = {is_nouse_red: 0}; | ||
| 1919 | + } | ||
| 1920 | + this.setData({using_quan: using_quan}); | ||
| 1921 | + | ||
| 1922 | + }, | ||
| 1923 | + | ||
| 1924 | + | ||
| 1925 | + /*----- 点击选择包邮券 -----*/ | ||
| 1926 | + sele_quan_item_by: function (e) { | ||
| 1927 | + var no_use = e.currentTarget.dataset.no; | ||
| 1928 | + //立即购买的包邮券 | ||
| 1929 | + var by_quanlist = this.data.get_by_quan_list; | ||
| 1930 | + if (by_quanlist) { | ||
| 1931 | + //---所有的券的显示红色选择都清理一遍--- | ||
| 1932 | + for (var ind in by_quanlist) { | ||
| 1933 | + by_quanlist[ind].show_red = 0; | ||
| 1934 | + } | ||
| 1935 | + this.setData({get_by_quan_list: by_quanlist}); | ||
| 1936 | + } | ||
| 1937 | + | ||
| 1938 | + //--购物车过来的包邮券-- | ||
| 1939 | + var by_cart_list = this.data.by_quan_list_cart; | ||
| 1940 | + if (by_cart_list) { | ||
| 1941 | + //---所有的券的显示红色选择都清理一遍--- | ||
| 1942 | + for (var ind in by_cart_list) { | ||
| 1943 | + by_cart_list[ind].show_red = 0; | ||
| 1944 | + } | ||
| 1945 | + this.setData({by_quan_list_cart: by_cart_list}); | ||
| 1946 | + } | ||
| 1947 | + //普通券 | ||
| 1948 | + var quanlist = this.data.selected_quan_list; | ||
| 1949 | + if (quanlist) { | ||
| 1950 | + //---所有的券的显示红色选择都清理一遍--- | ||
| 1951 | + for (var ind in quanlist) { | ||
| 1952 | + quanlist[ind].show_red = 0; | ||
| 1953 | + } | ||
| 1954 | + this.setData({selected_quan_list: quanlist}); | ||
| 1955 | + } | ||
| 1956 | + | ||
| 1957 | + var th = this; | ||
| 1958 | + var using_quan = this.data.using_quan; | ||
| 1959 | + //---如果是不使用优惠券--- | ||
| 1960 | + if (no_use == 1) { | ||
| 1961 | + if (using_quan[th.data.selected_quan_pick]) { | ||
| 1962 | + using_quan[th.data.selected_quan_pick].is_nouse_red = 1; | ||
| 1963 | + } | ||
| 1964 | + else { | ||
| 1965 | + using_quan[th.data.selected_quan_pick] = {is_nouse_red: 1}; | ||
| 1966 | + } | ||
| 1967 | + this.setData({using_quan: using_quan, is_coupon: 2222}); | ||
| 1968 | + return; | ||
| 1969 | + } | ||
| 1970 | + | ||
| 1971 | + var pickid = th.data.selected_quan_pick; //现在选择的是哪一个门店 | ||
| 1972 | + var ind = e.currentTarget.dataset.ind; | ||
| 1973 | + //--如果是立即购买的部分-- | ||
| 1974 | + var txt = ""; | ||
| 1975 | + var txt1 = ""; | ||
| 1976 | + var quan_item = null; | ||
| 1977 | + | ||
| 1978 | + quan_item = this.data.get_by_quan_list[ind]; | ||
| 1979 | + txt = "get_by_quan_list[" + ind + "].show_red"; | ||
| 1980 | + var obj = {}; | ||
| 1981 | + obj[txt] = 1; | ||
| 1982 | + this.setData(obj); | ||
| 1983 | + | ||
| 1984 | + | ||
| 1985 | + if (using_quan[th.data.selected_quan_pick]) { | ||
| 1986 | + using_quan[th.data.selected_quan_pick].is_nouse_red = 0; | ||
| 1987 | + } | ||
| 1988 | + else { | ||
| 1989 | + using_quan[th.data.selected_quan_pick] = {is_nouse_red: 0}; | ||
| 1990 | + } | ||
| 1991 | + this.setData({using_quan: using_quan}); | ||
| 1992 | + }, | ||
| 1993 | + | ||
| 1994 | + //--确认使用券--- | ||
| 1995 | + confirm_quan: function () { | ||
| 1996 | + var using_quan = this.data.using_quan; //正在使用中的券列表 | ||
| 1997 | + var pickid = this.data.selected_quan_pick; //选中的门店ID | ||
| 1998 | + var th = this; | ||
| 1999 | + var selected_quan_list = this.data.selected_quan_list; //选择了那个门店的券列表 | ||
| 2000 | + var get_by_quan_list = this.data.get_by_quan_list; //立即购买的包邮券列表 | ||
| 2001 | + var by_quan_list_cart = this.data.by_quan_list_cart; //购物车购买的包邮券列表 | ||
| 2002 | + //选择了的券 | ||
| 2003 | + var sele_quan = null; | ||
| 2004 | + | ||
| 2005 | + //循环普通的券 | ||
| 2006 | + for (var i in selected_quan_list) { | ||
| 2007 | + var item = selected_quan_list[i]; | ||
| 2008 | + if (item.show_red) { | ||
| 2009 | + th.insert_into_using_quan(item, using_quan, pickid); | ||
| 2010 | + return; | ||
| 2011 | + } | ||
| 2012 | + } | ||
| 2013 | + //循环包邮的券,立即购买的 | ||
| 2014 | + for (var i in get_by_quan_list) { | ||
| 2015 | + var item = get_by_quan_list[i]; | ||
| 2016 | + if (item.show_red) { | ||
| 2017 | + if (th.data.is_no_by[pickid] == 1) { | ||
| 2018 | + getApp().my_warnning("已全场不能包邮,不能选择包邮券", 0, th); | ||
| 2019 | + return false; | ||
| 2020 | + } | ||
| 2021 | + if (th.data.is_by[pickid] == 1) { | ||
| 2022 | + getApp().my_warnning("已全场包邮,不能选择包邮券", 0, th); | ||
| 2023 | + return false; | ||
| 2024 | + } | ||
| 2025 | + | ||
| 2026 | + th.insert_into_using_quan(item, using_quan, pickid, 1); | ||
| 2027 | + return; | ||
| 2028 | + } | ||
| 2029 | + } | ||
| 2030 | + | ||
| 2031 | + //循环包邮的券 | ||
| 2032 | + for (var i in by_quan_list_cart) { | ||
| 2033 | + var item = by_quan_list_cart[i]; | ||
| 2034 | + if (item.show_red) { | ||
| 2035 | + if (th.data.is_no_by[pickid] == 1) { | ||
| 2036 | + getApp().my_warnning("已全场不能包邮,不能选择包邮券", 0, th); | ||
| 2037 | + return false; | ||
| 2038 | + } | ||
| 2039 | + if (th.data.is_by[pickid] == 1) { | ||
| 2040 | + getApp().my_warnning("已全场包邮,不能选择包邮券", 0, th); | ||
| 2041 | + return false; | ||
| 2042 | + } | ||
| 2043 | + th.insert_into_using_quan(item, using_quan, pickid, 1); | ||
| 2044 | + return; | ||
| 2045 | + } | ||
| 2046 | + } | ||
| 2047 | + | ||
| 2048 | + //选择了的券,看是不是点击了不使用券,点击了不使用优惠券 | ||
| 2049 | + if (using_quan[pickid]) { | ||
| 2050 | + if (using_quan[pickid].is_nouse_red == 1) { | ||
| 2051 | + using_quan[pickid] = {is_nouse_red: 1}; | ||
| 2052 | + th.setData({using_quan: using_quan}); | ||
| 2053 | + if (th.data.is_b_now == 1) { | ||
| 2054 | + th.calculatePrice2(); | ||
| 2055 | + } else { | ||
| 2056 | + th.calculatePrice(); | ||
| 2057 | + } | ||
| 2058 | + th.setData({open_quan: 0}); | ||
| 2059 | + return; | ||
| 2060 | + } | ||
| 2061 | + } | ||
| 2062 | + }, | ||
| 2063 | + | ||
| 2064 | + //----把券插入之后的操作,同时还要重新计算价格---- | ||
| 2065 | + insert_into_using_quan: function (item, using_quan, pickid, isby) { | ||
| 2066 | + var th = this; | ||
| 2067 | + if (isby == 1) { | ||
| 2068 | + using_quan[pickid] = { | ||
| 2069 | + coupon_no: item.no, | ||
| 2070 | + money: 0, | ||
| 2071 | + is_nouse_red: 0, | ||
| 2072 | + region_list: item.region_list, | ||
| 2073 | + goods_list: item.goods_list | ||
| 2074 | + }; | ||
| 2075 | + using_quan[pickid].isby = 1; | ||
| 2076 | + } else { | ||
| 2077 | + using_quan[pickid] = {coupon_no: item.CashRepNo, money: item.Sum, is_nouse_red: 0}; | ||
| 2078 | + using_quan[pickid].isby = 0; | ||
| 2079 | + } | ||
| 2080 | + this.setData({using_quan: using_quan}); | ||
| 2081 | + th.calculatePrice2(); | ||
| 2082 | + | ||
| 2083 | + th.setData({open_quan: 0}); | ||
| 2084 | + }, | ||
| 2085 | + | ||
| 2086 | + cart_set_err: function (e) { | ||
| 2087 | + var txt = e.currentTarget.dataset.err; | ||
| 2088 | + var ob = {}; | ||
| 2089 | + ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif"; | ||
| 2090 | + this.setData(ob); | ||
| 2091 | + }, | ||
| 2092 | + //--验证是否已经冻结-- | ||
| 2093 | + check_is_frozenQuan: function (quanlist, frozenQuan, isby) { | ||
| 2094 | + console.log("券列表", quanlist); | ||
| 2095 | + if (!quanlist) return null; | ||
| 2096 | + if (!frozenQuan) return quanlist; | ||
| 2097 | + var arr = []; | ||
| 2098 | + for (var i = 0; i < quanlist.length; i++) { | ||
| 2099 | + var item = quanlist[i]; | ||
| 2100 | + var is_find = 0; | ||
| 2101 | + var Q_no = quanlist[i].CashRepNo; | ||
| 2102 | + if (isby) Q_no = quanlist[i].no; | ||
| 2103 | + for (var j = 0; j < frozenQuan.length; j++) { | ||
| 2104 | + var q_no = frozenQuan[j].cashRepNo; | ||
| 2105 | + if (Q_no == q_no) { | ||
| 2106 | + is_find = 1; | ||
| 2107 | + break; | ||
| 2108 | + } | ||
| 2109 | + } | ||
| 2110 | + if (!is_find) arr.push(item); | ||
| 2111 | + } | ||
| 2112 | + return arr; | ||
| 2113 | + }, | ||
| 2114 | + | ||
| 2115 | + //// 开启物流的弹窗 | ||
| 2116 | + show_wu_arr: function (e) { | ||
| 2117 | + var wu_arr_txt = e.currentTarget.dataset.txt; | ||
| 2118 | + var w_sele_index = e.currentTarget.dataset.w_sele_index; | ||
| 2119 | + var is_express = null; | ||
| 2120 | + var ob = {open_express: 1, wu_arr_txt: wu_arr_txt, disabled: 1}; | ||
| 2121 | + | ||
| 2122 | + //--如果是多个门店的时候-- | ||
| 2123 | + if (w_sele_index != undefined) { | ||
| 2124 | + is_express = this.data.cartlist[w_sele_index].wind; | ||
| 2125 | + ob['is_express'] = is_express; | ||
| 2126 | + } | ||
| 2127 | + this.setData(ob); | ||
| 2128 | + }, | ||
| 2129 | + // 关闭物流的弹窗 | ||
| 2130 | + close_express: function () { | ||
| 2131 | + this.setData({open_express: 0, disabled: 0}); | ||
| 2132 | + }, | ||
| 2133 | + // 选择物流 | ||
| 2134 | + click_express_name: function (e) { | ||
| 2135 | + var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode; | ||
| 2136 | + var index = e.currentTarget.dataset.idxe; | ||
| 2137 | + var ob = {is_express: index, is_shipping_code: shippingcode, disabled: 0}; | ||
| 2138 | + ob[this.data.wu_arr_txt] = index; | ||
| 2139 | + this.setData(ob); | ||
| 2140 | + }, | ||
| 2141 | + | ||
| 2142 | + //点击确定物流 | ||
| 2143 | + determine_expres: function (e) { | ||
| 2144 | + this.setData({open_express: 0}); | ||
| 2145 | + if (this.data.is_b_now == 1) | ||
| 2146 | + this.calculatePrice2(); | ||
| 2147 | + else | ||
| 2148 | + this.calculatePrice(); | ||
| 2149 | + }, | ||
| 2150 | + | ||
| 2151 | + //点击打开优惠券使用说明 | ||
| 2152 | + clik_coupons: function (e) { | ||
| 2153 | + var ind = e.currentTarget.dataset.idx; | ||
| 2154 | + var is_open = this.data.selected_quan_list[ind].is_open; | ||
| 2155 | + | ||
| 2156 | + if (is_open == 1) is_open = 0; | ||
| 2157 | + else is_open = 1; | ||
| 2158 | + | ||
| 2159 | + var txt = "selected_quan_list[" + ind + "].is_open" | ||
| 2160 | + var obj = {}; | ||
| 2161 | + obj[txt] = is_open; | ||
| 2162 | + | ||
| 2163 | + this.setData(obj); | ||
| 2164 | + this.setData({disabled: 1}) | ||
| 2165 | + }, | ||
| 2166 | + | ||
| 2167 | + clik_coupons2: function (e) { | ||
| 2168 | + var ind = e.currentTarget.dataset.idx; | ||
| 2169 | + var is_open = this.data.get_by_quan_list[ind].is_open; | ||
| 2170 | + | ||
| 2171 | + if (is_open == 1) is_open = 0; | ||
| 2172 | + else is_open = 1; | ||
| 2173 | + | ||
| 2174 | + var txt = "get_by_quan_list[" + ind + "].is_open" | ||
| 2175 | + var obj = {}; | ||
| 2176 | + obj[txt] = is_open; | ||
| 2177 | + | ||
| 2178 | + this.setData(obj); | ||
| 2179 | + this.setData({disabled: 1}) | ||
| 2180 | + }, | ||
| 2181 | + | ||
| 2182 | + | ||
| 2183 | + //设置默认物流 | ||
| 2184 | + select_default_logistics: function () { | ||
| 2185 | + var th = this; | ||
| 2186 | + var is_shipping_code = this.data.is_shipping_code | ||
| 2187 | + getApp().request.put("/api/weshop/users/update", { | ||
| 2188 | + data: {user_id: getApp().globalData.user_id, store_id: oo.stoid, def_exp_code: is_shipping_code}, | ||
| 2189 | + success: function (rse) { | ||
| 2190 | + if (rse.data.code == 0) { | ||
| 2191 | + getApp().globalData.userInfo.def_exp_code = is_shipping_code; | ||
| 2192 | + th.setData({open_express: 0}); | ||
| 2193 | + //----计算此时购物车的价格---- | ||
| 2194 | + if (th.data.is_b_now == 1) th.calculatePrice2(); | ||
| 2195 | + else th.calculatePrice(); | ||
| 2196 | + } | ||
| 2197 | + } | ||
| 2198 | + }) | ||
| 2199 | + }, | ||
| 2200 | + | ||
| 2201 | + //更新下默认,在onshow里面 | ||
| 2202 | + update_code(){ | ||
| 2203 | + var th = this, m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; | ||
| 2204 | + //--定时器,判断wu_arr不未空-- | ||
| 2205 | + var uii = setInterval(function () { | ||
| 2206 | + if (th.data.wu_arr) { | ||
| 2207 | + clearInterval(uii); | ||
| 2208 | + for (var k = 0; k < th.data.wu_arr.length; k++) { | ||
| 2209 | + var item = th.data.wu_arr[k]; | ||
| 2210 | + if (def_exp_code == item.code) { | ||
| 2211 | + m_wind = k; | ||
| 2212 | + } | ||
| 2213 | + } | ||
| 2214 | + //--如果是立即购买-- | ||
| 2215 | + if (th.data.is_b_now == 1) { | ||
| 2216 | + th.setData({index: m_wind, is_express: m_wind}); | ||
| 2217 | + } else { | ||
| 2218 | + var ui = setInterval(function () { | ||
| 2219 | + if (th.data.cartlist) { | ||
| 2220 | + var c_arr = th.data.cartlist; | ||
| 2221 | + for (var i in c_arr) { | ||
| 2222 | + c_arr[i].wind = m_wind; | ||
| 2223 | + } | ||
| 2224 | + th.setData({cartlist: c_arr, is_express: m_wind}) | ||
| 2225 | + clearInterval(ui); | ||
| 2226 | + } | ||
| 2227 | + }, 500) | ||
| 2228 | + } | ||
| 2229 | + } | ||
| 2230 | + }, 500); | ||
| 2231 | + }, | ||
| 2232 | + //-----获取购物车进来的劵------- | ||
| 2233 | + get_cart_quan: async function (order_prom_list_cart) { | ||
| 2234 | + var th = this; | ||
| 2235 | + var is_xz_yh = 1; | ||
| 2236 | + //等待值的出现 | ||
| 2237 | + //getApp().waitfor2(this,"g_cart_q_time","order_prom_list_cart",async function () { | ||
| 2238 | + //var arr=th.data.order_prom_list_cart; | ||
| 2239 | + var arr = order_prom_list_cart; | ||
| 2240 | + if (!arr) arr = []; | ||
| 2241 | + //如果系统有限制使用优惠券 | ||
| 2242 | + if (th.data.is_close_quan) return false; | ||
| 2243 | + | ||
| 2244 | + //------------开始计算使用优惠券相关------------ | ||
| 2245 | + for (var ind in arr) { | ||
| 2246 | + var ep = arr[ind]; | ||
| 2247 | + var goodlist = ep.goods; | ||
| 2248 | + var pickup_id = ep.pickup_id; | ||
| 2249 | + //--更优惠券抵用有关,立即购买的,如果是购物车,如果有等级价还有考虑等级价的东西 | ||
| 2250 | + //就要把相应的值,写入cartlist数组中-- | ||
| 2251 | + var ckeck_quan_price = 0, | ||
| 2252 | + check_quan_price_list = '', | ||
| 2253 | + check_quan_ware_list = ''; | ||
| 2254 | + | ||
| 2255 | + for (var i in goodlist) { | ||
| 2256 | + var gd = goodlist[i]; | ||
| 2257 | + //--如果是秒杀就跳出,如果是赠品,如果是组合购,如果是限制使用优惠券-- | ||
| 2258 | + if (gd.prom_type == 1 || gd.is_gift || gd.prom_type == 7) { | ||
| 2259 | + continue; | ||
| 2260 | + } | ||
| 2261 | + //如果有限制使用优惠券,就要返回 | ||
| 2262 | + if (gd.prom_type == 3) { | ||
| 2263 | + if (th.data.prom_goods_map[pickup_id][gd.prom_id].is_xz_yh) continue; | ||
| 2264 | + th.data.prom_goods_map[pickup_id][gd.prom_id].coupon_sele = 1; | ||
| 2265 | + } | ||
| 2266 | + is_xz_yh = 0; | ||
| 2267 | + var item_price = gd.goods_price * gd.goods_num; | ||
| 2268 | + //-- 如果有平摊下去,有实收价格的时候,就要用account来计算价格 -- | ||
| 2269 | + if (gd.account_fir != null && gd.account_fir != undefined) { | ||
| 2270 | + item_price = gd.account_fir * gd.goods_num; | ||
| 2271 | + } | ||
| 2272 | + ckeck_quan_price += item_price; | ||
| 2273 | + | ||
| 2274 | + //--组装价格list-- | ||
| 2275 | + if (check_quan_price_list) { | ||
| 2276 | + check_quan_price_list += "," + item_price; | ||
| 2277 | + } else { | ||
| 2278 | + check_quan_price_list = item_price; | ||
| 2279 | + } | ||
| 2280 | + //--组装商品的线下erpwareid-- | ||
| 2281 | + if (check_quan_ware_list) { | ||
| 2282 | + check_quan_ware_list += "," + encodeURIComponent(gd['erpwareid']); | ||
| 2283 | + } else { | ||
| 2284 | + check_quan_ware_list = encodeURIComponent(gd['erpwareid']); | ||
| 2285 | + } | ||
| 2286 | + } | ||
| 2287 | + //优惠券优惠的金额要控制到优惠券的选择条件 | ||
| 2288 | + var cut_price = 0; | ||
| 2289 | + for (var i in th.data.prom_goods_map[pickup_id]) { | ||
| 2290 | + var obj = th.data.prom_goods_map[pickup_id][i]; | ||
| 2291 | + if (obj.coupon_sele) { | ||
| 2292 | + cut_price += obj.price - obj.prom_price; | ||
| 2293 | + } | ||
| 2294 | + } | ||
| 2295 | + | ||
| 2296 | + arr[ind].ckeck_quan_price = ckeck_quan_price - cut_price; | ||
| 2297 | + arr[ind].check_quan_ware_list = check_quan_ware_list; | ||
| 2298 | + arr[ind].check_quan_price_list = check_quan_price_list; | ||
| 2299 | + | ||
| 2300 | + //是否关闭使用优惠券 | ||
| 2301 | + if (th.data.is_close_quan != 1 && !is_xz_yh) { | ||
| 2302 | + //--调用接口,获取优惠券的列表,3秒钟内控制接口请求-- | ||
| 2303 | + var url = "/api/weshop/couponList/getUseCouponList"; | ||
| 2304 | + await app.request.promiseGet(url, { | ||
| 2305 | + data: { | ||
| 2306 | + storeId: oo.stoid, | ||
| 2307 | + userId: app.globalData.user_id, | ||
| 2308 | + BuySum: ckeck_quan_price, | ||
| 2309 | + WareIds: check_quan_ware_list, | ||
| 2310 | + pageSize: 100 | ||
| 2311 | + } | ||
| 2312 | + }).then(res => { | ||
| 2313 | + if (res.data.code == 0) { | ||
| 2314 | + var quan_list = res.data.data.pageData; | ||
| 2315 | + arr[ind].quan_list = th.check_is_frozenQuan(quan_list, th.data.frozenQuan); | ||
| 2316 | + } | ||
| 2317 | + }) | ||
| 2318 | + } | ||
| 2319 | + } | ||
| 2320 | + | ||
| 2321 | + //如果是搭配购的立即购买的时候 | ||
| 2322 | + if (th.data.is_b_now) { | ||
| 2323 | + if (arr && arr.length > 0) { | ||
| 2324 | + var quanlist = arr[0].quan_list; | ||
| 2325 | + th.setData({selected_quan_list: quanlist, cartlist: arr}) | ||
| 2326 | + } | ||
| 2327 | + } else { | ||
| 2328 | + th.setData({cartlist: arr}) | ||
| 2329 | + th.set_can_num(); | ||
| 2330 | + } | ||
| 2331 | + | ||
| 2332 | + //}) | ||
| 2333 | + }, | ||
| 2334 | + | ||
| 2335 | + //------ 获取立即购买的购物车的劵 -------- | ||
| 2336 | + get_buy_now_quan: function () { | ||
| 2337 | + var quanlist = null, th = this, frozenQuan = null; | ||
| 2338 | + var good = this.data.bn_goods; | ||
| 2339 | + if (good.prom_price) { | ||
| 2340 | + th.data.ckeck_quan_price = good.prom_price; //如果有优惠价,就用优惠价 | ||
| 2341 | + } else if (good.is_offline) { | ||
| 2342 | + th.data.ckeck_quan_price = good.offline_price; //如果有线下取价,就用线下价 | ||
| 2343 | + } | ||
| 2344 | + //--如果商家后台没有限制使用优惠券,同时商品的优惠活动没有限制使用优惠券-- | ||
| 2345 | + if (th.data.is_close_quan != 1 && th.data.bn_goods.is_xz_yh != 1) { | ||
| 2346 | + var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id; | ||
| 2347 | + var url = "/api/weshop/couponList/getUseCouponList"; | ||
| 2348 | + app.request.promiseGet(url0, {1: 1}).then(res => { | ||
| 2349 | + if (res.data.code == 0) { | ||
| 2350 | + frozenQuan = res.data.data; | ||
| 2351 | + th.data.frozenQuan = frozenQuan; | ||
| 2352 | + } | ||
| 2353 | + app.request.time_limit_get(6, url, { | ||
| 2354 | + data: { | ||
| 2355 | + storeId: oo.stoid, | ||
| 2356 | + userId: app.globalData.user_id, | ||
| 2357 | + BuySum: th.data.ckeck_quan_price, | ||
| 2358 | + WareIds: encodeURIComponent(th.data.check_quan_ware_list), | ||
| 2359 | + pageSize: 100 | ||
| 2360 | + }, | ||
| 2361 | + success: function (res) { | ||
| 2362 | + if (res.data.code == 0) { | ||
| 2363 | + quanlist = res.data.data.pageData; | ||
| 2364 | + if (quanlist) { | ||
| 2365 | + quanlist = th.check_is_frozenQuan(quanlist, frozenQuan); | ||
| 2366 | + th.setData({selected_quan_list: quanlist}) | ||
| 2367 | + } | ||
| 2368 | + } | ||
| 2369 | + } | ||
| 2370 | + }) | ||
| 2371 | + }) | ||
| 2372 | + } | ||
| 2373 | + }, | ||
| 2374 | + | ||
| 2375 | + //检查区域是不是包邮 | ||
| 2376 | + check_area: function (arr) { | ||
| 2377 | + var user_addr = this.data.user_addr; | ||
| 2378 | + if (!user_addr) return 0; | ||
| 2379 | + for (var i in arr) { | ||
| 2380 | + var item = arr[i]; | ||
| 2381 | + if (user_addr.twon == item || user_addr.district == item | ||
| 2382 | + || user_addr.city == item || user_addr.province == item) { | ||
| 2383 | + return 0; | ||
| 2384 | + } | ||
| 2385 | + } | ||
| 2386 | + return 1; | ||
| 2387 | + }, | ||
| 2388 | + | ||
| 2389 | + //检查立即购买的商品是不是不包邮 | ||
| 2390 | + check_good: function (arr, goods_id) { | ||
| 2391 | + if (!goods_id) goods_id = this.data.bn_goods.goods_id; | ||
| 2392 | + for (var i in arr) { | ||
| 2393 | + var item = arr[i]; | ||
| 2394 | + if (goods_id == item) return 0; | ||
| 2395 | + } | ||
| 2396 | + return 1; | ||
| 2397 | + }, | ||
| 2398 | + check_by_area: function (region_list) { | ||
| 2399 | + var arr = region_list.split(","); | ||
| 2400 | + var check = this.check_area(arr); | ||
| 2401 | + return !check; | ||
| 2402 | + }, | ||
| 2403 | + check_by_goods: function (goods_list, goods_id) { | ||
| 2404 | + var arr = goods_list.split(","); | ||
| 2405 | + var check = this.check_good(arr, goods_id); | ||
| 2406 | + return !check; | ||
| 2407 | + }, | ||
| 2408 | + //立即购买获取优惠活动的内容 | ||
| 2409 | + buy_now_prom_goods: function (prom_id, arr, func) { | ||
| 2410 | + var price = arr.shop_price * arr.goods_num; | ||
| 2411 | + var prom = null; | ||
| 2412 | + getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + prom_id, {}).then(res => { | ||
| 2413 | + if (res.data.code == 0) { | ||
| 2414 | + prom = res.data.data; | ||
| 2415 | + return getApp().request.promiseGet("/api/weshop/goods/getDiscount", { | ||
| 2416 | + data: { | ||
| 2417 | + price: price, | ||
| 2418 | + prom_id: prom_id, | ||
| 2419 | + goods_num: arr.goods_num, | ||
| 2420 | + user_id: getApp().globalData.user_id, | ||
| 2421 | + is_bz: prom.is_bz | ||
| 2422 | + } | ||
| 2423 | + }) | ||
| 2424 | + } else { | ||
| 2425 | + func(arr); | ||
| 2426 | + } | ||
| 2427 | + }).then(res => { | ||
| 2428 | + if (res.data.code == 0) { | ||
| 2429 | + var get_data = res.data.data; | ||
| 2430 | + arr.is_bz = prom.is_bz; //是不是倍增 | ||
| 2431 | + arr.is_xz_yh = prom.is_xz_yh; //是不是优惠 | ||
| 2432 | + arr.bs = get_data.bs; //是不是倍数 | ||
| 2433 | + arr.is_past = get_data.is_past; //是不是包邮 | ||
| 2434 | + arr.prom_price = get_data.price >= 0 ? get_data.price : price; | ||
| 2435 | + arr.s_intValue = get_data.intValue; | ||
| 2436 | + arr.s_coupon_id = get_data.coupon_id; | ||
| 2437 | + arr.s_coupon_num = get_data.coupon_num; | ||
| 2438 | + //-- 看是不是有赠品 -- | ||
| 2439 | + if (get_data.gift_id) { | ||
| 2440 | + arr.gift_id = get_data.gift_id; | ||
| 2441 | + arr.gift_goods_id = get_data.goods_id; | ||
| 2442 | + arr.gift_goods_name = get_data.goods_name; | ||
| 2443 | + arr.gift_goods_color = get_data.goodsinfo.goods_color; | ||
| 2444 | + arr.gift_goods_spec = get_data.goodsinfo.goods_spec; | ||
| 2445 | + arr.gift_original_img = get_data.goodsinfo.original_img; | ||
| 2446 | + arr.gift_weight = get_data.goodsinfo.weight; | ||
| 2447 | + arr.gift_exp_sum_type = get_data.goodsinfo.exp_sum_type; | ||
| 2448 | + arr.gift_uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum; | ||
| 2449 | + arr.gift_limit_num = get_data.limit_num; | ||
| 2450 | + arr.gift_storecount = get_data.gift_storecount; | ||
| 2451 | + } | ||
| 2452 | + arr.s_libao = get_data.libao; | ||
| 2453 | + arr.s_lb_num = get_data.lb_num; | ||
| 2454 | + arr.prom_id = prom_id; | ||
| 2455 | + } | ||
| 2456 | + func(arr); | ||
| 2457 | + }) | ||
| 2458 | + }, | ||
| 2459 | + //--检查订单优惠-- | ||
| 2460 | + check_is_order_prom: function (condition, func, pick) { | ||
| 2461 | + var th = this; | ||
| 2462 | + pick = this.data.bn_pick; | ||
| 2463 | + //---获取订单优惠--- | ||
| 2464 | + getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", { | ||
| 2465 | + data: {store_id: os.stoid, orderAmount: condition} | ||
| 2466 | + }).then(res => { | ||
| 2467 | + if (res.data.code == 0) { | ||
| 2468 | + var data = res.data.data; | ||
| 2469 | + th.data.order_prom[pick] = data; | ||
| 2470 | + } | ||
| 2471 | + func(); | ||
| 2472 | + }) | ||
| 2473 | + }, | ||
| 2474 | + | ||
| 2475 | + //--- 加入优惠活动的映射中,同时要有一个good列表 --- | ||
| 2476 | + add_prom_goods_map: async function (item) { | ||
| 2477 | + var th = this; | ||
| 2478 | + var pickid = item.pick_id; | ||
| 2479 | + var map = th.data.prom_goods_map; | ||
| 2480 | + var obj = map[pickid]; | ||
| 2481 | + | ||
| 2482 | + if (map[pickid]) { | ||
| 2483 | + if (map[pickid][item.prom_id]) { | ||
| 2484 | + var ob = map[pickid][item.prom_id]; | ||
| 2485 | + ob.price += item.goods_price * item.goods_num; | ||
| 2486 | + ob.goods_num += item.goods_num; | ||
| 2487 | + ob.goods.push({goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num}); | ||
| 2488 | + | ||
| 2489 | + } else { | ||
| 2490 | + var prom = null; | ||
| 2491 | + await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + item.prom_id, {}).then(res => { | ||
| 2492 | + if (res.data.code == 0) { | ||
| 2493 | + prom = res.data.data; | ||
| 2494 | + } | ||
| 2495 | + }) | ||
| 2496 | + var ob = {}; | ||
| 2497 | + ob.prom_id = item.prom_id; | ||
| 2498 | + ob.price = item.goods_price * item.goods_num; | ||
| 2499 | + ob.goods_num = item.goods_num; | ||
| 2500 | + ob.is_bz = prom.is_bz; | ||
| 2501 | + ob.is_xz_yh = prom.is_xz_yh; | ||
| 2502 | + ob.goods = new Array(); | ||
| 2503 | + ob.goods.push({goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num}); | ||
| 2504 | + map[pickid][item.prom_id] = ob; | ||
| 2505 | + } | ||
| 2506 | + } else { | ||
| 2507 | + var ob = {}; | ||
| 2508 | + var prom = null; | ||
| 2509 | + await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + item.prom_id, {}).then(res => { | ||
| 2510 | + if (res.data.code == 0) { | ||
| 2511 | + prom = res.data.data; | ||
| 2512 | + } | ||
| 2513 | + }) | ||
| 2514 | + ob.prom_id = item.prom_id; | ||
| 2515 | + ob.price = item.goods_price * item.goods_num; | ||
| 2516 | + ob.goods_num = item.goods_num; | ||
| 2517 | + ob.is_bz = prom.is_bz; | ||
| 2518 | + ob.is_xz_yh = prom.is_xz_yh; | ||
| 2519 | + ob.goods = new Array(); | ||
| 2520 | + ob.goods.push({goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num}); | ||
| 2521 | + | ||
| 2522 | + var obj = {}; | ||
| 2523 | + obj[item.prom_id] = ob; | ||
| 2524 | + map[pickid] = obj; | ||
| 2525 | + | ||
| 2526 | + } | ||
| 2527 | + }, | ||
| 2528 | + | ||
| 2529 | + //计算立即购买赠品的物流费用 | ||
| 2530 | + 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) { | ||
| 2531 | + var good = this.data.buy_now_gift_goods; | ||
| 2532 | + var goods_weight = -1, goods_piece = -1; | ||
| 2533 | + var gift_shipping_price = 0; | ||
| 2534 | + var th = this; | ||
| 2535 | + switch (good['exp_sum_type']) { | ||
| 2536 | + case 1: | ||
| 2537 | + //统一运费 | ||
| 2538 | + gift_shipping_price += good['uniform_exp_sum']; | ||
| 2539 | + gift_shipping_price += o_shipping_price; | ||
| 2540 | + break; | ||
| 2541 | + case 2: | ||
| 2542 | + if (goods_weight < 0) goods_weight = 0; | ||
| 2543 | + //累积商品重量 每种商品的重量 * 数量 | ||
| 2544 | + goods_weight += good['weight'] * good['buynum']; | ||
| 2545 | + if (goods_weight1 > 0) { | ||
| 2546 | + goods_weight += goods_weight1; | ||
| 2547 | + } | ||
| 2548 | + break; | ||
| 2549 | + case 3: | ||
| 2550 | + if (goods_piece < 0) goods_piece = 0; | ||
| 2551 | + //累积商品数量 | ||
| 2552 | + goods_piece += good['buynum']; | ||
| 2553 | + if (goods_piece1) { | ||
| 2554 | + goods_piece += goods_piece1; | ||
| 2555 | + } | ||
| 2556 | + break; | ||
| 2557 | + } | ||
| 2558 | + | ||
| 2559 | + | ||
| 2560 | + //如果有设置不包邮区域的时候 | ||
| 2561 | + if (no_by_data && no_by_data.region_list) { | ||
| 2562 | + if (th.check_by_area(no_by_data.region_list)) { | ||
| 2563 | + gift_freight_free = 0; | ||
| 2564 | + th.data.is_no_by[th.data.bn_pick] = 1; | ||
| 2565 | + } | ||
| 2566 | + } | ||
| 2567 | + //如果有设置不包邮商品 | ||
| 2568 | + if (no_by_data && no_by_data.goods_list && gift_freight_free) { | ||
| 2569 | + if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { | ||
| 2570 | + gift_freight_free = 0; | ||
| 2571 | + //th.data.is_no_by[th.data.bn_pick]=1; | ||
| 2572 | + } | ||
| 2573 | + } | ||
| 2574 | + | ||
| 2575 | + var t_shipping_price = | ||
| 2576 | + this.calculatewuliu(code, gift_shipping_price, goods_weight, | ||
| 2577 | + goods_piece, user_addr, gift_freight_free, allpice, rs); | ||
| 2578 | + return t_shipping_price; | ||
| 2579 | + | ||
| 2580 | + }, | ||
| 2581 | + | ||
| 2582 | + //从优惠的映射中拿出商品从表的item | ||
| 2583 | + item_map_get_goods: function (goods_id, map) { | ||
| 2584 | + for (var i in map.goods) { | ||
| 2585 | + if (map.goods[i].goods_id == goods_id) return map.goods[i]; | ||
| 2586 | + } | ||
| 2587 | + }, | ||
| 2588 | + //从优惠的映射中拿出商品从表的item | ||
| 2589 | + arr_get_goods: function (goods_id, arr) { | ||
| 2590 | + for (var i in arr) { | ||
| 2591 | + if (arr[i].goods_id == goods_id) return arr[i]; | ||
| 2592 | + } | ||
| 2593 | + }, | ||
| 2594 | + | ||
| 2595 | + //检查是不是有其他门店的订单在选择了券 | ||
| 2596 | + check_other_use: function (iter, pkid) { | ||
| 2597 | + var using = this.data.using_quan; | ||
| 2598 | + var is_use = 0; | ||
| 2599 | + if (using) { | ||
| 2600 | + for (var i in using) { | ||
| 2601 | + if (i == pkid) continue; | ||
| 2602 | + if (iter.CashRepNo == using[i].coupon_no) { | ||
| 2603 | + is_use = 1; | ||
| 2604 | + break; | ||
| 2605 | + } | ||
| 2606 | + } | ||
| 2607 | + } | ||
| 2608 | + return is_use; | ||
| 2609 | + }, | ||
| 2610 | + //检查是不是有其他门店的订单在选择了包邮券 | ||
| 2611 | + check_other_use_by: function (iter, pkid) { | ||
| 2612 | + var using = this.data.using_quan; | ||
| 2613 | + var is_use = 0; | ||
| 2614 | + if (using) { | ||
| 2615 | + for (var i in using) { | ||
| 2616 | + if (i == pkid) continue; | ||
| 2617 | + if (iter.no == using[i].coupon_no) { | ||
| 2618 | + is_use = 1; | ||
| 2619 | + break; | ||
| 2620 | + } | ||
| 2621 | + } | ||
| 2622 | + } | ||
| 2623 | + return is_use; | ||
| 2624 | + }, | ||
| 2625 | + | ||
| 2626 | + //跳转到购买卡 | ||
| 2627 | + buycard: function () { | ||
| 2628 | + getApp().goto("/pages/user/plus/plus"); | ||
| 2629 | + getApp().globalData.plus_buy_back = 1; | ||
| 2630 | + }, | ||
| 2631 | + | ||
| 2632 | + //跳转关闭弹出框的显示 | ||
| 2633 | + close_offline: function () { | ||
| 2634 | + this.setData({is_offline_show: 0}); | ||
| 2635 | + }, | ||
| 2636 | + | ||
| 2637 | + //立即购买显示弹出框 | ||
| 2638 | + bn_pop_offline: function () { | ||
| 2639 | + var off_price = this.data.bn_goods.shop_price - this.data.bn_goods.offline_price; | ||
| 2640 | + //是不是线下 | ||
| 2641 | + var is_get_offline = this.data.bn_goods.is_offline; | ||
| 2642 | + this.setData({is_offline_show: 1, show_off_price: off_price.toFixed(2), is_get_offline: is_get_offline}); | ||
| 2643 | + }, | ||
| 2644 | + | ||
| 2645 | + //确定使用线下取价 | ||
| 2646 | + sure_offline: function () { | ||
| 2647 | + var bn_goods = this.data.bn_goods; | ||
| 2648 | + if (bn_goods && bn_goods.prom_type == 0) { | ||
| 2649 | + bn_goods.is_offline = 1; | ||
| 2650 | + this.setData({is_offline_show: 0, bn_goods: bn_goods}); | ||
| 2651 | + this.calculatePrice2(); | ||
| 2652 | + } | ||
| 2653 | + //就是购物车结算时的 | ||
| 2654 | + else { | ||
| 2655 | + var index = this.data.pop_offline_index; | ||
| 2656 | + var txt = "cartlist[" + index + "].is_offline"; | ||
| 2657 | + this.setData({[txt]: 1, is_offline_show: 0,}); | ||
| 2658 | + this.data.old_cartlist[index].is_offline = 1; | ||
| 2659 | + this.calculatePrice(); | ||
| 2660 | + } | ||
| 2661 | + }, | ||
| 2662 | + | ||
| 2663 | + | ||
| 2664 | + //取消使用线下取价 | ||
| 2665 | + cancle_offline: function () { | ||
| 2666 | + //判断是不是立即购买 | ||
| 2667 | + var bn_goods = this.data.bn_goods; | ||
| 2668 | + if (bn_goods && bn_goods.prom_type == 0) { | ||
| 2669 | + bn_goods.is_offline = 0; | ||
| 2670 | + this.setData({is_offline_show: 0, bn_goods: bn_goods}); | ||
| 2671 | + this.calculatePrice2(); | ||
| 2672 | + } | ||
| 2673 | + //就是购物车结算时的 | ||
| 2674 | + else { | ||
| 2675 | + var index = this.data.pop_offline_index; | ||
| 2676 | + var txt = "cartlist[" + index + "].is_offline"; | ||
| 2677 | + this.setData({[txt]: 0, is_offline_show: 0,}) | ||
| 2678 | + this.data.old_cartlist[index].is_offline = 0; | ||
| 2679 | + this.calculatePrice(); | ||
| 2680 | + } | ||
| 2681 | + }, | ||
| 2682 | + | ||
| 2683 | + //-- 弹出购物车选择是不是要店铺优惠 -- | ||
| 2684 | + cart_pop_offline: function (e) { | ||
| 2685 | + var index = e.currentTarget.dataset.index; | ||
| 2686 | + var item = this.data.cartlist[index]; | ||
| 2687 | + var off_price = item.offline_price; | ||
| 2688 | + //是不是线下 | ||
| 2689 | + var is_get_offline = item.is_offline; | ||
| 2690 | + this.setData({ | ||
| 2691 | + pop_offline_index: index, | ||
| 2692 | + is_offline_show: 1, | ||
| 2693 | + show_off_price: off_price.toFixed(2), | ||
| 2694 | + is_get_offline: is_get_offline | ||
| 2695 | + }); | ||
| 2696 | + }, | ||
| 2697 | + | ||
| 2698 | + set_hid_inp:function (e) { | ||
| 2699 | + var index = e.currentTarget.dataset.index; | ||
| 2700 | + var txt = "cartlist[" + index + "].focus"; | ||
| 2701 | + this.setData({[txt]:1}) | ||
| 2702 | + }, | ||
| 2703 | + | ||
| 2704 | + clear_hid_inp:function (e) { | ||
| 2705 | + var index = e.currentTarget.dataset.index; | ||
| 2706 | + var txt = "cartlist[" + index + "].focus"; | ||
| 2707 | + this.setData({[txt]:0}) | ||
| 2708 | + }, | ||
| 2709 | + | ||
| 2710 | + | ||
| 2711 | + | ||
| 2712 | +}); |
packageC/pages/presell/cart/cart2.json
0 → 100644
packageC/pages/presell/cart/cart2.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="tab-container"> | ||
| 10 | + <view class="tab-wrapper"> | ||
| 11 | + <view hidden="{{bn_t_exp_t==2}}" bindtap='setexptype' data-t='1' class="tab {{bn_exp_type == 1? 'active':''}}" | ||
| 12 | + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view> | ||
| 13 | + | ||
| 14 | + <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}" | ||
| 15 | + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view> | ||
| 16 | + | ||
| 17 | + </view> | ||
| 18 | + </view> | ||
| 19 | + | ||
| 20 | + <!--要进行判断地址是否显示----> | ||
| 21 | + <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{bn_exp_type==1 && is_b_now==1}}'> | ||
| 22 | + <!---默认地址显示------> | ||
| 23 | + <block wx:if="{{user_addr!=null}}"> | ||
| 24 | + <view class="user-contact"> | ||
| 25 | + <text class="bold fs36 pdr20">{{user_addr.consignee}}</text> | ||
| 26 | + <text class="fs28">{{user_addr.mobile}}</text> | ||
| 27 | + </view> | ||
| 28 | + <view class="location"> | ||
| 29 | + <view class="address fs26 pdt20"> | ||
| 30 | + <view class="pos-icon"> | ||
| 31 | + <image class="wh100 bdr14" src="{{imgUrl}}/miniapp/images/goodscategory/new_position.png"></image> | ||
| 32 | + </view> | ||
| 33 | + {{user_addr.more_address}}{{' '}}{{user_addr.address}} | ||
| 34 | + </view> | ||
| 35 | + | ||
| 36 | + </view> | ||
| 37 | + <view class="update-logistics"> | ||
| 38 | + <!-- <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/new_position.png"></image> --> | ||
| 39 | + <view class="xc-right"></view> | ||
| 40 | + </view> | ||
| 41 | + </block> | ||
| 42 | + <!---先增地址------> | ||
| 43 | + <block wx:else> | ||
| 44 | + <view class="add_new"> | ||
| 45 | + <image class="addr_jia" src="{{imgUrl}}/miniapp/images/jia.png"></image>添加地址 | ||
| 46 | + </view> | ||
| 47 | + </block> | ||
| 48 | + </view> | ||
| 49 | + | ||
| 50 | + <!-- ----立即购买------ --> | ||
| 51 | + | ||
| 52 | + <view class="use-item bfff bdr_t-14 mgt20"> | ||
| 53 | + <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image> | ||
| 54 | + <view>{{bn_pickname}}</view> | ||
| 55 | + <!-- <view>门店:{{bn_pickname}}</view> --> | ||
| 56 | + </view> | ||
| 57 | + <view class="order-detail"> | ||
| 58 | + <view class="goods-img"> | ||
| 59 | + <image class="wh100 bdr14" src="{{bn_goods.original_img}}" binderror='cart_set_err' data-err="bn_goods.original_img"></image> | ||
| 60 | + </view> | ||
| 61 | + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}"> | ||
| 62 | + <view class="goods-name ellipsis-2">{{bn_goods.goods_name}}</view> | ||
| 63 | + <!-- 商品属性 --> | ||
| 64 | + <view class="flex-vertical fs28 xc-ash color-gray n_guige"> | ||
| 65 | + <view class="goods-color"> | ||
| 66 | + <block><text>{{filters.show_gui_ge(bn_goods.goods_spec,bn_goods.goods_color)}}</text></block> | ||
| 67 | + </view> | ||
| 68 | + </view> | ||
| 69 | + | ||
| 70 | + <!-- ---商品名称规格---- --> | ||
| 71 | + <view class="order-num flex-space-between"> | ||
| 72 | + <view class="co-red">¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></view> | ||
| 73 | + <view class="goods-num">x{{bn_goods.buynum}}</view> | ||
| 74 | + </view> | ||
| 75 | + </navigator> | ||
| 76 | + | ||
| 77 | + </view> | ||
| 78 | + <!-- 赠品的显示 --> | ||
| 79 | + <view class="order-detail" wx:if="{{buy_now_gift_goods}}"> | ||
| 80 | + <view class="goods-img" style="position: relative"> | ||
| 81 | + <image src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image> | ||
| 82 | + | ||
| 83 | + <image class="wh100 bdr14" src="{{buy_now_gift_goods.original_img}}" binderror='cart_set_err' data-err="buy_now_gift_goods.original_img"></image> | ||
| 84 | + </view> | ||
| 85 | + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{buy_now_gift_goods.goods_id}}"> | ||
| 86 | + <view class="goods-name ellipsis-2">{{buy_now_gift_goods.goods_name}}</view> | ||
| 87 | + <!-- 商品属性 --> | ||
| 88 | + <view class="flex-vertical fs28 xc-ash color-gray n_guige"> | ||
| 89 | + <view class="goods-color"> | ||
| 90 | + <block><text>{{filters.show_gui_ge(buy_now_gift_goods.goods_spec,buy_now_gift_goods.goods_color)}}</text></block> | ||
| 91 | + </view> | ||
| 92 | + </view> | ||
| 93 | + <!-- ---商品名称规格---- --> | ||
| 94 | + <view class="order-num flex-space-between"> | ||
| 95 | + <view class="co-red">¥<text class="fs36">0</text></view> | ||
| 96 | + <view class="goods-num">x{{buy_now_gift_goods.buynum}}</view> | ||
| 97 | + </view> | ||
| 98 | + </navigator> | ||
| 99 | + </view> | ||
| 100 | + | ||
| 101 | + | ||
| 102 | + <block wx:if="{{collocation_goods}}"> | ||
| 103 | + <!-- 搭配购买的功能实现 --> | ||
| 104 | + <view class="order-detail" wx:for="{{collocation_goods}}"> | ||
| 105 | + <view class="goods-img"> | ||
| 106 | + <image class="wh100 bdr14" src="{{imgUrl+item.original_img}}" binderror='err_img_collocation' data-err="item.original_img"></image> | ||
| 107 | + </view> | ||
| 108 | + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | ||
| 109 | + <view class="goods-name ellipsis-2">{{item.goods_name}}</view> | ||
| 110 | + <!-- 商品属性 --> | ||
| 111 | + <view class="flex-vertical fs28 xc-ash color-gray n_guige"> | ||
| 112 | + <view class="goods-color"> | ||
| 113 | + <block><text>{{filters.show_gui_ge(item.goods_spec,item.goods_color)}}</text></block> | ||
| 114 | + </view> | ||
| 115 | + </view> | ||
| 116 | + <!-- ---商品名称规格---- --> | ||
| 117 | + <view class="order-num flex-space-between"> | ||
| 118 | + <view class="co-red">¥<text class="fs36">{{item.price}}</text></view> | ||
| 119 | + <view class="goods-num">x{{item.goods_num}}</view> | ||
| 120 | + </view> | ||
| 121 | + </navigator> | ||
| 122 | + </view> | ||
| 123 | + </block> | ||
| 124 | + | ||
| 125 | + <!-- 如果是等级卡的商品,会员没有注册,要提醒注册 --> | ||
| 126 | + <view class="plus_buy fs28" wx:if="{{card_cut_price>0}}"> | ||
| 127 | + <view class="flex"> | ||
| 128 | + <view class="card_bg ellipsis-1" style="margin-right: 10rpx;"> | ||
| 129 | + <image src="{{imgUrl}}/miniapp/images/plus/dj_icon.png"></ image> | ||
| 130 | + <text class="card_name">{{show_card.CardName}}</text> | ||
| 131 | + </view> | ||
| 132 | + <view>立减 <text style="color:#f23030;">{{filters.toFix(card_cut_price,2) }}</text> 元</view> | ||
| 133 | + </view> | ||
| 134 | + <view> | ||
| 135 | + <text style="color: #999;margin-left: 4rpx;">vip超级会员仅需{{show_card.CardFee}}元</text> | ||
| 136 | + </view> | ||
| 137 | + <!-- 三角形 --> | ||
| 138 | + <view class="car_tri_up"></view> | ||
| 139 | + <!-- 立即开通跳转 --> | ||
| 140 | + <view bindtap="buycard" class="card_op">立即开通</view> | ||
| 141 | + </view> | ||
| 142 | + | ||
| 143 | + | ||
| 144 | + <view class="set-mes bdr_b-14"> | ||
| 145 | + <view wx:if="{{order.store_prom}}"> | ||
| 146 | + <icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}} | ||
| 147 | + </view> | ||
| 148 | + | ||
| 149 | + <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}}"> | ||
| 150 | + <view class="work-frame flex-space-between"> | ||
| 151 | + <view class="work"> | ||
| 152 | + 优惠券 <text class="quan_num_show">{{(selected_quan_list?selected_quan_list.length:0)+ (get_by_quan_list?get_by_quan_list.length:0)}}张可用</text> | ||
| 153 | + </view> | ||
| 154 | + <view class="xc-right-frame"> | ||
| 155 | + <text wx:if="{{using_quan[bn_pick].is_nouse}}">不使用</text> | ||
| 156 | + <block wx:else> | ||
| 157 | + <text wx:if="{{using_quan[bn_pick].money}}">¥{{using_quan[bn_pick].money}}元优惠券</text> | ||
| 158 | + <text wx:if="{{using_quan[bn_pick].isby}}">包邮券</text> | ||
| 159 | + </block> | ||
| 160 | + <view class="xc-right"></view> | ||
| 161 | + </view> | ||
| 162 | + </view> | ||
| 163 | + </view> | ||
| 164 | + | ||
| 165 | + <view class="xc-coupon-frame" wx:if="{{bn_exp_type==0 && !is_default_logistics}}"> | ||
| 166 | + <view class="flex-space-between" style="padding: 20rpx 25rpx; font-size: 30rpx;"> | ||
| 167 | + <view>选择物流</view> | ||
| 168 | + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index' style="margin-right: 12rpx;"> | ||
| 169 | + <view class="logistics-name">{{wu_arr[index].name}}</view> | ||
| 170 | + <view class="xc-right"></view> | ||
| 171 | + </view> | ||
| 172 | + </view> | ||
| 173 | + </view> | ||
| 174 | + </view> | ||
| 175 | + <!-- 留言 --> | ||
| 176 | + <view class="coupon-mes flex-vertical"> | ||
| 177 | + <view>留言</view> | ||
| 178 | + <view class="leave-word"> | ||
| 179 | + <input placeholder-class="fs28" placeholder='给商家留言,最多100字' bindinput="keyUpChangeNum" disabled="{{disabled}}" | ||
| 180 | + class="word-box" maxlength="100" name="user_note"></input> | ||
| 181 | + </view> | ||
| 182 | + </view> | ||
| 183 | + | ||
| 184 | + <!-- 是否参与店铺优惠 --> | ||
| 185 | + <view class="coupon-mes flex-vertical" bindtap="bn_pop_offline" wx:if="{{bn_goods.offline_price}}"> | ||
| 186 | + <view>店铺优惠</view> | ||
| 187 | + <view class="leave-word fs32" style="color: #999;"> | ||
| 188 | + 省{{filters.toFix(bn_goods.shop_price-bn_goods.offline_price,2)}}元 | ||
| 189 | + </view> | ||
| 190 | + <block wx:if="{{bn_goods.is_offline}}"> | ||
| 191 | + <text style="color: #d7642b;">-¥{{filters.toFix(bn_goods.shop_price-bn_goods.offline_price,2)}}</text> | ||
| 192 | + </block> | ||
| 193 | + <block wx:else> | ||
| 194 | + <text style="color: #d7642b;">不使用优惠</text> | ||
| 195 | + </block> | ||
| 196 | + <!-- 右边点击 --> | ||
| 197 | + <view class="xc-right" style="margin-right: 12rpx; border-color: #d7642b;"></view> | ||
| 198 | + </view> | ||
| 199 | + <!-----使用余额------> | ||
| 200 | + <view class="set-mes bdr_t-14" wx:if="{{yuer>0}}"> | ||
| 201 | + <view class="use-item" bindtap='set_bn_useyuer'> | ||
| 202 | + <icon color="{{bn_use_money?'red':'gray'}}" size="16" type="success"></icon> | ||
| 203 | + <view class="yu_er">使用余额 :¥{{yuer}} </view> | ||
| 204 | + </view> | ||
| 205 | + </view> | ||
| 206 | + | ||
| 207 | + | ||
| 208 | + <view class="information bdr14"> | ||
| 209 | + <view class="item" wx:if="{{formData.all_price>0}}"> | ||
| 210 | + <view>商品金额</view> | ||
| 211 | + <view class="co-red">¥ {{formData.all_price}}元</view> | ||
| 212 | + </view> | ||
| 213 | + <view class="item" wx:if="{{formData.shipping_price>0}}"> | ||
| 214 | + <view>配送费用</view> | ||
| 215 | + <view class="co-red">¥ {{formData.shipping_price}}元</view> | ||
| 216 | + </view> | ||
| 217 | + <view class="item" wx:if="{{formData.coupon_price>0}}"> | ||
| 218 | + <view>使用优惠券</view> | ||
| 219 | + <view class="co-red">- ¥ {{formData.coupon_price}}元</view> | ||
| 220 | + </view> | ||
| 221 | + <!-- 优惠活动优惠金额 --> | ||
| 222 | + <view class="item" wx:if="{{formData.cut_price>0}}"> | ||
| 223 | + <view>优惠活动</view> | ||
| 224 | + <view class="co-red">- ¥ {{filters.toFix(formData.cut_price,2)}}元</view> | ||
| 225 | + </view> | ||
| 226 | + <!-- 订单优惠优惠金额 --> | ||
| 227 | + <view class="item" wx:if="{{formData.order_prom_amount>0}}"> | ||
| 228 | + <view>订单优惠</view> | ||
| 229 | + <view class="co-red">- ¥ {{filters.toFix(formData.order_prom_amount,2)}}元</view> | ||
| 230 | + </view> | ||
| 231 | + <view class="item" wx:if="{{formData.user_money>0}}"> | ||
| 232 | + <view>使用余额</view> | ||
| 233 | + <view class="co-red">- ¥ {{formData.user_money}}元</view> | ||
| 234 | + </view> | ||
| 235 | + </view> | ||
| 236 | + </view> | ||
| 237 | + | ||
| 238 | + <view class="btn-wrap shadow-1" wx:if="{{show_submit}}"> | ||
| 239 | + <view class="pay-amount"> | ||
| 240 | + <view class="payable">应付金额:<text class="co-red"><text class="fs24">¥</text>{{formData.order_amount}}</text></view> | ||
| 241 | + </view> | ||
| 242 | + <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button> | ||
| 243 | + </view> | ||
| 244 | +</form> | ||
| 245 | + | ||
| 246 | +<!-- 使用券列表的弹窗 --> | ||
| 247 | +<view wx:if='{{open_quan==1}}'> | ||
| 248 | + <view class="cover-layer flex-center " bindtap='close_coupon'> </view> | ||
| 249 | + <view class="cx-popup {{open_quan==true?'up' : 'down'}}"> | ||
| 250 | + <!-- 最上面 --> | ||
| 251 | + <view class="top flex"> | ||
| 252 | + <view class="xc-top-content t-c"> | ||
| 253 | + <view class="xc-title">优惠券使用</view> | ||
| 254 | + </view> | ||
| 255 | + <view class="xc-close-frame" bindtap='close_coupon'> | ||
| 256 | + <view class="xc-close">×</view> | ||
| 257 | + </view> | ||
| 258 | + </view> | ||
| 259 | + <!-- 使用优惠券和不使用优惠券层--> | ||
| 260 | + <view class="may_use_coupon fs28 flex"> 可使用的优惠券 | ||
| 261 | + <view class=" is_use_coupon flex-vertical" bindtap="sele_quan_item" data-no="1">不使用优惠券 | ||
| 262 | + <block wx:if="{{using_quan[selected_quan_pick].is_nouse_red}}"> | ||
| 263 | + <view class="circle white xc-hooka fs20 red-b sn"><text>Γ</text></view> | ||
| 264 | + </block> | ||
| 265 | + <block wx:else> | ||
| 266 | + <view class="circle xc-hookst ons"></view> | ||
| 267 | + </block> | ||
| 268 | + </view> | ||
| 269 | + </view> | ||
| 270 | + | ||
| 271 | + <!-- 中间券内容显示 --> | ||
| 272 | + <view class="xc-frame flex-level"> | ||
| 273 | + <view class="list-frame"> | ||
| 274 | + <view wx:for="{{selected_quan_list}}" bindtap="sele_quan_item" wx:if="{{!item.is_using}}" data-ind="{{q_index}}" | ||
| 275 | + wx:for-item="item" wx:for-index="q_index"> | ||
| 276 | + <view class="xc-coupon-frame flex-center" data-ind="{{q_index}}"> | ||
| 277 | + <view class="coupon-frame flex rel"> | ||
| 278 | + <!-- 锯齿 --> | ||
| 279 | + <include src="juchi_part.wxml" /> | ||
| 280 | + <!-- 左边 --> | ||
| 281 | + <view class="coupon-left rel {{filter.setcolor(item.UseObjectType)}} flex-center"> | ||
| 282 | + <view class="white xc-money-frames"> | ||
| 283 | + <view class="f_text"><text class="xc-rmb-symbol">¥</text><text class="xc-rmb-val">{{item.Sum}}</text></view> | ||
| 284 | + <view class="coupon-explain t-c" wx:if="{{item.BuySum>0}}">满{{item.BuySum}}元可用</view> | ||
| 285 | + <view class="coupon-explain t-c" wx:else>满0元可用</view> | ||
| 286 | + </view> | ||
| 287 | + </view> | ||
| 288 | + <!-- 右边 --> | ||
| 289 | + <view class="coupon-right flex-center rel"> | ||
| 290 | + <view class="coupon-annotation flex"> | ||
| 291 | + <view class="flex top-frame"> | ||
| 292 | + <view class="frame"> | ||
| 293 | + <view class="coupon-wode ib flex ellipsis-2 "> | ||
| 294 | + <text class="xc-brand t-c ib white {{filter.setcolor(item.UseObjectType)}}">{{filter.get_type_card(item.UseObjectType)}}</text> | ||
| 295 | + <block>{{item.Sum}}元优惠券</block> | ||
| 296 | + </view> | ||
| 297 | + <view class="coupon-time">{{filters.replace_time2(item.BeginDate)}}至{{item.ValidDate?filters.replace_time2(item.ValidDate):'不限'}}</view> | ||
| 298 | + </view> | ||
| 299 | + </view> | ||
| 300 | + <block wx:if="{{item.show_red}}"> | ||
| 301 | + <view class="circle white xc-hook fs20 red-b sn"><text>Γ</text></view> | ||
| 302 | + </block> | ||
| 303 | + <block wx:else> | ||
| 304 | + <view class="circle xc-hooks on"></view> | ||
| 305 | + </block> | ||
| 306 | + </view> | ||
| 307 | + <include src="remark_click_part.wxml" /> | ||
| 308 | + </view> | ||
| 309 | + </view> | ||
| 310 | + </view> | ||
| 311 | + <!-- 打开是说明 --> | ||
| 312 | + <include src="remark_part.wxml" /> | ||
| 313 | + </view> | ||
| 314 | + <!-- 包邮券的显示,立即购买 --> | ||
| 315 | + <block wx:if="{{bn_exp_type==0}}"> | ||
| 316 | + <view wx:for="{{get_by_quan_list}}" bindtap="sele_quan_item_by" wx:if="{{!item.is_using}}" data-ind="{{byq_index}}" | ||
| 317 | + wx:for-item="item" wx:for-index="byq_index"> | ||
| 318 | + <view class="xc-coupon-frame flex-center" data-ind="{{byq_index}}"> | ||
| 319 | + <view class="coupon-frame flex rel"> | ||
| 320 | + <!-- 锯齿 --> | ||
| 321 | + <include src="juchi_part.wxml" /> | ||
| 322 | + <!-- 左边 --> | ||
| 323 | + <view class="coupon-left rel {{filter.setcolor(item.UseObjectType)}} flex-center"> | ||
| 324 | + <view class="white xc-money-frames"> | ||
| 325 | + <view class="f_text"><text class="xc-rmb-val">包邮券</text></view> | ||
| 326 | + <view class="coupon-explain t-c" wx:if="{{item.condition>0}}">满{{item.condition}}元可用</view> | ||
| 327 | + <view class="coupon-explain t-c" wx:else>满0元可用</view> | ||
| 328 | + </view> | ||
| 329 | + </view> | ||
| 330 | + <!-- 右边 --> | ||
| 331 | + <view class="coupon-right flex-center rel"> | ||
| 332 | + <view class="coupon-annotation flex"> | ||
| 333 | + <view class="flex top-frame"> | ||
| 334 | + <view class="frame"> | ||
| 335 | + <view class="coupon-wode ib flex ellipsis-2 "> | ||
| 336 | + <text class="xc-brand t-c ib white {{filter.setcolor(item.UseObjectType)}}">{{filter.get_type_card(0)}}</text> | ||
| 337 | + <block>包邮券</block> | ||
| 338 | + </view> | ||
| 339 | + <view class="coupon-time">{{filters.format_time(item.use_start_time)}}至{{item.use_end_time?filters.format_time(item.use_end_time):'不限'}}</view> | ||
| 340 | + </view> | ||
| 341 | + </view> | ||
| 342 | + <block wx:if="{{item.show_red}}"> | ||
| 343 | + <view class="circle white xc-hook fs20 red-b sn"><text>Γ</text></view> | ||
| 344 | + </block> | ||
| 345 | + <block wx:else> | ||
| 346 | + <view class="circle xc-hooks on"></view> | ||
| 347 | + </block> | ||
| 348 | + </view> | ||
| 349 | + <include src="remark_click_part2.wxml" /> | ||
| 350 | + </view> | ||
| 351 | + </view> | ||
| 352 | + </view> | ||
| 353 | + <!-- 打开是说明 --> | ||
| 354 | + <include src="remark_part.wxml" /> | ||
| 355 | + </view> | ||
| 356 | + </block> | ||
| 357 | + | ||
| 358 | + | ||
| 359 | + | ||
| 360 | + | ||
| 361 | + </view> | ||
| 362 | + </view> | ||
| 363 | + <!-- 最底下确定层--> | ||
| 364 | + <view class="determine-frame"> | ||
| 365 | + <view class="xc-confirm flex-center" bindtap="confirm_quan"> 确定 </view> | ||
| 366 | + </view> | ||
| 367 | + </view> | ||
| 368 | +</view> | ||
| 369 | +<!----弹起选择物流名的列表----> | ||
| 370 | +<view wx:if='{{open_express==1}}'> | ||
| 371 | + <view class="cover-layer flex-center " bindtap='close_express'> | ||
| 372 | + </view> | ||
| 373 | + | ||
| 374 | + <view class="cx-popup radius {{open_express==1?'up' : 'down'}}"> | ||
| 375 | + <view class="tops flex"> | ||
| 376 | + <view class="top-content fs32"> | ||
| 377 | + <view>选择物流名字</view> | ||
| 378 | + </view> | ||
| 379 | + <view class="close-frame" bindtap='close_express'> | ||
| 380 | + <view class="xc-close-express">×</view> | ||
| 381 | + </view> | ||
| 382 | + </view> | ||
| 383 | + <view class="express_list"> | ||
| 384 | + <view wx:for="{{wu_arr}}" wx:for-item="express_list" wx:for-index="idx"> | ||
| 385 | + <view class="express_list_frame" bindtap="click_express_name" data-shippingcode="{{express_list.shipping_code}}" | ||
| 386 | + data-name="{{express_list.name}}" data-idxe="{{idx}}"> | ||
| 387 | + | ||
| 388 | + <block wx:if="{{is_express==idx}}"> | ||
| 389 | + <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view> | ||
| 390 | + </block> | ||
| 391 | + <block wx:else> | ||
| 392 | + <view class="circle xc-hooks"></view> | ||
| 393 | + </block> | ||
| 394 | + <view class="fs30">{{express_list.name}}</view> | ||
| 395 | + | ||
| 396 | + </view> | ||
| 397 | + </view> | ||
| 398 | + </view> | ||
| 399 | + <view class="flex click-buttem"> | ||
| 400 | + <view class="xc-determine flex-center" bindtap="determine_expres"> | ||
| 401 | + <view class="flex-vertical t-c">确定</view> | ||
| 402 | + </view> | ||
| 403 | + <view class="xc-confirms flex-center" bindtap="select_default_logistics"> | ||
| 404 | + <view class="flex-vertical t-c">设为默认</view> | ||
| 405 | + </view> | ||
| 406 | + </view> | ||
| 407 | + | ||
| 408 | + </view> | ||
| 409 | +</view> | ||
| 410 | +<warn id="warn"></warn> | ||
| 411 | +<!-- 是不是使用店铺优惠pop --> | ||
| 412 | +<view class="cover-layer flex ai-center" bindtap="close_offline" wx:if="{{is_offline_show}}"> | ||
| 413 | + <view style="background-color: #fff; width: 540rpx; margin: 0 auto; border-radius: 20rpx;"> | ||
| 414 | + <view class="fs32" style="text-align: center;height: 80rpx; line-height: 80rpx;">店铺优惠</view> | ||
| 415 | + <view class="flex jc_sb ai-center fs28" style="height: 80rpx; width: 400rpx; margin-left: 70rpx;"> | ||
| 416 | + <view catchtap="sure_offline" class="flex ai-center" >优惠¥{{show_off_price}} | ||
| 417 | + <icon style="margin-left: 10rpx;" color="{{is_get_offline?'red':'gray'}}" size="14" type="success" role="img"></icon></view> | ||
| 418 | + <view catchtap="cancle_offline" class="flex ai-center" >不用优惠 | ||
| 419 | + <icon style="margin-left: 10rpx;" color="{{is_get_offline!=1?'red':'gray'}}" size="14" type="success" role="img"></icon> </view> | ||
| 420 | + </view> | ||
| 421 | + </view> | ||
| 422 | +</view> |
packageC/pages/presell/cart/cart2.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: 120rpx; | ||
| 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 | + display: flex; | ||
| 253 | + align-items: center; | ||
| 254 | + height: 50rpx; | ||
| 255 | + width: 500rpx; | ||
| 256 | +} | ||
| 257 | + | ||
| 258 | +.word-box { | ||
| 259 | + font-size: 26rpx; | ||
| 260 | + /* width: 600rpx; */ | ||
| 261 | + /* padding: 10rpx; | ||
| 262 | + height: 28rpx; | ||
| 263 | + line-height: 40rpx; */ | ||
| 264 | +} | ||
| 265 | + | ||
| 266 | +.max-word { | ||
| 267 | + position: absolute; | ||
| 268 | + right: 0; | ||
| 269 | + bottom: 0; | ||
| 270 | +} | ||
| 271 | + | ||
| 272 | +.information { | ||
| 273 | + /* padding: 20rpx; */ | ||
| 274 | + background-color: #fff; | ||
| 275 | + /* margin-bottom: 120rpx; */ | ||
| 276 | +} | ||
| 277 | + | ||
| 278 | +.information .item { | ||
| 279 | + display: flex; | ||
| 280 | + justify-content: space-between; | ||
| 281 | + /* height: 60rpx; | ||
| 282 | + line-height: 60rpx; */ | ||
| 283 | + font-size: 24rpx; | ||
| 284 | + /* color: #333; */ | ||
| 285 | + padding: 20rpx; | ||
| 286 | +} | ||
| 287 | + | ||
| 288 | +.btn-wrap { | ||
| 289 | + height: 94rpx; | ||
| 290 | + box-sizing: border-box; | ||
| 291 | + display: flex; | ||
| 292 | + justify-content: space-between; | ||
| 293 | + background-color: white; | ||
| 294 | + align-items: center; | ||
| 295 | + position: fixed; | ||
| 296 | + bottom: 0; | ||
| 297 | + left: 0; | ||
| 298 | + width: 100%; | ||
| 299 | + padding: 0 30rpx; | ||
| 300 | +} | ||
| 301 | + | ||
| 302 | +.tips-btn { | ||
| 303 | + /* float: right; | ||
| 304 | + width: 200rpx; | ||
| 305 | + height: 100rpx; | ||
| 306 | + line-height: 100rpx; | ||
| 307 | + text-align: center; | ||
| 308 | + font-size: 30rpx; | ||
| 309 | + color: #fff; | ||
| 310 | + background-color: #f23030; */ | ||
| 311 | + color: white; | ||
| 312 | + background-color: #FE4445; | ||
| 313 | + height: 72rpx; | ||
| 314 | + line-height: 72rpx; | ||
| 315 | + padding: 0 42rpx; | ||
| 316 | + border-radius: 36rpx; | ||
| 317 | + margin-left: 0; | ||
| 318 | + margin-right: 0; | ||
| 319 | +} | ||
| 320 | + | ||
| 321 | +.pay-amount { | ||
| 322 | + /* float: right; | ||
| 323 | + display: flex; | ||
| 324 | + align-items: center; | ||
| 325 | + height: 100rpx; | ||
| 326 | + font-size: 26rpx; | ||
| 327 | + margin-right: 40rpx; */ | ||
| 328 | +} | ||
| 329 | + | ||
| 330 | +.payable { | ||
| 331 | + color: #444; | ||
| 332 | + /* margin-right: 20rpx; */ | ||
| 333 | +} | ||
| 334 | + | ||
| 335 | +.shipping-modal { | ||
| 336 | + z-index: 20; | ||
| 337 | + position: fixed; | ||
| 338 | + bottom: 0; | ||
| 339 | + left: 0; | ||
| 340 | + right: 0; | ||
| 341 | + overflow-y: hidden; | ||
| 342 | + color: #666666; | ||
| 343 | + background-color: white; | ||
| 344 | +} | ||
| 345 | + | ||
| 346 | +.shipping-nav { | ||
| 347 | + text-align: center; | ||
| 348 | + font-size: 35rpx; | ||
| 349 | + padding-top: 30rpx; | ||
| 350 | +} | ||
| 351 | + | ||
| 352 | +.shipping-list { | ||
| 353 | + padding: 20rpx 30rpx 40rpx; | ||
| 354 | + font-size: 28rpx; | ||
| 355 | +} | ||
| 356 | + | ||
| 357 | +.shipping-item { | ||
| 358 | + display: block; | ||
| 359 | + padding: 20rpx 0; | ||
| 360 | +} | ||
| 361 | + | ||
| 362 | +.shipping-btn { | ||
| 363 | + width: 100%; | ||
| 364 | + color: white; | ||
| 365 | + background-color: #f23030; | ||
| 366 | + line-height: 90rpx; | ||
| 367 | + text-align: center; | ||
| 368 | + font-size: 40rpx; | ||
| 369 | +} | ||
| 370 | + | ||
| 371 | +/*----------nyf新增,地址---------*/ | ||
| 372 | +.add_new{ | ||
| 373 | + height: 90rpx; | ||
| 374 | + display: flex; | ||
| 375 | + align-items: center; | ||
| 376 | + padding: 0 26rpx; | ||
| 377 | +} | ||
| 378 | +.addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd; | ||
| 379 | + margin-right: 15rpx;vertical-align: middle;} | ||
| 380 | +.yu_er{ | ||
| 381 | + margin-left: 10rpx; | ||
| 382 | + /* margin-right: 60rpx; */ | ||
| 383 | +} | ||
| 384 | +.wuliu{margin-left: 20rpx;} | ||
| 385 | + | ||
| 386 | + | ||
| 387 | +/*---- 优惠券列表 -----*/ | ||
| 388 | +.xc-coupon-frame{ | ||
| 389 | + width: 100%; | ||
| 390 | + height: 92rpx; | ||
| 391 | + | ||
| 392 | +} | ||
| 393 | +.xc-coupon-frame .work-frame{ | ||
| 394 | + width: 100%; | ||
| 395 | + height: 100%; | ||
| 396 | + border-bottom:3rpx solid #eee; | ||
| 397 | + padding: 0 26rpx; | ||
| 398 | + background-color: white; | ||
| 399 | +} | ||
| 400 | +.xc-right{ | ||
| 401 | + width:12rpx; | ||
| 402 | + height:12rpx; | ||
| 403 | + border-top:2rpx solid #000; | ||
| 404 | + border-right:2rpx solid #000; | ||
| 405 | + transform:rotate(45deg); | ||
| 406 | + display:inline-block; | ||
| 407 | + margin-left: 10rpx; | ||
| 408 | +} | ||
| 409 | + | ||
| 410 | +.xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; } | ||
| 411 | +.xc-right-frame{font-size: 30rpx;line-height: 92rpx; margin-right: 10rpx } | ||
| 412 | + | ||
| 413 | +/* 自定义弹出窗口 */ | ||
| 414 | +.cx-popup{ | ||
| 415 | + width:100%; | ||
| 416 | + height:880rpx; | ||
| 417 | + background: #fff; | ||
| 418 | + z-index: 35; | ||
| 419 | + border-top-left-radius: 20rpx; | ||
| 420 | + border-top-right-radius: 20rpx; | ||
| 421 | + position:fixed; | ||
| 422 | + bottom:0; | ||
| 423 | + left: 0; | ||
| 424 | + /* padding-bottom: 25rpx; */ | ||
| 425 | +} | ||
| 426 | + | ||
| 427 | +.cx-popup .top{ | ||
| 428 | + width:95%; | ||
| 429 | + height:100rpx; | ||
| 430 | + border-bottom:3rpx solid #ddd; | ||
| 431 | + margin: auto; | ||
| 432 | + margin-top: 30rpx; | ||
| 433 | + | ||
| 434 | +} | ||
| 435 | +.xc-top-content{ | ||
| 436 | + width: 93%; | ||
| 437 | + height:85rpx; | ||
| 438 | + padding-top: 30rpx; | ||
| 439 | + font-size: 34rpx; | ||
| 440 | + font-weight: 600; | ||
| 441 | + | ||
| 442 | +} | ||
| 443 | + | ||
| 444 | + | ||
| 445 | +.xc-valid-coupon{ | ||
| 446 | + width: 90%; | ||
| 447 | + height:40rpx; | ||
| 448 | + padding-top: 24rpx; | ||
| 449 | + overflow: hidden; | ||
| 450 | +} | ||
| 451 | +.xc-frame{ | ||
| 452 | + width: 100%; | ||
| 453 | + height:60%; | ||
| 454 | +} | ||
| 455 | + | ||
| 456 | +.xc-frame .list-frame{ | ||
| 457 | + width: 95%; | ||
| 458 | + height: 100%; | ||
| 459 | + overflow-y:scroll; | ||
| 460 | + | ||
| 461 | +} | ||
| 462 | +.xc-close-frame{ | ||
| 463 | + margin-top:-10rpx; | ||
| 464 | + | ||
| 465 | +} | ||
| 466 | + | ||
| 467 | +.xc-close{ | ||
| 468 | + width: 37rpx; | ||
| 469 | +height: 37rpx; | ||
| 470 | +border-radius: 50%; | ||
| 471 | +border: 3rpx solid #333; | ||
| 472 | +text-align: center; | ||
| 473 | +line-height: 34rpx; | ||
| 474 | +font-size: 29rpx; | ||
| 475 | +color: #333; | ||
| 476 | + | ||
| 477 | +} | ||
| 478 | +.xc-money{ | ||
| 479 | + color: #af2346; | ||
| 480 | + font-size: 35rpx; | ||
| 481 | +} | ||
| 482 | + | ||
| 483 | +.xc-money-frame{ | ||
| 484 | + margin-left:35rpx; | ||
| 485 | + | ||
| 486 | +} | ||
| 487 | +.xc-coupon-effect{ | ||
| 488 | + width: 99%; | ||
| 489 | + min-height: 100rpx; | ||
| 490 | + border-bottom:3rpx solid #ddd; | ||
| 491 | + | ||
| 492 | + | ||
| 493 | +} | ||
| 494 | +.xc-goods-coupon{ | ||
| 495 | + width: 85%; | ||
| 496 | + height:100%; | ||
| 497 | + | ||
| 498 | +} | ||
| 499 | +.xc-title{ | ||
| 500 | + width:50%; | ||
| 501 | + margin-left:222rpx; | ||
| 502 | + | ||
| 503 | +} | ||
| 504 | +.xc-coupon-money0{ | ||
| 505 | + color: #c91e31; | ||
| 506 | + font-size: 35rpx; | ||
| 507 | + line-height: 40rpx; | ||
| 508 | + | ||
| 509 | +} | ||
| 510 | +.xc-coupon-money{ | ||
| 511 | + color: #c91e31; | ||
| 512 | + font-size: 35rpx; | ||
| 513 | + line-height: 40rpx; | ||
| 514 | + padding-top: 10px; | ||
| 515 | + | ||
| 516 | +} | ||
| 517 | +.xc-coupon-money1{ | ||
| 518 | + color: #444; | ||
| 519 | + font-size: 28rpx; | ||
| 520 | + line-height: 60rpx; | ||
| 521 | + | ||
| 522 | + | ||
| 523 | +} | ||
| 524 | +.xc-coupon-time{ | ||
| 525 | + height: 50rpx; | ||
| 526 | + font-size: 27rpx; | ||
| 527 | + color: #a4a4a4; | ||
| 528 | +} | ||
| 529 | +.xc-coupon-time .time{ | ||
| 530 | + margin-left: 15rpx; | ||
| 531 | + font-size: 27rpx; | ||
| 532 | +} | ||
| 533 | +.xc-coupon-selection{ | ||
| 534 | + height:100%; | ||
| 535 | +} | ||
| 536 | + | ||
| 537 | +.xc-confirm { | ||
| 538 | + width: 50%; | ||
| 539 | + border-radius: 50rpx; | ||
| 540 | + height: 80rpx; | ||
| 541 | + margin:0 auto; | ||
| 542 | + background:#d60021; | ||
| 543 | + color:#fff; | ||
| 544 | + font-size:28rpx; | ||
| 545 | + margin-top: 28rpx; | ||
| 546 | +} | ||
| 547 | + | ||
| 548 | +.up{ animation: up .7s; } | ||
| 549 | +.down{ animation: down 1s; } | ||
| 550 | +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } } | ||
| 551 | +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } } | ||
| 552 | + | ||
| 553 | +.xc-not-Selection{ | ||
| 554 | + width: 40rpx; | ||
| 555 | +height: 40rpx; | ||
| 556 | + background: #eeeeee; | ||
| 557 | +} | ||
| 558 | + | ||
| 559 | + | ||
| 560 | +.xc-close-express{ | ||
| 561 | + width: 40rpx; | ||
| 562 | +height: 40rpx; | ||
| 563 | +border-radius: 50%; | ||
| 564 | +border: 3rpx solid #333; | ||
| 565 | +text-align: center; | ||
| 566 | +font-size:32rpx; | ||
| 567 | +line-height: 38rpx; | ||
| 568 | +color: #333; | ||
| 569 | +margin-top: 5rpx; | ||
| 570 | +} | ||
| 571 | +.cx-popup .tops{ | ||
| 572 | + width: 100%; | ||
| 573 | +height: 145rpx; | ||
| 574 | +border-bottom: 3rpx solid #eee; | ||
| 575 | + | ||
| 576 | +} | ||
| 577 | +.top-content { | ||
| 578 | + width: 82%; | ||
| 579 | +padding-top: 33px; | ||
| 580 | +height: 100%; | ||
| 581 | +padding-left: 40rpx; | ||
| 582 | +} | ||
| 583 | +.close-frame{ | ||
| 584 | + margin-top: 30rpx; | ||
| 585 | + | ||
| 586 | +} | ||
| 587 | + | ||
| 588 | +.xc-hook { | ||
| 589 | +width: 33rpx; | ||
| 590 | +height: 33rpx; | ||
| 591 | +transform: rotate(-135deg); | ||
| 592 | +line-height: 35rpx; | ||
| 593 | +text-align: center; | ||
| 594 | +margin-right: 20rpx | ||
| 595 | + | ||
| 596 | + | ||
| 597 | +} | ||
| 598 | +.xc-hooks { | ||
| 599 | +width: 30rpx; | ||
| 600 | +height: 30rpx; | ||
| 601 | +border: 1rpx solid #999; | ||
| 602 | +margin-right: 20rpx; | ||
| 603 | +} | ||
| 604 | +.express_list_frame{ | ||
| 605 | + display: flex; | ||
| 606 | +height: 80rpx; | ||
| 607 | +align-items: center; | ||
| 608 | +padding-left: 40rpx; | ||
| 609 | +border-bottom: 1rpx solid #eee; | ||
| 610 | + | ||
| 611 | +} | ||
| 612 | +.express_list{ | ||
| 613 | + width: 100%; | ||
| 614 | + height: 65%; | ||
| 615 | + overflow-y: auto; | ||
| 616 | + margin-bottom: 40rpx; | ||
| 617 | + | ||
| 618 | +} | ||
| 619 | +.xc-confirms { | ||
| 620 | + box-sizing: border-box; | ||
| 621 | + width: 40%; | ||
| 622 | + border-radius: 50rpx; | ||
| 623 | + height: 80rpx; | ||
| 624 | + margin:0 auto; | ||
| 625 | + font-size:28rpx; | ||
| 626 | + background: #fff; | ||
| 627 | + color: #333; | ||
| 628 | + border: 2rpx solid #333; | ||
| 629 | +} | ||
| 630 | + | ||
| 631 | + | ||
| 632 | +/* 优惠券的改版样式 */ | ||
| 633 | +.xc-coupon-frame{ | ||
| 634 | + /* width: 710rpx; */ | ||
| 635 | + width: 100%; | ||
| 636 | + height:auto; | ||
| 637 | + margin: 0 auto; | ||
| 638 | + | ||
| 639 | +} | ||
| 640 | +.xc-coupon-frame .coupon-frame{ | ||
| 641 | + width: 100%; | ||
| 642 | + height: 200rpx; | ||
| 643 | + margin-top:10rpx; | ||
| 644 | + border-bottom: 1rpx solid #eee; | ||
| 645 | + | ||
| 646 | +} | ||
| 647 | +.xc-coupon-frame .coupon-frame .coupon-left{ | ||
| 648 | + width: 215rpx; | ||
| 649 | + height:100%; | ||
| 650 | + overflow: hidden; | ||
| 651 | +} | ||
| 652 | +.xc-money-frames{ | ||
| 653 | + width:96%; | ||
| 654 | + margin-top: -10px; | ||
| 655 | +} | ||
| 656 | + | ||
| 657 | +.xc-rmb-symbol{ | ||
| 658 | + font-size:40rpx; | ||
| 659 | + | ||
| 660 | +} | ||
| 661 | + | ||
| 662 | +.xc-rmb-val{ | ||
| 663 | + font-size:60rpx; | ||
| 664 | + | ||
| 665 | +} | ||
| 666 | +.coupon-explain{ | ||
| 667 | + font-size:25rpx; | ||
| 668 | +width:100%; | ||
| 669 | + | ||
| 670 | + | ||
| 671 | +} | ||
| 672 | +.xc-valuer{ | ||
| 673 | + margin-top:39rpx; | ||
| 674 | + margin-left:28rpx; | ||
| 675 | + font-size:25rpx; | ||
| 676 | +} | ||
| 677 | +.coupon-frame .oval{ | ||
| 678 | + width:155rpx; | ||
| 679 | + height:83rpx; | ||
| 680 | + border-radius: 50%; | ||
| 681 | + right:-78rpx; | ||
| 682 | + top:-37rpx; | ||
| 683 | +} | ||
| 684 | +.coupon-right{ | ||
| 685 | + /* width:490rpx; */ | ||
| 686 | + height: 99%; | ||
| 687 | + border-top: 1rpx solid #eaeaea; | ||
| 688 | + /* //border-bottom: 1rpx solid #eaeaea; */ | ||
| 689 | + border-right: 1rpx solid #eaeaea; | ||
| 690 | + flex-grow: 1; | ||
| 691 | +} | ||
| 692 | +.coupon-annotation{ | ||
| 693 | + width: 95%; | ||
| 694 | + height: 100%; | ||
| 695 | + | ||
| 696 | +} | ||
| 697 | +.xc-brand{ | ||
| 698 | + width:100rpx; | ||
| 699 | + height:35rpx; | ||
| 700 | + line-height: 35rpx; | ||
| 701 | + font-size:21rpx; | ||
| 702 | + border-radius:10rpx; position: relative; top:-1px; | ||
| 703 | + margin-right: 8rpx | ||
| 704 | +} | ||
| 705 | +.top-frame{ | ||
| 706 | + width:82%; | ||
| 707 | + height: 75rpx; | ||
| 708 | + margin-top:10rpx; | ||
| 709 | +} | ||
| 710 | +.top-frame .coupon-wode{ | ||
| 711 | + font-size: 25rpx; | ||
| 712 | + margin-left:10rpx; | ||
| 713 | + width:340rpx; | ||
| 714 | + height:88rpx; | ||
| 715 | +} | ||
| 716 | +.coupon-code{ | ||
| 717 | + width:60rpx; | ||
| 718 | + height:60rpx; | ||
| 719 | + margin-top:5rpx; | ||
| 720 | + | ||
| 721 | +} | ||
| 722 | +.frame{ | ||
| 723 | + width: 100% | ||
| 724 | +} | ||
| 725 | +.coupon-time{ | ||
| 726 | + font-size: 23rpx; | ||
| 727 | + line-height:33rpx; | ||
| 728 | + color: #333; | ||
| 729 | +} | ||
| 730 | + | ||
| 731 | +.clik-get{ | ||
| 732 | + width:125rpx; | ||
| 733 | + height:45rpx; | ||
| 734 | + border-radius: 25rpx; | ||
| 735 | + line-height: 45rpx; | ||
| 736 | + font-size:25rpx; | ||
| 737 | + bottom:67rpx; | ||
| 738 | + right:6px; | ||
| 739 | +} | ||
| 740 | + | ||
| 741 | +.code-img{ | ||
| 742 | + margin-left:20rpx; | ||
| 743 | +} | ||
| 744 | +.bottmo-explain{ | ||
| 745 | +top:145rpx; | ||
| 746 | +width:94%; | ||
| 747 | +border-top:1rpx dashed #eee; | ||
| 748 | +padding-top:8rpx; | ||
| 749 | +height:38rpx; | ||
| 750 | +line-height: 51rpx; | ||
| 751 | + | ||
| 752 | +} | ||
| 753 | +.font-word{ | ||
| 754 | + font-size: 22rpx; | ||
| 755 | +} | ||
| 756 | +.circle-size{ | ||
| 757 | + background: #a0a0a0; | ||
| 758 | + width: 27rpx; | ||
| 759 | + height: 27rpx; | ||
| 760 | + margin-top:13rpx; | ||
| 761 | +margin-left:8rpx; | ||
| 762 | +display: flex; | ||
| 763 | + | ||
| 764 | +align-items: center; | ||
| 765 | +} | ||
| 766 | +.xc-jiantou{ | ||
| 767 | + /* width: 9rpx; | ||
| 768 | + height: 9rpx; */ | ||
| 769 | + /* border-top: 2rpx solid #fff; | ||
| 770 | + border-right: 2rpx solid #fff; */ | ||
| 771 | + transform: rotate(-90deg); | ||
| 772 | + color: #fff; | ||
| 773 | + font-size: 15rpx; | ||
| 774 | + /* display:inline-block; | ||
| 775 | + margin-top: 6.5rpx; */ | ||
| 776 | + text-align: center; | ||
| 777 | +width: 24rpx; | ||
| 778 | +} | ||
| 779 | +.xc-buttom{ | ||
| 780 | + box-sizing: border-box; | ||
| 781 | + width:100%; | ||
| 782 | + min-height:76rpx; | ||
| 783 | + height:auto; | ||
| 784 | + line-height:40rpx; | ||
| 785 | + border-left:1rpx solid #eee; | ||
| 786 | + border-right:1rpx solid #eee; | ||
| 787 | + border-bottom:1rpx solid #eee; | ||
| 788 | +/* margin-left: 6rpx; */ | ||
| 789 | +} | ||
| 790 | + | ||
| 791 | +.goods-num{ | ||
| 792 | + font-size: 28rpx; | ||
| 793 | + color: #333; | ||
| 794 | +} | ||
| 795 | + | ||
| 796 | +.explain-coupon{ | ||
| 797 | + font-size:25rpx; | ||
| 798 | + padding: 10rpx 10rpx | ||
| 799 | +} | ||
| 800 | +.circle-frame{ | ||
| 801 | + width: 20rpx; | ||
| 802 | + height: auto; | ||
| 803 | + z-index:1; | ||
| 804 | + left:210rpx; | ||
| 805 | + | ||
| 806 | +} | ||
| 807 | +.circle-sawtooth{ | ||
| 808 | + width: 11rpx; | ||
| 809 | + height: 11rpx; | ||
| 810 | + background: #fff; | ||
| 811 | +} | ||
| 812 | + | ||
| 813 | +.red{background-color: #fe7496;} | ||
| 814 | +.green{ background-color: #22c7c1;} | ||
| 815 | +.blue{background-color:#5e82e3;} | ||
| 816 | +.g_gray{background-color: #aaaaaa} | ||
| 817 | + | ||
| 818 | +.f_text{text-align: center; height:96rpx; } | ||
| 819 | +.xc-hook.sn { | ||
| 820 | + margin-top:12%; | ||
| 821 | +width:45rpx; | ||
| 822 | +height:45rpx; | ||
| 823 | +font-size:28rpx; | ||
| 824 | +line-height:44rpx; | ||
| 825 | + | ||
| 826 | + | ||
| 827 | +} | ||
| 828 | +.xc-hooks.on{ | ||
| 829 | + margin-top:12%; | ||
| 830 | +width:42rpx; | ||
| 831 | +height:42rpx; | ||
| 832 | +} | ||
| 833 | +.may_use_coupon{ | ||
| 834 | + /* width: 95%; */ | ||
| 835 | + /* height: 68rpx; */ | ||
| 836 | + line-height:78rpx; | ||
| 837 | + padding: 0 26rpx; | ||
| 838 | + justify-content: space-between; | ||
| 839 | + align-items: center; | ||
| 840 | +} | ||
| 841 | +.determine-frame{ | ||
| 842 | + width: 100%; | ||
| 843 | + height: 130rpx; | ||
| 844 | + | ||
| 845 | +} | ||
| 846 | +.xc-determine{ | ||
| 847 | + height: 80rpx; | ||
| 848 | + width: 40%; | ||
| 849 | + border-radius: 50rpx; | ||
| 850 | +background: #d60021; | ||
| 851 | +color: #fff; | ||
| 852 | +font-size: 28rpx; | ||
| 853 | +margin: 0 auto; | ||
| 854 | + | ||
| 855 | +} | ||
| 856 | +.click-buttem{ | ||
| 857 | +width: 90%; | ||
| 858 | +margin: auto; | ||
| 859 | +} | ||
| 860 | +.logistics-name{ | ||
| 861 | + margin-right:20rpx; | ||
| 862 | +} | ||
| 863 | +.xc-border{ | ||
| 864 | + border-top:8rpx solid #eee; | ||
| 865 | +width: 100% | ||
| 866 | +} | ||
| 867 | +.main-top{ | ||
| 868 | +margin-top: 20rpx; | ||
| 869 | + | ||
| 870 | +} | ||
| 871 | +.xc-hookts{ | ||
| 872 | +border: 1rpx solid #999; | ||
| 873 | + | ||
| 874 | +} | ||
| 875 | +.xc-hookts.on{ | ||
| 876 | + width:30rpx; | ||
| 877 | +height:30rpx; | ||
| 878 | + | ||
| 879 | +} | ||
| 880 | +.xc-hookt.sn{ | ||
| 881 | + width: 32rpx; | ||
| 882 | +height: 32rpx; | ||
| 883 | +font-size: 28rpx; | ||
| 884 | +line-height: 34rpx; | ||
| 885 | +} | ||
| 886 | +.xc-hookt{ | ||
| 887 | + transform: rotate(-135deg); | ||
| 888 | +text-align: center; | ||
| 889 | + | ||
| 890 | +} | ||
| 891 | +.main-bottom{ | ||
| 892 | + margin-bottom: 20rpx; | ||
| 893 | + | ||
| 894 | +} | ||
| 895 | +.xc-hookst{ | ||
| 896 | + border: 1rpx solid #999; | ||
| 897 | + | ||
| 898 | +} | ||
| 899 | +.xc-hookst.ons{ | ||
| 900 | + width: 42rpx; | ||
| 901 | +height: 42rpx; | ||
| 902 | +margin-left: 20rpx; | ||
| 903 | + | ||
| 904 | +} | ||
| 905 | +.is_use_coupon{ | ||
| 906 | + width: 65%; | ||
| 907 | +justify-content: flex-end; | ||
| 908 | +padding-top: 10rpx; | ||
| 909 | + | ||
| 910 | + | ||
| 911 | +} | ||
| 912 | +.xc-hooka{ | ||
| 913 | + transform: rotate(-135deg); | ||
| 914 | +text-align: center; | ||
| 915 | + | ||
| 916 | +} | ||
| 917 | +.xc-hooka.sn{ | ||
| 918 | + width: 45rpx; | ||
| 919 | +height: 45rpx; | ||
| 920 | +font-size: 28rpx; | ||
| 921 | +line-height: 44rpx; | ||
| 922 | +margin-left: 20rpx; | ||
| 923 | + | ||
| 924 | +} | ||
| 925 | +.color-gray{ | ||
| 926 | + color: #808080; | ||
| 927 | +} | ||
| 928 | +.n_guige{ display: inline-block; background:rgb(236, 236, 236); color: rgb(63,63,63); padding: 3rpx 10rpx; border-radius: 3rpx } | ||
| 929 | +.gift_image{ width: 60rpx; height: 60rpx; position: absolute; top: 0; left: 0} | ||
| 930 | + | ||
| 931 | +.quan_num_show{ padding: 4rpx 6rpx; background-color:#ea5551; color:#fff; border-radius: 6rpx;margin-left:10rpx;font-size:24rpx;} | ||
| 932 | + | ||
| 933 | +.navigator-hover { | ||
| 934 | + background: none; | ||
| 935 | + opacity: 1; | ||
| 936 | +} | ||
| 937 | + | ||
| 938 | + | ||
| 939 | +.plus_buy{ | ||
| 940 | + background-color: #fff; | ||
| 941 | + margin:15rpx 0; | ||
| 942 | + padding: 20rpx; | ||
| 943 | + position: relative; | ||
| 944 | +} | ||
| 945 | + | ||
| 946 | + | ||
| 947 | +.card_bg { | ||
| 948 | + box-sizing: border-box; | ||
| 949 | + padding: 2rpx 10rpx; | ||
| 950 | + height: 28rpx; | ||
| 951 | + border-radius: 26rpx; | ||
| 952 | + font-size: 18rpx; | ||
| 953 | + line-height: 28rpx; | ||
| 954 | + max-width: 210rpx; | ||
| 955 | + background: #333; | ||
| 956 | + color: #fff; | ||
| 957 | + margin-left: 8rpx; | ||
| 958 | + position:relative; | ||
| 959 | + top:7rpx; | ||
| 960 | +} | ||
| 961 | + | ||
| 962 | +.card_bg image { | ||
| 963 | + width: 19rpx; | ||
| 964 | + height: 19rpx; | ||
| 965 | + margin-right: 8rpx; | ||
| 966 | +} | ||
| 967 | + | ||
| 968 | +/* .card_bg .card_name { | ||
| 969 | + max-width: 76rpx; | ||
| 970 | + width: auto; | ||
| 971 | + overflow: hidden; | ||
| 972 | + white-space: nowrap; | ||
| 973 | +} */ | ||
| 974 | + | ||
| 975 | +.card_name { | ||
| 976 | + position: relative; | ||
| 977 | + top: -4rpx; | ||
| 978 | + margin-left: 6px; | ||
| 979 | +} | ||
| 980 | + | ||
| 981 | +.car_tri_up { | ||
| 982 | + width: 0;height: 0; | ||
| 983 | + border-left: 20rpx solid transparent; | ||
| 984 | + border-right: 20rpx solid transparent; | ||
| 985 | + border-bottom: 20rpx solid #fff; | ||
| 986 | + position: absolute; | ||
| 987 | + right: 20rpx; | ||
| 988 | + top:-10rpx | ||
| 989 | +} | ||
| 990 | +.card_op{ | ||
| 991 | + position: absolute; | ||
| 992 | + right: 20rpx; | ||
| 993 | + top:36rpx | ||
| 994 | +} | ||
| 995 | + |
packageC/pages/presell/goodsInfo/goodsInfo.js
| @@ -1139,9 +1139,13 @@ Page({ | @@ -1139,9 +1139,13 @@ Page({ | ||
| 1139 | }) | 1139 | }) |
| 1140 | 1140 | ||
| 1141 | app.set_b_now(e); | 1141 | app.set_b_now(e); |
| 1142 | - getApp().goto("/packageC/pages/presell/cart/cart2_pre"); | ||
| 1143 | - | ||
| 1144 | 1142 | ||
| 1143 | + //如果是全额付款的话 | ||
| 1144 | + if(this.data.presellForm.presell_type==1){ | ||
| 1145 | + getApp().goto("/packageC/pages/presell/cart/cart2") | ||
| 1146 | + }else{ | ||
| 1147 | + getApp().goto("/packageC/pages/presell/cart/cart2_pre"); | ||
| 1148 | + } | ||
| 1145 | }, | 1149 | }, |
| 1146 | 1150 | ||
| 1147 | //----------增加购买数量----------- | 1151 | //----------增加购买数量----------- |
| @@ -1538,7 +1542,7 @@ Page({ | @@ -1538,7 +1542,7 @@ Page({ | ||
| 1538 | 1542 | ||
| 1539 | 1543 | ||
| 1540 | 1544 | ||
| 1541 | - var url = "/packageC/pages/presell/goodsInfo/goodsInfo?goods_id=" + th.data.gid; | 1545 | + var url = "/packageC/pages/presell/goodsInfo/goodsInfo?goods_id=" + th.data.gid+"&pre_id="+th.data.pre_arr.id; |
| 1542 | if (getApp().globalData.user_id) { | 1546 | if (getApp().globalData.user_id) { |
| 1543 | url += "&first_leader=" + getApp().globalData.user_id; | 1547 | url += "&first_leader=" + getApp().globalData.user_id; |
| 1544 | } | 1548 | } |
| @@ -1558,6 +1562,9 @@ Page({ | @@ -1558,6 +1562,9 @@ Page({ | ||
| 1558 | }; | 1562 | }; |
| 1559 | 1563 | ||
| 1560 | ob.title += '\n' + th.data.presellForm.share_remark; | 1564 | ob.title += '\n' + th.data.presellForm.share_remark; |
| 1565 | + | ||
| 1566 | + | ||
| 1567 | + console.log(ob,888); | ||
| 1561 | 1568 | ||
| 1562 | 1569 | ||
| 1563 | return ob; | 1570 | return ob; |
| @@ -2688,7 +2695,8 @@ Page({ | @@ -2688,7 +2695,8 @@ Page({ | ||
| 2688 | var app = getApp(); | 2695 | var app = getApp(); |
| 2689 | var unit = that.data.screenWidth / 750 * 1.35; //基础单位, | 2696 | var unit = that.data.screenWidth / 750 * 1.35; //基础单位, |
| 2690 | var path2 = that.data.data.original_img; | 2697 | var path2 = that.data.data.original_img; |
| 2691 | - var scene = th.data.gid + ""; | 2698 | + |
| 2699 | + var scene = th.data.gid + "_"+th.data.pre_arr.id; | ||
| 2692 | var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0; | 2700 | var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0; |
| 2693 | if (user_id > 0) { | 2701 | if (user_id > 0) { |
| 2694 | scene += "_" + user_id; | 2702 | scene += "_" + user_id; |
| @@ -2699,8 +2707,10 @@ Page({ | @@ -2699,8 +2707,10 @@ Page({ | ||
| 2699 | if (!user_id) scene += "_0"; | 2707 | if (!user_id) scene += "_0"; |
| 2700 | scene += "_" + getApp().globalData.room_id; | 2708 | scene += "_" + getApp().globalData.room_id; |
| 2701 | } | 2709 | } |
| 2710 | + | ||
| 2702 | ///二微码 | 2711 | ///二微码 |
| 2703 | var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | 2712 | var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + |
| 2713 | + //os.stoid + "?sceneValue=" + scene + "&pageValue=packageC/pages/presell/goodsInfo/goodsInfo"; | ||
| 2704 | os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; | 2714 | os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; |
| 2705 | 2715 | ||
| 2706 | console.log(path3); | 2716 | console.log(path3); |
| @@ -2796,14 +2806,20 @@ Page({ | @@ -2796,14 +2806,20 @@ Page({ | ||
| 2796 | context.setFontSize(22 * unit) | 2806 | context.setFontSize(22 * unit) |
| 2797 | pri0 = "¥" + th.data.data.market_price.toFixed(2); | 2807 | pri0 = "¥" + th.data.data.market_price.toFixed(2); |
| 2798 | var wd2 = th.data.screenWidth - ut.measureText(pri0, 22 * unit) - 25; | 2808 | var wd2 = th.data.screenWidth - ut.measureText(pri0, 22 * unit) - 25; |
| 2799 | - context.fillText('定金', wd2, 213 * unit); | ||
| 2800 | - | ||
| 2801 | - // context.setStrokeStyle('gray'); | ||
| 2802 | - // context.setLineWidth(1 * unit); | ||
| 2803 | - // context.moveTo(wd2 - 5, 206 * unit); | ||
| 2804 | - // context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit); | ||
| 2805 | - // context.stroke(); | ||
| 2806 | - | 2809 | + |
| 2810 | + if(th.data.presellForm.presell_type==1){ | ||
| 2811 | + context.setStrokeStyle('gray'); | ||
| 2812 | + context.fillText(pri0, wd2, 213 * unit); | ||
| 2813 | + context.setLineWidth(1 * unit); | ||
| 2814 | + context.moveTo(wd2 - 5, 206 * unit); | ||
| 2815 | + context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit); | ||
| 2816 | + context.stroke(); | ||
| 2817 | + }else{ | ||
| 2818 | + context.fillText('定金', wd2, 213 * unit); | ||
| 2819 | + } | ||
| 2820 | + | ||
| 2821 | + | ||
| 2822 | + | ||
| 2807 | } else { | 2823 | } else { |
| 2808 | context.setFillStyle("black"); | 2824 | context.setFillStyle("black"); |
| 2809 | context.setFontSize(21.3 * unit) | 2825 | context.setFontSize(21.3 * unit) |
| @@ -2829,43 +2845,7 @@ Page({ | @@ -2829,43 +2845,7 @@ Page({ | ||
| 2829 | //---中间大图--- | 2845 | //---中间大图--- |
| 2830 | context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit); | 2846 | context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit); |
| 2831 | 2847 | ||
| 2832 | - //预售 | ||
| 2833 | - /* if (th.data.poster && parseInt(th.data.poster.style) == 2) { | ||
| 2834 | - if (parseInt(th.data.poster.show_quality)) { | ||
| 2835 | - var g_path = "../../../../images/share/s_gou.png"; | ||
| 2836 | - context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 2837 | - context.setFillStyle("red") | ||
| 2838 | - context.setFontSize(18 * unit) | ||
| 2839 | - context.fillText("正品保证", 84 * unit, 690 * unit); | ||
| 2840 | - | ||
| 2841 | - context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 2842 | - context.setFillStyle("red") | ||
| 2843 | - context.setFontSize(18 * unit) | ||
| 2844 | - context.fillText("纯实体店", 246 * unit, 690 * unit); | ||
| 2845 | - | ||
| 2846 | - context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 2847 | - context.setFillStyle("red") | ||
| 2848 | - context.setFontSize(18 * unit) | ||
| 2849 | - context.fillText("官方验证", 420 * unit, 690 * unit); | ||
| 2850 | - } | ||
| 2851 | - } else { | ||
| 2852 | - var g_path = "../../../../images/share/s_gou.png"; | ||
| 2853 | - context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 2854 | - context.setFillStyle("red") | ||
| 2855 | - context.setFontSize(18 * unit) | ||
| 2856 | - context.fillText("正品保证", 84 * unit, 690 * unit); | ||
| 2857 | - | ||
| 2858 | - context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 2859 | - context.setFillStyle("red") | ||
| 2860 | - context.setFontSize(18 * unit) | ||
| 2861 | - context.fillText("纯实体店", 246 * unit, 690 * unit); | ||
| 2862 | - | ||
| 2863 | - context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 2864 | - context.setFillStyle("red") | ||
| 2865 | - context.setFontSize(18 * unit) | ||
| 2866 | - context.fillText("官方验证", 420 * unit, 690 * unit); | ||
| 2867 | - } */ | ||
| 2868 | - | 2848 | + |
| 2869 | //---画线--- | 2849 | //---画线--- |
| 2870 | context.setLineWidth(1 * unit) | 2850 | context.setLineWidth(1 * unit) |
| 2871 | context.moveTo(32 * unit, 665 * unit) | 2851 | context.moveTo(32 * unit, 665 * unit) |
| @@ -2876,14 +2856,14 @@ Page({ | @@ -2876,14 +2856,14 @@ Page({ | ||
| 2876 | context.setFillStyle("black") | 2856 | context.setFillStyle("black") |
| 2877 | // context.setFontSize(22 * unit) | 2857 | // context.setFontSize(22 * unit) |
| 2878 | context.setFontSize(24 * unit) | 2858 | context.setFontSize(24 * unit) |
| 2879 | - context.fillText(th.data.sto_sele_name_1, 40 * unit, 766 * unit); | 2859 | + context.fillText(th.data.sto_sele_name_1, 40 * unit, 730 * unit); |
| 2880 | context.setFillStyle("red") | 2860 | context.setFillStyle("red") |
| 2881 | context.setFontSize(20 * unit) | 2861 | context.setFontSize(20 * unit) |
| 2882 | var presell_price = `预售价:${th.data.presellList.presell_price}` | 2862 | var presell_price = `预售价:${th.data.presellList.presell_price}` |
| 2883 | - context.fillText(presell_price, 40 * unit, 801 * unit); | 2863 | + context.fillText(presell_price, 40 * unit, 780 * unit); |
| 2884 | context.setFillStyle("black") | 2864 | context.setFillStyle("black") |
| 2885 | context.setFontSize(22 * unit) | 2865 | context.setFontSize(22 * unit) |
| 2886 | - context.fillText("特惠好物,限时预售", 40 * unit, 836 * unit); | 2866 | + context.fillText("特惠好物,限时预售", 40 * unit, 826 * unit); |
| 2887 | context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 866 * unit); | 2867 | context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 866 * unit); |
| 2888 | 2868 | ||
| 2889 | //---二维吗图--- | 2869 | //---二维吗图--- |
| @@ -2894,7 +2874,7 @@ Page({ | @@ -2894,7 +2874,7 @@ Page({ | ||
| 2894 | context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit); | 2874 | context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit); |
| 2895 | } else { | 2875 | } else { |
| 2896 | //---二维吗图--- | 2876 | //---二维吗图--- |
| 2897 | - context.drawImage(vpath, 390 * unit, 756 * unit, 130 * unit, 116 * unit); | 2877 | + context.drawImage(vpath, 390 * unit, 746 * unit, 130 * unit, 116 * unit); |
| 2898 | } | 2878 | } |
| 2899 | 2879 | ||
| 2900 | 2880 | ||
| @@ -3966,7 +3946,7 @@ Page({ | @@ -3966,7 +3946,7 @@ Page({ | ||
| 3966 | } | 3946 | } |
| 3967 | }) | 3947 | }) |
| 3968 | if (!pre_arr) { | 3948 | if (!pre_arr) { |
| 3969 | - wx.showToast({title: "当前会员身份不符,无法参与", icon: 'none', duration: 3000}); | 3949 | + wx.showToast({title: "当前会员身份不符或者时间已过期,无法参与", icon: 'none', duration: 3000}); |
| 3970 | setTimeout(function () { | 3950 | setTimeout(function () { |
| 3971 | ut.wx_back(); | 3951 | ut.wx_back(); |
| 3972 | }, 2000) | 3952 | }, 2000) |
packageC/pages/presell/goodsInfo/goodsInfo.wxml
| @@ -116,12 +116,14 @@ | @@ -116,12 +116,14 @@ | ||
| 116 | <view class="goods-num"> | 116 | <view class="goods-num"> |
| 117 | <block wx:if="{{presellList.virtual_qty}}"> | 117 | <block wx:if="{{presellList.virtual_qty}}"> |
| 118 | <view class="stock">总数量:{{presellList.presell_sumqty+presellList.virtual_qty}}件</view> | 118 | <view class="stock">总数量:{{presellList.presell_sumqty+presellList.virtual_qty}}件</view> |
| 119 | - <view class="stock">限购:{{presellList.vip_butyqty}}件</view> | 119 | + <view class="stock" wx:if="{{presellList.vip_butyqty}}">限购:{{presellList.vip_butyqty}}件</view> |
| 120 | + <view class="stock" wx:else>限购:不限</view> | ||
| 120 | <view class="sales">已购:{{presellList.buy_goodnum+presellList.virtual_qty}}件</view> | 121 | <view class="sales">已购:{{presellList.buy_goodnum+presellList.virtual_qty}}件</view> |
| 121 | </block> | 122 | </block> |
| 122 | <block wx:else> | 123 | <block wx:else> |
| 123 | <view class="stock">总数量:{{presellList.presell_sumqty}}件</view> | 124 | <view class="stock">总数量:{{presellList.presell_sumqty}}件</view> |
| 124 | - <view class="stock">限购:{{presellList.vip_butyqty}}件</view> | 125 | + <view class="stock" wx:if="{{presellList.vip_butyqty}}">限购:{{presellList.vip_butyqty}}件</view> |
| 126 | + <view class="stock" wx:else>限购:不限</view> | ||
| 125 | <view class="sales">已购:{{presellList.buy_goodnum}}件</view> | 127 | <view class="sales">已购:{{presellList.buy_goodnum}}件</view> |
| 126 | </block> | 128 | </block> |
| 127 | </view> | 129 | </view> |
pages/cart/cart2/cart2.js
| @@ -1935,6 +1935,12 @@ Page({ | @@ -1935,6 +1935,12 @@ Page({ | ||
| 1935 | } | 1935 | } |
| 1936 | }) | 1936 | }) |
| 1937 | } else { | 1937 | } else { |
| 1938 | + | ||
| 1939 | + var order_prom_txt1 = "formData.order_prom_id"; | ||
| 1940 | + var order_prom_txt2 = "formData.order_prom_amount"; | ||
| 1941 | + th.setData({[order_prom_txt1]: 0, [order_prom_txt2]: 0}) | ||
| 1942 | + | ||
| 1943 | + | ||
| 1938 | total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price); | 1944 | total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price); |
| 1939 | order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price); | 1945 | order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price); |
| 1940 | var atxt = "formData.total_amount"; | 1946 | var atxt = "formData.total_amount"; |
pages/index/index/index.js
pages/user/order_list/order_list.wxml
| @@ -59,6 +59,7 @@ | @@ -59,6 +59,7 @@ | ||
| 59 | <view wx:if="{{item.order_status==3 && item.pt_status!=6}}" class="flex-center" >已取消<view class="lin"></view> | 59 | <view wx:if="{{item.order_status==3 && item.pt_status!=6}}" class="flex-center" >已取消<view class="lin"></view> |
| 60 | <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-index="{{index}}" data-order_id="{{item.order_id}}"></image> | 60 | <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-index="{{index}}" data-order_id="{{item.order_id}}"></image> |
| 61 | </view> | 61 | </view> |
| 62 | + <view wx:if="{{item.order_status==6}}">退款成功</view> | ||
| 62 | </block> | 63 | </block> |
| 63 | <block wx:else>退款中</block> | 64 | <block wx:else>退款中</block> |
| 64 | 65 |