|
|
|
@ -1,42 +1,29 @@
|
|
|
|
|
<template> |
|
|
|
|
<view class="lottie-bg"> |
|
|
|
|
<view id="lottie"> |
|
|
|
|
<image src="../../static/images/live-logo.gif" rel="preload" mode="widthFix" style="width: 100%;" /> |
|
|
|
|
<image :src="`${$VUE_APP_RESOURCES_URL}/images/live-logo.gif`" rel="preload" mode="widthFix" style="width: 100%;" /> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { |
|
|
|
|
mapState, |
|
|
|
|
mapMutations, |
|
|
|
|
mapActions |
|
|
|
|
} from "vuex"; |
|
|
|
|
import { mapState, mapMutations, mapActions } from 'vuex' |
|
|
|
|
// 组件 |
|
|
|
|
// import request from "@//api/request"; |
|
|
|
|
import { |
|
|
|
|
wxappAuth, |
|
|
|
|
} from "@/api/user"; |
|
|
|
|
import dayjs from "dayjs"; |
|
|
|
|
import store from "@/store"; |
|
|
|
|
import cookie from "@/utils/store/cookie"; |
|
|
|
|
import { |
|
|
|
|
parseQuery, |
|
|
|
|
login, |
|
|
|
|
handleQrCode, |
|
|
|
|
getCurrentPageUrl, |
|
|
|
|
handleUrlParam, |
|
|
|
|
getCurrentPageUrlWithArgs |
|
|
|
|
} from "@/utils"; |
|
|
|
|
import { wxappAuth } from '@/api/user' |
|
|
|
|
import dayjs from 'dayjs' |
|
|
|
|
import store from '@/store' |
|
|
|
|
import cookie from '@/utils/store/cookie' |
|
|
|
|
import { parseQuery, login, handleQrCode, getCurrentPageUrl, handleUrlParam, getCurrentPageUrlWithArgs } from '@/utils' |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
name: "Loading", |
|
|
|
|
name: 'Loading', |
|
|
|
|
data() { |
|
|
|
|
return {}; |
|
|
|
|
return {} |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
console.log('getUser') |
|
|
|
|
var url = handleQrCode(); |
|
|
|
|
var url = handleQrCode() |
|
|
|
|
if (!url) { |
|
|
|
|
url = handleUrlParam(getCurrentPageUrlWithArgs()) |
|
|
|
|
} |
|
|
|
@ -44,49 +31,49 @@
|
|
|
|
|
console.log('判断是否是分销') |
|
|
|
|
// 判断是否是分销 |
|
|
|
|
if (url) { |
|
|
|
|
let urlSpread = parseInt(url.spread); |
|
|
|
|
let urlSpread = parseInt(url.spread) |
|
|
|
|
if (urlSpread) { |
|
|
|
|
cookie.set("spread", urlSpread); |
|
|
|
|
cookie.set('spread', urlSpread) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (this.$deviceType == "app" || this.$deviceType == "weixinh5") { |
|
|
|
|
if (this.$deviceType == 'app' || this.$deviceType == 'weixinh5') { |
|
|
|
|
this.$yrouter.switchTab({ |
|
|
|
|
path: "/pages/home/index" |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
path: '/pages/home/index', |
|
|
|
|
}) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
if (this.$store.getters.token) { |
|
|
|
|
// 如果token存在,直接进行进页面 |
|
|
|
|
console.log('登录状态存在,直接进页面') |
|
|
|
|
this.toLaunch(); |
|
|
|
|
return; |
|
|
|
|
this.toLaunch() |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
console.log('进行登录操作') |
|
|
|
|
login().finally(() => { |
|
|
|
|
this.$yrouter.switchTab({ |
|
|
|
|
path: "/pages/home/index" |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
path: '/pages/home/index', |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
...mapActions(["changeAuthorization", "setUserInfo", "getUser"]), |
|
|
|
|
...mapActions(['changeAuthorization', 'setUserInfo', 'getUser']), |
|
|
|
|
toLaunch() { |
|
|
|
|
console.log("loading home"); |
|
|
|
|
this.changeAuthorization(false); |
|
|
|
|
console.log('loading home') |
|
|
|
|
this.changeAuthorization(false) |
|
|
|
|
let redirect = cookie.get('redirect').replace(/\ /g, '') |
|
|
|
|
if (redirect && redirect.indexOf('/pages') != -1) { |
|
|
|
|
this.$yrouter.replace({ |
|
|
|
|
path: '/pages' + redirect.split('/pages')[1], |
|
|
|
|
}); |
|
|
|
|
cookie.remove('redirect'); |
|
|
|
|
}) |
|
|
|
|
cookie.remove('redirect') |
|
|
|
|
} else { |
|
|
|
|
this.$yrouter.switchTab({ |
|
|
|
|
path: "/pages/home/index" |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
path: '/pages/home/index', |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped lang="less"> |
|
|
|
|