Commit 89ae8c95 by 杨北旺

1.0.7

1 parent 28cb940d
VUE_APP_REPO=https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config
VUE_APP_PROJECR_VERSION = 10001
VUE_APP_PROJECR_ID = 10001
VUE_APP_PROJECR_SECRET = 'F50C6A9062D80107E72F6E09B5AD63DD'
\ No newline at end of file \ No newline at end of file
VUE_APP_REPO=https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config
\ No newline at end of file \ No newline at end of file
...@@ -3,11 +3,14 @@ ...@@ -3,11 +3,14 @@
VUE_APP_TITLE=广联运营平台 VUE_APP_TITLE=广联运营平台
# 网络请求公用地址 # 网络请求公用地址
#VUE_APP_API=https://wx.glsx.com.cn/rop-ddh-carlife/router #VUE_APP_API=https://wx.glsx.com.cn/rop-ddh-carlife/router
VUE_APP_API=http://scrm.test.glsx.com.cn/rop-scrm-equity/router
#VUE_APP_API=http://192.168.2.60:7226/rop-scrm-equity/router
#VUE_APP_API=http://scrm.test.glsx.com.cn/rop-scrm-equity/router #VUE_APP_API=http://scrm.test.glsx.com.cn/rop-scrm-equity/router
#VUE_APP_API=http://192.168.2.60:7226/rop-scrm-equity/router
VUE_APP_API=https://scrm.glsx.com.cn/rop-scrm-equity/router
#VUE_APP_API=http://qcwx.glsx.com.cn/rop-ddh-carlife/router #VUE_APP_API=http://qcwx.glsx.com.cn/rop-ddh-carlife/router
#VUE_APP_API=http://192.168.2.60:8086/rop-ddh-carlife/router #VUE_APP_API=http://192.168.2.60:8086/rop-ddh-carlife/router
VUE_APP_KEY=48e5e13229b82c1b4e6e8c96151f0637 #VUE_APP_KEY=48e5e13229b82c1b4e6e8c96151f0637
VUE_APP_SECRET=c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b #VUE_APP_SECRET=c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b
VUE_APP_KEY=036cc0e0fe316483238287e5721df4c3
VUE_APP_SECRET=c7290f606d6b4e9aaf6da3ad6310e883fe316483238287e5
...@@ -3,12 +3,7 @@ module.exports = { ...@@ -3,12 +3,7 @@ module.exports = {
env: { env: {
node: true node: true
}, },
globals: { globals: { wx: true },
wx: true,
'returnCitySN': true ,
'MobileDetect': true,
'track': true
},
'extends': [ 'extends': [
'plugin:vue/essential', 'plugin:vue/essential',
'eslint:recommended' 'eslint:recommended'
......
This diff could not be displayed because it is too large.
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
"dependencies": { "dependencies": {
"axios": "^0.21.0", "axios": "^0.21.0",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"js-md5": "^0.7.3",
"sha1": "^1.1.1", "sha1": "^1.1.1",
"vant": "^2.10.11", "vant": "^2.10.11",
"vconsole": "^3.4.0", "vconsole": "^3.4.0",
......
...@@ -2,48 +2,45 @@ ...@@ -2,48 +2,45 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> --> <!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=0"> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=0">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" /> <meta http-equiv="Expires" content="0" />
<meta name="referrer" content="no-referrer"> <meta name="referrer" content="no-referrer">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- 使用CDN的CSS文件 --> <!-- 使用CDN的CSS文件 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %> <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" /> <link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" />
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet" /> <link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet" />
<% } %>
<!-- 使用CDN的JS文件 预加载 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.js[i] %>" rel="preload" as="script" />
<% } %> <% } %>
<!-- 使用CDN的JS文件 预加载 --> <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %> <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.8&key=bd290dc27d0945959280753215ddda71&plugin=AMap.Geocoder"></script>
<link href="<%= htmlWebpackPlugin.options.cdn.js[i] %>" rel="preload" as="script" /> <title>权益中心</title>
<% } %>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script type="text/javascript" src="https://img01.glsx.com.cn/js/track-1.0.0.js"></script>
<script src="https://pv.sohu.com/cityjson?ie=utf-8"></script>
<script src="https://cdn.jsdelivr.net/npm/mobile-detect@1.4.4/mobile-detect.min.js"></script>
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.8&key=bd290dc27d0945959280753215ddda71&plugin=AMap.Geocoder"></script>
<title>权益中心</title>
</head> </head>
<body> <body>
<noscript> <noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
</html> </html>
<style> <style>
html,
body {
margin: 0;
padding: 0;
}
#app {
color: #333333;
}
</style>
\ No newline at end of file \ No newline at end of file
html,
body {
margin: 0;
padding: 0;
}
#app {
color: #333333;
}
</style>
<template> <template>
<div id="app"> <div id="app">
<template v-if="$route.meta.showNavBar && !isMiniprogram && showNavBar"> <template v-if="$route.meta.showNavBar && !isMiniprogram">
<div class="nav-bar"> <div class="nav-bar">
<van-nav-bar <van-nav-bar
safe-area-inset-top safe-area-inset-top
:title="$route.meta.title" :title="$route.meta.title"
left-arrow left-arrow
:fixed='true'
@click-left="onClickLeft" @click-left="onClickLeft"
/> />
</div> </div>
</template> </template>
<div>
<transition name="fade"> <transition name="fade">
<keep-alive> <keep-alive>
<router-view <router-view
v-if="$route.meta.keepAlive" v-if="$route.meta.keepAlive"
class="main-box"
:class="{'app-box': showNavBar && $route.meta.showNavBar}"
v-wechat-title="$route.meta.title" v-wechat-title="$route.meta.title"
/> />
</keep-alive> </keep-alive>
</transition> </transition>
<transition name="fade"> <transition name="fade">
<router-view <router-view
class="main-box"
:class="{'app-box': showNavBar && $route.meta.showNavBar}"
v-wechat-title="$route.meta.title" v-wechat-title="$route.meta.title"
v-if="!$route.meta.keepAlive" v-if="!$route.meta.keepAlive"
/> />
</transition> </transition>
</div>
</div> </div>
</template> </template>
<script> <script>
// import VConsole from 'vconsole' // import VConsole from 'vconsole'
export default { export default {
data() { data() {
return { return {};
isScroll: false,
pagename: "",
showNavBar: false
};
},
watch: {
// 如果路由有变化
$route(to) {
this.isScroll = false;
let name = to.name;
switch (name) {
case "common.marketing":
this.pagename = "营销页";
break;
case "equity.index":
this.pagename = "权益首页";
break;
case "commodity.recharge":
case "commodity.business":
this.pagename = "商品详情";
break;
case "oilStation.index":
this.pagename = "加油列表";
break;
case "cardRoll.customer":
this.pagename = "客服";
break;
default:
this.pagename = to.meta.title;
}
},
}, },
components: {}, components: {},
created() { created() {},
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) != 'micromessenger') {
this.showNavBar = true;
}
window.onload = function () {
let navigationStart = window.performance.timing.navigationStart.toString();
navigationStart = parseInt(navigationStart.substr(0, 10));
let domContentLoadedEventEnd =
window.performance.timing.domContentLoadedEventEnd.toString();
domContentLoadedEventEnd = parseInt(domContentLoadedEventEnd.substr(0, 10));
let logs = window.vm.trackConfig({
event: "loading_event",
properties: {
pagename: localStorage['pagename'],
enter_time: navigationStart,
leave_time: domContentLoadedEventEnd,
},
});
window.vm.track.collect(logs);
};
},
mounted() { mounted() {
// window.vConsole = new VConsole() // window.vConsole = new VConsole()
//解决ios下history.back后不刷新 //解决ios下history.back后不刷新
this.handleScroll();
var isPageHide = false; var isPageHide = false;
window.addEventListener("pageshow", function () { window.addEventListener("pageshow", function() {
if (isPageHide) { if (isPageHide) {
window.location.reload(); window.location.reload();
} }
}); });
window.addEventListener("pagehide", function () { window.addEventListener("pagehide", function() {
isPageHide = true; isPageHide = true;
}); });
}, },
methods: { methods: {},
onClickLeft() {
this.$router.go(-1)
},
handleScroll() {
window.addEventListener("scroll", () => {
if (!this.isScroll) {
let logs = window.vm.trackConfig({
event: "scroll_event",
properties: {
pagename: this.pagename,
isScroll: true,
},
});
window.vm.track.collect(logs);
this.isScroll = true;
}
});
},
},
}; };
</script> </script>
...@@ -136,31 +57,4 @@ export default { ...@@ -136,31 +57,4 @@ export default {
#app { #app {
font-size: 14px; font-size: 14px;
} }
.main-box {
width: 100%;
position: absolute;
left: 0px;
height: 100%;
overflow: scroll;
padding-bottom: 0px;
box-sizing: border-box!important;
}
.app-box {
box-sizing: border-box!important;
width: 100%;
position: absolute;
left: 0px;
overflow: scroll;
padding-bottom: 0px;
}
.app-box.main-box {
height: calc(100% - 46px);
}
.van-nav-bar {
z-index: 100;
}
.nav-bar {
height: 46px;
width: 100%;
}
</style> </style>
...@@ -47,19 +47,8 @@ service.interceptors.response.use( ...@@ -47,19 +47,8 @@ service.interceptors.response.use(
} else { } else {
const ua = navigator.userAgent.toLowerCase() const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') { if (ua.match(/MicroMessenger/i) == 'micromessenger') {
sessionStorage.setItem( sessionStorage.setItem("CODE_PAST_DUE",true);
"CODE_PAST_DUE", window.vm.$router.replace({ name: 'common.phoneLogin' })
true
);
let { sessionId } = JSON.parse(
sessionStorage.getItem("GL_EQUITY_USER_INFO")
)
? JSON.parse(sessionStorage.getItem("GL_EQUITY_USER_INFO"))
: window.vm.$store.state;
let [href] = window.location.href.split("/#/");
let url = `${href}/#/common/phoneLogin?sessionId=${sessionId}`;
window.vm.openWindows(url, "common.phoneLogin");
// window.vm.$router.replace({ name: 'common.phoneLogin' })
} else { } else {
let equipmentType = "" let equipmentType = ""
let agent = navigator.userAgent.toLowerCase() let agent = navigator.userAgent.toLowerCase()
......

1.74 MB | W: | H:

1.74 MB | W: | H:

src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -3,29 +3,7 @@ ...@@ -3,29 +3,7 @@
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
html, body {
position: absolute;
width: 100%;
height: 100%;
top: 0;
overflow: hidden;
}
body {
margin: 0;
padding: 0;
position: relative;
box-sizing: border-box;
-webkit-text-size-adjust: none;
-webkit-overflow-scrolling: touch;
-moz-user-select: none;
-o-user-select:none;
-khtml-user-select:none;
-webkit-user-select:none;
-ms-user-select:none;
user-select:none;
}
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
......
...@@ -9,87 +9,27 @@ import '@a/scss/common.scss' ...@@ -9,87 +9,27 @@ import '@a/scss/common.scss'
import store from "./store" import store from "./store"
import axios from 'axios' import axios from 'axios'
Vue.use(VueWechatTitle) Vue.use(VueWechatTitle)
import { Lazyload } from 'vant';
Vue.use(Lazyload);
Vue.use(Vant) Vue.use(Vant)
import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css'
// import VConsole from 'vconsole' // import VConsole from 'vconsole'
// const vConsole = new VConsole() // const vConsole = new VConsole()
// Vue.use(vConsole) // Vue.use(vConsole)
import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css'
Vue.use(preview) Vue.use(preview)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.isMiniprogram = window.__wxjs_environment === 'miniprogram' Vue.prototype.isMiniprogram = window.__wxjs_environment === 'miniprogram'
Vue.prototype.track = track; axios({
baseURL: process.env.VUE_APP_REPO + '/scrm-equity-mobile-config',
if (!localStorage['sessionId'] || !localStorage['expirationTime'] || (localStorage['sessionId'] && (new Date().getTime() - localStorage['expirationTime']) > 60 * 60 * 1000)) { method: 'get'
const ua = navigator.userAgent.toLowerCase(); }).then(({
let terminal; data: config
if (ua.match(/MicroMessenger/i) == 'micromessenger') { }) => {
terminal = 'h5' window.$baseConfig = config
} else { window.vm = new Vue({
if (Vue.prototype.checkPhoneType() == 'ios') { router,
terminal = 'ios' store,
} else { render: h => {
terminal = 'android' return h(App)
}
} }
let project_id = process.env.VUE_APP_PROJECR_VERSION;
let secret = process.env.VUE_APP_PROJECR_SECRET;
let client_id = '';
let user_id = '';
track.setCommonConfig({ project_id, secret, client_id, user_id })
let user = JSON.stringify({
"user_id": user_id,
"client_ip": returnCitySN.cip,
"client_id": localStorage['client_id'],
"wx_open_id": '',
"loc_city": returnCitySN.name,
"loc_province": returnCitySN.name,
"loc_country": '',
"network_carrier": '',
"device_model": '',
"brand": Vue.prototype.getDetect().brand,
"resolution": window.screen.width + '*' + window.screen.height,
"browser_version": window.navigator.appVersion,
"browser": Vue.prototype.getDetect().userAgent,
"os_name": Vue.prototype.getDetect().os_name,
"os_version": Vue.prototype.getDetect().version,
"network_type": window.navigator.connection ? window.navigator.connection.effectiveType : '',
"terminal": terminal
})
track.getSessionId('/collectdata/login', user, function() {
axios({
baseURL: process.env.VUE_APP_REPO + '/scrm-equity-mobile-config',
method: 'get'
}).then(({
data: config
}) => {
window.$baseConfig = config
window.vm = new Vue({
router,
store,
render: h => {
return h(App)
}
}).$mount('#app')
})
})
} else {
axios({
baseURL: process.env.VUE_APP_REPO + '/scrm-equity-mobile-config',
method: 'get'
}).then(({
data: config
}) => {
window.$baseConfig = config
window.vm = new Vue({
router,
store,
render: h => {
return h(App)
}
}).$mount('#app')
})
}
\ No newline at end of file \ No newline at end of file
}).$mount('#app')
})
\ No newline at end of file \ No newline at end of file
...@@ -17,23 +17,23 @@ export default { ...@@ -17,23 +17,23 @@ export default {
description: '7折起', description: '7折起',
id: 54 id: 54
}, },
{ {
name: '道路救援', name: '道路救援',
icon: 'jiuyuan', icon: 'jiuyuan',
description: '非事故免费', description: '非事故免费',
route: 'road' route: 'road'
}, },
], ],
hotelList: [{ hotelList: [{
name: '今日特惠', name: '今日特惠',
icon: 'today', icon: 'today',
description: '超性价比' description: '超性价比'
}, },
{ {
name: '景区门票', name: '景区门票',
icon: 'tickets', icon: 'tickets',
description: '全国3000+景点' description: '全国3000+景点'
} }
], ],
cateringList2: [{ cateringList2: [{
name: '肯德基', name: '肯德基',
...@@ -41,35 +41,35 @@ export default { ...@@ -41,35 +41,35 @@ export default {
description: '最高省81元', description: '最高省81元',
typeId: 23 typeId: 23
}, },
{ {
name: '麦当劳', name: '麦当劳',
icon: 'm', icon: 'm',
description: '最高省44元', description: '最高省44元',
typeId: 64 typeId: 64
}, },
{ {
name: '星巴克', name: '星巴克',
icon: 'xbk', icon: 'xbk',
description: '最高省17元', description: '最高省17元',
typeId: 21 typeId: 21
}, },
{ {
name: '瑞幸咖啡', name: '瑞幸咖啡',
icon: 'ruixing', icon: 'ruixing',
description: '最高省10元', description: '最高省10元',
typeId: 148 typeId: 148
} }
], ],
gasList: [{ gasList: [{
name: '覆盖城市', name: '覆盖城市',
icon: 'city', icon: 'city',
subIcon: '400' subIcon: '400'
}, },
{ {
name: '加油站', name: '加油站',
icon: 'gas', icon: 'gas',
subIcon: '10000' subIcon: '10000'
} }
], ],
...shopList ...shopList
} }
...@@ -98,26 +98,35 @@ export default { ...@@ -98,26 +98,35 @@ export default {
this.setNoticeInfo() this.setNoticeInfo()
}, },
CarLink(e) { CarLink(e) {
let {sessionId} = this.$store.state;
let [href] = window.location.href.split('/#/');
let url;
let supplier = e.supplier; let supplier = e.supplier;
sessionStorage.setItem('common', this.icon ? 1 : 0) sessionStorage.setItem('common',this.icon?1:0)
switch (supplier) { switch(supplier) {
case 'GL_OIL': case 'GL_OIL':
this.$router.push({ name:'oilStation.index' }) url = `${href}/#/oilStation/index?sessionId=${sessionId}`
this.openWindows(url, 'oilStation.index')
break; break;
case 'GL_ROAD_RESCUE': case 'GL_ROAD_RESCUE':
this.$router.push({ name:'equity.road'}) url = `${href}/#/equity/road`
this.openWindows(url, 'equity.road')
break; break;
case 'GL_TIRE_PROTECTION': case 'GL_TIRE_PROTECTION':
this.$router.push({ name:'equity.tyre'}) url = `${href}/#/equity/tyre`
this.openWindows(url, 'equity.tyre')
break; break;
case 'GL_ROBBERY_PROTECTION': case 'GL_ROBBERY_PROTECTION':
this.$router.push({ name:'equity.compensate'}) url = `${href}/#/equity/compensate`
this.openWindows(url, 'equity.compensate')
break; break;
case 'GL_COLLISION_REPAIR': case 'GL_COLLISION_REPAIR':
this.$router.push({ name:'equity.collision'}) url = `${href}/#/equity/collision`
this.openWindows(url, 'equity.collision')
break; break;
case 'GL_CAR_TOTAL_LOSS': case 'GL_CAR_TOTAL_LOSS':
this.$router.push({ name:'equity.loss'}) url = `${href}/#/equity/loss`
this.openWindows(url, 'equity.loss')
break; break;
case 'EDJ': case 'EDJ':
this.jumpDEJ(); this.jumpDEJ();
...@@ -125,23 +134,15 @@ export default { ...@@ -125,23 +134,15 @@ export default {
default: default:
this.showToast('即将上线,敬请期待') this.showToast('即将上线,敬请期待')
} }
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益首页",
event_name: e.equityName,
},
});
window.vm.track.collect(logs);
}, },
jumpDEJ() { jumpDEJ() {
let { sessionId } = this.$store.state; let {sessionId} = this.$store.state;
let para = { let para = {
sessionId sessionId
} }
equity.getEdjUrl(para).then(res => { equity.getEdjUrl(para).then(res => {
let { code, data, message } = res let {code, data, message} = res
if (code == 0) { if (code == 0){
this.openWindows(data) this.openWindows(data)
} else { } else {
this.showToast(message) this.showToast(message)
...@@ -149,28 +150,18 @@ export default { ...@@ -149,28 +150,18 @@ export default {
}) })
}, },
jumpLink(e) { jumpLink(e) {
this.$store.commit('setGoodsInfo', e); let { sessionId } = this.$store.state;
if (e.appearance == 1) { this.$store.commit('setGoodsInfo',e);
this.$router.push({ name:'commodity.business' }) let {brandId,supplier,brandName} = e;
} else { if(e.appearance == 1) {
this.$router.push({ name:'commodity.recharge' }) let [href] = window.location.href.split('/#/');
let url = `${href}/#/commodity/business?sessionId=${sessionId}&brandId=${brandId}&supplier=${supplier}&brandName=${brandName}`;
this.openWindows(url, 'commodity.business')
}else {
let [href] = window.location.href.split('/#/');
let url = `${href}/#/commodity/recharge?sessionId=${sessionId}&brandId=${brandId}&supplier=${supplier}&brandName=${brandName}`;
this.openWindows(url, 'commodity.recharge')
} }
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益首页",
event_name: e.equityName,
extra_data: {
equityName: e.equityName,
brandName: e.brandName,
equityDesc: e.equityDesc,
goodsCategory: e.goodsCategory,
goodsID: e.id,
goodsIcon: e.equityIcon,
}
},
});
window.vm.track.collect(logs);
}, },
getMerchantid() { getMerchantid() {
this.carServiceList = [] this.carServiceList = []
...@@ -178,8 +169,8 @@ export default { ...@@ -178,8 +169,8 @@ export default {
merchantId: this.merchantId merchantId: this.merchantId
} }
equity.getMerchantid(para).then(res => { equity.getMerchantid(para).then(res => {
let { code, data, message } = res let {code, data, message} = res
if (code == 0) { if (code == 0){
this.carServiceList = data.carServiceList this.carServiceList = data.carServiceList
this.goodsServiceList = data.goodsServiceList; this.goodsServiceList = data.goodsServiceList;
this.equityGoodsGroupDescDtos = this.goodsServiceList[0].equityGoodsGroupDescDtos; this.equityGoodsGroupDescDtos = this.goodsServiceList[0].equityGoodsGroupDescDtos;
...@@ -191,14 +182,6 @@ export default { ...@@ -191,14 +182,6 @@ export default {
changeGoods(item) { changeGoods(item) {
this.goodsTab = item; this.goodsTab = item;
this.equityGoodsGroupDescDtos = this.goodsServiceList[item].equityGoodsGroupDescDtos; this.equityGoodsGroupDescDtos = this.goodsServiceList[item].equityGoodsGroupDescDtos;
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益首页",
event_name: this.goodsServiceList[item].goodsCategory,
},
});
window.vm.track.collect(logs);
}, },
jumpMore() { jumpMore() {
equity.getCouponList({ equity.getCouponList({
......
import WxConfig from '@u/WxConfig' import WxConfig from '@u/WxConfig'
import { commodity } from "@r/api"; import {commodity} from "@r/api";
const WX = new WxConfig(['chooseWXPay']); const WX = new WxConfig(['chooseWXPay']);
export default { export default {
data() { data() {
return {} return {}
}, },
mounted() {}, mounted() {
},
methods: { methods: {
async chooseWXPay() { async chooseWXPay() {
if (this.appearance == 2 && !/^[a-zA-Z0-9]+$/.test(this.rechargeNumber)) { if (this.appearance == 2 && !/^[a-zA-Z0-9]+$/.test(this.rechargeNumber)) {
...@@ -16,28 +17,14 @@ export default { ...@@ -16,28 +17,14 @@ export default {
}, },
async orderPay() { async orderPay() {
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "商品详情",
event_name: '购买',
extra_data: {
brandName: this.selectData ? this.selectData.brandName : this.brandName,
productName: this.selectData ? this.selectData.productName : this.businessList[this.typeSno].productName,
rechargeNumber: this.rechargeNumber,
denomination: this.denomination ? this.denomination.denomination : undefined
}
}
});
window.vm.track.collect(logs);
this.showLoading(); this.showLoading();
let { sessionId } = this.$store.state; let {sessionId} = this.$store.state;
let orderCode = await commodity.getOrderCode({ let orderCode = await commodity.getOrderCode({
sessionId, sessionId,
supplier: this.supplier, supplier: this.supplier,
brandId: this.brandId brandId: this.brandId
}).then(res => { }).then(res => {
let { code, data, message } = res let {code, data, message} = res
if (code == 0) { if (code == 0) {
return data; return data;
} else { } else {
...@@ -48,7 +35,7 @@ export default { ...@@ -48,7 +35,7 @@ export default {
const ua = navigator.userAgent.toLowerCase(); const ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == 'micromessenger') { if (ua.match(/MicroMessenger/i) == 'micromessenger') {
payMannerId = 4; payMannerId = 4;
} else { }else {
payMannerId = 5; // 7 payMannerId = 5; // 7
} }
let para = { let para = {
...@@ -61,7 +48,7 @@ export default { ...@@ -61,7 +48,7 @@ export default {
} }
let payData = await commodity.payOrder(para).then(res => { let payData = await commodity.payOrder(para).then(res => {
this.hideLoading() this.hideLoading()
let { code, data, message } = res let {code, data, message} = res
if (code == 0) { if (code == 0) {
return data; return data;
} else { } else {
...@@ -69,7 +56,7 @@ export default { ...@@ -69,7 +56,7 @@ export default {
} }
}) })
if (ua.match(/MicroMessenger/i) == 'micromessenger') { if (ua.match(/MicroMessenger/i) == 'micromessenger') {
this.handlePay(payData, orderCode); this.handlePay(payData);
} else { } else {
if (this.checkPhoneType() == 'ios') { if (this.checkPhoneType() == 'ios') {
if (window["payWebOrder"] && typeof window.payWebOrder === "function") { if (window["payWebOrder"] && typeof window.payWebOrder === "function") {
...@@ -82,87 +69,40 @@ export default { ...@@ -82,87 +69,40 @@ export default {
} }
let self = this; let self = this;
window.onMessageFromPayBack = function(result) { window.onMessageFromPayBack = function(result) {
if (result == 0) { if(result == 0) {
if (self.appearance == 2) { if (self.appearance == 2) {
let productName = self.brandName + self.businessList[self.typeSno].productName + self.denomination.denomination let productName = self.brandName + self.businessList[self.typeSno].productName + self.denomination.denomination
window.vm.$router.push({ window.vm.$router.push({
name: 'commodity.process', name: 'commodity.process', query: {
query: {
rechargeNumber: self.rechargeNumber, rechargeNumber: self.rechargeNumber,
productName productName
} }
}) })
} else { } else {
window.vm.$router.push({ name: 'commodity.success', query: { price: self.selectData.salesPrice } }) window.vm.$router.push({name: 'commodity.success', query: {price:self.isOpen || !self.selectData.noMemberPrice? self.selectData.salesPrice:self.selectData.noMemberPrice}})
} }
self.payCollect(orderCode, 1); }else {
} else { window.vm.showToast(result==-1?'支付失败':'取消支付')
self.payCollect(orderCode, 0);
window.vm.showToast(result == -1 ? '支付失败' : '取消支付')
} }
} }
} }
}, },
handlePay(payData, orderCode) { handlePay(payData) {
const { timeStamp, nonceStr, packages, signType, paySign } = payData; const {timeStamp, nonceStr, packages, signType, paySign} = payData;
WX.chooseWXPay(timeStamp, nonceStr, packages, signType, paySign).then(res => { WX.chooseWXPay(timeStamp, nonceStr, packages, signType, paySign).then(res => {
if (res) { console.log(res)
this.payCollect(orderCode, 1);
} else {
this.payCollect(orderCode, 0);
}
if (this.appearance == 2) { if (this.appearance == 2) {
let productName = this.brandName + this.businessList[this.typeSno].productName + this.denomination.denomination let productName = this.brandName + this.businessList[this.typeSno].productName + this.denomination.denomination
window.vm.$router.push({ window.vm.$router.push({
name: 'commodity.process', name: 'commodity.process', query: {
query: {
rechargeNumber: this.rechargeNumber, rechargeNumber: this.rechargeNumber,
productName productName
} }
}) })
} else { } else {
window.vm.$router.replace({ name: 'commodity.success', query: { price: this.selectData.salesPrice } }) window.vm.$router.replace({name: 'commodity.success', query: {price:this.isOpen || !this.selectData.noMemberPrice? this.selectData.salesPrice:this.selectData.noMemberPrice}})
} }
}) })
},
payCollect(orderCode, status) {
let extra_data;
if (this.selectData) {
extra_data = {
brandName: this.selectData.brandName,
productName: this.selectData.productName,
goodsID: this.selectData.id,
goodsIcon: this.selectData.goodsImage,
goodsPriceLineation: this.selectData.lineationPrice,
goodsPriceSales: this.selectData.salesPrice,
goodsPrice: this.selectData.salesPrice,
goodsStock: this.selectData.stock,
orderCode,
result: status ? '成功' : '失败'
}
} else {
extra_data = {
brandName: this.brandName,
productName: this.businessList[this.typeSno].productName,
goodsID: this.denomination.id,
account: this.rechargeNumber,
denomination: this.denomination.denomination,
goodsPriceLineation: this.denomination.lineationPrice,
goodsPriceSales: this.denomination.salesPrice,
goodsPrice: this.denomination.salesPrice,
orderCode,
result: status ? '成功' : '失败'
}
}
let logs = window.vm.trackConfig({
event: "order_event",
properties: {
pagename: "商品详情",
event_name: '支付',
extra_data
}
});
window.vm.track.collect(logs);
} }
} }
}
\ No newline at end of file \ No newline at end of file
}
...@@ -6,7 +6,7 @@ import { ...@@ -6,7 +6,7 @@ import {
Notify Notify
} from 'vant' } from 'vant'
import store from '@/store' import store from '@/store'
import { common, equity } from '../api/api' import { common,equity } from '../api/api'
Vue.use(VueRouter) Vue.use(VueRouter)
const router = new VueRouter({ const router = new VueRouter({
routes, routes,
...@@ -17,35 +17,20 @@ const router = new VueRouter({ ...@@ -17,35 +17,20 @@ const router = new VueRouter({
} }
} }
}) })
let startTime = Date.parse(new Date()).toString();
startTime = parseInt(startTime.substr(0, 10));
let currentTime = null, pagename = null, currentPagename = null;
// window.onunload = function () {
// let name = localStorage['currentPagename']
// currentTime = parseInt(Date.parse(new Date()).toString().substr(0, 10));
// stayBuried(name, startTime, currentTime)
// }
// document.addEventListener("visibilitychange", function(){
// if(!document.hidden) {
// startTime = localStorage['nextPageTime']
// stayBuried(localStorage['nextPageName'], parseInt(localStorage['nextPageTime']), parseInt(Date.parse(new Date()).toString().substr(0, 10)))
// }
// });
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
routerBuried(to,from)
let { meta: { authBase } } = to let { meta: { authBase } } = to
store.commit('findPrevPath', from.name) store.commit('findPrevPath', from.name)
if (to.name != 'common.phoneLogin') store.commit('jumpPath', to.name) if (to.name != 'common.phoneLogin') store.commit('jumpPath', to.name)
const params = getParams(window.location.href); const params = getParams(window.location.href);
if (params.appId) sessionStorage.setItem('GL_WX_APPID', params.appId) if (params.appId) sessionStorage.setItem('GL_WX_APPID', params.appId)
if (params.merchantId) { if (params.merchantId){
store.commit('setMerchantId', params.merchantId) store.commit('setMerchantId',params.merchantId)
sessionStorage.setItem('GL_WX_MERCHANTID', params.merchantId) sessionStorage.setItem('GL_WX_MERCHANTID', params.merchantId)
} }
window.onMessageFromLoginBack = (type, userId, sessionId) => { window.onMessageFromLoginBack = (type, userId, sessionId) => {
console.log('onMessageFromLoginBack', type, userId, sessionId) console.log('onMessageFromLoginBack', type, userId, sessionId)
if (type == 0) { if (type == 0) {
getSessionAppId(sessionId, true); getSessionAppId(sessionId,true);
} else { } else {
store.commit('clearSessionId') store.commit('clearSessionId')
next() next()
...@@ -72,13 +57,9 @@ router.beforeEach((to, from, next) => { ...@@ -72,13 +57,9 @@ router.beforeEach((to, from, next) => {
} }
return return
} else { } else {
if(to.name == 'common.marketing' && params.sessionId) { setUserInfo(params)
getSessionAppId(params.sessionId,false,next) getSessionAppId(params.sessionId)
}else { next()
setUserInfo(params)
next()
}
} }
} }
} else { } else {
...@@ -87,158 +68,21 @@ router.beforeEach((to, from, next) => { ...@@ -87,158 +68,21 @@ router.beforeEach((to, from, next) => {
} }
}) })
//路由跳转埋点收集 const getSessionAppId = (sid,status) => {
const routerBuried = (to, from) => {
let name = from.name, currentName = to.name;
switch (name) {
case 'common.marketing':
pagename = '营销页'
break;
case 'equity.index':
pagename = '权益首页'
break;
case 'commodity.recharge':
case 'commodity.business':
pagename = '商品详情'
break;
case 'oilStation.index':
pagename = '加油列表'
break;
case 'cardRoll.customer':
pagename = '客服'
break;
default:
pagename = from.meta.title;
}
switch (currentName) {
case 'common.marketing':
currentPagename = '营销页'
break;
case 'equity.index':
currentPagename = '权益首页'
break;
case 'commodity.recharge':
case 'commodity.business':
currentPagename = '商品详情'
break;
case 'oilStation.index':
currentPagename = '加油列表'
break;
case 'cardRoll.customer':
currentPagename = '客服'
break;
default:
currentPagename = to.meta.title;
}
currentTime = parseInt(Date.parse(new Date()).toString().substr(0, 10));
localStorage.setItem('startTime', startTime)
localStorage.setItem('pagename', pagename?pagename:localStorage['currentPagename'] )
localStorage.setItem('currentPagename', currentPagename)
stayBuried(pagename?pagename:currentPagename, startTime, currentTime)
jumpBuried(currentPagename, pagename)
startTime = currentTime;
}
//停留事件
const stayBuried = (pagename, startTime, currentTime) => {
if(startTime != currentTime) {
let logs = Vue.prototype.trackConfig({
"event": 'stay_event',
"properties": {
"pagename": pagename,
"enter_time": parseInt(startTime),
"leave_time": currentTime,
}
})
Vue.prototype.track.collect(logs);
}
}
//跳转事件
const jumpBuried = (currentPagename, pagename) => {
let logs = Vue.prototype.trackConfig({
"event": 'jump_event',
"properties": {
"pagename": currentPagename,
"prevpagename": pagename,
"extra_data": {
"isVip": localStorage['isVip'],
}
}
})
Vue.prototype.track.collect(logs);
}
const loginBuried = (data) => {
/**
* 埋点登录
*/
let project_id = process.env.VUE_APP_PROJECR_VERSION;
let secret = process.env.VUE_APP_PROJECR_SECRET;
let client_id = '';
let user_id;
if (data.openid) {
user_id = data.phone
} else {
user_id = data.mobile
}
window.vm.track.setCommonConfig({ project_id, secret, client_id, user_id })
const ua = navigator.userAgent.toLowerCase();
let terminal;
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
terminal = 'h5'
} else {
if (window.vm.checkPhoneType() == 'ios') {
terminal = 'ios'
} else {
terminal = 'android'
}
}
let user = JSON.stringify({
"user_id": user_id,
"client_ip": returnCitySN.cip,
"client_id": localStorage['client_id'],
"wx_open_id": data.openid ? data.openid : '',
"loc_city": returnCitySN.name,
"loc_province": returnCitySN.name,
"loc_country": '',
"network_carrier": '',
"device_model": '',
"brand": Vue.prototype.getDetect().brand,
"resolution": window.screen.width+'*'+window.screen.height,
"browser_version": window.navigator.appVersion,
"browser": Vue.prototype.getDetect().userAgent,
"os_name": Vue.prototype.getDetect().os_name,
"os_version": Vue.prototype.getDetect().version,
"network_type": window.navigator.connection?window.navigator.connection.effectiveType:'',
"terminal": terminal
})
window.vm.track.getSessionId('/collectdata/login', user, function () {
setUserInfo(data)
})
}
const getSessionAppId = (sid, status,callback) => {
common.getAppSessionId({ sid }).then(res => { common.getAppSessionId({ sid }).then(res => {
let { code, data } = res let { code, data } = res
if (code == 0) { if (code == 0) {
/**
* app埋点登录
*/
setUserInfo(data); setUserInfo(data);
loginBuried(data) if(status) {
if (status) {
store.commit('reload'); store.commit('reload');
} else { }else {//登录后,查询会员信息,如果已经开通过了会员,就直接跳转到会员页面,不走营销也?
equity.getCardInfo().then(res => { equity.getCardInfo().then(res => {
let { code,data } = res; let { code,data } = res;
if (code == 0 && data) { if (code == 0&&data) {
localStorage.setItem('isVip',1) router.replace({name: 'equity.index'})
router.push({ name: 'equity.index' })
}else {
localStorage.setItem('isVip',0)
} }
}) })
} }
callback();
} }
}) })
} }
...@@ -249,12 +93,10 @@ const getSessionId = (redirectUrl, state) => { ...@@ -249,12 +93,10 @@ const getSessionId = (redirectUrl, state) => {
const appId = sessionStorage.getItem('GL_WX_APPID') const appId = sessionStorage.getItem('GL_WX_APPID')
common.getSessionId({ code: params.code, state, appId }).then(res => { common.getSessionId({ code: params.code, state, appId }).then(res => {
if (res) { if (res) {
let { code, data, message } = res let { code, data,message } = res
if (code == 0) { if (code == 0) {
/** setUserInfo(data)
* 埋点登录 router.push({name: 'common.phoneLogin'})
*/
loginBuried(data)
} else { } else {
Notify({ type: 'danger', message }) Notify({ type: 'danger', message })
} }
......
const pages = { const pages = {
equity: [ equity: [
{name: 'index'}, {name: 'index'},
{name: 'road', title: '道路救援',showNavBar: true}, {name: 'road', title: '道路救援'},
{name: 'tyre', title: '轮胎保障',showNavBar: true}, {name: 'tyre', title: '轮胎保障'},
{name: 'collision', title: '碰撞维修',showNavBar: true}, {name: 'collision', title: '碰撞维修'},
{name: 'compensate', title: '盗抢补偿',showNavBar: true}, {name: 'compensate', title: '盗抢补偿'},
{name: 'loss', title: '整车全损',showNavBar: true}, {name: 'loss', title: '整车全损'},
], ],
oilStation: [ oilStation: [
{name: 'index',showNavBar: true}, {name: 'index'},
{name: 'record', title: '加油记录',showNavBar: true}, {name: 'record', title: '加油记录'},
{name: 'detail', title: '加油站详情',showNavBar: true}, {name: 'detail', title: '加油站详情'},
{name: 'location', title: '选择位置',showNavBar: true}, {name: 'location', title: '加油站详情'},
], ],
common: [ common: [
{name: 'index'}, {name: 'index'},
{name: 'activate', title: '激活权益',showNavBar: true}, {name: 'activate', title: '激活权益'},
{name: 'explain', title: '常见疑问',showNavBar: true}, {name: 'explain', title: '常见疑问'},
{name: 'phoneLogin', title: '登录',wxAuth: true}, {name: 'phoneLogin', title: '登录',wxAuth: true},
{name: 'nothing'}, {name: 'nothing'},
{name: 'appTip',title: '领取结果'}, {name: 'appTip'},
{name: 'expcard',title: '体验卡领取'}, {name: 'expcard',title: '体验卡领取'},
{name: 'marketing', wxAuth: true}, {name: 'marketing', wxAuth: true},
], ],
...@@ -34,62 +34,48 @@ const pages = { ...@@ -34,62 +34,48 @@ const pages = {
cardRoll: [ cardRoll: [
{ {
name: 'index', name: 'index',
title: '我的卡券', title: '我的卡券'
showNavBar: true
}, },
{ {
name: 'detail', name: 'detail',
title: '查看卡券', title: '查看卡券'
showNavBar: true
}, },
{ {
name: 'opening', name: 'opening',
title: '开通权益', title: '开通权益'
showNavBar: true
}, },
{ {
name: 'salesDetail', name: 'salesDetail',
title: '售后详情', title: '售后详情'
showNavBar: true
}, },
{ {
name: 'waiting', name: 'waiting',
title: '等待处理', title: '等待处理'
showNavBar: true
}, },
{ {
name: 'salesApply', name: 'salesApply',
title: '申请售后', title: '申请售后'
showNavBar: true
}, },
{ {
name: 'agreement', name: 'agreement',
title: '权益服务协议', title: '权益服务协议'
showNavBar: true
}, },
{ {
name: 'customer', name: 'customer',
showNavBar: true
} }
], ],
commodity: [ commodity: [
{ {
name: 'process', name: 'process',
title: '充值流程',
showNavBar: true
}, },
{ {
name: 'recharge', name: 'recharge',
showNavBar: true
}, },
{ {
name: 'success', name: 'success',
title: '支付成功',
showNavBar: true
}, },
{ {
name: 'business', name: 'business',
showNavBar: true
}, },
], ],
device: [{ device: [{
...@@ -153,4 +139,3 @@ Object.keys(pages).map(parent => { ...@@ -153,4 +139,3 @@ Object.keys(pages).map(parent => {
}) })
}) })
export default routes export default routes
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
router.replace({ name: 'common.marketing' }) router.replace({ name: 'common.marketing' })
}, },
reload(state) { reload(state) {
console.log(state) console.log(state,'storeRelod方法,已译注');
// router.replace({ name: 'common.nothing' }) // router.replace({ name: 'common.nothing' })
// setTimeout(() => { // setTimeout(() => {
// state.lastPath?router.replace({ name: state.lastPath }):router.replace({name: 'equity.index'}) // state.lastPath?router.replace({ name: state.lastPath }):router.replace({name: 'equity.index'})
......
...@@ -108,11 +108,9 @@ class WxConfig { ...@@ -108,11 +108,9 @@ class WxConfig {
}, },
fail() { fail() {
window.vm.showToast('已取消支付') window.vm.showToast('已取消支付')
resolve()
}, },
cancel() { cancel() {
window.vm.showToast('支付失败,请重试') window.vm.showToast('支付失败,请重试')
resolve()
} }
}) })
}) })
......
...@@ -4,7 +4,7 @@ import { Toast, Dialog } from 'vant' ...@@ -4,7 +4,7 @@ import { Toast, Dialog } from 'vant'
* 日期格式化 * 日期格式化
* let time = new Date().format('yyyy-MM-dd hh:mm:ss') * let time = new Date().format('yyyy-MM-dd hh:mm:ss')
*/ */
Date.prototype.format = function (fmt) { Date.prototype.format = function(fmt) {
let o = { let o = {
'M+': this.getMonth() + 1, //月份 'M+': this.getMonth() + 1, //月份
'd+': this.getDate(), //日 'd+': this.getDate(), //日
...@@ -26,20 +26,20 @@ Date.prototype.format = function (fmt) { ...@@ -26,20 +26,20 @@ Date.prototype.format = function (fmt) {
return fmt return fmt
} }
const throttle = (fn, gapTime) => { const throttle = (fn, gapTime) => {
if (gapTime == null || gapTime == undefined) { if (gapTime == null || gapTime == undefined) {
gapTime = 1500 gapTime = 1500
} }
let _lastTime = null let _lastTime = null
return function () { return function() {
let _nowTime = +new Date() let _nowTime = +new Date()
if (_nowTime - _lastTime > gapTime || !_lastTime) { if (_nowTime - _lastTime > gapTime || !_lastTime) {
fn.apply(this, arguments) fn.apply(this, arguments)
_lastTime = _nowTime _lastTime = _nowTime
}
} }
} }
} /**防止重复点击 */
/**防止重复点击 */ // const noScroll = (e) => { e.preventDefault() }
// const noScroll = (e) => { e.preventDefault() }
const showLoading = (title = '加载中...') => { const showLoading = (title = '加载中...') => {
Toast({ Toast({
type: 'loading', type: 'loading',
...@@ -49,10 +49,10 @@ const showLoading = (title = '加载中...') => { ...@@ -49,10 +49,10 @@ const showLoading = (title = '加载中...') => {
}) })
} }
const hideLoading = () => { const hideLoading = () => {
Toast.clear() Toast.clear()
} }
/**复制 */ /**复制 */
const cloneText = (message) => { const cloneText = (message)=> {
let input = document.createElement("input"); let input = document.createElement("input");
input.value = message; input.value = message;
document.body.appendChild(input); document.body.appendChild(input);
...@@ -61,20 +61,20 @@ const cloneText = (message) => { ...@@ -61,20 +61,20 @@ const cloneText = (message) => {
document.body.removeChild(input); document.body.removeChild(input);
Toast('复制成功'); Toast('复制成功');
} }
/**num:要转换的数值,fixed:精确几位小数 */ /**num:要转换的数值,fixed:精确几位小数 */
const decimal = (num, fixed) => { const decimal = (num, fixed) => {
let pow = Math.pow(10, fixed) let pow = Math.pow(10, fixed)
return Math.round(num * pow) / pow return Math.round(num * pow) / pow
} }
const showToast = (message = '', icon) => { const showToast = (message = '', icon) => {
let params = { let params = {
message, message,
forbidClick: true forbidClick: true
}
if (icon) params.icon = icon
Toast(params)
} }
if (icon) params.icon = icon /**触摸样式 */
Toast(params)
}
/**触摸样式 */
const touchstart = e => { const touchstart = e => {
e.target.classList.add('btn-on-leave') e.target.classList.add('btn-on-leave')
} }
...@@ -126,59 +126,11 @@ const openWindows = (url, name) => { ...@@ -126,59 +126,11 @@ const openWindows = (url, name) => {
window.location.href = url window.location.href = url
} }
} else { } else {
let pagename;
switch (name) {
case 'common.marketing':
pagename = '营销页'
break;
case 'equity.index':
pagename = '权益首页'
break;
case 'commodity.recharge':
case 'commodity.business':
pagename = '商品详情'
break;
case 'oilStation.index':
pagename = '加油列表'
break;
case 'cardRoll.detail':
pagename = '查看卡卷'
break;
case 'cardRoll.index':
pagename = '我的卡卷'
break;
case 'cardRoll.opening':
pagename = '开通权益'
break;
case 'cardRoll.salesApply':
pagename = '售后详情'
break;
case 'cardRoll.agreement':
pagename = '服务协议'
break;
case 'equity.road':
pagename = '道路救援'
break;
default:
pagename = '';
}
localStorage.setItem('nextPageName', pagename)
localStorage.setItem('nextPageTime', parseInt(Date.parse(new Date()).toString().substr(0, 10)));
let params = { let params = {
needNavigator: 1, needNavigator: 1,
type: 4, type: 4,
url, url,
} }
let logs = Vue.prototype.trackConfig({
"event": 'stay_event',
"properties": {
"pagename": localStorage['currentPagename'],
"enter_time": parseInt(localStorage['startTime']),
"leave_time": parseInt(Date.parse(new Date()).toString().substr(0, 10)),
}
})
Vue.prototype.track.collect(logs);
if (checkPhoneType() == 'ios') { if (checkPhoneType() == 'ios') {
window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify(params)) window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify(params))
} else { } else {
...@@ -187,7 +139,7 @@ const openWindows = (url, name) => { ...@@ -187,7 +139,7 @@ const openWindows = (url, name) => {
} }
} }
} }
const getParams = str => { const getParams = str => {
let params = str.split('?') let params = str.split('?')
if (params.length < 2) return {} if (params.length < 2) return {}
let param = params[1].split('&') let param = params[1].split('&')
...@@ -200,34 +152,6 @@ const getParams = str => { ...@@ -200,34 +152,6 @@ const getParams = str => {
} }
return obj return obj
} }
const appHide = () => {
// const ua = navigator.userAgent.toLowerCase();
// const currentTime = parseInt(Date.parse(new Date()).toString().substr(0, 10));
// const startTime = parseInt(localStorage['startTime']);
// // if (ua.match(/MicroMessenger/i) != 'micromessenger') {
// document.addEventListener("visibilitychange", function() { //visibilityState
// if(!document.hidden) {
// let logs = Vue.prototype.trackConfig({
// "event": 'stay_event',
// "properties": {
// "pagename": localStorage['currentPagename'],
// "enter_time": startTime,
// "leave_time": currentTime,
// }
// })
// Vue.prototype.track.collect(logs);
// localStorage.setItem('aaa',9)
// }
// console.log(localStorage['currentPagename'])
// localStorage.setItem('aaa',startTime+''+parseInt(Date.parse(new Date()).toString().substr(0, 10))+new Date())
// });
// }
// document.addEventListener("visibilitychange", function(){
// if(!document.hidden) {
// localStorage.setItem('aaa',localStorage['nextPageName']+parseInt(localStorage['nextPageTime'])+''+ parseInt(Date.parse(new Date()).toString().substr(0, 10)))
// }
// });
}
const getChannel = () => { const getChannel = () => {
let source = 3 let source = 3
if (window.__wxjs_environment === 'miniprogram') { if (window.__wxjs_environment === 'miniprogram') {
...@@ -286,74 +210,6 @@ const equityLogin = () => { ...@@ -286,74 +210,6 @@ const equityLogin = () => {
}) })
} }
} }
const nowTime = () => { //获取当前时间戳秒
let time = parseInt(Date.parse(new Date()).toString().substr(0, 10));
return time;
}
const getDetect = function () {
//获取用户代理
let md = new MobileDetect(window.navigator.userAgent);
let version;
if (md.os() == 'iOS') {
version = md.version('iPhone')
} else {
version = md.version('Android')
}
let ua = navigator.userAgent.split("(")[1].split(")")[0];
let brand = "";
let phone = [/IPHONE/gi, /huawei/gi, /mi/gi, /vivo/gi, /OPPO/gi, /samsung/gi, /SONY/gi, /Nokia/gi, /HTC/gi, /ZTE/gi, /Lenovo/gi, /ZUK/gi,]
if (phone[0].test(ua)) {
brand = "iPhone";
} else if (phone[1].test(ua)) {
brand = "HUAWEI";
} else if (phone[2].test(ua)) {
brand = "小米";
} else if (phone[3].test(ua)) {
brand = "vivo";
} else if (phone[4].test(ua)) {
brand = "OPPO";
} else if (phone[5].test(ua)) {
brand = "SAMSUNG";
} else if (phone[6].test(ua)) {
brand = "SONY";
} else if (phone[7].test(ua)) {
brand = "Nokia";
} else if (phone[8].test(ua)) {
brand = "HTC";
} else if (phone[9].test(ua)) {
brand = "ZTE";
} else if (phone[10].test(ua) || phone[11].test(ua)) {
brand = "Lenovo";
} else {
brand = "Android";
}
return {
os_name: md.os(),
brand: brand,
version,
userAgent: md.userAgent()
}
}
const trackConfig = (params) => {
const ua = navigator.userAgent.toLowerCase();
let terminal;
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
terminal = 'h5'
} else {
if (checkPhoneType() == 'ios') {
terminal = 'ios'
} else {
terminal = 'android'
}
}
return Object.assign({}, params, {
"client_time": parseInt(Date.parse(new Date()).toString().substr(0, 10)),
"project_id": parseInt(process.env.VUE_APP_PROJECR_VERSION),
"project_ver": '1.0.0',
"terminal": terminal
})
}
//自定义弹框dialog //自定义弹框dialog
const myDialog = (message,confirmText,cancelText,comfirmFn,cancelFn)=>{ const myDialog = (message,confirmText,cancelText,comfirmFn,cancelFn)=>{
...@@ -397,10 +253,6 @@ const utils = { ...@@ -397,10 +253,6 @@ const utils = {
alert, alert,
cloneText, cloneText,
getParams, getParams,
trackConfig,
getDetect,
appHide,
nowTime,
myDialog myDialog
} }
......
...@@ -8,9 +8,7 @@ ...@@ -8,9 +8,7 @@
<script> <script>
export default { export default {
name: "customer", name: "customer"
mounted() {
}
} }
</script> </script>
......
...@@ -15,23 +15,23 @@ ...@@ -15,23 +15,23 @@
<div class="card-item-style" v-if="detailInfo.cardType == 5"> <div class="card-item-style" v-if="detailInfo.cardType == 5">
<div class="card-item-number"> <div class="card-item-number">
<div class="card-item-label text-hide">账号:{{detailInfo.cardPwd}}</div> <div class="card-item-label text-hide">账号:{{detailInfo.cardPwd}}</div>
<div class="btn-clone" @click="getClone(detailInfo.cardPwd,'cardPwd')">复制</div> <div class="btn-clone" @click="getClone(detailInfo.cardPwd)">复制</div>
</div> </div>
<div class="card-item-number"> <div class="card-item-number">
<div class="card-item-label text-hide">密码:{{detailInfo.cardPwd}}</div> <div class="card-item-label text-hide">密码:{{detailInfo.cardPwd}}</div>
<div class="btn-clone" @click="getClone(detailInfo.cardPwd,'cardPwd')">复制</div> <div class="btn-clone" @click="getClone(detailInfo.cardPwd)">复制</div>
</div> </div>
</div> </div>
<div class="card-item-style" v-if="detailInfo.cardType == 3"> <div class="card-item-style" v-if="detailInfo.cardType == 3">
<div class="card-item-number"> <div class="card-item-number">
<div class="card-item-label text-hide">URL:{{detailInfo.linkUrl}}</div> <div class="card-item-label text-hide">URL:{{detailInfo.linkUrl}}</div>
<div class="btn-clone" @click="getClone(detailInfo.linkUrl,'linkUrl')">复制</div> <div class="btn-clone" @click="getClone(detailInfo.linkUrl)">复制</div>
</div> </div>
</div> </div>
<div class="card-item-style" v-if="detailInfo.cardType == 4"> <div class="card-item-style" v-if="detailInfo.cardType == 4">
<div class="card-item-number"> <div class="card-item-number">
<div class="card-item-label text-hide">兑换码:{{detailInfo.cardPwd}}</div> <div class="card-item-label text-hide">兑换码:{{detailInfo.cardPwd}}</div>
<div class="btn-clone" @click="getClone(detailInfo.cardPwd,'cardPwd')">复制</div> <div class="btn-clone" @click="getClone(detailInfo.cardPwd)">复制</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -68,7 +68,13 @@ export default { ...@@ -68,7 +68,13 @@ export default {
}, },
mounted() { mounted() {
this.showLoading(); this.showLoading();
let orderCode = this.$store.state.order.orderCode; const ua = navigator.userAgent.toLowerCase();
let orderCode;
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
orderCode = this.$store.state.order.orderCode;
}else {
orderCode = this.$store.state.orderCode;
}
let para = { let para = {
orderCode orderCode
} }
...@@ -84,22 +90,9 @@ export default { ...@@ -84,22 +90,9 @@ export default {
}, },
methods: { methods: {
//复制编码 //复制编码
getClone(value,name) { getClone(value) {
this.cloneText(value) this.cloneText(value)
let logs = window.vm.trackConfig({ }
event: "click_event",
properties: {
pagename: "查看卡券",
event_name: '复制',
[name]:value,
},
});
this.collect(logs);
},
//埋点
collect(logs) {
window.vm.track.collect(logs);
},
} }
} }
</script> </script>
......
...@@ -137,14 +137,26 @@ export default { ...@@ -137,14 +137,26 @@ export default {
tabStatus, tabStatus,
reStatus, reStatus,
idx: 1, idx: 1,
isFirst: true,
cardStatus cardStatus
} }
}, },
mounted() { mounted() {
this.getCardList(); this.getCardList();
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) != 'micromessenger') {
this.reload();
}
}, },
methods: { methods: {
reload() {
let hiddenProperty ='hidden' in document ?'hidden':'webkitHidden' in document ?'webkitHidden':
'mozHidden' in document ?'mozHidden':null;
let visibilityChangeEvent = hiddenProperty.replace(/hidden/i,'visibilitychange');
let onVisibilityChange = function(){
window.location.reload()
}
document.addEventListener(visibilityChangeEvent, onVisibilityChange);
},
getCardList(e) { getCardList(e) {
let {sessionId} = this.$store.state; let {sessionId} = this.$store.state;
this.showLoading(); this.showLoading();
...@@ -165,49 +177,35 @@ export default { ...@@ -165,49 +177,35 @@ export default {
//切换tab //切换tab
tabClick(name) { tabClick(name) {
let params = {}; let params = {};
let str
switch(name) switch(name)
{ {
case 0: case 0:
params = {} params = {}
str = '全部'
break; break;
case 1: case 1:
params = { params = {
'statusList[0]': 1, 'statusList[0]': 1,
'statusList[1]': 2, 'statusList[1]': 2,
} }
str = '待收货'
break break
case 2: case 2:
params = { params = {
'statusList[0]': 3, 'statusList[0]': 3,
} }
str = '已完成'
break; break;
case 3: case 3:
params = { params = {
'statusList[0]': 5, 'statusList[0]': 5,
'statusList[1]': 6, 'statusList[1]': 6,
} }
str = '已退款'
break; break;
case 4: case 4:
params = { params = {
'statusList[0]': 4, 'statusList[0]': 4,
} }
str = '售后'
break; break;
} }
this.getCardList(params) this.getCardList(params)
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "我的卡券",
event_name: str,
},
});
this.collect(logs);
}, },
//确认收货 //确认收货
handleConfirm(val) { handleConfirm(val) {
...@@ -221,16 +219,6 @@ export default { ...@@ -221,16 +219,6 @@ export default {
sessionId: this.sessionId, sessionId: this.sessionId,
orderCode: val orderCode: val
}; };
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "我的卡券",
event_name: '确认收货',
orderCode:val,
sessionId:this.sessionId
},
});
this.collect(logs);
cardRoll.getCardConfirm(para).then(res => { cardRoll.getCardConfirm(para).then(res => {
this.hideLoading() this.hideLoading()
let { code, message } = res let { code, message } = res
...@@ -265,32 +253,19 @@ export default { ...@@ -265,32 +253,19 @@ export default {
// }, // },
//查看卡券 //查看卡券
jumpDetail(val) { jumpDetail(val) {
let { sessionId } = this.$store.state;
this.$store.commit('setOrder',val) this.$store.commit('setOrder',val)
window.vm.$router.push({ name: 'cardRoll.detail' }) let [href] = window.location.href.split('/#/');
let logs = window.vm.trackConfig({ let url = `${href}/#/cardRoll/detail?sessionId=${sessionId}&orderCode=${val.orderCode}`;
event: "click_event", this.openWindows(url, 'cardRoll.detail')
properties: {
pagename: "我的卡券",
event_name: '查看卡券',
orderCode:val.orderCode,
},
});
this.collect(logs);
}, },
jumpSales(val) { jumpSales(val) {
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "我的卡券",
event_name: '售后申请',
orderCode:val.orderCode,
orderPrices:val.orderPrices
},
});
this.collect(logs);
if(val.openRefund) { if(val.openRefund) {
let { sessionId } = this.$store.state;
this.$store.commit('setOrder',val) this.$store.commit('setOrder',val)
window.vm.$router.push({ name: 'cardRoll.salesApply' }) let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/salesApply?sessionId=${sessionId}&orderCode=${val.orderCode}&orderPrices=${val.orderPrices}`;
this.openWindows(url, 'cardRoll.salesApply')
}else { }else {
this.alert({ this.alert({
message: '该卡券无法发起售后,如有其它疑问,请联系购券页面的在线客服进行咨询!', message: '该卡券无法发起售后,如有其它疑问,请联系购券页面的在线客服进行咨询!',
...@@ -298,21 +273,11 @@ export default { ...@@ -298,21 +273,11 @@ export default {
} }
}, },
jumpSalesDetail(val) { jumpSalesDetail(val) {
let { sessionId } = this.$store.state;
this.$store.commit('setOrder',val) this.$store.commit('setOrder',val)
window.vm.$router.push({ name: 'cardRoll.salesDetail' }) let [href] = window.location.href.split('/#/');
let logs = window.vm.trackConfig({ let url = `${href}/#/cardRoll/salesDetail?sessionId=${sessionId}&orderCode=${val.orderCode}`;
event: "click_event", this.openWindows(url, 'cardRoll.salesDetail')
properties: {
pagename: "我的卡券",
event_name: '售后详情',
orderCode:val.orderCode
},
});
this.collect(logs);
},
//埋点
collect(logs) {
window.vm.track.collect(logs);
}, },
}, },
} }
......
...@@ -55,21 +55,18 @@ export default { ...@@ -55,21 +55,18 @@ export default {
} }
}, },
mounted() { mounted() {
this.appHide();
this.orderCode = this.$store.state.order.orderCode;
this.orderPrices = this.$store.state.order.orderPrices;
const ua = navigator.userAgent.toLowerCase() const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') { if (ua.match(/MicroMessenger/i) == 'micromessenger') {
this.weixinImg = true; this.weixinImg = true;
this.orderCode = this.$store.state.order.orderCode;
this.orderPrices = this.$store.state.order.orderPrices;
}else { }else {
this.weixinImg = false; this.weixinImg = false;
this.orderCode = this.$store.state.orderCode;
this.orderPrices = this.$store.state.orderPrices;
} }
}, },
methods: { methods: {
collect(logs) {
window.vm.track.collect(logs);
},
handleEditPrice() { handleEditPrice() {
this.priceDialog = true; this.priceDialog = true;
this.price2 = this.orderPrices; this.price2 = this.orderPrices;
...@@ -173,15 +170,6 @@ export default { ...@@ -173,15 +170,6 @@ export default {
if (img) { if (img) {
this.refundImg = img.data; this.refundImg = img.data;
this.showToast('上传成功') this.showToast('上传成功')
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "申请售后",
event_name: '图片上传',
image:img.data
},
});
this.collect(logs);
} else { } else {
this.showToast('上传失败') this.showToast('上传失败')
this.refundImg = ''; this.refundImg = '';
...@@ -207,15 +195,6 @@ export default { ...@@ -207,15 +195,6 @@ export default {
refundImg: this.refundImg, refundImg: this.refundImg,
sessionId sessionId
} }
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "申请售后",
event_name: '提交申请',
...para
},
});
this.collect(logs);
cardRoll.getCardRefund(para).then(res => { cardRoll.getCardRefund(para).then(res => {
this.hideLoading(); this.hideLoading();
console.log(res) console.log(res)
......
...@@ -52,7 +52,6 @@ export default { ...@@ -52,7 +52,6 @@ export default {
} }
}, },
mounted() { mounted() {
this.appHide();
const ua = navigator.userAgent.toLowerCase(); const ua = navigator.userAgent.toLowerCase();
let orderCode; let orderCode;
if (ua.match(/MicroMessenger/i) == 'micromessenger') { if (ua.match(/MicroMessenger/i) == 'micromessenger') {
......
...@@ -19,7 +19,6 @@ export default { ...@@ -19,7 +19,6 @@ export default {
} }
}, },
mounted() { mounted() {
this.appHide();
sessionStorage.setItem("need-refresh",1) sessionStorage.setItem("need-refresh",1)
}, },
methods: { methods: {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<div class="business-select-item" @click="selectBusiness(item,index)" :class="[{'checked': index == bindex,'itemWid': businessList.length<3},`select-${index}`]" v-for="(item,index) in businessList" :key="index"> <div class="business-select-item" @click="selectBusiness(item,index)" :class="[{'checked': index == bindex,'itemWid': businessList.length<3},`select-${index}`]" v-for="(item,index) in businessList" :key="index">
<van-icon name="checked" class="business-checked" v-if="index == bindex"/> <van-icon name="checked" class="business-checked" v-if="index == bindex"/>
<div class="business-select-img"> <div class="business-select-img">
<img v-lazy="item.goodsImage" alt=""> <img :src="item.goodsImage" alt="">
</div> </div>
<div class="business-select-name text-hide-2">{{ item.productName }}</div> <div class="business-select-name text-hide-2">{{ item.productName }}</div>
<div class="business-select-price1"><span>¥</span>{{ isOpen||!item.noMemberPrice?item.salesPrice:item.noMemberPrice}}</div> <div class="business-select-price1"><span>¥</span>{{ isOpen||!item.noMemberPrice?item.salesPrice:item.noMemberPrice}}</div>
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
<div class="pop-item" @click="selectBusiness(item,index)" v-for="(item,index) in businessList" :key="index"> <div class="pop-item" @click="selectBusiness(item,index)" v-for="(item,index) in businessList" :key="index">
<van-icon name="checked" class="pop-checked" v-if="index == bindex"/> <van-icon name="checked" class="pop-checked" v-if="index == bindex"/>
<div class="pop-item-img"> <div class="pop-item-img">
<img v-lazy="item.goodsImage" alt=""> <img :src="item.goodsImage" alt="">
</div> </div>
<div class="pop-item-name text-hide-2">{{ item.productName }}</div> <div class="pop-item-name text-hide-2">{{ item.productName }}</div>
<div class="pop-item-price1"><span>¥</span>{{ isOpen||!item.noMemberPrice?item.salesPrice:item.noMemberPrice}}</div> <div class="pop-item-price1"><span>¥</span>{{ isOpen||!item.noMemberPrice?item.salesPrice:item.noMemberPrice}}</div>
...@@ -101,7 +101,7 @@ export default { ...@@ -101,7 +101,7 @@ export default {
name: "business", name: "business",
data() { data() {
return { return {
isOpen: 1, isOpen: 0,
appearance: 1, appearance: 1,
businessStatus: 2, businessStatus: 2,
bindex: 0, bindex: 0,
...@@ -115,17 +115,23 @@ export default { ...@@ -115,17 +115,23 @@ export default {
}, },
status: true, status: true,
supplier: '', supplier: '',
isFirst: true,
isHaveInventory:true,//是否有库存 isHaveInventory:true,//是否有库存
} }
}, },
mounted() { mounted() {
this.appHide();
this.getCardInfo(); this.getCardInfo();
let goods = JSON.parse(sessionStorage.getItem('GL_GOODS_INFO')); const ua = navigator.userAgent.toLowerCase()
if(ua.match(/MicroMessenger/i) == 'micromessenger') {
let goods = JSON.parse(sessionStorage.getItem('GL_GOODS_INFO'));
document.title = goods.brandName document.title = goods.brandName
this.brandName = goods.brandName; this.brandName = goods.brandName;
this.supplier = goods.supplier; this.supplier = goods.supplier;
}else {
let params = this.getParams(window.location.href)
this.brandName = decodeURI(params.brandName);
this.supplier = params.supplier;
document.title = decodeURI(params.brandName)
}
this.showLoading(); this.showLoading();
let para = { let para = {
brandName: this.brandName, brandName: this.brandName,
...@@ -144,20 +150,6 @@ export default { ...@@ -144,20 +150,6 @@ export default {
}) })
}, },
methods: { methods: {
collect(logs) {
window.vm.track.collect(logs);
},
toSetTrackData(name,data){
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "商品详情",
event_name: name,
...data
},
});
this.collect(logs);
},
getCardInfo() { getCardInfo() {
equity.getCardInfo().then(res => { equity.getCardInfo().then(res => {
let { code,data } = res; let { code,data } = res;
...@@ -169,23 +161,21 @@ export default { ...@@ -169,23 +161,21 @@ export default {
}) })
}, },
getCard() { getCard() {
window.vm.$router.push({ name: 'cardRoll.index' }) let { sessionId } = this.$store.state;
this.toSetTrackData('我的卡券',{}) let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`;
this.openWindows(url, 'cardRoll.index')
}, },
jumpCustomer() { jumpCustomer() {
this.isFirst = false;
window.vm.$router.push({ name: 'cardRoll.customer' }) window.vm.$router.push({ name: 'cardRoll.customer' })
this.toSetTrackData('客服',{})
}, },
jumpOpening() { jumpOpening() {
window.vm.$router.push({ name: 'cardRoll.opening',query: {payStatus:1} }) window.vm.$router.push({ name: 'cardRoll.opening',query: {payStatus:1} })
this.setLocalStorage('whereInOpen','goods') this.setLocalStorage('whereInOpen','goods')
this.toSetTrackData('开通权益',{})
}, },
getMore() { getMore() {
this.show = true; this.show = true;
this.toSetTrackData('查看更多',{})
}, },
selectBusiness(item,index){ selectBusiness(item,index){
this.selectData = item; this.selectData = item;
...@@ -195,7 +185,6 @@ export default { ...@@ -195,7 +185,6 @@ export default {
document.querySelector('.business-select').scrollLeft = document.querySelector(`.select-${index}`).offsetLeft - 10; document.querySelector('.business-select').scrollLeft = document.querySelector(`.select-${index}`).offsetLeft - 10;
} }
this.checkInventory(item.id) this.checkInventory(item.id)
this.toSetTrackData('选择商品',item)
}, },
checkInventory(id){ checkInventory(id){
commodity.getInventory({id}).then(res=>{ commodity.getInventory({id}).then(res=>{
......
...@@ -57,7 +57,6 @@ export default { ...@@ -57,7 +57,6 @@ export default {
} }
}, },
mounted() { mounted() {
this.appHide();
this.rechargeNumber = this.$route.query.rechargeNumber; this.rechargeNumber = this.$route.query.rechargeNumber;
this.productName = this.$route.query.productName; this.productName = this.$route.query.productName;
}, },
......
...@@ -24,34 +24,22 @@ export default { ...@@ -24,34 +24,22 @@ export default {
} }
}, },
mounted() { mounted() {
this.appHide();
this.price = this.$route.query.price; this.price = this.$route.query.price;
}, },
methods: { methods: {
collect(logs) {
window.vm.track.collect(logs);
},
getAgainPay() { getAgainPay() {
window.vm.$router.go(-1) const ua = navigator.userAgent.toLowerCase()
let logs = window.vm.trackConfig({ if (ua.match(/MicroMessenger/i) == 'micromessenger') {
event: "click_event", window.vm.$router.go(-1)
properties: { }else {
pagename: "支付成功", window.vm.$router.replace({name:'equity.index'})
event_name: '重新购买' }
},
});
this.collect(logs);
}, },
getOrder() { getOrder() {
window.vm.$router.push({ name: 'cardRoll.index' }) let { sessionId } = this.$store.state;
let logs = window.vm.trackConfig({ let [href] = window.location.href.split('/#/');
event: "click_event", let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`;
properties: { this.openWindows(url, 'cardRoll.index')
pagename: "支付成功",
event_name: '查看订单'
},
});
this.collect(logs);
} }
} }
} }
......
...@@ -47,28 +47,11 @@ export default { ...@@ -47,28 +47,11 @@ export default {
}, },
methods: { methods: {
jump () { jump () {
let logs = window.vm.trackConfig({ let [href] = window.location.href.split('/#/')
event: "click_event", let url = `${href}/#/common/explain`
properties: { this.openWindows(url, 'common.explain')
pagename: "激活权益",
event_name: "常见疑问",
},
});
window.vm.track.collect(logs);
window.vm.$router.push({ name: 'common.explain' })
}, },
confirm () { confirm () {
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "激活权益",
event_name: "确定",
extra_data: {
cardNo: this.no
}
},
});
window.vm.track.collect(logs);
let { no } = this let { no } = this
if (!no) return if (!no) return
let target = 'activateBySn' let target = 'activateBySn'
...@@ -94,7 +77,16 @@ export default { ...@@ -94,7 +77,16 @@ export default {
if (window.__wxjs_environment === 'miniprogram') { if (window.__wxjs_environment === 'miniprogram') {
wx.miniProgram.navigateBack() wx.miniProgram.navigateBack()
} else { } else {
window.vm.$router.push({ name: 'equity.index' }) const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
window.vm.$router.push({ name: 'equity.index' })
} else {
if (this.checkPhoneType() == 'ios') {
window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify({ type: 1, reloadView: 'equity' }))
} else {
window.myjs.jumpNativeApp(JSON.stringify({ type: 1, reloadView: 'equity' }))
}
}
} }
}) })
} else { } else {
...@@ -108,8 +100,6 @@ export default { ...@@ -108,8 +100,6 @@ export default {
<style scoped lang='scss'> <style scoped lang='scss'>
.main { .main {
width: auto;
height: auto!important;
position: fixed; position: fixed;
top: 50%; top: 50%;
left: 50%; left: 50%;
......
...@@ -35,7 +35,6 @@ export default { ...@@ -35,7 +35,6 @@ export default {
sms: "", sms: "",
countDown: false, countDown: false,
countKey: new Date().getTime(), countKey: new Date().getTime(),
countNum: 0,
day:0 day:0
}; };
}, },
...@@ -82,57 +81,6 @@ export default { ...@@ -82,57 +81,6 @@ export default {
} }
} }
}, },
loginBuried(data) {
let project_id = process.env.VUE_APP_PROJECR_VERSION;
let secret = process.env.VUE_APP_PROJECR_SECRET;
let client_id = '';
let user_id = data.phone;
window.vm.track.setCommonConfig({ project_id, secret, client_id, user_id })
const ua = navigator.userAgent.toLowerCase();
let terminal;
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
terminal = 'h5'
} else {
if (window.vm.checkPhoneType() == 'ios') {
terminal = 'ios'
} else {
terminal = 'android'
}
}
let user = JSON.stringify({
"user_id": user_id,
"client_ip": returnCitySN.cip,
"client_id": localStorage['client_id'],
"wx_open_id": data?data.openid:'',
"loc_city": returnCitySN.name,
"loc_province": returnCitySN.name,
"loc_country": '',
"network_carrier": '',
"device_model": '',
"brand": window.vm.getDetect().brand,
"resolution": window.screen.width+'*'+window.screen.height,
"browser_version": window.navigator.appVersion,
"browser": window.vm.getDetect().userAgent,
"os_name": window.vm.getDetect().os_name,
"os_version": window.vm.getDetect().version,
"network_type": window.navigator.connection?window.navigator.connection.effectiveType:'',
"terminal": terminal
})
window.vm.track.getSessionId('/collectdata/login', user,function(){})
},
toCreateTrack(type,name,data){
let logs = window.vm.trackConfig({
event: type,
properties: {
pagename: "体验卡领取",
event_name: name,
extra_data: {
...data
}
},
});
window.vm.track.collect(logs);
},
login() { login() {
const params = this.getParams(window.location.href) const params = this.getParams(window.location.href)
const appId = sessionStorage.getItem("GL_WX_APPID") const appId = sessionStorage.getItem("GL_WX_APPID")
...@@ -143,7 +91,6 @@ export default { ...@@ -143,7 +91,6 @@ export default {
if(!this.sms){ if(!this.sms){
return return
} }
this.toCreateTrack('login','免费领取',{ mobile: this.tel, code: this.sms, count: this.countNum})
this.showLoading(); this.showLoading();
let para = { let para = {
mobile: this.tel, mobile: this.tel,
...@@ -161,7 +108,10 @@ export default { ...@@ -161,7 +108,10 @@ export default {
this.hideLoading() this.hideLoading()
this.setLocalStorage('codeAuth',false) this.setLocalStorage('codeAuth',false)
this.setLocalStorage('bindinfo',res) this.setLocalStorage('bindinfo',res)
this.loginBuried(res.data) if(res.code==-1&&res.errId==4052 || res.code==-1&&res.errId==1010 ||res.code==-1&&res.errId==10016){
this.showToast(res.message)
return
}
window.location.href = `${window.location.href.split('?')[0]}#/equity/index?pageFrom=expcard` window.location.href = `${window.location.href.split('?')[0]}#/equity/index?pageFrom=expcard`
}) })
}else{//非微信环境 }else{//非微信环境
...@@ -190,7 +140,6 @@ export default { ...@@ -190,7 +140,6 @@ export default {
if(this.countDown){ if(this.countDown){
return return
} }
this.countNum ++;
this.$store.commit( this.$store.commit(
"setVerificationCount", "setVerificationCount",
Math.round(new Date() / 1000) + 60 Math.round(new Date() / 1000) + 60
......
...@@ -38,7 +38,6 @@ export default { ...@@ -38,7 +38,6 @@ export default {
.main { .main {
padding: 20px; padding: 20px;
color: #2c2c2c; color: #2c2c2c;
window: auto;
.page { .page {
margin-bottom: 30px; margin-bottom: 30px;
.title { .title {
......
...@@ -126,14 +126,7 @@ export default { ...@@ -126,14 +126,7 @@ export default {
let [href] = window.location.href.split('/#/') let [href] = window.location.href.split('/#/')
let url = `${href}/#/cardRoll/opening?sessionId=${sessionId}` let url = `${href}/#/cardRoll/opening?sessionId=${sessionId}`
this.openWindows(url, 'cardRoll.opening'); this.openWindows(url, 'cardRoll.opening');
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益中心",
event_name:'立即领取'
},
});
this.collect(logs);
} else { } else {
this.equityLogin() this.equityLogin()
} }
...@@ -150,18 +143,7 @@ export default { ...@@ -150,18 +143,7 @@ export default {
} }
} }
} }
this.CarLink(e) this.CarLink(e)
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益中心",
event_name:e.equityName,
equityDesc:e.equityDesc,
equityIcon:e.equityIcon,
supplier:e.supplier
},
});
this.collect(logs);
}else { }else {
this.equityLogin() this.equityLogin()
} }
...@@ -179,25 +161,13 @@ export default { ...@@ -179,25 +161,13 @@ export default {
} }
} }
this.jumpLink(e) this.jumpLink(e)
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益中心",
event_name:e.brandName,
...e
},
});
this.collect(logs);
}else { }else {
this.equityLogin() this.equityLogin()
} }
}, },
willComeDialog() { willComeDialog() {
this.showToast('即将上线,敬请期待') this.showToast('即将上线,敬请期待')
}, }
collect(logs) {
window.vm.track.collect(logs);
},
} }
} }
</script> </script>
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
</div> </div>
</div> </div>
</div> </div>
<span @click="jump(1)" class="know_btn">我知道了</span> <span @click="jump" class="know_btn">我知道了</span>
</div> </div>
</template> </template>
...@@ -143,13 +143,10 @@ export default { ...@@ -143,13 +143,10 @@ export default {
}, },
methods: { methods: {
collect(logs) {
window.vm.track.collect(logs);
},
init() { init() {
//如果能够获取到这个缓存,说明已经是登录过 //如果能够获取到这个缓存,说明已经是登录过
// let isReload = this.getLocalStorage('reLoadIndex') // let isReload = this.getLocalStorage('reLoadIndex')
// console.log('时间搓',new Date().getTime());
// console.log('sessionId',isReload); // console.log('sessionId',isReload);
// if(isReload){ // if(isReload){
// this.removeLocalStorage('reLoadIndex') // this.removeLocalStorage('reLoadIndex')
...@@ -160,8 +157,18 @@ export default { ...@@ -160,8 +157,18 @@ export default {
// } // }
// }) // })
// } // }
// let urlObj = JSON.parse(sessionStorage.getItem('URL_PARAM')) // this.removeLocalStorage('showMydialog1')
// // let { sessionId, phone } = this.$store.state // let urlParam = JSON.parse(sessionStorage.getItem('URL_PARAM'))
let { sessionId} = this.$store.state
console.log('store------',this.$store.state);
if(sessionId){
equity.getCardInfo().then(res => {
let { code } = res
if (code == 0) {
this.$router.replace({ name: 'equity.index' })
}
})
}
// const ua = navigator.userAgent.toLowerCase() // const ua = navigator.userAgent.toLowerCase()
// let sid = urlObj.sessionId // let sid = urlObj.sessionId
// console.log(sid); // console.log(sid);
...@@ -210,14 +217,6 @@ export default { ...@@ -210,14 +217,6 @@ export default {
}) })
}, },
receive () { receive () {
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "首页",
event_name: "立即领取",
},
});
this.collect(logs);
let { sessionId, phone } = this.$store.state let { sessionId, phone } = this.$store.state
const ua = navigator.userAgent.toLowerCase() const ua = navigator.userAgent.toLowerCase()
if (sessionId) { if (sessionId) {
...@@ -236,7 +235,7 @@ export default { ...@@ -236,7 +235,7 @@ export default {
this.equityLogin() this.equityLogin()
} }
}, },
jump (str) { jump () {
// let { sessionId } = JSON.parse( // let { sessionId } = JSON.parse(
// sessionStorage.getItem("GL_EQUITY_USER_INFO") // sessionStorage.getItem("GL_EQUITY_USER_INFO")
// ) // )
...@@ -246,14 +245,6 @@ export default { ...@@ -246,14 +245,6 @@ export default {
// let url = `${href}/#/equity/index?sessionId=${sessionId}` // let url = `${href}/#/equity/index?sessionId=${sessionId}`
// this.openWindows(url, 'equity.index'); // this.openWindows(url, 'equity.index');
this.$router.replace({ name: 'equity.index' }) this.$router.replace({ name: 'equity.index' })
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "营销页",
event_name:str===1?'我知道了':'查看更多特权'
},
});
this.collect(logs);
} }
} }
} }
...@@ -264,7 +255,6 @@ export default { ...@@ -264,7 +255,6 @@ export default {
// } // }
.main.marketing_page{ .main.marketing_page{
width: auto;
background-color: #FEFAED; background-color: #FEFAED;
padding: 10px; padding: 10px;
color: #2c2c2c; color: #2c2c2c;
...@@ -353,7 +343,7 @@ export default { ...@@ -353,7 +343,7 @@ export default {
text-align: center; text-align: center;
font-size: 20px; font-size: 20px;
background-image: radial-gradient(86% 95%, #5E5E5E 0%, #2F2F2F 100%); background-image: radial-gradient(86% 95%, #5E5E5E 0%, #2F2F2F 100%);
margin-bottom: 10px; margin: 0 -10px -10px;
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -149,7 +149,6 @@ export default { ...@@ -149,7 +149,6 @@ export default {
tel: "", tel: "",
sms: "", sms: "",
countDown: false, countDown: false,
countNum: 0,
countKey: new Date().getTime(), countKey: new Date().getTime(),
showReSend:false showReSend:false
}; };
...@@ -245,7 +244,6 @@ export default { ...@@ -245,7 +244,6 @@ export default {
}) })
.then((res) => { .then((res) => {
if (res) { if (res) {
this.countNum++
let { code, message } = res; let { code, message } = res;
if (code != 0) { if (code != 0) {
this.showToast(message); this.showToast(message);
...@@ -280,8 +278,7 @@ export default { ...@@ -280,8 +278,7 @@ export default {
this.showToast("请填写正确的手机号"); this.showToast("请填写正确的手机号");
return; return;
} }
this.toCreateTrack('login','登录',{ mobile: tel, code: sms, count: this.countNum}) this.showLoading("登陆中...");
this.showLoading("登录中...");
common common
.smsLogin({ .smsLogin({
mobile: tel, mobile: tel,
...@@ -292,77 +289,16 @@ export default { ...@@ -292,77 +289,16 @@ export default {
if (res) { if (res) {
let { code, data, message } = res; let { code, data, message } = res;
if (code == 0) { if (code == 0) {
this.loginBuried(data) sessionStorage.setItem("GL_EQUITY_USER_INFO",JSON.stringify(data));
this.toCreateTrack('login_out_event','登录成功',data) sessionStorage.setItem("CODE_PAST_DUE",false);
sessionStorage.setItem(
"GL_EQUITY_USER_INFO",
JSON.stringify(data)
);
this.$store.commit("setUserInfo", data); this.$store.commit("setUserInfo", data);
let flag = window.location.href.indexOf('/#/') window.vm.$router.replace({ name: 'equity.index' });
if(flag!=-1){
window.location.href = `${window.location.href.split('/#/')[0]}/#/equity/index`
}else{
window.location.href = `${window.location.href.split('?')[0]}#/equity/index`
}
} else { } else {
this.toCreateTrack('login_out_event','登录失败',{message})
this.showToast(message); this.showToast(message);
} }
} }
}); });
}, },
loginBuried(data) {
let project_id = process.env.VUE_APP_PROJECR_VERSION;
let secret = process.env.VUE_APP_PROJECR_SECRET;
let client_id = '';
let user_id = data.phone;
window.vm.track.setCommonConfig({ project_id, secret, client_id, user_id })
const ua = navigator.userAgent.toLowerCase();
let terminal;
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
terminal = 'h5'
} else {
if (window.vm.checkPhoneType() == 'ios') {
terminal = 'ios'
} else {
terminal = 'android'
}
}
let user = JSON.stringify({
"user_id": user_id,
"client_ip": returnCitySN.cip,
"client_id": localStorage['client_id'],
"wx_open_id": data?data.openid:'',
"loc_city": returnCitySN.name,
"loc_province": returnCitySN.name,
"loc_country": '',
"network_carrier": '',
"device_model": '',
"brand": window.vm.getDetect().brand,
"resolution": window.screen.width+'*'+window.screen.height,
"browser_version": window.navigator.appVersion,
"browser": window.vm.getDetect().userAgent,
"os_name": window.vm.getDetect().os_name,
"os_version": window.vm.getDetect().version,
"network_type": window.navigator.connection?window.navigator.connection.effectiveType:'',
"terminal": terminal
})
window.vm.track.getSessionId('/collectdata/login', user,function(){})
},
toCreateTrack(type,name,data){
let logs = window.vm.trackConfig({
event: type,
properties: {
pagename: "登录页",
event_name: name,
extra_data: {
...data
}
},
});
window.vm.track.collect(logs);
},
jump() { jump() {
let { sessionId, phone } = JSON.parse( let { sessionId, phone } = JSON.parse(
sessionStorage.getItem("GL_EQUITY_USER_INFO") sessionStorage.getItem("GL_EQUITY_USER_INFO")
...@@ -370,6 +306,7 @@ export default { ...@@ -370,6 +306,7 @@ export default {
? JSON.parse(sessionStorage.getItem("GL_EQUITY_USER_INFO")) ? JSON.parse(sessionStorage.getItem("GL_EQUITY_USER_INFO"))
: this.$store.state; : this.$store.state;
const ua = navigator.userAgent.toLowerCase(); const ua = navigator.userAgent.toLowerCase();
console.log(sessionId);
if (sessionId) { if (sessionId) {
if (!this.isMiniprogram) { if (!this.isMiniprogram) {
if (ua.match(/MicroMessenger/i) == "micromessenger") { if (ua.match(/MicroMessenger/i) == "micromessenger") {
...@@ -379,6 +316,7 @@ export default { ...@@ -379,6 +316,7 @@ export default {
} }
} }
} }
sessionStorage.setItem("CODE_PAST_DUE",false);
this.$router.replace({ name: "equity.index" }); this.$router.replace({ name: "equity.index" });
} }
}, },
...@@ -396,7 +334,6 @@ export default { ...@@ -396,7 +334,6 @@ export default {
<style scoped lang='scss'> <style scoped lang='scss'>
.main { .main {
width: auto;
background-color: #fefaed; background-color: #fefaed;
padding: 10px; padding: 10px;
color: #2c2c2c; color: #2c2c2c;
......
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
</div> </div>
<div class="box_foot_img"></div> <div class="box_foot_img"></div>
</div> </div>
<!-- <div class="card-box"> <!-- <div class="card-box">
<div class="sprite-icon icon-banner"> <div class="sprite-icon icon-banner">
...@@ -148,6 +149,7 @@ ...@@ -148,6 +149,7 @@
</div> </div>
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { indexMixin } from "@/mixins"; import { indexMixin } from "@/mixins";
import { equity } from "@r/api.js"; import { equity } from "@r/api.js";
...@@ -194,9 +196,6 @@ export default { ...@@ -194,9 +196,6 @@ export default {
} }
}, },
methods: { methods: {
collect(logs) {
window.vm.track.collect(logs);
},
//获取分享链接 //获取分享链接
getShareInfoUrl() { getShareInfoUrl() {
const urlObj = JSON.parse(sessionStorage.getItem("URL_PARAM")); const urlObj = JSON.parse(sessionStorage.getItem("URL_PARAM"));
...@@ -253,11 +252,9 @@ export default { ...@@ -253,11 +252,9 @@ export default {
data.time = new Date(data.validitDate).format("yyyy-MM-dd"); data.time = new Date(data.validitDate).format("yyyy-MM-dd");
this.userInfo = data; this.userInfo = data;
this.ismember = true; this.ismember = true;
localStorage.setItem('isVip',1)
} else { } else {
this.ismember = false; this.ismember = false;
this.isOpen = 0; this.isOpen = 0;
localStorage.setItem('isVip',0)
} }
// 重新获取头像,避免头像拿不到 // 重新获取头像,避免头像拿不到
//app那边可能拿不到头像---写这个重新获取一下 //app那边可能拿不到头像---写这个重新获取一下
...@@ -276,16 +273,7 @@ export default { ...@@ -276,16 +273,7 @@ export default {
"续费开通", "续费开通",
"不用了", "不用了",
this.jumpOpenEquity, this.jumpOpenEquity,
() => { () => {}
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益首页",
event_name:'不用了'
},
});
this.collect(logs);
}
); );
} }
} }
...@@ -428,29 +416,17 @@ export default { ...@@ -428,29 +416,17 @@ export default {
}, },
followAccount() { followAccount() {
window.location.href = window.$baseConfig.axios.VUE_APP_WECHAT_ACCOUNT; window.location.href = window.$baseConfig.axios.VUE_APP_WECHAT_ACCOUNT;
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益首页",
event_name:'关注用户'
},
});
this.collect(logs);
}, },
jumpHotel() { jumpHotel() {
let url = "http://m.s11.cn/tehui/sz/?order_cust_id=4892038"; let url = "http://m.s11.cn/tehui/sz/?order_cust_id=4892038";
this.openWindows(url); this.openWindows(url);
}, },
jumpOrder() { jumpOrder() {
this.$router.push({ name: 'cardRoll.index'}) let { sessionId } = this.$store.state;
let logs = window.vm.trackConfig({ let [href] = window.location.href.split("/#/");
event: "click_event", let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`;
properties: { console.log(url);
pagename: "权益首页", this.openWindows(url, "cardRoll.index");
event_name:'权益订单'
},
});
this.collect(logs);
}, },
jumpOpenShop() { jumpOpenShop() {
this.openWindows("https://www.wjx.cn/m/89882107.aspx"); this.openWindows("https://www.wjx.cn/m/89882107.aspx");
...@@ -461,14 +437,6 @@ export default { ...@@ -461,14 +437,6 @@ export default {
} else { } else {
this.showToast("尚未配置活动参数"); this.showToast("尚未配置活动参数");
} }
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益首页",
event_name:'查看奖励'
},
});
this.collect(logs);
}, },
jumpInvite() { jumpInvite() {
if (this.inviteUrl) { if (this.inviteUrl) {
...@@ -476,33 +444,27 @@ export default { ...@@ -476,33 +444,27 @@ export default {
} else { } else {
this.showToast("尚未配置活动参数"); this.showToast("尚未配置活动参数");
} }
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益首页",
event_name:'分享好友'
},
});
this.collect(logs);
}, },
willComeDialog() { willComeDialog() {
this.showToast("即将上线,敬请期待"); this.showToast("即将上线,敬请期待");
}, },
jumpOpenEquity() { jumpOpenEquity() {
this.$router.push({ name: 'cardRoll.opening'}) // let { sessionId } = this.$store.state;
this.setLocalStorage('whereInOpen','index') // if(sessionId){
let logs = window.vm.trackConfig({ // window.vm.$router.push({ name: 'cardRoll.opening',query: {payStatus:1} })
event: "click_event", // }else{
properties: { // this.equityLogin();
pagename: "权益首页", // }
event_name:'开通' let { sessionId } = this.$store.state;
}, let [href] = window.location.href.split("/#/");
}); let url = `${href}/#/cardRoll/opening?sessionId=${sessionId}`;
this.collect(logs); this.openWindows(url, "cardRoll.opening");
this.setLocalStorage("whereInOpen", "index");
}, },
}, },
}; };
</script> </script>
<style lang='scss'> <style lang='scss'>
@import "@a/scss/index.scss"; @import "@a/scss/index.scss";
html, html,
...@@ -902,6 +864,7 @@ body { ...@@ -902,6 +864,7 @@ body {
} }
} }
} }
&.box_between { &.box_between {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -909,6 +872,7 @@ body { ...@@ -909,6 +872,7 @@ body {
} }
} }
} }
.tab_content { .tab_content {
padding: 10px; padding: 10px;
.icon-goods { .icon-goods {
...@@ -917,6 +881,7 @@ body { ...@@ -917,6 +881,7 @@ body {
margin-bottom: 4px; margin-bottom: 4px;
} }
} }
.content .box { .content .box {
&.equity_box { &.equity_box {
margin-bottom: 10px; margin-bottom: 10px;
...@@ -937,4 +902,4 @@ body { ...@@ -937,4 +902,4 @@ body {
} }
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</div> </div>
<div <div
class="phone btn" class="phone btn"
@click="toCall()" @click="makePhoneCall('4008060999')"
> >
<div class="sprite-icon icon-equity-phone"></div> <div class="sprite-icon icon-equity-phone"></div>
电话咨询 电话咨询
...@@ -49,18 +49,6 @@ export default { ...@@ -49,18 +49,6 @@ export default {
mounted () { mounted () {
}, },
methods: { methods: {
toCall(){
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "道路救援",
event_name:'拨打电话',
phone:'4008060999'
},
});
window.vm.track.collect(logs);
this.makePhoneCall('4008060999')
}
} }
} }
</script> </script>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="main"> <div class="main">
<div class="box" id="mapContainer"> <div class="box" id="mapContainer">
<div class="de-header"> <div class="de-header">
<img v-lazy="detailInfo.gasLogoBig" alt="" /> <img :src="detailInfo.gasLogoBig" alt="" />
</div> </div>
<div class="box-detail"> <div class="box-detail">
<div class="de-desc"> <div class="de-desc">
...@@ -87,13 +87,24 @@ export default { ...@@ -87,13 +87,24 @@ export default {
}; };
}, },
mounted() { mounted() {
let { oilId, oilNo, longitude, latitude, distance } = this.$route.query; const ua = navigator.userAgent.toLowerCase();
this.oilId = oilId; if (ua.match(/MicroMessenger/i) == "micromessenger") {
this.oilNo = oilNo; let { oilId, oilNo, longitude, latitude, distance } = this.$route.query;
this.oilSnoi = oilNo; this.oilId = oilId;
this.longitude = longitude; this.oilNo = oilNo;
this.latitude = latitude; this.oilSnoi = oilNo;
this.distance = distance; this.longitude = longitude;
this.latitude = latitude;
this.distance = distance;
} else {
let { oilId, oilNo, longitude, latitude, distance } = this.$store.state;
this.oilId = oilId;
this.oilNo = oilNo;
this.oilSnoi = oilNo;
this.longitude = longitude;
this.latitude = latitude;
this.distance = distance;
}
this.getOilDetail(); this.getOilDetail();
this.getCardInfo(); this.getCardInfo();
}, },
...@@ -103,20 +114,13 @@ export default { ...@@ -103,20 +114,13 @@ export default {
name: "cardRoll.opening", name: "cardRoll.opening",
query: { payStatus: 1 }, query: { payStatus: 1 },
}); });
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "开通权益",
},
});
this.collect(logs);
}, },
getCardInfo() { getCardInfo() {
equity.getCardInfo().then((res) => { equity.getCardInfo().then((res) => {
let { code } = res; let { code, data } = res;
if (code == 0) { if (code == 0 && data) {
this.isOpen = 1; this.isOpen = 1;
} else { } else {
this.isOpen = 0; this.isOpen = 0;
} }
...@@ -136,15 +140,12 @@ export default { ...@@ -136,15 +140,12 @@ export default {
this.detailInfo = data; this.detailInfo = data;
this.gunNos = data.gunNos; this.gunNos = data.gunNos;
this.equityOilNoDTOList = data.equityOilNoDTOList; this.equityOilNoDTOList = data.equityOilNoDTOList;
// let img = new Image();
// img.src = data.gasLogoBig;
// img.onload = ()=> {
// this.hideLoading();
// }
} else { } else {
this.showToast(message); this.showToast(message);
} }
this.hideLoading(); setTimeout(()=>{
this.hideLoading();
},1000)
}); });
}, },
openLocation(val) { openLocation(val) {
...@@ -159,21 +160,13 @@ export default { ...@@ -159,21 +160,13 @@ export default {
).then((res) => { ).then((res) => {
console.log(res); console.log(res);
}); });
}else { }else{
if (this.checkPhoneType() == 'ios') { if (this.checkPhoneType() == 'ios') {
window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify({ type: 8,address:val.gasAddress,latitude:Number(val.gasAddressLatitude),longitude:Number(val.gasAddressLongitude)})) window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify({type: 8,address:val.gasAddress,latitude:Number(val.gasAddressLatitude),longitude:Number(val.gasAddressLongitude)}))
} else { } else {
window.myjs.jumpNativeApp(JSON.stringify({ type: 8,address:val.gasAddress,latitude:Number(val.gasAddressLatitude),longitude:Number(val.gasAddressLongitude)})) window.myjs.jumpNativeApp(JSON.stringify({type: 8,address:val.gasAddress,latitude:Number(val.gasAddressLatitude),longitude:Number(val.gasAddressLongitude)}))
} }
} }
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "导航",
},
});
this.collect(logs);
}, },
changeOilSno(item) { changeOilSno(item) {
if (this.oilSnoi == item) { if (this.oilSnoi == item) {
...@@ -183,27 +176,9 @@ export default { ...@@ -183,27 +176,9 @@ export default {
this.oilNo = item; this.oilNo = item;
this.oilSuni = null; this.oilSuni = null;
this.getOilDetail(); this.getOilDetail();
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "选择油号",
oilNo: item,
},
});
this.collect(logs);
}, },
changeOilSun(item) { changeOilSun(item) {
this.oilSuni = item; this.oilSuni = item;
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "选择油枪",
oilSuni: item,
},
});
this.collect(logs);
}, },
oilPay() { oilPay() {
let { oilId } = this.$route.query; let { oilId } = this.$route.query;
...@@ -220,27 +195,6 @@ export default { ...@@ -220,27 +195,6 @@ export default {
oilNo: this.oilSnoi, oilNo: this.oilSnoi,
gunNo: this.oilSuni, gunNo: this.oilSuni,
}; };
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "下一步",
extra_data: {
gasName: this.detailInfo.gasName,
gasId: this.detailInfo.id,
gasAddress: this.detailInfo.gasAddress,
gasAddressLatitude: this.detailInfo.gasAddressLatitude,
gasAddressLongitude: this.detailInfo.gasAddressLongitude,
gasLogoBig: this.detailInfo.gasLogoBig,
priceOfficial: this.detailInfo.priceOfficial,
priceYfq: this.detailInfo.priceYfq,
priceReduced: this.detailInfo.priceReduced,
oilNo: this.oilSnoi,
gunNo: this.oilSuni,
},
},
});
this.collect(logs);
this.showLoading(); this.showLoading();
let jumpUrl; let jumpUrl;
const ua = navigator.userAgent.toLowerCase(); const ua = navigator.userAgent.toLowerCase();
...@@ -250,6 +204,7 @@ export default { ...@@ -250,6 +204,7 @@ export default {
jumpUrl = "getStationAppPayUrl"; jumpUrl = "getStationAppPayUrl";
} }
oilStation[jumpUrl](para).then((res) => { oilStation[jumpUrl](para).then((res) => {
console.log(res, "加油站");
this.hideLoading(); this.hideLoading();
let { code, data, message } = res; let { code, data, message } = res;
if (code == 0) { if (code == 0) {
...@@ -259,10 +214,6 @@ export default { ...@@ -259,10 +214,6 @@ export default {
} }
}); });
}, },
//埋点
collect(logs) {
window.vm.track.collect(logs);
},
}, },
}; };
</script> </script>
......
...@@ -74,18 +74,8 @@ export default { ...@@ -74,18 +74,8 @@ export default {
mounted() { mounted() {
this.getRecord(); this.getRecord();
this.handleLocation(); this.handleLocation();
this.listeningBack();
}, },
methods: { methods: {
listeningBack() {
const path = window.vm.$store.state.prevPath;
window.onpopstate = null;
window.onpopstate = function () {
window.onpopstate = null;
history.pushState({}, null, window.location.href);
window.vm.$router.replace({ name: "oilStation.index" });
};
},
getRecord() { getRecord() {
oilStation.getStationSearchList().then(res => { oilStation.getStationSearchList().then(res => {
this.hideLoading() this.hideLoading()
...@@ -98,14 +88,6 @@ export default { ...@@ -98,14 +88,6 @@ export default {
}) })
}, },
clearEmpty() { clearEmpty() {
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "清空搜索记录",
},
});
this.collect(logs);
oilStation.getStationSearchDeleteAll().then(res => { oilStation.getStationSearchDeleteAll().then(res => {
this.hideLoading() this.hideLoading()
let { code, message } = res let { code, message } = res
...@@ -120,15 +102,6 @@ export default { ...@@ -120,15 +102,6 @@ export default {
let para = { let para = {
id: index id: index
} }
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "删除历史记录",
id:index
},
});
this.collect(logs);
oilStation.getStationSearchDelete(para).then(res => { oilStation.getStationSearchDelete(para).then(res => {
this.hideLoading() this.hideLoading()
let { code, message } = res let { code, message } = res
...@@ -147,14 +120,6 @@ export default { ...@@ -147,14 +120,6 @@ export default {
}else { }else {
this.getMapLocation(); this.getMapLocation();
} }
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "重新定位",
},
});
this.collect(logs);
}, },
getMapLocation() { getMapLocation() {
let self = this; let self = this;
...@@ -209,53 +174,17 @@ export default { ...@@ -209,53 +174,17 @@ export default {
}, },
onCancel() { onCancel() {
this.localStatus = true; this.localStatus = true;
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "取消搜索",
search:this.input
},
});
this.collect(logs);
}, },
onSearch(){ onSearch(){
this.localStatus = false; this.localStatus = false;
this.$refs.maps.onSearch(); this.$refs.maps.onSearch();
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "搜索",
search:this.input
},
});
this.collect(logs);
}, },
selectItem(val) { selectItem(val) {
this.$store.commit('setAddress',val) this.$store.commit('setAddress',val)
window.vm.$router.replace({ path: '/oilStation/index'}) window.vm.$router.push({ path: '/oilStation/index'})
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "选择地址",
address:val
},
});
this.collect(logs);
}, },
selectAddress() { selectAddress() {
window.vm.$router.replace({ path: '/oilStation/index'}) window.vm.$router.push({ path: '/oilStation/index'})
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "当前定位",
address:this.addressInfo.address
},
});
this.collect(logs);
}, },
selectLocation(value) { selectLocation(value) {
let para = { let para = {
...@@ -263,30 +192,17 @@ export default { ...@@ -263,30 +192,17 @@ export default {
longitude: value.location.lng, longitude: value.location.lng,
latitude: value.location.lat, latitude: value.location.lat,
} }
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "选择地点",
...para
},
});
this.collect(logs);
oilStation.getStationSearchInsert(para).then(res => { oilStation.getStationSearchInsert(para).then(res => {
this.hideLoading() this.hideLoading()
let { code, message } = res let { code, message } = res
if (code == 0) { if (code == 0) {
this.$store.commit('setAddress',para) this.$store.commit('setAddress',para)
window.vm.$router.replace({ path: '/oilStation/index'}) window.vm.$router.push({ path: '/oilStation/index'})
} else { } else {
this.showToast(message) this.showToast(message)
} }
}) })
}, }
//埋点
collect(logs) {
window.vm.track.collect(logs);
},
} }
} }
</script> </script>
......
...@@ -26,7 +26,7 @@ const CDN = { ...@@ -26,7 +26,7 @@ const CDN = {
'https://cdn.jsdelivr.net/npm/vant@2.12/lib/vant.min.js' 'https://cdn.jsdelivr.net/npm/vant@2.12/lib/vant.min.js'
] ]
} }
const publicPath = '/scrm-equity-h5/' const publicPath = '/scrm-equity/'
module.exports = { module.exports = {
// publicPath, // publicPath,
devServer: { devServer: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!