Commit 8ad4c186 by 高淑倩

modify: 条形码

parent 067b3e84
...@@ -11,37 +11,21 @@ wxService.page({ ...@@ -11,37 +11,21 @@ wxService.page({
*/ */
data: { data: {
couponDetailTitle: '', couponDetailTitle: '',
cardno: ''
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow () {
// Promise.JsBarcode("#imgcode", "123", {
// format: "CODE39",//选择要使用的条形码类型
// width:3,//设置条之间的宽度
// height:100,//高度
// displayValue:true,//是否在条形码下方显示文字
// text:"456",//覆盖显示的文本
// fontOptions:"bold italic",//使文字加粗体或变斜体
// font:"fantasy",//设置文本的字体
// textAlign:"left",//设置文本的水平对齐方式
// textPosition:"top",//设置文本的垂直位置
// textMargin:5,//设置条形码和文本之间的间距
// fontSize:15,//设置文本的大小
// background:"#eee",//设置条形码的背景
// lineColor:"#2196f3",//设置条和文本的颜色。
// margin:15//设置条形码周围的空白边距
// });
wxbarcode.barcode('barcode', '1234567890123456789', 700, 150);
const {title,cardno} = this.options const {title,cardno} = this.options
this.setData({ this.setData({
couponDetailTitle: title couponDetailTitle: title,
cardno
}) })
this.getCouponDetail(cardno) this.getCouponDetail(cardno)
// 条形码
wxbarcode.barcode('barcode',cardno, 600, 150);
}, },
// 查询单个优惠券 // 查询单个优惠券
...@@ -49,7 +33,6 @@ wxService.page({ ...@@ -49,7 +33,6 @@ wxService.page({
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
wxService.post(`/coupon/coupon/get?cardNo=${cardno}`).then(res => { wxService.post(`/coupon/coupon/get?cardNo=${cardno}`).then(res => {
const {result,data} = res.data const {result,data} = res.data
if(result == 0){ if(result == 0){
...@@ -61,9 +44,6 @@ wxService.page({ ...@@ -61,9 +44,6 @@ wxService.page({
icon: 'none' icon: 'none'
}) })
} }
}).finally(() => { }).finally(() => {})
})
} }
}) })
\ No newline at end of file
...@@ -11,13 +11,11 @@ ...@@ -11,13 +11,11 @@
<image src='/assets/imgs/line.png'></image> <image src='/assets/imgs/line.png'></image>
</view> </view>
<view class='qr-code'> <view class='qr-code'>
<view class='top-code'>987876786</view> <!-- <view class='top-code'>987876786</view>-->
<view class='code-img'> <view class='code-img'>
<canvas canvas-id="barcode" /> <canvas canvas-id="barcode" />
<!--<img id="imgcode" /> -->
</view> </view>
<view class='bottom-code'>987868</view> <view class='bottom-code'>{{cardno}}</view>
</view> </view>
</view> </view>
</view> </view>
/* pages/couponDetail/couponDetail.wxss */ /* pages/couponDetail/couponDetail.wxss */
canvas{
height: 80px!important;
}
.coupon-detail-content{ .coupon-detail-content{
width: 642rpx; width: 642rpx;
margin: 52rpx auto; margin: 52rpx auto;
/* background-color: #ffffff; */
text-align: center; text-align: center;
box-shadow: 0 0 30rpx 10rpx rgba(0,0,0,0.1); box-shadow: 0 0 30rpx 10rpx rgba(0,0,0,0.1);
} }
...@@ -30,7 +32,7 @@ ...@@ -30,7 +32,7 @@
} }
.code-img{ .code-img{
margin-top: 30rpx; margin-top: 30rpx;
margin-left: 5px; margin-left: 10px;
} }
.bottom-code{ .bottom-code{
font-size: 40rpx; font-size: 40rpx;
......
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