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
ede5f6a3
Commit
ede5f6a3
authored
Mar 27, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
积分活动分组
parent
bf352663
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
1381 additions
and
8 deletions
+1381
-8
app.json
src/app.json
+7
-5
personCenter.wxss
src/component/personCenter/personCenter.wxss
+1
-1
index.js
src/config/index.js
+3
-0
productDetail.js
src/pages/productDetail/productDetail.js
+1
-0
project.config.json
src/project.config.json
+22
-1
selectProductList.js
...ingGuid/page/pages/selectProductList/selectProductList.js
+2
-1
pointActivityGroup.js
...kageA/page/pages/pointActicityGroup/pointActivityGroup.js
+154
-0
pointActivityGroup.json
...geA/page/pages/pointActicityGroup/pointActivityGroup.json
+10
-0
pointActivityGroup.wxml
...geA/page/pages/pointActicityGroup/pointActivityGroup.wxml
+46
-0
pointActivityGroup.wxss
...geA/page/pages/pointActicityGroup/pointActivityGroup.wxss
+127
-0
pointExchangeCoupon.js
...geA/page/pages/pointExchangeCoupon/pointExchangeCoupon.js
+172
-0
pointExchangeCoupon.json
...A/page/pages/pointExchangeCoupon/pointExchangeCoupon.json
+11
-0
pointExchangeCoupon.wxml
...A/page/pages/pointExchangeCoupon/pointExchangeCoupon.wxml
+76
-0
pointExchangeCoupon.wxss
...A/page/pages/pointExchangeCoupon/pointExchangeCoupon.wxss
+227
-0
pointExchangeGoods.js
...kageA/page/pages/pointExchangeGoods/pointExchangeGoods.js
+204
-0
pointExchangeGoods.json
...geA/page/pages/pointExchangeGoods/pointExchangeGoods.json
+12
-0
pointExchangeGoods.wxml
...geA/page/pages/pointExchangeGoods/pointExchangeGoods.wxml
+79
-0
pointExchangeGoods.wxss
...geA/page/pages/pointExchangeGoods/pointExchangeGoods.wxss
+227
-0
No files found.
src/app.json
View file @
ede5f6a3
...
...
@@ -103,7 +103,10 @@
"root"
:
"subPackageA/page"
,
"pages"
:
[
"pages/deliveryCode/deliveryCode"
,
"pages/shareArticle/shareArticle"
"pages/shareArticle/shareArticle"
,
"pages/pointActicityGroup/pointActivityGroup"
,
"pages/pointExchangeCoupon/pointExchangeCoupon"
,
"pages/pointExchangeGoods/pointExchangeGoods"
]
}
],
...
...
@@ -117,16 +120,15 @@
"window"
:
{
"backgroundTextStyle"
:
"dark"
,
"navigationBarBackgroundColor"
:
"#fff"
,
"navigationBarTitleText"
:
"
小程序
"
,
"navigationBarTitleText"
:
"
微商城
"
,
"navigationBarTextStyle"
:
"black"
},
"navigateToMiniProgramAppIdList"
:
[
"wxeb490c6f9b154ef9"
,
"wxcf6d299fecd830cf"
,
"wx5717ceb7cfa09f2e"
,
"wx358b56af62edbde1"
,
"wxc3b64b09b1d3dfc2"
,
"wx857ea77f4f7f4f34"
"wxa006e9b0a0ee1bfe"
,
"wx39b5d8891f375d1c"
],
"plugins"
:
{
"contactPlugin"
:
{
...
...
src/component/personCenter/personCenter.wxss
View file @
ede5f6a3
...
...
@@ -73,10 +73,10 @@
color: #fff;
display: flex;
align-items: center;
justify-content: center;
}
.user-avatar .user-level .user-level-name{
flex: 1;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
...
...
src/config/index.js
View file @
ede5f6a3
...
...
@@ -356,6 +356,9 @@ const prod_brand_config = {
isNeedGetLocation
:
true
,
//是否开启小程序获取位置(提交订单时获取门店信息)
shareTitle
:
'【有一种甜叫巴黎贝甜~】'
,
logo
:
'https://img3.bigaka.com/prd/3001/202003/20200318/3001c0647584-3656-45e9-ae60-c898d435113e.png'
,
//要跳转的外部小程序appid
// "wxa006e9b0a0ee1bfe", 外卖
// "wx39b5d8891f375d1c" 礼品卡
}
}
...
...
src/pages/productDetail/productDetail.js
View file @
ede5f6a3
...
...
@@ -194,6 +194,7 @@ wxService.page({
this
.
data
.
productInfo
.
productStatus
=
data
.
productStatus
;
this
.
data
.
productInfo
.
minSalePrice
=
data
.
minSalePrice
;
this
.
data
.
productInfo
.
maxSalePrice
=
data
.
maxSalePrice
;
this
.
data
.
productInfo
.
indexUrl
=
data
.
indexUrl
;
this
.
data
.
productInfo
.
productStatusDesc
=
data
.
productStatus
==
1
?
'已下架'
:
(
data
.
productStatus
==
2
?
'已上架'
:
'已删除'
);
...
...
src/project.config.json
View file @
ede5f6a3
...
...
@@ -43,7 +43,7 @@
"list"
:
[]
},
"miniprogram"
:
{
"current"
:
13
,
"current"
:
85
,
"list"
:
[
{
"id"
:
-1
,
...
...
@@ -602,6 +602,27 @@
"pathName"
:
"shoppingGuid/page/pages/selectProductList/selectProductList"
,
"query"
:
""
,
"scene"
:
null
},
{
"id"
:
-1
,
"name"
:
"积分活动分组"
,
"pathName"
:
"subPackageA/page/pages/pointActicityGroup/pointActivityGroup"
,
"query"
:
""
,
"scene"
:
null
},
{
"id"
:
-1
,
"name"
:
"积分兑换优惠券活动列表"
,
"pathName"
:
"subPackageA/page/pages/pointExchangeCoupon/pointExchangeCoupon"
,
"query"
:
""
,
"scene"
:
null
},
{
"id"
:
-1
,
"name"
:
"积分兑换商品活动列表"
,
"pathName"
:
"subPackageA/page/pages/pointExchangeGoods/pointExchangeGoods"
,
"query"
:
""
,
"scene"
:
null
}
]
}
...
...
src/shoppingGuid/page/pages/selectProductList/selectProductList.js
View file @
ede5f6a3
...
...
@@ -46,7 +46,8 @@ wxService.page({
//获取商品列表
getProductList
(
refresh
){
wxService
.
post
(
`/sale/product/buyer/listPage?pageNo=
${
this
.
data
.
pageNo
}
&pageSize=
${
this
.
data
.
pageSize
}
`
,
{
productName
:
this
.
data
.
productName
productName
:
this
.
data
.
productName
,
productStatus
:
2
,
}).
then
(
res
=>
{
if
(
res
){
let
list
=
res
.
data
.
data
.
content
?
res
.
data
.
data
.
content
:
[];
...
...
src/subPackageA/page/pages/pointActicityGroup/pointActivityGroup.js
0 → 100644
View file @
ede5f6a3
// pages/userCenter.js
const
wxService
=
require
(
'../../../../utils/wxService'
)
wxService
.
page
({
/**
* 页面的初始数据
*/
data
:
{
query
:
''
,
memberPoint
:
{
total
:
'--'
,
expirePoint
:
0
,
expireDate
:
''
},
activityList
:
[],
pageNo
:
1
,
pageSize
:
10
,
totalPage
:
0
,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
wx
.
hideShareMenu
();
this
.
refreshPointRequest
();
this
.
getPointActivityGroupList
();
},
//刷新积分请求
refreshPointRequest
()
{
const
{
memberId
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
if
(
!
memberId
)
{
return
;
}
wxService
.
get
(
'/member/memberPoint/refreshExpiredPoint?memberId='
+
memberId
).
then
(
res
=>
{
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
//获取会员积分信息
this
.
getMemberIntegrateInfo
();
},
//查询会员积分信息
getMemberIntegrateInfo
()
{
// wx.showLoading({
// title: '数据请求中..',
// });
const
{
memberId
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
if
(
!
memberId
)
{
return
;
}
wxService
.
get
(
`/member/memberPoint/getMemberPointInfo?memberId=
${
memberId
}
`
).
then
(
res
=>
{
let
data
=
res
.
data
.
data
?
res
.
data
.
data
:
{};
this
.
data
.
memberPoint
.
total
=
data
.
point
?
data
.
point
:
0
;
this
.
data
.
memberPoint
.
expirePoint
=
data
.
pointWillExpired
?
data
.
pointWillExpired
:
0
;
let
expireDate
=
data
.
pointExpiredTime
?
data
.
pointExpiredTime
:
'2019-12-31 23:59:59'
;
if
(
expireDate
)
{
let
dateStr
=
expireDate
.
replace
(
/-/g
,
'/'
);
let
da
=
new
Date
(
dateStr
);
let
year
=
da
.
getFullYear
();
let
month
=
(
da
.
getMonth
()
+
1
)
<
10
?
'0'
+
(
da
.
getMonth
()
+
1
)
:
da
.
getMonth
()
+
1
;
let
day
=
da
.
getDate
()
<
10
?
'0'
+
da
.
getDate
()
:
da
.
getDate
();
expireDate
=
`
${
year
}
年
${
month
}
月
${
day
}
日`
}
this
.
data
.
memberPoint
.
expireDate
=
expireDate
;
this
.
setData
({
memberPoint
:
this
.
data
.
memberPoint
});
});
},
// 点击跳转至会员规则页
handleGoMemberRulesRules
()
{
wxService
.
router
(
`/pages/memberRules/memberRules?type=2`
)
},
//获取积分分组活动列表
getPointActivityGroupList
(
refres
){
let
pageNo
=
this
.
data
.
pageNo
,
pageSize
=
this
.
data
.
pageSize
;
wxService
.
post
(
`/merchant/groupingActivities/findPage?pageNo=
${
pageNo
}
&pageSize=
${
pageSize
}
`
,{
status
:
0
}).
then
(
res
=>
{
if
(
res
){
let
list
=
res
.
data
.
data
.
content
?
res
.
data
.
data
.
content
:
[];
this
.
data
.
activityList
=
this
.
data
.
activityList
.
concat
(
list
);
this
.
data
.
totalPage
=
res
.
data
.
data
.
totalPages
;
this
.
setData
({
activityList
:
this
.
data
.
activityList
,
totalPage
:
this
.
data
.
totalPage
});
}
if
(
refres
){
wx
.
stopPullDownRefresh
();
wx
.
showToast
({
title
:
'刷新成功'
,
});
}
})
},
//去详情
onTapToInfo
(
e
){
let
item
=
e
.
currentTarget
.
dataset
.
item
;
if
(
item
.
type
==
1
){
//积分换物
wx
.
navigateTo
({
url
:
'/subPackageA/page/pages/pointExchangeGoods/pointExchangeGoods?id='
+
item
.
id
,
});
}
else
if
(
item
.
type
==
2
){
//积分兑换优惠券
wx
.
navigateTo
({
url
:
'/subPackageA/page/pages/pointExchangeCoupon/pointExchangeCoupon?id='
+
item
.
id
,
});
}
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
this
.
data
.
pageNo
=
1
;
this
.
data
.
activityList
=
[];
this
.
getPointActivityGroupList
(
true
);
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
if
(
this
.
data
.
pageNo
<
this
.
data
.
totalPage
){
this
.
data
.
pageNo
++
;
this
.
getPointActivityGroupList
();
}
else
{
if
(
this
.
data
.
pageNo
>
1
){
wx
.
showToast
({
title
:
'没有更多数据啦~'
,
icon
:
'none'
});
}
}
},
});
\ No newline at end of file
src/subPackageA/page/pages/pointActicityGroup/pointActivityGroup.json
0 → 100644
View file @
ede5f6a3
{
"navigationBarTitleText"
:
"积分活动中心"
,
"enablePullDownRefresh"
:
true
,
"usingComponents"
:
{
"empty"
:
"/component/empty/empty"
,
"go-home"
:
"/component/goHome/goHome"
,
"go-guid"
:
"/component/goGuid/goGuid"
}
}
\ No newline at end of file
src/subPackageA/page/pages/pointActicityGroup/pointActivityGroup.wxml
0 → 100644
View file @
ede5f6a3
<!--pages/userCenter.wxml-->
<view class='page-integral-mall'>
<!-- title -->
<view class='mall-title'>
<view class='title-num-point'>
<view class='title-img-point'>
<view class='img-point'>
<image class="point-img" src='/assets/imgs/point.png' mode="widthFix" />
</view>
<view class='text-point'>
{{memberPoint.total}}
</view>
</view>
<view class='integral-vip-rules' bindtap="handleGoMemberRulesRules">会员规则</view>
</view>
<view class='title-time-point' wx:if="{{memberPoint.expirePoint > 0}}">
{{memberPoint.expirePoint}} 积分将于 {{memberPoint.expireDate}} 清零
</view>
<view class='title-time-point' wx:if="{{memberPoint.expirePoint == 0}}">
暂无将过期积分
</view>
</view>
<!-- 活动分组列表 -->
<view class='activity-group-list box' wx:if="{{activityList.length > 0}}">
<view class='list-item'
wx:for="{{activityList}}"
wx:for-item="item"
data-item="{{item}}"
bindtap='onTapToInfo'
wx:key="*this">
<image mode='widthFix' src='{{item.msgUrl}}'></image>
</view>
</view>
<!-- 空 -->
<empty text="当前商家暂无任何积分兑换活动~" wx:else/>
<!--goHome-->
<go-home/>
<floatNav bind:getAuth="_getUserInfo" bind:updatePage="updatePage"/>
</view>
<!-- 库存没了 -->
<go-guid />
src/subPackageA/page/pages/pointActicityGroup/pointActivityGroup.wxss
0 → 100644
View file @
ede5f6a3
/* pages/userCenter.wxss */
@import "/base/base.wxss";
page {
/* background-color: rgba(0, 0, 0, 0.05); */
background: #ffffff;
}
.page-integral-mall {
border-top: 1px solid rgba(151, 151, 151, 0.1);
}
.box{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.empty-wrap {
width: 300rpx;
margin: 190rpx auto 0;
text-align: center;
}
.empty-img {
width: 197rpx;
height: 176rpx;
margin-bottom: 48rpx;
}
.empty-text {
color: #cccccc;
font-size: 28rpx;
}
.text-align-left{
text-align: left !important;
}
.point-img {
width: 28rpx;
height: 36rpx;
}
.title-img-point {
display: flex;
align-items: center;
}
.point-exchange-goods-records{
font-size: 28rpx;
color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
height: 80rpx;
position: fixed;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.65);
z-index: 2;
width: 100%;
}
.point-exchange-goods-records:active{
opacity: 0.7;
}
.text-point {
color: rgba(51, 51, 51, 1);
font-size: 42rpx;
margin-left: 10rpx;
}
.mall-title {
height: 150rpx;
padding-left: 50rpx;
padding-right: 42rpx;
box-sizing: border-box;
background-color: rgba(255, 255, 255, 1);
box-shadow: 0px 0px 8px 5px rgba(0, 0, 0, 0.05),
0px 0px 3px 0px rgba(0, 0, 0, 0.03);
}
.title-num-point {
padding-top: 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.integral-vip-rules {
width: 133rpx;
height: 42rpx;
line-height: 42rpx;
border-radius: 34rpx;
font-size: 23rpx;
text-align: center;
border: 1px solid rgba(204, 204, 204, 1);
}
.title-time-point {
color: rgba(102, 102, 102, 1);
font-size: 20rpx;
text-align: left;
padding-top: 3rpx;
margin-top: 15rpx;
}
/* 活动分组 */
.activity-group-list{
width: 100%;
height: auto;
padding: 10rpx 30rpx;
margin-top: 20rpx;
}
.activity-group-list .list-item{
width: 100%;
height: auto;
margin-bottom: 20rpx;
}
.activity-group-list .list-item:active{
opacity: 0.7;
}
.activity-group-list .list-item image{
width: 100%;
display: block;
border-radius: 10rpx;
}
\ No newline at end of file
src/subPackageA/page/pages/pointExchangeCoupon/pointExchangeCoupon.js
0 → 100644
View file @
ede5f6a3
// pages/userCenter.js
const
wxService
=
require
(
'../../../../utils/wxService'
)
wxService
.
page
({
/**
* 页面的初始数据
*/
data
:
{
query
:
''
,
integralCouponList
:
[],
// 积分兑换优惠券列表
noMore
:
false
,
isExchange
:
false
,
exchangeId
:
''
,
exchangePoint
:
0
,
memberPoint
:
{
total
:
'--'
,
expirePoint
:
0
,
expireDate
:
''
},
activityId
:
''
,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
this
.
data
.
activityId
=
options
.
id
;
wx
.
hideShareMenu
();
this
.
refreshPointRequest
();
this
.
getActivityGroupInfo
();
},
//刷新积分请求
refreshPointRequest
()
{
const
{
memberId
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
if
(
!
memberId
)
{
return
;
}
wxService
.
get
(
'/member/memberPoint/refreshExpiredPoint?memberId='
+
memberId
).
then
(
res
=>
{
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
//获取会员积分信息
this
.
getMemberIntegrateInfo
();
},
//查询会员积分信息
getMemberIntegrateInfo
()
{
// wx.showLoading({
// title: '数据请求中..',
// });
const
{
memberId
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
if
(
!
memberId
)
{
return
;
}
wxService
.
get
(
`/member/memberPoint/getMemberPointInfo?memberId=
${
memberId
}
`
).
then
(
res
=>
{
let
data
=
res
.
data
.
data
?
res
.
data
.
data
:
{};
this
.
data
.
memberPoint
.
total
=
data
.
point
?
data
.
point
:
0
;
this
.
data
.
memberPoint
.
expirePoint
=
data
.
pointWillExpired
?
data
.
pointWillExpired
:
0
;
let
expireDate
=
data
.
pointExpiredTime
?
data
.
pointExpiredTime
:
'2019-12-31 23:59:59'
;
if
(
expireDate
)
{
let
dateStr
=
expireDate
.
replace
(
/-/g
,
'/'
);
let
da
=
new
Date
(
dateStr
);
let
year
=
da
.
getFullYear
();
let
month
=
(
da
.
getMonth
()
+
1
)
<
10
?
'0'
+
(
da
.
getMonth
()
+
1
)
:
da
.
getMonth
()
+
1
;
let
day
=
da
.
getDate
()
<
10
?
'0'
+
da
.
getDate
()
:
da
.
getDate
();
expireDate
=
`
${
year
}
年
${
month
}
月
${
day
}
日`
}
this
.
data
.
memberPoint
.
expireDate
=
expireDate
;
this
.
setData
({
memberPoint
:
this
.
data
.
memberPoint
});
});
},
//查询指定积分换物活动兑换数量
findExchangeNumByIds
(
integralGoodsList
)
{
//获取ids
let
ids
=
integralGoodsList
.
map
(
g
=>
{
return
g
.
id
;
});
wxService
.
post
(
`/member/pointsRedemptionProductSetting/getExchangeCount`
,
ids
).
then
(
res
=>
{
if
(
res
)
{
let
data
=
res
.
data
.
data
?
res
.
data
.
data
:
null
;
if
(
data
)
{
for
(
let
k
in
data
)
{
let
id
=
k
,
value
=
data
[
k
];
for
(
let
i
=
0
;
i
<
integralGoodsList
.
length
;
i
++
)
{
if
(
integralGoodsList
[
i
].
id
==
id
)
{
integralGoodsList
[
i
].
canExchange
=
integralGoodsList
[
i
].
stock
>
value
;
}
}
}
}
}
this
.
setData
({
integralGoodsList
:
integralGoodsList
,
});
});
},
//获取积分活动分组详情
getActivityGroupInfo
(){
wxService
.
get
(
`/merchant/groupingActivities/findById?id=
${
this
.
data
.
activityId
}
`
).
then
(
res
=>
{
if
(
res
){
let
data
=
res
.
data
.
data
?
res
.
data
.
data
:
null
;
if
(
data
){
let
ids
=
data
.
sons
.
map
(
item
=>
{
return
item
.
activateId
;
});
this
.
initIntegralCouponList
(
ids
);
}
}
})
},
// 积分兑换优惠券列表
initIntegralCouponList
(
ids
)
{
wx
.
showLoading
({
title
:
'加载中'
});
wxService
.
post
(
`/coupon/pointsRedemptionCouponSetting/findByIds`
,
ids
).
then
(
res
=>
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
this
.
setData
({
integralCouponList
:
data
.
reverse
()
});
}
}
}).
finally
(()
=>
{
wx
.
hideLoading
();
})
},
//立即兑换优惠券
exchange
(
e
)
{
const
{
id
,
point
}
=
e
.
currentTarget
.
dataset
this
.
setData
({
isExchange
:
true
,
exchangeId
:
id
,
exchangePoint
:
point
})
},
// 点击跳转至会员规则页
handleGoMemberRulesRules
()
{
wxService
.
router
(
`/pages/memberRules/memberRules?type=2`
)
},
goCouponDetail
(
e
)
{
const
{
id
}
=
e
.
currentTarget
.
dataset
wxService
.
router
(
`/pages/integralMallDetail/integralMallDetail?id=
${
id
}
`
)
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
},
})
\ No newline at end of file
src/subPackageA/page/pages/pointExchangeCoupon/pointExchangeCoupon.json
0 → 100644
View file @
ede5f6a3
{
"navigationBarTitleText"
:
"积分兑换优惠券"
,
"enablePullDownRefresh"
:
true
,
"usingComponents"
:
{
"no-more"
:
"/component/noMore/noMore"
,
"exchange-coupon-modal"
:
"/component/exchange-coupon-modal/exchange-coupon-modal"
,
"go-home"
:
"/component/goHome/goHome"
,
"go-guid"
:
"/component/goGuid/goGuid"
}
}
\ No newline at end of file
src/subPackageA/page/pages/pointExchangeCoupon/pointExchangeCoupon.wxml
0 → 100644
View file @
ede5f6a3
<!--pages/userCenter.wxml-->
<view class='page-integral-mall' style="padding-bottom: {{currentTab =='goods' ? '80rpx' : '40rpx'}}">
<!-- title -->
<view class='mall-title'>
<view class='title-num-point'>
<view class='title-img-point'>
<view class='img-point'>
<image class="point-img" src='/assets/imgs/point.png' mode="widthFix" />
</view>
<view class='text-point'>
{{memberPoint.total}}
</view>
</view>
<view class='integral-vip-rules' wx:if="{{integralCouponList.length}}" bindtap="handleGoMemberRulesRules">会员规则</view>
</view>
<view class='title-time-point' wx:if="{{memberPoint.expirePoint > 0}}">
{{memberPoint.expirePoint}} 积分将于 {{memberPoint.expireDate}} 清零
</view>
<view class='title-time-point' wx:if="{{memberPoint.expirePoint == 0}}">
暂无将过期积分
</view>
</view>
<!-- 优惠券列表-->
<view>
<view class='coupon-wrap' wx:if="{{integralCouponList.length}}">
<view
class='coupon-list'
wx:for="{{integralCouponList}}"
wx:for-item="item"
wx:for-index="k"
wx:key="{{k}}"
data-id="{{item.id}}"
bindtap="goCouponDetail"
>
<view class="coupon-item">
<view class='coupon-img-title'>
<view class='coupon-img'>
<image wx:if="{{item.thumbnail}}" src='{{item.thumbnail}}' />
<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-desc text-align-left fs-24'>查看详情</view>
</view>
</view>
<view class='coupon-btn'>
<view class='coupon-btn-click'
data-id="{{item.id}}"
data-point="{{item.point}}"
catchtap='exchange'>立即兑换</view>
<view class='coupon-btn-num'>{{item.point}}积分</view>
</view>
</view>
</view>
</view>
<view class='empty-wrap' wx:if="{{!integralCouponList.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>
</view>
<exchange-coupon-modal exchangeId="{{exchangeId}}" exchangePoint="{{exchangePoint}}" isExchange='{{isExchange}}' />
<!--<no-more wx:if="{{noMore}}"/>-->
<!--goHome-->
<go-home/>
<floatNav bind:getAuth="_getUserInfo" bind:updatePage="updatePage"/>
</view>
<go-guid />
src/subPackageA/page/pages/pointExchangeCoupon/pointExchangeCoupon.wxss
0 → 100644
View file @
ede5f6a3
/* pages/userCenter.wxss */
@import "/base/base.wxss";
page {
/* background-color: rgba(0, 0, 0, 0.05); */
background: #ffffff;
}
.page-integral-mall {
border-top: 1px solid rgba(151, 151, 151, 0.1);
}
.empty-wrap {
width: 300rpx;
margin: 190rpx auto 0;
text-align: center;
}
.empty-img {
width: 197rpx;
height: 176rpx;
margin-bottom: 48rpx;
}
.empty-text {
color: #cccccc;
font-size: 28rpx;
}
/* 卡劵列表 */
.coupon-wrap {
padding: 20rpx;
clear: both;
}
.coupon-list {
margin-bottom: 10rpx;
border-bottom: solid 1px #eeeeee;
}
.coupon-img-title {
display: flex;
align-items: center;
}
.coupon-item {
display: flex;
align-items: center;
height: 144rpx;
background-color: #fff;
justify-content: space-between;
}
.coupon-btn {
margin-right: 30rpx;
}
.coupon-btn-click {
width: 153.8rpx;
height: 48rpx;
border-radius: 33rpx;
background-color: rgba(5, 195, 91, 1);
box-shadow: 0rpx 3rpx 10rpx 0rpx rgba(5, 195, 91, 0.3);
line-height: 48rpx;
color: rgba(255, 255, 255, 1);
font-size: 24rpx;
text-align: center;
}
.coupon-btn-click.disabled{
background-color: #dddddd !important;
box-shadow: none;
}
.coupon-btn-num {
width: 153.8rpx;
height: 22rpx;
color: rgba(250, 100, 0, 1);
font-size: 22rpx;
text-align: center;
margin-top: 10rpx;
}
.coupon-img {
box-sizing: border-box;
margin-left: 30rpx;
}
.coupon-img image {
width: 80rpx;
height: 80rpx;
}
.coupon-info {
padding: 42rpx 39rpx;
box-sizing: border-box;
}
.coupon-name {
color: #333;
}
.coupon-time {
color: #fc921e;
margin-bottom: 18rpx;
font-size: 26rpx;
}
.coupon-desc {
/* color: #999;
margin-top: 11rpx;
width: 360rpx;
font-size: 24rpx; */
color: rgba(118, 161, 213, 1);
font-size: 22rpx;
text-align: right;
margin-top: 18rpx;
}
.text-align-left{
text-align: left !important;
}
.coupon-code {
color: #ffffff;
word-wrap: break-word;
font-weight: bold;
margin: 0 10rpx;
padding: 35rpx 20rpx;
box-sizing: content-box;
width: 40rpx;
line-height: 35rpx;
}
.invalid-coupon {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 3;
border-radius: 7rpx;
}
.invalid-img {
position: absolute;
width: 147rpx;
height: 147rpx;
right: 81rpx;
top: 31rpx;
z-index: 4;
}
.point-img {
width: 28rpx;
height: 36rpx;
}
.title-img-point {
display: flex;
align-items: center;
}
.point-exchange-goods-records{
font-size: 28rpx;
color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
height: 80rpx;
position: fixed;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.65);
z-index: 2;
width: 100%;
}
.point-exchange-goods-records:active{
opacity: 0.7;
}
.text-point {
color: rgba(51, 51, 51, 1);
font-size: 42rpx;
margin-left: 10rpx;
}
.mall-title {
height: 150rpx;
padding-left: 50rpx;
padding-right: 42rpx;
box-sizing: border-box;
background-color: rgba(255, 255, 255, 1);
box-shadow: 0px 0px 8px 5px rgba(0, 0, 0, 0.05),
0px 0px 3px 0px rgba(0, 0, 0, 0.03);
}
.title-num-point {
padding-top: 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.integral-vip-rules {
width: 133rpx;
height: 42rpx;
line-height: 42rpx;
border-radius: 34rpx;
font-size: 23rpx;
text-align: center;
border: 1px solid rgba(204, 204, 204, 1);
}
.title-time-point {
color: rgba(102, 102, 102, 1);
font-size: 20rpx;
text-align: left;
padding-top: 3rpx;
margin-top: 15rpx;
}
.mall-tab {
height: 80rpx;
display: flex;
align-items: center;
background-color: #fff;
padding: 5rpx 0;
box-sizing: border-box;
margin-top: 10rpx;
border-bottom: solid 1px #eeeeee;
}
.tab-coupon, .tab-goods,.tab-coupon-goods {
flex: 1;
text-align: center;
color: rgba(102, 102, 102, 1);
font-size: 26rpx;
}
.tab-coupon {
border-right: 1rpx solid rgba(102, 102, 102, 1);
}
.tab-active {
color: rgba(5, 195, 91, 1);
}
\ No newline at end of file
src/subPackageA/page/pages/pointExchangeGoods/pointExchangeGoods.js
0 → 100644
View file @
ede5f6a3
// pages/userCenter.js
const
wxService
=
require
(
'../../../../utils/wxService'
)
wxService
.
page
({
/**
* 页面的初始数据
*/
data
:
{
query
:
''
,
integralGoodsList
:
[],
// 限量精品列表
noMore
:
false
,
isExchange
:
false
,
exchangeId
:
''
,
exchangePoint
:
0
,
memberPoint
:
{
total
:
'--'
,
expirePoint
:
0
,
expireDate
:
''
},
dialogStockEmpty
:
false
,
dialogUserLimit
:
false
,
activityId
:
''
,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
this
.
data
.
activityId
=
options
.
id
;
wx
.
hideShareMenu
();
this
.
refreshPointRequest
();
this
.
getActivityGroupInfo
();
},
//刷新积分请求
refreshPointRequest
()
{
const
{
memberId
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
if
(
!
memberId
)
{
return
;
}
wxService
.
get
(
'/member/memberPoint/refreshExpiredPoint?memberId='
+
memberId
).
then
(
res
=>
{
})
},
//获取积分活动分组详情
getActivityGroupInfo
()
{
wxService
.
get
(
`/merchant/groupingActivities/findById?id=
${
this
.
data
.
activityId
}
`
).
then
(
res
=>
{
if
(
res
)
{
let
data
=
res
.
data
.
data
?
res
.
data
.
data
:
null
;
if
(
data
)
{
let
ids
=
data
.
sons
.
map
(
item
=>
{
return
item
.
activateId
;
});
this
.
initIntegralProductList
(
ids
);
}
}
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
//获取会员积分信息
this
.
getMemberIntegrateInfo
();
if
(
wx
.
getStorageSync
(
'needReloadExchangeList'
))
{
wx
.
removeStorageSync
(
'needReloadExchangeList'
);
this
.
getActivityGroupInfo
();
}
},
//积分换物记录
onTapToExchangeRecords
()
{
wx
.
navigateTo
({
url
:
'/subPackage/page/pages/recordList/recordList'
,
});
},
//查询会员积分信息
getMemberIntegrateInfo
()
{
// wx.showLoading({
// title: '数据请求中..',
// });
const
{
memberId
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
if
(
!
memberId
)
{
return
;
}
wxService
.
get
(
`/member/memberPoint/getMemberPointInfo?memberId=
${
memberId
}
`
).
then
(
res
=>
{
let
data
=
res
.
data
.
data
?
res
.
data
.
data
:
{};
this
.
data
.
memberPoint
.
total
=
data
.
point
?
data
.
point
:
0
;
this
.
data
.
memberPoint
.
expirePoint
=
data
.
pointWillExpired
?
data
.
pointWillExpired
:
0
;
let
expireDate
=
data
.
pointExpiredTime
?
data
.
pointExpiredTime
:
'2019-12-31 23:59:59'
;
if
(
expireDate
)
{
let
dateStr
=
expireDate
.
replace
(
/-/g
,
'/'
);
let
da
=
new
Date
(
dateStr
);
let
year
=
da
.
getFullYear
();
let
month
=
(
da
.
getMonth
()
+
1
)
<
10
?
'0'
+
(
da
.
getMonth
()
+
1
)
:
da
.
getMonth
()
+
1
;
let
day
=
da
.
getDate
()
<
10
?
'0'
+
da
.
getDate
()
:
da
.
getDate
();
expireDate
=
`
${
year
}
年
${
month
}
月
${
day
}
日`
}
this
.
data
.
memberPoint
.
expireDate
=
expireDate
;
this
.
setData
({
memberPoint
:
this
.
data
.
memberPoint
});
});
},
// 查询所有生效中的活动 限量精品
initIntegralProductList
(
ids
)
{
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
post
(
`/member/pointsRedemptionProductSetting/findByIds`
,
ids
).
then
(
res
=>
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
let
list
=
data
?
data
:
[];
let
integralGoodsList
=
list
;
this
.
findExchangeNumByIds
(
integralGoodsList
);
}
}
}).
finally
(()
=>
{
wx
.
hideLoading
();
})
},
//查询指定积分换物活动兑换数量
findExchangeNumByIds
(
integralGoodsList
)
{
//获取ids
let
ids
=
integralGoodsList
.
map
(
g
=>
{
return
g
.
id
;
});
wxService
.
post
(
`/member/pointsRedemptionProductSetting/getExchangeCount`
,
ids
).
then
(
res
=>
{
if
(
res
)
{
let
data
=
res
.
data
.
data
?
res
.
data
.
data
:
null
;
if
(
data
)
{
for
(
let
k
in
data
)
{
let
id
=
k
,
value
=
data
[
k
];
for
(
let
i
=
0
;
i
<
integralGoodsList
.
length
;
i
++
)
{
if
(
integralGoodsList
[
i
].
id
==
id
)
{
integralGoodsList
[
i
].
canExchange
=
integralGoodsList
[
i
].
stock
>
value
;
}
}
}
}
}
this
.
setData
({
integralGoodsList
:
integralGoodsList
,
});
});
},
// 立即兑换物品
exchangeGoods
(
e
)
{
const
{
id
,
point
,
canexchange
}
=
e
.
currentTarget
.
dataset
;
const
{
memberId
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
if
(
!
canexchange
)
{
this
.
setData
({
dialogStockEmpty
:
true
});
return
;
}
//检查是不是可以兑换
wx
.
showLoading
({
title
:
'检查兑换资格中..'
,
});
wxService
.
post
(
`/member/pointsRedemptionProductRecord/checkByMemberIdAndSettingId?memberId=
${
memberId
}
&settingId=
${
id
}
`
).
then
(
res
=>
{
if
(
res
.
data
.
data
==
-
1
)
{
this
.
setData
({
dialogUserLimit
:
true
})
}
else
{
wx
.
navigateTo
({
url
:
'/subPackage/page/pages/exchangeAddress/exchangeAddress?id='
+
id
,
});
}
});
},
//跳转积分换物详情
// subPackage/page/pages/IntegrateGoodsExchangeInfo/IntegrateGoodsExchangeInfo
goIntegrateGoodsExchangeDetail
(
e
)
{
const
{
id
}
=
e
.
currentTarget
.
dataset
wxService
.
router
(
`/subPackage/page/pages/IntegrateGoodsExchangeInfo/IntegrateGoodsExchangeInfo?id=
${
id
}
`
)
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
},
})
\ No newline at end of file
src/subPackageA/page/pages/pointExchangeGoods/pointExchangeGoods.json
0 → 100644
View file @
ede5f6a3
{
"navigationBarTitleText"
:
"积分换物"
,
"enablePullDownRefresh"
:
true
,
"usingComponents"
:
{
"no-more"
:
"/component/noMore/noMore"
,
"dialog-stock-empty"
:
"/component/dialogStockEmpty/dialogStockEmpty"
,
"dialog-user-limit"
:
"/component/dialogUserLimit/dialogUserLimit"
,
"go-home"
:
"/component/goHome/goHome"
,
"go-guid"
:
"/component/goGuid/goGuid"
}
}
\ No newline at end of file
src/subPackageA/page/pages/pointExchangeGoods/pointExchangeGoods.wxml
0 → 100644
View file @
ede5f6a3
<!--pages/userCenter.wxml-->
<view class='page-integral-mall' style="padding-bottom: 80rpx;">
<!-- title -->
<view class='mall-title'>
<view class='title-num-point'>
<view class='title-img-point'>
<view class='img-point'>
<image class="point-img" src='/assets/imgs/point.png' mode="widthFix" />
</view>
<view class='text-point'>
{{memberPoint.total}}
</view>
</view>
</view>
<view class='title-time-point' wx:if="{{memberPoint.expirePoint > 0}}">
{{memberPoint.expirePoint}} 积分将于 {{memberPoint.expireDate}} 清零
</view>
<view class='title-time-point' wx:if="{{memberPoint.expirePoint == 0}}">
暂无将过期积分
</view>
</view>
<!-- goods -->
<view>
<view class='coupon-wrap' wx:if="{{integralGoodsList.length}}">
<view
class='coupon-list'
wx:for="{{integralGoodsList}}"
wx:for-item="item"
wx:for-index="k"
wx:key="{{k}}"
data-id="{{item.id}}"
bindtap="goIntegrateGoodsExchangeDetail"
>
<view class="coupon-item">
<view class='coupon-img-title'>
<view class='coupon-img'>
<image wx:if="{{item.thumbnail}}" src='{{item.thumbnail}}' />
<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-desc text-align-left fs-24'>查看详情</view>
</view>
</view>
<view class='coupon-btn'>
<view class='coupon-btn-click'
data-id="{{item.id}}"
data-point="{{item.point}}"
data-canexchange="{{item.canExchange}}"
catchtap='exchangeGoods'>立即兑换</view>
<view class='coupon-btn-num'>{{item.point}}积分</view>
</view>
</view>
</view>
</view>
<view class='empty-wrap' wx:if="{{!integralGoodsList.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>
</view>
<!-- 悬浮兑换记录 -->
<view class='point-exchange-goods-records' bindtap='onTapToExchangeRecords'>
查看兑换记录 >>
</view>
<!--goHome-->
<go-home/>
<floatNav bind:getAuth="_getUserInfo" bind:updatePage="updatePage"/>
</view>
<!-- 库存没了 -->
<dialog-stock-empty show="{{dialogStockEmpty}}"/>
<dialog-user-limit show="{{dialogUserLimit}}"/>
<go-guid />
src/subPackageA/page/pages/pointExchangeGoods/pointExchangeGoods.wxss
0 → 100644
View file @
ede5f6a3
/* pages/userCenter.wxss */
@import "/base/base.wxss";
page {
/* background-color: rgba(0, 0, 0, 0.05); */
background: #ffffff;
}
.page-integral-mall {
border-top: 1px solid rgba(151, 151, 151, 0.1);
}
.empty-wrap {
width: 300rpx;
margin: 190rpx auto 0;
text-align: center;
}
.empty-img {
width: 197rpx;
height: 176rpx;
margin-bottom: 48rpx;
}
.empty-text {
color: #cccccc;
font-size: 28rpx;
}
/* 卡劵列表 */
.coupon-wrap {
padding: 20rpx;
clear: both;
}
.coupon-list {
margin-bottom: 10rpx;
border-bottom: solid 1px #eeeeee;
}
.coupon-img-title {
display: flex;
align-items: center;
}
.coupon-item {
display: flex;
align-items: center;
height: 144rpx;
background-color: #fff;
justify-content: space-between;
}
.coupon-btn {
margin-right: 30rpx;
}
.coupon-btn-click {
width: 153.8rpx;
height: 48rpx;
border-radius: 33rpx;
background-color: rgba(5, 195, 91, 1);
box-shadow: 0rpx 3rpx 10rpx 0rpx rgba(5, 195, 91, 0.3);
line-height: 48rpx;
color: rgba(255, 255, 255, 1);
font-size: 24rpx;
text-align: center;
}
.coupon-btn-click.disabled{
background-color: #dddddd !important;
box-shadow: none;
}
.coupon-btn-num {
width: 153.8rpx;
height: 22rpx;
color: rgba(250, 100, 0, 1);
font-size: 22rpx;
text-align: center;
margin-top: 10rpx;
}
.coupon-img {
box-sizing: border-box;
margin-left: 30rpx;
}
.coupon-img image {
width: 80rpx;
height: 80rpx;
}
.coupon-info {
padding: 42rpx 39rpx;
box-sizing: border-box;
}
.coupon-name {
color: #333;
}
.coupon-time {
color: #fc921e;
margin-bottom: 18rpx;
font-size: 26rpx;
}
.coupon-desc {
/* color: #999;
margin-top: 11rpx;
width: 360rpx;
font-size: 24rpx; */
color: rgba(118, 161, 213, 1);
font-size: 22rpx;
text-align: right;
margin-top: 18rpx;
}
.text-align-left{
text-align: left !important;
}
.coupon-code {
color: #ffffff;
word-wrap: break-word;
font-weight: bold;
margin: 0 10rpx;
padding: 35rpx 20rpx;
box-sizing: content-box;
width: 40rpx;
line-height: 35rpx;
}
.invalid-coupon {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 3;
border-radius: 7rpx;
}
.invalid-img {
position: absolute;
width: 147rpx;
height: 147rpx;
right: 81rpx;
top: 31rpx;
z-index: 4;
}
.point-img {
width: 28rpx;
height: 36rpx;
}
.title-img-point {
display: flex;
align-items: center;
}
.point-exchange-goods-records{
font-size: 28rpx;
color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
height: 80rpx;
position: fixed;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.65);
z-index: 2;
width: 100%;
}
.point-exchange-goods-records:active{
opacity: 0.7;
}
.text-point {
color: rgba(51, 51, 51, 1);
font-size: 42rpx;
margin-left: 10rpx;
}
.mall-title {
height: 150rpx;
padding-left: 50rpx;
padding-right: 42rpx;
box-sizing: border-box;
background-color: rgba(255, 255, 255, 1);
box-shadow: 0px 0px 8px 5px rgba(0, 0, 0, 0.05),
0px 0px 3px 0px rgba(0, 0, 0, 0.03);
}
.title-num-point {
padding-top: 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.integral-vip-rules {
width: 133rpx;
height: 42rpx;
line-height: 42rpx;
border-radius: 34rpx;
font-size: 23rpx;
text-align: center;
border: 1px solid rgba(204, 204, 204, 1);
}
.title-time-point {
color: rgba(102, 102, 102, 1);
font-size: 20rpx;
text-align: left;
padding-top: 3rpx;
margin-top: 15rpx;
}
.mall-tab {
height: 80rpx;
display: flex;
align-items: center;
background-color: #fff;
padding: 5rpx 0;
box-sizing: border-box;
margin-top: 10rpx;
border-bottom: solid 1px #eeeeee;
}
.tab-coupon, .tab-goods,.tab-coupon-goods {
flex: 1;
text-align: center;
color: rgba(102, 102, 102, 1);
font-size: 26rpx;
}
.tab-coupon {
border-right: 1rpx solid rgba(102, 102, 102, 1);
}
.tab-active {
color: rgba(5, 195, 91, 1);
}
\ No newline at end of file
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