Commit bd323f130b47a0e9a24cf25e5dba1740aa5f6c4b

Authored by 后端开发-许程
1 parent 535b3610

助力选取任务

pages/user/assistance/task_assistance.js
... ... @@ -24,18 +24,14 @@ Page({
24 24 aitem: "", //活动的轮播图数据
25 25 switch_head: 0, //0:我的任务,1:记录
26 26 help_id: "", //活动的id canvasHidden: 0, //分享图片是否已经生成
27   - is_share: 1, //是否显示画布
28   - shareImgPath: [], //生成的图片
29   - screenWidth: "", //用户的屏幕宽度
30 27 gid: "",
31 28 timer: null, //全局的定时器
32 29 user_task_list: null, //会员列表
33 30 taskid: "", //任务id
34 31 usercount: 0, //参与的人数
35 32 dismantle: null, //帮拆记录数据集
36   -
37 33 is_user_task:null,//判断是不是领取的任务
38   -
  34 + zzjx_id:"",//真正进行的任务id
39 35 //*********************************************start钱
40 36 canvasHidden: 0, //分享图片是否已经生成
41 37 is_share: 0, //是否显示画布
... ... @@ -254,9 +250,9 @@ Page({
254 250 // 领取礼包
255 251 get_libao: function (e) {
256 252 var libao_id = e.currentTarget.dataset.libaoid;
257   - // var completeid = e.currentTarget.dataset.completeid;
  253 + var completeid = e.currentTarget.dataset.completeid;
258 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 257 //查看礼包id
262 258 select_libao: function () {
... ... @@ -336,7 +332,7 @@ Page({
336 332 }
337 333 })
338 334 },
339   - //判断是否有领取任务
  335 + //判断是否有领取任务 获取正在进行中的任务
340 336 get_user_task:function(){
341 337 var user_id = getApp().globalData.user_id;
342 338 var th=this;
... ... @@ -1026,19 +1022,18 @@ Page({
1026 1022 },
1027 1023 //好友猜一猜
1028 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 1027 //任务id
1032   - var taskid = e.currentTarget.dataset.taskid;
  1028 + var taskid = aitem[sw_index].id
1033 1029 console.log("好友猜一猜的任务id", taskid);
1034 1030 var th = this;
1035   -
1036 1031 var url = "/api/weshop/marketing/help/help/task/involve/page";
1037 1032 getApp().request.promiseGet(url, {
1038 1033 data: {
1039   - storeId: 1,
  1034 + storeId: os.stoid,
1040 1035 taskId: taskid,
1041   - userId: 1433390
  1036 + userId: getApp().globalData.user_id
1042 1037 }
1043 1038 }).then(res => {
1044 1039 if (res.data.code == 0) {
... ... @@ -1140,14 +1135,49 @@ Page({
1140 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 1139 libao_details:function(e){
1149 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 1184 \ No newline at end of file
... ...
pages/user/assistance/task_assistance.wxml
... ... @@ -41,7 +41,7 @@
41 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 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 46 </view>
47 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 77 <view class="ellipsis-1">
78 78 <text wx:if="{{item.status==0}}">{{item.zlHelpNum}}/{{item.helpNum}}</text>
79 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 81 data-completeid="{{item.id}}">领取礼包 </text>
82 82 </view>
83 83 </view>
... ...