Commit 3f02cd2edffae65d79ca9cff2f1f035e90cddc4a
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
3 changed files
with
97 additions
and
68 deletions
pages/user/assistance/friend_assistance.js
@@ -32,54 +32,53 @@ Page({ | @@ -32,54 +32,53 @@ Page({ | ||
32 | if (options.userId) this.data.userId = options.userId; | 32 | if (options.userId) this.data.userId = options.userId; |
33 | //任务是不是为空 | 33 | //任务是不是为空 |
34 | if (this.data.tasking == 0 || this.data.tasking == undefined) { | 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 != | ||
38 | - 0) { | ||
39 | - getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", { | ||
40 | - data: { | ||
41 | - id: th.data.tasking, | ||
42 | - storeId: os.stoid | ||
43 | - } | ||
44 | - }).then(res => { | ||
45 | - if (res.data.code == 0) { | ||
46 | - th.data.userId = res.data.data.userId; | ||
47 | - th.data.taskId = res.data.data.taskId; | ||
48 | - //获取活动的时间 | ||
49 | - return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { | ||
50 | - data: { | ||
51 | - helpId: res.data.data.helpFormId, | ||
52 | - storeId: os.stoid | ||
53 | - } | ||
54 | - }) | ||
55 | - } | ||
56 | - return ut.null_promise(); | ||
57 | - }).then(res => { | ||
58 | - if (res.data.code == 0) { | ||
59 | - th.setData({ | ||
60 | - zl_act: res.data.data | ||
61 | - }) | ||
62 | - //获取活动的参与的人数 | ||
63 | - return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { | ||
64 | - data: { | ||
65 | - helpId: res.data.data.id, | ||
66 | - storeId: os.stoid | ||
67 | - } | ||
68 | - }) | ||
69 | - } | ||
70 | - return ut.null_promise(); | ||
71 | - }).then(res => { | ||
72 | - if (res.data.code == 0) { | ||
73 | - th.setData({ | ||
74 | - s_num: res.data.data.countAll | ||
75 | - }); | ||
76 | - } | ||
77 | - }) | ||
78 | - | ||
79 | - } | 35 | + this.data.tasking = decodeURIComponent(options.scene); |
80 | } | 36 | } |
81 | - }, | ||
82 | 37 | ||
38 | + if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking != | ||
39 | + 0) { | ||
40 | + getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", { | ||
41 | + data: { | ||
42 | + id: th.data.tasking, | ||
43 | + storeId: os.stoid | ||
44 | + } | ||
45 | + }).then(res => { | ||
46 | + if (res.data.code == 0) { | ||
47 | + th.data.userId = res.data.data.userId; | ||
48 | + th.data.taskId = res.data.data.taskId; | ||
49 | + //获取活动的时间 | ||
50 | + return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { | ||
51 | + data: { | ||
52 | + helpId: res.data.data.helpFormId, | ||
53 | + storeId: os.stoid | ||
54 | + } | ||
55 | + }) | ||
56 | + } | ||
57 | + return ut.null_promise(); | ||
58 | + }).then(res => { | ||
59 | + if (res.data.code == 0) { | ||
60 | + th.setData({ | ||
61 | + zl_act: res.data.data | ||
62 | + }) | ||
63 | + //获取活动的参与的人数 | ||
64 | + return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { | ||
65 | + data: { | ||
66 | + helpId: res.data.data.id, | ||
67 | + storeId: os.stoid | ||
68 | + } | ||
69 | + }) | ||
70 | + } | ||
71 | + return ut.null_promise(); | ||
72 | + }).then(res => { | ||
73 | + if (res.data.code == 0) { | ||
74 | + th.setData({ | ||
75 | + s_num: res.data.data.countAll | ||
76 | + }); | ||
77 | + } | ||
78 | + }) | ||
79 | + | ||
80 | + } | ||
81 | + }, | ||
83 | 82 | ||
84 | // 跳转到助力成功页 | 83 | // 跳转到助力成功页 |
85 | participate_activity: function() { | 84 | participate_activity: function() { |
pages/user/assistance/task_assistance.js
@@ -24,18 +24,14 @@ Page({ | @@ -24,18 +24,14 @@ Page({ | ||
24 | aitem: "", //活动的轮播图数据 | 24 | aitem: "", //活动的轮播图数据 |
25 | switch_head: 0, //0:我的任务,1:记录 | 25 | switch_head: 0, //0:我的任务,1:记录 |
26 | help_id: "", //活动的id canvasHidden: 0, //分享图片是否已经生成 | 26 | help_id: "", //活动的id canvasHidden: 0, //分享图片是否已经生成 |
27 | - is_share: 1, //是否显示画布 | ||
28 | - shareImgPath: [], //生成的图片 | ||
29 | - screenWidth: "", //用户的屏幕宽度 | ||
30 | gid: "", | 27 | gid: "", |
31 | timer: null, //全局的定时器 | 28 | timer: null, //全局的定时器 |
32 | user_task_list: null, //会员列表 | 29 | user_task_list: null, //会员列表 |
33 | taskid: "", //任务id | 30 | taskid: "", //任务id |
34 | usercount: 0, //参与的人数 | 31 | usercount: 0, //参与的人数 |
35 | dismantle: null, //帮拆记录数据集 | 32 | dismantle: null, //帮拆记录数据集 |
36 | - | ||
37 | is_user_task:null,//判断是不是领取的任务 | 33 | is_user_task:null,//判断是不是领取的任务 |
38 | - | 34 | + zzjx_id:"",//真正进行的任务id |
39 | //*********************************************start钱 | 35 | //*********************************************start钱 |
40 | canvasHidden: 0, //分享图片是否已经生成 | 36 | canvasHidden: 0, //分享图片是否已经生成 |
41 | is_share: 0, //是否显示画布 | 37 | is_share: 0, //是否显示画布 |
@@ -254,9 +250,9 @@ Page({ | @@ -254,9 +250,9 @@ Page({ | ||
254 | // 领取礼包 | 250 | // 领取礼包 |
255 | get_libao: function (e) { | 251 | get_libao: function (e) { |
256 | var libao_id = e.currentTarget.dataset.libaoid; | 252 | var libao_id = e.currentTarget.dataset.libaoid; |
257 | - // var completeid = e.currentTarget.dataset.completeid; | 253 | + var completeid = e.currentTarget.dataset.completeid; |
258 | console.log("礼包id", libao_id); | 254 | console.log("礼包id", libao_id); |
259 | - getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + libao_id + "&is_libao="+1 ); | 255 | + getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + libao_id + "&is_libao=" + 1 + "&completeid=" + completeid); |
260 | }, | 256 | }, |
261 | //查看礼包id | 257 | //查看礼包id |
262 | select_libao: function () { | 258 | select_libao: function () { |
@@ -336,7 +332,7 @@ Page({ | @@ -336,7 +332,7 @@ Page({ | ||
336 | } | 332 | } |
337 | }) | 333 | }) |
338 | }, | 334 | }, |
339 | - //判断是否有领取任务 | 335 | + //判断是否有领取任务 获取正在进行中的任务 |
340 | get_user_task:function(){ | 336 | get_user_task:function(){ |
341 | var user_id = getApp().globalData.user_id; | 337 | var user_id = getApp().globalData.user_id; |
342 | var th=this; | 338 | var th=this; |
@@ -1026,19 +1022,18 @@ Page({ | @@ -1026,19 +1022,18 @@ Page({ | ||
1026 | }, | 1022 | }, |
1027 | //好友猜一猜 | 1023 | //好友猜一猜 |
1028 | save_share: function (e) { | 1024 | save_share: function (e) { |
1029 | - // var aitem = this.data.aitem; //任务的数据集 | ||
1030 | - // var sw_index = this.data.sw_index; //轮播的下标 | 1025 | + var aitem = this.data.aitem; //任务的数据集 |
1026 | + var sw_index = this.data.sw_index; //轮播的下标 | ||
1031 | //任务id | 1027 | //任务id |
1032 | - var taskid = e.currentTarget.dataset.taskid; | 1028 | + var taskid = aitem[sw_index].id |
1033 | console.log("好友猜一猜的任务id", taskid); | 1029 | console.log("好友猜一猜的任务id", taskid); |
1034 | var th = this; | 1030 | var th = this; |
1035 | - | ||
1036 | var url = "/api/weshop/marketing/help/help/task/involve/page"; | 1031 | var url = "/api/weshop/marketing/help/help/task/involve/page"; |
1037 | getApp().request.promiseGet(url, { | 1032 | getApp().request.promiseGet(url, { |
1038 | data: { | 1033 | data: { |
1039 | - storeId: 1, | 1034 | + storeId: os.stoid, |
1040 | taskId: taskid, | 1035 | taskId: taskid, |
1041 | - userId: 1433390 | 1036 | + userId: getApp().globalData.user_id |
1042 | } | 1037 | } |
1043 | }).then(res => { | 1038 | }).then(res => { |
1044 | if (res.data.code == 0) { | 1039 | if (res.data.code == 0) { |
@@ -1140,14 +1135,49 @@ Page({ | @@ -1140,14 +1135,49 @@ Page({ | ||
1140 | dynamic: images | 1135 | dynamic: images |
1141 | }) | 1136 | }) |
1142 | }, | 1137 | }, |
1143 | - test:function(e){ | ||
1144 | - var task_id=e.currentTarget.dataset.taskid; | ||
1145 | - console.log("正在进行中任务的id",task_id); | ||
1146 | - }, | ||
1147 | //礼包的详情 轮播图 | 1138 | //礼包的详情 轮播图 |
1148 | libao_details:function(e){ | 1139 | libao_details:function(e){ |
1149 | var giftbagid=e.currentTarget.dataset.giftbagid; | 1140 | var giftbagid=e.currentTarget.dataset.giftbagid; |
1150 | - getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + giftbagid + "&is_libao=" + 0); | ||
1151 | - } | 1141 | + getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" +giftbagid + "&is_libao=" + 0); |
1142 | + }, | ||
1143 | + //正在进行任务 | ||
1144 | + test: function (e) { | ||
1145 | + var th=this; | ||
1146 | + var aitem = this.data.aitem; //任务的数据集 | ||
1147 | + var sw_index = this.data.sw_index; //轮播的下标 | ||
1148 | + //任务id | ||
1149 | + var taskid = aitem[sw_index].id; | ||
1150 | + //查看正在进行中的任务 | ||
1151 | + getAPP().request.promiseGet("/api/weshop/marketing/help/help/task/get",{ | ||
1152 | + data:{ | ||
1153 | + storeId: os.stoid, | ||
1154 | + userId: getApp().globalData.user_id, | ||
1155 | + taskId:taskid | ||
1156 | + } | ||
1157 | + }).then(res=>{ | ||
1158 | + if (res.data.code==0){ | ||
1159 | + var zzjx_id=res.data.data.id; | ||
1160 | + th.setData({zzjx_id:zzjx_id}); | ||
1161 | + var zzjx_id=th.data.zzjx_id; | ||
1162 | + getApp().goto("/pages/user/friend_assistance/friend_assistance?taskimg=" + zzjx_id); | ||
1163 | + // return getApp().request.json_post("/api/weshop/marketing/help/help/task/involve/insert",{ | ||
1164 | + // id:zzjx_id, | ||
1165 | + // storeId: os.stoid, | ||
1166 | + // userId: getApp().globalData.user_id, | ||
1167 | + // zlUserId: 4379287 | ||
1168 | + // },function (res) { | ||
1169 | + // if (res.data.code==0){ | ||
1170 | + | ||
1171 | + | ||
1172 | + // } | ||
1173 | + // } | ||
1174 | + | ||
1175 | + | ||
1176 | + // )} | ||
1177 | + }) | ||
1178 | + | ||
1179 | + | ||
1180 | + | ||
1181 | + }, | ||
1152 | 1182 | ||
1153 | }) | 1183 | }) |
1154 | \ No newline at end of file | 1184 | \ No newline at end of file |
pages/user/assistance/task_assistance.wxml
@@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
41 | <view wx:if="{{is_user_task==null}}" class="task_clike fs40 t-c flex-center"data-taskid="{{taskid}}" bindtap="add_onlicke"> | 41 | <view wx:if="{{is_user_task==null}}" class="task_clike fs40 t-c flex-center"data-taskid="{{taskid}}" bindtap="add_onlicke"> |
42 | 就选它了 | 42 | 就选它了 |
43 | </view> | 43 | </view> |
44 | - <view wx:if="{{is_user_task!=null}}" class="task_clike fs40 t-c flex-center"data-taskid="{{is_user_task.id}}" bindtap="save_share"> | 44 | + <view wx:if="{{is_user_task!=null}}" class="task_clike fs40 t-c flex-center" bindtap="save_share"> |
45 | 好友拆一拆 | 45 | 好友拆一拆 |
46 | </view> | 46 | </view> |
47 | <view wx:if="{{is_user_task!=null}}" class="task_clike fs40 t-c flex-center"data-taskid="{{is_user_task.id}}" bindtap="test"> | 47 | <view wx:if="{{is_user_task!=null}}" class="task_clike fs40 t-c flex-center"data-taskid="{{is_user_task.id}}" bindtap="test"> |
@@ -77,7 +77,7 @@ | @@ -77,7 +77,7 @@ | ||
77 | <view class="ellipsis-1"> | 77 | <view class="ellipsis-1"> |
78 | <text wx:if="{{item.status==0}}">{{item.zlHelpNum}}/{{item.helpNum}}</text> | 78 | <text wx:if="{{item.status==0}}">{{item.zlHelpNum}}/{{item.helpNum}}</text> |
79 | <text wx:if="{{item.status==2}}"bindtap="select_libao" data-libaoid="{{item.helpListGiftBagId}}">查看礼包</text> | 79 | <text wx:if="{{item.status==2}}"bindtap="select_libao" data-libaoid="{{item.helpListGiftBagId}}">查看礼包</text> |
80 | - <text wx:if="{{item.status==1}}"bindtap="get_libao"data-libaoid="{{item.helpListGiftBagId}}" | 80 | + <text wx:if="{{item.status==1}}"bindtap="get_libao"data-orderid="{{item.ordersn}}" data-libaoid="{{item.helpListGiftBagId}}" |
81 | data-completeid="{{item.id}}">领取礼包 </text> | 81 | data-completeid="{{item.id}}">领取礼包 </text> |
82 | </view> | 82 | </view> |
83 | </view> | 83 | </view> |