Commit 09f0f7acc4e33f7f007cfe8b2aae0495cb3d64c7
1 parent
30ae7e7c
生成分享图的bug修复
Showing
1 changed file
with
7 additions
and
4 deletions
pages/user/assistance/task_assistance.js
... | ... | @@ -387,7 +387,7 @@ Page({ |
387 | 387 | r:r, |
388 | 388 | }, |
389 | 389 | success: function (su) { |
390 | - th.data.block=0 | |
390 | + th.data.block=0 | |
391 | 391 | if (su.data.code == 0) { |
392 | 392 | if (su.data.data.total > 5) { |
393 | 393 | var rw_page = th.data.rw_page + 1; |
... | ... | @@ -706,6 +706,8 @@ Page({ |
706 | 706 | ctx.drawImage(images[0], 0, 0, 445 * unit, 700 * unit); //分享的背景图片 |
707 | 707 | ctx.drawImage(images[1], 37 * unit, 185 * unit, 370 * unit, 377 * unit); //分享的背景图片 |
708 | 708 | |
709 | + console.log(111); | |
710 | + console.log(th.data.share_lb_img); | |
709 | 711 | |
710 | 712 | ctx.drawImage(th.data.share_lb_img, 90 * unit, 231 * unit, 266 * unit, 160 * unit); //分享的礼包的背景图片 |
711 | 713 | |
... | ... | @@ -797,8 +799,9 @@ Page({ |
797 | 799 | left += imagesize + spacing; |
798 | 800 | } |
799 | 801 | |
800 | - if (help_num - head_list_img.lengt > 0) { | |
802 | + if (help_num - head_list_img.length > 0) { | |
801 | 803 | var neednum = help_num - head_list_img.length; |
804 | + if(neednum>6) neednum=6; | |
802 | 805 | //这个是还未助力的位置 |
803 | 806 | for (var i = 0; i < neednum; i++) { |
804 | 807 | // 助力人的头像 |
... | ... | @@ -942,7 +945,7 @@ Page({ |
942 | 945 | var data = res.data.data.pageData; //帮拆数组 |
943 | 946 | if (data.length > 0) { |
944 | 947 | th.data.dynamic = data[0]; |
945 | - var path = th.data.iurl + sw_item.giftBagUrl; | |
948 | + var path = th.data.iurl + (sw_item.giftBagUrl?sw_item.giftBagUrl:'/miniapp/images/no-head.jpg'); | |
946 | 949 | //先获取礼包分享时的本地路径 |
947 | 950 | getApp().request.promise_downimg(path).then(res => { |
948 | 951 | th.data.share_lb_img = res; |
... | ... | @@ -992,7 +995,7 @@ Page({ |
992 | 995 | var taskId = e.currentTarget.dataset.taskid; //任务id |
993 | 996 | getApp().goto("/pages/user/assistance/giftpacklist?help_id=" + help_id + "&is_libao=" + 0 + "&taskId=" + taskId); |
994 | 997 | }, |
995 | - | |
998 | + | |
996 | 999 | user_task_list_click:function(){ |
997 | 1000 | if (this.data.switch_head==0) return false; |
998 | 1001 | this.data.block=0; | ... | ... |