Commit cd65a26d by 赵雅纹

文案

parent 3ba56a9d
...@@ -11,6 +11,10 @@ Component({ ...@@ -11,6 +11,10 @@ Component({
type: String, type: String,
value: '' value: ''
}, },
cardExplain:{ //文案
type: String,
value: ''
},
productDesc: { // 产品描述 productDesc: { // 产品描述
type: String, type: String,
value: '' value: ''
...@@ -181,13 +185,32 @@ Component({ ...@@ -181,13 +185,32 @@ Component({
// title // title
console.log('productDesc', that.data.productDesc) console.log('productDesc', that.data.productDesc)
if (that.data.productDesc){ if (that.data.productDesc){
ctx.setFontSize(12); ctx.setFontSize(12);
ctx.setFillStyle('#333333'); ctx.setFillStyle('#333333');
ctx.setTextAlign('left'); ctx.setTextAlign('left');
ctx.fillText(that.data.productDesc, 61, 300); ctx.fillText(that.data.productDesc, 61, 300);
}else{
let explain = JSON.parse(that.data.cardExplain)
if (explain[0]){
ctx.setFontSize(12);
ctx.setFillStyle('#333333');
ctx.setTextAlign('left');
ctx.fillText(explain[0], 61, 300);
}
if (explain[1]) {
ctx.setFontSize(12);
ctx.setFillStyle('#333333');
ctx.setTextAlign('left');
ctx.fillText(explain[1], 61, 314);
}
if (explain[2]) {
ctx.setFontSize(12);
ctx.setFillStyle('#333333');
ctx.setTextAlign('left');
ctx.fillText(explain[2], 61, 326);
}
} }
//产品金额 //产品金额
// if (that.data.price || that.data.price == 0) { // if (that.data.price || that.data.price == 0) {
// ctx.setFontSize(25); // ctx.setFontSize(25);
......
...@@ -201,7 +201,7 @@ wxService.page({ ...@@ -201,7 +201,7 @@ wxService.page({
}else{ }else{
this.setData({ this.setData({
cardTitle: this.data.explain ? this.data.explain : this.data.proData[0].productName, cardTitle: this.data.explain ? this.data.explain : this.data.proData[0].productName,
cardUrl: this.data.proData[0].productImgUrl, cardUrl: this.data.proData[0].productImgUrl || 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/product_defalut.jpg',
pagePath: path, pagePath: path,
scene: scene scene: scene
}); });
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<view class="buy-product-content"> <view class="buy-product-content">
<view class="buy-list" wx:if="{{extendProList.length}}" wx:for="{{extendProList}}" wx:key="{{index}}"> <view class="buy-list" wx:if="{{extendProList.length}}" wx:for="{{extendProList}}" wx:key="{{index}}">
<view class="prod-img"> <view class="prod-img">
<image src="{{item.productImgUrl}}" /> <image src="{{item.productImgUrl || 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/product_defalut.jpg'}}" />
</view> </view>
<view class="prod-info"> <view class="prod-info">
<view class="prod-name">{{item.productName}}</view> <view class="prod-name">{{item.productName}}</view>
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
page-path="{{pagePath}}" page-path="{{pagePath}}"
scene="{{scene}}" scene="{{scene}}"
/> />
<share-poster id="getPoster" bindmyevent="myEventListener" avater="{{cardUrl}}" productDesc="{{cardTitle}}" userAvatar="https://xiedemo.oss-cn-shanghai.aliyuncs.com/logo_head.jpg" bind:showMiniCard="_showMiniCard" pagePath="{{pagePath}}" code-img="{{codeImg}}"></share-poster> <share-poster id="getPoster" bindmyevent="myEventListener" avater="{{cardUrl}}" cardExplain="{{cardTitle}}" userAvatar="https://xiedemo.oss-cn-shanghai.aliyuncs.com/logo_head.jpg" bind:showMiniCard="_showMiniCard" pagePath="{{pagePath}}" code-img="{{codeImg}}"></share-poster>
<!--goHome--> <!--goHome-->
<go-home/> <go-home/>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment