加载优化

This commit is contained in:
仲么了
2023-08-30 10:03:07 +08:00
parent d0168235d4
commit d61a1614f9
9 changed files with 85 additions and 64 deletions

View File

@@ -20,13 +20,14 @@ export default {
url: '/pages/user/login',
})
}
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
if (!userInfo) return
// 查询字典
queryDictDataCache().then((res) => {
uni.setStorageSync(this.$cacheKey.dictData, res.data)
})
// 更新用户头像
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
if (userInfo.headSculpture) {
getImageUrl(userInfo.headSculpture).then((res) => {
userInfo.avatar = res.data

View File

@@ -4,10 +4,8 @@
<navigator url="/pages/user/login" hover-class="none" class="page-login-btn">登录</navigator>
</template>
<template v-else>
<view class="loading" v-if="loading">
<zero-loading v-if="loading"></zero-loading>
</view>
<slot name="body" v-if="!loading"></slot>
<zero-loading v-if="loading" mask></zero-loading>
<slot name="body" v-if="beforeRender|| !loading "></slot>
</template>
</view>
</template>
@@ -20,6 +18,10 @@ export default {
type: Boolean,
default: false,
},
beforeRender: {
type: Boolean,
default: false,
},
showLoginMsk: Boolean,
noPadding: Boolean,
},

View File

@@ -132,7 +132,7 @@
"/api" : {
"https" : true,
// "target" : "https://china.indpecker.com",
"target" : "http://192.168.1.13:10215",
"target" : "http://192.168.1.115:10215",
"changOrigin" : true,
"pathRewrite" : {
"/api" : ""

View File

@@ -1,5 +1,5 @@
<template>
<Cn-page :loading="loading" noPadding>
<Cn-page :loading="loading" noPadding beforeRender>
<view slot="body">
<view class="detail" :style="{ opacity: domLoading ? '0' : '1' }" style="overflow: hidden">
<view class="detail-header">
@@ -61,7 +61,7 @@
</view>
</view>
</view>
<view class="content" v-if="deviceInfo">
<view class="content" v-if="!loading">
<view v-if="navMenuActive == 0">
<basic :basicData="basicData"></basic>
</view>
@@ -75,7 +75,7 @@
<oscillogram></oscillogram>
</view> -->
<view v-else-if="navMenuActive == 3">
<IO :deviceInfo="deviceInfo"></IO>
<IO :basicData="basicData"></IO>
</view>
<view style="height: 20rpx"></view>
</view>

View File

@@ -367,8 +367,8 @@ export default {
console.log(res)
this.$util.toast('提交成功')
let prePage = this.$util.prePage()
prePage.init()
console.log(prePage)
console.log(prePage.$vm)
prePage.$vm.init()
setTimeout(() => {
uni.navigateBack({delta: 1})
}, 1500)
@@ -470,6 +470,7 @@ export default {
.point {
white-space: nowrap;
font-size: 24rpx;
}
}

View File

@@ -521,6 +521,7 @@ export default {
.point {
white-space: nowrap;
font-size: 24rpx;
}
}

File diff suppressed because one or more lines are too long

View File

@@ -1,13 +1,13 @@
<template>
<Cn-page :loading="loading">
<Cn-page :loading="loading" beforeRender>
<view slot="body">
<view class="transfer">
<!-- <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 ref="uqrcode" canvas-id="qrcode" :value="content" size="200"
@complete="complete"
:loading="false"></uqrcode>
<canvas id="qrcode" width="200" height="200"></canvas>
<view style="height: 200rpx"></view>
<view class="transfer-text ">请让接收人员扫码接收</view>
<view class="transfer-btn">
<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 {
data() {
return {
loading: false,
loading: true,
content: '',
options: {},
}
},
methods: {
complete() {
this.loading = false
},
back() {
uni.navigateBack({delta: 1})
},

View File

@@ -94,7 +94,7 @@
bottom: 0;
height: 100vh;
width: 100vw;
background: rgba(7, 17, 27, .3);
background: #f3f4f5;
transform: translate(0, 0);
}
</style>