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
747bbc4c
Commit
747bbc4c
authored
May 25, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 优惠券列表
parent
91e90b33
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
181 additions
and
88 deletions
+181
-88
noMore.wxss
src/component/noMore/noMore.wxss
+2
-1
IntegralMall.js
src/pages/IntegralMall/IntegralMall.js
+5
-0
coupons.js
src/pages/coupons/coupons.js
+63
-55
coupons.json
src/pages/coupons/coupons.json
+5
-1
coupons.wxml
src/pages/coupons/coupons.wxml
+60
-22
coupons.wxss
src/pages/coupons/coupons.wxss
+29
-0
integralWater.js
src/pages/integralWater/integralWater.js
+6
-5
integralWater.json
src/pages/integralWater/integralWater.json
+1
-0
integralWater.wxml
src/pages/integralWater/integralWater.wxml
+1
-1
project.config.json
src/project.config.json
+7
-1
Http.js
src/utils/Http.js
+2
-2
No files found.
src/component/noMore/noMore.wxss
View file @
747bbc4c
...
...
@@ -4,5 +4,5 @@
text-align: center;
font-size: 21rpx;
color: #bfbfbf;
margin-top: 45rpx;
/* margin-top: 45rpx; */
}
\ No newline at end of file
src/pages/IntegralMall/IntegralMall.js
View file @
747bbc4c
...
...
@@ -79,6 +79,10 @@ wxService.page({
noMore
:
true
})
this
.
initIntegralCouponList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
)
}
else
{
this
.
setData
({
noMore
:
true
})
}
},
})
\ No newline at end of file
src/pages/coupons/coupons.js
View file @
747bbc4c
...
...
@@ -19,27 +19,45 @@ wxService.page({
}
],
navIndex
:
'1'
,
params
:{
pageNo
:
1
,
pageSize
:
10
},
pageNo
:
1
,
pageSize
:
10
,
queryData
:{
"brandId"
:
0
,
"couponSettingId"
:
0
,
"status"
:
0
,
"title"
:
""
//"brandId": 1002
,
//
"couponSettingId": 0,
//
"status": 0,
//
"title": ""
},
totalPages
:
''
totalPages
:
0
,
totalElements
:
0
,
invalidTotalElements
:
0
,
couponList
:
[],
invalidCouponList
:
[],
currentTab
:
0
,
noMoreCoupon
:
false
,
noMoreCouponInvalid
:
false
},
//滑动切换
swiperTab
:
function
(
e
)
{
var
that
=
this
;
that
.
setData
({
currentTab
:
e
.
detail
.
current
});
},
//点击切换
clickTab
:
function
(
e
)
{
var
that
=
this
;
if
(
this
.
data
.
currentTab
===
e
.
target
.
dataset
.
current
)
{
return
false
;
}
else
{
that
.
setData
({
currentTab
:
e
.
target
.
dataset
.
current
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
},
onLoad
:
function
(
options
)
{},
/**
* 生命周期函数--监听页面显示
*/
...
...
@@ -47,70 +65,61 @@ wxService.page({
this
.
setData
({
'queryData.status'
:
this
.
data
.
navIndex
})
this
.
getCouponList
()
this
.
getCouponList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
)
},
//切换tab
switchTab
(
e
){
this
.
setData
({
navIndex
:
e
.
currentTarget
.
dataset
.
index
,
'queryData.status'
:
e
.
currentTarget
.
dataset
.
index
})
this
.
getCouponList
(
)
},
//
switchTab(e){
//
this.setData({
//
navIndex: e.currentTarget.dataset.index,
//
'queryData.status': e.currentTarget.dataset.index
//
})
// this.getCouponList(this.data.pageNo,this.data.pageSize
)
//
},
//获取优惠券列表
getCouponList
(
typ
e
){
getCouponList
(
pageNo
,
pageSiz
e
){
wx
.
showLoading
({
title
:
'加载中'
})
this
.
setData
({
'queryData.status'
:
this
.
data
.
navIndex
})
wxService
.
post
(
`/coupon/coupon/setting/list?pageNo=
${
this
.
data
.
params
.
pageNo
}
&pageSize=
${
this
.
data
.
params
.
pageSize
}
`
,
this
.
queryData
).
then
(
res
=>
{
let
couponList
=
[];
couponList
=
this
.
data
.
params
.
pageNo
==
1
?
res
.
data
.
data
:
this
.
data
.
couponList
.
concat
(
res
.
data
.
data
);
// const params = this.data.queryData
const
params
=
{}
wxService
.
post
(
`/coupon/coupon/setting/list?pageNo=
${
pageNo
}
&pageSize=
${
pageSize
}
`
,
params
).
then
(
res
=>
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
){
wx
.
hideLoading
()
this
.
setData
({
couponList
,
totalPages
:
res
.
data
.
data
.
totalPages
,
couponList
:
this
.
data
.
pageNo
==
1
?
[...
data
.
content
]:
[...
this
.
data
.
couponList
,...
data
.
content
],
totalPages
:
data
.
totalPages
,
totalElements
:
data
.
totalElements
})
wx
.
hideLoading
();
if
(
type
&&
type
.
pullDown
)
wx
.
stopPullDownRefresh
();
}
}).
finally
(()
=>
{
wx
.
hideLoading
();
this
.
setData
({
couponList
:
''
})
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
this
.
setData
({
params
:
{
pageNo
:
1
,
pageSize
:
10
,
},
})
this
.
getCouponList
({
pullDown
:
true
});
},
onPullDownRefresh
:
function
()
{},
/**
* 页面上拉触底事件的处理函数
*/
bindDownLoad
:
function
()
{
if
(
this
.
data
.
pa
rams
.
pa
geNo
<
this
.
data
.
totalPages
)
{
onReachBottom
:
function
()
{
if
(
this
.
data
.
pageNo
<
this
.
data
.
totalPages
)
{
this
.
setData
({
params
:
{
pageNo
:
this
.
data
.
params
.
pageNo
+
1
,
pageSize
:
10
},
loadDataDone
:
true
pageNo
:
this
.
data
.
pageNo
+
1
,
// loadDataDone: true
})
this
.
getCouponList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
)
}
else
{
this
.
setData
({
noMoreCoupon
:
true
})
this
.
getCouponList
()
}
},
})
\ No newline at end of file
src/pages/coupons/coupons.json
View file @
747bbc4c
{
"enablePullDownRefresh"
:
true
,
"navigationBarTitleText"
:
"我的卡券"
,
"usingComponents"
:
{}
"usingComponents"
:
{
"no-more"
:
"/component/noMore/noMore"
}
}
\ No newline at end of file
src/pages/coupons/coupons.wxml
View file @
747bbc4c
<!--pages/userCenter.wxml-->
<view class='page-coupons'>
<view class='tabs-wrap'>
<view wx:for='{{nav}}' wx:key='{{index}}' class="tab-nav fs-25 {{navIndex == item.type ? 'nav-active' : ''}}" data-index='{{item.type}}' bindtap='switchTab'>{{item.name}}(0)</view>
<!--<view class='tabs-wrap'>
<view wx:for='{{nav}}' wx:key='{{index}}' class="tab-nav fs-25 {{navIndex == item.type ? 'nav-active' : ''}}" data-index='{{item.type}}' bindtap='switchTab'>{{item.name}}({{item.type ? totalElements:invalidTotalElements }})</view>
</view>-->
<view class="swiper-tab">
<view class="swiper-tab-item {{currentTab==0?'active':''}}" data-current="0" bindtap="clickTab">可使用 ({{totalElements}})</view>
<view class="swiper-tab-item {{currentTab==1?'active':''}}" data-current="1" bindtap="clickTab">已失效 ({{invalidTotalElements}})</view>
</view>
<scroll-view scroll-y bindscrolltolower="bindDownLoad">
<swiper current="{{currentTab}}" duration="300" bindchange="swiperTab">
<swiper-item wx:if="{{couponList.length}}">
<scroll-view scroll-y>
<view class='coupon-wrap'>
<view class='coupon-list'>
<view
class='coupon-list'
wx:for="{{couponList}}"
wx:for-item="item"
wx:for-index="k"
wx:key="{{k}}"
>
<navigator hover-class='none' url='/pages/couponDetail/couponDetail'>
<image class='coupon-bg' src='/assets/imgs/coupon-bg.png'></image>
<view wx:if="{{invalidCouponList.length}}">
<view class='invalid-coupon' />
<image src='/assets/imgs/invalid.png' class='invalid-img' />
</view>
<image class='coupon-bg' src='/assets/imgs/coupon-bg.png' />
<view class='coupon-img'>
<image src='/assets/imgs/qr-code.png'></image
>
<image src='/assets/imgs/qr-code.png' /
>
</view>
<view class='coupon-info'>
<view class='coupon-name fs-28'>卡劵名称
</view>
<view class='coupon-time fs-24'>时间
</view>
<view class='coupon-desc fs-24'>是个梵蒂冈设计费郭德纲发电机房
</view>
<view class='coupon-name fs-28'>{{item.couponSetting.typeDesc}}
</view>
<view class='coupon-time fs-24'>{{item.couponSetting.startTime}} 至 {{item.couponSetting.endTime}}
</view>
<view class='coupon-desc fs-24'>{{item.couponSetting.typeDesc}}
</view>
</view>
<view class='coupon-code fs-24'>出示劵码</view>
</navigator>
</view>
<view class='coupon-list'>
<!-- 失效 -->
<view class='invalid-coupon'></view>
<image src='/assets/imgs/invalid.png' class='invalid-img'></image>
<!-- 未失效 -->
<image class='coupon-bg' src='/assets/imgs/coupon-bg.png'></image>
</view>
</scroll-view>
<no-more wx:if="{{noMoreCoupon}}" />
<view class='empty-wrap' wx:if="{{!couponList.length}}">
<view class='empty-info'>
<image class='empty-img' src='/assets/imgs/empty-coupon.png' />
<view class='empty-text'>没有任何卡劵</view>
</view>
</view>
</swiper-item>
<swiper-item>
<scroll-view scroll-y wx:if="{{invalidCouponList.length}}">
<view class='coupon-wrap'>
<view
class='coupon-list'
wx:for="{{invalidCouponList}}"
wx:for-item="item"
wx:for-index="k"
wx:key="{{k}}"
>
<view class='invalid-coupon' />
<image src='/assets/imgs/invalid.png' class='invalid-img' />
<image class='coupon-bg' src='/assets/imgs/coupon-bg.png' />
<view class='coupon-img'>
<image src='/assets/imgs/qr-code.png'></image
>
<image src='/assets/imgs/qr-code.png' /
>
</view>
<view class='coupon-info'>
<view class='coupon-name fs-28'>卡劵名称
</view>
<view class='coupon-time fs-24'>时间
</view>
<view class='coupon-desc fs-24'>是个梵蒂冈设计费郭德纲发电机房
</view>
<view class='coupon-name fs-28'>{{item.couponSetting.typeDesc}}
</view>
<view class='coupon-time fs-24'>{{item.couponSetting.startTime}} 至 {{item.couponSetting.endTime}}
</view>
<view class='coupon-desc fs-24'>{{item.couponSetting.typeDesc}}
</view>
</view>
<view class='coupon-code fs-24'>出示劵码</view>
</view>
</view>
<view class='empty-wrap'>
</scroll-view>
<no-more wx:if="{{noMoreCouponInvalid}}" />
<view class='empty-wrap' wx:if="{{!invalidCouponList.length}}">
<view class='empty-info'>
<image class='empty-img' src='/assets/imgs/empty-coupon.png'></image
>
<image class='empty-img' src='/assets/imgs/empty-coupon.png' /
>
<view class='empty-text'>没有任何卡劵</view>
</view>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
src/pages/coupons/coupons.wxss
View file @
747bbc4c
/* pages/userCenter.wxss */
@import './../../base/base.wxss';
.page-coupons{
position: relative;
}
.tabs-wrap{
height: 86rpx;
}
...
...
@@ -100,3 +103,29 @@
top: 31rpx;
z-index: 4;
}
.swiper-tab{
width: 100%;
height: 86rpx;
line-height: 86rpx;
display: flex;
background-color: #ffffff;
color: #666666;
position:fixed;
z-index:1;
}
.swiper-tab-item{
flex: 1;
text-align: center;
}
.active{
color: #05c35b;
border-bottom: 4rpx solid #05c35b;
}
swiper {
width: 100%;
flex: 1;
height:100vh;
padding-bottom:20rpx;
position: absolute;
top: 100rpx;
}
src/pages/integralWater/integralWater.js
View file @
747bbc4c
...
...
@@ -12,7 +12,8 @@ wxService.page({
integralNum
:
1246
,
pageNo
:
1
,
pageSize
:
30
,
integralList
:
[]
integralList
:
[],
noMore
:
false
},
/**
* 生命周期函数--监听页面加载
...
...
@@ -21,9 +22,7 @@ wxService.page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
:
function
()
{
},
onReady
:
function
()
{},
/**
* 生命周期函数--监听页面显示
*/
...
...
@@ -92,7 +91,9 @@ wxService.page({
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
this
.
setData
({
noMore
:
true
})
},
/**
...
...
src/pages/integralWater/integralWater.json
View file @
747bbc4c
{
"enablePullDownRefresh"
:
true
,
"navigationBarTitleText"
:
"积分流水"
,
"usingComponents"
:
{
"no-more"
:
"/component/noMore/noMore"
...
...
src/pages/integralWater/integralWater.wxml
View file @
747bbc4c
...
...
@@ -24,7 +24,7 @@
<view class="detail-num" wx:if="{{item.operation}}">+ {{item.changeValue}}</view>
<view class="detail-num minus" wx:if="{{!item.operation}}">- {{item.changeValue}}</view>
</view>
<no-more />
<no-more
wx:if="{{noMore}}"
/>
</view>
</view>
</view>
src/project.config.json
View file @
747bbc4c
...
...
@@ -37,7 +37,7 @@
"list"
:
[]
},
"miniprogram"
:
{
"current"
:
6
,
"current"
:
9
,
"list"
:
[
{
"id"
:
-1
,
...
...
@@ -92,6 +92,12 @@
"name"
:
"我的卡券"
,
"pathName"
:
"pages/coupons/coupons"
,
"query"
:
""
},
{
"id"
:
-1
,
"name"
:
"我的消费"
,
"pathName"
:
"pages/mySpend/mySpend"
,
"query"
:
""
}
]
}
...
...
src/utils/Http.js
View file @
747bbc4c
...
...
@@ -86,7 +86,7 @@ class Http {
header
:
{
// 'buyer-token': this.getToken()
// 'buyer-token': '187ef4436122d1cc2f40dc2b92f0eba0'
'seller-token'
:
'
2e72711cc202bb9c5dd7c277ee4f2b5
9'
'seller-token'
:
'
f80d09122733517ea4a0c2628c4eb0e
9'
},
data
:
parmas
})
...
...
@@ -99,7 +99,7 @@ class Http {
header
:
{
// 'buyer-token': wx.getStorageSync('token')
// 'buyer-token':'187ef4436122d1cc2f40dc2b92f0eba0'
'seller-token'
:
'
2e72711cc202bb9c5dd7c277ee4f2b5
9'
'seller-token'
:
'
f80d09122733517ea4a0c2628c4eb0e
9'
},
data
:
parmas
,
channel
:
channel
...
...
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