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
6f742c2d
Commit
6f742c2d
authored
Aug 31, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify: 商品详情购买去下单页
parent
4e6e0c85
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
35 deletions
+16
-35
skuPopup.js
src/component/skuPopup/skuPopup.js
+0
-31
productDetail.js
src/pages/productDetail/productDetail.js
+16
-4
No files found.
src/component/skuPopup/skuPopup.js
View file @
6f742c2d
...
...
@@ -175,43 +175,12 @@ Component({
skuId
:
this
.
data
.
skuId
,
count
:
this
.
data
.
proNum
,
})
// this.triggerEvent('skuselect', {
// selectSku: this.data.curSku,
// counts: this.data.proNum,
// isAllowArrive: this.data.isAllowArrive,
// clickDataStock: this.data.clickDataStock
// })
// const trolleySku = {
// count: this.data.proNum,
// skuId: this.data.skuId
// }
// // 加入购物车
// wxService.post('/sale/trolley/put', trolleySku).then(res => {
// if (res) {
// const { result } = res.data
// if (result == 0) {
// wx.showToast({
// title: '添加成功,在购物车等亲~',
// icon: 'none'
// })
// this.setData({
// show: false
// })
// this.triggerEvent('skuselect', {
// selectSku: this.data.curSpec,
// counts: this.data.proNum,
// // isAllowArrive: this.data.isAllowArrive,
// // clickDataStock: this.data.clickDataStock
// })
// }
// }
// })
},
inputNum
:
function
(
e
)
{
// 输入数量
var
newNum
=
e
.
detail
.
value
...
...
src/pages/productDetail/productDetail.js
View file @
6f742c2d
...
...
@@ -229,7 +229,6 @@ wxService.page({
confirmClick
(
event
)
{
const
{
skuId
,
count
}
=
event
.
detail
console
.
log
(
'父组件'
,
skuId
,
count
)
const
trolleySku
=
{
count
,
skuId
...
...
@@ -248,8 +247,21 @@ wxService.page({
// 加入购物车
this
.
getPutCart
(
trolleySku
)
}
else
if
(
this
.
data
.
showSkuPopupType
==
'buy'
)
{
// 下单页面
console
.
log
(
'buy'
)
// 关闭弹框
this
.
setData
({
showSkuPopup
:
false
},
()
=>
{
// 去下单页 && 参数
let
trolleySku2Buy
=
[]
trolleySku2Buy
.
push
(
trolleySku
)
let
parmas
=
{
trolleySku2Buy
:
JSON
.
stringify
(
trolleySku2Buy
)
}
wxService
.
router
(
'/pages/confirmOrder/confirmOrder'
)
.
search
(
parmas
)
})
}
},
// put 购物车
...
...
@@ -262,7 +274,7 @@ wxService.page({
if
(
res
)
{
const
{
result
}
=
res
.
data
if
(
result
==
0
)
{
//
关闭弹框
// 关闭弹框
this
.
setData
({
showSkuPopup
:
false
})
...
...
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