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
d859f7c1
Commit
d859f7c1
authored
Apr 28, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mall_dev_7.12.0' into 'mall_dev_7.11.0'
# Conflicts: # src/pages/category/category.wxss
parents
94514429
9be51b90
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
1493 additions
and
314 deletions
+1493
-314
app.json
src/app.json
+5
-1
app.wxss
src/app.wxss
+4
-0
category.js
src/pages/category/category.js
+59
-51
category.json
src/pages/category/category.json
+1
-0
category.wxml
src/pages/category/category.wxml
+40
-49
category.wxss
src/pages/category/category.wxss
+82
-11
couponDetail.js
src/pages/couponDetail/couponDetail.js
+39
-9
couponDetail.wxml
src/pages/couponDetail/couponDetail.wxml
+4
-2
couponDetail.wxss
src/pages/couponDetail/couponDetail.wxss
+5
-1
coupons.js
src/pages/coupons/coupons.js
+55
-118
coupons.wxml
src/pages/coupons/coupons.wxml
+81
-34
coupons.wxss
src/pages/coupons/coupons.wxss
+23
-2
pointDetail.js
src/pages/pointDetail/pointDetail.js
+13
-34
project.config.json
src/project.config.json
+28
-0
userInfo.wxml
src/shoppingGuid/page/pages/userInfo/userInfo.wxml
+5
-1
moneyBugCoupon.js
src/subPackageA/page/pages/moneyBuyCoupon/moneyBugCoupon.js
+70
-0
moneyBugCoupon.json
...subPackageA/page/pages/moneyBuyCoupon/moneyBugCoupon.json
+9
-0
moneyBugCoupon.wxml
...subPackageA/page/pages/moneyBuyCoupon/moneyBugCoupon.wxml
+18
-0
moneyBugCoupon.wxss
...subPackageA/page/pages/moneyBuyCoupon/moneyBugCoupon.wxss
+65
-0
moneyBuyCouponInfo.js
...kageA/page/pages/moneyBuyCouponInfo/moneyBuyCouponInfo.js
+201
-0
moneyBuyCouponInfo.json
...geA/page/pages/moneyBuyCouponInfo/moneyBuyCouponInfo.json
+6
-0
moneyBuyCouponInfo.wxml
...geA/page/pages/moneyBuyCouponInfo/moneyBuyCouponInfo.wxml
+67
-0
moneyBuyCouponInfo.wxss
...geA/page/pages/moneyBuyCouponInfo/moneyBuyCouponInfo.wxss
+230
-0
moneyBuyCouponRecords.js
...page/pages/moneyBuyCouponRecords/moneyBuyCouponRecords.js
+63
-0
moneyBuyCouponRecords.json
...ge/pages/moneyBuyCouponRecords/moneyBuyCouponRecords.json
+8
-0
moneyBuyCouponRecords.wxml
...ge/pages/moneyBuyCouponRecords/moneyBuyCouponRecords.wxml
+16
-0
moneyBuyCouponRecords.wxss
...ge/pages/moneyBuyCouponRecords/moneyBuyCouponRecords.wxss
+43
-0
payCardInfo.js
src/subPackageA/page/pages/payCardInfo/payCardInfo.js
+67
-0
payCardInfo.json
src/subPackageA/page/pages/payCardInfo/payCardInfo.json
+6
-0
payCardInfo.wxml
src/subPackageA/page/pages/payCardInfo/payCardInfo.wxml
+26
-0
payCardInfo.wxss
src/subPackageA/page/pages/payCardInfo/payCardInfo.wxss
+154
-0
wxService.js
src/utils/wxService.js
+0
-1
No files found.
src/app.json
View file @
d859f7c1
...
...
@@ -106,7 +106,11 @@
"pages/shareArticle/shareArticle"
,
"pages/pointActicityGroup/pointActivityGroup"
,
"pages/pointExchangeCoupon/pointExchangeCoupon"
,
"pages/pointExchangeGoods/pointExchangeGoods"
"pages/pointExchangeGoods/pointExchangeGoods"
,
"pages/payCardInfo/payCardInfo"
,
"pages/moneyBuyCoupon/moneyBugCoupon"
,
"pages/moneyBuyCouponInfo/moneyBuyCouponInfo"
,
"pages/moneyBuyCouponRecords/moneyBuyCouponRecords"
]
},
{
...
...
src/app.wxss
View file @
d859f7c1
...
...
@@ -17,6 +17,10 @@
background-color: #cb3c3c;
}
.theme-border-left{
border-left: 4rpx solid #cb3c3c;
}
.theme-text-color {
color: #cb3c3c;
}
...
...
src/pages/category/category.js
View file @
d859f7c1
...
...
@@ -3,16 +3,19 @@ const app = getApp()
const
wxService
=
require
(
'../../utils/wxService'
)
import
{
Integer
}
from
'../../utils/integerDigitalConvertion'
const
{
memberId
,
member
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
defaultCategoryImg
=
'https://img3.bigaka.com/prd/3001/202004/20200428/30012dfcf171-5140-40fc-babd-4482da4f7a1a.jpg'
;
const
defaultWidthCategoryImg
=
'https://img3.bigaka.com/prd/3001/202004/20200428/300168439317-6b28-4947-9054-b6d08b9081ce.jpg'
;
wxService
.
page
({
/**
* 页面的初始数据
*/
data
:
{
cur
Menu
:
[
0
,
0
]
,
cur
rentFirstCategory
:
{}
,
navData
:
[],
secondCategory
:
[],
defaultCategoryImg
:
defaultCategoryImg
,
defaultWidthCategoryImg
:
defaultWidthCategoryImg
,
},
/**
...
...
@@ -60,70 +63,75 @@ wxService.page({
title
:
'加载中'
})
wxService
.
get
(
`/sale/product/mallCategory/buyer/findCategoryTree`
).
then
(
res
=>
{
cons
t
{
result
,
data
}
=
res
.
data
le
t
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
wx
.
hideLoading
();
data
=
data
?
data
:
[];
data
.
forEach
(
item
=>
{
item
.
active
=
false
;
});
// 处理三级标识
this
.
handleFirstCategoryHasThirdChildren
(
data
);
if
(
data
.
length
>
0
){
data
[
0
].
active
=
true
;
this
.
data
.
currentFirstCategory
=
data
[
0
];
this
.
data
.
secondCategory
=
data
[
0
].
children
?
data
[
0
].
children
:
[];
this
.
data
.
secondCategory
=
this
.
handleSecondCategoryChildren
(
this
.
data
.
secondCategory
);
}
this
.
setData
({
navData
:
data
})
navData
:
data
,
secondCategory
:
this
.
data
.
secondCategory
,
currentFirstCategory
:
this
.
data
.
currentFirstCategory
,
});
}
}).
finally
(()
=>
{
wx
.
hideLoading
()
})
},
selectMenu
:
function
(
event
)
{
const
{
id1
,
id2
,
name1
,
name2
}
=
event
.
target
.
dataset
// xm_bi.Event.stat("classClick", {
// "className": name2,
// "classType": "中类",
// "classID": id2
// })
selectMenu
:
function
(
e
)
{
let
index
=
e
.
currentTarget
.
dataset
.
index
;
this
.
data
.
navData
.
forEach
(
item
=>
{
item
.
active
=
false
;
});
this
.
data
.
navData
[
index
].
active
=
true
;
this
.
data
.
currentFirstCategory
=
this
.
data
.
navData
[
index
];
this
.
data
.
secondCategory
=
this
.
data
.
navData
[
index
].
children
?
this
.
data
.
navData
[
index
].
children
:
[];
this
.
data
.
secondCategory
=
this
.
handleSecondCategoryChildren
(
this
.
data
.
secondCategory
);
this
.
setData
({
curMenu
:
[
event
.
target
.
dataset
.
i
,
event
.
target
.
dataset
.
j
]
})
// app.sr.track('browse_category_detail', {
// first_category: {
// id: id1,
// name: name1
// },
// second_category: {
// id: id2,
// name: name2
// }
// })
navData
:
this
.
data
.
navData
,
secondCategory
:
this
.
data
.
secondCategory
,
currentFirstCategory
:
this
.
data
.
currentFirstCategory
,
});
},
//处理二级分类下的三级 如果没有三级则children 设置为空数组
handleSecondCategoryChildren
(
secondCategory
){
secondCategory
.
forEach
(
item
=>
{
item
.
children
=
item
.
children
?
item
.
children
:
[];
});
/**
* 生命周期函数--监听页面隐藏
*/
onHide
:
function
()
{
return
secondCategory
;
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
:
function
()
{
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
//处理某一级是不是都有三级分类
handleFirstCategoryHasThirdChildren
(
navData
){
navData
.
forEach
(
first
=>
{
first
.
hasThirdChildren
=
false
;
let
firstChildren
=
first
.
children
?
first
.
children
:
[];
if
(
firstChildren
.
length
>
0
){
for
(
let
i
=
0
;
i
<
firstChildren
.
length
;
i
++
){
firstChildren
[
i
].
children
=
firstChildren
[
i
].
children
?
firstChildren
[
i
].
children
:
[];
if
(
firstChildren
[
i
].
children
.
length
>
0
){
first
.
hasThirdChildren
=
true
;
break
;
}
}
}
});
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
},
/**
* 用户点击右上角分享
...
...
src/pages/category/category.json
View file @
d859f7c1
{
"navigationBarTitleText"
:
"分类"
,
"disableScroll"
:
true
,
"usingComponents"
:
{
"go-home"
:
"/component/goHome/goHome"
,
"go-guid"
:
"/component/goGuid/goGuid"
...
...
src/pages/category/category.wxml
View file @
d859f7c1
...
...
@@ -2,64 +2,55 @@
<view class="nav-container search-top">
<scroll-view class="nav-menu" scroll-y="true">
<view
wx:for="{{navData}}"
wx:key="{{j}}"
wx:for-index="j"
wx:for-item="menuSec"
class="menu-item{{j == curMenu[1] ? ' active' : ''}}"
>
<view
class="menu-name{{j == curMenu[1] ? ' theme-text-color' : ''}}"
data-j="{{j}}"
data-name="{{menuSec.label}}"
data-id="{{menuSec.id}}"
bindtap="selectMenu"
>{{menuSec.label}}
<view wx:for="{{navData}}" wx:key="*this" wx:for-index="index" wx:for-item="item" class="menu-item">
<view class="menu-name {{ item.active ? ' theme-text-color' : ''}}"
data-index="{{index}}" data-name="{{item.label}}" data-id="{{item.id}}" bindtap="selectMenu">
{{item.label}}
</view>
</view>
</scroll-view>
<scroll-view class="nav-contents" scroll-y="true">
<view
wx:for="{{navData}}"
wx:key="{{j}}"
wx:for-index="j"
wx:for-item="menuSec"
class="nav-content{{j == curMenu[1] ? ' active' : ''}}"
>
<navigator
hover-class="none"
class="sec-menu-image"
open-type="navigate"
url="/subPackage/page/pages/categoryPro/categoryPro?id={{menuSec.id}}&name={{menuSec.label}}"
>
<image src="{{menuSec.image}}" mode="widthFix" />
</navigator>
<scroll-view class="nav-contents clear-box" scroll-y="true" wx:if="{{currentFirstCategory.id}}">
<!-- 二级分类 -->
<view class="second-category" wx:if="{{!currentFirstCategory.hasThirdChildren}}">
<!-- 无三级分类时 -->
<!-- 显示一级图片 -->
<view class="img-con">
<image src="{{currentFirstCategory.image ? currentFirstCategory.image : defaultWidthCategoryImg}}" mode="widthFix"></image>
</view>
<view class="menu-list">
<view
wx:for="{{menuSec.children}}"
wx:key="{{k}}"
wx:for-index="k"
wx:for-item="menuThr"
class="menu-third"
>
<view data-id="{{menuThr.id}}" data-name="{{menuThr.label}}" bindtap="navPage">
<navigator
hover-class="none"
class="sec-menu-image"
open-type="navigate"
url="/subPackage/page/pages/categoryPro/categoryPro?id={{menuThr.id}}&name={{menuThr.label}}"
>
<image src="{{menuThr.image}}" class="thr-menu-image" />
<view class="thr-menu-name">{{menuThr.label}}</view>
</navigator>
<view wx:for="{{secondCategory}}" wx:key="*this" wx:for-index="k" wx:for-item="second" class="menu-third">
<view data-id="{{second.id}}" data-name="{{second.label}}" bindtap="navPage">
<image src="{{second.image ? second.image : defaultCategoryImg}}" class="thr-menu-image" mode="aspectFill"/>
<view class="thr-menu-name">{{second.label}}</view>
</view>
</view>
</view>
</view>
<!-- 有三级分类时 -->
<view class="second-category" wx:if="{{currentFirstCategory.hasThirdChildren}}">
<view class="category-item" wx:for="{{secondCategory}}" wx:key="*this" wx:for-item="item">
<view class="img-con">
<image src="{{item.image ? item.image : defaultWidthCategoryImg}}" mode="widthFix"></image>
</view>
<view class="more">
<label>{{item.label}}</label>
<view class="right-more">
全部 <image src="/assets/imgs/arrow-right.png" mode="aspectFit"></image>
</view>
</view>
<!-- 具体的布局 -->
<view class="menu-list">
<view wx:for="{{item.children}}" wx:key="*this" wx:for-index="k" wx:for-item="third" class="menu-third">
<view data-id="{{third.id}}" data-name="{{third.label}}" bindtap="navPage">
<image src="{{third.image ? third.image : defaultCategoryImg}}" class="thr-menu-image" mode="aspectFill"/>
<view class="thr-menu-name">{{third.label}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
<!--goHome-->
...
...
src/pages/category/category.wxss
View file @
d859f7c1
...
...
@@ -17,11 +17,15 @@ page {
.nav-menu .menu-item {
position: relative;
/* padding: 0 16rpx; */
padding: 0 28rpx;
font-size: 26rpx;
color: #000000;
line-height: 100rpx;
text-align: center; }
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
/* .nav-menu .menu-item::after {
content: '';
...
...
@@ -40,11 +44,21 @@ page {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 26rpx; }
font-size: 26rpx;
padding: 0 20rpx;
width: 100%;
}
.clear-box{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.nav-contents {
flex: 1;
width: 75%; }
width: 75%;
padding: 30rpx;
}
.nav-content {
display: none;
...
...
@@ -74,19 +88,20 @@ page {
}
.menu-list:after{
content: '';
width: 1
5
0rpx;
width: 1
4
0rpx;
}
.menu-third {
width: 1
5
0rpx;
width: 1
4
0rpx;
text-align: center;
padding-bottom: 32rpx; }
padding-bottom: 32rpx;
}
.menu-third image {
width: 1
5
0rpx;
height: 1
5
0rpx;
width: 1
4
0rpx;
height: 1
4
0rpx;
border-radius: 2rpx;
}
}
.thr-menu-name {
font-size: 24rpx;
...
...
@@ -96,3 +111,59 @@ page {
font-stretch: normal;
letter-spacing: -1px;
color: #333; }
.second-category{
width: 100%;
height: auto;
}
.img-con{
width: 100%;
margin-bottom: 30rpx;
}
.img-con img{
width: 100%;
}
.category-item{
width: 100%;
height: auto;
}
.category-item .more{
width: 100%;
height: auto;
padding: 10rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
color: #333333;
padding-bottom: 20rpx;
border-bottom: solid 1rpx #dddddd;
margin-bottom: 20rpx;
}
.category-item .more label{
font-size: 28rpx;
font-weight: bold;
}
.category-item .more .right-more{
font-size: 24rpx;
color: #999999;
display: flex;
align-items: center;
justify-content: flex-end;
font-weight: 500;
}
.category-item .more .right-more image{
width: 18rpx;
height: 24rpx;
margin-left: 10rpx;
}
src/pages/couponDetail/couponDetail.js
View file @
d859f7c1
...
...
@@ -10,28 +10,56 @@ wxService.page({
*/
data
:
{
couponDetail
:{},
cardno
:
''
cardno
:
''
,
couponType
:
''
,
},
/**
* 生命周期函数--监听页面显示
*/
onShow
()
{
const
{
cardno
}
=
this
.
options
this
.
getCouponDetail
(
cardno
)
this
.
setData
({
cardno
})
},
onLoad
()
{
onLoad
(
options
)
{
wx
.
hideShareMenu
();
const
{
cardno
,
type
}
=
options
this
.
data
.
couponType
=
type
;
this
.
getCouponDetail
(
cardno
,
type
)
this
.
setData
({
cardno
:
cardno
,
couponType
:
type
,
});
},
// 卡券详情
getCouponDetail
(
id
){
getCouponDetail
(
id
,
type
){
wx
.
showLoading
({
title
:
'加载中'
})
});
if
(
!
type
){
this
.
getNormalCouponInfo
(
id
);
}
//支付券
else
if
(
type
==
1
){
this
.
getPayCardInfo
(
id
);
}
//包邮券
else
if
(
type
==
2
){
this
.
getPostalVoucherInfo
(
id
);
}
},
//获取支付券详情
getPayCardInfo
(
id
){
},
//获取包邮券详情
getPostalVoucherInfo
(
id
){
},
//获取优惠券相信
getNormalCouponInfo
(
id
){
wxService
.
post
(
`/coupon/coupon/get?cardNo=
${
id
}
`
).
then
(
res
=>
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
){
...
...
@@ -52,6 +80,8 @@ wxService.page({
wx
.
hideLoading
()
})
},
//展示券码
handelPresentCouponCode
(
e
)
{
// let data = e.currentTarget.dataset
const
{
cardno
}
=
this
.
data
...
...
src/pages/couponDetail/couponDetail.wxml
View file @
d859f7c1
...
...
@@ -12,7 +12,9 @@
<view class='coupon-name fs-28'>{{couponDetail.couponSetting.title}}</view>
<view class='coupon-desc fs-28'>{{couponDetail.coupon.startTime}} 至 {{couponDetail.coupon.endTime}}</view>
</view>
<view class='coupon-code fs-24' bindtap="handelPresentCouponCode">出示券码</view>
<view class='coupon-code fs-24' bindtap="handelPresentCouponCode" wx:if="{{!couponType}}">出示券码</view>
<view class='coupon-code fs-24' wx:if="{{couponType == 1}}">支付券</view>
<view class='coupon-code fs-24' wx:if="{{couponType == 2}}">包邮券</view>
</view>
<view class='integral-detail'>
<!-- <view class='integral-list'>
...
...
@@ -30,7 +32,7 @@
<!--goHome-->
<go-home/>
<floatNav bind:getAuth="_getUserInfo" bind:updatePage="updatePage"/>
<view class="position-bottom">
<view class="position-bottom"
wx:if="{{!couponType}}"
>
<button type='primary' class="redeem-now" bindtap='handelPresentCouponCode'>出示券码</button>
</view>
...
...
src/pages/couponDetail/couponDetail.wxss
View file @
d859f7c1
...
...
@@ -42,10 +42,14 @@
color: #ffffff;
position: absolute;
right: 20rpx;
top:
3
0rpx;
top: 0rpx;
width: 24rpx;
word-wrap: break-word;
font-weight: bold;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.integral-detail{
margin: 90rpx 0 160rpx 0;
...
...
src/pages/coupons/coupons.js
View file @
d859f7c1
...
...
@@ -9,68 +9,44 @@ wxService.page({
* 页面的初始数据
*/
data
:
{
nav
:[
{
type
:
'1'
,
name
:
'可使用'
},{
type
:
'2'
,
name
:
'已失效'
}
],
pageNo
:
1
,
pageSize
:
10
,
invalidPageNo
:
1
,
totalPages
:
0
,
totalElements
:
0
,
invalidTotalElements
:
0
,
couponList
:
[],
invalidCouponList
:
[],
invalidTotalPages
:
0
,
invalidTotalElements
:
0
,
currentTab
:
0
,
noMoreCoupon
:
false
,
noMoreCouponInvalid
:
false
// 支付券
payCouponList
:
[],
//包邮券
postalVoucherList
:
[]
},
//滑动切换
swiperTab
:
function
(
e
)
{
const
{
current
}
=
e
.
detail
if
(
this
.
data
.
currentTab
==
current
)
{
return
false
;
}
else
{
this
.
setData
({
currentTab
:
current
})
}
// 可使用
//滑动切换
swiperTab
:
function
(
e
)
{
const
{
current
}
=
e
.
detail
this
.
tabSwitch
(
current
);
},
// 点击切换
clickTab
:
function
(
e
)
{
const
{
current
}
=
e
.
target
.
dataset
this
.
tabSwitch
(
current
);
},
//tab栏切换
tabSwitch
(
current
){
if
(
this
.
data
.
currentTab
==
current
)
return
false
;
this
.
data
.
currentTab
=
current
;
this
.
setData
({
currentTab
:
this
.
data
.
currentTab
,
});
// 所有可使用优惠券
if
(
current
==
0
){
this
.
getCouponList
(
1
,
10
,
1
)
}
else
if
(
current
==
1
){
// 失效
this
.
getCouponList
(
1
,
10
,
0
)
}
},
// 点击切换
clickTab
:
function
(
e
)
{
const
{
current
}
=
e
.
target
.
dataset
if
(
this
.
data
.
currentTab
==
current
)
{
return
false
;
}
else
{
this
.
setData
({
currentTab
:
current
,
// couponList: [], // 清空数据
// invalidCouponList: [],
})
//微信支付券
}
else
if
(
current
==
2
){
//包邮券
// 可使用
if
(
current
==
0
){
this
.
getCouponList
(
1
,
10
,
1
)
}
else
if
(
current
==
1
){
// 失效
this
.
getCouponList
(
1
,
10
,
0
)
}
},
}
,
/**
* 生命周期函数--监听页面加载
*/
...
...
@@ -82,13 +58,19 @@ wxService.page({
*/
onShow
()
{
// 可使用 已失效
this
.
getCouponList
(
1
,
10
,
1
)
this
.
getCouponList
(
1
,
10
,
0
)
this
.
getCouponList
(
1
,
10
,
1
);
},
//跳转到卡券详情
handelPresentCouponDetail
(
e
)
{
let
{
cardno
}
=
e
.
currentTarget
.
dataset
wxService
.
router
(
`/pages/couponDetail/couponDetail`
).
search
({
cardno
})
let
{
cardno
,
type
}
=
e
.
currentTarget
.
dataset
if
(
type
){
wxService
.
router
(
`/pages/couponDetail/couponDetail`
).
search
({
cardno
:
cardno
,
type
:
type
});
}
else
{
wxService
.
router
(
`/pages/couponDetail/couponDetail`
).
search
({
cardno
:
cardno
});
}
},
//
handelPresentCouponCode
(
e
)
{
let
{
cardno
}
=
e
.
currentTarget
.
dataset
wxService
.
router
(
`/pages/couponCodeDetail/couponCodeDetail`
).
search
({
cardno
})
...
...
@@ -96,59 +78,32 @@ wxService.page({
//获取优惠券列表
getCouponList
(
pageNo
,
pageSize
,
statusNum
){
//获取我的优惠券
wx
.
showLoading
({
title
:
'加载中'
})
let
params
;
if
(
statusNum
==
1
){
params
=
{
status
:
1
}
if
(
pageNo
==
1
){
this
.
setData
({
pageNo
:
1
,
couponList
:
[],
// 清空数据
})
}
}
else
{
params
=
{
statusNot
:
1
}
if
(
pageNo
==
1
){
this
.
setData
({
invalidCouponList
:
[],
invalidPageNo
:
1
})
}
}
});
let
params
=
{};
params
.
status
=
1
;
this
.
data
.
couponList
=
[];
wxService
.
post
(
`/coupon/coupon/listWithMember4Mina?number=
${
pageNo
}
&size=
${
pageSize
}
`
,
params
).
then
(
res
=>
{
wxService
.
post
(
`/coupon/coupon/listWithMember4Mina?number=
1&size=1000000
`
,
params
).
then
(
res
=>
{
if
(
!
res
)
return
false
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
){
console
.
log
(
res
)
wx
.
hideLoading
()
// 处理时间显示
if
(
!
data
.
content
)
return
false
data
.
content
.
forEach
(
item
=>
{
item
.
startTime
=
item
.
startTime
.
substring
(
0
,
10
)
item
.
endTime
=
item
.
endTime
.
substring
(
0
,
10
)
})
// 可使用 or 已失效
if
(
statusNum
==
1
)
{
// couponList
this
.
setData
({
couponList
:
this
.
data
.
pageNo
==
1
?
[...
data
.
content
]:
[...
this
.
data
.
couponList
,...
data
.
content
],
totalPages
:
data
.
totalPages
,
totalElements
:
data
.
totalElements
})
}
else
{
// invalidCouponList
});
this
.
setData
({
invalidCouponList
:
this
.
data
.
invalidPageNo
==
1
?
[...
data
.
content
]:
[...
this
.
data
.
invalidCouponList
,...
data
.
content
],
invalidTotalPages
:
data
.
totalPages
,
invalidTotalElements
:
data
.
totalElements
})
}
couponList
:
data
.
content
,
});
}
}).
finally
(()
=>
{
...
...
@@ -164,29 +119,10 @@ wxService.page({
},
//scoll view 触到底部
onBottom
(){
const
{
currentTab
,
pageNo
,
pageSize
,
totalPages
,
invalidPageNo
,
invalidTotalPages
}
=
this
.
data
if
(
currentTab
==
0
)
{
if
(
pageNo
<
totalPages
)
{
this
.
setData
({
pageNo
:
pageNo
+
1
,
})
// status 1
this
.
getCouponList
(
this
.
data
.
pageNo
,
pageSize
,
1
)
}
else
{
this
.
setData
({
noMoreCoupon
:
true
})
}
}
else
{
this
.
setData
({
noMoreCouponInvalid
:
true
})
}
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
//跳转到我的购买优惠券记录
onTapToBuyCouponRecords
(){
},
})
\ No newline at end of file
src/pages/coupons/coupons.wxml
View file @
d859f7c1
<!--pages/userCenter.wxml-->
<view class='page-coupons'>
<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 class="swiper-tab-item {{currentTab==0?'active':''}}"
data-current="0" bindtap="clickTab">优惠券</view>
<view class="swiper-tab-item {{currentTab==1?'active':''}}"
data-current="1" bindtap="clickTab">微信支付券</view>
<view class="swiper-tab-item {{currentTab==2?'active':''}}"
data-current="2" bindtap="clickTab">包邮券</view>
</view>
<!--bindchange="swiperTab"-->
<swiper current="{{currentTab}}" duration="300" bindchange="swiperTab">
<swiper-item>
<scroll-view scroll-y wx:if="{{couponList.length}}" bindscrolltolower="onBottom">
<swiper-item >
<!-- 优惠券 -->
<scroll-view scroll-y wx:if="{{couponList.length}}" bindscrolltolower="onBottom" style="height:86vh;">
<view class='coupon-wrap'>
<view
class='coupon-list'
wx:for="{{couponList}}"
wx:for-item="item"
wx:for-index="k"
wx:key="{{k}}"
>
wx:key="{{k}}">
<view
data-title="{{item.title}}"
data-cardNo="{{item.cardNo}}"
data-id="{{item.couponId}}"
bindtap="handelPresentCouponDetail">
<image class='coupon-bg'
src='https://img3.bigaka.com/prd/3001/202003/20200309/300109875abd-15b0-4de3-9673-18d2d1ee4e20.png' />
<view class='coupon-img'>
<image wx:if="{{item.takeCouponBgimg}}" class='coupon-bg' src='{{item.takeCouponBgimg}}' mode="aspectFit"/>
<image wx:else src='https://img3.bigaka.com/prd/3001/202003/20200309/30018086c13a-4579-47ed-a16e-c74cb8010c1d.png' />
</view>
<view class='coupon-info'>
<view class='coupon-name fs-28'>{{item.title}}</view>
<view class='coupon-time fs-24'>{{item.startTime}} 至 {{item.endTime}}</view>
<!-- <view class='coupon-desc fs-24'>{{item.notice}}</view> -->
</view>
<view class='coupon-code fs-24' data-cardNo="{{item.cardNo}}" catchtap="handelPresentCouponCode">出示劵码</view>
</view>
</view>
</view>
</scroll-view>
<view class='empty-wrap' wx:if="{{!couponList.length}}">
<view class='empty-info'>
<image class='empty-img'
src='https://img3.bigaka.com/prd/3001/202003/20200309/30012bce7628-f373-4fa7-a6a4-ada9c1c721d6.png' />
<view class='empty-text'>没有任何优惠券~</view>
</view>
</view>
</swiper-item>
<!-- 微信支付券 -->
<swiper-item>
<scroll-view scroll-y wx:if="{{payCouponList.length}}">
<view class='coupon-wrap'>
<view
class='coupon-list'
wx:for="{{payCouponList}}"
wx:for-item="item"
wx:for-index="k"
wx:key="*this">
<view
data-title="{{item.title}}"
data-cardNo="{{item.cardNo}}"
data-id="{{item.couponId}}"
data-type="1"
bindtap="handelPresentCouponDetail"
>
<image class='coupon-bg'
...
...
@@ -33,65 +77,68 @@
<view class='coupon-time fs-24'>{{item.startTime}} 至 {{item.endTime}}</view>
<!-- <view class='coupon-desc fs-24'>{{item.notice}}</view> -->
</view>
<view class='coupon-code fs-24' data-cardNo="{{item.cardNo}}"
catchtap="handelPresentCouponCode">出示劵码
</view>
<view class='coupon-code fs-24' data-cardNo="{{item.cardNo}}"
>查看详情
</view>
</view>
</view>
</view>
<no-more wx:if="{{noMoreCoupon}}" />
</scroll-view>
<view class='empty-wrap' wx:if="{{!couponList.length}}">
<view class='empty-wrap' wx:if="{{!payCouponList.length}}">
<view class='empty-info'>
<image class='empty-img'
src='https://img3.bigaka.com/prd/3001/202003/20200309/30012bce7628-f373-4fa7-a6a4-ada9c1c721d6.png' />
<view class='empty-text'>没有任何
卡劵
</view>
<view class='empty-text'>没有任何
支付券~
</view>
</view>
</view>
</swiper-item>
<!-- 包邮券 -->
<swiper-item>
<scroll-view scroll-y wx:if="{{
invalidCoupon
List.length}}">
<scroll-view scroll-y wx:if="{{
postalVoucher
List.length}}">
<view class='coupon-wrap'>
<view
class='coupon-list'
wx:for="{{
invalidCoupon
List}}"
wx:for="{{
postalVoucher
List}}"
wx:for-item="item"
wx:for-index="k"
wx:key="{{k}}"
>
<view class='invalid-coupon' />
<!--5 已使用 !5 过期-->
<image wx:if="{{item.status == 5}}"
src='https://img3.bigaka.com/prd/3001/202003/20200309/3001c35498ca-ec0d-42b5-a46a-afb8f66ce996.png' class='invalid-img' />
<image wx:else
src='https://img3.bigaka.com/prd/3001/202003/20200309/30018297bfb0-e2b0-4687-838e-e78463eae06f.png' class='invalid-img' />
<image class='coupon-bg'
src='https://img3.bigaka.com/prd/3001/202003/20200309/300109875abd-15b0-4de3-9673-18d2d1ee4e20.png' />
<view class='coupon-img'>
<image wx:if="{{item.takeCouponBgimg}}" class='coupon-bg' src='{{item.takeCouponBgimg}}' />
<image wx:else src='https://img3.bigaka.com/prd/3001/202003/20200309/30018086c13a-4579-47ed-a16e-c74cb8010c1d.png' />
</view>
<view class='coupon-info'>
<view class='coupon-name fs-28'>{{item.title}}</view>
<view class='coupon-time fs-24'>{{item.startTime}} 至 {{item.endTime}}</view>
<!-- <view class='coupon-desc fs-24'>{{item.notice}}</view> -->
<view
data-title="{{item.title}}"
data-cardNo="{{item.cardNo}}"
data-id="{{item.couponId}}"
data-type="2"
bindtap="handelPresentCouponDetail"
>
<image class='coupon-bg'
src='https://img3.bigaka.com/prd/3001/202003/20200309/300109875abd-15b0-4de3-9673-18d2d1ee4e20.png' />
<view class='coupon-img'>
<image wx:if="{{item.takeCouponBgimg}}" class='coupon-bg' src='{{item.takeCouponBgimg}}' />
<image wx:else src='https://img3.bigaka.com/prd/3001/202003/20200309/30018086c13a-4579-47ed-a16e-c74cb8010c1d.png' />
</view>
<view class='coupon-info'>
<view class='coupon-name fs-28'>{{item.title}}</view>
<view class='coupon-time fs-24'>{{item.startTime}} 至 {{item.endTime}}</view>
<!-- <view class='coupon-desc fs-24'>{{item.notice}}</view> -->
</view>
<view class='coupon-code fs-24' data-cardNo="{{item.cardNo}}">查看详情</view>
</view>
<view class='coupon-code fs-24'>出示劵码</view>
</view>
</view>
<view class='no-more-exp'>--- 已失效优惠券最多显示10条 ---</view>
<no-more wx:if="{{noMoreCouponInvalid}}" />
</scroll-view>
<view class='empty-wrap' wx:if="{{!
invalidCoupon
List.length}}">
<view class='empty-wrap' wx:if="{{!
postalVoucher
List.length}}">
<view class='empty-info'>
<image class='empty-img'
src='https://img3.bigaka.com/prd/3001/202003/20200309/30012bce7628-f373-4fa7-a6a4-ada9c1c721d6.png' />
<view class='empty-text'>没有任何
卡劵
</view>
<view class='empty-text'>没有任何
包邮券~
</view>
</view>
</view>
</swiper-item>
</swiper>
</view>
<!-- 优惠券购买记录 -->
<view class="coupon-buy-records" wx:if="{{currentTab == 0}}" bindtap="onTapToBuyCouponRecords">优惠券购买记录</view>
<!--goHome-->
<go-home/>
<floatNav bind:getAuth="_getUserInfo" bind:updatePage="updatePage"/>
...
...
src/pages/coupons/coupons.wxss
View file @
d859f7c1
...
...
@@ -30,6 +30,7 @@ scroll-view{
margin: 190rpx auto 0;
text-align: center;
}
.empty-img{
width: 197rpx;
height: 176rpx;
...
...
@@ -141,9 +142,28 @@ scroll-view{
swiper {
width: 100%;
flex: 1;
height:9
0
vh;
padding-bottom:20rpx;
height:9
1
vh;
/* padding-bottom:20rpx; */
position: absolute;
overflow: scroll;
top: 100rpx;
}
.coupon-buy-records{
background: #05c35b;
width: 100%;
height: 80rpx;
color: #ffffff;
font-size: 28rpx;
position: fixed;
bottom: 0;
left: 0;
z-index: 999;
display: flex;
align-items: center;
justify-content: center;
}
.coupon-buy-records:active{
opacity: 0.7;
}
\ No newline at end of file
src/pages/pointDetail/pointDetail.js
View file @
d859f7c1
...
...
@@ -44,6 +44,7 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
console
.
log
(
options
)
let
memberId
=
options
.
memberId
;
if
(
memberId
)
{
let
tentacleInfo
=
{
...
...
@@ -56,48 +57,26 @@ wxService.page({
this
.
generatePointObject
(
tentacleInfo
);
}
this
.
getOptionsData
();
},
watch
:
{
// experAccessible(newVal, oldVal) {
// if(newVal) {
// this.getOptionsData();
// } else {
// // 去别的页面
// wxService.router(`/subPackage/page/pages/goToHome/goToHome`).replace()
// }
// }
this
.
getOptionsData
(
options
);
},
//获取集点详情
getOptionsData
(){
getOptionsData
(
options
){
// 登录接口返回err
const
reLoginErrFlag
=
wx
.
getStorageSync
(
'reLoginErr'
)
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
let
id
if
(
baseUserInfo
&&
!
reLoginErrFlag
)
{
let
id
=
options
.
id
;
this
.
data
.
isAuthorization
=
false
;
this
.
data
.
id
=
id
;
this
.
getPointDetail
(
this
.
data
.
id
)
this
.
setData
({
isAuthorization
:
false
},
()
=>
{
const
option
=
this
.
options
||
{}
const
{
scene
}
=
option
if
(
scene
)
{
let
idParam
=
decodeURIComponent
(
scene
).
split
(
'&'
)[
0
]
let
shareId
=
idParam
&&
idParam
.
split
(
'='
)[
1
]
||
0
id
=
shareId
}
else
{
id
=
option
.
id
}
isAuthorization
:
false
,
id
:
id
,
});
if
(
id
)
{
this
.
setData
({
id
},
()
=>
{
this
.
getPointDetail
(
id
)
})
}
// 隐藏 dialog
this
.
isShowDialog
(
false
)
})
this
.
isShowDialog
(
false
)
}
else
if
(
!
baseUserInfo
&&
reLoginErrFlag
)
{
this
.
setData
({
...
...
src/project.config.json
View file @
d859f7c1
...
...
@@ -645,6 +645,34 @@
"pathName"
:
"pages/pointList/pointList"
,
"query"
:
""
,
"scene"
:
null
},
{
"id"
:
89
,
"name"
:
"支付券信息"
,
"pathName"
:
"subPackageA/page/pages/payCardInfo/payCardInfo"
,
"query"
:
"id=704053422655279104"
,
"scene"
:
null
},
{
"id"
:
-1
,
"name"
:
"现金购买券列表"
,
"pathName"
:
"subPackageA/page/pages/moneyBuyCoupon/moneyBugCoupon"
,
"query"
:
""
,
"scene"
:
null
},
{
"id"
:
91
,
"name"
:
"现金购买券详情"
,
"pathName"
:
"subPackageA/page/pages/moneyBuyCouponInfo/moneyBuyCouponInfo"
,
"query"
:
"id=704317444864479232"
,
"scene"
:
null
},
{
"id"
:
-1
,
"name"
:
"优惠券购买记录"
,
"pathName"
:
"subPackageA/page/pages/moneyBuyCouponRecords/moneyBuyCouponRecords"
,
"query"
:
""
,
"scene"
:
null
}
]
}
...
...
src/shoppingGuid/page/pages/userInfo/userInfo.wxml
View file @
d859f7c1
...
...
@@ -38,7 +38,11 @@
<view class='guider'>
<view class='header'>
<label>所属导购:</label>
<text>{{guider.member.name ? guider.member.name : "暂无名称"}}</text>
<text>{{guider.member.name ? guider.member.name : "暂无"}}</text>
</view>
<view class='header'>
<label>注册门店:</label>
<text>{{memberInfo.storeName ? memberInfo.storeName : "暂无"}}</text>
</view>
<view class='month'>
...
...
src/subPackageA/page/pages/moneyBuyCoupon/moneyBugCoupon.js
0 → 100644
View file @
d859f7c1
// subPackage/page/pages/valueCard/valueCard.js
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
utils
=
require
(
'../../../../utils/util'
)
wxService
.
page
({
/**
* 页面的初始数据
*/
data
:
{
cardList
:
[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
// wx.hideShareMenu();
this
.
getActivityList
();
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
},
//跳转活动详情
onTapToCardInfo
(
e
){
let
item
=
e
.
currentTarget
.
dataset
.
item
;
wx
.
navigateTo
({
url
:
'/subPackageA/page/pages/moneyBuyCouponInfo/moneyBuyCouponInfo?id='
+
item
.
acvivityId
,
});
},
//获取有效活动列表
getActivityList
(
refresh
){
wx
.
showLoading
({
title
:
'加载中..'
,
});
wxService
.
post
(
`/coupon/couponMoneyBuyActivity/buyer/getValidList`
,{},
null
,
true
).
then
(
res
=>
{
if
(
res
){
let
list
=
res
.
data
.
data
?
res
.
data
.
data
:
[];
this
.
data
.
cardList
=
list
;
this
.
setData
({
cardList
:
this
.
data
.
cardList
});
}
wx
.
hideLoading
();
if
(
refresh
){
setTimeout
(()
=>
{
wx
.
showToast
({
title
:
'刷新成功'
,
});
wx
.
hideNavigationBarLoading
();
wx
.
stopPullDownRefresh
();
},
300
);
}
});
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
wx
.
showNavigationBarLoading
();
this
.
getActivityList
(
true
);
},
})
\ No newline at end of file
src/subPackageA/page/pages/moneyBuyCoupon/moneyBugCoupon.json
0 → 100644
View file @
d859f7c1
{
"navigationBarTitleText"
:
"现金购券"
,
"backgroundTextStyle"
:
"dark"
,
"enablePullDownRefresh"
:
true
,
"usingComponents"
:
{
"empty"
:
"../../../../component/empty/empty"
}
}
\ No newline at end of file
src/subPackageA/page/pages/moneyBuyCoupon/moneyBugCoupon.wxml
0 → 100644
View file @
d859f7c1
<!--subPackage/page/pages/valueCard/valueCard.wxml-->
<view class='cards-list' wx:if="{{cardList.length > 0}}">
<view class='card-item'
wx:for="{{cardList}}"
wx:for-item="item"
wx:for-index="idx"
wx:key="*this"
data-item="{{item}}"
bindtap='onTapToCardInfo'>
<image src='{{item.listPicture}}' mode='widthFix'></image>
<view class='card-buy-btn'>立即抢购</view>
</view>
</view>
<empty text="暂无超值卡活动~" wx:else/>
<view class='no-more' wx:if="{{cardList.length > 5}}">-- 我也是有底线滴 --</view>
\ No newline at end of file
src/subPackageA/page/pages/moneyBuyCoupon/moneyBugCoupon.wxss
0 → 100644
View file @
d859f7c1
/* subPackage/page/pages/valueCard/valueCard.wxss */
page{
background: #ffffff;
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
view{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.cards-list{
width: 100%;
height: auto;
padding: 30rpx;
}
.cards-list .card-item{
width: 100%;
margin-bottom: 20rpx;
position: relative;
}
.cards-list .card-item .card-buy-btn{
position: absolute;
bottom: 20rpx;
right: 20rpx;
width: 174rpx;
height: 54rpx;
border-radius: 27rpx;
background-color: rgba(5, 195, 91, 1);
box-shadow: 0px 3rpx 10rpx 0px rgba(5, 195, 91, 0.3);
color: #ffffff;
display: flex;
align-items: center;
font-size: 24rpx;
justify-content: center;
}
.cards-list .card-item .card-buy-btn:active{
opacity: 0.7;
}
.cards-list .card-item:last-child{
margin-bottom: 0;
}
.cards-list .card-item image{
width: 100%;
display: block;
border-radius: 6rpx;
}
.no-more{
width: 100%;
height: auto;
padding: 30rpx 0;
color: #999999;
font-size: 24rpx;
display: flex;
align-items: center;
justify-content: center;
}
\ No newline at end of file
src/subPackageA/page/pages/moneyBuyCouponInfo/moneyBuyCouponInfo.js
0 → 100644
View file @
d859f7c1
// subPackage/page/pages/valueCardInfo/valueCardInfo.js
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
utils
=
require
(
'../../../../utils/util'
)
wxService
.
page
({
/**
* 页面的初始数据
*/
data
:
{
id
:
null
,
checked
:
false
,
showModal
:
false
,
valueCardInfo
:
{},
userHasBaseInfo
:
false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
this
.
data
.
id
=
options
.
id
;
console
.
log
(
options
)
// wx.hideShareMenu();
this
.
getValueCardActivityInfo
();
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
this
.
userHasLogin
();
},
//获取当前用户是否登录
userHasLogin
()
{
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
if
(
baseUserInfo
)
{
this
.
setData
({
userHasBaseInfo
:
true
})
}
else
{
this
.
setData
({
userHasBaseInfo
:
false
})
}
},
//获取活动详情
getValueCardActivityInfo
()
{
wx
.
showLoading
({
title
:
'加载中..'
,
});
wxService
.
post
(
`/coupon/couponMoneyBuyActivity/getDetail?id=
${
this
.
data
.
id
}
`
,{},
null
,
true
).
then
(
res
=>
{
if
(
res
)
{
let
obj
=
res
.
data
.
data
?
res
.
data
.
data
:
null
;
if
(
obj
)
{
obj
.
activityDesc
=
obj
.
definition
?
JSON
.
parse
(
obj
.
definition
)
:
[];
obj
.
acPayMoney
=
parseFloat
(
obj
.
buyPrice
/
10
/
10
).
toFixed
(
2
);
obj
.
startTime
=
obj
.
startTime
.
substring
(
0
,
10
);
obj
.
endTime
=
obj
.
endTime
.
substring
(
0
,
10
);
obj
.
hasDate
=
obj
.
activityDesc
.
filter
(
item
=>
item
.
type
==
1
).
length
>
0
;
//处理说明文本
let
descArr
=
JSON
.
parse
(
JSON
.
stringify
(
obj
.
activityDesc
));
descArr
=
descArr
.
filter
(
item
=>
item
.
type
!=
1
);
// let tempArr = descArr.map(item => {
// return item.value;
// });
// console.log(obj)
obj
.
descArr
=
descArr
;
this
.
data
.
valueCardInfo
=
obj
;
this
.
setData
({
valueCardInfo
:
this
.
data
.
valueCardInfo
});
}
}
wx
.
hideLoading
();
});
},
//修改选中状态
onTapSwitchChecked
()
{
this
.
data
.
checked
=
!
this
.
data
.
checked
;
this
.
setData
({
checked
:
this
.
data
.
checked
});
},
//关闭modal
onTapCloseModal
()
{
this
.
setData
({
showModal
:
false
,
});
},
//查看rule
onTapViewRule
()
{
this
.
setData
({
showModal
:
true
})
},
//同意并阅读
onTapModalAgree
()
{
this
.
setData
({
showModal
:
false
,
checked
:
true
,
});
},
//立即购买
onTapBuy
()
{
if
(
!
this
.
data
.
checked
)
{
return
;
}
const
{
member
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
if
(
!
member
)
{
wx
.
showToast
({
title
:
'请先去登录'
,
icon
:
'none'
})
return
;
}
if
(
!
member
.
cardNoWeixin
){
wx
.
showToast
({
title
:
'请先开卡后购买'
,
});
wxService
.
openCard
()
return
;
}
//buyWayType 1微信 2支付宝
let
memeberId
=
member
.
id
,
buyWayType
=
1
;
let
activityId
=
this
.
data
.
id
;
let
url
=
`/coupon/couponMoneyBuyActivity/buyer/buy?activityId=
${
activityId
}
&memberId=
${
memeberId
}
&buyWayType=
${
buyWayType
}
`
;
wx
.
showLoading
({
title
:
'支付中..'
,
});
wxService
.
post
(
url
).
then
(
res
=>
{
wx
.
hideLoading
();
if
(
res
.
data
.
result
==
0
)
{
console
.
log
(
res
)
this
.
setData
({
checked
:
false
,
});
let
data
=
res
.
data
.
data
?
res
.
data
.
data
:
null
;
if
(
data
)
{
let
wxParams
=
data
.
wxParams
;
wx
.
requestPayment
({
timeStamp
:
wxParams
.
timeStamp
,
nonceStr
:
wxParams
.
nonceStr
,
package
:
wxParams
.
package
,
signType
:
wxParams
.
signType
,
paySign
:
wxParams
.
paySign
,
success
:
res
=>
{
wx
.
showModal
({
title
:
'购买成功提示'
,
content
:
'购买成功,是否到我的优惠券中查看?'
,
showCancel
:
true
,
cancelText
:
'取消'
,
confirmText
:
'确认'
,
confirmColor
:
'#cb3c3c'
,
success
:
function
(
modalRes
)
{
if
(
modalRes
.
confirm
)
{
wx
.
navigateTo
({
url
:
'/pages/coupons/coupons'
,
});
}
}
});
},
fail
:
error
=>
{
wx
.
showToast
({
title
:
'已取消支付'
,
icon
:
'none'
});
}
})
}
}
else
{
wx
.
showToast
({
title
:
'购买失败,请稍后再试!'
,
icon
:
'none'
});
}
});
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
},
})
\ No newline at end of file
src/subPackageA/page/pages/moneyBuyCouponInfo/moneyBuyCouponInfo.json
0 → 100644
View file @
d859f7c1
{
"navigationBarTitleText"
:
"现金购券详情"
,
"enablePullDownRefresh"
:
false
,
"usingComponents"
:
{}
}
\ No newline at end of file
src/subPackageA/page/pages/moneyBuyCouponInfo/moneyBuyCouponInfo.wxml
0 → 100644
View file @
d859f7c1
<!--subPackage/page/pages/valueCardInfo/valueCardInfo.wxml-->
<image src='{{valueCardInfo.detailPicture ? valueCardInfo.detailPicture : valueCardInfo.listPicture}}'
class='card-info' mode='widthFix'></image>
<view class='card-info-body'>
<view class='card-title'>{{valueCardInfo.activityName}}</view>
<view class='card-desc-item' wx:if="{{valueCardInfo.hasDate}}">
<view class='lf'>活动时间</view>
<view class='rg'>{{valueCardInfo.startTime}} 至 {{valueCardInfo.endTime}}</view>
</view>
<view class='card-desc-item'>
<view class='lf'>现金支付</view>
<view class='rg'>¥{{valueCardInfo.acPayMoney}}</view>
</view>
<view class='card-desc-item'
wx:for="{{valueCardInfo.descArr}}"
wx:for-item="item"
wx:for-index="idx"
wx:key="*this">
<view class='lf'>{{item.label ? item.label : '说明内容'}}</view>
<view class='rg'>
<view class='list-item'> {{item.value}}</view>
</view>
</view>
</view>
<!-- 底部 -->
<view class='bottom-buy'>
<view class='lf-info'>
<!-- 选中 active -->
<view class='check-box {{checked ? "active" : ""}}' bindtap='onTapSwitchChecked'>
<image src='/assets/imgs/tick-success.png' mode='aspectFit'></image>
</view>
<view class='explain'>
<label> 阅读并同意 </label>
<text bindtap='onTapViewRule'>《活动规则》</text>
</view>
</view>
<view class='rg-button positionRe {{checked ? "" : "disabled"}}' wx:if="{{!userHasBaseInfo}}">
<button class="positionAbs clear-btn"
bindgetuserinfo="_getUserInfo" open-type='getUserInfo'></button>
{{buyType == 1 ? "立即购买" : "立即兑换"}}
</view>
<view class='rg-button {{checked ? "" : "disabled"}}'
wx:if="{{userHasBaseInfo}}" bindtap='onTapBuy'>立即购买</view>
</view>
<!-- 超值卡规则 -->
<view class='rule-modal' wx:if="{{showModal}}">
<view class='modal-body'>
<view class='modal-body-title'>
《活动规则》
<image class='modal-body-close' src='/assets/imgs/gray_close.png' mode='aspectFit' bindtap='onTapCloseModal'></image>
</view>
<view class='modal-body-con'>
<image src="{{valueCardInfo.rulePicture}}" mode="widthFix"></image>
</view>
<view class='modal-body-bottom'>
<label bindtap='onTapModalAgree'>阅读并同意</label>
</view>
</view>
</view>
\ No newline at end of file
src/subPackageA/page/pages/moneyBuyCouponInfo/moneyBuyCouponInfo.wxss
0 → 100644
View file @
d859f7c1
/* subPackage/page/pages/valueCardInfo/valueCardInfo.wxss */
page{
background: #ffffff;
box-sizing: border-box;
-webkit-box-sizing: border-box;
padding-bottom: 100rpx;
}
view{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.card-info{
width: 100%;
display: block;
}
.card-info-body{
width: 100%;
padding: 30rpx;
}
.card-title{
font-size: 28rpx;
color: #333333;
font-weight: bold;
margin-bottom: 20rpx;
}
.card-desc-item{
width: 100%;
height: auto;
display: flex;
font-size: 28rpx;
margin-bottom: 10rpx;
}
.card-desc-item .lf{
flex: 0;
min-width: 120rpx;
max-width: 120rpx;
color: #666666;
}
.card-desc-item .rg{
flex: 1;
padding-left: 10rpx;
color: #333333;
}
.card-desc-item .rg .list-item{
margin-bottom: 8rpx;
white-space: pre-line;
}
.bottom-buy{
bottom: 0;
left: 0;
position: fixed;
z-index: 2;
border-top: solid 2rpx #ddd;
width: 100%;
height: 100rpx;
display: flex;
align-items: center;
background: #ffffff;
}
.bottom-buy .rg-button{
flex: 0;
min-width: 200rpx;
max-width: 200rpx;
height: 100%;
background: #05C35B ;
color: #ffffff;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
}
.bottom-buy .rg-button:active{
opacity: 0.7;
}
.bottom-buy .rg-button.disabled{
background: #cccccc;
}
.bottom-buy .rg-button.disabled:active{
opacity: 1;
}
.bottom-buy .lf-info{
flex: 1;
padding-left: 30rpx;
display: flex;
justify-content: flex-start;
align-items: center;
}
.check-box{
width: 42rpx;
height: 42rpx;
border-radius: 50%;
border: solid 1px #dddddd;
display: flex;
align-items: center;
justify-content: center;
}
.check-box image{
display: none;
}
.check-box.active{
background: #ff3333;
border: solid 1px #ff3333;
}
.check-box.active image{
display: block;
width: 25rpx;
height: 25rpx;
}
.explain{
display: flex;
flex-direction: column;
justify-content: center;
padding-left: 10rpx;
font-size: 28rpx;
}
.explain label{
color: #333333;
padding-left: 8rpx;
}
.explain text{
color: #558ACB;
font-size: 22rpx;
}
.rule-modal{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: 3;
display: flex;
align-items: center;
justify-content: center;
}
.rule-modal .modal-body{
width: 80vw;
height: 80vh;
background: #ffffff;
border-radius: 8rpx;
display: flex;
flex-direction: column;
}
.rule-modal .modal-body .modal-body-title{
flex: 0;
min-height: 80rpx;
max-height: 80rpx;
width: 100%;
border-bottom: solid 2rpx #dddddd;
position: relative;
display: flex;
justify-content: center;
align-items: center;
color: #333333;
font-size: 28rpx;
}
.rule-modal .modal-body .modal-body-title .modal-body-close{
position: absolute;
width: 32rpx;
height: 32rpx;
top: 24rpx;
right: 24rpx;
}
.rule-modal .modal-body .modal-body-title .modal-body-close:active{
opacity: 0.7;
}
.rule-modal .modal-body .modal-body-con{
flex: 1;
padding: 20rpx;
overflow: hidden;
overflow-y: auto;
font-size: 24rpx;
color: #666666;
}
.rule-modal .modal-body .modal-body-con image{
width: 100%;
}
.rule-modal .modal-body .modal-body-bottom{
flex: 0;
min-height: 120rpx;
max-height: 120rpx;
display: flex;
align-items: center;
justify-content: center;
}
.rule-modal .modal-body .modal-body-bottom label{
width: 280rpx;
height: 80rpx;
background: #ff3333;
color: #ffffff;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8rpx;
}
.rule-modal .modal-body .modal-body-bottom label:active{
opacity: 0.7;
}
src/subPackageA/page/pages/moneyBuyCouponRecords/moneyBuyCouponRecords.js
0 → 100644
View file @
d859f7c1
// subPackageA/page/pages/moneyBuyCouponRecords/moneyBuyCouponRecords.js
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
util
=
require
(
'../../../../utils/util'
)
wxService
.
page
({
/**
* 页面的初始数据
*/
data
:
{
recordsList
:
[],
pageSize
:
10
,
pageNo
:
1
,
totalPage
:
0
,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
wx
.
hideShareMenu
();
this
.
getBuyCouponRecords
();
},
//获取优惠券购买记录
getBuyCouponRecords
(
refresh
){
let
pageNo
=
this
.
data
.
pageNo
,
pageSize
=
this
.
data
.
pageSize
;
if
(
refresh
){
wx
.
stopPullDownRefresh
();
wx
.
showToast
({
title
:
'刷新成功'
,
});
}
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
this
.
data
.
pageNo
=
1
;
this
.
data
.
recordsList
=
[];
this
.
getBuyCouponRecords
(
true
);
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
if
(
this
.
data
.
pageNo
<
this
.
data
.
totalPage
){
this
.
data
.
pageNo
++
;
this
.
getBuyCouponRecords
();
}
else
{
if
(
this
.
data
.
pageNo
>
1
){
wx
.
showToast
({
title
:
'暂无更多数据了~'
,
icon
:
' none'
});
}
}
},
})
\ No newline at end of file
src/subPackageA/page/pages/moneyBuyCouponRecords/moneyBuyCouponRecords.json
0 → 100644
View file @
d859f7c1
{
"enablePullDownRefresh"
:
true
,
"navigationBarTitleText"
:
"优惠券购买记录"
,
"usingComponents"
:
{
"empty"
:
"/component/empty/empty"
}
}
\ No newline at end of file
src/subPackageA/page/pages/moneyBuyCouponRecords/moneyBuyCouponRecords.wxml
0 → 100644
View file @
d859f7c1
<!--subPackageA/page/pages/moneyBuyCouponRecords/moneyBuyCouponRecords.wxml-->
<view class="records-list" wx:if="{{recordsList.length > 0}}">
<view class="records-item">
<view class="records-title">
<label>活动名称活动名称活动名称活动名称</label>
<text>¥50.00</text>
</view>
<view class="other-info">
有效时间: <label>2020-04-30 15:30:30至2020-04-30 15:30:30</label>
</view>
</view>
</view>
<!-- 空的时候 -->
<empty text="未查到任何优惠券购买记录~" wx:if="{{recordsList.length == 0}}"/>
\ No newline at end of file
src/subPackageA/page/pages/moneyBuyCouponRecords/moneyBuyCouponRecords.wxss
0 → 100644
View file @
d859f7c1
/* subPackageA/page/pages/moneyBuyCouponRecords/moneyBuyCouponRecords.wxss */
page{
background: #ffffff;
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
view{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.records-list{
width: 100%;
height: auto;
padding: 20rpx;
}
.records-list .records-item{
padding: 20rpx;
border-bottom: solid 1rpx #dddddd;
font-size: 24rpx;
color: #333333;
}
.records-title{
font-size: 28rpx;
font-weight: bold;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10rpx;
}
.other-info{
color: #999999;
font-weight: 24rpx;
}
.records-title text{
color: red;
}
\ No newline at end of file
src/subPackageA/page/pages/payCardInfo/payCardInfo.js
0 → 100644
View file @
d859f7c1
// subPackage/page/pages/couponCenterInfo/couponCenterInfo.js
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
util
=
require
(
'../../../../utils/util'
)
wxService
.
page
({
/**
* 页面的初始数据
*/
data
:
{
activityId
:
null
,
activityInfo
:
{},
showDialog
:
false
,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
let
id
=
options
.
id
;
if
(
id
){
this
.
data
.
activityId
=
id
;
this
.
getPayCardInfo
();
}
},
//获取支付券详情
getPayCardInfo
(){
wxService
.
get
(
`/coupon/wechatCouponSet/get/
${
this
.
data
.
activityId
}
`
).
then
(
res
=>
{
if
(
res
){
let
obj
=
res
.
data
.
data
?
res
.
data
.
data
:
null
;
if
(
obj
){
let
detailInfo
=
obj
.
detailInfo
?
JSON
.
parse
(
obj
.
detailInfo
)
:
[];
this
.
data
.
activityInfo
=
obj
;
this
.
data
.
activityInfo
.
desc
=
detailInfo
;
this
.
setData
({
activityInfo
:
this
.
data
.
activityInfo
});
}
}
})
},
//领取优惠券
onTapGetCoupon
(){
wx
.
showLoading
({
title
:
'领取中..'
,
});
//调用接口领取
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
:
function
()
{
let
url
=
this
.
data
.
activityInfo
.
activityImgUrl
?
this
.
data
.
activityInfo
.
activityImgUrl
:
'https://img3.bigaka.com/prd/3001/202003/20200331/3001649f2f08-3b4e-4b5b-97c1-30cdf646651c.png'
;
return
{
title
:
`我分享给你一张“
${
this
.
data
.
activityInfo
.
couponName
}
”的支付券,赶快领取吧~`
,
path
:
`/subPackageA/page/pages/payCardInfo/payCardInfo?id=
${
this
.
data
.
activityId
}
`
,
imageUrl
:
url
,
// 可以更换分享的图片
}
}
});
\ No newline at end of file
src/subPackageA/page/pages/payCardInfo/payCardInfo.json
0 → 100644
View file @
d859f7c1
{
"navigationBarTitleText"
:
"支付券信息"
,
"usingComponents"
:
{
}
}
\ No newline at end of file
src/subPackageA/page/pages/payCardInfo/payCardInfo.wxml
0 → 100644
View file @
d859f7c1
<!--subPackage/page/pages/couponCenterInfo/couponCenterInfo.wxml-->
<view class="coupon-info-con">
<!-- 修改为新的布局 -->
<view class="coupon-package">
<image src="{{activityInfo.activityImgUrl}}" mode="widthFix"></image>
</view>
<!-- 活动说明 -->
<view class='integral-detail' style="margin-top:20rpx;" wx:if="{{activityInfo.desc.length > 0}}">
<view class='integral-list' wx:for="{{activityInfo.desc}}" wx:key="*this">
<text class='integral-title'>{{item.label}}</text>
<text class='integral-desc wpl'>{{item.value}}</text>
</view>
</view>
<!-- 按钮 -->
<view class="get-btn positionRe">
<button wx:if="{{!currentHasUserInfo}}"
bindgetuserinfo="_getUserInfo"
open-type='getUserInfo'
class="clear-btn positionAbs">立即领取</button>
<view wx:else class="view-btn" bindtap="onTapGetCoupon">立即领取</view>
</view>
</view>
src/subPackageA/page/pages/payCardInfo/payCardInfo.wxss
0 → 100644
View file @
d859f7c1
/* subPackage/page/pages/couponCenterInfo/couponCenterInfo.wxss */
page{
background: #ffffff;
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
view{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.coupon-info-con{
padding: 30rpx;
}
.coupon-info-bg{
width: 100%;
height: 174rpx;
background-position: center;
background-size: 100%;
background-repeat: no-repeat;
position: relative;
padding-left: 170rpx;
}
.coupon-info-bg .lf-coupon-Bg{
position: absolute;
left: 0;
top: 0;
width: 170rpx;
height: 100%;
padding: 15rpx;
}
.coupon-package{
width: 100%;
height: auto;
}
.coupon-package image{
width: 100%;
}
.coupon-info-bg .lf-coupon-Bg image{
width: 100%;
height: 100%;
}
.coupon-info-bg .rg-coupon-info{
width: 100%;
height: 100%;
padding: 15rpx;
font-size: 24rpx;
}
.coupon-title{
font-size: 28rpx;
color: #333333;
margin-bottom: 8rpx;
font-weight: 550;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.coupon-date{
font-size: 22rpx;
color: #999999;
margin-bottom: 5rpx;
}
.exp-intro{
margin-top: 60rpx;
}
.exp-intro .exp-intro-item{
display: flex;
font-size: 28rpx;
color: #333333;
}
.exp-intro .exp-intro-item .intro-title{
flex: 0;
min-width: 100rpx;
max-width: 100rpx;
}
.exp-intro .exp-intro-item .intro-desc{
flex: 1;
color: #999999;
}
.integral-detail{
margin-top: 60rpx;
}
.integral-list{
margin-bottom: 20rpx;
font-size: 24rpx;
color: #999999;
}
.integral-title{
font-size: 24rpx;
color: #333333;
margin-right: 8rpx;
}
.integral-title,.integral-desc{
display: inline-block;
}
.get-btn{
width: 100%;
height: 90rpx;
margin-top: 80rpx;
background: -webkit-linear-gradient(left,rgb(203,60,60,0.7),rgb(203,60,60,1));
border-radius: 8rpx;
color: #ffffff;
font-size: 28rpx;
display: flex;
justify-content: center;
align-items: center;
}
.get-btn button{
color: #ffffff;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
}
.get-btn .view-btn{
color: #ffffff;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 1;
}
.get-btn:active{
opacity: 0.7;
}
\ No newline at end of file
src/utils/wxService.js
View file @
d859f7c1
...
...
@@ -122,7 +122,6 @@ class WXService extends Http {
param
.
appid
=
app
.
globalData
.
appId
}
_this
.
post
(
`/member/minaLogin`
,
param
).
then
(
response
=>
{
if
(
response
)
{
let
dataResp
=
response
.
data
.
data
...
...
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