Commit 12002f62 by 无尘

fix: 更新loading

parent ca6f73c9
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-09-08 17:11:02 * @Date: 2020-09-08 17:11:02
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-12-21 10:28:25 * @LastEditTime: 2020-12-22 10:19:42
--> -->
<template> <template>
<div class="app-detail" v-loading="loading"> <div class="app-detail" v-loading="loading">
...@@ -102,7 +102,6 @@ export default { ...@@ -102,7 +102,6 @@ export default {
const that = this; const that = this;
that.loading = true; that.loading = true;
getAppDetail({ menuId, applicationId }).then(res => { getAppDetail({ menuId, applicationId }).then(res => {
that.loading = false;
const { applicationName, applicationDesc, applicationVersion, overTime, adminRange, storeAdminRange, applicationLogo, serverId } = res.result || {}; const { applicationName, applicationDesc, applicationVersion, overTime, adminRange, storeAdminRange, applicationLogo, serverId } = res.result || {};
that.appData.expirationDate = new Date().getTime() - overTime; // 到期时间 that.appData.expirationDate = new Date().getTime() - overTime; // 到期时间
that.appData.expirationDay = overTime - new Date().getTime(); // 剩余到期天数 that.appData.expirationDay = overTime - new Date().getTime(); // 剩余到期天数
......
<template> <template>
<div class="app-list"> <div class="app-list" v-loading="loading">
<template v-for="(item, index) in appList"> <template v-for="(item, index) in appList">
<div v-if="!!item.applications && item.applications.length" class="m-b-50" :key="index+'cate'"> <div v-if="!!item.applications && item.applications.length" class="m-b-50" :key="index+'cate'">
<h3 class="page-title">{{item.applicationCategoryName || '--'}}</h3> <h3 class="page-title">{{item.applicationCategoryName || '--'}}</h3>
...@@ -43,7 +43,8 @@ export default { ...@@ -43,7 +43,8 @@ export default {
name: 'AppList', name: 'AppList',
data() { data() {
return { return {
appList: [] appList: [],
loading: false
}; };
}, },
created() { created() {
...@@ -52,9 +53,10 @@ export default { ...@@ -52,9 +53,10 @@ export default {
}, },
methods: { methods: {
getAppList() { getAppList() {
this.loading = true;
getAppList().then(res => { getAppList().then(res => {
this.appList = res.result || []; this.appList = res.result || [];
}); }).finally(() => this.loading = false);
}, },
/** /**
* @description: 进入后台 * @description: 进入后台
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-10-16 11:46:25 * @Date: 2020-10-16 11:46:25
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-10-30 14:39:37 * @LastEditTime: 2020-12-22 10:16:46
--> -->
<template> <template>
<div class="app-market-body"> <div class="app-market-body" v-loading="loading">
<div class="app-market-account"> <div class="app-market-account">
<el-tooltip class="item" effect="dark" content="绑定服务市场账号后可购买应用。购买信息在服务市场可查看。" placement="top-start"> <span class="font-16 color-303133 font-w-600 common-bottom-border">服务市场账号</span></el-tooltip> <el-tooltip class="item" effect="dark" content="绑定服务市场账号后可购买应用。购买信息在服务市场可查看。" placement="top-start"> <span class="font-16 color-303133 font-w-600 common-bottom-border">服务市场账号</span></el-tooltip>
<el-button :class="['m-l-20 bind-btn-add', marketAccount.accountId ? 'bind-btn-hide': 'bind-btn-show']" type="primary" @click="addAcount">添加</el-button> <el-button :class="['m-l-20 bind-btn-add', marketAccount.accountId ? 'bind-btn-hide': 'bind-btn-show']" type="primary" @click="addAcount">添加</el-button>
...@@ -48,7 +48,8 @@ export default { ...@@ -48,7 +48,8 @@ export default {
bindTime: '', bindTime: '',
bindName: '' bindName: ''
}, },
showDialog: false showDialog: false,
loading: false
}; };
}, },
// 生命周期 - 挂载完成(访问DOM元素) // 生命周期 - 挂载完成(访问DOM元素)
...@@ -81,6 +82,7 @@ export default { ...@@ -81,6 +82,7 @@ export default {
*/ */
getMarket() { getMarket() {
const that = this; const that = this;
that.loading = true;
const para = { const para = {
}; };
getMarketAccount(para) getMarketAccount(para)
...@@ -89,7 +91,8 @@ export default { ...@@ -89,7 +91,8 @@ export default {
}) })
.catch(function(error) { .catch(function(error) {
}); })
.finally(() => that.loading = false);
} }
}, },
watch: {} watch: {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment