From 8388ed527fe46be9f22e77c8a3c332ab57eae723 Mon Sep 17 00:00:00 2001 From: yvette Date: Wed, 10 Nov 2021 22:20:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=AF=E7=82=B9=E8=AF=A6=E6=83=85=E5=88=86?= =?UTF-8?q?=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/info/sceneProductInfo/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pages/info/sceneProductInfo/index.js b/pages/info/sceneProductInfo/index.js index 37af081..0efb176 100644 --- a/pages/info/sceneProductInfo/index.js +++ b/pages/info/sceneProductInfo/index.js @@ -327,11 +327,14 @@ Page({ ctx.setFillStyle("#999999"); ctx.setFontSize(28 * ratio); //字大小 ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 - let subtitle = that.data.info.display_tags[0]; - if (subtitle.length > 10) { + let subtitle = that.data.info.sub_title + if (subtitle && subtitle.length > 10) { subtitle = subtitle.substr(0, 10) + '...' } - ctx.fillText(subtitle, 25 * ratio, 540 * ratio); + if(subtitle){ + ctx.fillText(subtitle, 25 * ratio, 540 * ratio); + } + // ctx.draw(); // 划线价 // ctx.setFillStyle("#999999");