Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
8ad4c186
Commit
8ad4c186
authored
Jun 04, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify: 条形码
parent
067b3e84
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
35 deletions
+14
-35
couponDetail.js
src/pages/couponDetail/couponDetail.js
+7
-28
couponDetail.wxml
src/pages/couponDetail/couponDetail.wxml
+3
-5
couponDetail.wxss
src/pages/couponDetail/couponDetail.wxss
+4
-2
No files found.
src/pages/couponDetail/couponDetail.js
View file @
8ad4c186
...
@@ -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
src/pages/couponDetail/couponDetail.wxml
View file @
8ad4c186
...
@@ -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>
src/pages/couponDetail/couponDetail.wxss
View file @
8ad4c186
/* 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:
5
px;
margin-left:
10
px;
}
}
.bottom-code{
.bottom-code{
font-size: 40rpx;
font-size: 40rpx;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment