Commit b31628243915636644cf5b3ca29cfca16ff42f24
1 parent
f540036e
助力活动的显示
Showing
4 changed files
with
29 additions
and
24 deletions
pages/user/assistance/assistance_success.js
... | ... | @@ -18,14 +18,15 @@ Page({ |
18 | 18 | * 生命周期函数--监听页面加载 |
19 | 19 | */ |
20 | 20 | onLoad: function (options) { |
21 | - | |
21 | + //var helpid=options.helpid; | |
22 | + var helpid=23; | |
23 | + this.init(helpid); | |
22 | 24 | }, |
23 | 25 | /** |
24 | 26 | * 生命周期函数--监听页面显示 |
25 | 27 | */ |
26 | 28 | onShow: function (e) { |
27 | - var helpid=e.helpid; | |
28 | - this.init(helpid); | |
29 | + | |
29 | 30 | }, |
30 | 31 | |
31 | 32 | // ----初始化---- |
... | ... | @@ -35,10 +36,9 @@ Page({ |
35 | 36 | var th=this; |
36 | 37 | |
37 | 38 | //链式调用接口,先获取活动,在获取参与活动的人数 |
38 | - getApp().request.promiseGet("/api/weshop/marketing/help/help/user/page", { | |
39 | + getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { | |
39 | 40 | data: { |
40 | - userId: app_d.user_id, | |
41 | - storeId: os.store_id, | |
41 | + storeId: store_id, | |
42 | 42 | helpId: helpid |
43 | 43 | } |
44 | 44 | }).then(res => { |
... | ... | @@ -46,7 +46,7 @@ Page({ |
46 | 46 | th.setData({zl_act:res.data.data}); |
47 | 47 | return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { |
48 | 48 | data: { |
49 | - storeId: os.store_id, | |
49 | + storeId: store_id, | |
50 | 50 | helpId: helpid |
51 | 51 | } |
52 | 52 | }) |
... | ... | @@ -69,4 +69,7 @@ Page({ |
69 | 69 | |
70 | 70 | }, |
71 | 71 | |
72 | + cklie_button:function(){ | |
73 | + getApp().goto("/pages/user/assistance/assistance") | |
74 | + } | |
72 | 75 | }) |
73 | 76 | \ No newline at end of file | ... | ... |
pages/user/assistance/assistance_success.wxml
pages/user/assistance/friend_assistance.js
... | ... | @@ -17,9 +17,10 @@ Page({ |
17 | 17 | is_show: 0, //显示弹框 |
18 | 18 | user: app_d.userInfo, |
19 | 19 | zl_act: null, //助力活动 |
20 | - task_id: 0, //助力任务ID | |
20 | + tasking: 0, //助力任务ID | |
21 | 21 | userId: 0, //任务用户的ID |
22 | 22 | s_num: 0, //分享的人数 |
23 | + taskId:0, //活动从表ID | |
23 | 24 | }, |
24 | 25 | |
25 | 26 | /** |
... | ... | @@ -27,25 +28,27 @@ Page({ |
27 | 28 | */ |
28 | 29 | onLoad: function(options) { |
29 | 30 | var th = this; |
30 | - if (options.task_id) this.data.task_id = options.task_id; | |
31 | + if (options.tasking) this.data.tasking = options.tasking; | |
31 | 32 | if (options.userId) this.data.userId = options.userId; |
32 | 33 | //任务是不是为空 |
33 | - if (this.data.task_id == 0 || this.data.task_id == undefined) { | |
34 | - this.data.task_id = decodeURIComponent(options.scene); | |
35 | - if (this.data.task_id != null && this.data.task_id != 'undefined' && this.data.task_id != "" && this.data.task_id != | |
34 | + if (this.data.tasking == 0 || this.data.tasking == undefined) { | |
35 | + //this.data.task_id = decodeURIComponent(options.scene); | |
36 | + this.data.tasking =1; | |
37 | + if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking != | |
36 | 38 | 0) { |
37 | 39 | getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", { |
38 | 40 | data: { |
39 | - id: th.data.task_id, | |
41 | + id: th.data.tasking, | |
40 | 42 | storeId: os.stoid |
41 | 43 | } |
42 | 44 | }).then(res => { |
43 | 45 | if (res.data.code == 0) { |
44 | - th.data.userId = res.data.data.user_id; | |
46 | + th.data.userId = res.data.data.userId; | |
47 | + th.data.taskId = res.data.data.taskId; | |
45 | 48 | //获取活动的时间 |
46 | 49 | return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { |
47 | 50 | data: { |
48 | - id: th.data.task_id, | |
51 | + helpId: res.data.data.helpFormId, | |
49 | 52 | storeId: os.stoid |
50 | 53 | } |
51 | 54 | }) |
... | ... | @@ -96,9 +99,9 @@ Page({ |
96 | 99 | var th = this; |
97 | 100 | var t_user_id = app_d.user_id; |
98 | 101 | var data = { |
99 | - id: this.data.task_id, | |
102 | + id: this.data.tasking, | |
100 | 103 | storeId: os.stoid, |
101 | - userId: this.data.user_id, | |
104 | + userId: this.data.userId, | |
102 | 105 | zlUserId: t_user_id |
103 | 106 | }; |
104 | 107 | console.log(data); |
... | ... | @@ -106,7 +109,7 @@ Page({ |
106 | 109 | data, //入参 |
107 | 110 | function(res) { //成功 |
108 | 111 | if (res.data.code == 0) |
109 | - this.setData({ | |
112 | + th.setData({ | |
110 | 113 | is_show: 1 |
111 | 114 | }); |
112 | 115 | else { |
... | ... | @@ -121,9 +124,8 @@ Page({ |
121 | 124 | }, |
122 | 125 | //点击关闭礼盒 |
123 | 126 | clike_none: function() { |
124 | - this.setData({ | |
125 | - is_show: 0 | |
126 | - }); | |
127 | + this.setData({is_show: 0}); | |
128 | + getApp().goto("/pages/user/assistance/assistance_success"); | |
127 | 129 | }, |
128 | 130 | //导航球 |
129 | 131 | close: function() { | ... | ... |
pages/user/assistance/friend_assistance.wxml
... | ... | @@ -14,12 +14,12 @@ |
14 | 14 | </view> |
15 | 15 | <view class="flex jc-center"> |
16 | 16 | <view class="activity_time fs24 white"> |
17 | - 活动时间:{{filter.fm_time(zl_act.begindate)}}-{{filter.fm_time(zl_act.begindate)}} | |
17 | + 活动时间:{{filter.fm_time(zl_act.beginDate)}}-{{filter.fm_time(zl_act.beginDate)}} | |
18 | 18 | </view> |
19 | 19 | </view> |
20 | 20 | </view> |
21 | 21 | <view class="cklie_button t-c flex-center" bindtap="cklie_button">帮他拆礼盒</view> |
22 | -<view class="fs26 white t-c">已有{{zl_act.qiang_num}}人领取礼盒</view> | |
22 | +<view class="fs26 white t-c" wx:if="{{s_num}}">已有{{s_num}}人领取礼盒</view> | |
23 | 23 | <!-- 礼盒弹框 --> |
24 | 24 | <view class="cover-layer" wx:if='{{is_show!=0}}' bindtap="clike_none"></view> |
25 | 25 | <view class="libao_frame t-c" wx:if='{{is_show!=0}}'> | ... | ... |