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
69ddb7ad
Commit
69ddb7ad
authored
Aug 19, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: cart
parent
36fb13c9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
33 deletions
+32
-33
cart.js
src/pages/cart/cart.js
+32
-33
No files found.
src/pages/cart/cart.js
View file @
69ddb7ad
...
@@ -213,13 +213,12 @@ wxService.page({
...
@@ -213,13 +213,12 @@ wxService.page({
let
cartListData
=
this
.
data
.
cartList
||
[]
let
cartListData
=
this
.
data
.
cartList
||
[]
if
(
!
cartListData
)
return
false
if
(
!
cartListData
)
return
false
// cartListData.filter(item => { // 选中的商品信息
cartListData
.
filter
(
item
=>
{
// 选中的商品信息
// return item.checked
return
item
.
checked
// }).map(function (item) {
}).
map
(
function
(
item
)
{
// goodsIds.push(item.promotionId)
goodsIds
.
push
(
item
.
skuId
)
// specIds.push(item.selectSku.id)
quantitys
.
push
(
item
.
count
)
// quantitys.push(item.quantity)
})
// })
if
(
goodsIds
.
length
==
0
)
{
if
(
goodsIds
.
length
==
0
)
{
wx
.
showToast
({
wx
.
showToast
({
title
:
'请选择商品'
,
title
:
'请选择商品'
,
...
@@ -228,38 +227,38 @@ wxService.page({
...
@@ -228,38 +227,38 @@ wxService.page({
return
false
return
false
}
}
// 去下单页
// 去下单页
//
this.handleGoBuy()
this
.
handleGoBuy
()
},
},
handleGoBuy
()
{
handleGoBuy
()
{
// 下单
// 下单
wx
.
showLoading
({
wx
.
showLoading
({
title
:
'加载中'
title
:
'加载中'
})
})
wxService
.
post
(
`/sale/trade/buyer/create`
).
then
(
res
=>
{
//
wxService.post(`/sale/trade/buyer/create`).then(res => {
if
(
!
res
)
return
false
;
//
if (!res) return false;
const
{
result
,
data
}
=
res
&&
res
.
data
||
res
&&
res
.
result
//
const { result, data } = res && res.data || res && res.result
if
(
result
==
0
)
{
//
if (result == 0) {
delete
data
.
appId
//
delete data.appId
wx
.
requestPayment
(
Object
.
assign
({
//
wx.requestPayment(Object.assign({
success
(
res
)
{
//
success(res) {
wx
.
hideLoading
()
//
wx.hideLoading()
wx
.
showToast
({
//
wx.showToast({
title
:
'支付成功'
,
//
title: '支付成功',
icon
:
'none'
,
//
icon: 'none',
mask
:
true
//
mask: true
})
//
})
},
//
},
fail
(
res
)
{
//
fail(res) {
wx
.
hideLoading
()
//
wx.hideLoading()
wx
.
showToast
({
//
wx.showToast({
title
:
'支付失败'
,
//
title: '支付失败',
icon
:
'none'
,
//
icon: 'none',
mask
:
true
//
mask: true
})
//
})
}
//
}
},
data
))
//
}, data))
}
//
}
})
//
})
},
},
// 调整商品 /trolley/add
// 调整商品 /trolley/add
editOk
()
{
editOk
()
{
...
...
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