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