Commit 664a0fd4 by ym

buried

1 parent c8b77e3f
...@@ -13,3 +13,6 @@ VUE_APP_KEY=48e5e13229b82c1b4e6e8c96151f0637 ...@@ -13,3 +13,6 @@ VUE_APP_KEY=48e5e13229b82c1b4e6e8c96151f0637
VUE_APP_SECRET=c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b VUE_APP_SECRET=c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b
#深圳广联公众号 #深圳广联公众号
VUE_APP_WECHAT_ACCOUNT=https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MjM5NzY4MTIzNw==#wechat_redirect VUE_APP_WECHAT_ACCOUNT=https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MjM5NzY4MTIzNw==#wechat_redirect
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
...@@ -3,7 +3,10 @@ module.exports = { ...@@ -3,7 +3,10 @@ module.exports = {
env: { env: {
node: true node: true
}, },
globals: { wx: true }, globals: {
wx: true,
'returnCitySN': true
},
'extends': [ 'extends': [
'plugin:vue/essential', 'plugin:vue/essential',
'eslint:recommended' 'eslint:recommended'
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
"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",
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<link href="<%= htmlWebpackPlugin.options.cdn.js[i] %>" rel="preload" as="script" /> <link href="<%= htmlWebpackPlugin.options.cdn.js[i] %>" rel="preload" as="script" />
<% } %> <% } %>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script> <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.8&key=bd290dc27d0945959280753215ddda71&plugin=AMap.Geocoder"></script> <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.8&key=bd290dc27d0945959280753215ddda71&plugin=AMap.Geocoder"></script>
<title>权益中心</title> <title>权益中心</title>
</head> </head>
......
...@@ -30,26 +30,93 @@ ...@@ -30,26 +30,93 @@
// import VConsole from 'vconsole' // import VConsole from 'vconsole'
export default { export default {
data() { data() {
return {}; return {
isScroll: false,
pagename: "",
};
},
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":
this.pagename = "直充详情";
break;
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() {
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: this.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: {
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>
......
...@@ -2,6 +2,7 @@ import Vue from 'vue' ...@@ -2,6 +2,7 @@ import Vue from 'vue'
import App from './App.vue' import App from './App.vue'
import router from './router' import router from './router'
import '@u/util' import '@u/util'
import track from '@u/track'
import Vant from 'vant' import Vant from 'vant'
import 'vant/lib/index.css' import 'vant/lib/index.css'
import VueWechatTitle from 'vue-wechat-title' import VueWechatTitle from 'vue-wechat-title'
...@@ -11,11 +12,49 @@ Vue.use(VueWechatTitle) ...@@ -11,11 +12,49 @@ Vue.use(VueWechatTitle)
Vue.use(Vant) Vue.use(Vant)
import preview from 'vue-photo-preview' import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css' import 'vue-photo-preview/dist/skin.css'
import VConsole from 'vconsole'
const vConsole = new VConsole()
Vue.use(vConsole)
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'
window.vm = new Vue({ Vue.prototype.track = track;
console.log(localStorage['sessionId'])
if(localStorage['sessionId']) {
window.vm = new Vue({
router, router,
store, store,
render: h => h(App) render: h => h(App)
}).$mount('#app') }).$mount('#app')
}else {
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": client_id,
"wx_open_id": client_id,
"loc_city": returnCitySN.name,
"loc_province": returnCitySN.name,
"loc_country": '',
"network_carrier": '',
"device_model": '',
"brand": '',
"resolution": '',
"browser_version": window.navigator.appVersion,
"browser": window.navigator.appName,
"os_name": window.navigator.userAgent,
"os_version": window.navigator.platform,
"network_type": window.navigator.connection?window.navigator.connection.effectiveType:'',
})
track.getSessionId('/collectdata/login', user, function () {
window.vm = new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
})
}
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() {
...@@ -18,13 +18,13 @@ export default { ...@@ -18,13 +18,13 @@ export default {
}, },
async orderPay() { async orderPay() {
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 {
...@@ -35,7 +35,7 @@ export default { ...@@ -35,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 = 7; // 5 payMannerId = 7; // 5
} }
let para = { let para = {
...@@ -48,13 +48,48 @@ export default { ...@@ -48,13 +48,48 @@ 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 {
this.showToast(message) this.showToast(message)
} }
}) })
let extra_data;
if(this.selectData) {
extra_data = {
goodsName: this.selectData.brandName,
goodsDesc: 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.productName,
orderCode
}
}else {
extra_data = {
goodsName: this.brandName,
goodsDesc: this.denominationList.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
}
}
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "商品详情",
event_name: 'click_event',
extra_data
}
});
window.vm.track.collect(logs);
if (ua.match(/MicroMessenger/i) == 'micromessenger') { if (ua.match(/MicroMessenger/i) == 'micromessenger') {
this.handlePay(payData); this.handlePay(payData);
} else { } else {
...@@ -68,8 +103,8 @@ export default { ...@@ -68,8 +103,8 @@ export default {
window.myjs.payWebOrder("wxpay", JSON.stringify(payData)); window.myjs.payWebOrder("wxpay", JSON.stringify(payData));
} }
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({
...@@ -79,16 +114,16 @@ export default { ...@@ -79,16 +114,16 @@ export default {
} }
}) })
} else { } else {
window.vm.$router.push({name: 'commodity.success', query: {price: self.selectData.salesPrice}}) window.vm.$router.push({ name: 'commodity.success', query: { price: self.selectData.salesPrice } })
} }
}else { } else {
window.vm.showToast(result==-1?'支付失败':'取消支付') window.vm.showToast(result == -1 ? '支付失败' : '取消支付')
} }
} }
} }
}, },
handlePay(payData) { 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 => {
console.log(res) console.log(res)
if (this.appearance == 2) { if (this.appearance == 2) {
...@@ -100,7 +135,7 @@ export default { ...@@ -100,7 +135,7 @@ export default {
} }
}) })
} else { } else {
window.vm.$router.replace({name: 'commodity.success', query: {price: this.selectData.salesPrice}}) window.vm.$router.replace({ name: 'commodity.success', query: { price: this.selectData.salesPrice } })
} }
}) })
} }
......
...@@ -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,26 +17,88 @@ const router = new VueRouter({ ...@@ -17,26 +17,88 @@ const router = new VueRouter({
} }
} }
}) })
let startTime = Date.parse(new Date()).toString();
startTime = parseInt(startTime.substr(0, 10));
let currentTime,pagename,currentPagename;
window.onunload = function() {
currentTime = parseInt(Date.parse(new Date()).toString().substr(0, 10));
stayBuried(pagename,startTime,currentTime)
}
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
if (to) {
let name = from.name,currentName = to.name;
switch(name)
{
case 'common.marketing':
pagename = '营销页'
break;
case 'equity.index':
pagename = '权益首页'
break;
case 'commodity.recharge':
pagename = '直充详情'
break;
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':
case 'common.index':
currentPagename = '权益首页'
break;
case 'commodity.recharge':
currentPagename = '直充详情'
break;
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));
stayBuried(pagename,startTime,currentTime)
jumpBuried(currentPagename,pagename)
startTime = currentTime
}
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()
} }
return return
} }
if (to.matched.some(recode => recode.meta.wxAuth)) { if (to.matched.some(recode => recode.meta.wxAuth)) {
const ua = navigator.userAgent.toLowerCase() const ua = navigator.userAgent.toLowerCase()
if (window.__wxjs_environment === 'miniprogram') { if (window.__wxjs_environment === 'miniprogram') {
...@@ -65,18 +127,85 @@ router.beforeEach((to, from, next) => { ...@@ -65,18 +127,85 @@ router.beforeEach((to, from, next) => {
} }
}) })
const getSessionAppId = (sid,status) => { //停留事件
const stayBuried = (pagename,startTime,currentTime)=> {
let logs = Vue.prototype.trackConfig({
"event": 'stay_event',
"properties": {
"pagename": pagename,
"enter_time": 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.nickName) {
client_id = data.nickName
user_id = data.nickName
}else {
client_id = data.openid;
user_id = data.phone;
}
window.vm.track.setCommonConfig({ project_id, secret, client_id, user_id })
let user = JSON.stringify({
"user_id": user_id,
"client_ip": returnCitySN.cip,
"client_id": client_id,
"wx_open_id": client_id,
"loc_city": returnCitySN.name,
"loc_province": returnCitySN.name,
"loc_country": '',
"network_carrier": '',
"device_model": '',
"brand": '',
"resolution": '',
"browser_version": window.navigator.appVersion,
"browser": window.navigator.appName,
"os_name": window.navigator.userAgent,
"os_version": window.navigator.platform,
"network_type": window.navigator.connection?window.navigator.connection.effectiveType:'',
})
window.vm.track.getSessionId('/collectdata/login', user,function() {
setUserInfo(data)
})
}
const getSessionAppId = (sid, status,user) => {
common.getAppSessionId({ sid }).then(res => { common.getAppSessionId({ sid }).then(res => {
let { code, data } = res let { code, data } = res
if (code == 0) { if (code == 0) {
setUserInfo(data); /**
if(status) { * app埋点登录
*/
loginBuried(data,user)
if (status) {
store.commit('reload'); store.commit('reload');
}else { } else {
equity.getCardInfo().then(res => { equity.getCardInfo().then(res => {
let { code } = res; let { code } = res;
if (code == 0) { if (code == 0) {
router.push({name: 'equity.index'}) router.push({ name: 'equity.index' })
} }
}) })
} }
...@@ -90,9 +219,12 @@ const getSessionId = (redirectUrl, state) => { ...@@ -90,9 +219,12 @@ 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) /**
* 埋点登录
*/
loginBuried(data)
} else { } else {
Notify({ type: 'danger', message }) Notify({ type: 'danger', message })
} }
......
...@@ -11,7 +11,7 @@ const pages = { ...@@ -11,7 +11,7 @@ const pages = {
{name: 'index'}, {name: 'index'},
{name: 'record', title: '加油记录'}, {name: 'record', title: '加油记录'},
{name: 'detail', title: '加油站详情'}, {name: 'detail', title: '加油站详情'},
{name: 'location', title: '加油站详情'}, {name: 'location', title: '选择位置'},
], ],
common: [ common: [
{name: 'index'}, {name: 'index'},
...@@ -65,12 +65,14 @@ const pages = { ...@@ -65,12 +65,14 @@ const pages = {
commodity: [ commodity: [
{ {
name: 'process', name: 'process',
title: '充值流程'
}, },
{ {
name: 'recharge', name: 'recharge',
}, },
{ {
name: 'success', name: 'success',
title: '支付成功'
}, },
{ {
name: 'business', name: 'business',
......
...@@ -210,6 +210,30 @@ const equityLogin = () => { ...@@ -210,6 +210,30 @@ const equityLogin = () => {
}) })
} }
} }
const nowTime = () => { //获取当前时间戳秒
let time = parseInt(Date.parse(new Date()).toString().substr(0,10));
return time;
}
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
})
}
const utils = { const utils = {
removeLocalStorage, removeLocalStorage,
setLocalStorage, setLocalStorage,
...@@ -229,7 +253,9 @@ const utils = { ...@@ -229,7 +253,9 @@ const utils = {
dialog, dialog,
alert, alert,
cloneText, cloneText,
getParams getParams,
trackConfig,
nowTime
} }
Object.keys(utils).map(key => { Object.keys(utils).map(key => {
......
...@@ -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)">复制</div> <div class="btn-clone" @click="getClone(detailInfo.cardPwd,'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)">复制</div> <div class="btn-clone" @click="getClone(detailInfo.cardPwd,'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)">复制</div> <div class="btn-clone" @click="getClone(detailInfo.linkUrl,'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)">复制</div> <div class="btn-clone" @click="getClone(detailInfo.cardPwd,'cardPwd')">复制</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -90,9 +90,22 @@ export default { ...@@ -90,9 +90,22 @@ export default {
}, },
methods: { methods: {
//复制编码 //复制编码
getClone(value) { getClone(value,name) {
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>
......
...@@ -177,35 +177,49 @@ export default { ...@@ -177,35 +177,49 @@ 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) {
...@@ -219,6 +233,16 @@ export default { ...@@ -219,6 +233,16 @@ 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
...@@ -258,8 +282,27 @@ export default { ...@@ -258,8 +282,27 @@ export default {
let [href] = window.location.href.split('/#/'); let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/detail?sessionId=${sessionId}&orderCode=${val.orderCode}`; let url = `${href}/#/cardRoll/detail?sessionId=${sessionId}&orderCode=${val.orderCode}`;
this.openWindows(url, 'cardRoll.detail') this.openWindows(url, 'cardRoll.detail')
let logs = window.vm.trackConfig({
event: "click_event",
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; let { sessionId } = this.$store.state;
this.$store.commit('setOrder',val) this.$store.commit('setOrder',val)
...@@ -278,6 +321,19 @@ export default { ...@@ -278,6 +321,19 @@ export default {
let [href] = window.location.href.split('/#/'); let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/salesDetail?sessionId=${sessionId}&orderCode=${val.orderCode}`; let url = `${href}/#/cardRoll/salesDetail?sessionId=${sessionId}&orderCode=${val.orderCode}`;
this.openWindows(url, 'cardRoll.salesDetail') this.openWindows(url, 'cardRoll.salesDetail')
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "我的卡券",
event_name: '售后详情',
orderCode:val.orderCode
},
});
this.collect(logs);
},
//埋点
collect(logs) {
window.vm.track.collect(logs);
}, },
}, },
} }
......
...@@ -91,8 +91,20 @@ export default { ...@@ -91,8 +91,20 @@ export default {
}) })
}, },
methods: { methods: {
//埋点
collect(logs) {
window.vm.track.collect(logs);
},
jumpOpen() { jumpOpen() {
window.vm.$router.push({ name: 'common.activate' }); window.vm.$router.push({ name: 'common.activate' });
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "开通权益",
event_name: '兑换权益卡',
},
});
this.collect(logs);
}, },
async buyCard() { async buyCard() {
this.showLoading(); this.showLoading();
...@@ -110,6 +122,15 @@ export default { ...@@ -110,6 +122,15 @@ export default {
orderSource: 3, orderSource: 3,
sessionId: this.sessionId, sessionId: this.sessionId,
} }
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "开通权益",
event_name: '立即开通',
...para
},
});
this.collect(logs);
let payData = await cardRoll.getCardBuy(para).then(res => { let payData = await cardRoll.getCardBuy(para).then(res => {
this.hideLoading() this.hideLoading()
let { code, data, message } = res let { code, data, message } = res
...@@ -165,6 +186,14 @@ export default { ...@@ -165,6 +186,14 @@ export default {
let [href] = window.location.href.split('/#/'); let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/agreement?sessionId=${sessionId}`; let url = `${href}/#/cardRoll/agreement?sessionId=${sessionId}`;
this.openWindows(url, 'cardRoll.agreement') this.openWindows(url, 'cardRoll.agreement')
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "开通权益",
event_name: '服务协议'
},
});
this.collect(logs);
} }
}, },
beforeDestroy() { beforeDestroy() {
......
...@@ -67,6 +67,9 @@ export default { ...@@ -67,6 +67,9 @@ export default {
} }
}, },
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;
...@@ -170,6 +173,15 @@ export default { ...@@ -170,6 +173,15 @@ 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 = '';
...@@ -195,6 +207,15 @@ export default { ...@@ -195,6 +207,15 @@ 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)
......
...@@ -107,7 +107,7 @@ export default { ...@@ -107,7 +107,7 @@ export default {
}, },
status: true, status: true,
brandId: '', brandName: '',
supplier: '' supplier: ''
} }
}, },
...@@ -117,17 +117,17 @@ export default { ...@@ -117,17 +117,17 @@ export default {
if(ua.match(/MicroMessenger/i) == 'micromessenger') { if(ua.match(/MicroMessenger/i) == 'micromessenger') {
let goods = JSON.parse(sessionStorage.getItem('GL_GOODS_INFO')); let goods = JSON.parse(sessionStorage.getItem('GL_GOODS_INFO'));
document.title = goods.brandName document.title = goods.brandName
this.brandId = goods.brandId; this.brandName = goods.brandName;
this.supplier = goods.supplier; this.supplier = goods.supplier;
}else { }else {
let params = this.getParams(window.location.href) let params = this.getParams(window.location.href)
this.brandId = params.brandId; this.brandName = decodeURI(params.brandName);
this.supplier = params.supplier; this.supplier = params.supplier;
document.title = decodeURI(params.brandName) document.title = decodeURI(params.brandName)
} }
this.showLoading(); this.showLoading();
let para = { let para = {
brandId: this.brandId, brandName: this.brandName,
supplier: this.supplier supplier: this.supplier
} }
commodity.getCouponDetail(para).then(res => { commodity.getCouponDetail(para).then(res => {
...@@ -142,6 +142,20 @@ export default { ...@@ -142,6 +142,20 @@ 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 } = res; let { code } = res;
...@@ -157,16 +171,19 @@ export default { ...@@ -157,16 +171,19 @@ export default {
let [href] = window.location.href.split('/#/'); let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`; let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`;
this.openWindows(url, 'cardRoll.index') this.openWindows(url, 'cardRoll.index')
this.toSetTrackData('我的卡券',{})
}, },
jumpCustomer() { jumpCustomer() {
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.toSetTrackData('开通权益',{})
}, },
getMore() { getMore() {
this.show = true; this.show = true;
this.toSetTrackData('查看更多',{})
}, },
selectBusiness(item,index){ selectBusiness(item,index){
this.selectData = item; this.selectData = item;
...@@ -175,6 +192,7 @@ export default { ...@@ -175,6 +192,7 @@ export default {
if(this.businessList.length>3) { if(this.businessList.length>3) {
document.querySelector('.business-select').scrollLeft = document.querySelector(`.select-${index}`).offsetLeft - 10; document.querySelector('.business-select').scrollLeft = document.querySelector(`.select-${index}`).offsetLeft - 10;
} }
this.toSetTrackData('选择商品',item)
}, },
} }
} }
......
...@@ -71,31 +71,28 @@ export default { ...@@ -71,31 +71,28 @@ export default {
reType: [], reType: [],
typeSno: 0, typeSno: 0,
amountSno: 0, amountSno: 0,
brandId: '',
supplier: '' supplier: ''
} }
}, },
mounted() { mounted() {
this.getCardInfo(); this.getCardInfo();
const ua = navigator.userAgent.toLowerCase() const ua = navigator.userAgent.toLowerCase()
if(ua.match(/MicroMessenger/i) == 'micromessenger') { if (ua.match(/MicroMessenger/i) == "micromessenger") {
let goods = JSON.parse(sessionStorage.getItem('GL_GOODS_INFO')); let goods = JSON.parse(sessionStorage.getItem("GL_GOODS_INFO"));
this.brandName = goods.brandName; this.brandName = goods.brandName;
document.title = this.brandName; document.title = this.brandName;
this.brandId = goods.brandId;
this.supplier = goods.supplier; this.supplier = goods.supplier;
}else { } else {
let params = this.getParams(window.location.href) let params = this.getParams(window.location.href);
this.brandId = params.brandId;
this.supplier = params.supplier; this.supplier = params.supplier;
this.brandName = decodeURI(params.brandName); this.brandName = decodeURI(params.brandName);
document.title = decodeURI(params.brandName); document.title = decodeURI(params.brandName);
} }
this.showLoading(); this.showLoading();
let para = { let para = {
brandId: this.brandId, brandName: this.brandName,
supplier: this.supplier supplier: this.supplier,
} };
commodity.getChargeDetail(para).then(res => { commodity.getChargeDetail(para).then(res => {
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
...@@ -109,6 +106,20 @@ export default { ...@@ -109,6 +106,20 @@ 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 } = res; let { code } = res;
...@@ -121,15 +132,18 @@ export default { ...@@ -121,15 +132,18 @@ export default {
}, },
jumpOpening() { jumpOpening() {
window.vm.$router.push({ name: 'cardRoll.opening',query: {payStatus:1} }) window.vm.$router.push({ name: 'cardRoll.opening',query: {payStatus:1} })
this.toSetTrackData('开通权益',{})
}, },
getCard() { getCard() {
let { sessionId } = this.$store.state; let { sessionId } = this.$store.state;
let [href] = window.location.href.split('/#/'); let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`; let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`;
this.openWindows(url, 'cardRoll.index') this.openWindows(url, 'cardRoll.index')
this.toSetTrackData('我的卡券',{})
}, },
jumpCustomer() { jumpCustomer() {
window.vm.$router.push({ name: 'cardRoll.customer'}); window.vm.$router.push({ name: 'cardRoll.customer'});
this.toSetTrackData('客服',{})
}, },
//充值类型 //充值类型
selectType(item) { selectType(item) {
...@@ -137,11 +151,13 @@ export default { ...@@ -137,11 +151,13 @@ export default {
this.amountSno = 0; this.amountSno = 0;
this.denominationList = this.businessList[item].denominationList; this.denominationList = this.businessList[item].denominationList;
this.denomination = this.businessList[item].denominationList[0]; this.denomination = this.businessList[item].denominationList[0];
this.toSetTrackData('充值类型',{productName:this.businessList[item].productName})
}, },
//选择面额 //选择面额
selectAmount(item) { selectAmount(item) {
this.amountSno = item; this.amountSno = item;
this.denomination = this.denominationList[item] this.denomination = this.denominationList[item]
this.toSetTrackData('充值面额',{...this.denomination})
} }
} }
} }
......
...@@ -27,6 +27,9 @@ export default { ...@@ -27,6 +27,9 @@ export default {
this.price = this.$route.query.price; this.price = this.$route.query.price;
}, },
methods: { methods: {
collect(logs) {
window.vm.track.collect(logs);
},
getAgainPay() { getAgainPay() {
const ua = navigator.userAgent.toLowerCase() const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') { if (ua.match(/MicroMessenger/i) == 'micromessenger') {
...@@ -34,12 +37,28 @@ export default { ...@@ -34,12 +37,28 @@ export default {
}else { }else {
window.vm.$router.replace({name:'equity.index'}) window.vm.$router.replace({name:'equity.index'})
} }
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "支付成功",
event_name: '重新购买'
},
});
this.collect(logs);
}, },
getOrder() { getOrder() {
let { sessionId } = this.$store.state; let { sessionId } = this.$store.state;
let [href] = window.location.href.split('/#/'); let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`; let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`;
this.openWindows(url, 'cardRoll.index') this.openWindows(url, 'cardRoll.index')
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "支付成功",
event_name: '查看订单'
},
});
this.collect(logs);
} }
} }
} }
......
...@@ -126,7 +126,14 @@ export default { ...@@ -126,7 +126,14 @@ 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()
} }
...@@ -144,6 +151,17 @@ export default { ...@@ -144,6 +151,17 @@ 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()
} }
...@@ -161,13 +179,25 @@ export default { ...@@ -161,13 +179,25 @@ 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>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<div class="slogan_wrap"> <div class="slogan_wrap">
<div class="sprite-icon icon-slogan1"></div> <div class="sprite-icon icon-slogan1"></div>
</div> </div>
<div class="box "> <div class="box">
<div class="box_3_1"> <div class="box_3_1">
<div class="item"> <div class="item">
<div class="sprite-icon icon-mt_gas"></div> <div class="sprite-icon icon-mt_gas"></div>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<p>特惠五折起</p> <p>特惠五折起</p>
</div> </div>
</div> </div>
<div class="item" @click="jump"> <div class="item" @click="jump(0)">
<div class="sprite-icon icon-mt_more"></div> <div class="sprite-icon icon-mt_more"></div>
<p>查看</p> <p>查看</p>
<p>更多特权</p> <p>更多特权</p>
...@@ -80,98 +80,112 @@ ...@@ -80,98 +80,112 @@
</div> </div>
</div> </div>
</div> </div>
<span @click="jump" class="know_btn">我知道了</span> <span @click="jump(1)" class="know_btn">我知道了</span>
</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";
export default { export default {
name: '', name: "",
data () { data() {
return { return {
};
}
}, },
mounted () { mounted() {
let urlParams = window.location.href.split('/#/?')[1] let urlParams = window.location.href.split("/#/?")[1];
if(urlParams) { if (urlParams) {
let urlObj = {} let urlObj = {};
let urlParamsArr = urlParams.split('&') let urlParamsArr = urlParams.split("&");
urlParamsArr.forEach((item) => { urlParamsArr.forEach((item) => {
const [param, value] = item.split('=') const [param, value] = item.split("=");
urlObj[param] = value urlObj[param] = value;
}) });
sessionStorage.setItem('URL_PARAM', JSON.stringify(urlObj)) sessionStorage.setItem("URL_PARAM", JSON.stringify(urlObj));
//console.log(JSON.parse(sessionStorage.getItem('URL_PARAM'))) //console.log(JSON.parse(sessionStorage.getItem('URL_PARAM')))
} }
let urlObj = JSON.parse(sessionStorage.getItem("URL_PARAM"));
let urlObj = JSON.parse(sessionStorage.getItem('URL_PARAM')) if (
if(urlObj && ('appId' in urlObj) && ('courseId' in urlObj) && ('channl' in urlObj) && ('merchantId' in urlObj) && ('fissionUser' in urlObj)) { urlObj &&
if(urlObj.fissionUser === 'false') { "appId" in urlObj &&
this.showLoading() "courseId" in urlObj &&
equity.getFissionInfo({merchantId: urlObj.merchantId}).then(res => { "channl" in urlObj &&
let { code, data } = res "merchantId" in urlObj &&
this.hideLoading() "fissionUser" in urlObj
) {
if (urlObj.fissionUser === "false") {
this.showLoading();
equity.getFissionInfo({ merchantId: urlObj.merchantId }).then((res) => {
let { code, data } = res;
this.hideLoading();
if (code == 0) { if (code == 0) {
if(data) { if (data) {
if(data.presentNumber>0) { if (data.presentNumber > 0) {
this.openCard(urlObj) this.openCard(urlObj);
}else{ } else {
this.showToast('赠送名额已失效,请联系门店') this.showToast("赠送名额已失效,请联系门店");
this.init() this.init();
} }
} }
} else { } else {
//this.showToast(message) //this.showToast(message)
this.init() this.init();
} }
}) });
}else if (urlObj.fissionUser === 'true') { } else if (urlObj.fissionUser === "true") {
this.openCard(urlObj) this.openCard(urlObj);
} }
}else{ } else {
this.init() this.init();
} }
}, },
methods: { methods: {
init() { init() {
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) {
if (!this.isMiniprogram) { if (!this.isMiniprogram) {
if (ua.match(/MicroMessenger/i) == 'micromessenger') { if (ua.match(/MicroMessenger/i) == "micromessenger") {
if (!phone) return if (!phone) return;
} }
} }
equity.getCardInfo().then(res => { equity.getCardInfo().then((res) => {
let { code } = res let { code } = res;
if (code == 0) { if (code == 0) {
this.$router.replace({ name: 'equity.index' }) this.$router.replace({ name: "equity.index" });
} }
}) });
} }
}, },
openCard(data) { openCard(data) {
this.showLoading() this.showLoading();
equity.openCardFission({...data}).then(res => { equity.openCardFission({ ...data }).then((res) => {
let { code, message } = res let { code, message } = res;
this.hideLoading() this.hideLoading();
if (code == 0) { if (code == 0) {
// //
} else { } else {
this.showToast(message) this.showToast(message);
} }
this.init() this.init();
}) });
},
collect(logs) {
window.vm.track.collect(logs);
},
receive() {
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "首页",
event_name: "立即领取",
}, },
receive () { });
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) {
...@@ -190,22 +204,30 @@ export default { ...@@ -190,22 +204,30 @@ export default {
this.equityLogin() this.equityLogin()
} }
}, },
jump () { jump(str) {
this.$router.replace({ name: 'common.index' }) this.$router.replace({ name: "common.index" });
} let logs = window.vm.trackConfig({
} event: "click_event",
} properties: {
pagename: "营销页",
event_name:str===1?'我知道了':'查看更多特权'
},
});
this.collect(logs);
},
},
};
</script> </script>
<style lang='scss'> <style lang='scss'>
html,body{ html,
body {
} }
.main.marketing_page{ .main.marketing_page {
background-color: #FEFAED; background-color: #fefaed;
padding: 10px; padding: 10px;
color: #2c2c2c; color: #2c2c2c;
.banner_bg{ .banner_bg {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
...@@ -213,18 +235,18 @@ html,body{ ...@@ -213,18 +235,18 @@ html,body{
width: 355px; width: 355px;
height: 160px; height: 160px;
font-size: 16px; font-size: 16px;
background-image: url('~@a/images/marketing_bg.png'); background-image: url("~@a/images/marketing_bg.png");
background-size: 355px 160px; background-size: 355px 160px;
margin-bottom: 20px; margin-bottom: 20px;
.slogan{ .slogan {
color: #C7C7C7; color: #c7c7c7;
.price{ .price {
color: #fff; color: #fff;
font-size: 20px; font-size: 20px;
margin: 0 5px; margin: 0 5px;
} }
} }
.get_btn{ .get_btn {
display: inline-block; display: inline-block;
width: 238px; width: 238px;
height: 32px; height: 32px;
...@@ -232,30 +254,30 @@ html,body{ ...@@ -232,30 +254,30 @@ html,body{
color: #525252; color: #525252;
text-align: center; text-align: center;
background-image: linear-gradient(180deg, #F1C23B 0%, #FFE596 100%); background-image: linear-gradient(180deg, #f1c23b 0%, #ffe596 100%);
box-shadow: 0 2px 4px 0 rgba(254,228,148,0.20); box-shadow: 0 2px 4px 0 rgba(254, 228, 148, 0.2);
border-radius: 25px; border-radius: 25px;
margin: 10px 0; margin: 10px 0;
} }
} }
.box{ .box {
background: #FFFFFF; background: #ffffff;
border: 1px solid #F5D890; border: 1px solid #f5d890;
box-shadow: 0 2px 8px 0 rgba(255,222,166,0.20); box-shadow: 0 2px 8px 0 rgba(255, 222, 166, 0.2);
border-radius: 8px; border-radius: 8px;
padding: 20px; padding: 20px;
margin-bottom: 20px; margin-bottom: 20px;
.box_3_1{ .box_3_1 {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
} }
.box_2_1{ .box_2_1 {
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
.item{ .item {
display: flex; display: flex;
margin-left: 10px; margin-left: 10px;
.right_info{ .right_info {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
...@@ -263,33 +285,33 @@ html,body{ ...@@ -263,33 +285,33 @@ html,body{
} }
} }
} }
.item{ .item {
text-align: center; text-align: center;
margin: 10px 0; margin: 10px 0;
p{ p {
color: #797979; color: #797979;
font-size: 12px; font-size: 12px;
} }
.sprite-icon{ .sprite-icon {
display: inline-block; display: inline-block;
} }
} }
} }
.slogan_wrap{ .slogan_wrap {
text-align: center; text-align: center;
margin-bottom: 10px; margin-bottom: 10px;
.sprite-icon{ .sprite-icon {
display: inline-block; display: inline-block;
} }
} }
.know_btn{ .know_btn {
display: block; display: block;
height: 50px; height: 50px;
line-height: 50px; line-height: 50px;
color: #fff; color: #fff;
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: 0 -10px -10px; margin: 0 -10px -10px;
} }
} }
......
...@@ -50,6 +50,7 @@ export default { ...@@ -50,6 +50,7 @@ export default {
return { return {
tel: '', tel: '',
sms: '', sms: '',
count: 0,
countDown: false, countDown: false,
countKey: new Date().getTime() countKey: new Date().getTime()
} }
...@@ -84,6 +85,7 @@ export default { ...@@ -84,6 +85,7 @@ export default {
mobile: tel mobile: tel
}).then(res => { }).then(res => {
if (res) { if (res) {
this.count++
let { code, message } = res let { code, message } = res
if (code != 0) { if (code != 0) {
this.showToast(message) this.showToast(message)
...@@ -118,6 +120,7 @@ export default { ...@@ -118,6 +120,7 @@ export default {
this.showToast('请填写正确的手机号') this.showToast('请填写正确的手机号')
return return
} }
this.toCreateTrack('login','登录',{ mobile: tel, code: sms, count: this.count})
this.showLoading('登陆中...') this.showLoading('登陆中...')
common.smsLogin({ common.smsLogin({
mobile: tel, mobile: tel,
...@@ -128,14 +131,29 @@ export default { ...@@ -128,14 +131,29 @@ export default {
if (res) { if (res) {
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
this.toCreateTrack('login_out_event','登录成功',data)
sessionStorage.setItem('GL_EQUITY_USER_INFO', JSON.stringify(data)) sessionStorage.setItem('GL_EQUITY_USER_INFO', JSON.stringify(data))
this.$store.commit('setUserInfo', data) this.$store.commit('setUserInfo', data)
window.vm.$router.replace({ name: lastPath }) window.vm.$router.replace({ name: lastPath })
} else { } else {
this.showToast(message) this.showToast(message)
this.toCreateTrack('login_out_event','登录失败',{message})
} }
} }
}) })
},
toCreateTrack(type,name,data){
let logs = window.vm.trackConfig({
event: type,
properties: {
pagename: "登录页",
event_name: name,
extra_data: {
...data
}
},
});
window.vm.track.collect(logs);
} }
} }
} }
......
...@@ -116,12 +116,14 @@ export default { ...@@ -116,12 +116,14 @@ export default {
this.hideLoading() this.hideLoading()
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
localStorage.setItem('isVip',1)
if(data.isConcern == 0) { if(data.isConcern == 0) {
this.showFollowAccount = true; this.showFollowAccount = true;
} }
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
} else { } else {
localStorage.setItem('isVip',0)
this.showToast(message) this.showToast(message)
} }
}) })
...@@ -155,8 +157,19 @@ export default { ...@@ -155,8 +157,19 @@ export default {
}, },
methods: { methods: {
collect(logs) {
window.vm.track.collect(logs);
},
followAccount() { followAccount() {
window.location.href = process.env.VUE_APP_WECHAT_ACCOUNT; window.location.href = process.env.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'
...@@ -167,6 +180,14 @@ export default { ...@@ -167,6 +180,14 @@ export default {
let [href] = window.location.href.split('/#/'); let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`; let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`;
this.openWindows(url, 'cardRoll.index') this.openWindows(url, 'cardRoll.index')
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益使用中心",
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')
...@@ -177,6 +198,14 @@ export default { ...@@ -177,6 +198,14 @@ 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) {
...@@ -184,6 +213,14 @@ export default { ...@@ -184,6 +213,14 @@ 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('即将上线,敬请期待')
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</div> </div>
<div <div
class="phone btn" class="phone btn"
@click="makePhoneCall('4008060999')" @click="toCall()"
> >
<div class="sprite-icon icon-equity-phone"></div> <div class="sprite-icon icon-equity-phone"></div>
电话咨询 电话咨询
...@@ -49,6 +49,18 @@ export default { ...@@ -49,6 +49,18 @@ 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>
......
...@@ -88,6 +88,14 @@ export default { ...@@ -88,6 +88,14 @@ 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
...@@ -102,6 +110,15 @@ export default { ...@@ -102,6 +110,15 @@ 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
...@@ -120,6 +137,14 @@ export default { ...@@ -120,6 +137,14 @@ 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;
...@@ -174,17 +199,53 @@ export default { ...@@ -174,17 +199,53 @@ 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.push({ 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.push({ 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 = {
...@@ -192,6 +253,15 @@ export default { ...@@ -192,6 +253,15 @@ 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
...@@ -202,7 +272,11 @@ export default { ...@@ -202,7 +272,11 @@ export default {
this.showToast(message) this.showToast(message)
} }
}) })
} },
//埋点
collect(logs) {
window.vm.track.collect(logs);
},
} }
} }
</script> </script>
......
...@@ -26,14 +26,25 @@ const CDN = { ...@@ -26,14 +26,25 @@ 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/' const publicPath = '/scrm-equity-buried/'
module.exports = { module.exports = {
// publicPath, // publicPath,
devServer: { devServer: {
disableHostCheck: true, disableHostCheck: true,
host: '0.0.0.0', host: '0.0.0.0',
port: 8081, port: 8081,
publicPath publicPath,
proxy: {
'/apid': { //这里最好有一个 /
target: 'http://192.168.3.152:35010', // 后台接口域名
ws: true, //如果要代理 websockets,配置这个参数
secure: false, // 如果是https接口,需要配置这个参数
changeOrigin: true, //是否跨域
pathRewrite:{
'^/apid':''
}
}
}
}, },
configureWebpack: config => { configureWebpack: config => {
config.resolve.modules = ['node_modules', './src/assets/spritesmith'] config.resolve.modules = ['node_modules', './src/assets/spritesmith']
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!