|
@@ -3,6 +3,7 @@
|
|
v-if="show"
|
|
v-if="show"
|
|
@mouseover="mouseover"
|
|
@mouseover="mouseover"
|
|
@mouseout="mouseout"
|
|
@mouseout="mouseout"
|
|
|
|
+ @click="btn"
|
|
class="box"
|
|
class="box"
|
|
:style="{ top: top + 'px', left: left + 'px', backgroundImage: `${img}`}"
|
|
:style="{ top: top + 'px', left: left + 'px', backgroundImage: `${img}`}"
|
|
>
|
|
>
|
|
@@ -42,7 +43,17 @@ export default {
|
|
clearInterval(this.timer);
|
|
clearInterval(this.timer);
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- ...mapActions(['upWindewQuery']),
|
|
|
|
|
|
+ ...mapActions(['upWindewQuery', 'contentsQuery']),
|
|
|
|
+ // 点击窗口
|
|
|
|
+ async btn() {
|
|
|
|
+ console.log(this.upwindow);
|
|
|
|
+ if (this.upwindow[0].url && this.upwindow[0].url !== '') {
|
|
|
|
+ window.open(this.upwindow[0].url);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ const res = await this.contentsQuery({ title: this.upwindow[0]?.title });
|
|
|
|
+ this.$router.push(`/details/${res.data[0]._id}`);
|
|
|
|
+ },
|
|
// 初始化飘窗规则
|
|
// 初始化飘窗规则
|
|
init() {
|
|
init() {
|
|
// 设置最大的top和left值:根元素可视区域宽高 - 飘窗的宽高 - 边距
|
|
// 设置最大的top和left值:根元素可视区域宽高 - 飘窗的宽高 - 边距
|