Commit 54d4cbb47bce2a693b34ab02303be3c9fc6f6b08

Authored by F5VT98DI7XY4X12\Administrator
1 parent 65ab0be8

小程序BUG 修改

pages/cart/cart2/cart2.js
... ... @@ -81,6 +81,7 @@ Page({
81 81 th.data.param=t;
82 82 //-----先获取物流,再获取用户信息,再展示页面-----
83 83 th.get_wuliu(th.get_info(th.show_page));
  84 +
84 85 },
85 86 onUnload: function () { this.setData({ isclose: 1 })},
86 87 //-------------------获取物流---------------
... ... @@ -101,12 +102,7 @@ Page({
101 102  
102 103 //------获取会员收货地址-----
103 104 getuser_addr:function(func){
104   - console.log(to.globalData.baddr);
105   - if (to.globalData.baddr!=null){
106   - var user_addr = to.globalData.baddr;
107   - to.globalData.baddr=null;
108   - func(user_addr);
109   - }else{
  105 +
110 106 a.get("/api/weshop/useraddress/page", {
111 107 data: { user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600 },
112 108 success: function (su) {
... ... @@ -121,10 +117,11 @@ Page({
121 117 if (user_addr[i]['is_default'] == 1) { item = user_addr[i]; break; }
122 118 }
123 119 if (item == null) item = user_addr[0];
  120 + if(item==undefined) item=null;
124 121 func(item);
125 122 }
126 123 });
127   - }
  124 +
128 125 },
129 126 //----------------展示页面,是再获取用户信息之后--------------
130 127 show_page:function(){
... ... @@ -375,9 +372,17 @@ Page({
375 372  
376 373 }else{
377 374 this.getuser_addr(function(ie){
378   - th.setData({user_addr: ie });
379   - });
380 375  
  376 + console.log("getuser_addr")
  377 + console.log(ie)
  378 +
  379 + th.setData({user_addr: ie });
  380 + if (th.data.is_b_now == 1) {
  381 + th.calculatePrice2();
  382 + } else {
  383 + th.calculatePrice();
  384 + }
  385 + });
381 386 }
382 387 },
383 388 //---------------检查是否有收货地址-------------------
... ... @@ -676,7 +681,8 @@ Page({
676 681 if (th.data.is_b_now==1){
677 682 console.log("buy_new");
678 683  
679   - if(th.data.bn_exp_type == 0 && th.data.user_addr==null ){ ff = false; confirmBox("请新建收货地址"); }
  684 + if(th.data.bn_exp_type == 0 && th.data.user_addr==null ){
  685 + ff = false; getApp().confirmBox("请新建收货地址"); }
680 686 if (!ff) return false;
681 687 var addr = th.data.user_addr;
682 688 if (th.data.bn_exp_type == 1) addr=null;
... ... @@ -687,7 +693,7 @@ Page({
687 693  
688 694 if(th.data.bn_exp_type==0)
689 695 if(th.data.wu_arr==null || th.data.wu_arr.length<=0){
690   - confirmBox("读取物流失败");
  696 + getApp().confirmBox("读取物流失败");
691 697 return false;
692 698 }
693 699  
... ... @@ -752,7 +758,7 @@ Page({
752 758 console.log(pdata);
753 759 }else{
754 760 //---------购物车的结算---------
755   - if (th.data.is_all_zt == 0 && th.data.user_addr == null) { ff = false;confirmBox("请新建收货地址");}
  761 + if (th.data.is_all_zt == 0 && th.data.user_addr == null) { ff = false; getApp().confirmBox("请新建收货地址");}
756 762 if (!ff) return false;
757 763  
758 764 var addr = th.data.user_addr;
... ... @@ -763,7 +769,7 @@ Page({
763 769  
764 770 if(th.data.is_all_zt !=1)
765 771 if(th.data.wu_arr==null || th.data.wu_arr.length<=0 ){
766   - confirmBox("读取物流失败");
  772 + getApp().confirmBox("读取物流失败");
767 773 return false;
768 774 }
769 775  
... ...
pages/cart/cart2_pt/cart2_pt.js
... ... @@ -110,6 +110,7 @@ Page({
110 110 if (user_addr[i]['is_default'] == 1) { item = user_addr[i]; break; }
111 111 }
112 112 if (item == null) item = user_addr[0];
  113 + if (item == undefined) item = null;
113 114 func(item);
114 115 }
115 116 });
... ...
pages/cart/cart_wk/cart_wk.js
... ... @@ -59,12 +59,16 @@ Page({
59 59  
60 60 th.getuser_addr(function(addr) {
61 61 if(addr==null || addr==undefined || addr.length==0) {
62   - th.setData({ enterAddressPage: 1,});
  62 + th.setData({ user_addr: null, enterAddressPage: 1,});
63 63 }else {
64 64 th.setData({
65 65 user_addr: addr, enterAddressPage: 0,
66 66 });
67 67 }
  68 +
  69 + if (th.data.exp_type == 0){
  70 + th.calculate_wuliu();
  71 + }
68 72 })
69 73  
70 74 },
... ... @@ -92,13 +96,9 @@ Page({
92 96  
93 97 //------获取会员收货地址-----
94 98 getuser_addr: function(func) {
95   - var to = getApp(),
  99 + var to = getApp(),
96 100 a = to.request;
97   - if (to.globalData.baddr != null) {
98   - var user_addr = to.globalData.baddr;
99   - to.globalData.baddr = null;
100   - func(user_addr);
101   - } else {
  101 +
102 102 a.get("/api/weshop/useraddress/page", {
103 103 data: {
104 104 user_id: to.globalData.user_id,
... ... @@ -115,10 +115,11 @@ Page({
115 115 }
116 116 }
117 117 if (item == null) item = user_addr[0];
  118 + if (item == undefined) item = null;
118 119 func(item);
119 120 }
120 121 });
121   - }
  122 +
122 123 },
123 124  
124 125 //----------------展示页面,是再获取用户信息之后--------------
... ... @@ -312,6 +313,12 @@ Page({
312 313 //--立即支付--
313 314 to_pay_type: function(ind) {
314 315 var th=this;
  316 +
  317 + //--物流支付时要有地址--
  318 + if (th.data.exp_type == 0 && th.data.user_addr==null){
  319 + return getApp().my_warnning("请先建地址",0,th);
  320 + }
  321 +
315 322 //---支付参数--
316 323 var dd = {
317 324 order_sn: th.data.order.order_sn,
... ... @@ -323,6 +330,7 @@ Page({
323 330 prom_id:th.data.order.pt_prom_id,
324 331 tail_pay_type:ind,//0微信支付 1余额支付
325 332 };
  333 +
326 334 if(th.data.exp_type==0){
327 335 var index=th.data.index;
328 336 dd.shipping_code=th.data.wu_arr[index].code;
... ... @@ -391,7 +399,7 @@ Page({
391 399 case 3:
392 400 if (goods_piece < 0) goods_piece = 0;
393 401 //累积商品数量
394   - goods_piece += good['buynum'];
  402 + goods_piece += th.data.order.order_goods['goods_num'];
395 403 break;
396 404 }
397 405 var code = th.data.wu_arr[th.data.index].code;
... ...
pages/cart/cart_wk/cart_wk.wxml
1   -<!--pages/cart/cart_wk/cart_wk.wxml-->
2   -
  1 +<wxs module="filters" src="../../../utils/filter.wxs"></wxs>
3 2 <!----要进行判断地址是否显示---->
4 3 <view bindtap="enterAddressPage" class="user-mes"
5 4 hidden='{{exp_type==1 }}'>
... ... @@ -80,7 +79,7 @@
80 79 </view>
81 80 <view class='ct_one'>
82 81 <view class='ct_one_left'>成团单价</view>
83   - <view class='ct_one_right'>¥<text class='redwz'>{{order.order_amount+order.user_money+order.pt_tail_money}}</text></view>
  82 + <view class='ct_one_right'>¥<text class='redwz'>{{filters.toFix(order.order_amount+order.user_money+order.pt_tail_money,2)}}</text></view>
84 83 </view>
85 84 <view class='ct_one'>
86 85 <view class='ct_one_left'>支付定金</view>
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -174,12 +174,10 @@ Page({
174 174 quan_list:null, //券列表
175 175  
176 176 coupon:0,
177   -
178 177 //会员分享的头像
179 178 share_head:"",
180 179 share_goods_img:"",
181 180  
182   -
183 181 //----------视频图片data参数---------
184 182 current: 0,//图片计数
185 183 swiperCurrent:0,//轮播的下标
... ... @@ -211,7 +209,6 @@ Page({
211 209 var ee = this, that=ee,
212 210 gid = t.goods_id;
213 211  
214   -
215 212 //如果tg_id是空的话,分享回来
216 213 if (gid == undefined || gid == null || gid == "") {
217 214 gid = decodeURIComponent(postdata.scene);
... ... @@ -395,8 +392,6 @@ Page({
395 392 //---展示---
396 393 onShow: function() {
397 394  
398   -
399   -
400 395 this.data.is_timer=1;
401 396 var ee = this,gid = this.data.gid,i=getApp().request;
402 397 i.get("/api/weshop/goods/get/" + o.stoid + "/" + ee.data.gid, {
... ... @@ -1476,6 +1471,14 @@ Page({
1476 1471 user_order_pt_state: 2
1477 1472 });
1478 1473 }
  1474 +
  1475 + if (odr.pt_status == 2 && odr.is_zsorder == 4) {
  1476 + th.setData({
  1477 + user_order_pt_state: 3,
  1478 + });
  1479 + th.data.wk_order_id=odr.order_id;
  1480 + }
  1481 +
1479 1482  
1480 1483 }
1481 1484 },
... ... @@ -2555,6 +2558,10 @@ Page({
2555 2558 getApp().goto(url);
2556 2559 },
2557 2560  
2558   -
  2561 + //--跳转到支付尾款界面--
  2562 + go_pay_wk:function () {
  2563 + var url = "/pages/cart/cart_wk/cart_wk?order_id="+ this.data.wk_order_id;
  2564 + getApp().goto(url);
  2565 + }
2559 2566  
2560 2567 });
2561 2568 \ No newline at end of file
... ...
pages/goods/goodsInfo/goodsInfo.wxml
... ... @@ -682,11 +682,11 @@
682 682  
683 683 </view>
684 684 <!---阶梯团---->
685   - <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==3}}" class="buy-btn cart-btn line-h">
  685 + <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==3 && user_order_pt_state!=3 }}" class="buy-btn cart-btn line-h">
686 686 <view class="fir-v">¥{{filters.toFix(prom_act.yf_price,2)}}</view>
687 687 <view>支付定金</view>
688 688 </view>
689   -
  689 +
690 690 <view wx:if="{{prom_st==0}}" class="buy-btn cart-btn lanse">即将开始</view>
691 691 <view wx:if="{{prom_r_null}}" class="buy-btn cart-btn huise">已抢光</view>
692 692 <view wx:if="{{prom_st==3 && !prom_r_null}}" class="buy-btn cart-btn lanse">活动已经结束</view>
... ... @@ -694,6 +694,7 @@
694 694 <block wx:else>
695 695 <view bindtap="go_to_nopay" wx:if="{{user_order_pt_state==1}}" class="buy-btn cart-btn huise">您还未支付</view>
696 696 <view bindtap="go_to_team_show" wx:if="{{user_order_pt_state==2}}" class="buy-btn cart-btn">查看支付详情</view>
  697 + <view wx:if="{{user_order_pt_state==3}}" bindtap="go_pay_wk" class="buy-btn cart-btn">支付尾款</view>
697 698 </block>
698 699 </block>
699 700 <!---<view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:else>立即兑换</view>-->
... ...
pages/team/team_success/team_success.wxml
... ... @@ -157,11 +157,9 @@
157 157 <button wx:if="{{p_status==1}}" style='background-color:#fab55a; color:#fff'>
158 158 邀请好友参团
159 159 </button>
160   - <button style='background-color:#42c780;' wx:if="{{p_status==2}}">
  160 + <button style='background-color:#42c780;' wx:if="{{order.pt_status==2 && order.is_zsorder==4 }}">
161 161 支付尾款
162   - </button>
163   -
164   -
  162 + </button>
165 163 </view>
166 164 <!-- <view wx:elif="{{teamlist.ct_num-ordertx.length>0}}" class='' bindtap='cmeng'> -->
167 165  
... ...
pages/team/team_success/team_success.wxss
... ... @@ -234,15 +234,12 @@ width:101rpx;
234 234 }
235 235  
236 236 .bodybutton{
237   - min-height: 60rpx;
238 237 width: 90%;
239 238 margin: 0 auto;
240 239 text-align: center;
241 240 line-height: 60rpx;
242 241 border-radius:15rpx;
243   - height: auto;
244   -
245   -
  242 + height: auto;
246 243 }
247 244  
248 245 .bodybutton button{
... ...
pages/user/order_detail/order_detail.js
... ... @@ -178,4 +178,9 @@ Page({
178 178 _errObj[_errImg] = "public/images/default_goods_image_240.gif";
179 179 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
180 180 },
  181 +
  182 + zfwk:function(){
  183 + var url = "/pages/cart/cart_wk/cart_wk?order_id=" + this.data.order.order_id;
  184 + getApp().goto(url);
  185 + }
181 186 });
182 187 \ No newline at end of file
... ...
pages/user/order_detail/order_detail.wxml
  1 +<wxs module="filters" src="../../../utils/filter.wxs"></wxs>
1 2 <view class="container">
2 3 <view class="user-mes" wx:if="{{order.exp_type==0}}">
3 4 <view class="user-contact">
... ... @@ -61,6 +62,32 @@
61 62 </view>
62 63 <view class="price-information information">
63 64 <view class="title">价格信息</view>
  65 + <block wx:if="{{order.is_zsorder==4}}">
  66 + <view class="item">
  67 + <view>商品总价</view>
  68 + <view>¥ {{filters.toFix(order.order_goods[0].member_goods_price*order.order_goods[0].goods_num,2)}}元</view>
  69 + </view>
  70 + <view class="item">
  71 + <view>定金金额</view>
  72 + <view>¥ {{filters.toFix(order.order_amount+order.user_money,2)}}元</view>
  73 + </view>
  74 + <view class="item" wx:if="{{order.pt_tail_money>0}}">
  75 + <view>尾款金额</view>
  76 + <view>¥ {{order.pt_tail_money}}元</view>
  77 + </view>
  78 +
  79 + <view class="item" wx:if="{{order.pt_tail_money>0}}">
  80 + <view>订单总价</view>
  81 + <view>¥ {{order.pt_tail_money}}元</view>
  82 + </view>
  83 +
  84 + <view class="item" wx:if="{{order.user_money>0}}">
  85 + <view>使用余额</view>
  86 + <view>¥ {{order.user_money}}元</view>
  87 + </view>
  88 + </block>
  89 +
  90 + <block wx:else>
64 91 <view class="item">
65 92 <view>商品总价</view>
66 93 <view>¥ {{order.goods_price}}元</view>
... ... @@ -71,34 +98,32 @@
71 98 </view>
72 99 <view class="item" wx:if="{{order.coupon_price>0}}">
73 100 <view>优惠券</view>
74   - <view>- ¥ {{order.coupon_price}}元</view>
  101 + <view> ¥ {{order.coupon_price}}元</view>
75 102 </view>
76 103 <view class="item" wx:if="{{order.integral_money>0}}">
77 104 <view>积分</view>
78   - <view>- ¥ {{order.integral_money}}元</view>
  105 + <view> ¥ {{order.integral_money}}元</view>
79 106 </view>
80 107 <view class="item" wx:if="{{order.user_money>0}}">
81 108 <view>余额</view>
82   - <view>- ¥ {{order.user_money}}元</view>
  109 + <view> ¥ {{order.user_money}}元</view>
83 110 </view>
84 111 <view class="item" wx:if="{{order.order_prom_amount>0}}">
85 112 <view>订单优惠</view>
86   - <view>- ¥ {{order.order_prom_amount}}元</view>
87   - </view>
88   - <view class="item" wx:if="{{order.pt_tail_money>0}}">
89   - <view>尾款金额</view>
90   - <view>- ¥ {{order.pt_tail_money}}元</view>
  113 + <view>¥ {{order.order_prom_amount}}元</view>
91 114 </view>
92   -
93   -
  115 +
94 116 <view class="item">
95 117 <view>实付金额</view>
96 118 <view class="pay-amount">¥ {{order.order_amount}}元</view>
97 119 </view>
  120 +
  121 +
  122 + </block>
98 123 </view>
99 124  
100 125 <view class="btn-wrap">
101   - <view bindtap="zfwk" class="tips-btn" wx:if="{{order.pt_tail_money>0}}">支付尾款</view>
  126 + <view bindtap="zfwk" class="tips-btn" wx:if="{{order.pt_tail_money>0 && order.pt_status==2 }}">支付尾款</view>
102 127 <view bindtap="jumpToCart4" class="tips-btn" hidden="{{!order.pay_btn}}">立即付款</view>
103 128 <navigator bindtap="confirmOrder" class="tips-btn" hidden="{{!order.receive_btn}}">收货确认</navigator>
104 129 <navigator class="tips-btn" hidden="{{!order.shipping_btn}}" url="/pages/user/express/express?order_id={{order.order_id}}">查看物流</navigator>
... ...
pages/user/order_list/order_list.wxml
  1 +<wxs module="filters" src="../../../utils/filter.wxs"></wxs>
1 2 <view class="container">
2 3 <view class="type-navbar">
3 4 <view class="type-box" wx:for="{{categories}}" wx:key="{{index}}">
... ... @@ -48,8 +49,15 @@
48 49 <view class="goods-tips">
49 50 <view class="order-total">
50 51 共{{item.g_num}}件,<view class="goods-total">
51   - <view>金额:¥{{item.order_amount+item.user_money}}</view>
  52 + <block wx:if="{{item.pt_status==4 || item.pt_status==5 }}">
  53 + <view>金额:¥{{filters.toFix(item.order_amount+item.user_money+item.pt_tail_money,2)}}</view>
  54 + </block>
  55 + <block wx:else>
  56 + <view wx:if="item.is_zsorder==4">定金:¥{{filters.toFix(item.order_amount+item.user_money,2)}}</view>
  57 + <view wx:else>金额:¥{{filters.toFix(item.order_amount+item.user_money,2)}}</view>
52 58 <view wx:if="{{item.pt_tail_money>0}}">尾款:¥{{item.pt_tail_money}}</view>
  59 + </block>
  60 +
53 61 </view>
54 62 </view>
55 63 <view class="check-btn">
... ...
pages/user/order_list/order_list.wxss
... ... @@ -36,7 +36,7 @@
36 36 .goods-box {
37 37 width: 100%;
38 38 background-color: #fff;
39   - padding: 0 30rpx;
  39 + padding: 0 25rpx;
40 40 margin-bottom: 20rpx;
41 41 font-size: 28rpx;
42 42 border-bottom: 1rpx solid #eee;
... ... @@ -117,7 +117,7 @@
117 117 .order-total {
118 118 display: flex;
119 119 justify-content: flex-start;
120   - font-size: 32rpx;
  120 + font-size: 31rpx;
121 121 color: #333;
122 122 }
123 123  
... ... @@ -127,12 +127,12 @@
127 127 }
128 128  
129 129 .order-btn {
130   - width: 150rpx;
  130 + width: 125rpx;
131 131 height: 60rpx;
132 132 line-height: 60rpx;
133 133 text-align: center;
134 134 border: 1px solid #eee;
135   - margin-left: 20rpx;
  135 + margin-left: 10rpx;
136 136 float: right;
137 137 border-radius: 5rpx;
138 138 }
... ...