Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
954d8d21
Commit
954d8d21
authored
Aug 31, 2023
by
侯体倬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 埋点优化
parent
cecaf436
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
src/api/goods.js
+4
-0
src/components/common/SelectGoods.vue
+23
-4
No files found.
src/api/goods.js
View file @
954d8d21
...
@@ -54,4 +54,8 @@ export default {
...
@@ -54,4 +54,8 @@ export default {
uncollect_goods
(
data
)
{
uncollect_goods
(
data
)
{
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/product/uncollect_goods?productId=
${
data
.
productId
}
&terminalProductId=
${
data
.
terminalProductId
}
`
,
data
)
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/product/uncollect_goods?productId=
${
data
.
productId
}
&terminalProductId=
${
data
.
terminalProductId
}
`
,
data
)
},
},
// 根据 productId 查询商品信息
queryProductInformation
(
productId
)
{
return
requestGET
(
`
${
process
.
env
.
OLSHOP_URL
}
/product/queryProductInformation?productId=
${
productId
}
`
)
},
};
};
src/components/common/SelectGoods.vue
View file @
954d8d21
...
@@ -3,7 +3,10 @@
...
@@ -3,7 +3,10 @@
<div
class=
"livedSelectionSpe"
>
<div
class=
"livedSelectionSpe"
>
<div
class=
"aaa"
:style=
"
{ 'z-index': show ? 999 : -999 }">
<div
class=
"aaa"
:style=
"
{ 'z-index': show ? 999 : -999 }">
<div
class=
"bg"
v-if=
"show"
@
click=
"close"
></div>
<div
class=
"bg"
v-if=
"show"
@
click=
"close"
></div>
<div
class=
"goodsMess"
:style=
"
{'bottom':show?0:''}">
<div
class=
"goodsMess"
:style=
"
{
'bottom': show ? 0 : '',
'padding-bottom': isIphonex ? '34px' : 0
}">
<div
class=
"sku"
>
<div
class=
"sku"
>
<!-- 关闭按钮 -->
<!-- 关闭按钮 -->
<div
class=
"close"
@
click=
"closeDia"
>
<div
class=
"close"
@
click=
"closeDia"
>
...
@@ -86,6 +89,7 @@
...
@@ -86,6 +89,7 @@
<
script
type=
"text/ecmascript-6"
>
<
script
type=
"text/ecmascript-6"
>
import
{
DFSImg
}
from
"@/utils/index"
;
import
{
DFSImg
}
from
"@/utils/index"
;
import
live
from
"@/api/live"
;
import
live
from
"@/api/live"
;
import
goods
from
"@/api/goods"
;
const
app
=
getApp
();
const
app
=
getApp
();
export
default
{
export
default
{
name
:
""
,
name
:
""
,
...
@@ -149,7 +153,12 @@ export default {
...
@@ -149,7 +153,12 @@ export default {
};
};
},
},
components
:
{},
components
:
{},
computed
:
{},
computed
:
{
isIphonex
()
{
const
res
=
wx
.
getSystemInfoSync
();
return
res
.
model
.
search
(
'iPhone'
)
!=
-
1
&&
res
.
screenHeight
>=
812
;
}
},
created
()
{
},
created
()
{
},
onLoad
()
{
},
onLoad
()
{
},
mounted
()
{
mounted
()
{
...
@@ -391,9 +400,15 @@ export default {
...
@@ -391,9 +400,15 @@ export default {
})
})
// 新华优选埋点
// 新华优选埋点
if
(
app
.
trackEvent
)
{
if
(
app
.
trackEvent
)
{
goods
.
queryProductInformation
(
this
.
getProductInfos
[
0
].
productId
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
let
productCode
=
res
.
data
.
data
.
productCode
;
if
(
typeof
productCode
===
'string'
)
productCode
=
productCode
.
trim
();
app
.
trackEvent
(
'resourceCartClick'
,
{
app
.
trackEvent
(
'resourceCartClick'
,
{
resourceId
:
this
.
getProductInfos
[
0
].
productId
,
resourceId
:
productCode
,
resourceName
:
this
.
getProductInfos
[
0
].
pdtName
resourceName
:
res
.
data
.
data
.
productName
});
}
})
})
}
}
this
.
show
=
false
;
this
.
show
=
false
;
...
@@ -678,6 +693,10 @@ export default {
...
@@ -678,6 +693,10 @@ export default {
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.is-iphonex
{
padding-bottom
:
34px
;
}
.aaa
{
.aaa
{
position
:
fixed
;
position
:
fixed
;
width
:
100%
;
width
:
100%
;
...
...
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