diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js index 1514c65..7f4bcb7 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.js +++ b/components/diy_goodsGroup/diy_goodsGroup.js @@ -186,6 +186,7 @@ Component({ is_new: th.data.is_new, pageSize: th.data.goodscount, page: th.data.currentPage, + isonsale: 1, } }).then(res => { //商品地址 @@ -260,6 +261,7 @@ Component({ gpid: wgroup, pageSize: th.data.goodscount, page: th.data.currentPage, + isonsale: 1, } }).then(res => { //商品地址 diff --git a/pages/giftpack/birthdaygift/birthdaygift.wxml b/pages/giftpack/birthdaygift/birthdaygift.wxml index 18602b8..fe5df0b 100644 --- a/pages/giftpack/birthdaygift/birthdaygift.wxml +++ b/pages/giftpack/birthdaygift/birthdaygift.wxml @@ -9,7 +9,7 @@ ______ - 新人专享\n你的美丽我来缔造 + 生日专享\n你的美丽我来缔造 ______ @@ -41,7 +41,7 @@ {{item.fromName}} - {{"新人可免费享受专业"+item.fromName+",可以享受"+item.num+"次。"}} + {{"生日可免费享受专业"+item.fromName+",可以享受"+item.num+"次。"}} 数量: @@ -67,7 +67,7 @@ ——— - 新人专享优惠券 + 生日专享优惠券 ——— @@ -99,8 +99,8 @@ {{item.sum+"元券"}} - {{"满"+item.buySum+"元可以用"}} + {{"满"+item.buySum+"元可以用"}} @@ -121,7 +121,7 @@ ——— - 新人专享福利 + 生日专享福利 ——— @@ -172,7 +172,7 @@ - + 一键全部领取 diff --git a/pages/giftpack/evaluategift/evaluategift.wxml b/pages/giftpack/evaluategift/evaluategift.wxml index 7a8ee89..7bee311 100644 --- a/pages/giftpack/evaluategift/evaluategift.wxml +++ b/pages/giftpack/evaluategift/evaluategift.wxml @@ -9,7 +9,7 @@ ______ - 新人专享\n你的美丽我来缔造 + 评价专享\n你的美丽我来缔造 ______ @@ -41,7 +41,7 @@ {{item.fromName}} - {{"新人可免费享受专业"+item.fromName+",可以享受"+item.num+"次。"}} + {{"评价可免费享受专业"+item.fromName+",可以享受"+item.num+"次。"}} 数量: @@ -67,7 +67,7 @@ ——— - 新人专享优惠券 + 评价专享优惠券 ——— @@ -94,13 +94,13 @@ 分类限定 - + 包邮券 - - {{item.sum+"元券"}} - {{"满"+item.buySum+"元可以用"}} + + {{item.sum+"元券"}} + {{"满"+item.buySum+"元可以用"}} @@ -121,7 +121,7 @@ ——— - 新人专享福利 + 评价专享福利 ——— diff --git a/pages/giftpack/festival/festival.wxml b/pages/giftpack/festival/festival.wxml index 81da5c8..00a37a1 100644 --- a/pages/giftpack/festival/festival.wxml +++ b/pages/giftpack/festival/festival.wxml @@ -9,7 +9,7 @@ ______ - 新人专享\n你的美丽我来缔造 + 节日专享\n你的美丽我来缔造 ______ @@ -41,7 +41,7 @@ {{item.fromName}} - {{"新人可免费享受专业"+item.fromName+",可以享受"+item.num+"次。"}} + {{"节日可免费享受专业"+item.fromName+",可以享受"+item.num+"次。"}} 数量: @@ -67,7 +67,7 @@ ——— - 新人专享优惠券 + 节日专享优惠券 ——— @@ -94,7 +94,12 @@ 分类限定 - {{item.sum+"元券"}} + + 包邮券 + + + {{item.sum+"元券"}} + {{"满"+item.buySum+"元可以用"}} @@ -116,7 +121,7 @@ ——— - 新人专享福利 + 节日专享福利 ——— diff --git a/pages/user/assistance/assistance.js b/pages/user/assistance/assistance.js index 66f48af..6f22649 100644 --- a/pages/user/assistance/assistance.js +++ b/pages/user/assistance/assistance.js @@ -111,9 +111,7 @@ Page({ th.setData({ is_load: 1 }) - if (res.data.code == 0) { - var list = th.data.zl_user_list; //连接数组 list = list.concat(res.data.data.pageData); @@ -170,13 +168,14 @@ Page({ // 领取礼包 get_libao: function(e) { - var libao_id = e.currentTarget.dataset.libaoid; - getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + libao_id + "&is_libao=" + 1); + var help_id = e.currentTarget.dataset.help_id; + var taskId = e.currentTarget.dataset.taskid;//任务id + getApp().goto("/pages/user/assistance/giftpacklist?help_id=" + help_id + "&is_libao=" + 1 + "&taskId=" + taskId); }, //查看礼包id select_libao: function() { - var orderSn = e.currentTarget.dataset.orderSn;//订单号 + var orderSn = e.currentTarget.dataset.orderSn; //订单号 getApp().goto("/pages/user/assistance/giftpacklist?orderSn=" + orderSn); } diff --git a/pages/user/assistance/assistance.wxml b/pages/user/assistance/assistance.wxml index cfb00d9..857a981 100644 --- a/pages/user/assistance/assistance.wxml +++ b/pages/user/assistance/assistance.wxml @@ -14,9 +14,9 @@ - + 活动时间:{{filter_s.format_time(zl_act.beginDate,0)}} 至 {{filter_s.format_time(zl_act.endDate,0)}} - + @@ -43,24 +43,24 @@ - - - - {{item.helpTaskName}} - + + + + {{item.helpTaskName}} + - - - 领取礼包 - - - {{item.zlHelpNum}}/{{item.helpNum}} - - - 查看礼包 - + + + 领取礼包 + + + {{item.zlHelpNum}}/{{item.helpNum}} + + + 查看礼包 + - + @@ -78,8 +78,8 @@ 暂无任务记录 - - 已有 {{s_num}}人领取了任务 + + 已有{{s_num}}人领取了任务 diff --git a/pages/user/assistance/assistance.wxss b/pages/user/assistance/assistance.wxss index 18d173b..7fe3e0e 100644 --- a/pages/user/assistance/assistance.wxss +++ b/pages/user/assistance/assistance.wxss @@ -116,6 +116,8 @@ page { .item { margin-bottom: 35rpx; + display: flex; + align-items: baseline; } .state { diff --git a/pages/user/assistance/friend_assistance.js b/pages/user/assistance/friend_assistance.js index 6d51dec..e92f55d 100644 --- a/pages/user/assistance/friend_assistance.js +++ b/pages/user/assistance/friend_assistance.js @@ -28,18 +28,20 @@ Page({ */ onLoad: function(options) { var th = this; + if (options.tasking) this.data.tasking = options.tasking; if (options.userId) this.data.userId = options.userId; //任务是不是为空 if (this.data.tasking == 0 || this.data.tasking == undefined) { this.data.tasking = decodeURIComponent(options.scene); } - + if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking != 0) { + getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", { data: { - id: th.data.tasking, + taskingId: th.data.tasking, storeId: os.stoid } }).then(res => { @@ -97,6 +99,7 @@ Page({ cklie_button: function() { var th = this; var t_user_id = app_d.user_id; + t_user_id = 1433320; var data = { id: this.data.tasking, storeId: os.stoid, diff --git a/pages/user/assistance/friend_assistance.wxml b/pages/user/assistance/friend_assistance.wxml index f9b47ad..1f3ec67 100644 --- a/pages/user/assistance/friend_assistance.wxml +++ b/pages/user/assistance/friend_assistance.wxml @@ -3,7 +3,7 @@ {{user.nickname}} - + 拜托拜托,帮我拆礼盒得好礼~ @@ -14,7 +14,7 @@ - 活动时间:{{filter.fm_time(zl_act.beginDate)}}-{{filter.fm_time(zl_act.beginDate)}} + 活动时间:{{filter.fm_time(zl_act.beginDate)}}-{{filter.fm_time(zl_act.endDate)}} diff --git a/pages/user/assistance/giftpacklist.js b/pages/user/assistance/giftpacklist.js index f20ad1e..8634eb5 100644 --- a/pages/user/assistance/giftpacklist.js +++ b/pages/user/assistance/giftpacklist.js @@ -49,10 +49,11 @@ Page({ } if (options.is_libao == 1) { th.setData({ - giftBagId: options.libao_id, + held_id: options.help_id, + taskId: options.taskId, is_type: 1 }) - th.GetBuyGiftList(); + th.help(); } if (options.order_sn) { th.setData({ @@ -61,14 +62,11 @@ Page({ }) th.GetMyGiftList(); } + var nav_b = th.selectComponent("#nav_b"); //组件的id + nav_b.set_name("助力", "/pages/user/assistance/assistance"); }, onShow: function() { - var th = this; - var is_read = th.data.is_read; - if (is_read){ - var nav_b = th.selectComponent("#nav_b"); //组件的id - nav_b.set_name("助力", "/pages/user/assistance/assistance"); - } + }, //助力活动查看礼包详情调用 help: function(e) { @@ -204,9 +202,9 @@ Page({ is_sub: 1 }) var json = { - "actId": th.data.held_id, //活动Id + "actId": th.data.taskId, //活动Id "actType": 5, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 - "giftBagId": th.data.giftBagId, //礼包Id + "giftBagId": 1, //礼包Id "storeId": a.stoid, //商家Id "userId": d.user_id //用户ID }; diff --git a/pages/user/assistance/giftpacklist.wxml b/pages/user/assistance/giftpacklist.wxml index 509fad8..a2311dc 100644 --- a/pages/user/assistance/giftpacklist.wxml +++ b/pages/user/assistance/giftpacklist.wxml @@ -141,4 +141,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/pages/user/assistance/task_assistance.js b/pages/user/assistance/task_assistance.js index 222a0b8..c7a6af6 100644 --- a/pages/user/assistance/task_assistance.js +++ b/pages/user/assistance/task_assistance.js @@ -9,7 +9,6 @@ var e = getApp(), app_d = e.globalData; var regeneratorRuntime = require('../../../utils/runtime.js'); Page({ - /** * 页面的初始数据 */ @@ -44,15 +43,13 @@ Page({ screenWidth: "", //用户的屏幕宽度 gid: "", 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" + "miniapp/images/friendhelp/check.png", "miniapp/images/friendhelp/unfinished.png","miniapp/images/xc_ellipsis.png" ], //固的分享图片 dynamic: null, //已助力的微信头像数组 head_pic_arr: [], //助力的头像 share_lb_img: "", //分享的礼包图片 - is_generate: 0, //是否重复点击拆一拆 already: 0, //已有几人助力 lack: 0, //还差几人助力 @@ -215,6 +212,10 @@ Page({ //帮拆记录的 dismantle_record: function(e) { + //优化444444444444444444 + if (this.data.switch_head == 1) { + return false; + } var aitem = this.data.aitem; //任务的数据集 var sw_index = this.data.sw_index; //轮播的下标 //任务id @@ -231,7 +232,8 @@ Page({ } this.setData({ is_task: 1, - switch_head: 1 + switch_head: 1, + block: 0, }); var bc_page = th.data.bc_page; rq.get("/api/weshop/marketing/help/help/task/involve/page", { @@ -252,7 +254,7 @@ Page({ is_bc_show: 1 }) } else { - getApp().showWarning("暂无更多内容", 0, th); + getApp().my_warnning("暂无更多内容", 0, th); } th.setData({ @@ -270,7 +272,8 @@ Page({ // 领取礼包 get_libao: function(e) { var libao_id = e.currentTarget.dataset.libaoid; //礼包id - getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + libao_id + "&is_libao=" + 1); + var taskid= e.currentTarget.dataset.taskid; + getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + libao_id + "&is_libao=" + 1 +"&taskId="+taskid); }, //查看礼包id select_libao: function(e) { @@ -308,6 +311,8 @@ Page({ // 获取会员的参与的任务列表 我的任务 user_task_list: function(e) { var th = this; + //防止已经当前位置的时候多次点击 + if (th.data.block == 1) { return false; } var index = 0; var is_task = this.data.is_task; //0任务,1帮拆 if (is_task == undefined || is_task == null) { @@ -333,6 +338,7 @@ Page({ userId: user_id }, success: function(su) { + th.setData({block:1}); if (su.data.code == 0) { if (su.data.data.total > 5) { var rw_page = th.data.rw_page + 1; @@ -340,14 +346,15 @@ Page({ rw_page: rw_page, is_show: 1 }) - getApp().my_warnning(); - getApp().showWarning("暂无更多内容", 0); + getApp().my_warnning(su.data.msg, 1, th); } var user_list = su.data.data.pageData; th.setData({ user_task_list: user_list }); + } else { + getApp().my_warnning(su.data.msg, 0, th); } } }) @@ -646,38 +653,91 @@ Page({ ctx.drawImage(images[3], 65 * unit, 445 * unit, 320 * unit * c, 12 * unit); var head_list_num = 30; var is_head_list = 0; - if (help_num < 8) { - // 判断已助力的人数 - - for (var a = 0; a < head_list_img.length; a++) { - 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(head_list_img[a], left , 505 * unit - imagesize / 2, imagesize, imagesize); - ctx.restore(); - left += imagesize + spacing; - } - //这个是还未助力的位置 - for (var i = 0; i < q_num; i++) { - // 助力人的头像 - ctx.drawImage(images[4], left , 505 * unit - imagesize / 2, imagesize, imagesize); //分享的背景图片 - left += imagesize + spacing; - } - } - - + + //当需要助力人数小与6个 + if (help_num < 6) { + var pos_arr=ut.get_box_arr(help_num,225.25*unit,505 * unit,spacing,imagesize / 2); + var now_ind=0; + //--判断已助力的人数-- + for (var a = 0; a < head_list_img.length; a++) { + var pos= pos_arr[now_ind]; + ut.draw_circle(ctx,pos.x, pos.y, imagesize / 2,head_list_img[a],'red',unit); + now_ind++; + } + //--显示还差的人数-- + if(help_num-head_list_img.length>0){ + var neednum=help_num-head_list_img.length; + //这个是还未助力的位置 + for (var i = 0; i < neednum; i++) { + var pos= pos_arr[now_ind]; + now_ind++; + // 助力人的头像 + ctx.drawImage(images[4], pos.x-imagesize/2, pos.y-imagesize/2,imagesize, imagesize); //分享的背景图片 + + } + } + + }else if(help_num>7){ + //助力头像数量, 是不是要显示省略图 + var zl_head=0,is_sheng=0; + if(head_list_img.length>=6) { + zl_head=5;is_sheng=1; + }else{ + zl_head=head_list_img.length; + } + + + //判断已助力的人数 + for (var a = 0; a < zl_head; a++) { + //绘制头像 + ut.draw_circle(ctx,left + imagesize / 2, 505 * unit, imagesize / 2,head_list_img[a],'red',unit); + left += imagesize + spacing; + } + + //如果是省略号的话 + if(is_sheng){ + ctx.drawImage(images[5], left , 505 * unit - imagesize / 2, imagesize, imagesize); //头像的省略图片 + }else{ + //这个是还未助力的位置 + for (var i = 0; i < 6-head_list_img.length; i++) { + // 助力人的头像 + ctx.drawImage(images[4], left , 505 * unit - imagesize / 2, imagesize, imagesize); //分享的?号图片 + left += imagesize + spacing; + } + } + }else{ + // 判断已助力的人数 + for (var a = 0; a < head_list_img.length; a++) { + 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(head_list_img[a], left , 505 * unit - imagesize / 2, imagesize, imagesize); + ctx.restore(); + left += imagesize + spacing; + } + + if(help_num-head_list_img.lengt>0){ + var neednum=help_num-head_list_img.length; + //这个是还未助力的位置 + for (var i = 0; i < neednum; i++) { + // 助力人的头像 + 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(act_time, 37 * unit, 620 * unit); //绘制活动是时间 ctx.setFillStyle("rgb(255,255,255)"); ctx.setFontSize(size); @@ -825,7 +885,6 @@ Page({ info_head: async function(func) { var th = this; var images = th.data.dynamic.zlHelpUser; - console.log(images,"图片长度", images.length); var arr = new Array(); var block = th.data.block; if (images) { @@ -839,19 +898,26 @@ Page({ } func(); }, - +//立即兑换 + redeem_now: function (e) { + var libao_id = e.currentTarget.dataset.libaoid; + var taskid = e.currentTarget.dataset.taskid; + getApp().goto("/pages/user/assistance/giftpacklist?libao_id=" + libao_id + "&is_libao=" + 1 + "&taskId=" + taskid); + }, //礼包的详情 轮播图 libao_details: function(e) { var th = this; var help_id = th.data.help_id; //活动id - var taskId = th.data.taskid; //任务id + var taskId = e.currentTarget.dataset.taskid; //任务id getApp().goto("/pages/user/assistance/giftpacklist?help_id=" + help_id + "&is_libao=" + 0 + "&taskId=" + taskId); }, - //正在进行任务 - test: function(e) { - getApp().goto("/pages/user/assistance/friend_assistance?tasking=13"); + //测试正在进行任务 + test: function (e) { + var taskid = e.currentTarget.dataset.taskid; + var uset_id = this.data.zlisuers_id; + getApp().goto("/pages/user/assistance/friend_assistance?tasking=" + taskid + "&userId=" + uset_id); }, }) \ No newline at end of file diff --git a/pages/user/assistance/task_assistance.wxml b/pages/user/assistance/task_assistance.wxml index bb0c715..7e469f0 100644 --- a/pages/user/assistance/task_assistance.wxml +++ b/pages/user/assistance/task_assistance.wxml @@ -23,7 +23,7 @@ - + 礼包详情 @@ -49,16 +49,21 @@ 就选它了 - + 好友拆一拆 - - 测试专用 + + 立即兑换 + + + + 测试专用 - + @@ -73,9 +78,9 @@ - + - + {{item.helpTaskName}} @@ -85,10 +90,10 @@ {{item.zlHelpNum}}/{{item.helpNum}} 查看礼包 - 领取礼包 + 领取礼包 - - + + diff --git a/pages/user/assistance/task_assistance.wxss b/pages/user/assistance/task_assistance.wxss index 6c55454..d9359e0 100644 --- a/pages/user/assistance/task_assistance.wxss +++ b/pages/user/assistance/task_assistance.wxss @@ -5,10 +5,15 @@ page { } - +.tesk_list{ + width: 100%; + max-height: 335rpx; + overflow: hidden; + overflow-y:auto; +} .top-back { width: 100%; - height:70%; + height:65%; background-repead: no-repead; background-size: 100% 100%; } diff --git a/utils/util.js b/utils/util.js index fe5146f..423d6f7 100644 --- a/utils/util.js +++ b/utils/util.js @@ -322,6 +322,28 @@ function get_box_arr(num,x,y,sp,r){ if(num==5) return [{x:x-2*sp-4*r,y:y},{x:x-sp-2*r,y:y},{x:x,y:y},{x:x+sp+2*r,y:y},{x:x+2*sp+4*r,y:y}]; } +/** + * @param {Object} ctx 画图句柄 + * @param {Object} x x坐标 + * @param {Object} y y坐标 + * @param {Object} img 画的图片 + * @param {Object} color 边框的颜色 + */ + +function draw_circle(ctx,x,y,r,img,color,unit){ + ctx.save(); + ctx.beginPath(); //开始绘制 + ctx.arc(x,y,r,0,2 * Math.PI); + ctx.setLineWidth(4 * unit); + ctx.setStrokeStyle('red'); + ctx.setFillStyle("white"); + ctx.fill(); + ctx.clip(); + ctx.drawImage(img,x-r,y-r,2*r,2*r); + ctx.restore(); +} + + function null_promise(){ var promise=new Promise(function(resolve, reject){ var ob={code:-1,data:null}; resolve(ob); }); return promise; } @@ -425,4 +447,5 @@ module.exports = { draw_randon_rect:draw_randon_rect ,//画图画圆角矩形 null_promise:null_promise,//返回空的promise get_box_arr:get_box_arr,//返回圆的数组 + draw_circle:draw_circle,//绘制圆 };