Commit 66770b6c031b2f36494b05ba4ff97b17174de727
1 parent
b2e72554
1.帮拆成功的跳转的参数传递, 2.导航小球的三个按钮的文字显示修改
Showing
4 changed files
with
28 additions
and
20 deletions
pages/user/assistance/assistance.js
pages/user/assistance/assistance_success.js
... | ... | @@ -18,23 +18,25 @@ Page({ |
18 | 18 | * 生命周期函数--监听页面加载 |
19 | 19 | */ |
20 | 20 | onLoad: function (options) { |
21 | - //var helpid=options.helpid; | |
22 | - var helpid=23; | |
21 | + var helpid=options.helpid; | |
23 | 22 | this.init(helpid); |
23 | + var nav_b = this.selectComponent("#nav_b"); //组件的id | |
24 | + nav_b.set_name("助力", "/pages/user/assistance/assistance"); | |
25 | + | |
24 | 26 | }, |
25 | 27 | /** |
26 | 28 | * 生命周期函数--监听页面显示 |
27 | 29 | */ |
28 | 30 | onShow: function (e) { |
29 | - | |
31 | + | |
30 | 32 | }, |
31 | 33 | |
32 | 34 | // ----初始化---- |
33 | - init:function(helpid) { | |
35 | + init:function(helpid) { | |
34 | 36 | var user_id = getApp().globalData.user_id; |
35 | 37 | var store_id = os.stoid; |
36 | 38 | var th=this; |
37 | - | |
39 | + | |
38 | 40 | //链式调用接口,先获取活动,在获取参与活动的人数 |
39 | 41 | getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { |
40 | 42 | data: { |
... | ... | @@ -49,10 +51,10 @@ Page({ |
49 | 51 | storeId: store_id, |
50 | 52 | helpId: helpid |
51 | 53 | } |
52 | - }) | |
54 | + }) | |
53 | 55 | } |
54 | 56 | return ut.null_promise(); |
55 | - | |
57 | + | |
56 | 58 | }).then(res=>{ |
57 | 59 | if(res.data.code==0){ |
58 | 60 | th.setData({s_num:res.data.data.countAll}); |
... | ... | @@ -70,6 +72,6 @@ Page({ |
70 | 72 | }, |
71 | 73 | |
72 | 74 | cklie_button:function(){ |
73 | - getApp().goto("/pages/user/assistance/assistance") | |
75 | + getApp().goto("/pages/user/assistance/assistance") | |
74 | 76 | } |
75 | -}) | |
76 | 77 | \ No newline at end of file |
78 | +}) | ... | ... |
pages/user/assistance/friend_assistance.js
... | ... | @@ -21,6 +21,7 @@ Page({ |
21 | 21 | userId: 0, //任务用户的ID |
22 | 22 | s_num: 0, //分享的人数 |
23 | 23 | taskId:0, //活动从表ID |
24 | + helpId:0, | |
24 | 25 | }, |
25 | 26 | |
26 | 27 | /** |
... | ... | @@ -28,17 +29,21 @@ Page({ |
28 | 29 | */ |
29 | 30 | onLoad: function(options) { |
30 | 31 | var th = this; |
31 | - | |
32 | + | |
33 | + var nav_b = th.selectComponent("#nav_b"); //组件的id | |
34 | + nav_b.set_name("助力", "/pages/user/assistance/assistance"); | |
35 | + | |
36 | + | |
32 | 37 | if (options.tasking) this.data.tasking = options.tasking; |
33 | 38 | if (options.userId) this.data.userId = options.userId; |
34 | 39 | //任务是不是为空 |
35 | 40 | if (this.data.tasking == 0 || this.data.tasking == undefined) { |
36 | - this.data.tasking = decodeURIComponent(options.scene); | |
41 | + this.data.tasking = decodeURIComponent(options.scene); | |
37 | 42 | } |
38 | - | |
43 | + | |
39 | 44 | if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking != |
40 | 45 | 0) { |
41 | - | |
46 | + | |
42 | 47 | getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", { |
43 | 48 | data: { |
44 | 49 | taskingId: th.data.tasking, |
... | ... | @@ -48,6 +53,7 @@ Page({ |
48 | 53 | if (res.data.code == 0) { |
49 | 54 | th.data.userId = res.data.data.userId; |
50 | 55 | th.data.taskId = res.data.data.taskId; |
56 | + th.data.helpId=res.data.data.helpFormId; | |
51 | 57 | //获取活动的时间 |
52 | 58 | return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { |
53 | 59 | data: { |
... | ... | @@ -72,7 +78,7 @@ Page({ |
72 | 78 | } |
73 | 79 | return ut.null_promise(); |
74 | 80 | }).then(res => { |
75 | - if (res.data.code == 0) { | |
81 | + if (res && res.data && res.data.code == 0) { | |
76 | 82 | th.setData({ |
77 | 83 | s_num: res.data.data.countAll |
78 | 84 | }); |
... | ... | @@ -85,7 +91,7 @@ Page({ |
85 | 91 | // 跳转到助力成功页 |
86 | 92 | participate_activity: function() { |
87 | 93 | wx.navigateTo({ |
88 | - url: '/pages/user/assistance/assistance_success', | |
94 | + url: '/pages/user/assistance/assistance_success?helpid='+this.data.helpId, | |
89 | 95 | }) |
90 | 96 | }, |
91 | 97 | |
... | ... | @@ -126,7 +132,7 @@ Page({ |
126 | 132 | //点击关闭礼盒 |
127 | 133 | clike_none: function() { |
128 | 134 | this.setData({is_show: 0}); |
129 | - getApp().goto("/pages/user/assistance/assistance_success"); | |
135 | + getApp().goto("/pages/user/assistance/assistance_success?helpid="+this.data.helpId); | |
130 | 136 | }, |
131 | 137 | //导航球 |
132 | 138 | close: function() { | ... | ... |
pages/user/assistance/task_assistance.wxml
... | ... | @@ -56,9 +56,9 @@ |
56 | 56 | 立即兑换 |
57 | 57 | </view> |
58 | 58 | |
59 | -<!-- <view class="task_clike fs40 t-c flex-center" bindtap="test">--> | |
60 | -<!-- 测试专用帮被人拆--> | |
61 | -<!-- </view>--> | |
59 | + <view class="task_clike fs40 t-c flex-center" bindtap="test"> | |
60 | + 测试专用帮被人拆 | |
61 | + </view> | |
62 | 62 | |
63 | 63 | </view> |
64 | 64 | <!-- 底部列表 --> | ... | ... |