diff --git a/pages/user/assistance/task_assistance.js b/pages/user/assistance/task_assistance.js index 5181a71..3f60597 100644 --- a/pages/user/assistance/task_assistance.js +++ b/pages/user/assistance/task_assistance.js @@ -17,21 +17,40 @@ Page({ sw_index: 0, //轮播的下标控制 url: s.url, //接口网址 iurl: s.imghost, - endDate:"",//活动结束时间 + endDate: "", //活动结束时间 activity_data: "25:20:59", //活动剩余时间 - task_number:0, //任务数 + task_number: 0, //任务数 is_task: 0, //历史记录与任务 - aitem: "", //活动的轮播图 + aitem: "", //活动的轮播图数据 switch_head: 0, //0:我的任务,1:记录 help_id: "", //活动的id canvasHidden: 0, //分享图片是否已经生成 + is_share: 1, //是否显示画布 + shareImgPath: [], //生成的图片 + screenWidth: "", //用户的屏幕宽度 + gid: "", + timer: null, //全局的定时器 + user_task_list: null, //会员列表 + taskid: "", //任务id + usercount: 0, //参与的人数 + dismantle: null, //帮拆记录数据集 + is_shares:111111,//判断是不是要分享的 + + //*********************************************start钱 + canvasHidden: 0, //分享图片是否已经生成 is_share: 0, //是否显示画布 shareImgPath: [], //生成的图片 screenWidth: "", //用户的屏幕宽度 gid: "", - timer: null,//全局的定时器 - user_task_list:null,//会员列表 - taskid:"",//任务id - usercount:0,//参与的人数 + images: ["miniapp/images/friendhelp/help.png", "miniapp/images/friendhelp/background.png", "miniapp/images/friendhelp/no_check.png", + "miniapp/images/friendhelp/check.png", "miniapp/images/friendhelp/unfinished.png", + "/public/upload/libao/temp/2019/12-20/51f251f44ea0f67b8efdc5bfa3a434b0.jpg" + ], //固的分享图片 + dynamic: [], //已助力的微信头像数组 + is_generate: 0, //是否重复点击拆一拆 + already: 0, //已有几人助力 + lack: 0, //还差几人助力 + zltime: "", //助力时间 + //*********************************************end }, /** @@ -43,6 +62,7 @@ Page({ th.setData({ help_id: help_id }); + //start 钱 if (options.gid != undefined) { th.setData({ gid: options.gid @@ -51,81 +71,38 @@ Page({ th.close(); th.syinfo(); // th.imageinfo(); + //end }, - - + + //选中任务保存 - add_onlicke:function(e){ - var th=this; - var taskid=e.target.dataset.taskid; + add_onlicke: function(e) { + var th = this; + var taskid = e.target.dataset.taskid; var help_id = th.data.help_id; var user_id = getApp().globalData.user_id; - var stoid=os.stoid - getApp().request.json_post("/api/weshop/marketing/help/help/task/insert" - ,{ - helpId:help_id, - userId:user_id, - storeId:stoid, + var stoid = os.stoid + getApp().request.json_post("/api/weshop/marketing/help/help/task/insert", { + helpId: help_id, + userId: user_id, + storeId: stoid, taskId: taskid }, - function(res) { - if(res.data.code==0){ - console.log(res.data.data); - getApp().my_warnning("任务领取成功", 1, th); - }else{ - getApp().my_warnning(res.data.msg, 0, th); - } - } - - ) - - }, + function(res) { - //帮拆记录的 - dismantle_record: function(e) { - console.log(); - var th = this; - var index =1; //获取当前选择的是任务还是活动说明 - var is_task= th.data.is_task; //0任务,1活动说明 - console.log(e, "这是标签的", is_task, "这是"); - - th.setData({ - is_task:1, - switch_head:1 - }); - rq.get("/api/weshop/marketing/help/help/task/involve/page", { - data: { - userId: user_id, - storeId: os.stoid - }, - success: function (res) {} + if (res.data.code == 0) { + console.log(res.data.data); + getApp().my_warnning(res.data.data, 1, th); + } else { + getApp().my_warnning(res.data.msg, 0, th); + } + } - }) + ) - }, - //划动的时候监听 - onSli: function(e) { - var th= this; - var ind = e.detail.current; - var aitem = this.data.aitem; - - var task_number = aitem[ind].giftQty - aitem[ind].useGiftQty; - th.setData({ - sw_index: ind, - task_number: task_number - }) - console.log(th.data.sw_index,"滑动监听", ind); - }, - //导航球 - close: function() { - var th = this; - var nav_b = th.selectComponent("#nav_b"); //组件的id - nav_b.close_box(); - nav_b.set_name("助力", ""); - }, /** * 生命周期函数--监听页面初次渲染完成 @@ -142,27 +119,27 @@ Page({ var th = this; var help_id = th.data.help_id; var user_id = getApp().globalData.user_id; - + /*-----助力活动(判断)-----*/ rq.get("/api/weshop/marketing/help/act/judge", { data: { userId: user_id, storeId: os.stoid }, - success: function (res) { + success: function(res) { if (res.data.code == 0) { var help_data = res.data.data; - console.log( '助力活动(判断)', res.data.data); + console.log('助力活动(判断)', res.data.data); th.setData({ - endDate:help_data.endDate, + endDate: help_data.endDate, }); } } - - - }); + + + }); /*-----获取助力活动的任务-----*/ @@ -182,9 +159,9 @@ Page({ var data_aissa = data.data.pageData; //当前时间戳 var nt = ut.gettimestamp(); - + data_aissa.forEach(function(val, ind) { - + //已开始 if (val.start_time < nt && val.end_time > nt) data_aissa[ind].status = 0; //未开始 @@ -192,13 +169,13 @@ Page({ //已结束 else if (val.start_time < nt && val.end_time < nt) data_aissa[ind].status = 2; }); - var task_number=data_aissa[0].giftQty - data_aissa[0].useGiftQty; + var task_number = data_aissa[0].giftQty - data_aissa[0].useGiftQty; var taskid = data_aissa[0].id; - + th.setData({ aitem: data_aissa, task_number: task_number, - taskid:taskid + taskid: taskid }); @@ -211,19 +188,83 @@ Page({ // th.shareFrends(); // }, 1000) //任务时间 设置全局定时器 - th.data.timer = setInterval(function () { + th.data.timer = setInterval(function() { th.countDown(); - },1000); + }, 1000); //会员任务列表 this.user_task_list(); - // 获取会员的参与的任务列表 我的任务 + // 获取会员的参与的任务列表 我的任务 this.get_user_task_num(); + + }, + + + + + + + //帮拆记录的 + dismantle_record: function(e) { + var aitem = this.data.aitem; //任务的数据集 + var sw_index = this.data.sw_index; //轮播的下标 + //任务id + var taskid = aitem[sw_index].id; + console.log("任务id", taskid); + var th = this; + var index = 1; //获取当前选择的是任务还是活动说明 + var is_task = th.data.is_task; //0任务,1帮拆 + console.log("0任务,1帮拆", is_task, ); + th.setData({ + is_task: 1, + switch_head: 1 + }); + rq.get("/api/weshop/marketing/help/help/task/involve/page", { + data: { + taskId: taskid, + userId: getApp().globalData.user_id, + storeId: os.stoid + }, + success: function(res) { + + if (res.data.code == 0) { + var dismantle = res.data.data.pageData; + th.setData({ + dismantle: dismantle + }); + } + } + + }) + + + }, + + + //划动的时候监听 + onSli: function(e) { + var th = this; + var ind = e.detail.current; + var aitem = this.data.aitem; + var task_number = aitem[ind].giftQty - aitem[ind].useGiftQty; + console.log("划动的任务总数", task_number, "任务所有的参数", aitem); + th.setData({ + sw_index: ind, + task_number: task_number + }); + console.log("可以领取的的任务数", aitem[ind].giftQty, '已领取的任务数据', aitem[ind].useGiftQty); + }, + //导航球 + close: function() { + var th = this; + var nav_b = th.selectComponent("#nav_b"); //组件的id + nav_b.close_box(); + nav_b.set_name("助力", ""); }, // 获取会员的参与的任务列表 我的任务 - user_task_list:function(e){ - var th=this; - // var index = e.target.dataset.index; //获取当前选择的是任务还是活动说明 - var index =0; + user_task_list: function(e) { + var th = this; + + var index = 0; var is_task = th.data.is_task; //0任务,1活动说明 var help_id = th.data.help_id; var user_id = getApp().globalData.user_id; @@ -233,49 +274,84 @@ Page({ storeId: os.stoid, userId: user_id }, - success: function (su) { + success: function(su) { th.setData({ is_task: index, switch_head: index }); if (su.data.code == 0) { - var user_list=su.data.data.pageData; - console.log("会员列表",user_list); + var user_list = su.data.data.pageData; + console.log("会员列表", user_list); th.setData({ user_task_list: user_list }); - }else{ + } else { th.setData({ - user_task_list:null + user_task_list: null }); } } - }) + }) }, //获取助力活动参与的人数 - get_user_task_num(){ - var th=this; - var help_id=th.data.help_id; - rq.get("/api/weshop/marketing/help/involve/help/act/people/count", { - data: { - helpId: help_id, - storeId: os.stoid, - }, - success: function (su) { - console.log(su.data.code, "获取助力活动参与的人数",su.data) - if (su.data.code == 0) { - var usercount=su.data.data.countAll; - - th.setData({ usercount: usercount}); - } else { - - } - } - }) - - }, + get_user_task_num() { + var th = this; + var help_id = th.data.help_id; + rq.get("/api/weshop/marketing/help/involve/help/act/people/count", { + data: { + helpId: help_id, + storeId: os.stoid, + }, + success: function(su) { + console.log(su.data.code, "获取助力活动参与的人数", su.data) + if (su.data.code == 0) { + var usercount = su.data.data.countAll; + + th.setData({ + usercount: usercount + }); + } else { + + } + } + }) + + }, + //轮播卡死的重置 + changeGoodsSwip: function(detail) { + if (detail.detail.source == "touch") { + //当页面卡死的时候,current的值会变成0 + if (detail.detail.current == 0) { + //有时候这算是正常情况,所以暂定连续出现3次就是卡了 + let swiperError = this.data.swiperError + swiperError += 1 + this.setData({ + swiperError: swiperError + }) + if (swiperError >= 3) { //在开关被触发3次以上 + console.error(this.data.swiperError) + this.setData({ + goodsIndex: this.data.preIndex + }); //,重置current为正确索引 + this.setData({ + swiperError: 0 + }) + } + } else { //正常轮播时,记录正确页码索引 + this.setData({ + preIndex: detail.detail.current + }); + //将开关重置为0 + this.setData({ + swiperError: 0 + }) + } + } + }, + // 轮播图点击左边 - click_pre: function () { + click_pre: function() { + console.log("轮播图点击左边"); var index = this.data.sw_index; index--; if (index < 0) return; @@ -288,14 +364,17 @@ Page({ }, //轮播图点击右边 - click_next: function () { + click_next: function() { + var index = this.data.sw_index; index++; + console.log("轮播图点击右边"); if (index >= this.data.aitem.length) return; var aitem = this.data.aitem; var task_number = aitem[index].giftQty - aitem[index].useGiftQty; this.setData({ - sw_index: index, task_number: task_number + sw_index: index, + task_number: task_number }) }, @@ -437,13 +516,13 @@ Page({ if (i == 0) { ctx.save(); ctx.beginPath(); //开始绘制 - ctx.arc(left + imagesize / 2, 505 * unit, imagesize/2, 0, 2 * Math.PI); + ctx.arc(left + imagesize / 2, 505 * unit, imagesize / 2, 0, 2 * Math.PI); ctx.setLineWidth(4 * unit); ctx.setStrokeStyle('red'); ctx.setFillStyle("white"); ctx.fill(); ctx.clip(); - ctx.drawImage(images[6], left, 505 * unit - imagesize/2, imagesize, imagesize); + ctx.drawImage(images[6], left, 505 * unit - imagesize / 2, imagesize, imagesize); ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 还可以继续绘制 } else { // 助力人的头像 @@ -533,103 +612,457 @@ Page({ } }) }, - //分享图 - // imageinfo: function() { - // var th = this; - // var images = th.data.images; - // var iurl = th.data.iurl; - // wx.getImageInfo({ - // src: iurl + images[0], - // success: function(res) { - // console.log(res + i); - // //res.path是网络图片的本地地址 - // images[0] = res.path; - // }, - // fail: function(res) { - // console.log(res.toString() + "" + i); - // } - // }); - // wx.getImageInfo({ - // src: iurl + images[1], - // success: function(res) { - // console.log(res + i); - // //res.path是网络图片的本地地址 - // images[1] = res.path; - // }, - // fail: function(res) { - // console.log(res.toString() + "" + i); - // } - // }); - // wx.getImageInfo({ - // src: iurl + images[2], - // success: function(res) { - // console.log(res + i); - // //res.path是网络图片的本地地址 - // images[2] = res.path; - // }, - // fail: function(res) { - // console.log(res.toString() + "" + i); - // } - // }); - // wx.getImageInfo({ - // src: iurl + images[3], - // success: function(res) { - // console.log(res + i); - // //res.path是网络图片的本地地址 - // images[3] = res.path; - // }, - // fail: function(res) { - // console.log(res.toString() + "" + i); - // } - // }); - // wx.getImageInfo({ - // src: iurl + images[4], - // success: function(res) { - // console.log(res + i); - // //res.path是网络图片的本地地址 - // images[4] = res.path; - // }, - // fail: function(res) { - // console.log(res.toString() + "" + i); - // } - // }); - // wx.getImageInfo({ - // src: iurl + images[5], - // success: function(res) { - // console.log(res + i); - // //res.path是网络图片的本地地址 - // images[5] = res.path; - // }, - // fail: function(res) { - // console.log(res.toString() + "" + i); - // } - // }); - // wx.getImageInfo({ - // src: iurl + images[6], - // success: function(res) { - // console.log(res + i); - // //res.path是网络图片的本地地址 - // images[6] = res.path; - // }, - // fail: function(res) { - // console.log(res.toString() + "" + i); - // } - // }); - - // wx.getImageInfo({ - // src: iurl + images[7], - // success: function(res) { - // console.log(res + i); - // //res.path是网络图片的本地地址 - // images[7] = res.path; - // }, - // fail: function(res) { - // console.log(res.toString() + "" + i); - // } - // }) - // th.setData({ - // images: images - // }) - - // } + //钱 分享图 + imageinfo: function() { + var th = this; + var images = th.data.images; + var iurl = th.data.iurl; + wx.getImageInfo({ + src: iurl + images[0], + success: function(res) { + console.log(res + i); + //res.path是网络图片的本地地址 + images[0] = res.path; + }, + fail: function(res) { + console.log(res.toString() + "" + i); + } + }); + wx.getImageInfo({ + src: iurl + images[1], + success: function(res) { + console.log(res + i); + //res.path是网络图片的本地地址 + images[1] = res.path; + }, + fail: function(res) { + console.log(res.toString() + "" + i); + } + }); + wx.getImageInfo({ + src: iurl + images[2], + success: function(res) { + console.log(res + i); + //res.path是网络图片的本地地址 + images[2] = res.path; + }, + fail: function(res) { + console.log(res.toString() + "" + i); + } + }); + wx.getImageInfo({ + src: iurl + images[3], + success: function(res) { + console.log(res + i); + //res.path是网络图片的本地地址 + images[3] = res.path; + }, + fail: function(res) { + console.log(res.toString() + "" + i); + } + }); + wx.getImageInfo({ + src: iurl + images[4], + success: function(res) { + console.log(res + i); + //res.path是网络图片的本地地址 + images[4] = res.path; + }, + fail: function(res) { + console.log(res.toString() + "" + i); + } + }); + wx.getImageInfo({ + src: iurl + images[5], + success: function(res) { + console.log(res + i); + //res.path是网络图片的本地地址 + images[5] = res.path; + }, + fail: function(res) { + console.log(res.toString() + "" + i); + } + }); + wx.getImageInfo({ + src: iurl + images[6], + success: function(res) { + console.log(res + i); + //res.path是网络图片的本地地址 + images[6] = res.path; + }, + fail: function(res) { + console.log(res.toString() + "" + i); + } + }); + + wx.getImageInfo({ + src: iurl + images[7], + success: function(res) { + console.log(res + i); + //res.path是网络图片的本地地址 + images[7] = res.path; + }, + fail: function(res) { + console.log(res.toString() + "" + i); + } + }) + th.setData({ + images: images + }) + + }, + //生成分享图,用于分享给好友帮拆 + demolition: function() { + var th = this; + + + }, + //************************ */ + shareFrends: function(e) { + var th = this; + var is_generate = th.data.is_generate; //是否重复提交拆一拆 + if (is_generate == 0) { + th.setData({ + is_generate: 1 + }) + var scene = th.data.gid; + ///二微码 + // var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + + // a.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; + var iurl = th.data.iurl; //图片地址前缀 + const ctx = wx.createCanvasContext('share_id'); //绘图上下文 + var unit = th.data.screenWidth / 750 * 1.35; + var numsize = 20 * unit; //几人助力字体大小 + var size = 15 * unit; + var num = th.data.already; //已有几位好友助力 + var q_num = th.data.lack; //还差几位好友助力 + var already = num.toString().length + 1; //已有几位好友助力 + var lack = q_num.toString().length + 1; //还差几位好友助力 + var imagesize = 40 * unit; //助力人的图片大小 + var left = 74 * unit; //助力人头像跟左边的距离 + var spacing = 12 * unit; //助力人图片间距 + var images = th.data.images; + ctx.drawImage(images[0], 0, 0, 445 * unit, 700 * unit); //分享的背景图片 + ctx.drawImage(images[1], 37 * unit, 185 * unit, 370 * unit, 377 * unit); //分享的背景图片 + ctx.drawImage(images[5], 90 * unit, 231 * unit, 266 * unit, 160 * unit); //分享的背景图片 + ctx.setFillStyle("rgb(221,153,116)"); + ctx.setFontSize(size) + ctx.fillText("已有", 77 * unit, 430 * unit); + ctx.setFillStyle("#FF4746"); + ctx.setFontSize(numsize) + ctx.fillText(num + "位", 108 * unit, 430 * unit); + ctx.setFillStyle("rgb(221,153,116)"); + ctx.setFontSize(size) + ctx.fillText("好友助力,还差", 116 * unit + already * numsize * unit, 430 * unit); + ctx.setFillStyle("#FF4746"); + ctx.setFontSize(numsize); + ctx.fillText(q_num + "位", 223 * unit + already * numsize * unit, 430 * unit); + ctx.setFillStyle("rgb(221,153,116)"); + ctx.setFontSize(size); + ctx.fillText("达成助力", 230 * unit + lack * numsize * unit + already * numsize * unit, 430 * unit); + var c = q_num / num; + ctx.drawImage(images[2], 65 * unit, 445 * unit, 320 * unit, 12 * unit); + ctx.drawImage(images[3], 65 * unit, 445 * unit, 320 * unit * c, 12 * unit); + // var dynamic = th.data.dynamic; //助力的微信头像 + // console.log(dynamic[0].headPic + "动态图片显示"); + for (var i = 0; i < 6; i++) { + if (i < 0) { + // ctx.beginPath(); + // ctx.arc(left + imagesize / 2, 505 * unit, imagesize / 2, 0, 2 * Math.PI); + // ctx.setLineWidth(1); + // ctx.setStrokeStyle('red'); + ctx.save(); + ctx.beginPath(); //开始绘制 + ctx.arc(left + imagesize / 2, 505 * unit, imagesize / 2, 0, 2 * Math.PI); + ctx.setLineWidth(4 * unit); + ctx.setStrokeStyle('red'); + ctx.setFillStyle("white"); + ctx.fill(); + ctx.clip(); + ctx.drawImage(dynamic[i].headPic, left, 505 * unit - imagesize / 2, imagesize, imagesize); + ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 还可以继续绘制 + } else { + // 助力人的头像 + ctx.drawImage(images[4], left, 505 * unit - imagesize / 2, imagesize, imagesize); //分享的背景图片 + + } + left += imagesize + spacing; + } + ctx.setFillStyle("rgb(255,255,255)"); + ctx.setFontSize(size); + ctx.fillText("优惠乐翻天,精彩就在你身边!", 37 * unit, 595 * unit); + ctx.setFillStyle("rgb(255,255,255)"); + ctx.setFontSize(size); + ctx.fillText("2019.06.26 - 2019.07.02!", 37 * unit, 620 * unit); + ctx.setFillStyle("rgb(255,255,255)"); + ctx.setFontSize(size); + ctx.fillText("长按识别二维码,可帮我助力!", 37 * unit, 660 * unit); + ctx.drawImage(images[5], 325 * unit, 585 * unit, 77 * unit, 77 * unit); //分享的背景图片 + ctx.save(); + //读取文件成功则OK-- + // wx.getImageInfo({ + // src: path3, + // success: function (res) { + //把画板内容绘制成图片,并回调 画板图片路径 + ctx.draw(false, function() { + setTimeout(function() { + wx.canvasToTempFilePath({ + x: 0, + y: 0, + width: 300, + height: 500, + destWidth: 400 * 2, + destHeight: 720 * 2, + canvasId: 'share_id', + success: function(res) { + wx.hideLoading(); + var shareImgPath = th.data.shareImgPath; + shareImgPath[0] = res.tempFilePath; + + th.setData({ + shareImgPath: shareImgPath, + canvasHidden: 1, + is_share: 1, + is_generate: 0, + canvasHidden: 1 + }) + if (!res.tempFilePath) { + wx.showModal({ + title: '提示', + content: '图片绘制中,请稍后重试', + showCancel: false + }) + return false; + } + + }, + fail(r) { + + } + }, 500) + }) + }) + } + }, + preview: function() { + var th = this; + var shareImgPath = th.data.shareImgPath; + wx.previewImage({ + url: shareImgPath[0], + urls: shareImgPath + }) + th.setData({ + is_share: 0 + }) + }, + + //关闭分享显示 + close_share: function() { + var th = this; + wx.hideLoading(); + th.setData({ + is_share: 0 + }) + }, + syinfo: function() { + var th = this; + //获取用户设备信息,屏幕宽度 + wx.getSystemInfo({ + success: res => { + th.setData({ + screenWidth: res.screenWidth + }) + } + }) + }, + //把固定的图片加载到本地 + imageinfo: function() { + var th = this; + var images = th.data.images; + var iurl = th.data.iurl; + wx.getImageInfo({ + src: iurl + images[0], + success: function(res) { + //res.path是网络图片的本地地址 + images[0] = res.path; + }, + fail: function(res) { + + } + }); + wx.getImageInfo({ + src: iurl + images[1], + success: function(res) { + //res.path是网络图片的本地地址 + images[1] = res.path; + }, + fail: function(res) { + + } + }); + wx.getImageInfo({ + src: iurl + images[2], + success: function(res) { + //res.path是网络图片的本地地址 + images[2] = res.path; + }, + fail: function(res) { + + } + }); + wx.getImageInfo({ + src: iurl + images[3], + success: function(res) { + + //res.path是网络图片的本地地址 + images[3] = res.path; + }, + fail: function(res) { + + } + }); + wx.getImageInfo({ + src: iurl + images[4], + success: function(res) { + + //res.path是网络图片的本地地址 + images[4] = res.path; + }, + fail: function(res) { + + } + }); + wx.getImageInfo({ + src: iurl + images[5], + success: function(res) { + + //res.path是网络图片的本地地址 + images[5] = res.path; + }, + fail: function(res) { + + } + }); + th.setData({ + images: images + }) + + }, +//好友猜一猜 + save_share: function (e) { + var aitem = this.data.aitem; //任务的数据集 + var sw_index = this.data.sw_index; //轮播的下标 + //任务id + var taskid = aitem[sw_index].id; + console.log("好友猜一猜的任务id", taskid); + var th = this; + + var url = "/api/weshop/marketing/help/help/task/involve/page"; + getApp().request.promiseGet(url, { + data: { + storeId: 1, + taskId: taskid, + userId: 1433390 + } + }).then(res => { + if (res.data.code == 0) { + var data = res.data.data.pageData; //帮拆数组 + if (data.length > 0) { + // th.setData({ + // dynamic: data + // }) + // th.info_head(); + th.imageinfo(); + setTimeout(function () { + th.shareFrends(); + }, 500) + } + } else { + wx.hideLoading(); + getApp().my_warnning(res.data.msg, 0, th); + } + }) + }, + //把已助力好友头像下载到本地 + info_head: function (e) { + var th = this; + var images = th.data.dynamic; + if (images[0] != null && images[0] != "" && images[0] != undefined) { + console.log(images[0].headPic + "就将计就计"); + wx.getImageInfo({ + src: images[0].headPic, + success: function (res) { + //res.path是网络图片的本地地址 + images[0].headPic = res.path; + }, + fail: function (res) { + + } + }); + } + if (images[1] != null && images[1] != "" && images[1] != undefined) { + wx.getImageInfo({ + src: images[1].headPic, + success: function (res) { + //res.path是网络图片的本地地址 + images[1].headPic = res.path; + }, + fail: function (res) { + + } + }); + } + if (images[2] != null && images[2] != "" && images[2] != undefined) { + wx.getImageInfo({ + src: images[2].headPic, + success: function (res) { + //res.path是网络图片的本地地址 + images[2].headPic = res.path; + }, + fail: function (res) { + + } + }); + } + if (images[3] != null && images[3] != "" && images[3] != undefined) { + wx.getImageInfo({ + src: images[3].headPic, + success: function (res) { + //res.path是网络图片的本地地址 + images[3].headPic = res.path; + }, + fail: function (res) { + + } + }); + } + // if (images[4] != null && images[4] != "" && images[4] != undefined) { + // wx.getImageInfo({ + // src: images[4].headPic, + // success: function(res) { + // //res.path是网络图片的本地地址 + // images[4].headPic = res.path; + // }, + // fail: function(res) { + + // } + // }); + // } + // if (images[5] != null && images[5] != "" && images[5] != undefined) { + // wx.getImageInfo({ + // src: images[5].headPic, + // success: function (res) { + // //res.path是网络图片的本地地址 + // images[5].headPic = res.path; + // }, + // fail: function (res) { + + // } + // }); + //} + th.setData({ + dynamic: images + }) + }, + }) \ No newline at end of file diff --git a/pages/user/assistance/task_assistance.wxml b/pages/user/assistance/task_assistance.wxml index bed33b8..7028232 100644 --- a/pages/user/assistance/task_assistance.wxml +++ b/pages/user/assistance/task_assistance.wxml @@ -1,8 +1,9 @@ + - {{sw_index}} + {{aitem[sw_index].helpTaskName}} @@ -14,7 +15,7 @@ - + @@ -24,23 +25,27 @@ - + - / + / 今天剩余可领{{task_number}}个任务 - + 就选它了 + + 好友拆一拆 + + - + @@ -57,7 +62,7 @@ - + {{item.helpTaskName}} @@ -77,12 +82,12 @@ - + - - 豪华任务一 + + {{itme.nickName}} - 2019-05-12 + {{filter.format_time(itme.beginDate)}} @@ -111,7 +116,7 @@ - + @@ -123,6 +128,22 @@ + + + + + + + + + + + + + + + + diff --git a/pages/user/assistance/task_assistance.wxss b/pages/user/assistance/task_assistance.wxss index 101fae3..c9e1c26 100644 --- a/pages/user/assistance/task_assistance.wxss +++ b/pages/user/assistance/task_assistance.wxss @@ -36,12 +36,12 @@ page{ .task_clike{ margin: auto; width: 60%; - height: 80rpx; + height: 65rpx; border-radius: 50rpx; margin-top: 20rpx; background: #fbda0e; color:#d01119; - line-height: 80rpx; + line-height: 65rpx; letter-spacing: 5rpx; box-shadow: 0rpx 7rpx 0rpx 0rpx rgb(245, 119, 6); } @@ -155,18 +155,42 @@ border-color: #fff; height: 70rpx; } .plan-frame{ - width: 90%; + width: 86%; margin: auto; + margin-top: 50rpx; } .plan-frame .plan_num{ width: 90%; background: #ffe7ab; border-radius: 20rpx; - height: 32rpx; + height: 22rpx; } .is_plam{ height: 100%; top: 0rpx; left: 0rpx; +} +.dust { + position: fixed; + width: 100%; + height: 100%; + background-color: red; + z-index: 10; +} + +.closes { + margin-top: 20rpx; +} + +.canvas { + position: fixed; + z-index: 11; + width: 100%; + top:20rpx; +} + +.close { + width: 70rpx; + height: 70rpx; } \ No newline at end of file