Commit 8c1a961a65c1ffb6d8dab06165c6255295e13cc7
1 parent
7d4ffcc7
会员中心 我的拼团裂隙 服务卡项的优化
Showing
2 changed files
with
67 additions
and
49 deletions
pages/team/team_ping/team_ping.js
| ... | ... | @@ -101,17 +101,18 @@ Page({ |
| 101 | 101 | |
| 102 | 102 | |
| 103 | 103 | wx.showLoading({ title: "加载中"}); |
| 104 | - for (i = 0; i < order.length; i++) { | |
| 104 | + if(order && order.length){ | |
| 105 | + for (i = 0; i < order.length; i++) { | |
| 105 | 106 | |
| 106 | - //获取teamgroup中的值 | |
| 107 | - await getApp().request.promiseGet("/api/weshop/teamgroup/page", { | |
| 108 | - data: { store_id: os.stoid, listno: order[i].pt_listno,pageSize:1,page:1} | |
| 109 | - }).then(res => { | |
| 110 | - team_g = res.data.data.pageData[0] | |
| 111 | - }) | |
| 107 | + //获取teamgroup中的值 | |
| 108 | + await getApp().request.promiseGet("/api/weshop/teamgroup/page", { | |
| 109 | + data: { store_id: os.stoid, listno: order[i].pt_listno,pageSize:1,page:1} | |
| 110 | + }).then(res => { | |
| 111 | + team_g = res.data.data.pageData[0] | |
| 112 | + }) | |
| 112 | 113 | |
| 113 | 114 | |
| 114 | - switch (team_g.goods_type){ | |
| 115 | + switch (team_g.goods_type){ | |
| 115 | 116 | case 0: |
| 116 | 117 | //获取订单从表信息 |
| 117 | 118 | await getApp().request.promiseGet("/api/weshop/ordergoods/pageGoods", { |
| ... | ... | @@ -142,75 +143,88 @@ Page({ |
| 142 | 143 | }) |
| 143 | 144 | break; |
| 144 | 145 | |
| 145 | - case 1: | |
| 146 | + case 1: | |
| 147 | + | |
| 148 | + order[i].goods_type=1; | |
| 149 | + order[i].pre_cut=0; | |
| 146 | 150 | |
| 147 | 151 | //获取order信息根据订单编号order_sn |
| 148 | 152 | await getApp().request.promiseGet("/api/weshop/rechargeServicelist/page", { |
| 149 | - data: { store_id: os.stoid, order_id: order.order_id,} | |
| 153 | + data: { store_id: os.stoid, order_id: order[i].order_id,} | |
| 150 | 154 | }).then(res => { |
| 151 | - order_goods = res.data.data.pageData[0]; | |
| 155 | + order_goods = res.data.data.pageData; | |
| 156 | + order_goods[0].goods_num=order_goods[0].qty; | |
| 157 | + order_goods[0].goods_price=order_goods[0].price; | |
| 152 | 158 | order[i].order_goods = order_goods; |
| 153 | - order[i].gimage = ee.data.imageurl + order_goods[0]?.original_img; | |
| 154 | 159 | }) |
| 155 | 160 | |
| 161 | + | |
| 162 | + //pt_tail_money 在从表 | |
| 163 | + order[i].pt_tail_money=order_goods[0].pt_tail_money; | |
| 164 | + | |
| 156 | 165 | //-- 获取商品信息 -- |
| 157 | - await getApp().request.promiseGet("/api/weshop/serviceCard/get/" + os.stoid + "/" + goods_id, { | |
| 166 | + await getApp().request.promiseGet("/api/weshop/serviceCard/get/" + os.stoid + "/" + order_goods[0].card_id, { | |
| 158 | 167 | }).then(res => { |
| 159 | - //-- 商品地址 -- | |
| 160 | - order[i].gimage = ee.data.imageurl + res.data.data.original_img | |
| 168 | + //-- 商品地址 -- | |
| 169 | + order[i].gimage = ee.data.imageurl + res.data.data.img_url | |
| 170 | + order_goods[0].goods_name= res.data.data.service_name; | |
| 161 | 171 | }) |
| 162 | 172 | |
| 163 | 173 | //-- 多少人参团头像 -- |
| 164 | 174 | await getApp().request.promiseGet("/api/weshop/rechargeServicelist/pagePtList", { |
| 165 | 175 | data: { |
| 166 | - store_id: o.stoid, | |
| 167 | - pt_listno: teamgroup.listno, | |
| 176 | + store_id: o.stoid, | |
| 177 | + pt_listno: team_g.listno, | |
| 168 | 178 | } |
| 169 | 179 | }).then(res => { |
| 170 | - ordertx = res.data.data.pageData; | |
| 171 | - order[i].tx=ordertx; | |
| 180 | + ordertx = res.data.data.pageData; | |
| 181 | + order[i].tx=ordertx; | |
| 172 | 182 | }) |
| 173 | 183 | |
| 174 | - break; | |
| 175 | - } | |
| 184 | + break; | |
| 185 | + } | |
| 176 | 186 | |
| 177 | 187 | |
| 178 | - if (order[i].is_zsorder== 4) { | |
| 179 | - var num = 0; | |
| 180 | - var jt_data = JSON.parse(order[i].ct_rylist); | |
| 181 | - for (var m in jt_data) { | |
| 182 | - if (jt_data[m].rynum > num) num = jt_data[m].rynum; | |
| 188 | + if (order[i].is_zsorder== 4) { | |
| 189 | + var num = 0; | |
| 190 | + var jt_data = JSON.parse(order[i].ct_rylist); | |
| 191 | + for (var m in jt_data) { | |
| 192 | + if (jt_data[m].rynum > num) num = jt_data[m].rynum; | |
| 193 | + } | |
| 194 | + order[i].max_ct_num = num; | |
| 183 | 195 | } |
| 184 | - order[i].max_ct_num = num; | |
| 185 | - } | |
| 186 | 196 | |
| 187 | - var head=[]; | |
| 188 | - if(team_g.is_xuni_ct) { | |
| 197 | + var head=[]; | |
| 198 | + if(team_g.is_xuni_ct) { | |
| 189 | 199 | head=team_g.xuni_head_id.split(","); |
| 190 | 200 | order[i].is_xuni_ct=1; |
| 191 | - } | |
| 201 | + } | |
| 202 | + | |
| 203 | + var sf_num = order[i].ct_num; | |
| 204 | + if (order[i].ct_num>=3){ sf_num=3;} | |
| 205 | + sf_num=sf_num-ordertx.length; | |
| 206 | + if(sf_num>0) { | |
| 207 | + var arr = []; | |
| 208 | + for(var j=0;j<sf_num;j++){ | |
| 209 | + if(team_g.is_xuni_ct){ | |
| 210 | + arr.push(head[j]); | |
| 211 | + }else{ | |
| 212 | + arr.push(j); | |
| 213 | + } | |
| 192 | 214 | |
| 193 | - var sf_num = order[i].ct_num; | |
| 194 | - if (order[i].ct_num>=3){ sf_num=3;} | |
| 195 | - sf_num=sf_num-ordertx.length; | |
| 196 | - if(sf_num>0) { | |
| 197 | - var arr = []; | |
| 198 | - for(var j=0;j<sf_num;j++){ | |
| 199 | - if(team_g.is_xuni_ct){ | |
| 200 | - arr.push(head[j]); | |
| 201 | - }else{ | |
| 202 | - arr.push(j); | |
| 203 | 215 | } |
| 204 | - | |
| 216 | + order[i].sf_num=arr; | |
| 205 | 217 | } |
| 206 | - order[i].sf_num=arr; | |
| 207 | - } | |
| 208 | 218 | |
| 219 | + } | |
| 220 | + //设置值 | |
| 221 | + for (var ii = 0; ii < order.length;ii++){ | |
| 222 | + this.data.requestData.push(order[ii]); | |
| 223 | + } | |
| 209 | 224 | } |
| 210 | - //设置值 | |
| 211 | - for (var ii = 0; ii < order.length;ii++){ | |
| 212 | - this.data.requestData.push(order[ii]); | |
| 213 | - } | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 214 | 228 | |
| 215 | 229 | wx.hideLoading(); |
| 216 | 230 | ee.setData({ order: this.data.requestData, ordertx: ordertx, isgo:1}); | ... | ... |
pages/team/team_ping/team_ping.wxml
| ... | ... | @@ -33,7 +33,11 @@ |
| 33 | 33 | <view class="flex"> |
| 34 | 34 | <text class='fs24 xc-wc {{item.pt_status==1?"xc-rmbs":"xc-rmb"}}'>¥</text> |
| 35 | 35 | <view class='pd-jg xc-wc'>{{item.order_goods[0].goods_price}}</view> |
| 36 | - <view class="flex no_line_c word-line xc-ash {{item.pt_status==1?'xc-rmbs':'xc-rmb'}}"><text class="fs24 xc-black"></text><text class="fs24 xc-wc">¥</text><text class="fs26 xc-wc">{{item.order_goods[0].shop_price || item.order_goods[0].market_price}}</text> </view> | |
| 36 | + <view hidden="{{item.goods_type}}" class="flex no_line_c word-line xc-ash {{item.pt_status==1?'xc-rmbs':'xc-rmb'}}"> | |
| 37 | + <text class="fs24 xc-black"></text> | |
| 38 | + <text class="fs24 xc-wc">¥</text> | |
| 39 | + <text class="fs26 xc-wc">{{item.order_goods[0].shop_price || item.order_goods[0].market_price}}</text> | |
| 40 | + </view> | |
| 37 | 41 | </view> |
| 38 | 42 | |
| 39 | 43 | <view class="xc-img-frame" wx:if="{{item.pt_status==2 || item.pt_status==4 || item.pt_status==5 || item.pt_status==6}}"> | ... | ... |