This commit is contained in:
Gaoxs
2020-09-15 15:43:37 +08:00
9 changed files with 5683 additions and 128 deletions

View File

@ -1,105 +1,124 @@
<template>
<view class="lottie-bg">
<view id="lottie">
<image src="../../static/images/live-logo.gif" rel="preload" mode="widthFix" style="width: 100%;" />
</view>
</view>
<view class="lottie-bg">
<view id="lottie">
<image src="../../static/images/live-logo.gif" rel="preload" mode="widthFix" style="width: 100%;" />
</view>
</view>
</template>
<script>
import {
mapState,
mapMutations,
mapActions
} from "vuex";
// 组件
// import request from "@//api/request";
import {
wxappAuth,
getUser
} from "@/api/user";
import dayjs from "dayjs";
import cookie from "@/utils/store/cookie";
import {
parseQuery,
login,
handleQrCode,
getCurrentPageUrl,
handleUrlParam
} from "@/utils";
import {
mapState,
mapMutations,
mapActions
} from "vuex";
// 组件
// import request from "@//api/request";
import {
wxappAuth,
getUser
} from "@/api/user";
import dayjs from "dayjs";
import cookie from "@/utils/store/cookie";
import {
parseQuery,
login,
handleQrCode,
getCurrentPageUrl,
handleUrlParam
} from "@/utils";
export default {
name: "Loading",
data() {
return {};
},
onShow() {
export default {
name: "Loading",
data() {
return {};
},
onShow() {
var url = handleQrCode();
if (!url) {
url = handleUrlParam(getCurrentPageUrl())
}
// 判断是否是分销
if (url) {
var spread = cookie.get("spread");
let urlSpread = parseInt(url.spread);
if (!Number.isNaN(urlSpread) && spread !== urlSpread) {
cookie.set("spread", urlSpread || 0);
} else if (spread === 0 || typeof spread !== "number") {
cookie.set("spread", urlSpread || 0);
}
if (this.$store.getters.token) {
this.toLaunch();
return;
}
if (this.$deviceType == "app" || this.$deviceType == "h5") {
this.$yrouter.switchTab({
path: "/pages/home/index"
});
return;
}
login().finally(() => {
this.$yrouter.switchTab({
path: "/pages/home/index"
});
});
}
},
methods: {
...mapActions(["changeAuthorization", "setUserInfo"]),
toLaunch() {
console.log("loading home");
this.changeAuthorization(false);
this.$yrouter.switchTab({
path: "/pages/home/index"
});
}
}
};
var url = handleQrCode();
if (!url) {
url = handleUrlParam(getCurrentPageUrl())
}
// 判断是否是分销
if (url) {
var spread = cookie.get("spread");
let urlSpread = parseInt(url.spread);
if (!Number.isNaN(urlSpread) && spread !== urlSpread) {
cookie.set("spread", urlSpread || 0);
} else if (spread === 0 || typeof spread !== "number") {
cookie.set("spread", urlSpread || 0);
}
if (this.$store.getters.token) {
this.toLaunch();
return;
}
// cookie.get("spread");
// if (this.$deviceType == "weixin") {
// let path = parseQuery().path
// console.log(this)
// if (path) {
// this.$yrouter.push({
// path
// });
// } else {
// this.$yrouter.switchTab({
// path: "/pages/home/index"
// });
// }
// return
// }
// this.toLaunch();
if (this.$deviceType == "app" || this.$deviceType == "h5") {
// this.toLaunch();
this.$yrouter.switchTab({
path: "/pages/home/index"
});
return;
}
login().finally(() => {
this.$yrouter.switchTab({
path: "/pages/home/index"
});
});
}
},
methods: {
...mapActions(["changeAuthorization", "setUserInfo"]),
toLaunch() {
console.log("loading home");
this.changeAuthorization(false);
this.$yrouter.switchTab({
path: "/pages/home/index"
});
}
}
};
</script>
<style scoped lang="less">
.lottie-bg {
position: fixed;
left: 0;
top: 0;
background-color: #fff;
width: 100%;
height: 100%;
z-index: 999;
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center;
-webkit-justify-content: center;
justify-content: center;
}
.lottie-bg {
position: fixed;
left: 0;
top: 0;
background-color: #fff;
width: 100%;
height: 100%;
z-index: 999;
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center;
-webkit-justify-content: center;
justify-content: center;
}
#lottie {
width: 35%;
display: block;
overflow: hidden;
transform: translate3d(0, 0, 0);
margin: auto;
}
</style>
#lottie {
width: 35%;
display: block;
overflow: hidden;
transform: translate3d(0, 0, 0);
margin: auto;
}
</style>

View File

@ -1,18 +1,26 @@
<template>
<view class="index">
<!-- 导航栏 -->
<view class="head_box " :style="{ background: bgcolor }" :class="{ active: bgcolor }">
<view class="cu-custom" :style="[{height:CustomBar+ 'px',}]">
<view class="cu-bar fixed" :style="customStyle" :class="[bgcolor]">
<view class="action">
<text class="nav-title Shop-selector-rect">{{ 'yshop商城' }}</text>
</view>
<view class="content" :style="[{top:StatusBar + 'px'}]">
<!-- <view class="head_box " :style="{ background: bgcolor }" :class="{ active: bgcolor }">-->
<!-- <view class="cu-custom" :style="[{height:CustomBar+ 'px',}]">-->
<!-- <view class="cu-bar fixed" :style="customStyle" :class="[bgcolor]">-->
<!-- <view class="action">-->
<!-- <text class="nav-title Shop-selector-rect">{{ 'yshop商城' }}</text>-->
<!-- </view>-->
<!-- <view class="content" :style="[{top:StatusBar + 'px'}]">-->
</view>
</view>
</view>
</view>
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<view class="head_box " :style="{ background: bgcolor }" :class="{ active: bgcolor }">
<cu-custom :isBack="true" >
<block slot="backText">
<text class="nav-title shopro-selector-rect">{{ 'YSHOP商城' }}</text>
</block>
</cu-custom>
</view>
<view class="header header-search acea-row row-center-wrapper" :style="{ background: bgcolor }">
<view @click="goGoodSearch()" class="search acea-row row-middle">
<text class="iconfont icon-xiazai5"></text>
@ -381,24 +389,22 @@
}
}
.head_box {
position: relative;
z-index: 10;
width: 100%;
// background: #fff;
transition: all linear 0.3s;
.head_box {
width: 750rpx;
// background: #fff;
transition: all linear 0.3s;
/deep/.cuIcon-back {
display: none;
}
/deep/.cuIcon-back {
display: none;
}
.nav-title {
font-size: 38rpx;
font-family: PingFang SC;
font-weight: 500;
color: #fff;
}
}
.nav-title {
font-size: 38rpx;
font-family: PingFang SC;
font-weight: 500;
color: #fff;
}
}
.cu-bar.fixed {
position: fixed;