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
53179d3d
Commit
53179d3d
authored
Aug 05, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 接口
parent
5af4381c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
24 deletions
+91
-24
pointDetail.js
src/pages/pointDetail/pointDetail.js
+33
-10
pointList.js
src/pages/pointList/pointList.js
+25
-6
pointList.wxml
src/pages/pointList/pointList.wxml
+11
-5
pointGoodsList.js
src/subPackage/page/pages/pointGoodsList/pointGoodsList.js
+22
-3
No files found.
src/pages/pointDetail/pointDetail.js
View file @
53179d3d
...
...
@@ -16,8 +16,8 @@ wxService.page({
content
:
'积分流水'
,
tip
:
'立即查看'
},
desc
:
[{
"label"
:
"优惠详情"
,
"value"
:
"使用100积分可兑换一张维记鲜牛奶优惠券,凭券可以4.8元优惠价换购维记鲜牛奶236ML一盒!"
,
"type"
:
2
},
{
"label"
:
"有效时间"
,
"value"
:
"2019-07-12 至 2019-08-06"
,
"type"
:
2
},
{
"label"
:
"兑换说明"
,
"value"
:
"1、点击【立即兑换】,即可兑换成功,每人限兑换10张券
\
n2、在【会员小程序-优惠券】中可查询到已兑换的券;"
,
"type"
:
2
},
{
"label"
:
"使用须知"
,
"value"
:
"1、凭此优惠券,前往广东7-Eleven有售门店,可以优惠价4.8元换购维记鲜牛奶236ML一盒!2、成功领到优惠券后,请务必在有效期内使用,逾期无效;3、一张券限兑换维记鲜牛奶236ML一盒;4、优惠券不设找零、不可兑换现金; 5、请于交易前向收银员出示此优惠券; 6、使用优惠券发生的交易,广东7-Eleven仅按实际支付金额开具发票;7、如发生退货,仅按顾客实际支付金额退款。 "
,
"type"
:
2
}]
desc
:
[{
"label"
:
"优惠详情"
,
"value"
:
"使用100积分可兑换一张维记鲜牛奶优惠券,凭券可以4.8元优惠价换购维记鲜牛奶236ML一盒!"
,
"type"
:
2
},
{
"label"
:
"有效时间"
,
"value"
:
"2019-07-12 至 2019-08-06"
,
"type"
:
2
},
{
"label"
:
"兑换说明"
,
"value"
:
"1、点击【立即兑换】,即可兑换成功,每人限兑换10张券
\
n2、在【会员小程序-优惠券】中可查询到已兑换的券;"
,
"type"
:
2
},
{
"label"
:
"使用须知"
,
"value"
:
"1、凭此优惠券,前往广东7-Eleven有售门店,可以优惠价4.8元换购维记鲜牛奶236ML一盒!2、成功领到优惠券后,请务必在有效期内使用,逾期无效;3、一张券限兑换维记鲜牛奶236ML一盒;4、优惠券不设找零、不可兑换现金; 5、请于交易前向收银员出示此优惠券; 6、使用优惠券发生的交易,广东7-Eleven仅按实际支付金额开具发票;7、如发生退货,仅按顾客实际支付金额退款。 "
,
"type"
:
2
}]
,
activityId
:
''
},
/**
...
...
@@ -26,15 +26,34 @@ wxService.page({
onLoad
:
function
(
options
)
{
},
getPointDetail
()
{
// 集点详情
getPointDetail
(
id
)
{
wx
.
showLoading
({
title
:
'加载中'
})
const
params
=
{
activityId
:
''
,
memberId
:
''
wxService
.
get
(
`/sale/touchpoints/pointConsumptionActivity/findById/
${
id
}
`
).
then
(
res
=>
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
console
.
log
(
data
)
this
.
setData
({
activityId
:
data
.
id
},()
=>
{
// 会员集点活动统计信息
this
.
getPointConsumptionCount
(
id
)
})
}
wxService
.
post
(
`/sale/touchpoints/pointConsumptionCount/getPointConsumptionCount`
,
params
).
then
(
res
=>
{
}
})
},
// 会员集点活动统计信息
getPointConsumptionCount
(
activityId
)
{
const
{
memberId
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
post
(
`/sale/touchpoints/pointConsumptionCount/getPointConsumptionCount?activityId=
${
activityId
}
&memberId=
${
memberId
}
`
).
then
(
res
=>
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
...
...
@@ -52,15 +71,16 @@ wxService.page({
handleGo
()
{
// 兑换成功跳转 触点有礼-消费集点兑换
// wxService.router(`/pages/coupons/coupons`)
// /touchpoints/pointConsumptionExchange/exchange
this
.
getPointExchange
()
},
getPointExchange
()
{
const
{
activityId
}
=
this
.
data
const
{
memberId
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
get
(
`/sale/touchpoints/pointConsumptionExchange/exchange?activityId=
${
1
}
&memberId=
${
1
}
`
).
then
(
res
=>
{
wxService
.
get
(
`/sale/touchpoints/pointConsumptionExchange/exchange?activityId=
${
activityId
}
&memberId=
${
memberId
}
`
).
then
(
res
=>
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
...
...
@@ -90,7 +110,10 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
this
.
getPointDetail
()
const
{
id
}
=
this
.
options
if
(
id
){
this
.
getPointDetail
(
id
)
}
},
/**
...
...
src/pages/pointList/pointList.js
View file @
53179d3d
...
...
@@ -4,12 +4,12 @@ const wxService = require('../../utils/wxService')
const
utils
=
require
(
'../../utils/util'
)
wxService
.
page
({
/**
* 页面的初始数据
*/
data
:
{
pointList
:
[]
pointList
:
[],
currentPointList
:
[]
// 合并对象
},
/**
...
...
@@ -40,18 +40,37 @@ wxService.page({
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
this
.
setData
({
pointList
:
data
})
data
.
forEach
(
item
=>
{
this
.
getPointConsumptionCount
(
item
.
id
)
})
}
}
})
},
getPointConsumptionCount
(
activityId
)
{
const
{
memberId
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
// 会员集点活动统计信息
wxService
.
post
(
`/sale/touchpoints/pointConsumptionCount/getPointConsumptionCount?activityId=
${
activityId
}
&memberId=
${
memberId
}
`
).
then
(
res
=>
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
console
.
log
(
data
)
let
obj1
=
{...
this
.
data
.
pointList
,...
res
.
data
}
let
currentList
=
[]
currentList
.
push
(
obj1
)
this
.
setData
({
currentPointList
:
currentList
})
}
}
})
},
handleDetail
(
e
)
{
const
{
index
}
=
e
.
currentTarget
.
dataset
console
.
log
(
'handleDetail'
,
index
)
wxService
.
router
(
`/pages/pointDetail/pointDetail`
).
search
({
index
})
const
{
id
}
=
e
.
currentTarget
.
dataset
wxService
.
router
(
`/pages/pointDetail/pointDetail`
).
search
({
id
})
},
/**
* 生命周期函数--监听页面隐藏
...
...
src/pages/pointList/pointList.wxml
View file @
53179d3d
<!--pages/pointList/pointList.wxml-->
<view class="point-list border_box">
<block wx:for="{{4}}" wx:for-item
="item">
<view class="point border_box" data-index="{{item
}}" bindtap="handleDetail">
<status-img></status-img
>
<block wx:for="{{currentPointList}}" wx:key
="item">
<view class="point border_box" data-id="{{item[0].id
}}" bindtap="handleDetail">
<status-img img="{{item[0].listImage}}" /
>
<view class="progress weui-flex df-j--bt">
<view class="rate">进度: <text class="rate-num">1</text>/5</view>
<view class="time-out">距离结束时间: <text class="time">11</text></view>
<view class="rate">进度:
<text class="rate-num">1</text>
/ {{item[0].goal}}
</view>
<view class="time-out">距离结束时间:
<text class="time">11</text>
</view>
</view>
</view>
</block>
</view>
src/subPackage/page/pages/pointGoodsList/pointGoodsList.js
View file @
53179d3d
...
...
@@ -6,7 +6,7 @@ wxService.page({
* 页面的初始数据
*/
data
:
{
goodsList
:
[{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
},{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
}],
goodsList
:
[{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
},
{
name
:
'aa'
}],
isNoMore
:
true
},
...
...
@@ -23,12 +23,31 @@ wxService.page({
onReady
:
function
()
{
},
// 活动下商品列表 id pageNo pageSize
findActivityProductList
()
{
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
get
(
`/sale/touchpoints/pointConsumptionActivity/findActivityProductList?id=
${}
&pageNo=
${}
&pageSize=
${}
`
).
then
(
res
=>
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
console
.
log
(
data
)
this
.
setData
({
})
}
}
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
const
{
id
}
=
this
.
options
if
(
id
){
this
.
findActivityProductList
(
id
)
}
},
/**
...
...
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