Commit df08707d31149de42089dda9e371359fcd41929f

Authored by 后端开发-许程
1 parent a234c286

助力

pages/user/assistance/assistance_success.json
1 { 1 {
  2 + "navigationBarTitleText": "好友助力,得好礼",
  3 + "navigationStyle": "custom",
2 "usingComponents": { 4 "usingComponents": {
3 "warn": "/components/long_warn/long_warn", 5 "warn": "/components/long_warn/long_warn",
4 "my_confirm": "/components/my_confirm/my_confirm", 6 "my_confirm": "/components/my_confirm/my_confirm",
pages/user/assistance/friend_assistance.js
@@ -131,7 +131,7 @@ Page({ @@ -131,7 +131,7 @@ Page({
131 var th = this; 131 var th = this;
132 var nav_b = th.selectComponent("#nav_b"); //组件的id 132 var nav_b = th.selectComponent("#nav_b"); //组件的id
133 nav_b.close_box(); 133 nav_b.close_box();
134 - nav_b.set_name("助力", ""); 134 + nav_b.set_name("助力", "/pages/user/assistance/assistance");
135 }, 135 },
136 136
137 /** 137 /**
pages/user/assistance/friend_assistance.json
1 { 1 {
  2 + "navigationBarTitleText": "好友助力,得好礼",
  3 + "navigationStyle": "custom",
2 "usingComponents": { 4 "usingComponents": {
3 "warn": "/components/long_warn/long_warn", 5 "warn": "/components/long_warn/long_warn",
4 "my_confirm": "/components/my_confirm/my_confirm", 6 "my_confirm": "/components/my_confirm/my_confirm",
pages/user/assistance/task_assistance.js
@@ -32,6 +32,10 @@ Page({ @@ -32,6 +32,10 @@ Page({
32 dismantle: null, //帮拆记录数据集 32 dismantle: null, //帮拆记录数据集
33 is_user_task: null, //判断是不是领取的任务 33 is_user_task: null, //判断是不是领取的任务
34 zzjx_id: "", //真正进行的任务id 34 zzjx_id: "", //真正进行的任务id
  35 + is_show:0,//任务的加载更多
  36 + is_bc_show:0,//帮拆的加载更多
  37 + bc_page:1,//帮拆的页码
  38 + rw_page:1,//任务的页码
35 //*********************************************start钱 39 //*********************************************start钱
36 canvasHidden: 0, //分享图片是否已经生成 40 canvasHidden: 0, //分享图片是否已经生成
37 is_share: 0, //是否显示画布 41 is_share: 0, //是否显示画布
@@ -77,7 +81,6 @@ Page({ @@ -77,7 +81,6 @@ Page({
77 add_onlicke: function(e) { 81 add_onlicke: function(e) {
78 var th = this; 82 var th = this;
79 var taskid = e.target.dataset.taskid; 83 var taskid = e.target.dataset.taskid;
80 - console.log("任务id5555555", taskid);  
81 var help_id = th.data.help_id; 84 var help_id = th.data.help_id;
82 var user_id = getApp().globalData.user_id; 85 var user_id = getApp().globalData.user_id;
83 var stoid = os.stoid 86 var stoid = os.stoid
@@ -88,10 +91,12 @@ Page({ @@ -88,10 +91,12 @@ Page({
88 taskId: taskid 91 taskId: taskid
89 }, 92 },
90 function(res) { 93 function(res) {
91 -  
92 if (res.data.code == 0) { 94 if (res.data.code == 0) {
93 - console.log(res.data.data);  
94 getApp().my_warnning(res.data.data, 1, th); 95 getApp().my_warnning(res.data.data, 1, th);
  96 + //判断是不是领取的任务
  97 + th.get_user_task();
  98 + //会员任务列表
  99 + th.user_task_list();
95 } else { 100 } else {
96 getApp().my_warnning(res.data.msg, 0, th); 101 getApp().my_warnning(res.data.msg, 0, th);
97 } 102 }
@@ -127,17 +132,18 @@ Page({ @@ -127,17 +132,18 @@ Page({
127 }, 132 },
128 success: function(res) { 133 success: function(res) {
129 if (res.data.code == 0) { 134 if (res.data.code == 0) {
130 -  
131 var help_data = res.data.data; 135 var help_data = res.data.data;
132 - console.log('助力活动(判断)', res.data.data);  
133 th.setData({ 136 th.setData({
134 endDate: help_data.endDate, 137 endDate: help_data.endDate,
135 }); 138 });
136 139
137 //任务时间 设置全局定时器 140 //任务时间 设置全局定时器
138 - th.data.timer = setInterval(function() {  
139 - th.countDown();  
140 - }, 1000); 141 + th.setData({
  142 + timer:setInterval(function () {
  143 + th.countDown();
  144 + }, 1000)
  145 + })
  146 +
141 147
142 } 148 }
143 } 149 }
@@ -194,7 +200,7 @@ Page({ @@ -194,7 +200,7 @@ Page({
194 200
195 //会员任务列表 201 //会员任务列表
196 this.user_task_list(); 202 this.user_task_list();
197 - // 获取会员的参与的任务列表 我的任务 203 + //获取助力活动参与的人数
198 this.get_user_task_num(); 204 this.get_user_task_num();
199 205
200 }, 206 },
@@ -210,7 +216,6 @@ Page({ @@ -210,7 +216,6 @@ Page({
210 var sw_index = this.data.sw_index; //轮播的下标 216 var sw_index = this.data.sw_index; //轮播的下标
211 //任务id 217 //任务id
212 var taskid = aitem[sw_index].id; 218 var taskid = aitem[sw_index].id;
213 - console.log("任务id", taskid);  
214 var th = this; 219 var th = this;
215 var index = 1; //获取当前选择的是任务还是活动说明 220 var index = 1; //获取当前选择的是任务还是活动说明
216 var is_task = this.data.is_task; //0任务,1帮拆 221 var is_task = this.data.is_task; //0任务,1帮拆
@@ -221,24 +226,31 @@ Page({ @@ -221,24 +226,31 @@ Page({
221 if (switch_head == undefined || switch_head == null) { 226 if (switch_head == undefined || switch_head == null) {
222 switch_head = 1; 227 switch_head = 1;
223 } 228 }
224 -  
225 - console.log("0任务,1帮拆", is_task, );  
226 this.setData({ 229 this.setData({
227 is_task: 1, 230 is_task: 1,
228 switch_head: 1 231 switch_head: 1
229 }); 232 });
  233 + var bc_page = th.data.bc_page;
230 rq.get("/api/weshop/marketing/help/help/task/involve/page", { 234 rq.get("/api/weshop/marketing/help/help/task/involve/page", {
231 data: { 235 data: {
  236 + page: bc_page,
  237 + pageSize: 5,
232 taskId: taskid, 238 taskId: taskid,
233 userId: getApp().globalData.user_id, 239 userId: getApp().globalData.user_id,
234 storeId: os.stoid 240 storeId: os.stoid
235 }, 241 },
236 success: function(res) { 242 success: function(res) {
237 -  
238 if (res.data.code == 0) { 243 if (res.data.code == 0) {
239 var dismantle = res.data.data.pageData[0].zlHelpUser; 244 var dismantle = res.data.data.pageData[0].zlHelpUser;
240 - console.log(dismantle.toString, "帮拆记录", dismantle[0].nickName);  
241 - 245 + if(res.data.data.total>5){
  246 + var bc_page = th.data.bc_page + 1;
  247 + th.data({ bc_page: bc_page,
  248 + is_bc_show:1
  249 + })
  250 + }else{
  251 + getApp().showWarning("暂无更多内容", 0);
  252 + }
  253 +
242 th.setData({ 254 th.setData({
243 dismantle: dismantle 255 dismantle: dismantle
244 }); 256 });
@@ -292,13 +304,11 @@ Page({ @@ -292,13 +304,11 @@ Page({
292 var th = this; 304 var th = this;
293 var nav_b = th.selectComponent("#nav_b"); //组件的id 305 var nav_b = th.selectComponent("#nav_b"); //组件的id
294 nav_b.close_box(); 306 nav_b.close_box();
295 - nav_b.set_name("助力", ""); 307 + nav_b.set_name("助力", "/pages/user/assistance/assistance");
296 }, 308 },
297 // 获取会员的参与的任务列表 我的任务 309 // 获取会员的参与的任务列表 我的任务
298 user_task_list: function(e) { 310 user_task_list: function(e) {
299 -  
300 var th = this; 311 var th = this;
301 -  
302 var index = 0; 312 var index = 0;
303 var is_task = this.data.is_task; //0任务,1帮拆 313 var is_task = this.data.is_task; //0任务,1帮拆
304 if (is_task == undefined || is_task == null) { 314 if (is_task == undefined || is_task == null) {
@@ -314,24 +324,34 @@ Page({ @@ -314,24 +324,34 @@ Page({
314 }); 324 });
315 var help_id = th.data.help_id; 325 var help_id = th.data.help_id;
316 var user_id = getApp().globalData.user_id; 326 var user_id = getApp().globalData.user_id;
  327 + var rw_page=th.data.rw_page;
317 rq.get("/api/weshop/marketing/help/help/user/page", { 328 rq.get("/api/weshop/marketing/help/help/user/page", {
318 data: { 329 data: {
  330 + page:rw_page,
  331 + pageSize:5,
319 helpId: help_id, 332 helpId: help_id,
320 storeId: os.stoid, 333 storeId: os.stoid,
321 userId: user_id 334 userId: user_id
322 }, 335 },
323 success: function(su) { 336 success: function(su) {
324 -  
325 if (su.data.code == 0) { 337 if (su.data.code == 0) {
  338 + if (su.data.data.total > 5){
  339 + th.setData({
  340 + rw_page: rw_page,
  341 + is_show: 1
  342 + })
  343 + getApp().showWarning("暂无更多内容", 0);
  344 + }else{
  345 + var rw_page = th.data.rw_page + 1;
  346 + th.setData({
  347 + rw_page: rw_page,
  348 +
  349 + })
  350 + }
326 var user_list = su.data.data.pageData; 351 var user_list = su.data.data.pageData;
327 - console.log("会员列表", user_list);  
328 th.setData({ 352 th.setData({
329 user_task_list: user_list 353 user_task_list: user_list
330 }); 354 });
331 - } else {  
332 - th.setData({  
333 - user_task_list: null  
334 - });  
335 } 355 }
336 } 356 }
337 }) 357 })
@@ -342,9 +362,7 @@ Page({ @@ -342,9 +362,7 @@ Page({
342 var th = this; 362 var th = this;
343 var aitem = th.data.aitem; 363 var aitem = th.data.aitem;
344 var sw_index = th.data.sw_index; 364 var sw_index = th.data.sw_index;
345 - console.log(sw_index, "判断是否有领取任务", aitem);  
346 var taskid = aitem[sw_index].id 365 var taskid = aitem[sw_index].id
347 - console.log("判断是否有领取任务 任务的id", taskid);  
348 rq.get("/api/weshop/marketing/help/help/task/get", { 366 rq.get("/api/weshop/marketing/help/help/task/get", {
349 data: { 367 data: {
350 storeId: os.stoid, 368 storeId: os.stoid,
@@ -354,7 +372,6 @@ Page({ @@ -354,7 +372,6 @@ Page({
354 success: function(res) { 372 success: function(res) {
355 if (res.data.code == 0) { 373 if (res.data.code == 0) {
356 var is_usertask = res.data.data; 374 var is_usertask = res.data.data;
357 - console.log('判断是不是领取的任务', is_usertask);  
358 th.setData({ 375 th.setData({
359 is_user_task: is_usertask 376 is_user_task: is_usertask
360 }); 377 });
@@ -424,7 +441,6 @@ Page({ @@ -424,7 +441,6 @@ Page({
424 var aitem = this.data.aitem; 441 var aitem = this.data.aitem;
425 var task_number = aitem[index].giftQty - aitem[index].useGiftQty; 442 var task_number = aitem[index].giftQty - aitem[index].useGiftQty;
426 var task_id = aitem[index].id; 443 var task_id = aitem[index].id;
427 - console.log("轮播图点击左边");  
428 this.setData({ 444 this.setData({
429 sw_index: index, 445 sw_index: index,
430 task_number: task_number, 446 task_number: task_number,
@@ -446,7 +462,6 @@ Page({ @@ -446,7 +462,6 @@ Page({
446 var aitem = this.data.aitem; 462 var aitem = this.data.aitem;
447 var task_number = aitem[index].giftQty - aitem[index].useGiftQty; 463 var task_number = aitem[index].giftQty - aitem[index].useGiftQty;
448 var task_id = aitem[index].id; 464 var task_id = aitem[index].id;
449 - console.log("轮播图点击右边");  
450 this.setData({ 465 this.setData({
451 sw_index: index, 466 sw_index: index,
452 task_number: task_number, 467 task_number: task_number,
@@ -462,8 +477,7 @@ Page({ @@ -462,8 +477,7 @@ Page({
462 */ 477 */
463 onHide: function() { 478 onHide: function() {
464 //--清理定时器-- 479 //--清理定时器--
465 - console.log("清理定时器");  
466 - clearInterval(this.timer); 480 + clearInterval(this.data.timer);
467 }, 481 },
468 482
469 /** 483 /**
@@ -489,14 +503,13 @@ Page({ @@ -489,14 +503,13 @@ Page({
489 // 对结束时间进行处理渲染到页面 503 // 对结束时间进行处理渲染到页面
490 504
491 // var o = endTimeList[i]; 505 // var o = endTimeList[i];
492 - var endTime = th.data.endDate  
493 - 506 + var endTime = th.data.endDate;
  507 + console.log("结束时间5555555", endTime);
494 // if (o.status == 0) endTime = o.start_time 508 // if (o.status == 0) endTime = o.start_time
495 509
496 var obj = null; 510 var obj = null;
497 // 如果活动未结束,对时间进行处理 511 // 如果活动未结束,对时间进行处理
498 if (endTime - newTime > 0) { 512 if (endTime - newTime > 0) {
499 -  
500 var time = (endTime - newTime); 513 var time = (endTime - newTime);
501 // 获取天、时、分、秒 514 // 获取天、时、分、秒
502 var day = parseInt(time / (60 * 60 * 24)); 515 var day = parseInt(time / (60 * 60 * 24));
@@ -518,15 +531,10 @@ Page({ @@ -518,15 +531,10 @@ Page({
518 sec: '00' 531 sec: '00'
519 } 532 }
520 } 533 }
521 - 534 + var txt = "aitem[" +0+ "].djs";
522 th.setData({ 535 th.setData({
523 - djs: obj 536 + [txt]: obj
524 }); 537 });
525 -  
526 -  
527 -  
528 -  
529 -  
530 }, 538 },
531 //---小于10的格式化函数---- 539 //---小于10的格式化函数----
532 timeFormat(param) { 540 timeFormat(param) {
@@ -1032,7 +1040,8 @@ Page({ @@ -1032,7 +1040,8 @@ Page({
1032 //礼包的详情 轮播图 1040 //礼包的详情 轮播图
1033 libao_details: function(e) { 1041 libao_details: function(e) {
1034 var giftbagid = e.currentTarget.dataset.giftbagid; 1042 var giftbagid = e.currentTarget.dataset.giftbagid;
1035 - getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + giftbagid + "&is_libao=" + 0); 1043 + var help_id = this.data.help_id;
  1044 + getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + giftbagid + "&is_libao=" + 0+"help_id");
1036 }, 1045 },
1037 //正在进行任务 1046 //正在进行任务
1038 test: function(e) { 1047 test: function(e) {
pages/user/assistance/task_assistance.json
1 { 1 {
2 - "navigationBarTitleText": "好友助力", 2 + "navigationBarTitleText": "好友助力,得好礼",
3 "navigationStyle": "custom", 3 "navigationStyle": "custom",
4 "usingComponents": { 4 "usingComponents": {
5 "warn": "/components/long_warn/long_warn", 5 "warn": "/components/long_warn/long_warn",
pages/user/assistance/task_assistance.wxml
1 -<wxs module="filter" src="../../../utils/filter.wxs"></wxs> 1 + <wxs module="filter" src="../../../utils/filter.wxs"></wxs>
2 <view class="top-back" style="background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)"> 2 <view class="top-back" style="background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)">
3 <!-- 助力活动头部 --> 3 <!-- 助力活动头部 -->
4 <view class="top-frame"> 4 <view class="top-frame">
@@ -44,9 +44,9 @@ @@ -44,9 +44,9 @@
44 <view wx:if="{{is_user_task!=null}}" class="task_clike fs40 t-c flex-center" bindtap="save_share"> 44 <view wx:if="{{is_user_task!=null}}" class="task_clike fs40 t-c flex-center" bindtap="save_share">
45 好友拆一拆 45 好友拆一拆
46 </view> 46 </view>
47 - <view wx:if="{{is_user_task!=null}}" class="task_clike fs40 t-c flex-center"data-taskid="{{is_user_task.id}}" bindtap="test"> 47 + <!-- <view wx:if="{{is_user_task!=null}}" class="task_clike fs40 t-c flex-center"data-taskid="{{is_user_task.id}}" bindtap="test">
48 测试专用 48 测试专用
49 - </view> 49 + </view> -->
50 50
51 </view> 51 </view>
52 <!-- 底部列表 --> 52 <!-- 底部列表 -->
@@ -108,8 +108,13 @@ @@ -108,8 +108,13 @@
108 <view class="ellipsis-1">{{filter.format_time(item.zltime)}} 108 <view class="ellipsis-1">{{filter.format_time(item.zltime)}}
109 </view> 109 </view>
110 </view> 110 </view>
111 -  
112 </view> 111 </view>
  112 +
  113 + <view class="flex-center fs32" wx:if="{{is_bc_show==1}}">
  114 + <view class="line"></view>
  115 + <view class="load white" bindtap="dismantle_record">点击加载更多</view>
  116 + <view class="line"></view>
  117 + </view>
113 </block> 118 </block>
114 119
115 <view class="fs30" wx:if="{{dismantle==null|| dismantle==''}}"> 120 <view class="fs30" wx:if="{{dismantle==null|| dismantle==''}}">
@@ -124,9 +129,9 @@ @@ -124,9 +129,9 @@
124 </view> 129 </view>
125 <!-- 加载更多 --> 130 <!-- 加载更多 -->
126 <view class="fs32"> 131 <view class="fs32">
127 - <view class="flex-center" wx:if="{{user_task_list}}"> 132 + <view class="flex-center" wx:if="{{is_show==1}}">
128 <view class="line"></view> 133 <view class="line"></view>
129 - <view class="load white" bindtap="">点击加载更多</view> 134 + <view class="load white" bindtap="user_task_list">点击加载更多</view>
130 <view class="line"></view> 135 <view class="line"></view>
131 </view> 136 </view>
132 <view class="flex-center white" style="margin-top: 20rpx;"> 137 <view class="flex-center white" style="margin-top: 20rpx;">