From db2f5ec6d7eeff6d7cc67a846be6e22cf3636edc Mon Sep 17 00:00:00 2001 From: 康凯 <kangk26@foxmail.com> Date: Mon, 23 May 2022 19:06:04 +0800 Subject: [PATCH] bug:没有内容时,提示“暂无内容” --- src/views/memory/detailImage.vue | 218 +++++++++++++++++++++--------------------- src/views/personage/detailImage.vue | 12 +- src/views/spirit/detailvideo.vue | 12 +- src/views/scenery/detailvideo.vue | 4 src/views/memory/detailvideo.vue | 12 +- src/views/personage/detailvideo.vue | 12 +- src/views/spirit/detailImage.vue | 12 +- src/views/scenery/detailImage.vue | 12 +- 8 files changed, 147 insertions(+), 147 deletions(-) diff --git a/src/views/memory/detailImage.vue b/src/views/memory/detailImage.vue index a4986ef..420dec4 100644 --- a/src/views/memory/detailImage.vue +++ b/src/views/memory/detailImage.vue @@ -1,71 +1,71 @@ <template> - <div class="data-detail-image"> - <div class="images"> - <mt-swipe :show-indicators="false" :auto="0" :continuous="false" @change="ChangeImage"> - <mt-swipe-item v-for="item in images.data" :key="item.key"> - <img :src="item.path"/> - </mt-swipe-item> - </mt-swipe> - </div> - <div class="content"> - <mt-navbar v-model="navIndex"> - <mt-tab-item id="1">关键词</mt-tab-item> - <mt-tab-item id="2">简介</mt-tab-item> - </mt-navbar> - <div class="line"></div> - <mt-tab-container v-model="navIndex"> - <mt-tab-container-item id="1"> - {{ image.keyWord }} - </mt-tab-container-item> - <mt-tab-container-item id="2"> - {{ image.introduction }} - </mt-tab-container-item> - </mt-tab-container> - </div> - </div> + <div class="data-detail-image"> + <div class="images"> + <mt-swipe :show-indicators="false" :auto="0" :continuous="false" @change="ChangeImage"> + <mt-swipe-item v-for="item in images.data" :key="item.key"> + <img :src="item.path"/> + </mt-swipe-item> + </mt-swipe> + </div> + <div class="content"> + <mt-navbar v-model="navIndex"> + <mt-tab-item id="1">关键词</mt-tab-item> + <mt-tab-item id="2">简介</mt-tab-item> + </mt-navbar> + <div class="line"></div> + <mt-tab-container v-model="navIndex"> + <mt-tab-container-item id="1"> + {{ image.keyWord == "" ? "暂无内容" : image.keyWord }} + </mt-tab-container-item> + <mt-tab-container-item id="2"> + {{ image.introduction == "" ? "暂无内容" : image.introduction }} + </mt-tab-container-item> + </mt-tab-container> + </div> + </div> </template> <script> import {GetImageDetail as Api_GetImageDetail} from "@/api/apilist"; export default { - name: "detailImage", - data() { - return { - navIndex: "1", - images: { - pageSize: 10, - currentPage: 1, - total: 0, - data: [] - }, - image: { - id: "", - name: "", - path: "", - keyWord: "", - introduction: "", - } - } - }, - methods: { - ChangeImage: function (index) { - this.image = this.images.data[index]; - }, - }, - created() { - let imageId = this.$route.query.id; - let objId = this.$route.query.objId; - Api_GetImageDetail(imageId, 1, objId, 999).then(res => { - this.images = res; - this.image = res.data[0]; - }, rej => { - alert(rej); - }).catch(err => { - console.log(err); - alert('错误的请求!'); - }); - } + name: "detailImage", + data() { + return { + navIndex: "1", + images: { + pageSize: 10, + currentPage: 1, + total: 0, + data: [] + }, + image: { + id: "", + name: "", + path: "", + keyWord: "", + introduction: "", + } + } + }, + methods: { + ChangeImage: function (index) { + this.image = this.images.data[index]; + }, + }, + created() { + let imageId = this.$route.query.id; + let objId = this.$route.query.objId; + Api_GetImageDetail(imageId, 1, objId, 999).then(res => { + this.images = res; + this.image = res.data[0]; + }, rej => { + alert(rej); + }).catch(err => { + console.log(err); + alert('错误的请求!'); + }); + } } </script> @@ -73,90 +73,90 @@ .data-detail-image { - width: 100%; + width: 100%; } .images { - width: 100%; - height: 31.5vh; + width: 100%; + height: 31.5vh; } .images img { - width: 100%; - height: 100%; - object-fit: cover; + width: 100%; + height: 100%; + object-fit: cover; } .content { - width: 100%; - height: 66vh; - box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16); - opacity: 1; - border-radius: 10px; + width: 100%; + height: 66vh; + box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16); + opacity: 1; + border-radius: 10px; - padding-top: 1vh; + padding-top: 1vh; } -.content > div{ - width: 90%; - margin-left: 5%; +.content > div { + width: 90%; + margin-left: 5%; } -.content > .line{ - width: 100%; - background: #F8F8F8; - margin-left: 0; - height: 1vh; +.content > .line { + width: 100%; + background: #F8F8F8; + margin-left: 0; + height: 1vh; } .mint-navbar { - width: 100%; + width: 100%; } -.mint-navbar /deep/ .mint-tab-item{ - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; +.mint-navbar /deep/ .mint-tab-item { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; - padding: 7px 0; + padding: 7px 0; } .mint-navbar /deep/ .mint-tab-item-label { - width: 8rem; - font-size: 2rem; - font-family: Source Han Sans CN; - font-weight: 500; - line-height: 2rem; - color: #767676; - opacity: 1; + width: 8rem; + font-size: 2rem; + font-family: Source Han Sans CN; + font-weight: 500; + line-height: 2rem; + color: #767676; + opacity: 1; - padding: 10px 0; + padding: 10px 0; } .mint-navbar /deep/ .is-selected { - color: #BC0000; - border-bottom: 0px; + color: #BC0000; + border-bottom: 0px; } .mint-navbar /deep/ .is-selected .mint-tab-item-label { - color: #BC0000; - border-bottom: 0.3vh solid #BC0000; + color: #BC0000; + border-bottom: 0.3vh solid #BC0000; } .mint-tab-container { - width: 100%; + width: 100%; } .mint-tab-container { - text-align: left; - font-size: 1.87rem; - font-family: Source Han Serif CN; - font-weight: 400; - line-height: 3rem; - color: #585858; - opacity: 1; - margin-top: 2vh; + text-align: left; + font-size: 1.87rem; + font-family: Source Han Serif CN; + font-weight: 400; + line-height: 3rem; + color: #585858; + opacity: 1; + margin-top: 2vh; } </style> diff --git a/src/views/memory/detailvideo.vue b/src/views/memory/detailvideo.vue index f755c4c..79e0d1a 100644 --- a/src/views/memory/detailvideo.vue +++ b/src/views/memory/detailvideo.vue @@ -11,12 +11,12 @@ <mt-tab-item id="2">简介</mt-tab-item> </mt-navbar> <mt-tab-container v-model="navIndex"> - <mt-tab-container-item id="1"> - {{ video.keyWord }} - </mt-tab-container-item> - <mt-tab-container-item id="2"> - {{ video.introduction }} - </mt-tab-container-item> + <mt-tab-container-item id="1"> + {{ video.keyWord == ""?"暂无内容": video.keyWord}} + </mt-tab-container-item> + <mt-tab-container-item id="2"> + {{ video.introduction == ""?"暂无内容": video.introduction}} + </mt-tab-container-item> </mt-tab-container> </div> </div> diff --git a/src/views/personage/detailImage.vue b/src/views/personage/detailImage.vue index a4986ef..0f827f8 100644 --- a/src/views/personage/detailImage.vue +++ b/src/views/personage/detailImage.vue @@ -14,12 +14,12 @@ </mt-navbar> <div class="line"></div> <mt-tab-container v-model="navIndex"> - <mt-tab-container-item id="1"> - {{ image.keyWord }} - </mt-tab-container-item> - <mt-tab-container-item id="2"> - {{ image.introduction }} - </mt-tab-container-item> + <mt-tab-container-item id="1"> + {{ image.keyWord == "" ? "暂无内容" : image.keyWord }} + </mt-tab-container-item> + <mt-tab-container-item id="2"> + {{ image.introduction == "" ? "暂无内容" : image.introduction }} + </mt-tab-container-item> </mt-tab-container> </div> </div> diff --git a/src/views/personage/detailvideo.vue b/src/views/personage/detailvideo.vue index f755c4c..79e0d1a 100644 --- a/src/views/personage/detailvideo.vue +++ b/src/views/personage/detailvideo.vue @@ -11,12 +11,12 @@ <mt-tab-item id="2">简介</mt-tab-item> </mt-navbar> <mt-tab-container v-model="navIndex"> - <mt-tab-container-item id="1"> - {{ video.keyWord }} - </mt-tab-container-item> - <mt-tab-container-item id="2"> - {{ video.introduction }} - </mt-tab-container-item> + <mt-tab-container-item id="1"> + {{ video.keyWord == ""?"暂无内容": video.keyWord}} + </mt-tab-container-item> + <mt-tab-container-item id="2"> + {{ video.introduction == ""?"暂无内容": video.introduction}} + </mt-tab-container-item> </mt-tab-container> </div> </div> diff --git a/src/views/scenery/detailImage.vue b/src/views/scenery/detailImage.vue index 7d609ab..ee8e973 100644 --- a/src/views/scenery/detailImage.vue +++ b/src/views/scenery/detailImage.vue @@ -15,12 +15,12 @@ </mt-navbar> <div class="line"></div> <mt-tab-container v-model="navIndex"> - <mt-tab-container-item id="1"> - {{ image.keyWord }} - </mt-tab-container-item> - <mt-tab-container-item id="2"> - {{ image.introduction }} - </mt-tab-container-item> + <mt-tab-container-item id="1"> + {{ image.keyWord == "" ? "暂无内容" : image.keyWord }} + </mt-tab-container-item> + <mt-tab-container-item id="2"> + {{ image.introduction == "" ? "暂无内容" : image.introduction }} + </mt-tab-container-item> </mt-tab-container> </div> </div> diff --git a/src/views/scenery/detailvideo.vue b/src/views/scenery/detailvideo.vue index f755c4c..e87a6c4 100644 --- a/src/views/scenery/detailvideo.vue +++ b/src/views/scenery/detailvideo.vue @@ -12,10 +12,10 @@ </mt-navbar> <mt-tab-container v-model="navIndex"> <mt-tab-container-item id="1"> - {{ video.keyWord }} + {{ video.keyWord == ""?"暂无内容": video.keyWord}} </mt-tab-container-item> <mt-tab-container-item id="2"> - {{ video.introduction }} + {{ video.introduction == ""?"暂无内容": video.introduction}} </mt-tab-container-item> </mt-tab-container> </div> diff --git a/src/views/spirit/detailImage.vue b/src/views/spirit/detailImage.vue index a4986ef..0f827f8 100644 --- a/src/views/spirit/detailImage.vue +++ b/src/views/spirit/detailImage.vue @@ -14,12 +14,12 @@ </mt-navbar> <div class="line"></div> <mt-tab-container v-model="navIndex"> - <mt-tab-container-item id="1"> - {{ image.keyWord }} - </mt-tab-container-item> - <mt-tab-container-item id="2"> - {{ image.introduction }} - </mt-tab-container-item> + <mt-tab-container-item id="1"> + {{ image.keyWord == "" ? "暂无内容" : image.keyWord }} + </mt-tab-container-item> + <mt-tab-container-item id="2"> + {{ image.introduction == "" ? "暂无内容" : image.introduction }} + </mt-tab-container-item> </mt-tab-container> </div> </div> diff --git a/src/views/spirit/detailvideo.vue b/src/views/spirit/detailvideo.vue index f755c4c..79e0d1a 100644 --- a/src/views/spirit/detailvideo.vue +++ b/src/views/spirit/detailvideo.vue @@ -11,12 +11,12 @@ <mt-tab-item id="2">简介</mt-tab-item> </mt-navbar> <mt-tab-container v-model="navIndex"> - <mt-tab-container-item id="1"> - {{ video.keyWord }} - </mt-tab-container-item> - <mt-tab-container-item id="2"> - {{ video.introduction }} - </mt-tab-container-item> + <mt-tab-container-item id="1"> + {{ video.keyWord == ""?"暂无内容": video.keyWord}} + </mt-tab-container-item> + <mt-tab-container-item id="2"> + {{ video.introduction == ""?"暂无内容": video.introduction}} + </mt-tab-container-item> </mt-tab-container> </div> </div> -- Gitblit v1.9.3