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
b7cefa1a
Commit
b7cefa1a
authored
Jun 05, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify: 优惠券条形码自适应
parent
e9c33082
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
120 additions
and
39 deletions
+120
-39
couponDetail.js
src/pages/couponDetail/couponDetail.js
+1
-1
couponDetail.wxml
src/pages/couponDetail/couponDetail.wxml
+20
-2
couponDetail.wxss
src/pages/couponDetail/couponDetail.wxss
+70
-28
userCenter.js
src/pages/userCenter/userCenter.js
+1
-0
project.config.json
src/project.config.json
+5
-6
util.js
src/utils/util.js
+23
-2
No files found.
src/pages/couponDetail/couponDetail.js
View file @
b7cefa1a
...
@@ -25,7 +25,7 @@ wxService.page({
...
@@ -25,7 +25,7 @@ wxService.page({
})
})
this
.
getCouponDetail
(
cardno
)
this
.
getCouponDetail
(
cardno
)
// 条形码
// 条形码
wxbarcode
.
barcode
(
'barcode'
,
cardno
,
550
,
15
0
);
wxbarcode
.
barcode
(
'barcode'
,
cardno
,
600
,
18
0
);
},
},
// 查询单个优惠券
// 查询单个优惠券
...
...
src/pages/couponDetail/couponDetail.wxml
View file @
b7cefa1a
<!--pages/userCenter.wxml-->
<!--pages/userCenter.wxml-->
<view class='page-couponDetail'>
<
!--<
view class='page-couponDetail'>
<view class='coupon-detail-content'>
<view class='coupon-detail-content'>
<view class='coupon-detail-header'>
<view class='coupon-detail-header'>
<view class='avatar-img'>
<view class='avatar-img'>
...
@@ -11,11 +11,28 @@
...
@@ -11,11 +11,28 @@
<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='code-img'>
<view class='code-img'>
<canvas canvas-id="barcode" />
<canvas canvas-id="barcode" />
</view>
</view>
<view class='bottom-code'>{{cardno}}</view>
<view class='bottom-code'>{{cardno}}</view>
</view>
</view>
</view>
</view>
</view>-->
<view class="container-coupon page">
<view class="panel">
<view class="qrcode">
<view class='avatar-img'>
<image src='/assets/imgs/avatar.png'></image>
</view>
<view class='title fs-36'>{{couponDetailTitle}}</view>
</view>
<view class='line'>
<image src='/assets/imgs/line.png'></image>
</view>
<view class="barcode">
<canvas canvas-id="barcode" />
</view>
<view class='bottom-code'>{{cardno}}</view>
</view>
</view>
</view>
\ No newline at end of file
src/pages/couponDetail/couponDetail.wxss
View file @
b7cefa1a
/* pages/couponDetail/couponDetail.wxss */
/* pages/couponDetail/couponDetail.wxss */
canvas{
@import './../../base/base.wxss';
height: 80px!important;
page {
background-color: #fff;
}
}
.
coupon-detail-content
{
.
page
{
width: 642rp
x;
display: fle
x;
margin: 52rpx auto
;
flex-direction: column
;
text-align
: center;
justify-content
: center;
box-shadow: 0 0 30rpx 10rpx rgba(0,0,0,0.1)
;
align-items: center
;
}
}
.avatar-img image{
width: 81rpx;
.container-coupon {
height: 81rpx;
padding-bottom: 10rpx;
margin-top: 58rpx;
}
}
.title{
color: #333333;
.panel {
margin-top: 66rpx;
width:642rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: stretch;
margin: 52rpx 60rpx;
box-sizing: border-box;
border-radius: 10rpx;
background-color: #fff;
box-shadow: 0 0 30rpx 10rpx rgba(0,0,0,0.1);
}
}
.line image{
width: 642rpx;
.barcode {
height: 42rpx;
display: flex;
margin: 80rpx 0;
height: 320rpx;
flex-direction: column;
justify-content: center;
align-items: center;
padding:0 20rpx;
box-sizing: border-box;
}
}
.top-code{
font-size: 24rpx;
.barnum {
color: #999999;
width: 670rpx;
height: 100rpx;
line-height: 100rpx;
font-size: 38rpx;
font-weight: bold;
text-align: center;
letter-spacing: 10rpx;
white-space: nowrap;
}
}
.code-img image{
.barcode > canvas {
width: 600rpx;
width: 600rpx;
height:
150rpx;
height:
200rpx;
}
}
.code-img{
margin-top: 30rpx;
.qrcode {
margin-left: 10px;
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
}
}
.bottom-code{
.bottom-code{
font-size: 40rpx;
font-size: 40rpx;
color: #05c35b;
color: #05c35b;
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
margin-top: 30rpx;
margin-top: 30rpx;
padding-bottom: 140rpx;
}
.avatar-img image{
width: 81rpx;
height: 81rpx;
margin-top: 58rpx;
}
}
.qr-code{
.title{
padding-bottom: 150rpx;
color: #333333;
margin-top: 66rpx;
}
.line image{
width: 100%;
height: 42rpx;
margin: 40rpx 0;
}
}
src/pages/userCenter/userCenter.js
View file @
b7cefa1a
...
@@ -60,6 +60,7 @@ wxService.page({
...
@@ -60,6 +60,7 @@ wxService.page({
this
.
getMemberPointInfo
()
this
.
getMemberPointInfo
()
// 优惠券数量
// 优惠券数量
this
.
getMemberCouponInfo
()
this
.
getMemberCouponInfo
()
},
},
// 查询积分信息
// 查询积分信息
getMemberPointInfo
(){
getMemberPointInfo
(){
...
...
src/project.config.json
View file @
b7cefa1a
{
{
"description"
:
"项目配置文件"
,
"description"
:
"项目配置文件"
,
"packOptions"
:
{
"packOptions"
:
{
...
@@ -15,8 +14,8 @@
...
@@ -15,8 +14,8 @@
"compileType"
:
"miniprogram"
,
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.6.6"
,
"libVersion"
:
"2.6.6"
,
"appid"
:
"wxc3b64b09b1d3dfc2"
,
"appid"
:
"wxc3b64b09b1d3dfc2"
,
"tempappid_wx"
:
"wxc3b64b09b1d3dfc2"
,
"tempappid_wx"
:
"wxc3b64b09b1d3dfc2"
,
"tempappid_711"
:
"wx358b56af62edbde1"
,
"tempappid_711"
:
"wx358b56af62edbde1"
,
"projectname"
:
"7-Eleven"
,
"projectname"
:
"7-Eleven"
,
"debugOptions"
:
{
"debugOptions"
:
{
"hidedInDevtools"
:
[]
"hidedInDevtools"
:
[]
...
@@ -40,7 +39,7 @@
...
@@ -40,7 +39,7 @@
"list"
:
[]
"list"
:
[]
},
},
"miniprogram"
:
{
"miniprogram"
:
{
"current"
:
12
,
"current"
:
3
,
"list"
:
[
"list"
:
[
{
{
"id"
:
-1
,
"id"
:
-1
,
...
@@ -61,10 +60,10 @@
...
@@ -61,10 +60,10 @@
"query"
:
""
"query"
:
""
},
},
{
{
"id"
:
6
,
"id"
:
3
,
"name"
:
"券码详情页"
,
"name"
:
"券码详情页"
,
"pathName"
:
"pages/couponDetail/couponDetail"
,
"pathName"
:
"pages/couponDetail/couponDetail"
,
"query"
:
""
"query"
:
"
cardno=24390355190533807720&title=新券
"
},
},
{
{
"id"
:
7
,
"id"
:
7
,
...
...
src/utils/util.js
View file @
b7cefa1a
...
@@ -47,7 +47,7 @@ function getAccountInfo() {
...
@@ -47,7 +47,7 @@ function getAccountInfo() {
return
accountInfo
return
accountInfo
}
}
/**
*
/**
* 判断用户滑动
* 判断用户滑动
* 左滑还是右滑
* 左滑还是右滑
*/
*/
...
@@ -62,6 +62,26 @@ function getTouchData(endX, endY, startX, startY) {
...
@@ -62,6 +62,26 @@ function getTouchData(endX, endY, startX, startY) {
}
}
/**
/**
* 全面屏
*/
function
aspectRatio
(
h
,
w
)
{
let
viewStyle
=
{}
let
originalScale
=
h
/
w
// view宽高比
wxService
.
getSystemInfo
().
then
(
res
=>
{
let
windowscale
=
res
.
windowHeight
/
res
.
windowWidth
if
(
originalScale
<
windowscale
){
viewStyle
.
width
=
res
.
windowWidth
viewStyle
.
height
=
(
res
.
windowWidth
*
h
)
/
w
;
}
else
{
viewStyle
.
width
=
(
res
.
windowHeight
*
w
)
/
h
viewStyle
.
height
=
res
.
windowHeight
}
})
return
viewStyle
;
}
/**
* 解析 url 参数
* 解析 url 参数
*/
*/
function
parseUrl
(
query
){
function
parseUrl
(
query
){
...
@@ -241,5 +261,6 @@ module.exports = {
...
@@ -241,5 +261,6 @@ module.exports = {
formatNumber
:
formatNumber
,
formatNumber
:
formatNumber
,
logger
:
new
Logger
(),
logger
:
new
Logger
(),
getTouchData
,
getTouchData
,
getAccountInfo
getAccountInfo
,
aspectRatio
}
}
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