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
d9eca4d2
Commit
d9eca4d2
authored
Jun 05, 2019
by
赵雅纹
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into feature-zyw
# Conflicts: # src/component/personCenter/personCenter.js
parents
57f6ff1d
6c133907
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
201 additions
and
112 deletions
+201
-112
app.json
src/app.json
+4
-1
personCenter.js
src/component/personCenter/personCenter.js
+9
-32
couponDetail.js
src/pages/couponDetail/couponDetail.js
+1
-1
couponDetail.wxml
src/pages/couponDetail/couponDetail.wxml
+21
-3
couponDetail.wxss
src/pages/couponDetail/couponDetail.wxss
+70
-28
coupons.js
src/pages/coupons/coupons.js
+15
-5
coupons.wxml
src/pages/coupons/coupons.wxml
+1
-1
userCenter.js
src/pages/userCenter/userCenter.js
+51
-32
userCenter.wxml
src/pages/userCenter/userCenter.wxml
+1
-1
project.config.json
src/project.config.json
+5
-6
util.js
src/utils/util.js
+23
-2
No files found.
src/app.json
View file @
d9eca4d2
...
@@ -21,6 +21,8 @@
...
@@ -21,6 +21,8 @@
"navigationBarTextStyle"
:
"black"
"navigationBarTextStyle"
:
"black"
},
},
"navigateToMiniProgramAppIdList"
:
[
"navigateToMiniProgramAppIdList"
:
[
"wxeb490c6f9b154ef9"
"wxeb490c6f9b154ef9"
,
"wxcf6d299fecd830cf"
,
"wx5717ceb7cfa09f2e"
]
]
}
}
\ No newline at end of file
src/component/personCenter/personCenter.js
View file @
d9eca4d2
...
@@ -8,7 +8,15 @@ Component({
...
@@ -8,7 +8,15 @@ Component({
personData
:
{
personData
:
{
type
:
Object
,
type
:
Object
,
value
:
{},
value
:
{},
},
},
integralNum
:
{
type
:
Number
,
value
:
0
,
},
couponNum
:
{
type
:
Number
,
value
:
0
,
},
},
},
/**
/**
* 页面的初始数据
* 页面的初始数据
...
@@ -45,37 +53,6 @@ Component({
...
@@ -45,37 +53,6 @@ Component({
console
.
log
(
this
.
data
.
baseUrl
);
console
.
log
(
this
.
data
.
baseUrl
);
},
},
methods
:
{
methods
:
{
// 查询积分信息
getMemberPointInfo
(){
console
.
log
(
'getMemberPointInfo'
)
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
get
(
`/member/memberPoint/getMyPointInfo`
).
then
(
res
=>
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
this
.
setData
({
integralNum
:
data
.
point
})
}
})
},
// 查询优惠券数量
getMemberCouponInfo
(){
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
post
(
`/coupon/coupon/memberCouponCount`
).
then
(
res
=>
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
this
.
setData
({
couponNum
:
data
[
1
]
||
0
})
}
})
},
toBonusDetails
()
{
toBonusDetails
()
{
wxService
.
router
(
`/pages/integralWater/integralWater`
)
wxService
.
router
(
`/pages/integralWater/integralWater`
)
},
},
...
...
src/pages/couponDetail/couponDetail.js
View file @
d9eca4d2
...
@@ -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 @
d9eca4d2
<!--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>-->
<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>
\ No newline at end of file
src/pages/couponDetail/couponDetail.wxss
View file @
d9eca4d2
/* 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/coupons/coupons.js
View file @
d9eca4d2
...
@@ -47,8 +47,8 @@ wxService.page({
...
@@ -47,8 +47,8 @@ wxService.page({
}
else
{
}
else
{
this
.
setData
({
this
.
setData
({
currentTab
:
current
,
currentTab
:
current
,
couponList
:
[],
// 清空数据
//
couponList: [], // 清空数据
invalidCouponList
:
[],
//
invalidCouponList: [],
})
})
}
}
...
@@ -85,12 +85,24 @@ wxService.page({
...
@@ -85,12 +85,24 @@ wxService.page({
params
=
{
params
=
{
status
:
1
status
:
1
}
}
if
(
pageNo
==
1
){
this
.
setData
({
pageNo
:
1
,
couponList
:
[],
// 清空数据
})
}
}
else
{
}
else
{
params
=
{
params
=
{
statusNot
:
1
statusNot
:
1
}
}
if
(
pageNo
==
1
){
this
.
setData
({
invalidCouponList
:
[],
invalidPageNo
:
1
})
}
}
}
wxService
.
post
(
`/coupon/coupon/listWithMember4Mina?number=
${
pageNo
}
&size=
${
pageSize
}
`
,
params
).
then
(
res
=>
{
wxService
.
post
(
`/coupon/coupon/listWithMember4Mina?number=
${
pageNo
}
&size=
${
pageSize
}
`
,
params
).
then
(
res
=>
{
const
{
result
,
data
}
=
res
.
data
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
){
if
(
result
==
0
){
...
@@ -116,7 +128,6 @@ wxService.page({
...
@@ -116,7 +128,6 @@ wxService.page({
invalidTotalElements
:
data
.
totalElements
invalidTotalElements
:
data
.
totalElements
})
})
}
}
}
}
}).
finally
(()
=>
{
}).
finally
(()
=>
{
...
@@ -133,7 +144,6 @@ wxService.page({
...
@@ -133,7 +144,6 @@ wxService.page({
onReachBottom
:
function
()
{
onReachBottom
:
function
()
{
// 可使用 0 or 已失效 1
// 可使用 0 or 已失效 1
const
{
currentTab
,
pageNo
,
pageSize
,
totalPages
,
invalidPageNo
,
invalidTotalPages
}
=
this
.
data
const
{
currentTab
,
pageNo
,
pageSize
,
totalPages
,
invalidPageNo
,
invalidTotalPages
}
=
this
.
data
console
.
log
(
'2222'
,
currentTab
)
if
(
currentTab
==
0
)
{
if
(
currentTab
==
0
)
{
if
(
pageNo
<
totalPages
)
{
if
(
pageNo
<
totalPages
)
{
this
.
setData
({
this
.
setData
({
...
...
src/pages/coupons/coupons.wxml
View file @
d9eca4d2
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
<image src='/assets/imgs/qr-code.png' />
<image src='/assets/imgs/qr-code.png' />
</view>
</view>
<view class='coupon-info'>
<view class='coupon-info'>
<view class='coupon-name fs-28'>{{item.t
ypeDesc
}}</view>
<view class='coupon-name fs-28'>{{item.t
itle
}}</view>
<view class='coupon-time fs-24'>{{item.startTime}} 至 {{item.endTime}}</view>
<view class='coupon-time fs-24'>{{item.startTime}} 至 {{item.endTime}}</view>
<view class='coupon-desc fs-24'>{{item.notice}}</view>
<view class='coupon-desc fs-24'>{{item.notice}}</view>
</view>
</view>
...
...
src/pages/userCenter/userCenter.js
View file @
d9eca4d2
...
@@ -16,44 +16,15 @@ wxService.page({
...
@@ -16,44 +16,15 @@ wxService.page({
render
:
null
,
// 渲染页面数据对象(安全渲染)
render
:
null
,
// 渲染页面数据对象(安全渲染)
renderPageOver
:
false
,
// 渲染页面结束
renderPageOver
:
false
,
// 渲染页面结束
startX
:
0
,
startX
:
0
,
startY
:
0
startY
:
0
,
integralNum
:
0
,
couponNum
:
0
},
},
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
// this.setData(
// {
// pages: [],
// groupLoadState: 'complete', // 活动分组加载标志
// homeApiLoading: true,
// render: null, // 渲染页面数据对象(安全渲染)
// isLastPage: false, // 页面段落加载完成
// renderPageOver: false // 渲染页面结束
// },
// () => {
// // this.loadMore()
// }
// )
// handlerDataOnPage = new utils.HandlerDataOnPage()
// renderPage = require('../../utils/renderPage').getRenderPage()
// handlerDataOnPage.init(this, 'pages')
// this.initPage()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
:
function
()
{
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
this
.
setData
(
this
.
setData
(
{
{
pages
:
[],
pages
:
[],
...
@@ -73,6 +44,54 @@ wxService.page({
...
@@ -73,6 +44,54 @@ wxService.page({
this
.
initPage
()
this
.
initPage
()
},
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
:
function
()
{
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
// 积分数量
this
.
getMemberPointInfo
()
// 优惠券数量
this
.
getMemberCouponInfo
()
},
// 查询积分信息
getMemberPointInfo
(){
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
get
(
`/member/memberPoint/getMyPointInfo`
).
then
(
res
=>
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
this
.
setData
({
integralNum
:
data
.
point
})
}
})
},
// 查询优惠券数量
getMemberCouponInfo
(){
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
post
(
`/coupon/coupon/memberCouponCount`
).
then
(
res
=>
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
this
.
setData
({
couponNum
:
data
[
1
]
||
0
})
}
})
},
touchStart
(
e
)
{
touchStart
(
e
)
{
this
.
setData
({
this
.
setData
({
startX
:
e
.
changedTouches
[
0
].
clientX
,
startX
:
e
.
changedTouches
[
0
].
clientX
,
...
...
src/pages/userCenter/userCenter.wxml
View file @
d9eca4d2
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
<!-- 个人中心 {{pItem.customer}}-->
<!-- 个人中心 {{pItem.customer}}-->
<view class="images-tab pd1530" wx:if="{{pItem.type == 2}}">
<view class="images-tab pd1530" wx:if="{{pItem.type == 2}}">
<person-center person-data="{{pItem.customer}}" />
<person-center person-data="{{pItem.customer}}"
integral-num="{{integralNum}}" coupon-num="{{couponNum}}"
/>
</view>
</view>
<!-- 图片导航 {{pItem.navigation.images}}-->
<!-- 图片导航 {{pItem.navigation.images}}-->
...
...
src/project.config.json
View file @
d9eca4d2
{
{
"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 @
d9eca4d2
...
@@ -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