Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
group-buy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
group-buy-ui
Commits
ecdb682d
Commit
ecdb682d
authored
Sep 25, 2021
by
Xuguangxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 埋点
parent
7ceda05f
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
41 additions
and
100 deletions
+41
-100
home.api.js
src/api/home.api.js
+3
-3
pay.api.js
src/api/pay.api.js
+5
-5
groupShare.vue
src/components/groupShare.vue
+2
-2
env.config.js
src/config/env.config.js
+3
-1
prod.config.js
src/config/prod.config.js
+3
-1
main.js
src/main.js
+1
-1
sa.service.js
src/service/sa.service.js
+16
-40
goodsCard.vue
src/views/goodsList/components/goodsCard.vue
+2
-2
index.vue
src/views/goodsList/index.vue
+2
-2
createOrder.vue
src/views/order/createOrder.vue
+0
-1
List.vue
src/views/orderList/components/List.vue
+2
-2
extends.js
src/views/pay/extends.js
+2
-14
index.vue
src/views/pay/index.vue
+0
-10
payWaiting.vue
src/views/pay/payWaiting.vue
+0
-16
No files found.
src/api/home.api.js
View file @
ecdb682d
import
config
from
'
@/config
'
;
import
http
from
'
@/service/httpDecorator
'
;
import
{
uiTrack
}
from
'
@/service/sa.service
'
;
import
{
saDeviceId
}
from
'
@/service/sa.service
'
;
const
{
talosHost
}
=
config
;
const
PAGE
=
'
home
'
;
export
const
getBanner
=
()
=>
{
...
...
@@ -13,7 +13,7 @@ export const getContent = () => {
};
export
const
getGoodsList
=
async
data
=>
{
const
scDeviceId
=
await
uiTrack
.
run
(
'
saDeviceId
'
);
const
scDeviceId
=
await
saDeviceId
(
);
return
http
.
get
(
`
${
talosHost
}
/api/kdsp/recommend/goods-list`
,
{
params
:
data
,
customHeader
:
{
...
...
@@ -23,7 +23,7 @@ export const getGoodsList = async data => {
};
export
const
homeSearch
=
async
data
=>
{
const
scDeviceId
=
await
uiTrack
.
run
(
'
saDeviceId
'
);
const
scDeviceId
=
await
saDeviceId
(
);
return
http
.
post
(
`
${
talosHost
}
/api/kdsp/search/result`
,
data
,
{
customHeader
:
{
scDeviceId
...
...
src/api/pay.api.js
View file @
ecdb682d
import
request
from
'
@/service/httpDecorator
'
;
import
config
from
'
@/config
'
;
import
{
uiTrack
}
from
'
@/service/sa.service
'
;
import
{
saDeviceId
}
from
'
@/service/sa.service
'
;
const
{
talosHost
}
=
config
;
const
queryPayInfo
=
function
(
data
)
{
return
request
.
post
(
`
${
talosHost
}
/open/checkout`
,
data
);
};
const
prepay
=
async
function
(
data
)
{
const
scDeviceId
=
await
uiTrack
.
run
(
'
saDeviceId
'
);
const
scDeviceId
=
await
saDeviceId
(
);
return
request
.
post
(
`
${
talosHost
}
/open/checkout/prepay`
,
data
,
{
customHeader
:
{
scDeviceId
...
...
@@ -17,7 +17,7 @@ const prepay = async function(data) {
};
const
pay
=
async
function
(
data
)
{
const
scDeviceId
=
await
uiTrack
.
run
(
'
saDeviceId
'
);
const
scDeviceId
=
await
saDeviceId
(
);
return
request
.
post
(
`
${
talosHost
}
/open/checkout/pay`
,
data
,
{
customHeader
:
{
scDeviceId
...
...
@@ -43,7 +43,7 @@ const h5AppyUrl = function() {
};
const
getCoupon
=
async
function
(
params
)
{
const
scDeviceId
=
await
uiTrack
.
run
(
'
saDeviceId
'
);
const
scDeviceId
=
await
saDeviceId
(
);
return
request
.
post
(
`
${
talosHost
}
/open/checkout/pay_coupon_list`
,
params
,
{
customHeader
:
{
scDeviceId
...
...
@@ -56,7 +56,7 @@ const ocrFaceId = function(params) {
};
const
getGoodsList
=
async
function
(
data
)
{
const
scDeviceId
=
await
uiTrack
.
run
(
'
saDeviceId
'
);
const
scDeviceId
=
await
saDeviceId
(
);
return
request
.
get
(
`
${
talosHost
}
/vcc/xyqb/recommend/goods-list`
,
{
params
:
data
,
hideLoading
:
true
,
...
...
src/components/groupShare.vue
View file @
ecdb682d
...
...
@@ -11,7 +11,7 @@
<
script
>
import
MpBridge
from
'
@/service/mp
'
;
import
{
mapState
}
from
'
vuex
'
;
import
{
registeredEvents
}
from
'
@/service/sa.service
'
;
import
{
saTrackEvent
}
from
'
@/service/sa.service
'
;
export
default
{
name
:
'
GroupShare
'
,
components
:
{},
...
...
@@ -53,7 +53,7 @@ export default {
}
const
nativeBridge
=
this
.
nativeBridge
;
this
.
$store
.
dispatch
(
'
goods_send_shareinfo
'
,
{
ev
,
nativeBridge
});
registeredEvents
(
'
H5_GroupZeroYuanPurchaseActivityPageSharePopupWindowBtnClick
'
,
{
saTrackEvent
(
'
H5_GroupZeroYuanPurchaseActivityPageSharePopupWindowBtnClick
'
,
{
sku_no
:
''
,
buttons_name
:
''
,
// 按钮名称
activity_id
:
''
,
...
...
src/config/env.config.js
View file @
ecdb682d
...
...
@@ -17,6 +17,7 @@ const localHost = 'https://group-buy-test1.liangkebang.net'; // 测试环境页
// const talosHost = 'http://192.168.25.122:8098'; // 王永杰
// const talosHost = protocol + '//192.168.28.41'; // 超人
const
opapiHost
=
'
https://opapi-test1.liangkebang.net
'
;
const
shenceUrl
=
protocol
+
'
//bn.xyqb.com/sa?project=default
'
;
const
VCC_CHANNEL
=
''
;
const
TERMINAL
=
'
H5
'
;
const
VERSION
=
'
7.9.00
'
;
...
...
@@ -32,5 +33,6 @@ export default {
TERMINAL
,
VERSION
,
kdspHost
,
opapiHost
opapiHost
,
shenceUrl
};
src/config/prod.config.js
View file @
ecdb682d
...
...
@@ -10,6 +10,7 @@ const kdspHost = 'https://kdsp-api.q-gp.com';
const
opapiHost
=
`
${
protocol
}
//opapi.xyqb.com`
;
// const localHost = 'https://mall.q-gp.com/group-buying'; // 正式环境页面地址
const
localHost
=
'
https://group-buy-test1.liangkebang.net
'
;
// 正式环境页面地址
const
shenceUrl
=
protocol
+
'
//bn.xyqb.com/sa?project=production
'
;
export
default
{
localHost
,
// apiHost,
...
...
@@ -22,5 +23,6 @@ export default {
VERSION
,
qiniuHost
,
kdspHost
,
opapiHost
opapiHost
,
shenceUrl
};
src/main.js
View file @
ecdb682d
...
...
@@ -21,7 +21,7 @@ if (process.env.SENTRY_ENV !== 'test' && process.env.NODE_ENV === 'production')
.
install
();
}
Vue
.
prototype
.
util
=
new
Bridge
();
Vue
.
prototype
.
$track
=
saService
;
saService
.
init
(
router
);
Vue
.
use
(
lazyload
);
Vue
.
config
.
productionTip
=
false
;
...
...
src/service/sa.service.js
View file @
ecdb682d
import
Vue
from
'
vue
'
;
import
sa
from
'
sa-sdk-javascript
'
;
import
config
from
'
@/config
'
;
// +==========================
import
UiTrack
from
'
@qg/ui-track-web/src/index.js
'
;
import
router
from
'
@/router
'
;
import
{
getVccChannel
}
from
'
@/service/userInfo.service
'
;
export
const
uiTrack
=
new
UiTrack
({
globalVars
:
{
platformType
:
'
H5
'
,
parent_channel_id
:
getVccChannel
(
'
vccChannel
'
)
||
''
,
son_channel_id
:
getVccChannel
(
'
sonVccChannel
'
)
||
''
},
useUweb
:
false
,
shenceHost
:
config
.
shenceHost
,
showLog
:
config
.
test
,
router
:
router
// router实例
});
// +============+============
export
default
{
init
:
function
(
router
)
{
sa
.
init
({
server_url
:
config
.
shence
Host
,
server_url
:
config
.
shence
Url
,
heatmap
:
{
//是否开启点击图,默认 default 表示开启,自动采集 $WebClick 事件,可以设置 'not_collect' 表示关闭
//
是否开启点击图,默认 default 表示开启,自动采集 $WebClick 事件,可以设置 'not_collect' 表示关闭
clickmap
:
'
default
'
,
//
是否开启触达注意力图,默认 default 表示开启,自动采集 $WebStay 事件,可以设置 'not_collect' 表示关闭
scroll_notice_map
:
'
defaul
t
'
//
关闭触达注意力
scroll_notice_map
:
'
not_collec
t
'
},
//
判断外层是否有 App 的 SDK ,如果有的话,会往 App 的 SDK 发数据。如果没有,就正常发送数据。
use_app_track
:
true
,
show_log
:
config
.
test
,
app_js_bridge
:
true
//
TODO: app是如何判断的
// 判断外层是否有 App 的 SDK ,如果有的话,会往 App 的 SDK 发数据。如果没有,就正常发送数据。
use_app_track
:
false
,
show_log
:
config
.
env
===
'
test
'
});
// 添加公共属性
sa
.
registerPage
({
platformType
:
'
H5
'
,
uuid
:
''
,
qg_device_id
:
''
,
channel_code
:
''
,
splitStream
:
''
});
sa
.
registerPage
({
platformType
:
'
H5
'
});
router
.
afterEach
(()
=>
{
Vue
.
nextTick
(()
=>
{
sa
.
quick
(
'
autoTrackSinglePage
'
);
...
...
@@ -48,16 +27,9 @@ export default {
});
}
};
export
function
registeredEvents
(
eventName
,
eventData
,
callback
=
()
=>
{})
{
sa
.
track
(
eventName
,
eventData
,
callback
);
}
// 用户登录神策埋点
export
function
loginSa
(
uuid
=
localStorage
.
get
(
'
uuid
'
))
{
if
(
!
uuid
)
return
;
localStorage
.
set
(
'
uuid
'
,
uuid
);
sa
.
login
(
uuid
);
export
function
saTrackEvent
(
name
,
data
)
{
sa
.
track
(
name
,
data
);
}
export
function
saDeviceId
()
{
return
new
Promise
(
resolve
=>
{
sa
.
quick
(
'
isReady
'
,
function
()
{
...
...
@@ -65,3 +37,7 @@ export function saDeviceId() {
});
});
}
// 设置公共属性
export
function
setRegisterPage
(
registerPageObj
)
{
sa
.
registerPage
(
registerPageObj
);
}
src/views/goodsList/components/goodsCard.vue
View file @
ecdb682d
...
...
@@ -37,7 +37,7 @@
</dl>
</
template
>
<
script
>
import
{
registeredEvents
}
from
'
@/service/sa.service
'
;
import
{
saTrackEvent
}
from
'
@/service/sa.service
'
;
export
default
{
name
:
'
GoodsCard
'
,
props
:
{
...
...
@@ -105,7 +105,7 @@ export default {
}
=
this
.
goodsItem
;
const
{
s
}
=
this
.
btnByStatus
;
if
(
s
===
2
)
{
registeredEvents
(
'
H5_GroupZeroYuanPurchaseActivityPageOpenGroupImmediatelyBtnClick
'
,
{
saTrackEvent
(
'
H5_GroupZeroYuanPurchaseActivityPageOpenGroupImmediatelyBtnClick
'
,
{
skuNo
});
this
.
$router
.
push
({
...
...
src/views/goodsList/index.vue
View file @
ecdb682d
...
...
@@ -83,7 +83,7 @@ import { handleRemainTime, handleDateFormat } from './components/utils';
import
localStorage
from
'
@/service/localStorage.service
'
;
import
goodsCheckMixin
from
'
@/mixins/goodsCheck.mixin
'
;
import
{
setAppTitleColor
}
from
'
@/service/utils.service
'
;
import
{
registeredEvents
}
from
'
@/service/sa.service
'
;
import
{
saTrackEvent
}
from
'
@/service/sa.service
'
;
import
{
isNull
,
isWxMp
}
from
'
@/service/validation.service
'
;
import
config
from
'
@/config
'
;
let
topicIndex
;
...
...
@@ -196,7 +196,7 @@ export default {
const
activity_id
=
this
.
activityId
;
const
shareInfo
=
await
this
.
getShareData
();
this
.
$store
.
dispatch
(
'
goods_share_open
'
,
shareInfo
);
registeredEvents
(
'
H5_GroupZeroYuanPurchaseActivityPageSharePopupBtnClick
'
,
{
saTrackEvent
(
'
H5_GroupZeroYuanPurchaseActivityPageSharePopupBtnClick
'
,
{
activity_id
});
},
...
...
src/views/order/createOrder.vue
View file @
ecdb682d
...
...
@@ -116,7 +116,6 @@ export default {
if
(
addressList
)
{
this
.
handleAddressChange
(
addressList
);
}
// this.$track.registeredEvents('H5_2B_OrderConfirmPageExposure');
},
handleToAddress
()
{
if
(
this
.
orderInfo
.
addrReceiverInfo
)
{
...
...
src/views/orderList/components/List.vue
View file @
ecdb682d
...
...
@@ -98,7 +98,7 @@ import countDown from '@/components/countDown';
import
{
isWxMp
,
isApp
}
from
'
@/service/validation.service
'
;
import
Bridge
from
'
@qg/js-bridge
'
;
import
MpBridge
from
'
@/service/mp
'
;
import
{
registeredEvents
}
from
'
@/service/sa.service
'
;
import
{
saTrackEvent
}
from
'
@/service/sa.service
'
;
import
groupBuyApi
from
'
@/api/groupBuy
'
;
export
default
{
name
:
'
OrderSkuList
'
,
...
...
@@ -187,7 +187,7 @@ export default {
// this.shareInfo = skuInfo;
// this.$store.dispatch('goods_share_open');
registeredEvents
(
'
H5_MyPuzzlePageGroupOrderBtnClick
'
,
{
saTrackEvent
(
'
H5_MyPuzzlePageGroupOrderBtnClick
'
,
{
sku_no
:
''
,
leader_user_id
:
''
});
...
...
src/views/pay/extends.js
View file @
ecdb682d
import
cookies
from
'
@/service/cookieStorage.service
'
;
export
const
goUrlExtends
=
{
methods
:
{
goHome
(
payStatus
)
{
goHome
()
{
// 商城地址
if
(
payStatus
)
{
this
.
$track
?.
registeredEvents
(
'
h5_RechargeResultPageClick
'
,
{
pay_status
:
payStatus
,
buttons_name
:
'
返回首页
'
});
}
setTimeout
(()
=>
{
this
.
$router
.
replace
({
name
:
'
home
'
});
},
500
);
},
goOrderList
(
payStatus
)
{
if
(
payStatus
)
{
this
.
$track
?.
registeredEvents
(
'
h5_RechargeResultPageClick
'
,
{
pay_status
:
payStatus
,
buttons_name
:
'
查看订单
'
});
}
goOrderList
()
{
setTimeout
(()
=>
{
this
.
$router
.
replace
({
name
:
'
orderList
'
,
params
:
{
status
:
0
}
});
},
500
);
...
...
src/views/pay/index.vue
View file @
ecdb682d
...
...
@@ -227,12 +227,10 @@ export default {
// 先支付再查询信息
this
.
pay
(
this
.
payInfo
?.
paramsData
,
'
ocr
'
,
cookies
.
get
(
'
ocrflag
'
));
}
// !this.$route?.query?.ocrflag && this.$track?.registeredEvents('h5_CheckOutCouterExposure');
const
vccToken
=
localStorage
.
get
(
'
vccToken
'
);
Current_Url
=
`
${
window
.
location
.
origin
}
/payWaiting?vccToken=
${
vccToken
}
&orderNo=
${
this
.
orderNo
}
`
;
this
.
queryPayInfo
();
this
.
getCouponList
(
this
.
orderNo
);
// this.$track.registeredEvents('H5_2B_CashierPageExposure');
},
methods
:
{
/* 查询支付信息 */
...
...
@@ -404,8 +402,6 @@ export default {
buttons_name
:
this
.
accountS
.
text
};
cookies
.
set
(
'
payTrackInfo
'
,
trackParams
);
// this.$track?.registeredEvents('h5_CheckOutCounterConfirmPayClick', trackParams);
// this.$track?.registeredEvents('H5_2BCashierPageConfirmPaymentBtnClick', trackParams);
if
(
this
.
isShowProtocol
)
{
if
(
!
this
.
isCheckAgreement
)
{
this
.
$toast
(
'
请仔细阅读并同意相关协议
'
);
...
...
@@ -562,15 +558,9 @@ export default {
openCouponModal
()
{
this
.
random
=
Math
.
random
();
this
.
couponPopup
=
true
;
// this.$track?.registeredEvents('h5_CheckOutCouterCouponBannerClick');
},
/* 选取优惠券 */
handleSelectCoupon
(
id
,
selectedCoupon
)
{
// this.$track?.registeredEvents('h5_CheckOutCounterCouponPopupWindowClick', {
// coupon_type: '享花券',
// check_or_not: id ? '勾选' : '取消',
// coupon_id: id
// });
this
.
selectedCoupon
=
selectedCoupon
||
{};
this
.
getBtnStatus
(
this
.
isRiskLimit
());
this
.
couponPopup
=
false
;
...
...
src/views/pay/payWaiting.vue
View file @
ecdb682d
...
...
@@ -60,28 +60,12 @@ export default {
}
},
mounted
()
{
this
.
$track
?.
registeredEvents
(
'
h5_RechargeResultPageExposure
'
,
{
pay_status
:
'
正在支付
'
});
const
amount
=
cookies
.
get
(
'
amount
'
)
||
{};
const
payTrackInfo
=
cookies
.
get
(
'
payTrackInfo
'
)
||
{};
this
.
$track
?.
registeredEvents
(
'
H5_2BPaymentPageExposure
'
,
{
order_no
:
this
.
orderNo
,
pay_result
:
'
正在支付
'
,
vcc_state
:
payTrackInfo
.
vcc_state
,
pay_method
:
payTrackInfo
.
pay_method
,
pay_amount
:
amount
.
finalAmt
});
this
.
$dialog
({
message
:
'
请确认订单已完成支付
'
,
confirmButtonText
:
'
已完成支付
'
,
cancelButtonText
:
'
重新支付
'
,
confirmButtonColor
:
'
#EC1500
'
,
onCancel
:
()
=>
{
this
.
$track
?.
registeredEvents
(
'
h5_RechargeResultPageClick
'
,
{
pay_status
:
'
正在支付
'
,
buttons_name
:
'
重新支付
'
});
this
.
goPay
();
},
onConfirm
:
()
=>
{
...
...
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