Authored by TaoHuang

fix($report): 修复上报的问题

... ... @@ -194,8 +194,8 @@ router.onReady(() => {
params: {
appop: 'XY_H5_PAGE_OPEN_L',
param: {
F_URL: `${location.origin}${from.fullPath}`,
PAGE_URL: `${location.origin}${to.fullPath}`,
F_URL: `${location.origin}${from?.fullPath}`,
PAGE_URL: `${location.origin}${to?.fullPath}`,
PAGE_NAME: to.name,
},
},
... ... @@ -205,8 +205,8 @@ router.onReady(() => {
params: {
appop: 'XY_H5_PAGE_EXIT_L',
param: {
F_URL: `${location.origin}${to.fullPath}`,
PAGE_URL: `${location.origin}${from.fullPath}`,
F_URL: `${location.origin}${to?.fullPath}`,
PAGE_URL: `${location.origin}${from?.fullPath}`,
PAGE_NAME: from.name,
},
},
... ...
... ... @@ -14,6 +14,7 @@
<script>
import Tabs from './components/tabs';
import { mapState, mapMutations } from 'vuex';
export default {
name: 'IndexPage',
... ... @@ -21,11 +22,18 @@ export default {
components: {
Tabs
},
computed: {
...mapState(['yoho'])
},
mounted() {
this.SET_QUERY(this.$route.query ? this.$route.query : {});
},
methods: {
...mapMutations(['SET_QUERY']),
onClick(index) {
this.$store.dispatch('reportYas', {
params: {
param: {TAB_ID: index + 1 },
param: { TAB_ID: index + 1 },
appop: 'XY_UFO_MAIN_TAB'
}
});
... ... @@ -42,20 +50,20 @@ export default {
this.$yoho.auth({
refer: '/xianyu/index/news'
}).then((res) => {
if(res) {
if (res) {
this.go('NewsPage');
}
})
});
break;
}
case 3: {
this.$yoho.auth({
refer: '/xianyu/index/mine'
}).then((res) => {
if(res) {
if (res) {
this.go('MinePage');
}
})
});
break;
}
default: {
... ... @@ -65,7 +73,10 @@ export default {
},
go(name) {
this.$router.replace({
name
name,
query: {
...this.yoho.context.query
}
});
}
}
... ...
... ... @@ -24,7 +24,8 @@ export default function(mergeState = {}) {
isLogin: false,
userHeadIco: '',
userName: '',
enableQiugou: null, // 是否启用求购,默认不启用, null: 初始状态标识,需要请求api, false: 不启用, true: 启用
enableQiugou: null, // 是否启用求购,默认不启用, null: 初始状态标识,需要请求api, false: 不启用, true: 启用,
query: {}
},
window: {
statusBarStatus: false,
... ... @@ -140,6 +141,9 @@ export default function(mergeState = {}) {
},
[Types.FETCH_XIANYU_CONFIG](state, data) {
state.config = data;
},
[Types.SET_QUERY](state, data) {
state.context.query = data;
}
},
getters: {
... ... @@ -228,6 +232,22 @@ export default function(mergeState = {}) {
},
asyncindx,
);
if (window._yasEvents) {
window._yasEvents.forEach(e => {
window._yas.sendAppLogs(
{
appop: e.appop,
param: e.param ? JSON.stringify(e.param) : '{}',
},
asyncindx,
);
});
window._yasEvents = null;
}
} else {
window._yasEvents = window._yasEvents ? window._yasEvents.push({ appop, param }) : [{ appop, param }];
}
}, 300);
} catch (e) {
... ...
... ... @@ -21,3 +21,5 @@ export const FETCH_USER_INFO_FAILD = 'FETCH_USER_INFO_FAILD';
export const FETCH_USER_INFO_SUCCESS = 'FETCH_USER_INFO_SUCCESS';
export const FETCH_XIANYU_CONFIG = 'FETCH_XIANYU_CONFIG';
export const SET_QUERY = 'SET_QUERY';
... ...