修改我的收藏的取消收藏后数据少问题、修改预览视频的预加载、修改咨询小助手二维码的显示方式
This commit is contained in:
@@ -58,7 +58,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-popover placement="bottom-end" popper-class="consult-popover flexcenter" :width="300"
|
<el-popover placement="bottom-end" popper-class="consult-popover flexcenter" :width="300"
|
||||||
trigger="click" :show-arrow="false"
|
trigger="hover" :show-arrow="false"
|
||||||
popper-style="background-color:transparent;border: none;box-shadow: none;padding:0;">
|
popper-style="background-color:transparent;border: none;box-shadow: none;padding:0;">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<div class="tool-btn consult-btn flexcenter">
|
<div class="tool-btn consult-btn flexcenter">
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
<el-carousel-item v-for="(item, i) in list" :key="i">
|
<el-carousel-item v-for="(item, i) in list" :key="i">
|
||||||
<div class="dis-f jus-x al-item" v-if="item">
|
<div class="dis-f jus-x al-item" v-if="item">
|
||||||
<div class="img-box dis-f jus-x" v-if="item['type'] != 'attachment'">
|
<div class="img-box dis-f jus-x" v-if="item['type'] != 'attachment'">
|
||||||
<video :autoplay="false" controls :src="item.url || item['videourl']" style="width:800px;"></video>
|
<video :autoplay="false" controls :src="item.url || item['videourl']" :preload="imageTab == i ? 'metadata' : 'none'"
|
||||||
|
style="width:800px;"></video>
|
||||||
</div>
|
</div>
|
||||||
<div class="img-box dis-f jus-x" v-else>
|
<div class="img-box dis-f jus-x" v-else>
|
||||||
<!-- <img v-lazy="item && item.url || item['imageurl'] || item['image']" class="img" alt=""> -->
|
<!-- <img v-lazy="item && item.url || item['imageurl'] || item['image']" class="img" alt=""> -->
|
||||||
@@ -81,7 +82,7 @@ let imageTab = ref(0)
|
|||||||
let prev = () => carousel.value.prev()
|
let prev = () => carousel.value.prev()
|
||||||
|
|
||||||
// 轮播图滚动后事件
|
// 轮播图滚动后事件
|
||||||
const carouselChange = value =>{ imageTab.value = value;console.log(value)}
|
const carouselChange = value => { imageTab.value = value; console.log(value) }
|
||||||
|
|
||||||
//下一张
|
//下一张
|
||||||
let next = () => carousel.value.next()
|
let next = () => carousel.value.next()
|
||||||
@@ -174,8 +175,9 @@ img {
|
|||||||
.select-box {
|
.select-box {
|
||||||
border: 1px solid #50e3c2 !important;
|
border: 1px solid #50e3c2 !important;
|
||||||
}
|
}
|
||||||
.carousel-w{
|
|
||||||
min-width:800px;
|
.carousel-w {
|
||||||
|
min-width: 800px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.watch-box {
|
.watch-box {
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ import emptyDuck from '@/components/public/empty-duck.vue'
|
|||||||
import choosingIdentity from '@/components/edit/choosingIdentity.vue'
|
import choosingIdentity from '@/components/edit/choosingIdentity.vue'
|
||||||
import backToTop from '@/components/public/backToTop.vue'
|
import backToTop from '@/components/public/backToTop.vue'
|
||||||
|
|
||||||
import { ref, reactive, onMounted, onUnmounted, getCurrentInstance, nextTick } from 'vue'
|
import { ref, reactive, onMounted, onUnmounted, getCurrentInstance, nextTick, pushScopeId } from 'vue'
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
|
||||||
import { ElLoading, ElMessage } from 'element-plus'
|
import { ElLoading, ElMessage } from 'element-plus'
|
||||||
@@ -174,6 +174,7 @@ const init = () => {
|
|||||||
|
|
||||||
if (!route.query['tab']) {
|
if (!route.query['tab']) {
|
||||||
if (data.count['publish'] > 0) tabState.value = 'publish'
|
if (data.count['publish'] > 0) tabState.value = 'publish'
|
||||||
|
else if (data.count['fav'] == 0) tabState.value = 'publish'
|
||||||
else tabState.value = 'fav'
|
else tabState.value = 'fav'
|
||||||
} else tabState.value = route.query['tab']
|
} else tabState.value = route.query['tab']
|
||||||
|
|
||||||
@@ -244,13 +245,14 @@ const getFavData = () => {
|
|||||||
background: 'rgba(0, 0, 0, 0.7)',
|
background: 'rgba(0, 0, 0, 0.7)',
|
||||||
})
|
})
|
||||||
proxy.$post("/tenement/pc/api/user/favList", {
|
proxy.$post("/tenement/pc/api/user/favList", {
|
||||||
page: favData.value['page']
|
page: favData.value['page'],
|
||||||
|
limit:5
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code != 200) return
|
if (res.code != 200) return
|
||||||
let data = res.data
|
let data = res.data
|
||||||
favData.value['page'] = data['page'] * data['limit'] >= data['count'] ? 0 : data['page'] + 1
|
favData.value['page'] = data['page'] * data['limit'] >= data['count'] ? 0 : data['page'] + 1
|
||||||
favData.value['list'] = favData.value['list'].concat(data['data'] || [])
|
favData.value['list'] = favData.value['list'].concat(data['data'] || [])
|
||||||
|
favData.value['limit'] = data['limit']
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
masonryInstance.reloadItems();
|
masonryInstance.reloadItems();
|
||||||
masonryInstance.layout();
|
masonryInstance.layout();
|
||||||
@@ -277,6 +279,11 @@ let cancelCollection = data => {
|
|||||||
favData.value.list.splice(data['index'], 1)
|
favData.value.list.splice(data['index'], 1)
|
||||||
count.value['fav']--
|
count.value['fav']--
|
||||||
|
|
||||||
|
if (favData.value.list.length == 0 && favData.value['page'] != 0) {
|
||||||
|
favData.value['page'] = 1
|
||||||
|
getFavData()
|
||||||
|
} else refillData(data['index'])
|
||||||
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
masonryInstance.reloadItems();
|
masonryInstance.reloadItems();
|
||||||
masonryInstance.layout();
|
masonryInstance.layout();
|
||||||
@@ -285,6 +292,24 @@ let cancelCollection = data => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 取消输出后重新补充一条数据
|
||||||
|
const refillData = index => {
|
||||||
|
if (favData.value['page'] == 0 || loading['visible'].value) return
|
||||||
|
const page = favData.value['page'] - 1
|
||||||
|
proxy.$post("/tenement/pc/api/user/favList", {
|
||||||
|
page,
|
||||||
|
limit: favData.value['limit']
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code != 200) return
|
||||||
|
let data = res.data['data'] || []
|
||||||
|
favData.value['list'].push(data[data.length - 1])
|
||||||
|
nextTick(() => {
|
||||||
|
masonryInstance.reloadItems();
|
||||||
|
masonryInstance.layout();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 点击下架都修改状态
|
// 点击下架都修改状态
|
||||||
const undercarriage = (index, status) => {
|
const undercarriage = (index, status) => {
|
||||||
stat.value['listing']--
|
stat.value['listing']--
|
||||||
@@ -301,7 +326,7 @@ const handleDelete = (index, status) => {
|
|||||||
if (status == 0) stat.value['draft']--
|
if (status == 0) stat.value['draft']--
|
||||||
else if (status == 1) stat.value['listing']--
|
else if (status == 1) stat.value['listing']--
|
||||||
else stat.value['offshelf']--
|
else stat.value['offshelf']--
|
||||||
count.value['publish'] --
|
count.value['publish']--
|
||||||
publishData.value['list'].splice(index, 1)
|
publishData.value['list'].splice(index, 1)
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
masonryInstancepublish.reloadItems();
|
masonryInstancepublish.reloadItems();
|
||||||
|
|||||||
Reference in New Issue
Block a user