Commit d045025c40bb7430447b9d68156152fd980cc030
1 parent
54d4cbb4
拼团列表,参团,购物车
Showing
5 changed files
with
31 additions
and
49 deletions
pages/cart/cart2/cart2.js
... | ... | @@ -121,8 +121,8 @@ Page({ |
121 | 121 | func(item); |
122 | 122 | } |
123 | 123 | }); |
124 | - | |
125 | 124 | }, |
125 | + | |
126 | 126 | //----------------展示页面,是再获取用户信息之后-------------- |
127 | 127 | show_page:function(){ |
128 | 128 | var th=this,ta = this.data.param; |
... | ... | @@ -306,6 +306,7 @@ Page({ |
306 | 306 | |
307 | 307 | switch (gd.prom_type){ |
308 | 308 | case 0: |
309 | + case 6: | |
309 | 310 | //--此时开始计算商品的使用券相关,如果有等级价还要计算和等级价相关的, |
310 | 311 | // 如果有优惠促销,还要把促销的部分计算在内,因为促销还有不能使用优惠券-- |
311 | 312 | ... | ... |
pages/team/team_ping/team_ping.js
... | ... | @@ -90,34 +90,34 @@ Page({ |
90 | 90 | order_goods=null;//订单商品表 |
91 | 91 | |
92 | 92 | //获取订单表的信息根据活动user_id,pt_prom_id>0 AND pay_time>0 |
93 | + /*--- | |
93 | 94 | await getApp().request.promiseGet("/api/weshop/order/page?"+where, { |
94 | 95 | data: { is_pt:1,store_id: os.stoid, user_id: user_id, pageSize: 6, page: this.data.currentPage,} |
95 | 96 | }).then(res => { |
96 | 97 | order = res.data.data.pageData; |
97 | 98 | this.data.currentPage++; |
99 | + })--*/ | |
100 | + | |
101 | + await getApp().request.promiseGet("/api/weshop/order/pageTuan?"+where, { | |
102 | + data: { is_pt:1,store_id: os.stoid, user_id: user_id, pageSize: 6, page: this.data.currentPage,} | |
103 | + }).then(res => { | |
104 | + order = res.data.data.pageData; | |
105 | + this.data.currentPage++; | |
98 | 106 | }) |
99 | 107 | |
108 | + | |
100 | 109 | wx.showLoading({ title: "加载中"}); |
101 | 110 | for (i = 0; i < order.length; i++) { |
102 | 111 | //获取订单从表信息 |
103 | - await getApp().request.promiseGet("/api/weshop/ordergoods/page", { | |
112 | + await getApp().request.promiseGet("/api/weshop/ordergoods/pageGoods", { | |
104 | 113 | data: { store_id: os.stoid, order_id: order[i].order_id } |
105 | 114 | }).then(res => { |
106 | 115 | order_goods = res.data.data.pageData; |
107 | 116 | order[i].order_goods = order_goods; |
117 | + order[i].gimage = ee.data.imageurl + order_goods[0].original_img; | |
108 | 118 | }) |
109 | 119 | |
110 | - for (var j = 0; j < order_goods.length;j++){ | |
111 | - //获取商品表信息 | |
112 | - await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + order_goods[j].goods_id, { | |
113 | - data: {} | |
114 | - }).then(res => { | |
115 | - goods = res.data.data; | |
116 | - order[i].goods = goods; | |
117 | - order[i].original_img = this.data.imageurl + goods.original_img; | |
118 | - }) | |
119 | - } | |
120 | - | |
120 | + | |
121 | 121 | //获取订单表信息根据上面查询的订单号order[i].pt_listno |
122 | 122 | await getApp().request.promiseGet("/api/weshop/order/pagePtList", { |
123 | 123 | data: { store_id: os.stoid, pt_listno: order[i].pt_listno,pageSize:60,page:1} |
... | ... | @@ -128,43 +128,19 @@ Page({ |
128 | 128 | order[i].tx=ordertx; |
129 | 129 | }) |
130 | 130 | |
131 | - var teamlist=null; | |
132 | - //获取团的信息 | |
133 | - await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + order[i].pt_prom_id,{ | |
134 | - 1:1 | |
135 | - }).then(res=>{ | |
136 | - teamlist=res.data.data; | |
137 | - order[i].ct_num=teamlist.ct_num; | |
138 | - }) | |
131 | + | |
139 | 132 | |
140 | - if (teamlist.kttype == 3) { | |
133 | + if (order[i].is_zsorder== 4) { | |
141 | 134 | var num = 0; |
142 | - var jt_data = JSON.parse(teamlist.ct_rylist); | |
135 | + var jt_data = JSON.parse(order[i].ct_rylist); | |
143 | 136 | for (var m in jt_data) { |
144 | 137 | if (jt_data[m].rynum > num) num = jt_data[m].rynum; |
145 | 138 | } |
146 | 139 | order[i].max_ct_num = num; |
147 | 140 | } |
148 | 141 | |
149 | - | |
150 | - var teamgroup=null; | |
151 | - //获取活动从表信息team_id:305暂时 | |
152 | - await getApp().request.promiseGet("/api/weshop/teamgroup/page" , { | |
153 | - data: { store_id: os.stoid, listno: order[i].pt_listno, team_id: order[i].pt_prom_id } | |
154 | - }).then(res => { | |
155 | - teamgroup = res.data.data.pageData[0]; | |
156 | - }) | |
157 | - | |
158 | - //--正在进行中的团,才有时间倒计时-- | |
159 | - if(teamgroup && teamgroup.state==2) { | |
160 | - order[i].kt_end_time = teamgroup.kt_end_time; | |
161 | - //---如果参团的人数没有3个人,则要体现沙发--- | |
162 | - order[i].tg_state = teamgroup.state; | |
163 | - | |
164 | - } | |
165 | - | |
166 | - var sf_num=teamlist.ct_num; | |
167 | - if(teamlist.ct_num>=3){ sf_num=3;} | |
142 | + var sf_num = order[i].ct_num; | |
143 | + if (order[i].ct_num>=3){ sf_num=3;} | |
168 | 144 | sf_num=sf_num-ordertx.length; |
169 | 145 | if(sf_num>0) { |
170 | 146 | var arr = []; |
... | ... | @@ -245,6 +221,13 @@ Page({ |
245 | 221 | return param < 10 ? '0' + param : param; |
246 | 222 | }, |
247 | 223 | |
224 | + images_err:function(e){ | |
225 | + var txt = e.currentTarget.dataset.err; | |
226 | + var ob={}; | |
227 | + ob[txt] = this.data.imageurl + "/miniapp/images/default_g_img.gif"; | |
228 | + this.setData(ob); | |
229 | + } | |
230 | + | |
248 | 231 | |
249 | 232 | }) |
250 | 233 | ... | ... |
pages/team/team_ping/team_ping.wxml
... | ... | @@ -22,13 +22,12 @@ |
22 | 22 | <view class='pd-list-image'> |
23 | 23 | <view class="xc-list flex"> |
24 | 24 | <view class="frame"> |
25 | - <image src='{{item.original_img}}'></image> | |
25 | + <image src='{{item.gimage}}' binderror='images_err' data-err="order[{{index}}].gimage"></image> | |
26 | 26 | </view> |
27 | 27 | <view> |
28 | 28 | <view class='pd-img-wz1 ellipsis-2'>{{item.goods.goods_name}} |
29 | 29 | </view> |
30 | 30 | |
31 | - | |
32 | 31 | |
33 | 32 | <view class="flex-space-between {{item.pt_status==1? 'xc-price-sn':'xc-price-no'}}"> |
34 | 33 | <view class="flex"> | ... | ... |
pages/team/team_ping/team_ping.wxss
... | ... | @@ -338,11 +338,8 @@ margin-bottom:40rpx; |
338 | 338 | color: #e4374d; |
339 | 339 | border-radius: 7rpx; |
340 | 340 | font-size: 25rpx; |
341 | - | |
342 | - letter-spacing:4; | |
343 | -margin-right:8rpx; | |
344 | - | |
345 | - | |
341 | + margin-right:8rpx; | |
342 | + line-height: 46rpx | |
346 | 343 | } |
347 | 344 | .xc-price-sn{ |
348 | 345 | height:73rpx; | ... | ... |
pages/team/team_show/team_show.js
... | ... | @@ -684,6 +684,8 @@ Page({ |
684 | 684 | pick_id: th.data.pick_id, |
685 | 685 | user_id: oo.user_id, |
686 | 686 | store_id: th.data.stoid, |
687 | + goods_name: th.data.goods.goods_name, | |
688 | + goods_sn: th.data.goods.goods_sn, | |
687 | 689 | }; |
688 | 690 | //-----拼团----- |
689 | 691 | newd.goods_price = th.data.teamlist.price; | ... | ... |