Commit 9d2f981ee2c1fcd5287d01d8549a193afcb509de
1 parent
e80b5721
1、拼团成功后跳转
2、参看拼团中的列表的优化
Showing
7 changed files
with
361 additions
and
7 deletions
app.json
| ... | ... | @@ -116,10 +116,12 @@ |
| 116 | 116 | "pages/cart2_ser/cart2_ser", |
| 117 | 117 | "pages/libao_payment/payment", |
| 118 | 118 | "pages/details_serviceCard/details_serviceCard", |
| 119 | - "pages/serviceCard_pd/goodsInfo/goodsInfo", | |
| 120 | - "pages/serviceCard_pd/team_show/team_show", | |
| 121 | - "pages/serviceCard_pd/cart/cart", | |
| 122 | - "pages/serviceCard_pd/team_success/team_success" | |
| 119 | + "pages/serviceCard_pd/goodsInfo/goodsInfo", | |
| 120 | + "pages/serviceCard_pd/team_show/team_show", | |
| 121 | + "pages/serviceCard_pd/cart/cart", | |
| 122 | + "pages/serviceCard_pd/team_success/team_success", | |
| 123 | + "pages/serviceCard_pd/cart_wk/cart_wk", | |
| 124 | + "pages/serviceCard_pd/team_more/team_more" | |
| 123 | 125 | ] |
| 124 | 126 | }, |
| 125 | 127 | { | ... | ... |
packageA/pages/serviceCard_pd/team_more/team_more.js
0 → 100644
| 1 | +var t = getApp(), a = t.request, o = t.globalData.setting, os = o, | |
| 2 | + i = require("../../../../utils/util.js"), ut = i, s = require("../../../../utils/common.js"); | |
| 3 | +var regeneratorRuntime = require('../../../../utils/runtime.js'); | |
| 4 | + | |
| 5 | + | |
| 6 | +Page({ | |
| 7 | + data: { | |
| 8 | + ylburl: "https://mshopimg.yolipai.net/",//有礼派图片地址 | |
| 9 | + pt_act: null,//拼单数据 | |
| 10 | + baseUrl: "/api/weshop/teamgroup/page?1=1", | |
| 11 | + resourceUrl: t.globalData.setting.resourceUrl, | |
| 12 | + currentPage: 1, | |
| 13 | + requestData: null, | |
| 14 | + store_id: 1, | |
| 15 | + team_id:0, | |
| 16 | + requestUrl: "", | |
| 17 | + teamgroup:null, | |
| 18 | + }, | |
| 19 | + | |
| 20 | + onLoad: function (t) { | |
| 21 | + | |
| 22 | + wx.setNavigationBarTitle({ title: "开团列表", }) | |
| 23 | + | |
| 24 | + var th=this; | |
| 25 | + //初始化加載更多 | |
| 26 | + th.data.requestData=new Array(); | |
| 27 | + var team_id=t.team_id; | |
| 28 | + var teamlist=null; | |
| 29 | + th.data.team_id = team_id; | |
| 30 | + | |
| 31 | + //获取活动表的ct_num | |
| 32 | + getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + team_id, { | |
| 33 | + data: {} | |
| 34 | + }).then(res => { | |
| 35 | + if (res.data.code == 0) { | |
| 36 | + teamlist = res.data.data; | |
| 37 | + var jt_team_num=teamlist.ct_rylist; | |
| 38 | + if (jt_team_num != "" && jt_team_num != null && jt_team_num!= undefined) { | |
| 39 | + var team_num_arr = JSON.parse(jt_team_num); | |
| 40 | + var max_num = 0; | |
| 41 | + team_num_arr.forEach(function (val, ind) { | |
| 42 | + if (val.rynum > max_num) max_num = val.rynum; | |
| 43 | + }) | |
| 44 | + teamlist.max_num = max_num; | |
| 45 | + } | |
| 46 | + | |
| 47 | + th.setData({ pt_act: teamlist }); | |
| 48 | + th.init(team_id); | |
| 49 | + } | |
| 50 | + }) | |
| 51 | + }, | |
| 52 | + | |
| 53 | + //加载更多的函数 | |
| 54 | + async init(team_id) { | |
| 55 | + | |
| 56 | + var teamgroup_arr = [];//活動从表 | |
| 57 | + var teamgroup = null,//活動从表 | |
| 58 | + user = null, | |
| 59 | + ee = this, th=ee, | |
| 60 | + pt_status = 1;//已支付 | |
| 61 | + | |
| 62 | + var req_data={ | |
| 63 | + store_id: os.stoid, pageSize:6,page:ee.data.currentPage, | |
| 64 | + state: 2, team_id: team_id,ordernum:1 | |
| 65 | + } | |
| 66 | + | |
| 67 | + if(this.data.pt_act.kttype==3 && this.data.pt_act.max_num){ | |
| 68 | + req_data.max_num=this.data.pt_act.max_num; | |
| 69 | + } | |
| 70 | + | |
| 71 | + | |
| 72 | + //获取活动从表信息team_id | |
| 73 | + await getApp().request.promiseGet("/api/weshop/teamgroup/page", { | |
| 74 | + data: req_data | |
| 75 | + }).then(res => { | |
| 76 | + if(ut.ajax_ok(res)){ | |
| 77 | + teamgroup = res.data.data.pageData; | |
| 78 | + console.log(teamgroup); | |
| 79 | + ee.data.currentPage++; | |
| 80 | + } | |
| 81 | + | |
| 82 | + }) | |
| 83 | + | |
| 84 | + //获取订单的总数这个接口不能用 | |
| 85 | + for (i = 0; i < teamgroup.length; i++) { | |
| 86 | + await getApp().request.promiseGet("/api/weshop/rechargeServicelist/page", { | |
| 87 | + data: { store_id: os.stoid, pt_status: 1, pt_listno: teamgroup[i].listno } | |
| 88 | + }).then(res => { | |
| 89 | + if(ut.ajax_ok(res)){ | |
| 90 | + var order = res.data.data.pageData; | |
| 91 | + teamgroup[i].open_num = order.length; | |
| 92 | + } | |
| 93 | + }) | |
| 94 | + | |
| 95 | + if(!teamgroup[i].open_num) continue; | |
| 96 | + | |
| 97 | + await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + teamgroup[i].openvipid, { | |
| 98 | + }).then(res => { | |
| 99 | + var user = res.data.data; | |
| 100 | + teamgroup[i].user = user; | |
| 101 | + }) | |
| 102 | + | |
| 103 | + teamgroup_arr.push(teamgroup[i]); | |
| 104 | + } | |
| 105 | + // //设置值 | |
| 106 | + // for(var ii=0;ii<teamgroup.length;ii++){ | |
| 107 | + // th.data.requestData.push(teamgroup[ii]); | |
| 108 | + // } | |
| 109 | + if(teamgroup_arr.length){ | |
| 110 | + th.setData({ teamgroup: teamgroup_arr}); | |
| 111 | + ee.countDown2(); | |
| 112 | + } | |
| 113 | + }, | |
| 114 | + //滚动到底部 | |
| 115 | + onReachBottom: function () { | |
| 116 | + this.init(th.data.team_id); | |
| 117 | + }, | |
| 118 | + | |
| 119 | + resetData: function () { | |
| 120 | + n.resetConfig(), this.data.teamgroup = null, this.data.currentPage = 1; | |
| 121 | + }, | |
| 122 | + | |
| 123 | + //---小于10的格式化函数---- | |
| 124 | + timeFormat(param) { | |
| 125 | + return param < 10 ? '0' + param : param; | |
| 126 | + }, | |
| 127 | + | |
| 128 | + //----拼单倒计时函数----- | |
| 129 | + countDown2() { | |
| 130 | + var th = this; | |
| 131 | + // 获取当前时间,同时得到活动结束时间数组 | |
| 132 | + var newTime = ut.gettimestamp(); | |
| 133 | + var List = this.data.teamgroup; | |
| 134 | + if(!List || List.length<=0) return false; | |
| 135 | + | |
| 136 | + for (var j = 0; j < List.length; j++) { | |
| 137 | + // 对结束时间进行处理渲染到页面 | |
| 138 | + var endTime = List[j].kt_end_time; | |
| 139 | + let obj = null; | |
| 140 | + // 如果活动未结束,对时间进行处理 | |
| 141 | + if (endTime - newTime > 0) { | |
| 142 | + let time = (endTime - newTime); | |
| 143 | + // 获取天、时、分、秒 | |
| 144 | + let day = parseInt(time / (60 * 60 * 24)); | |
| 145 | + let hou = parseInt(time % (60 * 60 * 24) / 3600); | |
| 146 | + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60); | |
| 147 | + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); | |
| 148 | + obj = { | |
| 149 | + day: this.timeFormat(day), | |
| 150 | + hou: this.timeFormat(hou), | |
| 151 | + min: this.timeFormat(min), | |
| 152 | + sec: this.timeFormat(sec) | |
| 153 | + } | |
| 154 | + } else { | |
| 155 | + //活动已结束,全部设置为'00' | |
| 156 | + obj = { | |
| 157 | + day: '00', | |
| 158 | + hou: '00', | |
| 159 | + min: '00', | |
| 160 | + sec: '00' | |
| 161 | + } | |
| 162 | + } | |
| 163 | + var txt = "teamgroup[" + j + "].djs"; | |
| 164 | + th.setData({ | |
| 165 | + [txt]: obj | |
| 166 | + }); | |
| 167 | + } | |
| 168 | + | |
| 169 | + setTimeout(th.countDown2, 1000); | |
| 170 | + }, | |
| 171 | + | |
| 172 | + //--跳转到加载更多-- | |
| 173 | + go_team_show:function (e) { | |
| 174 | + | |
| 175 | + var th=this; | |
| 176 | + var tid=e.currentTarget.dataset.tid; | |
| 177 | + var team_id=e.currentTarget.dataset.team_id; | |
| 178 | + var oo=getApp().globalData; | |
| 179 | + | |
| 180 | + getApp().request.get("/api/weshop/rechargeServicelist/page", { | |
| 181 | + data: { | |
| 182 | + prom_id: team_id, | |
| 183 | + user_id: oo.user_id, | |
| 184 | + store_id: os.stoid, | |
| 185 | + pageSize: 1, | |
| 186 | + page: 1 | |
| 187 | + }, | |
| 188 | + success: function(e) { | |
| 189 | + //--跳转到已经购买的情况-- | |
| 190 | + if (e.data.code == 0 && e.data.data.pageData.length > 0) { | |
| 191 | + var odr = e.data.data.pageData[0]; | |
| 192 | + //还未支付 | |
| 193 | + if (odr.pt_status == 0 && odr.order_status == 1) { | |
| 194 | + wx.navigateTo({ | |
| 195 | + url: "/packageA/pages/details_serviceCard/details_serviceCard/details_serviceCard?order_id=" + odr.order_id, | |
| 196 | + }); | |
| 197 | + }else if (odr.pt_status == 1 && odr.order_status == 1){ | |
| 198 | + wx.navigateTo({ | |
| 199 | + url: "/packageA/pages/serviceCard_pd/team_success/team_success?ordersn=" + odr.order_sn, | |
| 200 | + }); | |
| 201 | + } | |
| 202 | + } | |
| 203 | + //--跳转到参团-- | |
| 204 | + else if(e.data.code == 0){ | |
| 205 | + wx.navigateTo({ | |
| 206 | + url: "/packageA/pages/serviceCard_pd/team_show/team_show?tg_id="+tid+"&goods_id="+th.data.pt_act.goods_id, | |
| 207 | + }); | |
| 208 | + } | |
| 209 | + | |
| 210 | + } | |
| 211 | + }); | |
| 212 | + | |
| 213 | + } | |
| 214 | + | |
| 215 | +}) | |
| 0 | 216 | \ No newline at end of file | ... | ... |
packageA/pages/serviceCard_pd/team_more/team_more.json
0 → 100644
packageA/pages/serviceCard_pd/team_more/team_more.wxml
0 → 100644
| 1 | +<!--//选项框--> | |
| 2 | +<block wx:for="{{teamgroup}}"> | |
| 3 | +<view class='group' wx:if="{{item.open_num>0}}"> | |
| 4 | + <view class='group-list' bindtap="go_team_show" data-tid="{{item.id}}" data-team_id="{{item.team_id}}" > | |
| 5 | + <!--//选项框头像--> | |
| 6 | + <view class='gtou' > | |
| 7 | + <image src='{{item.user.head_pic}}'></image> | |
| 8 | + </view> | |
| 9 | + <!--//等你来拼--> | |
| 10 | + <view class='gdn'>等你来拼 (^_^)</view> | |
| 11 | + <!--//还差几人,剩余时间--> | |
| 12 | + <view class='ghaicha'> | |
| 13 | + <text class='gred' wx:if="{{pt_act.max_num}}"> | |
| 14 | + <text wx:if="prom_act.max_num - item.open_num>0">还差{{pt_act.max_num - item.open_num}}人享最低优惠</text> | |
| 15 | + <text wx:else>您已经享最低优惠</text> | |
| 16 | + </text> | |
| 17 | + <text class='gred' wx:else>还差{{pt_act.ct_num - item.open_num}}人成团</text> | |
| 18 | + <view> | |
| 19 | + <view class="time_show_view"> | |
| 20 | + 剩余 | |
| 21 | + <text wx:if="{{item.djs.day}}">{{item.djs.day}}天:</text> | |
| 22 | + <text>{{item.djs.hou}}</text>: | |
| 23 | + <text>{{item.djs.min}}</text>: | |
| 24 | + <text>{{item.djs.sec}}</text>结束 | |
| 25 | + </view> | |
| 26 | + </view> | |
| 27 | + | |
| 28 | + </view> | |
| 29 | + <!--//参加团--> | |
| 30 | + <view class='cjt'> | |
| 31 | + <navigator>去参团 ></navigator> | |
| 32 | + </view> | |
| 33 | + <view class="clear"></view> | |
| 34 | + </view> | |
| 35 | +</view> | |
| 36 | +</block> | |
| 0 | 37 | \ No newline at end of file | ... | ... |
packageA/pages/serviceCard_pd/team_more/team_more.wxss
0 → 100644
| 1 | +/* pages/team/team_more/team_more.wxss */ | |
| 2 | + | |
| 3 | +/* pages/team/test.wxss */ | |
| 4 | + | |
| 5 | +page { | |
| 6 | + background-color: white; | |
| 7 | +} | |
| 8 | + | |
| 9 | +.top { | |
| 10 | + background-color: white; | |
| 11 | + width: 100%; | |
| 12 | + height: 100rpx; | |
| 13 | + font-size: 32rpx; | |
| 14 | + border-bottom: 2rpx #e5e5e5 solid; | |
| 15 | + padding-left: 4rpx; | |
| 16 | + padding-right: 4rpx; | |
| 17 | +} | |
| 18 | + | |
| 19 | +.group { | |
| 20 | + width: 100%; | |
| 21 | + margin-top: 20rpx; | |
| 22 | + min-height: 108rpx; | |
| 23 | +} | |
| 24 | + | |
| 25 | +.group .group-list { | |
| 26 | + border: 1rpx #f48886 solid; | |
| 27 | + border-radius: 200rpx; | |
| 28 | + height: 90rpx; | |
| 29 | + width: 720rpx; | |
| 30 | + margin-left: 15rpx; | |
| 31 | + overflow: hidden; | |
| 32 | + display: flex; | |
| 33 | + position: relative; | |
| 34 | +} | |
| 35 | + | |
| 36 | +.group .group-list .gtou { | |
| 37 | + width: 80rpx; | |
| 38 | + height: 80rpx; | |
| 39 | + top: 6rpx; | |
| 40 | +} | |
| 41 | + | |
| 42 | +.group .group-list .gtou image { | |
| 43 | + width: 80rpx; | |
| 44 | + height: 80rpx; | |
| 45 | + border-radius: 200rpx; | |
| 46 | + background-color: green; | |
| 47 | +} | |
| 48 | + | |
| 49 | +.group .group-list .gdn { | |
| 50 | + font-size: 24rpx; | |
| 51 | + line-height: 48rpx; | |
| 52 | + height: 48rpx; | |
| 53 | + width: 168rpx; | |
| 54 | + color: #8f8f94; | |
| 55 | + margin-left: 15rpx; | |
| 56 | +} | |
| 57 | + | |
| 58 | +.group .group-list .ghaicha { | |
| 59 | + text-align: right; | |
| 60 | + width: 320rpx; | |
| 61 | + height: 96rpx; | |
| 62 | + font-size: 24rpx; | |
| 63 | + overflow: hidden; | |
| 64 | +} | |
| 65 | + | |
| 66 | +.group .group-list .ghaicha .gred { | |
| 67 | + height: 48rpx; | |
| 68 | + line-height: 48rpx; | |
| 69 | + color: red; | |
| 70 | + width: 300rpx; | |
| 71 | +} | |
| 72 | + | |
| 73 | + | |
| 74 | +.group .group-list .cjt { | |
| 75 | + height: 86rpx; | |
| 76 | + width: 120rpx; | |
| 77 | + position: absolute; | |
| 78 | + right: 0; | |
| 79 | + top: 0; | |
| 80 | + border-radius: 0 100rpx 100rpx 0; | |
| 81 | + line-height: 86rpx; | |
| 82 | + font-size: 24rpx; | |
| 83 | + color: #fff; | |
| 84 | + border: 2rpx solid #dd524d; | |
| 85 | + background-color: #dd524d; | |
| 86 | +} | |
| 87 | + | |
| 88 | +.gbody { | |
| 89 | + background-color: white; | |
| 90 | +} | |
| 91 | +.time_show_view{ height: 40rpx; line-height: 40rpx; color: #8f8f94; } | ... | ... |
pages/cart/cart_wk/cart_wk.js
| ... | ... | @@ -311,6 +311,7 @@ Page({ |
| 311 | 311 | jsarr.forEach(function (value, index) { |
| 312 | 312 | if (count >= value['rynum']) price = value['price']; |
| 313 | 313 | }) |
| 314 | + | |
| 314 | 315 | var tail_money = (price * order_goods.goods_num - order['order_amount'] - order['user_money']).toFixed(2); |
| 315 | 316 | |
| 316 | 317 | tail_money = parseFloat(tail_money); | ... | ... |
pages/user/order_list/order_list.wxml
| ... | ... | @@ -312,12 +312,16 @@ |
| 312 | 312 | <block wx:if="{{item.prom_type==6}}"> |
| 313 | 313 | <block wx:if="{{item.pt_status==0}}" >未支付</block> |
| 314 | 314 | <block wx:if="{{item.pt_status==1}}" >组团中</block> |
| 315 | - <block wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">待支付尾款</block> | |
| 315 | + | |
| 316 | 316 | </block> |
| 317 | 317 | <block wx:else> |
| 318 | 318 | 待支付 |
| 319 | 319 | </block> |
| 320 | 320 | </view> |
| 321 | + <view wx:if="{{item.order_status<2}}"> | |
| 322 | + <block wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">待支付尾款</block> | |
| 323 | + </view> | |
| 324 | + | |
| 321 | 325 | <view wx:if="{{item.order_status == 1 && item.pay_status==1}}" class="flex-center">待评价 |
| 322 | 326 | <view class="lin"></view> |
| 323 | 327 | <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" |
| ... | ... | @@ -422,10 +426,12 @@ |
| 422 | 426 | |
| 423 | 427 | <navigator class="commodity_To_evaluate flex-level comment_go" |
| 424 | 428 | bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type==6 && item.pt_status==0}}">立即支付</navigator> |
| 425 | - | |
| 426 | 429 | |
| 430 | + <navigator class="commodity_To_evaluate flex-level comment_go" url="/packageA/pages/serviceCard_pd/cart_wk/cart_wk?order_id={{item.order_id}}" | |
| 431 | + data-idx="{{index}}" wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">支付尾款</navigator> | |
| 427 | 432 | |
| 428 | - </view> | |
| 433 | + | |
| 434 | + </view> | |
| 429 | 435 | </view> |
| 430 | 436 | </view> |
| 431 | 437 | </view> | ... | ... |