mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-20 23:40:27 +00:00
perf: 优化移动端网络错误提示
This commit is contained in:
parent
bebeb49ae4
commit
3a3ecd920f
@ -14,7 +14,7 @@
|
|||||||
<RightBottom/>
|
<RightBottom/>
|
||||||
|
|
||||||
<!--网络提示-->
|
<!--网络提示-->
|
||||||
<NetworkException/>
|
<NetworkException v-if="windowLarge"/>
|
||||||
|
|
||||||
<!--图片预览-->
|
<!--图片预览-->
|
||||||
<PreviewImageState/>
|
<PreviewImageState/>
|
||||||
|
|||||||
@ -16,6 +16,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
<NetworkException v-if="windowSmall" type="alert"/>
|
||||||
<ul class="tabbar-box">
|
<ul class="tabbar-box">
|
||||||
<li v-for="item in navList" @click="toggleRoute(item.name)" :class="{active: activeName === item.name}">
|
<li v-for="item in navList" @click="toggleRoute(item.name)" :class="{active: activeName === item.name}">
|
||||||
<i class="taskfont" v-html="item.icon"></i>
|
<i class="taskfont" v-html="item.icon"></i>
|
||||||
@ -36,10 +37,11 @@
|
|||||||
<script>
|
<script>
|
||||||
import {mapGetters, mapState} from "vuex";
|
import {mapGetters, mapState} from "vuex";
|
||||||
import {Store} from "le5le-store";
|
import {Store} from "le5le-store";
|
||||||
|
import NetworkException from "../NetworkException";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MobileTabbar",
|
name: "MobileTabbar",
|
||||||
|
components: {NetworkException},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isMore: false,
|
isMore: false,
|
||||||
|
|||||||
@ -1,22 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<Modal
|
<div class="common-network-exception">
|
||||||
v-model="show"
|
<Alert v-if="type==='alert' && show" type="error" show-icon closable>{{$L('网络连接失败,请检查网络设置。')}}</Alert>
|
||||||
:width="416"
|
<Modal
|
||||||
:closable="false"
|
v-else
|
||||||
:footer-hide="true"
|
v-model="show"
|
||||||
class-name="common-network-exception">
|
:width="416"
|
||||||
<div class="ivu-modal-confirm">
|
:closable="false"
|
||||||
<div class="ivu-modal-confirm-head">
|
:footer-hide="true"
|
||||||
<div class="ivu-modal-confirm-head-icon ivu-modal-confirm-head-icon-error"><Icon type="ios-close-circle"/></div><div class="ivu-modal-confirm-head-title">{{$L('温馨提示')}}</div>
|
class-name="common-network-exception-modal">
|
||||||
|
<div class="ivu-modal-confirm">
|
||||||
|
<div class="ivu-modal-confirm-head">
|
||||||
|
<div class="ivu-modal-confirm-head-icon ivu-modal-confirm-head-icon-error"><Icon type="ios-close-circle"/></div><div class="ivu-modal-confirm-head-title">{{$L('温馨提示')}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="ivu-modal-confirm-body">
|
||||||
|
<div>{{$L('网络连接失败,请检查网络设置。')}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="ivu-modal-confirm-footer">
|
||||||
|
<Button type="primary" @click="show = false">{{$L('确定')}}</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ivu-modal-confirm-body">
|
</Modal>
|
||||||
<div>{{$L('网络连接失败,请检查网络设置。')}}</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="ivu-modal-confirm-footer">
|
|
||||||
<Button type="primary" @click="show = false">{{$L('确定')}}</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Modal>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -24,12 +28,22 @@ import {mapState} from "vuex";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'NetworkException',
|
name: 'NetworkException',
|
||||||
|
props: {
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
default: 'modal'
|
||||||
|
},
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
show: false,
|
show: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
beforeDestroy() {
|
||||||
|
this.show = false
|
||||||
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState([ 'ajaxNetworkException' ]),
|
...mapState([ 'ajaxNetworkException' ]),
|
||||||
},
|
},
|
||||||
|
|||||||
18
resources/assets/sass/components/mobile.scss
vendored
18
resources/assets/sass/components/mobile.scss
vendored
@ -9,6 +9,24 @@
|
|||||||
z-index: 99;
|
z-index: 99;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
|
.common-network-exception {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 72px;
|
||||||
|
width: 100%;
|
||||||
|
.ivu-alert {
|
||||||
|
margin: 0 12px;
|
||||||
|
&.ivu-alert-with-icon {
|
||||||
|
.ivu-alert-icon {
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.ivu-alert-error {
|
||||||
|
background-color: rgba(255, 240, 231, 0.95);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.tabbar-box {
|
.tabbar-box {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user