Commit 30ae7e7cb362ef7d06c4608133ccff60bd0df2ac

Authored by 后端研发-倪永富
1 parent a23e9773

助力小程序的首页,礼包页的点击领取效果, 领取任务的页面。测试专用的跳转页

app.json
... ... @@ -89,8 +89,12 @@
89 89 "pages/giftpack/mygiftpack/mygiftpack",
90 90  
91 91 "pages/user/assistance/giftpacklist",
92   - "pages/user/assistance/task_assistance"
  92 + "pages/user/assistance/task_assistance",
  93 + "pages/user/assistance/friend_assistance",
  94 + "pages/user/assistance/assistance_success",
  95 + "pages/user/assistance/assistance",
93 96  
  97 + "pages/test/zhuli_test"
94 98  
95 99 ],
96 100 "permission": {
... ...
pages/test/zhuli_test.js 0 → 100644
  1 +var e = getApp(),
  2 + a = e.globalData.setting,
  3 + os = a;
  4 +var regeneratorRuntime = require('../../utils/runtime.js');
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 + iurl: a.imghost, //图片地址前缀\
  12 + taskId:0,
  13 + mobile:0,
  14 + },
  15 + /**
  16 + * 生命周期函数--监听页面加载
  17 + */
  18 + onLoad: function(options) {
  19 + wx.setNavigationBarTitle({
  20 + title: "测试帮忙助力",
  21 + })
  22 + var th = this;
  23 + var taskId=options.taskId;
  24 + this.data.taskId=taskId;
  25 + },
  26 +
  27 + getphoneValue:function(e){
  28 + this.data.mobile=e.detail.value;
  29 + },
  30 + //测试正在进行任务
  31 + bindReg:async function () {
  32 + var userinfo=null;
  33 + await getApp().request.promiseGet("/api/weshop/users/page",{
  34 + data:{mobile:this.data.mobile,store_id:os.stoid}
  35 + }).then(res=>{
  36 + userinfo=res.data.data.pageData[0];
  37 + })
  38 + if(!userinfo) {
  39 + getApp().my_warnning("未找到会员",0,this); return false;
  40 + }
  41 +
  42 + var task=null;
  43 + await getApp().request.promiseGet("/api/weshop/marketing/help/help/task/get",{
  44 + data:{taskId:this.data.taskId,storeId:os.stoid,userId:userinfo.user_id}
  45 + }).then(res=>{
  46 + task=res.data.data;
  47 + })
  48 + if(!task) {
  49 + getApp().my_warnning("未找任务",0,this); return false;
  50 + }
  51 +
  52 + if(task.status!=0){
  53 + getApp().my_warnning("任务不是进行中",0,this); return false;
  54 + }
  55 + var taking=task.id;
  56 + getApp().goto("/pages/user/assistance/friend_assistance?tasking=" + taking + "&userId=" + userinfo.user_id);
  57 + },
  58 +
  59 +
  60 +})
... ...
pages/test/zhuli_test.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "助力测试专用",
  3 + "usingComponents": {
  4 + "warn": "/components/long_warn/long_warn"
  5 + }
  6 +}
0 7 \ No newline at end of file
... ...
pages/test/zhuli_test.wxml 0 → 100644
  1 +<view class="index">
  2 +
  3 + <!-- 发送验证码登录注册 -->
  4 + <view class="sr">
  5 + <view class="inputs fs30">
  6 + <!-- 手机号码 -->
  7 + <view class="flex rel phone_view">
  8 + <image src="{{iurl}}/mddmscp/regico1.jpg" class="tubiao_set"></image>
  9 + <input class="input_phone" type="number" placeholder="请输入手机号码" placeholder-style="color:rgb(190,190,190);"
  10 + maxlength="11" bindinput="getphoneValue"></input>
  11 + </view>
  12 + </view>
  13 + <!-- 点击注册 -->
  14 + <view class="flex-center fs30 reg_btn" bindtap="bindReg">
  15 + <view class="userlogin flex-center on">
  16 + <view>去帮忙助力</view>
  17 + </view>
  18 + </view>
  19 + </view>
  20 +</view>
  21 +
  22 +<warn id="warn"></warn>
... ...
pages/test/zhuli_test.wxss 0 → 100644
  1 +page{
  2 + border-top: 3rpx solid #EAEAEC;
  3 +}
  4 +.index {
  5 + position: absolute; width: 100%;
  6 + z-index: 1;
  7 +}
  8 +
  9 +.logins {
  10 + width: 100%;
  11 + padding-top: 60rpx;
  12 + padding-bottom: 120rpx;
  13 +}
  14 +
  15 +.login_img {
  16 + width: 192rpx;
  17 + height: 192rpx;
  18 + border-radius: 50%
  19 +}
  20 +
  21 +.input_phone {
  22 + height: 55rpx;
  23 + line-height: 55rpx;
  24 + margin-left:10rpx ;
  25 + position: relative; top:10rpx
  26 +}
  27 +
  28 +.input_code {
  29 + width: 360rpx;
  30 + height: 55rpx;
  31 + line-height: 55rpx;
  32 + border-radius: 12rpx;
  33 + margin-right: 20rpx;
  34 + border: 3rpx solid rgb(230, 230, 230);
  35 + padding-left: 40rpx;
  36 + color:#ef8179
  37 +}
  38 +
  39 +.codes {
  40 + margin-bottom: 65rpx;
  41 +}
  42 +
  43 +.get_code {
  44 + width: 176rpx;
  45 + height: 65rpx;
  46 + line-height: 65rpx;
  47 + border:1rpx solid rgb(236, 109, 95);
  48 + color: #ed7067;
  49 + border-radius: 12rpx;
  50 + right: 0;
  51 + top:5rpx;
  52 +}
  53 +
  54 +.userlogin {
  55 + width: 100%;
  56 + height: 95rpx;
  57 + line-height: 95rpx;
  58 + background-color: #ffc5c0;
  59 + color: rgb(255, 255, 255);
  60 + margin-bottom: 30rpx;
  61 + margin-top: 50rpx
  62 + }
  63 +
  64 +.userlogin.on{
  65 + background-color: #eb6359;
  66 +}
  67 +
  68 +.go_index {
  69 + color: #9d9d9d;
  70 + margin-bottom: 300rpx;
  71 +}
  72 +
  73 +.sr {
  74 + width: 90%; margin: 0 auto;
  75 +}
  76 +
  77 +.checkbox {
  78 + width: 25rpx;
  79 + height: 25rpx;
  80 + color: rgb(0, 0, 0);
  81 + margin-right: 50rpx;
  82 + margin-bottom: 30rpx
  83 +}
  84 +
  85 +.agrs {
  86 + padding: 0rpx 65rpx;
  87 +}
  88 +
  89 +.agreement {
  90 + color: rgb(236, 109, 95);
  91 + display: initial;
  92 +}
  93 +
  94 +.popup {
  95 + position: fixed;
  96 + z-index: 10;
  97 + background-color: rgba(153, 153, 153, 0.568);
  98 + height: 100%;
  99 + width: 100%;
  100 +}
  101 +
  102 +.content {
  103 + max-height: 800rpx;
  104 +min-height: 100rpx;
  105 +padding: 60rpx 35rpx;
  106 +background-color: rgb(255, 255, 255);
  107 +width: 570rpx;
  108 +margin-bottom: 70rpx;
  109 +overflow-y: scroll;
  110 +border-radius: 15rpx;
  111 +line-height: 50rpx;
  112 +font-size: 26rpx;
  113 +color: #545454;
  114 +
  115 +
  116 +}
  117 +
  118 +.close {
  119 + width: 65rpx;
  120 + height: 65rpx;
  121 +}
  122 +
  123 +.xy {
  124 + display: initial;color: #9c9c9c; line-height: 34rpx
  125 +}
  126 +
  127 +.get_code.on{
  128 + color: #666;
  129 +}
  130 +.tubiao_set{
  131 + width: 50rpx; height: 64rpx; margin-right:30rpx; position: relative; top:5rpx;
  132 +}
  133 +.tubiao_set2{
  134 + width: 46rpx; height: 64rpx; margin-right:34rpx;
  135 +}
  136 +.phone_view{
  137 + border-bottom:1rpx solid #e8e8e8 ;
  138 + height: 96rpx; margin-top:50rpx
  139 +
  140 +}
  141 +.phone_view.mt{
  142 + margin-top:20rpx
  143 +}
  144 +.reg_btn{
  145 + margin-top:40rpx; margin-bottom: 20rpx
  146 +}
