Commit 98a8234b1484c7be66a7f803012026d10ad2771f

Authored by yvan.ni
1 parent 340aa305

拼团的订单的优化

packageA/pages/serviceCard_pd/cart/cart.js
@@ -3,6 +3,7 @@ var t = getApp(), app = t, a = t.request, e = require("../../../../utils/common. @@ -3,6 +3,7 @@ var t = getApp(), app = t, a = t.request, e = require("../../../../utils/common.
3 var oo = t.globalData.setting, os = oo; 3 var oo = t.globalData.setting, os = oo;
4 var regeneratorRuntime = require('../../../../utils/runtime.js'); 4 var regeneratorRuntime = require('../../../../utils/runtime.js');
5 var util_pay = require("../../../../utils/pay.js"); 5 var util_pay = require("../../../../utils/pay.js");
  6 +var t_pay = require("../../../../utils/pay2.js");
6 7
7 Page({ 8 Page({
8 data: { 9 data: {
@@ -66,6 +67,8 @@ Page({ @@ -66,6 +67,8 @@ Page({
66 }, 67 },
67 onLoad: function (t) { 68 onLoad: function (t) {
68 console.log("onLoad_pt_cart"); 69 console.log("onLoad_pt_cart");
  70 +
  71 +
69 var th = this; this.setData({ is_b_now: t.is_bnow == undefined ? 0 : t.is_bnow, }); 72 var th = this; this.setData({ is_b_now: t.is_bnow == undefined ? 0 : t.is_bnow, });
70 var appD = getApp().get_b_now(); 73 var appD = getApp().get_b_now();
71 74
@@ -209,6 +212,12 @@ Page({ @@ -209,6 +212,12 @@ Page({
209 212
210 //----------子页返回父页触发---------- 213 //----------子页返回父页触发----------
211 onShow: function () { 214 onShow: function () {
  215 +
  216 + s.fy_back('',0);
  217 +
  218 + t_pay.set_fir();
  219 + util_pay.set_fir();
  220 +
212 var th = this; 221 var th = this;
213 if (th.data.isclose == 0) { 222 if (th.data.isclose == 0) {
214 wx.navigateTo({ 223 wx.navigateTo({
@@ -371,39 +380,31 @@ Page({ @@ -371,39 +380,31 @@ Page({
371 //要进行判断,如果是用微信支付,就要跳转到支付界面 380 //要进行判断,如果是用微信支付,就要跳转到支付界面
372 if (order_amount > 0) { 381 if (order_amount > 0) {
373 th.setData({ isclose: 0 }); 382 th.setData({ isclose: 0 });
374 - getApp().request.post("/api/weshop/order/pay/createRechargeOrder", {  
375 - data: {  
376 - parentSn: data.data.order_sn,  
377 - store_id: oo.stoid  
378 - },  
379 - success: function(su) {  
380 -  
381 - var n = su.data.data;  
382 - let order_id = data.data.order_id;  
383 - th.weixinPay(n,  
384 - function() {  
385 - // getApp().showWarning("购买成功");  
386 - wx.showToast({  
387 - title: '购买成功',  
388 - icon: 'success',  
389 - duration: 2000  
390 - });  
391 - setTimeout(function() {  
392 - wx.redirectTo({  
393 - url: "/packageA/pages/serviceCard_pd/team_success/team_success?order_sn=" + data.data.order_sn  
394 - });  
395 - }, 1000)  
396 - },  
397 - function() {  
398 - getApp().showWarning("支付失败");  
399 - setTimeout(function() {  
400 - wx.reLaunch({  
401 - url: "/pages/user/order_list/order_list?index=2&tabindex=1",  
402 - })  
403 - }, 1000)  
404 - })  
405 - } 383 +
  384 + t_pay.set_pay_url("/api/weshop/order/pay/createRechargeOrder");
  385 + t_pay.pay({
  386 + parentSn: data.data.order_sn,
  387 + store_id: oo.stoid
  388 + }, function () {
  389 + wx.showToast({
  390 + title: '购买成功',
  391 + icon: 'success',
  392 + duration: 2000
  393 + });
  394 + setTimeout(function() {
  395 + wx.redirectTo({
  396 + url: "/packageA/pages/serviceCard_pd/team_success/team_success?ordersn=" + data.data.order_sn
  397 + });
  398 + }, 1000)
  399 +
  400 + }, function (e) {
  401 + wx.showToast({
  402 + title: e,
  403 + icon: 'none',
  404 + duration: 2000
  405 + });
406 }) 406 })
  407 +
407 } 408 }
408 } else { 409 } else {
409 th.data.is_summit_ing = 0; //是否提交中 410 th.data.is_summit_ing = 0; //是否提交中
packageA/pages/serviceCard_pd/cart/cart.wxml
1 <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> 1 <wxs module="filters" src="../../../../utils/filter.wxs"></wxs>
2 <form bindsubmit="submitForm"> 2 <form bindsubmit="submitForm">
3 <view class="container"> 3 <view class="container">
4 -  
5 - <view class="tab-container" wx:if="{{kt_type!=3 || is_normal==1}}">  
6 - <view class="tab-wrapper">  
7 - <view hidden="{{bn_t_exp_t==2}}" bindtap='setexptype' data-t='1' class="tab {{bn_exp_type == 1? 'active':''}}"  
8 - data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view>  
9 -  
10 - <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}"  
11 - data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view>  
12 -  
13 - </view>  
14 - </view>  
15 -  
16 -  
17 - <!--要进行判断地址是否显示---->  
18 - <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{bn_exp_type==1 || kt_type==3}}'>  
19 - <!---默认地址显示------>  
20 - <block wx:if="{{user_addr!=null}}">  
21 - <view class="user-contact">收货人:{{user_addr.consignee}}{{'  '}}{{user_addr.mobile}}</view>  
22 - <view class="location">  
23 - <view class="address">{{user_addr.more_address}}{{' '}}{{user_addr.address}}</view>  
24 - <view class="pos-icon">  
25 - <image class="wh100 bdr14" src="{{imgUrl}}/miniapp/images/goodscategory/new_position.png"></image>  
26 - </view>  
27 - </view>  
28 - <view class="update-logistics">  
29 - <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/icon-arrowdown.png"></image>  
30 - </view>  
31 - </block>  
32 - <!---先增地址------>  
33 - <block wx:else>  
34 - <view class="add_new">  
35 - <image class="addr_jia" src="{{imgUrl}}/miniapp/images/jia.png"></image>添加地址  
36 - </view>  
37 - </block>  
38 - <!-- <view class="border-img"><image class="wh100 bdr14" src="{{imgUrl}}/miniapp/images/tt.png"></image></view> -->  
39 - </view>  
40 -  
41 4
42 <!------立即购买--------> 5 <!------立即购买-------->
43 <block> 6 <block>
44 - <!-- <view class="xc-border main-top"></view> -->  
45 <view class="use-item bfff bdr_t-14 mgt20"> 7 <view class="use-item bfff bdr_t-14 mgt20">
46 <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image> <view>{{bn_pickname}}</view></view> 8 <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image> <view>{{bn_pickname}}</view></view>
47 <view class="order-detail"> 9 <view class="order-detail">
48 - <view class="goods-img"> 10 + <view class="goods-img" bindtap="go_to" data-url="/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?goods_id={{items.service_id}}&prom_type=6&prom_id={{bn_goods.prom_id}}">
49 <image class="wh100 bdr14" src="{{bn_goods.original_img}}" 11 <image class="wh100 bdr14" src="{{bn_goods.original_img}}"
50 binderror='cart_set_err' data-err="bn_goods.original_img"></image> 12 binderror='cart_set_err' data-err="bn_goods.original_img"></image>
51 </view> 13 </view>
52 - <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}">  
53 - <view class="goods-name ellipsis-2">{{bn_goods.goods_name}}</view>  
54 - <!-- 商品属性 -->  
55 - <view class="flex-vertical fs28 color-gray n_guige">  
56 - <view class="goods-color"><text>{{filters.show_gui_ge(bn_goods.goods_spec,bn_goods.goods_color)}}</text>  
57 - </view></view>  
58 - 14 + <navigator class="order-cont" url="/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?goods_id={{items.service_id}}&prom_type=6&prom_id={{bn_goods.prom_id}}">
  15 + <view class="goods-name ellipsis-2">{{bn_goods.service_name}}</view>
59 <!-----商品名称规格------> 16 <!-----商品名称规格------>
60 - <view class="order-num flex-space-between">  
61 - <view class="co-red">¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></view>  
62 - <view class="goods-num">x{{bn_goods.buynum}}</view>  
63 - </view> 17 + <view class="order-num flex-space-between">
  18 + <view class="co-red">¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></view>
  19 + <view class="goods-num">x{{bn_goods.buynum}}</view>
  20 + </view>
64 </navigator> 21 </navigator>
65 - <!-- <view class="order-num">  
66 - <view class="co-red">¥{{bn_goods.shop_price}}</view>  
67 - <view class="goods-num">x{{bn_goods.buynum}}</view>  
68 - </view> -->  
69 - </view>  
70 -  
71 - <!-- 如果是等级卡的商品,会员没有注册,要提醒注册 -->  
72 - <view class="plus_buy fs28" wx:if="{{card_cut_price>0}}">  
73 - <view class="flex">  
74 - <view class="card_bg ellipsis-1" style="margin-right: 10rpx;">  
75 - <image src="{{imgUrl}}/miniapp/images/plus/dj_icon.png"></ image>  
76 - <text class="card_name">{{show_card.CardName}}</text>  
77 - </view>  
78 - <view>立减 <text style="color:#f23030;">{{filters.toFix(card_cut_price,2) }}</text> 元</view>  
79 - </view>  
80 - <view>  
81 - <text style="color: #999;margin-left: 4rpx;">vip超级会员仅需{{show_card.CardFee}}元</text>  
82 - </view>  
83 - <!-- 三角形 -->  
84 - <view class="car_tri_up"></view>  
85 - <!-- 立即开通跳转 -->  
86 - <view bindtap="buycard" class="card_op">立即开通</view>  
87 - </view>  
88 -  
89 -  
90 - <view class="set-mes bdr_b-14">  
91 - <view wx:if="{{order.store_prom}}"><icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}}  
92 - </view>  
93 -  
94 - <!--阶梯团是不显示的-->  
95 - <block wx:if="{{bn_exp_type==0 && !is_default_logistics}}">  
96 - <view class="use-item flex-space-between" wx:if="{{kt_type!=3 || is_normal==1}}">  
97 - <view>选择物流</view>  
98 - <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index' style="margin-right: 8rpx;">  
99 - <view class="logistics-name">{{wu_arr[index].name}}</view><view class="xc-right"></view>  
100 - </view>  
101 - </view>  
102 - </block>  
103 -  
104 - <!--阶梯团是不显示的  
105 - <block wx:if="{{kt_type!=3 || is_normal==1 }}">  
106 - <view class="use-item" hidden='{{bn_exp_type==1}}'>  
107 - <view>使用物流:</view>  
108 - <picker bindchange="bindPickerChange" value="{{index}}" range="{{wu_arr}}" range-key="name">  
109 - <view >{{wu_arr[index].name}}</view>  
110 - </picker>  
111 - </view>  
112 - </block>-->  
113 22
114 </view> 23 </view>
115 24
116 -  
117 - <view class="coupon-mes flex-vertical">  
118 - <view>留言</view>  
119 - <view class="leave-word">  
120 - <input placeholder-class="fs28" placeholder='给商家留言,最多100字'bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="100" name="user_note"></input>  
121 - 25 + <view class="set-mes bdr_b-14">
  26 + <view wx:if="{{order.store_prom}}">
  27 + <icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}}
122 </view> 28 </view>
123 </view> 29 </view>
  30 +
124 </block> 31 </block>
125 32
126 <view class="information bdr14"> 33 <view class="information bdr14">
127 - <!-----使用余额------>  
128 - <view class="set-mes" wx:if="{{userinfo.user_money>0 && yuer>0}}">  
129 - <view class="use-item" bindtap='set_bn_useyuer' style="padding-left:0;padding-right:0;">  
130 - <icon color="{{bn_use_money?'red':'gray'}}" size="16" type="success"></icon>  
131 - <view class="yu_er">使用余额 :¥{{yuer}} </view>  
132 - </view>  
133 - </view>  
134 <view class="item" wx:if="{{kt_type<3 || is_normal==1}}"> 34 <view class="item" wx:if="{{kt_type<3 || is_normal==1}}">
135 <view>商品金额</view> 35 <view>商品金额</view>
136 <view class="co-red">¥ {{formData.all_price}}元</view> 36 <view class="co-red">¥ {{formData.all_price}}元</view>
@@ -141,70 +41,15 @@ @@ -141,70 +41,15 @@
141 <view class="co-red">¥ {{formData.all_price}}元</view> 41 <view class="co-red">¥ {{formData.all_price}}元</view>
142 </view> 42 </view>
143 43
144 - <view class="item" wx:if="{{formData.shipping_price>0}}">  
145 - <view>配送费用</view>  
146 - <view class="co-red">¥ {{formData.shipping_price}}元</view>  
147 - </view>  
148 - <view class="item" wx:if="{{formData.user_money>0}}">  
149 - <view>使用余额</view>  
150 - <view class="co-red">- ¥ {{formData.user_money}}元</view>  
151 - </view>  
152 -  
153 </view> 44 </view>
154 </view> 45 </view>
155 46
156 <view class="btn-wrap"> 47 <view class="btn-wrap">
157 <view class="pay-amount"> 48 <view class="pay-amount">
158 <view class="payable">应付金额:<text class="co-red">¥{{formData.order_amount}}</text></view> 49 <view class="payable">应付金额:<text class="co-red">¥{{formData.order_amount}}</text></view>
159 - <!-- <view class="co-red big"></view> -->  
160 </view> 50 </view>
161 <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button> 51 <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button>
162 </view> 52 </view>
163 </form> 53 </form>
164 54
165 -<!----弹起选择物流名的列表---->  
166 -<view wx:if='{{open_express==1}}' >  
167 - <view class="cover-layer flex-center " bindtap='close_express'>  
168 - </view>  
169 -  
170 - <view class="cx-popup radius {{open_express==1?'up' : 'down'}}" >  
171 - <view class="tops flex">  
172 - <view class="top-content fs32">  
173 - <view>  
174 - 选择物流名字  
175 - </view>  
176 - </view>  
177 - <view class="close-frame" bindtap='close_express' >  
178 - <view class="xc-close-express">×</view>  
179 - </view>  
180 - </view>  
181 - <view class="express_list">  
182 - <view wx:for="{{wu_arr}}" wx:for-item="express_list" wx:for-index="idx">  
183 - <view class="express_list_frame" bindtap="click_express_name"  
184 - data-shippingcode="{{express_list.shipping_code}}"  
185 - data-name="{{express_list.name}}" data-idxe="{{idx}}">  
186 -  
187 - <block wx:if="{{is_express==idx}}">  
188 - <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view>  
189 - </block>  
190 - <block wx:else>  
191 - <view class="circle xc-hooks"></view>  
192 - </block>  
193 - <view class="fs30">{{express_list.name}}</view>  
194 -  
195 - </view>  
196 - </view>  
197 - </view>  
198 - <view class="flex click-buttem" >  
199 - <view class="xc-determine flex-center" bindtap="determine_expres">  
200 - <view class="flex-vertical t-c">确定</view>  
201 - </view>  
202 - <view class="xc-confirms flex-center" bindtap="select_default_logistics">  
203 - <view class="flex-vertical t-c">设为默认</view>  
204 - </view>  
205 - </view>  
206 -  
207 - </view >  
208 -</view>  
209 -  
210 <warn id="warn"></warn> 55 <warn id="warn"></warn>