Commit b31628243915636644cf5b3ca29cfca16ff42f24

Authored by yvan.ni
1 parent f540036e

助力活动的显示

pages/user/assistance/assistance_success.js
@@ -18,14 +18,15 @@ Page({ @@ -18,14 +18,15 @@ Page({
18 * 生命周期函数--监听页面加载 18 * 生命周期函数--监听页面加载
19 */ 19 */
20 onLoad: function (options) { 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 onShow: function (e) { 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,10 +36,9 @@ Page({
35 var th=this; 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 data: { 40 data: {
40 - userId: app_d.user_id,  
41 - storeId: os.store_id, 41 + storeId: store_id,
42 helpId: helpid 42 helpId: helpid
43 } 43 }
44 }).then(res => { 44 }).then(res => {
@@ -46,7 +46,7 @@ Page({ @@ -46,7 +46,7 @@ Page({
46 th.setData({zl_act:res.data.data}); 46 th.setData({zl_act:res.data.data});
47 return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { 47 return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", {
48 data: { 48 data: {
49 - storeId: os.store_id, 49 + storeId: store_id,
50 helpId: helpid 50 helpId: helpid
51 } 51 }
52 }) 52 })
@@ -69,4 +69,7 @@ Page({ @@ -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 \ No newline at end of file 76 \ No newline at end of file
pages/user/assistance/assistance_success.wxml
1 - 1 +<wxs module="filter" src="c_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 <view class="flex-vertical user_assis"> 3 <view class="flex-vertical user_assis">
4 <image class="circle user_img" src="{{user.head_pic}}"></image> 4 <image class="circle user_img" src="{{user.head_pic}}"></image>
pages/user/assistance/friend_assistance.js
@@ -17,9 +17,10 @@ Page({ @@ -17,9 +17,10 @@ Page({
17 is_show: 0, //显示弹框 17 is_show: 0, //显示弹框
18 user: app_d.userInfo, 18 user: app_d.userInfo,
19 zl_act: null, //助力活动 19 zl_act: null, //助力活动
20 - task_id: 0, //助力任务ID 20 + tasking: 0, //助力任务ID
21 userId: 0, //任务用户的ID 21 userId: 0, //任务用户的ID
22 s_num: 0, //分享的人数 22 s_num: 0, //分享的人数
  23 + taskId:0, //活动从表ID
23 }, 24 },
24 25
25 /** 26 /**
@@ -27,25 +28,27 @@ Page({ @@ -27,25 +28,27 @@ Page({
27 */ 28 */
28 onLoad: function(options) { 29 onLoad: function(options) {
29 var th = this; 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 if (options.userId) this.data.userId = options.userId; 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 0) { 38 0) {
37 getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", { 39 getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", {
38 data: { 40 data: {
39 - id: th.data.task_id, 41 + id: th.data.tasking,
40 storeId: os.stoid 42 storeId: os.stoid
41 } 43 }
42 }).then(res => { 44 }).then(res => {
43 if (res.data.code == 0) { 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 return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { 49 return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", {
47 data: { 50 data: {
48 - id: th.data.task_id, 51 + helpId: res.data.data.helpFormId,
49 storeId: os.stoid 52 storeId: os.stoid
50 } 53 }
51 }) 54 })
@@ -96,9 +99,9 @@ Page({ @@ -96,9 +99,9 @@ Page({
96 var th = this; 99 var th = this;
97 var t_user_id = app_d.user_id; 100 var t_user_id = app_d.user_id;
98 var data = { 101 var data = {
99 - id: this.data.task_id, 102 + id: this.data.tasking,
100 storeId: os.stoid, 103 storeId: os.stoid,
101 - userId: this.data.user_id, 104 + userId: this.data.userId,
102 zlUserId: t_user_id 105 zlUserId: t_user_id
103 }; 106 };
104 console.log(data); 107 console.log(data);
@@ -106,7 +109,7 @@ Page({ @@ -106,7 +109,7 @@ Page({
106 data, //入参 109 data, //入参
107 function(res) { //成功 110 function(res) { //成功
108 if (res.data.code == 0) 111 if (res.data.code == 0)
109 - this.setData({ 112 + th.setData({
110 is_show: 1 113 is_show: 1
111 }); 114 });
112 else { 115 else {
@@ -121,9 +124,8 @@ Page({ @@ -121,9 +124,8 @@ Page({
121 }, 124 },
122 //点击关闭礼盒 125 //点击关闭礼盒
123 clike_none: function() { 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 close: function() { 131 close: function() {
pages/user/assistance/friend_assistance.wxml
@@ -14,12 +14,12 @@ @@ -14,12 +14,12 @@
14 </view> 14 </view>
15 <view class="flex jc-center"> 15 <view class="flex jc-center">
16 <view class="activity_time fs24 white"> 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 </view> 18 </view>
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">已有{{zl_act.qiang_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}}'>