... ...
pages/user/assistance/assistance.js
... ... @@ -20,7 +20,7 @@ Page({
20 20 switch_head: 0, //0:我的任务,1:活动说明
21 21 zl_act: null, //助力活动
22 22 zl_user_list: [], //任务列表
23   - is_load: 0, //是否已经加载
  23 + is_load: 0, //是否已经加载
24 24 cur_page: 1, //页码
25 25 page_num: 5, //每页多少个
26 26 is_show_more: 0, //是否加载更多
... ... @@ -37,15 +37,16 @@ Page({
37 37 var th = this;
38 38 var nav_b = th.selectComponent("#nav_b"); //组件的id
39 39 nav_b.set_name("助力", "/pages/user/assistance/assistance");
40   - // 助力活动
41   - th.assistance();
  40 +
42 41 },
43 42  
44 43 /**
45 44 * 生命周期函数--监听页面显示
46 45 */
47 46 onShow: function() {
48   -
  47 + var th = this;
  48 + // 助力活动
  49 + th.assistance();
49 50 },
50 51 // 助力活动
51 52 assistance() {
... ... @@ -94,7 +95,9 @@ Page({
94 95  
95 96 var th = this;
96 97 var page = th.data.page;
  98 + if(page==1)th.data.zl_user_list=[];
97 99 var help_id = this.data.help_id;
  100 + var r=Math.random()*100;
98 101 t.request.get("/api/weshop/marketing/help/help/user/page", {
99 102 isShowLoading: true,
100 103 data: {
... ... @@ -102,7 +105,8 @@ Page({
102 105 storeId: os.stoid,
103 106 helpId: help_id,
104 107 page: page,
105   - pageSize: 5
  108 + pageSize: 5,
  109 + r:r,
106 110 },
107 111 success: function(res) {
108 112 clearTimeout(th.data.timer);
... ... @@ -113,7 +117,7 @@ Page({
113 117 })
114 118 if (res.data.code == 0) {
115 119 var list = th.data.zl_user_list;
116   - //连接数组
  120 + //连接数组
117 121 list = list.concat(res.data.data.pageData);
118 122 th.setData({
119 123 zl_user_list: list,
... ... @@ -180,4 +184,4 @@ Page({
180 184 getApp().goto("/pages/user/assistance/giftpacklist?orderSn=" + orderSn);
181 185 }
182 186  
183   -})
184 187 \ No newline at end of file
  188 +})
... ...
pages/user/assistance/giftpacklist.js
... ... @@ -334,10 +334,21 @@ Page({
334 334 bind_bnerr2: function(e) {
335 335 var _errImg = e.target.dataset.errorimg;
336 336 var _errObj = {};
337   - _errObj[_errImg] = "/public/images/empty.jpg";
  337 + _errObj[_errImg] ="/miniapp/images/giftbag/gift01.png";
338 338 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
339 339  
340 340 },
  341 +
  342 + //图片失败,默认图片
  343 + bind_bnerr: function (e) {
  344 + var _errImg = e.target.dataset.errorimg;
  345 + var _errObj = {};
  346 + _errObj[_errImg] = this.data.iurl + "/miniapp/images/empty.jpg";
  347 + //this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  348 + this.setData({ giftImage: this.data.iurl + "/miniapp/images/giftbag/gift01.png"});
  349 +
  350 + },
  351 +
341 352 //关闭导航
342 353 close: function() {
343 354 var th = this;
... ...
pages/user/assistance/giftpacklist.wxml
1 1 <view wx:if="{{is_head}}" class="box data-v-3a5b7e36" bindtap="close">
2 2 <view class="box_top data-v-3a5b7e36">
3   - <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="giftImage"></image>
  3 + <image src="{{giftImage}}" class="data-v-3a5b7e36" data-i='{{giftImage}}' lazy-load="true" binderror="bind_bnerr" data-errorimg="giftImage"></image>
4 4 </view>
5 5 <view class="box_title data-v-3a5b7e36">
6 6 <view class="top_title data-v-3a5b7e36">
... ... @@ -105,9 +105,13 @@
105 105 <view class="foot_button data-v-3a5b7e36">
106 106 <block wx:if="{{is_type!=0}}">
107 107 <block wx:if="{{is_type==1}}">
108   - <view class="foot_button_buy data-v-3a5b7e36" bindtap="GetReceive">
  108 + <view class="foot_button_buy data-v-3a5b7e36" bindtap="GetReceive" wx:if="{{!receiveState}}">
109 109 <text class="data-v-3a5b7e36">一键全部领取</text>
110 110 </view>
  111 +
  112 + <view class="foot_button_buy data-v-3a5b7e36 on" bindtap="GetReceive" wx:else>
  113 + <text class="data-v-3a5b7e36">已领取</text>
  114 + </view>
111 115 </block>
112 116 <block wx:if="{{is_type==2}}">
113 117 <block wx:if="{{is_lb!=1}}">
... ... @@ -141,4 +145,4 @@
141 145 <!-- 弹出框扫描 -->
142 146 <qr_code id="qc_com"></qr_code>
143 147 <!-- 制作一个圆球导航 -->
144   -<nav_b id="nav_b"></nav_b>
145 148 \ No newline at end of file
  149 +<nav_b id="nav_b"></nav_b>
... ...
pages/user/assistance/giftpacklist.wxss
... ... @@ -96,6 +96,7 @@
96 96 border: 2rpx solid #999;
97 97 width: 120rpx;
98 98 height: 120rpx;
  99 + background-color:#f8f8f8;
99 100 /* background-color: rgba(153, 153, 153, 0.664); */
100 101 }
101 102  
... ... @@ -219,6 +220,10 @@
219 220 border-radius: 40rpx;
220 221 }
221 222  
  223 +.foot_button_buy.data-v-3a5b7e36.on{
  224 + background-color: gainsboro; color: #666;
  225 +}
  226 +
222 227 .foot_button_intalge.data-v-3a5b7e36 {
223 228 background: #ffbb42;
224 229 color: #fff;
... ...
pages/user/assistance/task_assistance.js
  1 +var auth = require("../../../utils/auth.js"),
  2 + rq = require("../../../utils/request.js");
  3 +var e = getApp(),
  4 + app = e,
  5 + i = require("../../../utils/util.js"),
  6 + ut = i,
  7 + s = e.globalData.setting,
  8 + os = s,
  9 + app_d = e.globalData;
  10 +var regeneratorRuntime = require('../../../utils/runtime.js');
  11 +Page({
  12 + /**
  13 + * 页面的初始数据
  14 + */
  15 + data: {
  16 + swpie_img: s.imghost + "/miniapp/images/user_index_powder.jpg",
  17 + defaultAvatar: s.imghost + "/miniapp/images/no-head.jpg",//助力头像的默认图
  18 + sw_index: 0, //轮播的下标控制
  19 + url: s.url, //接口网址
  20 + iurl: s.imghost,
  21 + endDate: "", //活动结束时间
  22 + activity_data: "25:20:59", //活动剩余时间
  23 + task_number: 0, //任务数
  24 + is_task: 0, //历史记录与任务
  25 + aitem: "", //活动的轮播图数据
  26 + switch_head: 0, //0:我的任务,1:记录
  27 + help_id: "", //活动的id canvasHidden: 0, //分享图片是否已经生成
  28 + gid: "",
  29 + timer: null, //全局的定时器
  30 + user_task_list: [], //会员列表
  31 + taskid: "", //任务id
  32 + usercount: 0, //参与的人数
  33 + dismantle: [], //帮拆记录数据集
  34 + is_user_task: null, //判断是不是领取的任务
  35 + zzjx_id: "", //真正进行的任务id
  36 + is_show: 0, //任务的加载更多
  37 + is_bc_show: 0, //帮拆的加载更多
  38 + bc_page: 1, //帮拆的页码
  39 + rw_page: 1, //任务的页码
  40 + block: 0, //阻断助力的我的任务在当前位置多次点击
  41 + is_dismantle: 0, //阻断助力的帮拆记录在当前位置多次点击
  42 + is_clik: 0,//点击的时候控制划动
  43 + is_dis_list: 0,//多个数据的时候
  44 + is_user_list: 0,//我的任务点击加载更多的后
  45 +
  46 + //*********************************************start钱
  47 + canvasHidden: 0, //分享图片是否已经生成
  48 + is_share: 0, //是否显示画布
  49 + shareImgPath: [], //生成的图片
  50 + screenWidth: "", //用户的屏幕宽度
  51 + gid: "",
  52 + images: ["miniapp/images/friendhelp/help.png", "miniapp/images/friendhelp/background.png", "miniapp/images/friendhelp/no_check.png",
  53 + "miniapp/images/friendhelp/check.png", "miniapp/images/friendhelp/unfinished.png", "miniapp/images/xc_ellipsis.png"
  54 + ], //固的分享图片
  55 +
  56 + dynamic: null, //已助力的微信头像数组
  57 + head_pic_arr: [], //助力的头像
  58 + share_lb_img: "", //分享的礼包图片
  59 +
  60 + is_generate: 0, //是否重复点击拆一拆
  61 + already: 0, //已有几人助力
  62 + lack: 0, //还差几人助力
  63 + zltime: "", //助力时间
  64 + djs: "", //定时器的显示
  65 + //*********************************************end
  66 + },
  67 +
  68 + /**
  69 + * 生命周期函数--监听页面加载
  70 + */
  71 + onLoad: function (options) {
  72 + var th = this;
  73 + var help_id = options.help_id;
  74 + var nav_b = th.selectComponent("#nav_b"); //组件的id
  75 + nav_b.set_name("助力", "/pages/user/assistance/assistance");
  76 + th.setData({
  77 + help_id: help_id
  78 + });
  79 + //start 钱
  80 + if (options.gid != undefined) {
  81 + th.setData({
  82 + gid: options.gid
  83 + })
  84 + }
  85 + th.close();
  86 + th.syinfo();
  87 + th.imageinfo();
  88 +
  89 + },
  90 +
  91 +
  92 + //选中任务保存
  93 + add_onlicke: function (e) {
  94 + var th = this;
  95 + var taskid = e.target.dataset.taskid;
  96 + var help_id = th.data.help_id;
  97 + var user_id = getApp().globalData.user_id;
  98 + var stoid = os.stoid
  99 + getApp().request.json_post("/api/weshop/marketing/help/help/task/insert", {
  100 + helpId: help_id,
  101 + userId: user_id,
  102 + storeId: stoid,
  103 + taskId: taskid
  104 + },
  105 + function (res) {
  106 + if (res.data.code == 0) {
  107 + getApp().my_warnning(res.data.data, 1, th);
  108 + //判断是不是领取的任务
  109 + th.get_user_task();
  110 + //会员任务列表
  111 + th.user_task_list();
  112 + } else {
  113 + getApp().my_warnning(res.data.msg, 0, th);
  114 + }
  115 + }
  116 +
  117 + )
  118 +
  119 + },
  120 +
  121 +
  122 +
  123 + /**
  124 + * 生命周期函数--监听页面初次渲染完成
  125 + */
  126 + onReady: function () {
  127 +
  128 + },
  129 +
  130 + /**
  131 + * 生命周期函数--监听页面显示
  132 + */
  133 + onShow: function () {
  134 + this.data.is_timer = 1;
  135 + var th = this;
  136 + var help_id = th.data.help_id;
  137 + var user_id = getApp().globalData.user_id;
  138 +
  139 + /*-----助力活动(判断)-----*/
  140 + rq.get("/api/weshop/marketing/help/act/judge", {
  141 + data: {
  142 + userId: user_id,
  143 + storeId: os.stoid
  144 + },
  145 + success: function (res) {
  146 + if (res.data.code == 0) {
  147 + var help_data = res.data.data;
  148 + th.setData({
  149 + endDate: help_data.endDate,
  150 + });
  151 +
  152 + //任务时间 设置全局定时器
  153 + th.setData({
  154 + timer: setInterval(function () {
  155 + th.countDown();
  156 + }, 1000)
  157 + })
  158 +
  159 +
  160 + }
  161 + }
  162 + });
  163 +
  164 +
  165 + /*-----获取助力活动的任务-----*/
  166 + rq.get("/api/weshop/marketing/help/help/task/page", {
  167 + data: {
  168 + helpId: help_id,
  169 + storeId: os.stoid
  170 + },
  171 + success: function (su) {
  172 + var data = su.data;
  173 + if (data.code != 0) {
  174 + getApp().my_warnning(data.msg, 0, th);
  175 + return false;
  176 + }
  177 + if (data.code == 0) {
  178 + //轮播图的数据
  179 + var data_aissa = data.data.pageData;
  180 + //当前时间戳
  181 + var nt = ut.gettimestamp();
  182 +
  183 + data_aissa.forEach(function (val, ind) {
  184 +
  185 + //已开始
  186 + if (val.start_time < nt && val.end_time > nt) data_aissa[ind].status = 0;
  187 + //未开始
  188 + else if (val.start_time > nt && val.end_time > nt) data_aissa[ind].status = 1;
  189 + //已结束
  190 + else if (val.start_time < nt && val.end_time < nt) data_aissa[ind].status = 2;
  191 + });
  192 + var task_number = data_aissa[0].giftQty - data_aissa[0].useGiftQty;
  193 + var taskid = data_aissa[0].id;
  194 + th.setData({
  195 + aitem: data_aissa,
  196 + task_number: task_number,
  197 + taskid: taskid
  198 + });
  199 + //判断是不是领取的任务
  200 + th.get_user_task();
  201 +
  202 + }
  203 +
  204 + }
  205 + })
  206 +
  207 + // 分享的
  208 + // setTimeout(function() {
  209 + // th.shareFrends();
  210 + // }, 1000)
  211 +
  212 + //会员任务列表
  213 + this.user_task_list();
  214 + //获取助力活动参与的人数
  215 + this.get_user_task_num();
  216 +
  217 + },
  218 + //记录加载更多
  219 + dismantle_record_list: function () {
  220 + this.setData({ is_dismantle: 0 });
  221 + this.dismantle_record();
  222 + },
  223 +
  224 + dismantle_record_click(){
  225 + if(this.data.switch_head==1) return false;
  226 + this.setData({ is_dismantle: 0 });
  227 + this.dismantle_record();
  228 + },
  229 +
  230 + //帮拆记录的
  231 + dismantle_record: function (e) {
  232 + //优化
  233 + if (this.data.is_dismantle == 1) {
  234 + return false;
  235 + }
  236 +
  237 + var aitem = this.data.aitem; //任务的数据集
  238 + var sw_index = this.data.sw_index; //轮播的下标
  239 + //任务id
  240 + var taskid = aitem[sw_index].id;
  241 + var th = this;
  242 + var index = 1; //获取当前选择的是任务还是活动说明
  243 + var is_task = this.data.is_task; //0任务,1帮拆
  244 + if (is_task == undefined || is_task == null) {
  245 + is_task = 1;
  246 + }
  247 + var switch_head = this.data.switch_head;
  248 + if (switch_head == undefined || switch_head == null) {
  249 + switch_head = 1;
  250 + }
  251 + this.setData({
  252 + is_task: 1,
  253 + switch_head: 1,
  254 + block: 0,
  255 + });
  256 +
  257 + var bc_page = th.data.bc_page;
  258 + rq.get("/api/weshop/marketing/help/help/task/involve/page", {
  259 + data: {
  260 + page: bc_page,
  261 + pageSize: 5,
  262 + taskId: taskid,
  263 + userId: getApp().globalData.user_id,
  264 + storeId: os.stoid
  265 + },
  266 + success: function (res) {
  267 + if (res.data.code == 0) {
  268 + th.setData({ is_dismantle: 1 });
  269 + var dismantle = res.data.data.pageData[0].zlHelpUser;
  270 + if (res.data.data.total > 5) {
  271 + var bc_page = th.data.bc_page + 1;
  272 + var dismantle_s = th.data.dismantle.concat(dismantle);
  273 + th.setData({
  274 + bc_page: bc_page,
  275 + is_bc_show: 1,
  276 + dismantle: dismantle_s,
  277 + is_dis_list: 1
  278 + })
  279 + } else {
  280 + th.setData({
  281 + dismantle: dismantle,
  282 + is_dis_list: 0
  283 + });
  284 + }
  285 + var dis_len = th.data.dismantle.length;
  286 + if (res.data.data.total == dis_len) {
  287 + th.setData({
  288 + is_dis_list: 0,
  289 + })
  290 + }
  291 + th.setData({
  292 +
  293 + is_clik: 0,
  294 + });
  295 + } else {
  296 + th.setData({
  297 + dismantle: null
  298 + });
  299 + }
  300 + }
  301 +
  302 + })
  303 + },
  304 + // 领取礼包
  305 + get_libao: function (e) {
  306 + var libao_id = e.currentTarget.dataset.libaoid; //礼包id
  307 + var taskid = e.currentTarget.dataset.taskid;
  308 + var taskingid = e.currentTarget.dataset.taskingid;
  309 + getApp().goto("/pages/user/assistance/giftpacklist?help_id=" + this.data.help_id + "&is_libao=" + 1 + "&taskId=" + taskid + "&id=" + taskingid);
  310 + },
  311 + //查看礼包id
  312 + select_libao: function (e) {
  313 + var orderSn = e.currentTarget.dataset.ordersn;
  314 + getApp().goto("/pages/user/assistance/giftpacklist?orderSn=" + orderSn);
  315 + },
  316 +
  317 + //划动的时候监听
  318 + onSli: function (e) {
  319 + var arr = [];
  320 + this.setData({
  321 + dismantle: arr
  322 + });
  323 + var th = this;
  324 + var ind = e.detail.current;
  325 + var aitem = this.data.aitem;
  326 + var task_number = aitem[ind].giftQty - aitem[ind].useGiftQty;
  327 + var task_id = aitem[ind].id;
  328 + th.setData({
  329 + sw_index: ind,
  330 + task_number: task_number,
  331 + taskid: task_id,
  332 + is_dismantle: 0,
  333 + bc_page: 1
  334 + });
  335 +
  336 + if (this.data.switch_head == 1 && th.data.is_clik == 0) {
  337 + //判断有没有帮拆记录
  338 + this.dismantle_record();
  339 + }
  340 + //判断是不是领取的任务
  341 + th.get_user_task();
  342 +
  343 + },
  344 + //导航球
  345 + close: function () {
  346 + var th = this;
  347 + var nav_b = th.selectComponent("#nav_b"); //组件的id
  348 + nav_b.close_box();
  349 + },
  350 + //我的任务点击加载更多
  351 + task_list: function () {
  352 + this.setData({ block: 0 });
  353 + this.user_task_list();
  354 + },
  355 + // 获取会员的参与的任务列表 我的任务
  356 + user_task_list: function (e) {
  357 + var th = this;
  358 + //防止已经当前位置的时候多次点击
  359 + if (th.data.block == 1) { return false; }
  360 + th.data.block=1;
  361 + var index = 0;
  362 + var is_task = this.data.is_task; //0任务,1帮拆
  363 + if (is_task == undefined || is_task == null) {
  364 + is_task = 0;
  365 + }
  366 + var switch_head = this.data.switch_head;
  367 + if (switch_head == undefined || switch_head == null) {
  368 + switch_head = 0;
  369 + }
  370 + this.setData({
  371 + is_task: index,
  372 + switch_head: index,
  373 + user_task_list:[],
  374 + });
  375 + var help_id = th.data.help_id;
  376 + var user_id = getApp().globalData.user_id;
  377 + var rw_page = th.data.rw_page;
  378 + if(rw_page==1)th.data.zl_user_list=[];
  379 + var r=Math.random()*100;
  380 + rq.get("/api/weshop/marketing/help/help/user/page", {
  381 + data: {
  382 + page: rw_page,
  383 + pageSize: 5,
  384 + helpId: help_id,
  385 + storeId: os.stoid,
  386 + userId: user_id,
  387 + r:r,
  388 + },
  389 + success: function (su) {
  390 + th.data.block=0
  391 + if (su.data.code == 0) {
  392 + if (su.data.data.total > 5) {
  393 + var rw_page = th.data.rw_page + 1;
  394 + th.setData({
  395 + rw_page: rw_page,
  396 + is_show: 1
  397 + })
  398 +
  399 + }
  400 +
  401 +
  402 + var user_list = su.data.data.pageData;
  403 + // if (user_list == "" || user_list.length == 0 || user_list==null){
  404 + // th.setData({
  405 + // is_user_list: 1
  406 + // });
  407 + // console.log("走哪里1111");
  408 + // }else{}
  409 + console.log("走哪里22222222");
  410 + var user_lists = th.data.user_task_list.concat(user_list);
  411 + th.setData({
  412 + user_task_list: user_lists
  413 + });
  414 + } else {
  415 + th.setData({ is_user_list: 1 });
  416 + getApp().my_warnning(su.data.msg, 0, th);
  417 + }
  418 + }
  419 + })
  420 + },
  421 + //判断是否有领取任务 获取正在进行中的任务
  422 + get_user_task: function () {
  423 + var user_id = getApp().globalData.user_id;
  424 + var th = this;
  425 + var aitem = th.data.aitem;
  426 + var sw_index = th.data.sw_index;
  427 + var taskid = aitem[sw_index].id
  428 + rq.get("/api/weshop/marketing/help/help/task/get", {
  429 + data: {
  430 + storeId: os.stoid,
  431 + userId: user_id,
  432 + taskId: taskid
  433 + },
  434 + success: function (res) {
  435 + if (res.data.code == 0) {
  436 + var is_usertask = res.data.data;
  437 + th.setData({
  438 + is_user_task: is_usertask
  439 + });
  440 + }
  441 + }
  442 + })
  443 + },
  444 + //获取助力活动参与的人数
  445 + get_user_task_num: function () {
  446 + var th = this;
  447 + var help_id = th.data.help_id;
  448 + rq.get("/api/weshop/marketing/help/involve/help/act/people/count", {
  449 + data: {
  450 + helpId: help_id,
  451 + storeId: os.stoid,
  452 + },
  453 + success: function (su) {
  454 + if (su.data.code == 0) {
  455 + var usercount = su.data.data.countAll;
  456 +
  457 + th.setData({
  458 + usercount: usercount
  459 + });
  460 + }
  461 + }
  462 + })
  463 +
  464 + },
  465 + //轮播卡死的重置
  466 + changeGoodsSwip: function (detail) {
  467 + if (detail.detail.source == "touch") {
  468 + //当页面卡死的时候,current的值会变成0
  469 + if (detail.detail.current == 0) {
  470 + //有时候这算是正常情况,所以暂定连续出现3次就是卡了
  471 + let swiperError = this.data.swiperError
  472 + swiperError += 1
  473 + this.setData({
  474 + swiperError: swiperError
  475 + })
  476 + if (swiperError >= 3) { //在开关被触发3次以上
  477 + this.setData({
  478 + sw_index: this.data.preIndex
  479 + }); //,重置current为正确索引
  480 + this.setData({
  481 + swiperError: 0
  482 + })
  483 + }
  484 + } else { //正常轮播时,记录正确页码索引
  485 + this.setData({
  486 + preIndex: detail.detail.current
  487 + });
  488 + //将开关重置为0
  489 + this.setData({
  490 + swiperError: 0
  491 + })
  492 + }
  493 + }
  494 + },
  495 +
  496 + // 轮播图点击左边
  497 + click_pre: function () {
  498 + var arr = [];
  499 + this.setData({
  500 + dismantle: arr
  501 + });
  502 + var index = this.data.sw_index;
  503 + index--;
  504 + if (index < 0) return;
  505 + var aitem = this.data.aitem;
  506 + var task_number = aitem[index].giftQty - aitem[index].useGiftQty;
  507 + var task_id = aitem[index].id;
  508 + this.setData({
  509 + sw_index: index,
  510 + task_number: task_number,
  511 + taskid: task_id,
  512 + is_dismantle: 0,
  513 + is_clik: 1,
  514 + bc_page: 1
  515 + })
  516 + if (this.data.switch_head == 1) {
  517 + //判断有没有帮拆记录
  518 + console.log("往左点////////////////////");
  519 + this.dismantle_record();
  520 + }
  521 + if (this.data.switch_head == 0) {
  522 + //判断有没有领取任务
  523 + this.get_user_task();
  524 + }
  525 +
  526 + },
  527 + //轮播图点击右边
  528 + click_next: function () {
  529 + var arr = [];
  530 + this.setData({
  531 + is_clik: 1,
  532 + dismantle: arr
  533 + });
  534 + var index = this.data.sw_index;
  535 + index++;
  536 + if (index >= this.data.aitem.length) return;
  537 + var aitem = this.data.aitem;
  538 + var task_number = aitem[index].giftQty - aitem[index].useGiftQty;
  539 + var task_id = aitem[index].id;
  540 + this.setData({
  541 + sw_index: index,
  542 + task_number: task_number,
  543 + taskid: task_id,
  544 + is_dismantle: 0,
  545 + bc_page: 1,
  546 + })
  547 + if (this.data.switch_head == 1) {
  548 + this.dismantle_record();
  549 + }
  550 + },
  551 +
  552 + /**
  553 + * 生命周期函数--监听页面隐藏
  554 + */
  555 + onHide: function () {
  556 + //--清理定时器--
  557 + clearInterval(this.data.timer);
  558 + },
  559 +
  560 + /**
  561 + * 生命周期函数--监听页面卸载
  562 + */
  563 + onUnload: function () {
  564 +
  565 + },
  566 +
  567 + /**
  568 + * 页面相关事件处理函数--监听用户下拉动作
  569 + */
  570 + onPullDownRefresh: function () {
  571 +
  572 + },
  573 + //----助力任务的时间-----
  574 + countDown() {
  575 + if (!this.data.is_timer) return false;
  576 + var th = this;
  577 + // 获取当前时间,同时得到活动结束时间数组
  578 + var newTime = ut.gettimestamp();
  579 +
  580 + // 对结束时间进行处理渲染到页面
  581 +
  582 + // var o = endTimeList[i];
  583 + var endTime = th.data.endDate;
  584 + // if (o.status == 0) endTime = o.start_time
  585 +
  586 + var obj = null;
  587 + // 如果活动未结束,对时间进行处理
  588 + if (endTime - newTime > 0) {
  589 + var time = (endTime - newTime);
  590 + // 获取天、时、分、秒
  591 + var day = parseInt(time / (60 * 60 * 24));
  592 + var hou = parseInt(time % (60 * 60 * 24) / 3600);
  593 + var min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  594 + var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
  595 + obj = {
  596 + day: this.timeFormat(day),
  597 + hou: this.timeFormat(hou),
  598 + min: this.timeFormat(min),
  599 + sec: this.timeFormat(sec)
  600 + }
  601 + } else {
  602 + //活动已结束,全部设置为'00'
  603 + obj = {
  604 + day: '00',
  605 + hou: '00',
  606 + min: '00',
  607 + sec: '00'
  608 + }
  609 + }
  610 + var txt = "aitem[" + 0 + "].djs";
  611 + th.setData({
  612 + [txt]: obj
  613 + });
  614 + },
  615 + //---小于10的格式化函数----
  616 + timeFormat(param) {
  617 + return param < 10 ? '0' + param : param;
  618 + },
  619 +
  620 + /**
  621 + * 页面上拉触底事件的处理函数
  622 + */
  623 + onReachBottom: function () {
  624 +
  625 + },
  626 +
  627 + /**
  628 + * 用户点击右上角分享
  629 + */
  630 + onShareAppMessage: function () {
  631 +
  632 + },
  633 +
  634 + preview: function () {
  635 + var th = this;
  636 + var shareImgPath = th.data.shareImgPath;
  637 + wx.previewImage({
  638 + url: shareImgPath[0],
  639 + urls: shareImgPath
  640 + })
  641 + },
  642 +
  643 + //关闭分享显示
  644 + close_share: function () {
  645 + var th = this;
  646 + th.setData({
  647 + is_share: 0
  648 + })
  649 + },
  650 + syinfo: function () {
  651 + var th = this;
  652 + //获取用户设备信息,屏幕宽度
  653 + wx.getSystemInfo({
  654 + success: res => {
  655 + th.setData({
  656 + screenWidth: res.screenWidth
  657 + })
  658 + }
  659 + })
  660 + },
  661 +
  662 +
  663 +
  664 + //************************ */
  665 + shareFrends: function (e) {
  666 + var th = this;
  667 + if (th.data.is_generate) return;
  668 + th.data.is_generate = 1;
  669 +
  670 + var scene = 1;
  671 + ///二微码
  672 + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
  673 + os.stoid + "?sceneValue=" + scene + "&pageValue=pages/index/index/index";
  674 + //读取文件成功则OK--
  675 + wx.getImageInfo({
  676 + src: path3,
  677 + success: function (res) {
  678 +
  679 + var ewm_path = res.path; //
  680 + //var act_time="2019.06.26 - 2019.07.02"; //活动的时间
  681 + var bg_time = ut.formar_no_full(th.data.dynamic.beginDate);
  682 + var end_time = ut.formar_no_full(th.data.dynamic.endDate);
  683 + var act_time = bg_time + "-" + end_time;
  684 +
  685 +
  686 + var iurl = th.data.iurl; //图片地址前缀
  687 + const ctx = wx.createCanvasContext('share_id'); //绘图上下文
  688 + var unit = th.data.screenWidth / 750 * 1.35;
  689 + var numsize = 20 * unit; //几人助力字体大小
  690 + var head_list_img = th.data.head_pic_arr;
  691 + var num = th.data.head_pic_arr.length; //已有几位好友助力
  692 +
  693 + var aitem = th.data.aitem; //任务的数据集
  694 + var sw_index = th.data.sw_index; //轮播的下标
  695 + //任务id
  696 + var help_num = aitem[sw_index].helpNum;
  697 + var q_num = help_num - num; //还差几位好友助力
  698 + var already = num.toString().length + 1; //已有几位好友助力
  699 + var lack = q_num.toString().length + 1; //还差几位好友助力
  700 +
  701 + var size = 15 * unit;
  702 + var imagesize = 40 * unit; //助力人的图片大小
  703 + var left = 74 * unit; //助力人头像跟左边的距离
  704 + var spacing = 12 * unit; //助力人图片间距
  705 + var images = th.data.images;
  706 + ctx.drawImage(images[0], 0, 0, 445 * unit, 700 * unit); //分享的背景图片
  707 + ctx.drawImage(images[1], 37 * unit, 185 * unit, 370 * unit, 377 * unit); //分享的背景图片
  708 +
  709 +
  710 + ctx.drawImage(th.data.share_lb_img, 90 * unit, 231 * unit, 266 * unit, 160 * unit); //分享的礼包的背景图片
  711 +
  712 + ctx.setFillStyle("rgb(221,153,116)");
  713 + ctx.setFontSize(size)
  714 + ctx.fillText("已有", 77 * unit, 430 * unit);
  715 + ctx.setFillStyle("#FF4746");
  716 + ctx.setFontSize(numsize)
  717 + ctx.fillText(num + "位", 108 * unit, 430 * unit);
  718 + ctx.setFillStyle("rgb(221,153,116)");
  719 + ctx.setFontSize(size)
  720 + ctx.fillText("好友助力,还差", 116 * unit + already * numsize * unit, 430 * unit);
  721 + ctx.setFillStyle("#FF4746");
  722 + ctx.setFontSize(numsize);
  723 + ctx.fillText(q_num + "位", 223 * unit + already * numsize * unit, 430 * unit);
  724 + ctx.setFillStyle("rgb(221,153,116)");
  725 + ctx.setFontSize(size);
  726 + ctx.fillText("达成助力", 230 * unit + lack * numsize * unit + already * numsize * unit, 430 * unit);
  727 + var c = num / help_num;
  728 + ctx.drawImage(images[2], 65 * unit, 445 * unit, 320 * unit, 12 * unit);
  729 + ctx.drawImage(images[3], 65 * unit, 445 * unit, 320 * unit * c, 12 * unit);
  730 + var head_list_num = 30;
  731 + var is_head_list = 0;
  732 +
  733 + //当需要助力人数小与6个
  734 + if (help_num < 6) {
  735 + var pos_arr = ut.get_box_arr(help_num, 225.25 * unit, 505 * unit, spacing, imagesize / 2);
  736 + var now_ind = 0;
  737 + //--判断已助力的人数--
  738 + for (var a = 0; a < head_list_img.length; a++) {
  739 + var pos = pos_arr[now_ind];
  740 + ut.draw_circle(ctx, pos.x, pos.y, imagesize / 2, head_list_img[a], 'red', unit);
  741 + now_ind++;
  742 + }
  743 + //--显示还差的人数--
  744 + if (help_num - head_list_img.length > 0) {
  745 + var neednum = help_num - head_list_img.length;
  746 + //这个是还未助力的位置
  747 + for (var i = 0; i < neednum; i++) {
  748 + var pos = pos_arr[now_ind];
  749 + now_ind++;
  750 + // 助力人的头像
  751 + ctx.drawImage(images[4], pos.x - imagesize / 2, pos.y - imagesize / 2, imagesize, imagesize); //分享的背景图片
  752 +
  753 + }
  754 + }
  755 +
  756 + } else if (help_num > 7) {
  757 + //助力头像数量, 是不是要显示省略图
  758 + var zl_head = 0, is_sheng = 0;
  759 + if (head_list_img.length >= 6) {
  760 + zl_head = 5; is_sheng = 1;
  761 + } else {
  762 + zl_head = head_list_img.length;
  763 + }
  764 +
  765 +
  766 + //判断已助力的人数
  767 + for (var a = 0; a < zl_head; a++) {
  768 + //绘制头像
  769 + ut.draw_circle(ctx, left + imagesize / 2, 505 * unit, imagesize / 2, head_list_img[a], 'red', unit);
  770 + left += imagesize + spacing;
  771 + }
  772 +
  773 + //如果是省略号的话
  774 + if (is_sheng) {
  775 + ctx.drawImage(images[5], left, 505 * unit - imagesize / 2, imagesize, imagesize); //头像的省略图片
  776 + } else {
  777 + //这个是还未助力的位置
  778 + for (var i = 0; i < 6 - head_list_img.length; i++) {
  779 + // 助力人的头像
  780 + ctx.drawImage(images[4], left, 505 * unit - imagesize / 2, imagesize, imagesize); //分享的?号图片
  781 + left += imagesize + spacing;
  782 + }
  783 + }
  784 + } else {
  785 + // 判断已助力的人数
  786 + for (var a = 0; a < head_list_img.length; a++) {
  787 + ctx.save();
  788 + ctx.beginPath(); //开始绘制
  789 + ctx.arc(left + imagesize / 2, 505 * unit, imagesize / 2, 0, 2 * Math.PI);
  790 + ctx.setLineWidth(4 * unit);
  791 + ctx.setStrokeStyle('red');
  792 + ctx.setFillStyle("white");
  793 + ctx.fill();
  794 + ctx.clip();
  795 + ctx.drawImage(head_list_img[a], left, 505 * unit - imagesize / 2, imagesize, imagesize);
  796 + ctx.restore();
  797 + left += imagesize + spacing;
  798 + }
  799 +
  800 + if (help_num - head_list_img.lengt > 0) {
  801 + var neednum = help_num - head_list_img.length;
  802 + //这个是还未助力的位置
  803 + for (var i = 0; i < neednum; i++) {
  804 + // 助力人的头像
  805 + ctx.drawImage(images[4], left, 505 * unit - imagesize / 2, imagesize, imagesize); //分享的背景图片
  806 + left += imagesize + spacing;
  807 + }
  808 + }
  809 +
  810 + }
  811 +
  812 + ctx.setFillStyle("rgb(255,255,255)");
  813 + ctx.setFontSize(size);
  814 + ctx.fillText("优惠乐翻天,精彩就在你身边!", 37 * unit, 595 * unit);
  815 + ctx.setFillStyle("rgb(255,255,255)");
  816 + ctx.setFontSize(size);
  817 + ctx.fillText(act_time, 37 * unit, 620 * unit); //绘制活动是时间
  818 + ctx.setFillStyle("rgb(255,255,255)");
  819 + ctx.setFontSize(size);
  820 + ctx.fillText("长按识别二维码,可帮我助力!", 37 * unit, 660 * unit);
  821 + ctx.drawImage(ewm_path, 325 * unit, 585 * unit, 77 * unit, 77 * unit); //分享的背景图片
  822 + ctx.save();
  823 + //读取文件成功则OK--
  824 + // wx.getImageInfo({
  825 + // src: path3,
  826 + // success: function (res) {
  827 + //把画板内容绘制成图片,并回调 画板图片路径
  828 + ctx.draw(false, function () {
  829 + setTimeout(function () {
  830 + wx.canvasToTempFilePath({
  831 + x: 0,
  832 + y: 0,
  833 + width: 300,
  834 + height: 500,
  835 + destWidth: 400 * 2,
  836 + destHeight: 720 * 2,
  837 + canvasId: 'share_id',
  838 + success: function (res) {
  839 + wx.hideLoading();
  840 + var shareImgPath = th.data.shareImgPath;
  841 + shareImgPath[0] = res.tempFilePath;
  842 +
  843 + th.setData({
  844 + shareImgPath: shareImgPath,
  845 + canvasHidden: 1,
  846 + is_share: 1,
  847 + is_generate: 0,
  848 + canvasHidden: 1
  849 + })
  850 + if (!res.tempFilePath) {
  851 + wx.showModal({
  852 + title: '提示',
  853 + content: '图片绘制中,请稍后重试',
  854 + showCancel: false
  855 + })
  856 + return false;
  857 + }
  858 +
  859 + },
  860 + fail(r) {
  861 +
  862 + }
  863 + }, 500)
  864 + })
  865 + })
  866 + }
  867 + })
  868 +
  869 +
  870 + },
  871 +
  872 +
  873 + preview: function () {
  874 + var th = this;
  875 + var shareImgPath = th.data.shareImgPath;
  876 + wx.previewImage({
  877 + url: shareImgPath[0],
  878 + urls: shareImgPath
  879 + })
  880 + th.setData({
  881 + is_share: 0
  882 + })
  883 + },
  884 +
  885 + //关闭分享显示
  886 + close_share: function () {
  887 + var th = this;
  888 + wx.hideLoading();
  889 + th.setData({
  890 + is_share: 0
  891 + })
  892 + },
  893 + syinfo: function () {
  894 + var th = this;
  895 + //获取用户设备信息,屏幕宽度
  896 + wx.getSystemInfo({
  897 + success: res => {
  898 + th.setData({
  899 + screenWidth: res.screenWidth
  900 + })
  901 + }
  902 + })
  903 + },
  904 +
  905 + //把固定的图片加载到本地
  906 + imageinfo: async function () {
  907 + var th = this;
  908 + var images = th.data.images;
  909 + var iurl = th.data.iurl;
  910 + for (var i in images) {
  911 + var img_path = iurl + images[i];
  912 + await getApp().request.promise_downimg(img_path).then(res => {
  913 + images[i] = res;
  914 + })
  915 + }
  916 +
  917 + th.data.images = images;
  918 + },
  919 +
  920 +
  921 + //好友猜一猜
  922 + save_share: function (e) {
  923 + var th = this;
  924 + var aitem = this.data.aitem; //任务的数据集
  925 + var sw_index = this.data.sw_index; //轮播的下标
  926 + var sw_item = aitem[sw_index];
  927 + //任务id
  928 + var taskid = sw_item.id;
  929 + th.setData({
  930 + is_share: 1
  931 + })
  932 + var url = "/api/weshop/marketing/help/help/task/involve/page";
  933 + getApp().request.promiseGet(url, {
  934 + isShowLoading: true,
  935 + data: {
  936 + storeId: os.stoid,
  937 + taskId: taskid,
  938 + userId: getApp().globalData.user_id
  939 + }
  940 + }).then(res => {
  941 + if (res.data.code == 0) {
  942 + var data = res.data.data.pageData; //帮拆数组
  943 + if (data.length > 0) {
  944 + th.data.dynamic = data[0];
  945 + var path = th.data.iurl + sw_item.giftBagUrl;
  946 + //先获取礼包分享时的本地路径
  947 + getApp().request.promise_downimg(path).then(res => {
  948 + th.data.share_lb_img = res;
  949 + //先获取会员的头像
  950 + th.info_head(th.shareFrends);
  951 + });
  952 + }
  953 + } else {
  954 + wx.hideLoading();
  955 + getApp().my_warnning(res.data.msg, 0, th);
  956 + }
  957 + })
  958 + },
  959 +
  960 + //把已助力好友头像下载到本地
  961 + info_head: async function (func) {
  962 + var th = this;
  963 + var images = th.data.dynamic.zlHelpUser;
  964 + var arr = new Array();
  965 + var block = th.data.block;
  966 + if (images) {
  967 + th.data.head_pic_arr.length = 0;
  968 + for (var i in images) {
  969 + var img_path = images[i].headPic;
  970 + await getApp().request.promise_downimg(img_path).then(res => {
  971 + th.data.head_pic_arr.push(res);
  972 + })
  973 + }
  974 + }
  975 + func();
  976 + },
  977 + //立即兑换
  978 + redeem_now: function (e) {
  979 + var libao_id = e.currentTarget.dataset.libaoid;
  980 + var sw_index = this.data.sw_index;
  981 + var aitem = this.data.aitem;
  982 + var taskid = aitem[sw_index].id;
  983 + var taskingid = e.currentTarget.dataset.taskingid;
  984 + getApp().goto("/pages/user/assistance/giftpacklist?help_id=" + this.data.help_id + "&is_libao=" + 1 + "&taskId=" + taskid + "&id=" + taskingid);
  985 + },
  986 +
  987 +
  988 + //礼包的详情 轮播图
  989 + libao_details: function (e) {
  990 + var th = this;
  991 + var help_id = th.data.help_id; //活动id
  992 + var taskId = e.currentTarget.dataset.taskid; //任务id
  993 + getApp().goto("/pages/user/assistance/giftpacklist?help_id=" + help_id + "&is_libao=" + 0 + "&taskId=" + taskId);
  994 + },
  995 +
  996 + user_task_list_click:function(){
  997 + if (this.data.switch_head==0) return false;
  998 + this.data.block=0;
  999 + this.user_task_list();
  1000 + },
  1001 +
  1002 +
  1003 + //--测试用--
  1004 + test:function(){
  1005 + var ind=this.data.sw_index;
  1006 + var aitem = this.data.aitem;
  1007 + var task_id = aitem[ind].id;
  1008 + getApp().goto("/pages/test/zhuli_test?taskId="+task_id);
  1009 + }
  1010 +
  1011 +})
... ...
pages/user/assistance/task_assistance.wxml
... ... @@ -55,10 +55,10 @@
55 55 <view wx:if="{{is_user_task!=null&&is_user_task.status==1}}" class="task_clike fs40 t-c flex-center" data-libaoid="{{is_user_task.helpListGiftBagId}}"data-taskingid="{{is_user_task.id}}" bindtap="redeem_now">
56 56 立即兑换
57 57 </view>
58   - <view wx:if="{{is_user_task!=null&&is_user_task.status==0}}" class="task_clike fs40 t-c flex-center"data-taskid="{{is_user_task.id}}" bindtap="test">
59   - <!-- <input placeholder="请输助力用户的id" maxlength="11" bindblur="testinput"></input>
60   - <view ></view> -->
61   - 测试专用
  58 +
  59 +
  60 + <view class="task_clike fs40 t-c flex-center"data-taskid="{{}}" bindtap="test">
  61 + 测试专用帮被人拆
62 62 </view>
63 63  
64 64 </view>
... ... @@ -67,20 +67,20 @@
67 67 <!-- 标题 -->
68 68  
69 69 <view class="flex-vertical-between fs28 padding head">
70   - <view class="flex-center lhead {{switch_head==0?'rhead':''}}" bindtap="user_task_list" data-index="0">
  70 + <view class="flex-center lhead {{switch_head==0?'rhead':''}}" bindtap="user_task_list_click" data-index="0">
71 71 <image class="unfinished" src="{{iurl}}miniapp/images/friendhelp/task.png" lazy-load="true"></image>
72 72 <view>我的任务</view>
73 73 </view>
74   - <view class="flex-center lhead {{switch_head==1?'rhead':''}}" bindtap="dismantle_record" data-index='1'>
  74 + <view class="flex-center lhead {{switch_head==1?'rhead':''}}" bindtap="dismantle_record_click" data-index='1'>
75 75 <image class="unfinished" style="margin-top: 5rpx;" src="{{iurl}}miniapp/images/friendhelp/edit.png" lazy-load="true"></image>
76 76 <view>帮拆记录</view>
77 77 </view>
78 78 </view>
79 79  
80 80 <view class="white">
81   -
  81 +
82 82 <view class="items" wx:if="{{is_task==0}}">
83   - <view class="tesk_list">
  83 + <view class="tesk_list">
84 84 <view class="item fs26 flex-vertical-between padding" wx:for="{{user_task_list}}" wx:key="*this">
85 85 <view class="flex-center width">
86 86 <view class="ellipsis-1">{{item.helpTaskName}}
... ... @@ -92,7 +92,7 @@
92 92 <text wx:if="{{item.status==2}}" bindtap="select_libao" data-orderSn="{{item.orderSn}}">查看礼包</text>
93 93 <text wx:if="{{item.status==1}}" bindtap="get_libao" data-libaoid="{{item.helpListGiftBagId}}"data-taskingid="{{item.id}}" data-taskid="{{item.helpTaskId}}">领取礼包 </text>
94 94 </view>
95   - </view>
  95 + </view>
96 96 </view>
97 97 </view>
98 98  
... ... @@ -167,4 +167,4 @@
167 167 <!-- 引入提示组件 -->
168 168 <warn id="warn"></warn>
169 169 <!-- 制作一个圆球导航 -->
170   -<nav_b id="nav_b"></nav_b>
171 170 \ No newline at end of file
  171 +<nav_b id="nav_b"></nav_b>
... ...