Commit d7453110532137beb59fe07767870da2ad451008

Authored by 后端研发-倪永富
1 parent 34e92776

1. 小程序,显示的是有3人领取任务,实际是2人。只是其中一人领取了两次任务。(ok)

2. 活动剩余时间实际是还有剩余29天23小时,29后面应该显示天 (小程序ok)
3.小程序,可否控制点击礼包详情四个字区域也会进行跳转到礼包详情界面  (小程序ok)
4.小程序,当未设置助力活动,但是小程序还是有显示 (ok)
pages/user/assistance/assistance.wxml
@@ -79,7 +79,7 @@ @@ -79,7 +79,7 @@
79 </view> 79 </view>
80 <view class="flex-center receive" wx:if="{{is_load && s_num}}"> 80 <view class="flex-center receive" wx:if="{{is_load && s_num}}">
81 <view class="flex-center ai-bas"> 81 <view class="flex-center ai-bas">
82 - <view>已有{{s_num}}人领取了任务</view> 82 + <view>该活动已被领取了{{s_num}}次</view>
83 </view> 83 </view>
84 84
85 </view> 85 </view>
pages/user/assistance/assistance_success.js
@@ -12,6 +12,7 @@ Page({ @@ -12,6 +12,7 @@ Page({
12 user:app_d.userInfo, 12 user:app_d.userInfo,
13 zl_act:null, //助力活动 13 zl_act:null, //助力活动
14 s_num:0, //分享的人数 14 s_num:0, //分享的人数
  15 + taskId:0,
15 }, 16 },
16 17
17 /** 18 /**
@@ -19,6 +20,8 @@ Page({ @@ -19,6 +20,8 @@ Page({
19 */ 20 */
20 onLoad: function (options) { 21 onLoad: function (options) {
21 var helpid=options.helpid; 22 var helpid=options.helpid;
  23 + var taskId = options.taskId;
  24 + this.data.taskId = taskId;
22 this.init(helpid); 25 this.init(helpid);
23 var nav_b = this.selectComponent("#nav_b"); //组件的id 26 var nav_b = this.selectComponent("#nav_b"); //组件的id
24 nav_b.set_name("助力", "/pages/user/assistance/assistance"); 27 nav_b.set_name("助力", "/pages/user/assistance/assistance");
@@ -48,8 +51,9 @@ Page({ @@ -48,8 +51,9 @@ Page({
48 th.setData({zl_act:res.data.data}); 51 th.setData({zl_act:res.data.data});
49 return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { 52 return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", {
50 data: { 53 data: {
51 - storeId: store_id,  
52 - helpId: helpid 54 + storeId: store_id,
  55 + helpId: helpid,
  56 + taskId:th.data.taskId
53 } 57 }
54 }) 58 })
55 } 59 }
pages/user/assistance/friend_assistance.js
@@ -66,7 +66,7 @@ Page({ @@ -66,7 +66,7 @@ Page({
66 }).then(res => { 66 }).then(res => {
67 if (res.data.code == 0) { 67 if (res.data.code == 0) {
68 th.data.userId = res.data.data.userId; 68 th.data.userId = res.data.data.userId;
69 - th.data.taskId = res.data.data.taskId; 69 + th.data.taskId = res.data.data.helpTaskId;
70 th.data.helpId=res.data.data.helpFormId; 70 th.data.helpId=res.data.data.helpFormId;
71 //获取活动的时间 71 //获取活动的时间
72 return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { 72 return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", {
@@ -86,7 +86,8 @@ Page({ @@ -86,7 +86,8 @@ Page({
86 return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { 86 return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", {
87 data: { 87 data: {
88 helpId: res.data.data.id, 88 helpId: res.data.data.id,
89 - storeId: os.stoid 89 + storeId: os.stoid,
  90 + taskId:th.data.taskId,
90 } 91 }
91 }) 92 })
92 } 93 }
@@ -140,7 +141,7 @@ Page({ @@ -140,7 +141,7 @@ Page({
140 //点击关闭礼盒 141 //点击关闭礼盒
141 clike_none: function() { 142 clike_none: function() {
142 this.setData({is_show: 0}); 143 this.setData({is_show: 0});
143 - getApp().goto("/pages/user/assistance/assistance_success?helpid="+this.data.helpId); 144 + getApp().goto("/pages/user/assistance/assistance_success?helpid="+this.data.helpId+"&taskId="+this.data.taskId);
144 }, 145 },
145 //导航球 146 //导航球
146 close: function() { 147 close: function() {
pages/user/assistance/friend_assistance.wxml
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 </view> 19 </view>
20 </view> 20 </view>
21 <view class="cklie_button t-c flex-center" bindtap="cklie_button">帮他拆礼盒</view> 21 <view class="cklie_button t-c flex-center" bindtap="cklie_button">帮他拆礼盒</view>
22 -<view class="fs26 white t-c" wx:if="{{s_num}}">已有{{s_num}}人领取礼盒</view> 22 +<view class="fs26 white t-c" wx:if="{{s_num}}"> 该任务已被领取了{{s_num}}次</view>
23 <!-- 礼盒弹框 --> 23 <!-- 礼盒弹框 -->
24 <view class="cover-layer" wx:if='{{is_show!=0}}' bindtap="clike_none"></view> 24 <view class="cover-layer" wx:if='{{is_show!=0}}' bindtap="clike_none"></view>
25 <view class="libao_frame t-c" wx:if='{{is_show!=0}}'> 25 <view class="libao_frame t-c" wx:if='{{is_show!=0}}'>
pages/user/assistance/task_assistance.js
@@ -209,6 +209,7 @@ Page({ @@ -209,6 +209,7 @@ Page({
209 }); 209 });
210 //判断是不是领取的任务 210 //判断是不是领取的任务
211 th.get_user_task(); 211 th.get_user_task();
  212 + th.get_user_task_num();
212 } 213 }
213 } 214 }
214 215
@@ -223,7 +224,7 @@ Page({ @@ -223,7 +224,7 @@ Page({
223 //会员任务列表 224 //会员任务列表
224 this.user_task_list(); 225 this.user_task_list();
225 //获取助力活动参与的人数 226 //获取助力活动参与的人数
226 - this.get_user_task_num(); 227 +
227 228
228 }, 229 },
229 //记录加载更多 230 //记录加载更多
@@ -350,6 +351,7 @@ Page({ @@ -350,6 +351,7 @@ Page({
350 } 351 }
351 //判断是不是领取的任务 352 //判断是不是领取的任务
352 th.get_user_task(); 353 th.get_user_task();
  354 + th.get_user_task_num();
353 355
354 }, 356 },
355 //导航球 357 //导航球
@@ -456,10 +458,17 @@ Page({ @@ -456,10 +458,17 @@ Page({
456 get_user_task_num: function () { 458 get_user_task_num: function () {
457 var th = this; 459 var th = this;
458 var help_id = th.data.help_id; 460 var help_id = th.data.help_id;
  461 +
  462 + var aitem = this.data.aitem; //任务的数据集
  463 + var sw_index = this.data.sw_index; //轮播的下标
  464 + //任务id
  465 + var taskid = aitem[sw_index].id;
  466 +
459 rq.get("/api/weshop/marketing/help/involve/help/act/people/count", { 467 rq.get("/api/weshop/marketing/help/involve/help/act/people/count", {
460 data: { 468 data: {
461 helpId: help_id, 469 helpId: help_id,
462 storeId: os.stoid, 470 storeId: os.stoid,
  471 + taskId: taskid
463 }, 472 },
464 success: function (su) { 473 success: function (su) {
465 if (su.data.code == 0) { 474 if (su.data.code == 0) {
@@ -1043,7 +1052,7 @@ Page({ @@ -1043,7 +1052,7 @@ Page({
1043 is_dismantle: 0, 1052 is_dismantle: 0,
1044 bc_page: 1, 1053 bc_page: 1,
1045 }) 1054 })
1046 - 1055 + this.get_user_task_num();
1047 1056
1048 }, 1057 },
1049 1058
pages/user/assistance/task_assistance.wxml
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 </view> 9 </view>
10 <view class="activity-data t-c fs28 white"> 10 <view class="activity-data t-c fs28 white">
11 活动剩余时间: 11 活动剩余时间:
12 - <text class='tui-conutdown-box'> {{aitem[0].djs.day}}</text>: 12 + <block wx:if="{{aitem[0].djs.day}}"><text class='tui-conutdown-box'> {{aitem[0].djs.day}}天 </text></block>
13 <text class='tui-conutdown-box'>{{aitem[0].djs.hou}}</text>: 13 <text class='tui-conutdown-box'>{{aitem[0].djs.hou}}</text>:
14 <text class='tui-conutdown-box'>{{aitem[0].djs.min}}</text>: 14 <text class='tui-conutdown-box'>{{aitem[0].djs.min}}</text>:
15 <text class='tui-conutdown-box tui-countdown-bg'>{{aitem[0].djs.sec}}</text> 15 <text class='tui-conutdown-box tui-countdown-bg'>{{aitem[0].djs.sec}}</text>
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 <swiper-item class="rel" wx:for="{{aitem}}" wx:for-item="aitem" wx:for-index="pidx"> 24 <swiper-item class="rel" wx:for="{{aitem}}" wx:for-item="aitem" wx:for-index="pidx">
25 25
26 <image class="xc-center-img" bindtap="libao_details" data-taskid="{{aitem.id}}" src="{{aitem.giftBagUrl!=null&&aitem.giftBagUrl!=''?iurl+aitem.giftBagUrl:swpie_img}}"></image> 26 <image class="xc-center-img" bindtap="libao_details" data-taskid="{{aitem.id}}" src="{{aitem.giftBagUrl!=null&&aitem.giftBagUrl!=''?iurl+aitem.giftBagUrl:swpie_img}}"></image>
27 - <view class="abs select_details fs26 white">礼包详情</view> 27 + <view bindtap="libao_details" data-taskid="{{aitem.id}}" class="abs select_details fs26 white">礼包详情</view>
28 28
29 </swiper-item> 29 </swiper-item>
30 </swiper> 30 </swiper>
@@ -146,7 +146,10 @@ @@ -146,7 +146,10 @@
146 <view class="line"></view> 146 <view class="line"></view>
147 </view> 147 </view>
148 <view class="flex-center white bottom" wx:if="{{usercount>0}}"> 148 <view class="flex-center white bottom" wx:if="{{usercount>0}}">
149 - <view>已有{{usercount}}人领取了任务</view> 149 + <view>该任务已被领取了{{usercount}}次</view>
  150 + </view>
  151 + <view class="flex-center white bottom" wx:else>
  152 + <view>暂无领取记录</view>
150 </view> 153 </view>
151 </view> 154 </view>
152 155
pages/user/index/index.js
@@ -599,11 +599,12 @@ Page({ @@ -599,11 +599,12 @@ Page({
599 }, 599 },
600 // 判断助力活动是不是存在 600 // 判断助力活动是不是存在
601 is_assistance: function() { 601 is_assistance: function() {
602 - var th = this; 602 + var th = this,r=Math.random()*100;
603 rq.get("/api/weshop/marketing/help/act/judge", { 603 rq.get("/api/weshop/marketing/help/act/judge", {
604 data: { 604 data: {
605 storeId: os.stoid, 605 storeId: os.stoid,
606 - userId: app_d.user_id 606 + userId: app_d.user_id,
  607 + r:r,
607 }, 608 },
608 success: function(res) { 609 success: function(res) {
609 var code = res.data.code; 610 var code = res.data.code;
@@ -611,7 +612,11 @@ Page({ @@ -611,7 +612,11 @@ Page({
611 th.setData({ 612 th.setData({
612 is_assistance: 1 613 is_assistance: 1
613 }); 614 });
614 - } 615 + }else{
  616 + th.setData({
  617 + is_assistance: 0
  618 + });
  619 + }
615 620
616 } 621 }
617 }) 622 })