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
4e7d4871
Commit
4e7d4871
authored
Aug 30, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品详情页
parent
9f6658cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
26 deletions
+47
-26
skuPopup.js
src/component/skuPopup/skuPopup.js
+33
-25
productDetail.js
src/pages/productDetail/productDetail.js
+14
-1
No files found.
src/component/skuPopup/skuPopup.js
View file @
4e7d4871
...
@@ -171,31 +171,39 @@ Component({
...
@@ -171,31 +171,39 @@ Component({
}
}
}
}
const
trolleySku
=
{
// this.triggerEvent('skuselect', {
count
:
this
.
data
.
proNum
,
// selectSku: this.data.curSku,
skuId
:
this
.
data
.
skuId
// counts: this.data.proNum,
}
// isAllowArrive: this.data.isAllowArrive,
// 加入购物车
// clickDataStock: this.data.clickDataStock
wxService
.
post
(
'/sale/trolley/put'
,
trolleySku
).
then
(
res
=>
{
// })
if
(
res
)
{
const
{
result
}
=
res
.
data
if
(
result
==
0
)
{
// const trolleySku = {
wx
.
showToast
({
// count: this.data.proNum,
title
:
'添加成功,在购物车等亲~'
,
// skuId: this.data.skuId
icon
:
'none'
// }
})
// // 加入购物车
this
.
setData
({
// wxService.post('/sale/trolley/put', trolleySku).then(res => {
show
:
false
// if (res) {
})
// const { result } = res.data
this
.
triggerEvent
(
'skuselect'
,
{
// if (result == 0) {
selectSku
:
this
.
data
.
curSpec
,
// wx.showToast({
counts
:
this
.
data
.
proNum
,
// title: '添加成功,在购物车等亲~',
// isAllowArrive: this.data.isAllowArrive,
// icon: 'none'
// clickDataStock: this.data.clickDataStock
// })
})
// this.setData({
}
// show: false
}
// })
})
// this.triggerEvent('skuselect', {
// selectSku: this.data.curSpec,
// counts: this.data.proNum,
// // isAllowArrive: this.data.isAllowArrive,
// // clickDataStock: this.data.clickDataStock
// })
// }
// }
// })
},
},
...
...
src/pages/productDetail/productDetail.js
View file @
4e7d4871
...
@@ -51,6 +51,12 @@ wxService.page({
...
@@ -51,6 +51,12 @@ wxService.page({
// 商品加入购物车
// 商品加入购物车
// xm_bi.Event.stat("skuAddToCart", { "amount":"666","skuId":'abcd1234'});
// xm_bi.Event.stat("skuAddToCart", { "amount":"666","skuId":'abcd1234'});
},
},
goBuy
:
function
(
event
)
{
this
.
setData
({
showSkuPopup
:
true
,
showSkuPopupType
:
'buy'
})
},
// 分享
// 分享
onTapShare
()
{
onTapShare
()
{
...
@@ -222,7 +228,7 @@ wxService.page({
...
@@ -222,7 +228,7 @@ wxService.page({
},
},
confirmClick
(
event
){
confirmClick
(
event
){
console
.
log
(
event
)
console
.
log
(
'confirmClick'
,
event
)
var
selectSkuName
=
[]
var
selectSkuName
=
[]
for
(
let
i
in
event
.
detail
.
selectSku
){
for
(
let
i
in
event
.
detail
.
selectSku
){
selectSkuName
.
push
(
event
.
detail
.
selectSku
[
i
].
name
)
selectSkuName
.
push
(
event
.
detail
.
selectSku
[
i
].
name
)
...
@@ -231,6 +237,13 @@ wxService.page({
...
@@ -231,6 +237,13 @@ wxService.page({
this
.
setData
({
this
.
setData
({
selectSkuName
:
selectSkuStr
selectSkuName
:
selectSkuStr
})
})
if
(
this
.
data
.
showSkuPopupType
==
'cart'
)
{
// 加入购物车
}
else
if
(
this
.
data
.
showSkuPopupType
==
'buy'
)
{
// 下单页面
}
},
},
...
...
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