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,7 +387,7 @@ Page({ | ||
387 | r:r, | 387 | r:r, |
388 | }, | 388 | }, |
389 | success: function (su) { | 389 | success: function (su) { |
390 | - th.data.block=0 | 390 | + th.data.block=0 |
391 | if (su.data.code == 0) { | 391 | if (su.data.code == 0) { |
392 | if (su.data.data.total > 5) { | 392 | if (su.data.data.total > 5) { |
393 | var rw_page = th.data.rw_page + 1; | 393 | var rw_page = th.data.rw_page + 1; |
@@ -706,6 +706,8 @@ Page({ | @@ -706,6 +706,8 @@ Page({ | ||
706 | ctx.drawImage(images[0], 0, 0, 445 * unit, 700 * unit); //分享的背景图片 | 706 | ctx.drawImage(images[0], 0, 0, 445 * unit, 700 * unit); //分享的背景图片 |
707 | ctx.drawImage(images[1], 37 * unit, 185 * unit, 370 * unit, 377 * unit); //分享的背景图片 | 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 | ctx.drawImage(th.data.share_lb_img, 90 * unit, 231 * unit, 266 * unit, 160 * unit); //分享的礼包的背景图片 | 712 | ctx.drawImage(th.data.share_lb_img, 90 * unit, 231 * unit, 266 * unit, 160 * unit); //分享的礼包的背景图片 |
711 | 713 | ||
@@ -797,8 +799,9 @@ Page({ | @@ -797,8 +799,9 @@ Page({ | ||
797 | left += imagesize + spacing; | 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 | var neednum = help_num - head_list_img.length; | 803 | var neednum = help_num - head_list_img.length; |
804 | + if(neednum>6) neednum=6; | ||
802 | //这个是还未助力的位置 | 805 | //这个是还未助力的位置 |
803 | for (var i = 0; i < neednum; i++) { | 806 | for (var i = 0; i < neednum; i++) { |
804 | // 助力人的头像 | 807 | // 助力人的头像 |
@@ -942,7 +945,7 @@ Page({ | @@ -942,7 +945,7 @@ Page({ | ||
942 | var data = res.data.data.pageData; //帮拆数组 | 945 | var data = res.data.data.pageData; //帮拆数组 |
943 | if (data.length > 0) { | 946 | if (data.length > 0) { |
944 | th.data.dynamic = data[0]; | 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 | getApp().request.promise_downimg(path).then(res => { | 950 | getApp().request.promise_downimg(path).then(res => { |
948 | th.data.share_lb_img = res; | 951 | th.data.share_lb_img = res; |
@@ -992,7 +995,7 @@ Page({ | @@ -992,7 +995,7 @@ Page({ | ||
992 | var taskId = e.currentTarget.dataset.taskid; //任务id | 995 | var taskId = e.currentTarget.dataset.taskid; //任务id |
993 | getApp().goto("/pages/user/assistance/giftpacklist?help_id=" + help_id + "&is_libao=" + 0 + "&taskId=" + taskId); | 996 | getApp().goto("/pages/user/assistance/giftpacklist?help_id=" + help_id + "&is_libao=" + 0 + "&taskId=" + taskId); |
994 | }, | 997 | }, |
995 | - | 998 | + |
996 | user_task_list_click:function(){ | 999 | user_task_list_click:function(){ |
997 | if (this.data.switch_head==0) return false; | 1000 | if (this.data.switch_head==0) return false; |
998 | this.data.block=0; | 1001 | this.data.block=0; |