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");