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
7edb4a71
Commit
7edb4a71
authored
Aug 30, 2019
by
赵雅纹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plus购买
parent
6deb6a94
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
43 deletions
+59
-43
plus.js
src/component/plus/plus.js
+52
-4
plus.wxml
src/component/plus/plus.wxml
+5
-4
confirmOrder.js
src/pages/confirmOrder/confirmOrder.js
+1
-0
plus.js
src/subPackage/page/pages/plus/plus.js
+1
-30
plus.wxml
src/subPackage/page/pages/plus/plus.wxml
+0
-5
No files found.
src/component/plus/plus.js
View file @
7edb4a71
// component/plus/plus.js
const
wxService
=
require
(
'../../utils/wxService'
)
Component
({
/**
* 组件的属性列表
...
...
@@ -14,7 +16,7 @@ Component({
* 组件的初始数据
*/
data
:
{
currentTab
:
0
currentTab
:
'999'
},
/**
...
...
@@ -22,10 +24,56 @@ Component({
*/
methods
:
{
switchNav
(
e
){
console
.
log
(
e
)
this
.
setData
({
currentTab
:
e
.
currentTarget
.
dataset
.
current
currentTab
:
e
.
currentTarget
.
dataset
.
current
,
id
:
e
.
currentTarget
.
dataset
.
id
})
},
payPlus
()
{
if
(
!
this
.
data
.
id
){
wx
.
showToast
({
title
:
'请先选择会员卡'
,
icon
:
'none'
,
mask
:
true
})
return
}
// 下单
wx
.
showLoading
({
title
:
'加载中'
})
}
// 获取支付参数
wxService
.
post
(
`/sale/payment/premium/buyer/preorder/wxa`
,
{
premiumId
:
this
.
data
.
id
}).
then
(
res
=>
{
if
(
!
res
)
return
false
;
const
{
result
,
data
}
=
res
&&
res
.
data
||
res
&&
res
.
result
if
(
result
==
0
)
{
console
.
log
(
'data'
,
data
)
wx
.
requestPayment
(
Object
.
assign
({
success
(
res
)
{
wx
.
hideLoading
()
// wx.showToast({
// title: '支付成功',
// icon: 'none',
// mask: true
// })
// 支付成功页面
console
.
log
(
res
)
wxService
.
router
(
'/subPackage/page/pages/paymentStatus/paymentStatus'
)
},
fail
(
res
)
{
wx
.
hideLoading
()
wx
.
showToast
({
title
:
'支付失败'
,
icon
:
'none'
,
mask
:
true
})
}
},
data
))
}
})
},
}
})
src/component/plus/plus.wxml
View file @
7edb4a71
...
...
@@ -16,16 +16,17 @@
data-btnText="{{navItem.buttonText}}"
data-id="{{navItem.id}}"
bindtap="switchNav"
style="background-image:url({{navItem.coverImgUrl}})"
>
<view class="plus-choose">
<text>每月仅¥
25
</text>
<text>每月仅¥
{{navItem.price / navItem.duration * 30}}
</text>
</view>
<view class="card-kinds">
全年卡· 366 天
{{navItem.name}}
</view>
<view class="plus-price">
<text class="rmb">¥</text>
<text class="amount">
100
</text>
<text class="amount">
{{navItem.price}}
</text>
</view>
<view class="select-plus" wx:if="{{idx == currentTab}}">
<view class="circle-radio theme-color">
...
...
@@ -36,7 +37,7 @@
</block>
</scroll-view>
<view class="pay">
<button class="btn btn-primary">
<button class="btn btn-primary"
bindtap="payPlus"
>
<text>立即支付</text>
<text>¥158</text>
</button>
...
...
src/pages/confirmOrder/confirmOrder.js
View file @
7edb4a71
...
...
@@ -67,6 +67,7 @@ wxService.page({
delete
data
.
appId
wx
.
requestPayment
(
Object
.
assign
({
success
(
res
)
{
console
.
log
(
'000000'
,
res
)
wx
.
hideLoading
()
// 支付成功页面
wxService
.
router
(
'/subPackage/page/pages/paymentStatus/paymentStatus'
)
...
...
src/subPackage/page/pages/plus/plus.js
View file @
7edb4a71
...
...
@@ -6,36 +6,7 @@ wxService.page({
* 页面的初始数据
*/
data
:
{
skuVOList
:[
{
mainImgUrl
:
"http://testimg3.bigaka.com/group3/M00/00/17/Cv6CBF1Z9TKAU6T1AAAG8CvHO2o415.png"
,
amount
:
0.06
},
{
mainImgUrl
:
"http://testimg3.bigaka.com/group3/M00/00/17/Cv6CBF1Z9TKAU6T1AAAG8CvHO2o415.png"
,
amount
:
0.06
},
{
mainImgUrl
:
"http://testimg3.bigaka.com/group3/M00/00/17/Cv6CBF1Z9TKAU6T1AAAG8CvHO2o415.png"
,
amount
:
0.06
},
{
mainImgUrl
:
"http://testimg3.bigaka.com/group3/M00/00/17/Cv6CBF1Z9TKAU6T1AAAG8CvHO2o415.png"
,
amount
:
0.06
},
{
mainImgUrl
:
"http://testimg3.bigaka.com/group3/M00/00/17/Cv6CBF1Z9TKAU6T1AAAG8CvHO2o415.png"
,
amount
:
0.06
},
{
mainImgUrl
:
"http://testimg3.bigaka.com/group3/M00/00/17/Cv6CBF1Z9TKAU6T1AAAG8CvHO2o415.png"
,
amount
:
0.06
},
{
mainImgUrl
:
"http://testimg3.bigaka.com/group3/M00/00/17/Cv6CBF1Z9TKAU6T1AAAG8CvHO2o415.png"
,
amount
:
0.06
}
],
skuVOList
:[]
},
/**
...
...
src/subPackage/page/pages/plus/plus.wxml
View file @
7edb4a71
<!--subPackage/home/pages/plus/plus.wxml-->
<view class="plus">
<!-- plus 动态页面 -->
</view>
<plus sku-list="{{skuVOList}}"/>
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