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
VUE_APP_REPO=https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config
\ No newline at end of file
......@@ -3,11 +3,14 @@
VUE_APP_TITLE=广联运营平台
# 网络请求公用地址
#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://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://192.168.2.60:8086/rop-ddh-carlife/router
VUE_APP_KEY=48e5e13229b82c1b4e6e8c96151f0637
VUE_APP_SECRET=c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b
#VUE_APP_KEY=48e5e13229b82c1b4e6e8c96151f0637
#VUE_APP_SECRET=c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b
VUE_APP_KEY=036cc0e0fe316483238287e5721df4c3
VUE_APP_SECRET=c7290f606d6b4e9aaf6da3ad6310e883fe316483238287e5
......@@ -3,12 +3,7 @@ module.exports = {
env: {
node: true
},
globals: {
wx: true,
'returnCitySN': true ,
'MobileDetect': true,
'track': true
},
globals: { wx: true },
'extends': [
'plugin:vue/essential',
'eslint:recommended'
......
This diff could not be displayed because it is too large.
......@@ -10,7 +10,6 @@
"dependencies": {
"axios": "^0.21.0",
"core-js": "^3.6.5",
"js-md5": "^0.7.3",
"sha1": "^1.1.1",
"vant": "^2.10.11",
"vconsole": "^3.4.0",
......
......@@ -2,48 +2,45 @@
<html lang="en">
<head>
<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,minimum-scale=1,maximum-scale=1,user-scalable=0">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta name="referrer" content="no-referrer">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- 使用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="stylesheet" />
<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,minimum-scale=1,maximum-scale=1,user-scalable=0">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta name="referrer" content="no-referrer">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- 使用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="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文件 预加载 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<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://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>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.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>
<body>
<noscript>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<style>
html,
body {
margin: 0;
padding: 0;
}
#app {
color: #333333;
}
</style>
\ No newline at end of file
html,
body {
margin: 0;
padding: 0;
}
#app {
color: #333333;
}
</style>
<template>
<div id="app">
<template v-if="$route.meta.showNavBar && !isMiniprogram && showNavBar">
<template v-if="$route.meta.showNavBar && !isMiniprogram">
<div class="nav-bar">
<van-nav-bar
safe-area-inset-top
:title="$route.meta.title"
left-arrow
:fixed='true'
@click-left="onClickLeft"
/>
</div>
</template>
<div>
<transition name="fade">
<keep-alive>
<router-view
v-if="$route.meta.keepAlive"
class="main-box"
:class="{'app-box': showNavBar && $route.meta.showNavBar}"
v-wechat-title="$route.meta.title"
/>
</keep-alive>
</transition>
<transition name="fade">
<router-view
class="main-box"
:class="{'app-box': showNavBar && $route.meta.showNavBar}"
v-wechat-title="$route.meta.title"
v-if="!$route.meta.keepAlive"
/>
</transition>
</div>
</div>
</template>
<script>
// import VConsole from 'vconsole'
export default {
data() {
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;
}
},
return {};
},
components: {},
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);
};
},
created() {},
mounted() {
// window.vConsole = new VConsole()
//解决ios下history.back后不刷新
this.handleScroll();
var isPageHide = false;
window.addEventListener("pageshow", function () {
window.addEventListener("pageshow", function() {
if (isPageHide) {
window.location.reload();
}
});
window.addEventListener("pagehide", function () {
window.addEventListener("pagehide", function() {
isPageHide = true;
});
},
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;
}
});
},
},
methods: {},
};
</script>
......@@ -136,31 +57,4 @@ export default {
#app {
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>
......@@ -47,19 +47,8 @@ service.interceptors.response.use(
} else {
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
sessionStorage.setItem(
"CODE_PAST_DUE",
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' })
sessionStorage.setItem("CODE_PAST_DUE",true);
window.vm.$router.replace({ name: 'common.phoneLogin' })
} else {
let equipmentType = ""
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 @@
margin: 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 {
width: 100%;
height: 100%;
......
......@@ -9,87 +9,27 @@ import '@a/scss/common.scss'
import store from "./store"
import axios from 'axios'
Vue.use(VueWechatTitle)
import { Lazyload } from 'vant';
Vue.use(Lazyload);
Vue.use(Vant)
import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css'
// import VConsole from 'vconsole'
// const vConsole = new VConsole()
// Vue.use(vConsole)
import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css'
Vue.use(preview)
Vue.config.productionTip = false
Vue.prototype.isMiniprogram = window.__wxjs_environment === 'miniprogram'
Vue.prototype.track = track;
if (!localStorage['sessionId'] || !localStorage['expirationTime'] || (localStorage['sessionId'] && (new Date().getTime() - localStorage['expirationTime']) > 60 * 60 * 1000)) {
const ua = navigator.userAgent.toLowerCase();
let terminal;
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
terminal = 'h5'
} else {
if (Vue.prototype.checkPhoneType() == 'ios') {
terminal = 'ios'
} else {
terminal = 'android'
}
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)
}
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
}).$mount('#app')
})
\ No newline at end of file
......@@ -17,23 +17,23 @@ export default {
description: '7折起',
id: 54
},
{
name: '道路救援',
icon: 'jiuyuan',
description: '非事故免费',
route: 'road'
},
{
name: '道路救援',
icon: 'jiuyuan',
description: '非事故免费',
route: 'road'
},
],
hotelList: [{
name: '今日特惠',
icon: 'today',
description: '超性价比'
},
{
name: '景区门票',
icon: 'tickets',
description: '全国3000+景点'
}
{
name: '景区门票',
icon: 'tickets',
description: '全国3000+景点'
}
],
cateringList2: [{
name: '肯德基',
......@@ -41,35 +41,35 @@ export default {
description: '最高省81元',
typeId: 23
},
{
name: '麦当劳',
icon: 'm',
description: '最高省44元',
typeId: 64
},
{
name: '星巴克',
icon: 'xbk',
description: '最高省17元',
typeId: 21
},
{
name: '瑞幸咖啡',
icon: 'ruixing',
description: '最高省10元',
typeId: 148
}
{
name: '麦当劳',
icon: 'm',
description: '最高省44元',
typeId: 64
},
{
name: '星巴克',
icon: 'xbk',
description: '最高省17元',
typeId: 21
},
{
name: '瑞幸咖啡',
icon: 'ruixing',
description: '最高省10元',
typeId: 148
}
],
gasList: [{
name: '覆盖城市',
icon: 'city',
subIcon: '400'
},
{
name: '加油站',
icon: 'gas',
subIcon: '10000'
}
{
name: '加油站',
icon: 'gas',
subIcon: '10000'
}
],
...shopList
}
......@@ -98,26 +98,35 @@ export default {
this.setNoticeInfo()
},
CarLink(e) {
let {sessionId} = this.$store.state;
let [href] = window.location.href.split('/#/');
let url;
let supplier = e.supplier;
sessionStorage.setItem('common', this.icon ? 1 : 0)
switch (supplier) {
sessionStorage.setItem('common',this.icon?1:0)
switch(supplier) {
case 'GL_OIL':
this.$router.push({ name:'oilStation.index' })
url = `${href}/#/oilStation/index?sessionId=${sessionId}`
this.openWindows(url, 'oilStation.index')
break;
case 'GL_ROAD_RESCUE':
this.$router.push({ name:'equity.road'})
url = `${href}/#/equity/road`
this.openWindows(url, 'equity.road')
break;
case 'GL_TIRE_PROTECTION':
this.$router.push({ name:'equity.tyre'})
url = `${href}/#/equity/tyre`
this.openWindows(url, 'equity.tyre')
break;
case 'GL_ROBBERY_PROTECTION':
this.$router.push({ name:'equity.compensate'})
url = `${href}/#/equity/compensate`
this.openWindows(url, 'equity.compensate')
break;
case 'GL_COLLISION_REPAIR':
this.$router.push({ name:'equity.collision'})
url = `${href}/#/equity/collision`
this.openWindows(url, 'equity.collision')
break;
case 'GL_CAR_TOTAL_LOSS':
this.$router.push({ name:'equity.loss'})
url = `${href}/#/equity/loss`
this.openWindows(url, 'equity.loss')
break;
case 'EDJ':
this.jumpDEJ();
......@@ -125,23 +134,15 @@ export default {
default:
this.showToast('即将上线,敬请期待')
}
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益首页",
event_name: e.equityName,
},
});
window.vm.track.collect(logs);
},
jumpDEJ() {
let { sessionId } = this.$store.state;
let {sessionId} = this.$store.state;
let para = {
sessionId
}
equity.getEdjUrl(para).then(res => {
let { code, data, message } = res
if (code == 0) {
let {code, data, message} = res
if (code == 0){
this.openWindows(data)
} else {
this.showToast(message)
......@@ -149,28 +150,18 @@ export default {
})
},
jumpLink(e) {
this.$store.commit('setGoodsInfo', e);
if (e.appearance == 1) {
this.$router.push({ name:'commodity.business' })
} else {
this.$router.push({ name:'commodity.recharge' })
let { sessionId } = this.$store.state;
this.$store.commit('setGoodsInfo',e);
let {brandId,supplier,brandName} = e;
if(e.appearance == 1) {
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() {
this.carServiceList = []
......@@ -178,8 +169,8 @@ export default {
merchantId: this.merchantId
}
equity.getMerchantid(para).then(res => {
let { code, data, message } = res
if (code == 0) {
let {code, data, message} = res
if (code == 0){
this.carServiceList = data.carServiceList
this.goodsServiceList = data.goodsServiceList;
this.equityGoodsGroupDescDtos = this.goodsServiceList[0].equityGoodsGroupDescDtos;
......@@ -191,14 +182,6 @@ export default {
changeGoods(item) {
this.goodsTab = item;
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() {
equity.getCouponList({
......
import WxConfig from '@u/WxConfig'
import { commodity } from "@r/api";
import {commodity} from "@r/api";
const WX = new WxConfig(['chooseWXPay']);
export default {
data() {
return {}
},
mounted() {},
mounted() {
},
methods: {
async chooseWXPay() {
if (this.appearance == 2 && !/^[a-zA-Z0-9]+$/.test(this.rechargeNumber)) {
......@@ -16,28 +17,14 @@ export default {
},
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();
let { sessionId } = this.$store.state;
let {sessionId} = this.$store.state;
let orderCode = await commodity.getOrderCode({
sessionId,
supplier: this.supplier,
brandId: this.brandId
}).then(res => {
let { code, data, message } = res
let {code, data, message} = res
if (code == 0) {
return data;
} else {
......@@ -48,7 +35,7 @@ export default {
const ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
payMannerId = 4;
} else {
}else {
payMannerId = 5; // 7
}
let para = {
......@@ -61,7 +48,7 @@ export default {
}
let payData = await commodity.payOrder(para).then(res => {
this.hideLoading()
let { code, data, message } = res
let {code, data, message} = res
if (code == 0) {
return data;
} else {
......@@ -69,7 +56,7 @@ export default {
}
})
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
this.handlePay(payData, orderCode);
this.handlePay(payData);
} else {
if (this.checkPhoneType() == 'ios') {
if (window["payWebOrder"] && typeof window.payWebOrder === "function") {
......@@ -82,87 +69,40 @@ export default {
}
let self = this;
window.onMessageFromPayBack = function(result) {
if (result == 0) {
if(result == 0) {
if (self.appearance == 2) {
let productName = self.brandName + self.businessList[self.typeSno].productName + self.denomination.denomination
window.vm.$router.push({
name: 'commodity.process',
query: {
name: 'commodity.process', query: {
rechargeNumber: self.rechargeNumber,
productName
}
})
} 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 {
self.payCollect(orderCode, 0);
window.vm.showToast(result == -1 ? '支付失败' : '取消支付')
}else {
window.vm.showToast(result==-1?'支付失败':'取消支付')
}
}
}
},
handlePay(payData, orderCode) {
const { timeStamp, nonceStr, packages, signType, paySign } = payData;
handlePay(payData) {
const {timeStamp, nonceStr, packages, signType, paySign} = payData;
WX.chooseWXPay(timeStamp, nonceStr, packages, signType, paySign).then(res => {
if (res) {
this.payCollect(orderCode, 1);
} else {
this.payCollect(orderCode, 0);
}
console.log(res)
if (this.appearance == 2) {
let productName = this.brandName + this.businessList[this.typeSno].productName + this.denomination.denomination
window.vm.$router.push({
name: 'commodity.process',
query: {
name: 'commodity.process', query: {
rechargeNumber: this.rechargeNumber,
productName
}
})
} 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
}
......@@ -6,7 +6,7 @@ import {
Notify
} from 'vant'
import store from '@/store'
import { common, equity } from '../api/api'
import { common,equity } from '../api/api'
Vue.use(VueRouter)
const router = new VueRouter({
routes,
......@@ -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) => {
routerBuried(to,from)
let { meta: { authBase } } = to
store.commit('findPrevPath', from.name)
if (to.name != 'common.phoneLogin') store.commit('jumpPath', to.name)
const params = getParams(window.location.href);
if (params.appId) sessionStorage.setItem('GL_WX_APPID', params.appId)
if (params.merchantId) {
store.commit('setMerchantId', params.merchantId)
if (params.merchantId){
store.commit('setMerchantId',params.merchantId)
sessionStorage.setItem('GL_WX_MERCHANTID', params.merchantId)
}
window.onMessageFromLoginBack = (type, userId, sessionId) => {
console.log('onMessageFromLoginBack', type, userId, sessionId)
if (type == 0) {
getSessionAppId(sessionId, true);
getSessionAppId(sessionId,true);
} else {
store.commit('clearSessionId')
next()
......@@ -72,13 +57,9 @@ router.beforeEach((to, from, next) => {
}
return
} else {
if(to.name == 'common.marketing' && params.sessionId) {
getSessionAppId(params.sessionId,false,next)
}else {
setUserInfo(params)
next()
}
setUserInfo(params)
getSessionAppId(params.sessionId)
next()
}
}
} else {
......@@ -87,158 +68,21 @@ router.beforeEach((to, from, next) => {
}
})
//路由跳转埋点收集
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) => {
const getSessionAppId = (sid,status) => {
common.getAppSessionId({ sid }).then(res => {
let { code, data } = res
if (code == 0) {
/**
* app埋点登录
*/
setUserInfo(data);
loginBuried(data)
if (status) {
if(status) {
store.commit('reload');
} else {
}else {//登录后,查询会员信息,如果已经开通过了会员,就直接跳转到会员页面,不走营销也?
equity.getCardInfo().then(res => {
let { code,data } = res;
if (code == 0 && data) {
localStorage.setItem('isVip',1)
router.push({ name: 'equity.index' })
}else {
localStorage.setItem('isVip',0)
if (code == 0&&data) {
router.replace({name: 'equity.index'})
}
})
}
callback();
}
})
}
......@@ -249,12 +93,10 @@ const getSessionId = (redirectUrl, state) => {
const appId = sessionStorage.getItem('GL_WX_APPID')
common.getSessionId({ code: params.code, state, appId }).then(res => {
if (res) {
let { code, data, message } = res
let { code, data,message } = res
if (code == 0) {
/**
* 埋点登录
*/
loginBuried(data)
setUserInfo(data)
router.push({name: 'common.phoneLogin'})
} else {
Notify({ type: 'danger', message })
}
......
const pages = {
equity: [
{name: 'index'},
{name: 'road', title: '道路救援',showNavBar: true},
{name: 'tyre', title: '轮胎保障',showNavBar: true},
{name: 'collision', title: '碰撞维修',showNavBar: true},
{name: 'compensate', title: '盗抢补偿',showNavBar: true},
{name: 'loss', title: '整车全损',showNavBar: true},
{name: 'road', title: '道路救援'},
{name: 'tyre', title: '轮胎保障'},
{name: 'collision', title: '碰撞维修'},
{name: 'compensate', title: '盗抢补偿'},
{name: 'loss', title: '整车全损'},
],
oilStation: [
{name: 'index',showNavBar: true},
{name: 'record', title: '加油记录',showNavBar: true},
{name: 'detail', title: '加油站详情',showNavBar: true},
{name: 'location', title: '选择位置',showNavBar: true},
{name: 'index'},
{name: 'record', title: '加油记录'},
{name: 'detail', title: '加油站详情'},
{name: 'location', title: '加油站详情'},
],
common: [
{name: 'index'},
{name: 'activate', title: '激活权益',showNavBar: true},
{name: 'explain', title: '常见疑问',showNavBar: true},
{name: 'activate', title: '激活权益'},
{name: 'explain', title: '常见疑问'},
{name: 'phoneLogin', title: '登录',wxAuth: true},
{name: 'nothing'},
{name: 'appTip',title: '领取结果'},
{name: 'appTip'},
{name: 'expcard',title: '体验卡领取'},
{name: 'marketing', wxAuth: true},
],
......@@ -34,62 +34,48 @@ const pages = {
cardRoll: [
{
name: 'index',
title: '我的卡券',
showNavBar: true
title: '我的卡券'
},
{
name: 'detail',
title: '查看卡券',
showNavBar: true
title: '查看卡券'
},
{
name: 'opening',
title: '开通权益',
showNavBar: true
title: '开通权益'
},
{
name: 'salesDetail',
title: '售后详情',
showNavBar: true
title: '售后详情'
},
{
name: 'waiting',
title: '等待处理',
showNavBar: true
title: '等待处理'
},
{
name: 'salesApply',
title: '申请售后',
showNavBar: true
title: '申请售后'
},
{
name: 'agreement',
title: '权益服务协议',
showNavBar: true
title: '权益服务协议'
},
{
name: 'customer',
showNavBar: true
}
],
commodity: [
{
name: 'process',
title: '充值流程',
showNavBar: true
},
{
name: 'recharge',
showNavBar: true
},
{
name: 'success',
title: '支付成功',
showNavBar: true
},
{
name: 'business',
showNavBar: true
},
],
device: [{
......@@ -153,4 +139,3 @@ Object.keys(pages).map(parent => {
})
})
export default routes
......@@ -77,7 +77,7 @@ export default {
router.replace({ name: 'common.marketing' })
},
reload(state) {
console.log(state)
console.log(state,'storeRelod方法,已译注');
// router.replace({ name: 'common.nothing' })
// setTimeout(() => {
// state.lastPath?router.replace({ name: state.lastPath }):router.replace({name: 'equity.index'})
......
......@@ -108,11 +108,9 @@ class WxConfig {
},
fail() {
window.vm.showToast('已取消支付')
resolve()
},
cancel() {
window.vm.showToast('支付失败,请重试')
resolve()
}
})
})
......
......@@ -4,7 +4,7 @@ import { Toast, Dialog } from 'vant'
* 日期格式化
* let time = new Date().format('yyyy-MM-dd hh:mm:ss')
*/
Date.prototype.format = function (fmt) {
Date.prototype.format = function(fmt) {
let o = {
'M+': this.getMonth() + 1, //月份
'd+': this.getDate(), //日
......@@ -26,20 +26,20 @@ Date.prototype.format = function (fmt) {
return fmt
}
const throttle = (fn, gapTime) => {
if (gapTime == null || gapTime == undefined) {
gapTime = 1500
}
let _lastTime = null
return function () {
let _nowTime = +new Date()
if (_nowTime - _lastTime > gapTime || !_lastTime) {
fn.apply(this, arguments)
_lastTime = _nowTime
if (gapTime == null || gapTime == undefined) {
gapTime = 1500
}
let _lastTime = null
return function() {
let _nowTime = +new Date()
if (_nowTime - _lastTime > gapTime || !_lastTime) {
fn.apply(this, arguments)
_lastTime = _nowTime
}
}
}
}
/**防止重复点击 */
// const noScroll = (e) => { e.preventDefault() }
/**防止重复点击 */
// const noScroll = (e) => { e.preventDefault() }
const showLoading = (title = '加载中...') => {
Toast({
type: 'loading',
......@@ -49,10 +49,10 @@ const showLoading = (title = '加载中...') => {
})
}
const hideLoading = () => {
Toast.clear()
}
Toast.clear()
}
/**复制 */
const cloneText = (message) => {
const cloneText = (message)=> {
let input = document.createElement("input");
input.value = message;
document.body.appendChild(input);
......@@ -61,20 +61,20 @@ const cloneText = (message) => {
document.body.removeChild(input);
Toast('复制成功');
}
/**num:要转换的数值,fixed:精确几位小数 */
/**num:要转换的数值,fixed:精确几位小数 */
const decimal = (num, fixed) => {
let pow = Math.pow(10, fixed)
return Math.round(num * pow) / pow
}
const showToast = (message = '', icon) => {
let params = {
message,
forbidClick: true
let params = {
message,
forbidClick: true
}
if (icon) params.icon = icon
Toast(params)
}
if (icon) params.icon = icon
Toast(params)
}
/**触摸样式 */
/**触摸样式 */
const touchstart = e => {
e.target.classList.add('btn-on-leave')
}
......@@ -126,59 +126,11 @@ const openWindows = (url, name) => {
window.location.href = url
}
} 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 = {
needNavigator: 1,
type: 4,
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') {
window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify(params))
} else {
......@@ -187,7 +139,7 @@ const openWindows = (url, name) => {
}
}
}
const getParams = str => {
const getParams = str => {
let params = str.split('?')
if (params.length < 2) return {}
let param = params[1].split('&')
......@@ -200,34 +152,6 @@ const getParams = str => {
}
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 = () => {
let source = 3
if (window.__wxjs_environment === 'miniprogram') {
......@@ -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
const myDialog = (message,confirmText,cancelText,comfirmFn,cancelFn)=>{
......@@ -397,10 +253,6 @@ const utils = {
alert,
cloneText,
getParams,
trackConfig,
getDetect,
appHide,
nowTime,
myDialog
}
......
......@@ -8,9 +8,7 @@
<script>
export default {
name: "customer",
mounted() {
}
name: "customer"
}
</script>
......
......@@ -15,23 +15,23 @@
<div class="card-item-style" v-if="detailInfo.cardType == 5">
<div class="card-item-number">
<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 class="card-item-number">
<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-style" v-if="detailInfo.cardType == 3">
<div class="card-item-number">
<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 class="card-item-style" v-if="detailInfo.cardType == 4">
<div class="card-item-number">
<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>
......@@ -68,7 +68,13 @@ export default {
},
mounted() {
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 = {
orderCode
}
......@@ -84,22 +90,9 @@ export default {
},
methods: {
//复制编码
getClone(value,name) {
getClone(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>
......
......@@ -137,14 +137,26 @@ export default {
tabStatus,
reStatus,
idx: 1,
isFirst: true,
cardStatus
}
},
mounted() {
this.getCardList();
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) != 'micromessenger') {
this.reload();
}
},
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) {
let {sessionId} = this.$store.state;
this.showLoading();
......@@ -165,49 +177,35 @@ export default {
//切换tab
tabClick(name) {
let params = {};
let str
switch(name)
{
case 0:
params = {}
str = '全部'
break;
case 1:
params = {
'statusList[0]': 1,
'statusList[1]': 2,
}
str = '待收货'
break
case 2:
params = {
'statusList[0]': 3,
}
str = '已完成'
break;
case 3:
params = {
'statusList[0]': 5,
'statusList[1]': 6,
}
str = '已退款'
break;
case 4:
params = {
'statusList[0]': 4,
}
str = '售后'
break;
}
this.getCardList(params)
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "我的卡券",
event_name: str,
},
});
this.collect(logs);
},
//确认收货
handleConfirm(val) {
......@@ -221,16 +219,6 @@ export default {
sessionId: this.sessionId,
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 => {
this.hideLoading()
let { code, message } = res
......@@ -265,32 +253,19 @@ export default {
// },
//查看卡券
jumpDetail(val) {
let { sessionId } = this.$store.state;
this.$store.commit('setOrder',val)
window.vm.$router.push({ name: 'cardRoll.detail' })
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "我的卡券",
event_name: '查看卡券',
orderCode:val.orderCode,
},
});
this.collect(logs);
let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/detail?sessionId=${sessionId}&orderCode=${val.orderCode}`;
this.openWindows(url, 'cardRoll.detail')
},
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) {
let { sessionId } = this.$store.state;
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 {
this.alert({
message: '该卡券无法发起售后,如有其它疑问,请联系购券页面的在线客服进行咨询!',
......@@ -298,21 +273,11 @@ export default {
}
},
jumpSalesDetail(val) {
let { sessionId } = this.$store.state;
this.$store.commit('setOrder',val)
window.vm.$router.push({ name: '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);
let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/salesDetail?sessionId=${sessionId}&orderCode=${val.orderCode}`;
this.openWindows(url, 'cardRoll.salesDetail')
},
},
}
......
......@@ -55,21 +55,18 @@ export default {
}
},
mounted() {
this.appHide();
this.orderCode = this.$store.state.order.orderCode;
this.orderPrices = this.$store.state.order.orderPrices;
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
this.weixinImg = true;
this.orderCode = this.$store.state.order.orderCode;
this.orderPrices = this.$store.state.order.orderPrices;
}else {
this.weixinImg = false;
this.orderCode = this.$store.state.orderCode;
this.orderPrices = this.$store.state.orderPrices;
}
},
methods: {
collect(logs) {
window.vm.track.collect(logs);
},
handleEditPrice() {
this.priceDialog = true;
this.price2 = this.orderPrices;
......@@ -173,15 +170,6 @@ export default {
if (img) {
this.refundImg = img.data;
this.showToast('上传成功')
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "申请售后",
event_name: '图片上传',
image:img.data
},
});
this.collect(logs);
} else {
this.showToast('上传失败')
this.refundImg = '';
......@@ -207,15 +195,6 @@ export default {
refundImg: this.refundImg,
sessionId
}
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "申请售后",
event_name: '提交申请',
...para
},
});
this.collect(logs);
cardRoll.getCardRefund(para).then(res => {
this.hideLoading();
console.log(res)
......
......@@ -52,7 +52,6 @@ export default {
}
},
mounted() {
this.appHide();
const ua = navigator.userAgent.toLowerCase();
let orderCode;
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
......
......@@ -19,7 +19,6 @@ export default {
}
},
mounted() {
this.appHide();
sessionStorage.setItem("need-refresh",1)
},
methods: {
......
......@@ -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">
<van-icon name="checked" class="business-checked" v-if="index == bindex"/>
<div class="business-select-img">
<img v-lazy="item.goodsImage" alt="">
<img :src="item.goodsImage" alt="">
</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>
......@@ -79,7 +79,7 @@
<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"/>
<div class="pop-item-img">
<img v-lazy="item.goodsImage" alt="">
<img :src="item.goodsImage" alt="">
</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>
......@@ -101,7 +101,7 @@ export default {
name: "business",
data() {
return {
isOpen: 1,
isOpen: 0,
appearance: 1,
businessStatus: 2,
bindex: 0,
......@@ -115,17 +115,23 @@ export default {
},
status: true,
supplier: '',
isFirst: true,
isHaveInventory:true,//是否有库存
}
},
mounted() {
this.appHide();
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
this.brandName = goods.brandName;
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();
let para = {
brandName: this.brandName,
......@@ -144,20 +150,6 @@ export default {
})
},
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() {
equity.getCardInfo().then(res => {
let { code,data } = res;
......@@ -169,23 +161,21 @@ export default {
})
},
getCard() {
window.vm.$router.push({ name: 'cardRoll.index' })
this.toSetTrackData('我的卡券',{})
let { sessionId } = this.$store.state;
let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`;
this.openWindows(url, 'cardRoll.index')
},
jumpCustomer() {
this.isFirst = false;
window.vm.$router.push({ name: 'cardRoll.customer' })
this.toSetTrackData('客服',{})
},
jumpOpening() {
window.vm.$router.push({ name: 'cardRoll.opening',query: {payStatus:1} })
this.setLocalStorage('whereInOpen','goods')
this.toSetTrackData('开通权益',{})
},
getMore() {
this.show = true;
this.toSetTrackData('查看更多',{})
},
selectBusiness(item,index){
this.selectData = item;
......@@ -195,7 +185,6 @@ export default {
document.querySelector('.business-select').scrollLeft = document.querySelector(`.select-${index}`).offsetLeft - 10;
}
this.checkInventory(item.id)
this.toSetTrackData('选择商品',item)
},
checkInventory(id){
commodity.getInventory({id}).then(res=>{
......
......@@ -57,7 +57,6 @@ export default {
}
},
mounted() {
this.appHide();
this.rechargeNumber = this.$route.query.rechargeNumber;
this.productName = this.$route.query.productName;
},
......
......@@ -24,34 +24,22 @@ export default {
}
},
mounted() {
this.appHide();
this.price = this.$route.query.price;
},
methods: {
collect(logs) {
window.vm.track.collect(logs);
},
getAgainPay() {
window.vm.$router.go(-1)
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "支付成功",
event_name: '重新购买'
},
});
this.collect(logs);
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
window.vm.$router.go(-1)
}else {
window.vm.$router.replace({name:'equity.index'})
}
},
getOrder() {
window.vm.$router.push({ name: 'cardRoll.index' })
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "支付成功",
event_name: '查看订单'
},
});
this.collect(logs);
let { sessionId } = this.$store.state;
let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`;
this.openWindows(url, 'cardRoll.index')
}
}
}
......
......@@ -47,28 +47,11 @@ export default {
},
methods: {
jump () {
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "激活权益",
event_name: "常见疑问",
},
});
window.vm.track.collect(logs);
window.vm.$router.push({ name: 'common.explain' })
let [href] = window.location.href.split('/#/')
let url = `${href}/#/common/explain`
this.openWindows(url, 'common.explain')
},
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
if (!no) return
let target = 'activateBySn'
......@@ -94,7 +77,16 @@ export default {
if (window.__wxjs_environment === 'miniprogram') {
wx.miniProgram.navigateBack()
} 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 {
......@@ -108,8 +100,6 @@ export default {
<style scoped lang='scss'>
.main {
width: auto;
height: auto!important;
position: fixed;
top: 50%;
left: 50%;
......
......@@ -35,7 +35,6 @@ export default {
sms: "",
countDown: false,
countKey: new Date().getTime(),
countNum: 0,
day:0
};
},
......@@ -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() {
const params = this.getParams(window.location.href)
const appId = sessionStorage.getItem("GL_WX_APPID")
......@@ -143,7 +91,6 @@ export default {
if(!this.sms){
return
}
this.toCreateTrack('login','免费领取',{ mobile: this.tel, code: this.sms, count: this.countNum})
this.showLoading();
let para = {
mobile: this.tel,
......@@ -161,7 +108,10 @@ export default {
this.hideLoading()
this.setLocalStorage('codeAuth',false)
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`
})
}else{//非微信环境
......@@ -190,7 +140,6 @@ export default {
if(this.countDown){
return
}
this.countNum ++;
this.$store.commit(
"setVerificationCount",
Math.round(new Date() / 1000) + 60
......
......@@ -38,7 +38,6 @@ export default {
.main {
padding: 20px;
color: #2c2c2c;
window: auto;
.page {
margin-bottom: 30px;
.title {
......
......@@ -126,14 +126,7 @@ export default {
let [href] = window.location.href.split('/#/')
let url = `${href}/#/cardRoll/opening?sessionId=${sessionId}`
this.openWindows(url, 'cardRoll.opening');
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益中心",
event_name:'立即领取'
},
});
this.collect(logs);
} else {
this.equityLogin()
}
......@@ -150,18 +143,7 @@ export default {
}
}
}
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);
this.CarLink(e)
}else {
this.equityLogin()
}
......@@ -179,25 +161,13 @@ export default {
}
}
this.jumpLink(e)
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益中心",
event_name:e.brandName,
...e
},
});
this.collect(logs);
}else {
this.equityLogin()
}
},
willComeDialog() {
this.showToast('即将上线,敬请期待')
},
collect(logs) {
window.vm.track.collect(logs);
},
}
}
}
</script>
......
......@@ -80,7 +80,7 @@
</div>
</div>
</div>
<span @click="jump(1)" class="know_btn">我知道了</span>
<span @click="jump" class="know_btn">我知道了</span>
</div>
</template>
......@@ -143,13 +143,10 @@ export default {
},
methods: {
collect(logs) {
window.vm.track.collect(logs);
},
init() {
//如果能够获取到这个缓存,说明已经是登录过
// let isReload = this.getLocalStorage('reLoadIndex')
// console.log('时间搓',new Date().getTime());
// console.log('sessionId',isReload);
// if(isReload){
// this.removeLocalStorage('reLoadIndex')
......@@ -160,8 +157,18 @@ export default {
// }
// })
// }
// let urlObj = JSON.parse(sessionStorage.getItem('URL_PARAM'))
// // let { sessionId, phone } = this.$store.state
// this.removeLocalStorage('showMydialog1')
// 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()
// let sid = urlObj.sessionId
// console.log(sid);
......@@ -210,14 +217,6 @@ export default {
})
},
receive () {
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "首页",
event_name: "立即领取",
},
});
this.collect(logs);
let { sessionId, phone } = this.$store.state
const ua = navigator.userAgent.toLowerCase()
if (sessionId) {
......@@ -236,7 +235,7 @@ export default {
this.equityLogin()
}
},
jump (str) {
jump () {
// let { sessionId } = JSON.parse(
// sessionStorage.getItem("GL_EQUITY_USER_INFO")
// )
......@@ -246,14 +245,6 @@ export default {
// let url = `${href}/#/equity/index?sessionId=${sessionId}`
// this.openWindows(url, '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 {
// }
.main.marketing_page{
width: auto;
background-color: #FEFAED;
padding: 10px;
color: #2c2c2c;
......@@ -353,7 +343,7 @@ export default {
text-align: center;
font-size: 20px;
background-image: radial-gradient(86% 95%, #5E5E5E 0%, #2F2F2F 100%);
margin-bottom: 10px;
margin: 0 -10px -10px;
}
}
</style>
\ No newline at end of file
......@@ -149,7 +149,6 @@ export default {
tel: "",
sms: "",
countDown: false,
countNum: 0,
countKey: new Date().getTime(),
showReSend:false
};
......@@ -245,7 +244,6 @@ export default {
})
.then((res) => {
if (res) {
this.countNum++
let { code, message } = res;
if (code != 0) {
this.showToast(message);
......@@ -280,8 +278,7 @@ export default {
this.showToast("请填写正确的手机号");
return;
}
this.toCreateTrack('login','登录',{ mobile: tel, code: sms, count: this.countNum})
this.showLoading("登录中...");
this.showLoading("登陆中...");
common
.smsLogin({
mobile: tel,
......@@ -292,77 +289,16 @@ export default {
if (res) {
let { code, data, message } = res;
if (code == 0) {
this.loginBuried(data)
this.toCreateTrack('login_out_event','登录成功',data)
sessionStorage.setItem(
"GL_EQUITY_USER_INFO",
JSON.stringify(data)
);
sessionStorage.setItem("GL_EQUITY_USER_INFO",JSON.stringify(data));
sessionStorage.setItem("CODE_PAST_DUE",false);
this.$store.commit("setUserInfo", data);
let flag = window.location.href.indexOf('/#/')
if(flag!=-1){
window.location.href = `${window.location.href.split('/#/')[0]}/#/equity/index`
}else{
window.location.href = `${window.location.href.split('?')[0]}#/equity/index`
}
window.vm.$router.replace({ name: 'equity.index' });
} else {
this.toCreateTrack('login_out_event','登录失败',{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() {
let { sessionId, phone } = JSON.parse(
sessionStorage.getItem("GL_EQUITY_USER_INFO")
......@@ -370,6 +306,7 @@ export default {
? JSON.parse(sessionStorage.getItem("GL_EQUITY_USER_INFO"))
: this.$store.state;
const ua = navigator.userAgent.toLowerCase();
console.log(sessionId);
if (sessionId) {
if (!this.isMiniprogram) {
if (ua.match(/MicroMessenger/i) == "micromessenger") {
......@@ -379,6 +316,7 @@ export default {
}
}
}
sessionStorage.setItem("CODE_PAST_DUE",false);
this.$router.replace({ name: "equity.index" });
}
},
......@@ -396,7 +334,6 @@ export default {
<style scoped lang='scss'>
.main {
width: auto;
background-color: #fefaed;
padding: 10px;
color: #2c2c2c;
......
......@@ -59,6 +59,7 @@
</div>
<div class="box_foot_img"></div>
</div>
<!-- <div class="card-box">
<div class="sprite-icon icon-banner">
......@@ -148,6 +149,7 @@
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { indexMixin } from "@/mixins";
import { equity } from "@r/api.js";
......@@ -194,9 +196,6 @@ export default {
}
},
methods: {
collect(logs) {
window.vm.track.collect(logs);
},
//获取分享链接
getShareInfoUrl() {
const urlObj = JSON.parse(sessionStorage.getItem("URL_PARAM"));
......@@ -253,11 +252,9 @@ export default {
data.time = new Date(data.validitDate).format("yyyy-MM-dd");
this.userInfo = data;
this.ismember = true;
localStorage.setItem('isVip',1)
} else {
this.ismember = false;
this.isOpen = 0;
localStorage.setItem('isVip',0)
}
// 重新获取头像,避免头像拿不到
//app那边可能拿不到头像---写这个重新获取一下
......@@ -276,16 +273,7 @@ export default {
"续费开通",
"不用了",
this.jumpOpenEquity,
() => {
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益首页",
event_name:'不用了'
},
});
this.collect(logs);
}
() => {}
);
}
}
......@@ -428,29 +416,17 @@ export default {
},
followAccount() {
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() {
let url = "http://m.s11.cn/tehui/sz/?order_cust_id=4892038";
this.openWindows(url);
},
jumpOrder() {
this.$router.push({ name: 'cardRoll.index'})
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益首页",
event_name:'权益订单'
},
});
this.collect(logs);
let { sessionId } = this.$store.state;
let [href] = window.location.href.split("/#/");
let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`;
console.log(url);
this.openWindows(url, "cardRoll.index");
},
jumpOpenShop() {
this.openWindows("https://www.wjx.cn/m/89882107.aspx");
......@@ -461,14 +437,6 @@ export default {
} else {
this.showToast("尚未配置活动参数");
}
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益首页",
event_name:'查看奖励'
},
});
this.collect(logs);
},
jumpInvite() {
if (this.inviteUrl) {
......@@ -476,33 +444,27 @@ export default {
} else {
this.showToast("尚未配置活动参数");
}
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益首页",
event_name:'分享好友'
},
});
this.collect(logs);
},
willComeDialog() {
this.showToast("即将上线,敬请期待");
},
jumpOpenEquity() {
this.$router.push({ name: 'cardRoll.opening'})
this.setLocalStorage('whereInOpen','index')
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "权益首页",
event_name:'开通'
},
});
this.collect(logs);
// let { sessionId } = this.$store.state;
// if(sessionId){
// window.vm.$router.push({ name: 'cardRoll.opening',query: {payStatus:1} })
// }else{
// this.equityLogin();
// }
let { sessionId } = this.$store.state;
let [href] = window.location.href.split("/#/");
let url = `${href}/#/cardRoll/opening?sessionId=${sessionId}`;
this.openWindows(url, "cardRoll.opening");
this.setLocalStorage("whereInOpen", "index");
},
},
};
</script>
<style lang='scss'>
@import "@a/scss/index.scss";
html,
......@@ -902,6 +864,7 @@ body {
}
}
}
&.box_between {
display: flex;
justify-content: space-between;
......@@ -909,6 +872,7 @@ body {
}
}
}
.tab_content {
padding: 10px;
.icon-goods {
......@@ -917,6 +881,7 @@ body {
margin-bottom: 4px;
}
}
.content .box {
&.equity_box {
margin-bottom: 10px;
......@@ -937,4 +902,4 @@ body {
}
}
}
</style>
\ No newline at end of file
</style>
......@@ -30,7 +30,7 @@
</div>
<div
class="phone btn"
@click="toCall()"
@click="makePhoneCall('4008060999')"
>
<div class="sprite-icon icon-equity-phone"></div>
电话咨询
......@@ -49,18 +49,6 @@ export default {
mounted () {
},
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>
......
......@@ -2,7 +2,7 @@
<div class="main">
<div class="box" id="mapContainer">
<div class="de-header">
<img v-lazy="detailInfo.gasLogoBig" alt="" />
<img :src="detailInfo.gasLogoBig" alt="" />
</div>
<div class="box-detail">
<div class="de-desc">
......@@ -87,13 +87,24 @@ export default {
};
},
mounted() {
let { oilId, oilNo, longitude, latitude, distance } = this.$route.query;
this.oilId = oilId;
this.oilNo = oilNo;
this.oilSnoi = oilNo;
this.longitude = longitude;
this.latitude = latitude;
this.distance = distance;
const ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
let { oilId, oilNo, longitude, latitude, distance } = this.$route.query;
this.oilId = oilId;
this.oilNo = oilNo;
this.oilSnoi = oilNo;
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.getCardInfo();
},
......@@ -103,20 +114,13 @@ export default {
name: "cardRoll.opening",
query: { payStatus: 1 },
});
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "开通权益",
},
});
this.collect(logs);
},
getCardInfo() {
equity.getCardInfo().then((res) => {
let { code } = res;
if (code == 0) {
let { code, data } = res;
if (code == 0 && data) {
this.isOpen = 1;
} else {
this.isOpen = 0;
}
......@@ -136,15 +140,12 @@ export default {
this.detailInfo = data;
this.gunNos = data.gunNos;
this.equityOilNoDTOList = data.equityOilNoDTOList;
// let img = new Image();
// img.src = data.gasLogoBig;
// img.onload = ()=> {
// this.hideLoading();
// }
} else {
this.showToast(message);
}
this.hideLoading();
setTimeout(()=>{
this.hideLoading();
},1000)
});
},
openLocation(val) {
......@@ -159,21 +160,13 @@ export default {
).then((res) => {
console.log(res);
});
}else {
}else{
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 {
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) {
if (this.oilSnoi == item) {
......@@ -183,27 +176,9 @@ export default {
this.oilNo = item;
this.oilSuni = null;
this.getOilDetail();
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "选择油号",
oilNo: item,
},
});
this.collect(logs);
},
changeOilSun(item) {
this.oilSuni = item;
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "选择油枪",
oilSuni: item,
},
});
this.collect(logs);
},
oilPay() {
let { oilId } = this.$route.query;
......@@ -220,27 +195,6 @@ export default {
oilNo: this.oilSnoi,
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();
let jumpUrl;
const ua = navigator.userAgent.toLowerCase();
......@@ -250,6 +204,7 @@ export default {
jumpUrl = "getStationAppPayUrl";
}
oilStation[jumpUrl](para).then((res) => {
console.log(res, "加油站");
this.hideLoading();
let { code, data, message } = res;
if (code == 0) {
......@@ -259,10 +214,6 @@ export default {
}
});
},
//埋点
collect(logs) {
window.vm.track.collect(logs);
},
},
};
</script>
......
......@@ -74,18 +74,8 @@ export default {
mounted() {
this.getRecord();
this.handleLocation();
this.listeningBack();
},
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() {
oilStation.getStationSearchList().then(res => {
this.hideLoading()
......@@ -98,14 +88,6 @@ export default {
})
},
clearEmpty() {
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "清空搜索记录",
},
});
this.collect(logs);
oilStation.getStationSearchDeleteAll().then(res => {
this.hideLoading()
let { code, message } = res
......@@ -120,15 +102,6 @@ export default {
let para = {
id: index
}
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "删除历史记录",
id:index
},
});
this.collect(logs);
oilStation.getStationSearchDelete(para).then(res => {
this.hideLoading()
let { code, message } = res
......@@ -147,14 +120,6 @@ export default {
}else {
this.getMapLocation();
}
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "重新定位",
},
});
this.collect(logs);
},
getMapLocation() {
let self = this;
......@@ -209,53 +174,17 @@ export default {
},
onCancel() {
this.localStatus = true;
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "取消搜索",
search:this.input
},
});
this.collect(logs);
},
onSearch(){
this.localStatus = false;
this.$refs.maps.onSearch();
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "搜索",
search:this.input
},
});
this.collect(logs);
},
selectItem(val) {
this.$store.commit('setAddress',val)
window.vm.$router.replace({ path: '/oilStation/index'})
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "选择地址",
address:val
},
});
this.collect(logs);
window.vm.$router.push({ path: '/oilStation/index'})
},
selectAddress() {
window.vm.$router.replace({ path: '/oilStation/index'})
let logs = window.vm.trackConfig({
event: "click_event",
properties: {
pagename: "加油站详情",
event_name: "当前定位",
address:this.addressInfo.address
},
});
this.collect(logs);
window.vm.$router.push({ path: '/oilStation/index'})
},
selectLocation(value) {
let para = {
......@@ -263,30 +192,17 @@ export default {
longitude: value.location.lng,
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 => {
this.hideLoading()
let { code, message } = res
if (code == 0) {
this.$store.commit('setAddress',para)
window.vm.$router.replace({ path: '/oilStation/index'})
window.vm.$router.push({ path: '/oilStation/index'})
} else {
this.showToast(message)
}
})
},
//埋点
collect(logs) {
window.vm.track.collect(logs);
},
}
}
}
</script>
......
......@@ -26,7 +26,7 @@ const CDN = {
'https://cdn.jsdelivr.net/npm/vant@2.12/lib/vant.min.js'
]
}
const publicPath = '/scrm-equity-h5/'
const publicPath = '/scrm-equity/'
module.exports = {
// publicPath,
devServer: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!