Commit c2b7eba5 by 高淑倩

add: canvas err

parent e7d54d43
......@@ -24,7 +24,16 @@ wxService.page({
})
this.getCouponDetail(cardno)
},
onLoad() {
const {cardno} = this.data
// 条形码
if(cardno){
wxbarcode.barcode('barcode', cardno, 600, 180);
}
},
canvasIdErrorCallback (e) {
console.error(e.detail.errMsg)
},
// 查询单个优惠券
getCouponDetail(cardno){
wx.showLoading({
......@@ -37,7 +46,7 @@ wxService.page({
this.setData({
codeDetail: data
})
// 条形码
// // 条形码
wxbarcode.barcode('barcode', cardno, 600, 180);
} else {
wx.hideLoading()
......
......@@ -11,7 +11,7 @@
<image src='/assets/imgs/line.png'></image>
</view>
<view class="barcode">
<canvas canvas-id="barcode" />
<canvas canvas-id="barcode" binderror="canvasIdErrorCallback"/>
</view>
<view class='bottom-code'>{{cardno}}</view>
</view>
......
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