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
20255594
Commit
20255594
authored
May 27, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 积分兑换优惠券
parent
d1b65078
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
14 deletions
+49
-14
exchange-coupon-modal.js
src/component/exchange-coupon-modal/exchange-coupon-modal.js
+33
-5
exchange-coupon-modal.wxml
...omponent/exchange-coupon-modal/exchange-coupon-modal.wxml
+4
-4
exchange-coupon-modal.wxss
...omponent/exchange-coupon-modal/exchange-coupon-modal.wxss
+2
-0
noMore.js
src/component/noMore.js
+0
-0
IntegralMall.js
src/pages/IntegralMall/IntegralMall.js
+8
-3
IntegralMall.wxml
src/pages/IntegralMall/IntegralMall.wxml
+2
-2
No files found.
src/component/exchange-coupon-modal/exchange-coupon-modal.js
View file @
20255594
// component/exchange-coupon-modal/exchange-coupon-modal.js
var
app
=
getApp
()
const
wxService
=
require
(
'../../utils/wxService'
)
const
envInfo
=
require
(
'../../config/index'
).
envInfo
Component
({
/**
* 组件的属性列表
*/
properties
:
{
isExchange
:
Boolean
isExchange
:{
type
:
Boolean
,
value
:
false
},
exchangePoint
:{
type
:
Number
,
value
:
0
},
exchangeId
:
{
type
:
String
,
value
:
''
},
},
/**
...
...
@@ -46,15 +61,28 @@ Component({
})
}
},
//再想想
//
再想想
cancel
(){
this
.
setData
({
isExchange
:
false
})
},
//立即兑换
query
(){
// 立即兑换
handelRedeemNow
(){
wx
.
showLoading
({
title
:
'加载中'
})
const
params
=
{
activateId
:
this
.
data
.
exchangeId
}
wxService
.
post
(
`/coupon/pointsRedemptionCouponSetting/exchange`
,
params
).
then
(
res
=>
{
const
{
result
,
data
}
=
res
.
data
console
.
log
(
'res.data'
,
res
.
data
)
if
(
result
==
0
){
wx
.
hideLoading
()
}
})
}
}
})
src/component/exchange-coupon-modal/exchange-coupon-modal.wxml
View file @
20255594
...
...
@@ -7,16 +7,16 @@
</view>
<view class="modal-content">
<view class='modal-desc'>
<
text><text class="num">500</text>积分</text
>
<view class='coupon-number'>
<
view><text class="num">{{exchangePoint}}</text>积分</view
>
<!--
<view class='coupon-number'>
<view class="redus" catchtap="minusNum">-</view>
<input type="number" catchtap bindblur="blurNum" bindinput="inputNum" value="{{couponNum}}"></input>
<view class="add" catchtap="addNum">+</view>
</view>
</view>
-->
</view>
<view>
<button type='default' class='cancel' bindtap='cancel'>再想想</button>
<button type='primary' class='query' bindtap='
query
'>立即兑换</button>
<button type='primary' class='query' bindtap='
handelRedeemNow
'>立即兑换</button>
</view>
</view>
</view>
...
...
src/component/exchange-coupon-modal/exchange-coupon-modal.wxss
View file @
20255594
...
...
@@ -60,6 +60,8 @@
font-size: 28rpx;
margin-top: 38rpx;
margin-bottom: 100rpx;
display: flex;
justify-content:center;
}
.cancel,.query{
display: inline-block;
...
...
src/component/noMore.js
deleted
100644 → 0
View file @
d1b65078
src/pages/IntegralMall/IntegralMall.js
View file @
20255594
...
...
@@ -15,7 +15,9 @@ wxService.page({
totalPages
:
0
,
integralCouponList
:
[],
// 积分兑换优惠券列表
noMore
:
false
,
isExchange
:
false
isExchange
:
false
,
exchangeId
:
''
,
exchangePoint
:
0
,
},
/**
...
...
@@ -50,9 +52,12 @@ wxService.page({
})
},
//立即兑换
exchange
(){
exchange
(
e
){
const
{
id
,
point
}
=
e
.
currentTarget
.
dataset
this
.
setData
({
isExchange
:
true
isExchange
:
true
,
exchangeId
:
id
,
exchangePoint
:
point
})
},
// 点击跳转至会员规则页
...
...
src/pages/IntegralMall/IntegralMall.wxml
View file @
20255594
...
...
@@ -12,7 +12,7 @@
<view class='coupon-time fs-24'>{{item.startTime}}</view>
<view class='coupon-desc fs-24' data-id="{{item.id}}" bindtap="goCouponDetail">查看详情</view>
</view>
<view class='coupon-code fs-24' bindtap='exchange'>立即兑换</view>
<view class='coupon-code fs-24'
data-id="{{item.id}}" data-point="{{item.point}}"
bindtap='exchange'>立即兑换</view>
</view>
</view>
<view class='empty-wrap' wx:if="{{!integralCouponList.length}}">
...
...
@@ -21,6 +21,6 @@
<view class='empty-text'>没有任何卡劵</view>
</view>
</view>
<exchange-coupon-modal isExchange='{{isExchange}}'/>
<exchange-coupon-modal
exchangeId="{{exchangeId}}" exchangePoint="{{exchangePoint}}"
isExchange='{{isExchange}}'/>
<no-more wx:if="{{noMore}}"/>
</view>
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