|
@@ -9,12 +9,13 @@
|
|
<div
|
|
<div
|
|
class="row"
|
|
class="row"
|
|
v-for="item in topData"
|
|
v-for="item in topData"
|
|
|
|
+ @click="cutType(item.type)"
|
|
:key="item.name"
|
|
:key="item.name"
|
|
:class="{ active: item.type === formData.type }"
|
|
:class="{ active: item.type === formData.type }"
|
|
>
|
|
>
|
|
{{ item.name }}
|
|
{{ item.name }}
|
|
</div>
|
|
</div>
|
|
- <div class="search">
|
|
|
|
|
|
+ <div class="search" @keyup.enter="mySearch">
|
|
<el-input
|
|
<el-input
|
|
prefix-icon="el-icon-search"
|
|
prefix-icon="el-icon-search"
|
|
type="text"
|
|
type="text"
|
|
@@ -22,17 +23,30 @@
|
|
v-model="formData.searchKey"
|
|
v-model="formData.searchKey"
|
|
maxlength="10"
|
|
maxlength="10"
|
|
/>
|
|
/>
|
|
|
|
+ <span class="btnn" @click="mySearch"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <!-- 没有数据的时候 -->
|
|
|
|
+ <div class="hint" v-if="myArr.length === 0">
|
|
|
|
+ <img src="@/assets/img/serachNull.png" alt="" />
|
|
|
|
+ <p>暂时没有数据</p>
|
|
|
|
+ <p>请试一下其他关键字</p>
|
|
|
|
+ </div>
|
|
<!-- 渲染的内容 -->
|
|
<!-- 渲染的内容 -->
|
|
- <div class="infoBox">
|
|
|
|
- <div class="infoRow" :title="item.name" v-for="item in myArr" :key="item.id">
|
|
|
|
|
|
+ <div class="infoBox" v-else>
|
|
|
|
+ <div
|
|
|
|
+ @click="lookInfo(item)"
|
|
|
|
+ class="infoRow"
|
|
|
|
+ :title="item.name"
|
|
|
|
+ v-for="item in myArr"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ >
|
|
<img :src="baseURL + item.thumb" alt="" />
|
|
<img :src="baseURL + item.thumb" alt="" />
|
|
<p>{{ item.name }}</p>
|
|
<p>{{ item.name }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- 分页 -->
|
|
<!-- 分页 -->
|
|
- <div class="paging">
|
|
|
|
|
|
+ <div class="paging" v-show="myArr.length !== 0">
|
|
<el-pagination
|
|
<el-pagination
|
|
layout="prev,pager,next,jumper"
|
|
layout="prev,pager,next,jumper"
|
|
:total="total"
|
|
:total="total"
|
|
@@ -45,6 +59,24 @@
|
|
<!-- 关闭按钮 -->
|
|
<!-- 关闭按钮 -->
|
|
<div class="close el-icon-close" @click="$emit('close')"></div>
|
|
<div class="close el-icon-close" @click="$emit('close')"></div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <!-- 模型和图片 -->
|
|
|
|
+ <div class="model" v-if="modelShow">
|
|
|
|
+ <div class="ifrCon" ref="ifrCon">
|
|
|
|
+ <img :src="baseURL + txtInfo.thumb" alt="" v-if="formData.type==='img'">
|
|
|
|
+ <iframe :src="mySrc" frameborder="0" v-else></iframe>
|
|
|
|
+ <!-- 全屏按钮 -->
|
|
|
|
+ <div class="full" @click="screen" v-if="formData.type==='model'">
|
|
|
|
+ <img src="@/assets/img/tab3FullX.png" alt="" v-if="fullscreen" />
|
|
|
|
+ <img src="@/assets/img/tab3Full.png" alt="" v-else />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="rightTxt">
|
|
|
|
+ <h3>{{ txtInfo.name }}</h3>
|
|
|
|
+ <p>{{txtInfo.description}}</p>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 返回按钮 -->
|
|
|
|
+ <div class="close el-icon-arrow-left" @click="modelShow = false"></div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -74,9 +106,14 @@ export default {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
searchKey: "",
|
|
searchKey: "",
|
|
- type: "img",
|
|
|
|
|
|
+ type: "",
|
|
},
|
|
},
|
|
myArr: [],
|
|
myArr: [],
|
|
|
|
+ // 有关三维模型的数据
|
|
|
|
+ mySrc: "",
|
|
|
|
+ modelShow: false,
|
|
|
|
+ fullscreen: false,
|
|
|
|
+ txtInfo: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
//监听属性 类似于data概念
|
|
//监听属性 类似于data概念
|
|
@@ -85,6 +122,51 @@ export default {
|
|
watch: {},
|
|
watch: {},
|
|
//方法集合
|
|
//方法集合
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 点击模型全屏
|
|
|
|
+ screen() {
|
|
|
|
+ const element = this.$refs.ifrCon; // 获取容器
|
|
|
|
+ if (this.fullscreen) {
|
|
|
|
+ // 如果已经全屏了就退出全屏
|
|
|
|
+
|
|
|
|
+ if (document.exitFullscreen) {
|
|
|
|
+ document.exitFullscreen();
|
|
|
|
+ } else if (document.webkitCancelFullScreen) {
|
|
|
|
+ document.webkitCancelFullScreen();
|
|
|
|
+ } else if (document.mozCancelFullScreen) {
|
|
|
|
+ document.mozCancelFullScreen();
|
|
|
|
+ } else if (document.msExitFullscreen) {
|
|
|
|
+ document.msExitFullscreen();
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ // 如果不是全屏就变成全屏
|
|
|
|
+ if (element.requestFullscreen) {
|
|
|
|
+ element.requestFullscreen();
|
|
|
|
+ } else if (element.webkitRequestFullScreen) {
|
|
|
|
+ element.webkitRequestFullScreen();
|
|
|
|
+ } else if (element.mozRequestFullScreen) {
|
|
|
|
+ element.mozRequestFullScreen();
|
|
|
|
+ } else if (element.msRequestFullscreen) {
|
|
|
|
+ // IE11
|
|
|
|
+ element.msRequestFullscreen();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.fullscreen = !this.fullscreen;
|
|
|
|
+ },
|
|
|
|
+ lookInfo(item) {
|
|
|
|
+ this.txtInfo = item;
|
|
|
|
+ // 三维模型
|
|
|
|
+ this.mySrc ="4dage/Model.html?m=" + item.filePath;
|
|
|
|
+ this.modelShow = true;
|
|
|
|
+ },
|
|
|
|
+ mySearch() {
|
|
|
|
+ this.formData.pageNum = 1;
|
|
|
|
+ this.goodList(this.formData);
|
|
|
|
+ },
|
|
|
|
+ cutType(type) {
|
|
|
|
+ this.formData.type = type;
|
|
|
|
+ this.goodList(this.formData);
|
|
|
|
+ },
|
|
// 分页器方法
|
|
// 分页器方法
|
|
currentChange(val) {
|
|
currentChange(val) {
|
|
// console.log('当前页改变了', val)
|
|
// console.log('当前页改变了', val)
|
|
@@ -102,7 +184,6 @@ export default {
|
|
const res = await goodList(data);
|
|
const res = await goodList(data);
|
|
this.total = res.data.total;
|
|
this.total = res.data.total;
|
|
this.myArr = res.data.records;
|
|
this.myArr = res.data.records;
|
|
- console.log(998, res);
|
|
|
|
},
|
|
},
|
|
},
|
|
},
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
@@ -143,9 +224,17 @@ export default {
|
|
backdrop-filter: blur(4px);
|
|
backdrop-filter: blur(4px);
|
|
z-index: -1;
|
|
z-index: -1;
|
|
}
|
|
}
|
|
|
|
+ .close {
|
|
|
|
+ color: #cc946d;
|
|
|
|
+ font-size: 34px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 40px;
|
|
|
|
+ top: 55px;
|
|
|
|
+ }
|
|
.main {
|
|
.main {
|
|
color: #774926;
|
|
color: #774926;
|
|
- padding: 55px 40px 0;
|
|
|
|
|
|
+ padding: 55px 26px 0;
|
|
position: absolute;
|
|
position: absolute;
|
|
top: 50%;
|
|
top: 50%;
|
|
left: 50%;
|
|
left: 50%;
|
|
@@ -154,14 +243,6 @@ export default {
|
|
height: 700px;
|
|
height: 700px;
|
|
background: url("../../../assets/img/goodBg.png");
|
|
background: url("../../../assets/img/goodBg.png");
|
|
background-size: 100% 100%;
|
|
background-size: 100% 100%;
|
|
- .close {
|
|
|
|
- color: #cc946d;
|
|
|
|
- font-size: 34px;
|
|
|
|
- cursor: pointer;
|
|
|
|
- position: absolute;
|
|
|
|
- right: 40px;
|
|
|
|
- top: 55px;
|
|
|
|
- }
|
|
|
|
.top {
|
|
.top {
|
|
height: 36px;
|
|
height: 36px;
|
|
display: flex;
|
|
display: flex;
|
|
@@ -184,19 +265,45 @@ export default {
|
|
color: #fff6d2;
|
|
color: #fff6d2;
|
|
}
|
|
}
|
|
.search {
|
|
.search {
|
|
|
|
+ position: relative;
|
|
/deep/.el-icon-search {
|
|
/deep/.el-icon-search {
|
|
color: #774926;
|
|
color: #774926;
|
|
font-size: 20px;
|
|
font-size: 20px;
|
|
margin-top: -1px;
|
|
margin-top: -1px;
|
|
}
|
|
}
|
|
|
|
+ .btnn {
|
|
|
|
+ z-index: 10;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 0;
|
|
|
|
+ top: 0;
|
|
|
|
+ height: 36px;
|
|
|
|
+ width: 36px;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ background-color: transparent;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .hint {
|
|
|
|
+ text-align: center;
|
|
|
|
+ margin-top: 100px;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 380px;
|
|
|
|
+ & > p {
|
|
|
|
+ color: #cc946d;
|
|
|
|
+ font-size: 20px;
|
|
|
|
+ margin-top: 20px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.infoBox {
|
|
.infoBox {
|
|
- margin-top: 50px;
|
|
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
+ margin-top: 55px;
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 410px;
|
|
height: 410px;
|
|
- background-color: aqua;
|
|
|
|
.infoRow {
|
|
.infoRow {
|
|
|
|
+ margin-right: 12px;
|
|
|
|
+ margin-bottom: 26px;
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
width: 220px;
|
|
width: 220px;
|
|
@@ -209,6 +316,7 @@ export default {
|
|
object-fit: cover;
|
|
object-fit: cover;
|
|
}
|
|
}
|
|
& > p {
|
|
& > p {
|
|
|
|
+ padding: 0 10px;
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 38px;
|
|
height: 38px;
|
|
line-height: 38px;
|
|
line-height: 38px;
|
|
@@ -218,6 +326,14 @@ export default {
|
|
text-overflow: ellipsis;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
}
|
|
}
|
|
|
|
+ &:nth-of-type(5n) {
|
|
|
|
+ margin-right: 0;
|
|
|
|
+ }
|
|
|
|
+ &:hover {
|
|
|
|
+ & > p {
|
|
|
|
+ color: #cc946d;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.paging {
|
|
.paging {
|
|
@@ -229,7 +345,74 @@ export default {
|
|
justify-content: center;
|
|
justify-content: center;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ // 模型
|
|
|
|
+ .model {
|
|
|
|
+ color: #774926;
|
|
|
|
+ padding: 110px 26px 0;
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 50%;
|
|
|
|
+ left: 50%;
|
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
|
+ width: 1200px;
|
|
|
|
+ height: 700px;
|
|
|
|
+ background: url("../../../assets/img/goodBg.png");
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+ .ifrCon {
|
|
|
|
+ position: relative;
|
|
|
|
+ width: 558px;
|
|
|
|
+ height: 478px;
|
|
|
|
+ iframe {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ }
|
|
|
|
+ &>img{
|
|
|
|
+ max-width: 100%;
|
|
|
|
+ max-height: 100%;
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 50%;
|
|
|
|
+ top: 50%;
|
|
|
|
+ transform: translate(-50%,-50%);
|
|
|
|
+ }
|
|
|
|
+ .full {
|
|
|
|
+ width: 30px;
|
|
|
|
+ height: 30px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 10px;
|
|
|
|
+ bottom: 10px;
|
|
|
|
+ color: #fff;
|
|
|
|
+ & > img {
|
|
|
|
+ width: 30px;
|
|
|
|
+ height: 30px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .rightTxt {
|
|
|
|
+ padding-right: 20px;
|
|
|
|
+ height: 478px;
|
|
|
|
+ flex: 1;
|
|
|
|
+ margin-left: 110px;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ &>h3{
|
|
|
|
+ width: 100%;
|
|
|
|
+ word-break:break-all;
|
|
|
|
+ font-size: 30px;
|
|
|
|
+ margin-bottom: 30px;
|
|
|
|
+ }
|
|
|
|
+ &>P{
|
|
|
|
+ width: 100%;
|
|
|
|
+ word-break:break-all;
|
|
|
|
+ color: #CC946D;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
.full {
|
|
.full {
|
|
width: 100%;
|
|
width: 100%;
|
|
}
|
|
}
|