<template>
|
<view>
|
|
</view>
|
</template>
|
|
<script>
|
const app = getApp();
|
import {
|
mapGetters
|
} from "vuex";
|
import {
|
LOGO_URL,
|
EXPIRES_TIME,
|
USER_INFO,
|
STATE_R_KEY,
|
BACK_URL
|
} from '@/config/cache';
|
import Routine from '@/libs/routine';
|
import wechat from "@/libs/wechat";
|
export default {
|
data() {
|
return {
|
myOptions:{}
|
}
|
},
|
onLaunch(option) {},
|
onLoad() {},
|
onShow() {
|
let that = this;
|
let pages = getCurrentPages(),
|
currPage = pages[pages.length - 1];
|
let option = currPage.options;
|
console.log('wechat_login options', option);
|
|
this.myOptions = option;
|
that.thirdGo()
|
},
|
methods: {
|
back() {
|
uni.navigateBack();
|
},
|
home() {
|
uni.switchTab({
|
url: '/pages/index/index'
|
})
|
},
|
thirdGo() {
|
let that = this;
|
if (this.$store.getters.isLogin) {
|
Routine.getLastUserInfo();
|
}
|
let backUrl = this.$Cache.get(BACK_URL) || "/pages/index/index";
|
if (backUrl.indexOf('pages/users/login/index') >= 0) {
|
backUrl = '/pages/index/index';
|
}
|
if (that.myOptions.back_url) {
|
backUrl = decodeURIComponent(that.myOptions.back_url);
|
}
|
if (!this.$store.getters.isLogin) {
|
if (backUrl.indexOf('pages/users/order_list') >= 0) {
|
backUrl = '/pages/user/index';
|
}
|
}
|
if (backUrl.indexOf('/') > 0) {
|
backUrl = '/' + backUrl;
|
}
|
console.log('login backUrl:' + backUrl);
|
if (backUrl) {
|
if (backUrl.indexOf('pages/index/index') >= 0 ||
|
backUrl.indexOf('pages/goods_cate/goods_cate') >= 0 ||
|
backUrl.indexOf('pages/user/index') >= 0
|
) {
|
if (backUrl.indexOf('pages/user/index') >= 0) {
|
this.$Cache.set('skipAuthLogin', '1');
|
}
|
uni.switchTab({
|
url: backUrl,
|
success: function(e) {
|
|
}
|
});
|
} else {
|
uni.redirectTo({
|
url: backUrl,
|
success: function(e) {
|
|
}
|
});
|
}
|
}
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
page {
|
background: #fff;
|
height: 100%;
|
}
|
</style>
|