|
@@ -1,24 +1,55 @@
|
|
|
<template>
|
|
|
- <view class="main"> </view>
|
|
|
+ <view class="main">
|
|
|
+ <view class="one">
|
|
|
+ <image class="logo" :src="logoUrl"></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
data() {
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ logoUrl: ''
|
|
|
+ };
|
|
|
},
|
|
|
- onLoad: function() {
|
|
|
+ onLoad: async function() {
|
|
|
const that = this;
|
|
|
- that.searchToken();
|
|
|
+ await that.searchConfig();
|
|
|
+ await that.searchOpenid();
|
|
|
},
|
|
|
methods: {
|
|
|
- searchToken() {
|
|
|
+ // 查询基本设置
|
|
|
+ async searchConfig() {
|
|
|
+ const that = this;
|
|
|
+ let res = await that.$api(`/config`, 'GET', {});
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ that.$set(that, `logoUrl`, res.data.logo_url[0].url);
|
|
|
+ uni.setStorage({
|
|
|
+ key: 'config',
|
|
|
+ data: res.data,
|
|
|
+ success: function(res) {},
|
|
|
+ fail: function(err) {
|
|
|
+ console.log(err);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async searchOpenid() {
|
|
|
const that = this;
|
|
|
try {
|
|
|
const res = uni.getStorageSync('openid');
|
|
|
- uni.reLaunch({
|
|
|
- url: `/pages/home/index`
|
|
|
- })
|
|
|
+ const aee = await that.$api(`/login/wxapp/${res}`, 'POST', {})
|
|
|
+ if (aee.errcode == '0') {
|
|
|
+ uni.reLaunch({
|
|
|
+ url: `/pages/home/index`
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: aee.errmsg,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
} catch (e) {
|
|
|
uni.showToast({
|
|
|
title: err.errmsg,
|
|
@@ -26,10 +57,26 @@
|
|
|
duration: 2000
|
|
|
});
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+ .main {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+
|
|
|
+ .one {
|
|
|
+ .logo {
|
|
|
+ width: 50vw;
|
|
|
+ height: 50vw;
|
|
|
+ border-radius: 90px;
|
|
|
+ box-shadow: 0 0 5px var(--f1Color);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|