|
@@ -67,7 +67,7 @@
|
|
|
<div
|
|
|
class="swiper-pagination"
|
|
|
slot="pagination"
|
|
|
- v-if="lengthShow"
|
|
|
+ v-show="lengthShow"
|
|
|
></div>
|
|
|
</swiper>
|
|
|
<div
|
|
@@ -168,10 +168,34 @@ export default {
|
|
|
data: {},
|
|
|
iconArr,
|
|
|
active: "",
|
|
|
+ // 标题的第一个和内容的第一个
|
|
|
+ fisTit: "",
|
|
|
+ fisTxt: "",
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
active(newVal) {
|
|
|
+ // 定制的热点信息,并且切换为视频
|
|
|
+ if (this.myFlag && newVal == "video") {
|
|
|
+ this.myInd = 0;
|
|
|
+ this.data.title[0] = this.data.videoTit;
|
|
|
+ this.data.content[0] = this.data.videoTxt;
|
|
|
+ } else {
|
|
|
+ this.data.title[0] = this.fisTit;
|
|
|
+ this.data.content[0] = this.fisTxt;
|
|
|
+ }
|
|
|
+ if (newVal == "images") this.myInd = 0;
|
|
|
+ // 判断是否只有一张图片或者视频,ifrm lengthShow
|
|
|
+ let tempType = this.data[this.active];
|
|
|
+ if (typeof tempType === "number") {
|
|
|
+ if (tempType > 1) this.lengthShow = true;
|
|
|
+ else this.lengthShow = false;
|
|
|
+ } else {
|
|
|
+ if (tempType && tempType.length && tempType.length > 1)
|
|
|
+ this.lengthShow = true;
|
|
|
+ else this.lengthShow = false;
|
|
|
+ }
|
|
|
+
|
|
|
if (!newVal) {
|
|
|
return;
|
|
|
}
|
|
@@ -211,7 +235,9 @@ export default {
|
|
|
dom.show();
|
|
|
},
|
|
|
imgSrc(val) {
|
|
|
- // if (typeof val === "number") return `/data/${this.m}/img/${val}${this.data.suf}`; //线下调试
|
|
|
+ if (typeof val === "number")
|
|
|
+ // return `/data/${this.m}/img/${val}${this.data.suf}`;
|
|
|
+ //线下调试
|
|
|
if (typeof val === "number") return `/erhai/data/${this.m}/img/${val}${this.data.suf}`; //打包
|
|
|
else return val;
|
|
|
},
|
|
@@ -235,17 +261,22 @@ export default {
|
|
|
}/hot/js/data.js?time=${Math.random()}`;
|
|
|
let result = (await this.$http.get(url)).data;
|
|
|
let temp = result[this.m];
|
|
|
- console.log(temp);
|
|
|
let tempObj;
|
|
|
tempObj = obj.find((v) => v.id === this.m);
|
|
|
- if(tempObj) {
|
|
|
- temp=tempObj
|
|
|
- this.myFlag=true
|
|
|
- }
|
|
|
- else {
|
|
|
+ if (tempObj) {
|
|
|
+ temp = tempObj;
|
|
|
+ // 把标题的第一个和内容的第一个信息存起来
|
|
|
+ this.fisTit = temp.title[0];
|
|
|
+ this.fisTxt = temp.content[0];
|
|
|
+ this.myFlag = true;
|
|
|
+ } else {
|
|
|
+ // 把标题的第一个和内容的第一个信息存起来
|
|
|
+ this.fisTit = temp.title;
|
|
|
+ this.fisTxt = temp.content;
|
|
|
temp.content = [temp.content];
|
|
|
temp.title = [temp.title];
|
|
|
- this.myFlag=false
|
|
|
+
|
|
|
+ this.myFlag = false;
|
|
|
}
|
|
|
|
|
|
this.data = temp;
|
|
@@ -264,14 +295,6 @@ export default {
|
|
|
item.display = true;
|
|
|
}
|
|
|
});
|
|
|
- // 判断是否只有一张图片或者视频,ifrm lengthShow
|
|
|
- let tempType = this.data[this.active];
|
|
|
- if (typeof tempType === "number") {
|
|
|
- if (tempType > 1) this.lengthShow = true;
|
|
|
- } else {
|
|
|
- if (tempType && tempType.length && tempType.length > 1)
|
|
|
- this.lengthShow = true;
|
|
|
- }
|
|
|
},
|
|
|
|
|
|
colseParent(item) {
|