加载优化
This commit is contained in:
7
App.vue
7
App.vue
@@ -1,6 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import { queryDictDataCache } from './common/api/dictionary.js'
|
import {queryDictDataCache} from './common/api/dictionary.js'
|
||||||
import { getImageUrl } from '@/common/api/basic'
|
import {getImageUrl} from '@/common/api/basic'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function () {
|
onLaunch: function () {
|
||||||
@@ -20,13 +20,14 @@ export default {
|
|||||||
url: '/pages/user/login',
|
url: '/pages/user/login',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||||
|
if (!userInfo) return
|
||||||
// 查询字典
|
// 查询字典
|
||||||
queryDictDataCache().then((res) => {
|
queryDictDataCache().then((res) => {
|
||||||
uni.setStorageSync(this.$cacheKey.dictData, res.data)
|
uni.setStorageSync(this.$cacheKey.dictData, res.data)
|
||||||
})
|
})
|
||||||
|
|
||||||
// 更新用户头像
|
// 更新用户头像
|
||||||
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
|
||||||
if (userInfo.headSculpture) {
|
if (userInfo.headSculpture) {
|
||||||
getImageUrl(userInfo.headSculpture).then((res) => {
|
getImageUrl(userInfo.headSculpture).then((res) => {
|
||||||
userInfo.avatar = res.data
|
userInfo.avatar = res.data
|
||||||
|
|||||||
@@ -4,10 +4,8 @@
|
|||||||
<navigator url="/pages/user/login" hover-class="none" class="page-login-btn">登录</navigator>
|
<navigator url="/pages/user/login" hover-class="none" class="page-login-btn">登录</navigator>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<view class="loading" v-if="loading">
|
<zero-loading v-if="loading" mask></zero-loading>
|
||||||
<zero-loading v-if="loading"></zero-loading>
|
<slot name="body" v-if="beforeRender|| !loading "></slot>
|
||||||
</view>
|
|
||||||
<slot name="body" v-if="!loading"></slot>
|
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -20,6 +18,10 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
beforeRender: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
showLoginMsk: Boolean,
|
showLoginMsk: Boolean,
|
||||||
noPadding: Boolean,
|
noPadding: Boolean,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -132,7 +132,7 @@
|
|||||||
"/api" : {
|
"/api" : {
|
||||||
"https" : true,
|
"https" : true,
|
||||||
// "target" : "https://china.indpecker.com",
|
// "target" : "https://china.indpecker.com",
|
||||||
"target" : "http://192.168.1.13:10215",
|
"target" : "http://192.168.1.115:10215",
|
||||||
"changOrigin" : true,
|
"changOrigin" : true,
|
||||||
"pathRewrite" : {
|
"pathRewrite" : {
|
||||||
"/api" : ""
|
"/api" : ""
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Cn-page :loading="loading" noPadding>
|
<Cn-page :loading="loading" noPadding beforeRender>
|
||||||
<view slot="body">
|
<view slot="body">
|
||||||
<view class="detail" :style="{ opacity: domLoading ? '0' : '1' }" style="overflow: hidden">
|
<view class="detail" :style="{ opacity: domLoading ? '0' : '1' }" style="overflow: hidden">
|
||||||
<view class="detail-header">
|
<view class="detail-header">
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="content" v-if="deviceInfo">
|
<view class="content" v-if="!loading">
|
||||||
<view v-if="navMenuActive == 0">
|
<view v-if="navMenuActive == 0">
|
||||||
<basic :basicData="basicData"></basic>
|
<basic :basicData="basicData"></basic>
|
||||||
</view>
|
</view>
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
<oscillogram></oscillogram>
|
<oscillogram></oscillogram>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view v-else-if="navMenuActive == 3">
|
<view v-else-if="navMenuActive == 3">
|
||||||
<IO :deviceInfo="deviceInfo"></IO>
|
<IO :basicData="basicData"></IO>
|
||||||
</view>
|
</view>
|
||||||
<view style="height: 20rpx"></view>
|
<view style="height: 20rpx"></view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -367,8 +367,8 @@ export default {
|
|||||||
console.log(res)
|
console.log(res)
|
||||||
this.$util.toast('提交成功')
|
this.$util.toast('提交成功')
|
||||||
let prePage = this.$util.prePage()
|
let prePage = this.$util.prePage()
|
||||||
prePage.init()
|
console.log(prePage.$vm)
|
||||||
console.log(prePage)
|
prePage.$vm.init()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack({delta: 1})
|
uni.navigateBack({delta: 1})
|
||||||
}, 1500)
|
}, 1500)
|
||||||
@@ -470,6 +470,7 @@ export default {
|
|||||||
|
|
||||||
.point {
|
.point {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -521,6 +521,7 @@ export default {
|
|||||||
|
|
||||||
.point {
|
.point {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,14 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<Cn-page :loading="loading">
|
<Cn-page :loading="loading" beforeRender>
|
||||||
<view slot="body">
|
<view slot="body">
|
||||||
<view class="transfer">
|
<view class="transfer">
|
||||||
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
|
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
|
||||||
<!-- <uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" :options="{ margin: 10 }"></uqrcode> -->
|
<!-- <uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" :options="{ margin: 10 }"></uqrcode> -->
|
||||||
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" :options="{ margin: 10 }"
|
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" size="200"
|
||||||
|
@complete="complete"
|
||||||
:loading="false"></uqrcode>
|
:loading="false"></uqrcode>
|
||||||
|
<view style="height: 200rpx"></view>
|
||||||
<canvas id="qrcode" width="200" height="200"></canvas>
|
<view class="transfer-text ">请让接收人员扫码接收</view>
|
||||||
<view class="transfer-text">请让接收人员扫码接收</view>
|
|
||||||
<view class="transfer-btn">
|
<view class="transfer-btn">
|
||||||
<button class="transfer-btn-item" style="background-color: #fff; color: #111" @click="back">
|
<button class="transfer-btn-item" style="background-color: #fff; color: #111" @click="back">
|
||||||
返回
|
返回
|
||||||
@@ -28,12 +28,15 @@ import {transferDevice} from "@/common/api/device";
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: true,
|
||||||
content: '',
|
content: '',
|
||||||
options: {},
|
options: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
complete() {
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
back() {
|
back() {
|
||||||
uni.navigateBack({delta: 1})
|
uni.navigateBack({delta: 1})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
<view class="main">
|
<view class="main">
|
||||||
<loading0 v-if="type=='circle'"></loading0>
|
<loading0 v-if="type=='circle'"></loading0>
|
||||||
<loading1 v-if="type=='pulse'"></loading1>
|
<loading1 v-if="type=='pulse'"></loading1>
|
||||||
<loading2 v-if="type=='bounce'"></loading2>
|
<loading2 v-if="type=='bounce'"></loading2>
|
||||||
<loading3 v-if="type=='eyes'"></loading3>
|
<loading3 v-if="type=='eyes'"></loading3>
|
||||||
<loading4 v-if="type=='triangle'"></loading4>
|
<loading4 v-if="type=='triangle'"></loading4>
|
||||||
<loading5 v-if="type=='sun'"></loading5>
|
<loading5 v-if="type=='sun'"></loading5>
|
||||||
<loading6 v-if="type=='love'"></loading6>
|
<loading6 v-if="type=='love'"></loading6>
|
||||||
<loading7 v-if="type=='sword'"></loading7>
|
<loading7 v-if="type=='sword'"></loading7>
|
||||||
<loading8 v-if="type=='atom'"></loading8>
|
<loading8 v-if="type=='atom'"></loading8>
|
||||||
@@ -21,10 +21,10 @@
|
|||||||
<script>
|
<script>
|
||||||
import loading0 from "./static/loading-circle.vue"
|
import loading0 from "./static/loading-circle.vue"
|
||||||
import loading1 from "./static/loading-pulse.vue"
|
import loading1 from "./static/loading-pulse.vue"
|
||||||
import loading2 from "./static/loading-bounce.vue"
|
import loading2 from "./static/loading-bounce.vue"
|
||||||
import loading3 from "./static/loading-eyes.vue"
|
import loading3 from "./static/loading-eyes.vue"
|
||||||
import loading4 from "./static/loading-triangle.vue"
|
import loading4 from "./static/loading-triangle.vue"
|
||||||
import loading5 from "./static/loading-sun.vue"
|
import loading5 from "./static/loading-sun.vue"
|
||||||
import loading6 from "./static/loading-love.vue"
|
import loading6 from "./static/loading-love.vue"
|
||||||
import loading7 from "./static/loading-sword.vue"
|
import loading7 from "./static/loading-sword.vue"
|
||||||
import loading8 from "./static/loading-atom.vue"
|
import loading8 from "./static/loading-atom.vue"
|
||||||
@@ -35,10 +35,10 @@
|
|||||||
components: {
|
components: {
|
||||||
loading0,
|
loading0,
|
||||||
loading1,
|
loading1,
|
||||||
loading2,
|
loading2,
|
||||||
loading3,
|
loading3,
|
||||||
loading4,
|
loading4,
|
||||||
loading5,
|
loading5,
|
||||||
loading6,
|
loading6,
|
||||||
loading7,
|
loading7,
|
||||||
loading8,
|
loading8,
|
||||||
@@ -65,12 +65,12 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleClick() {
|
handleClick() {
|
||||||
this.$emit('click')
|
this.$emit('click')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
background: rgba(7, 17, 27, .3);
|
background: #f3f4f5;
|
||||||
transform: translate(0, 0);
|
transform: translate(0, 0);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user