Merge remote-tracking branch 'origin/main'

# Conflicts:
#	src/components/detail/imageWatch.vue
This commit is contained in:
luJianJun 2023-08-03 12:18:07 +08:00
commit 3d70b58f2d
3 changed files with 35 additions and 8 deletions

View File

@ -58,7 +58,7 @@
</div>
<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;">
<template #reference>
<div class="tool-btn consult-btn flexcenter">

View File

@ -9,7 +9,8 @@
<el-carousel-item v-for="(item, i) in list" :key="i">
<div class="dis-f jus-x al-item" v-if="item">
<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 class="img-box dis-f jus-x" v-else>
<!-- <img v-lazy="item && item.url || item['imageurl'] || item['image']" class="img" alt=""> -->
@ -174,8 +175,9 @@ img {
.select-box {
border: 1px solid #50e3c2 !important;
}
.carousel-w{
min-width:800px;
.carousel-w {
min-width: 800px;
}
.watch-box {

View File

@ -123,7 +123,7 @@ import emptyDuck from '@/components/public/empty-duck.vue'
import choosingIdentity from '@/components/edit/choosingIdentity.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 { ElLoading, ElMessage } from 'element-plus'
@ -174,6 +174,7 @@ const init = () => {
if (!route.query['tab']) {
if (data.count['publish'] > 0) tabState.value = 'publish'
else if (data.count['fav'] == 0) tabState.value = 'publish'
else tabState.value = 'fav'
} else tabState.value = route.query['tab']
@ -244,13 +245,14 @@ const getFavData = () => {
background: 'rgba(0, 0, 0, 0.7)',
})
proxy.$post("/tenement/pc/api/user/favList", {
page: favData.value['page']
page: favData.value['page'],
limit:5
}).then(res => {
if (res.code != 200) return
let data = res.data
favData.value['page'] = data['page'] * data['limit'] >= data['count'] ? 0 : data['page'] + 1
favData.value['list'] = favData.value['list'].concat(data['data'] || [])
favData.value['limit'] = data['limit']
nextTick(() => {
masonryInstance.reloadItems();
masonryInstance.layout();
@ -277,6 +279,11 @@ let cancelCollection = data => {
favData.value.list.splice(data['index'], 1)
count.value['fav']--
if (favData.value.list.length == 0 && favData.value['page'] != 0) {
favData.value['page'] = 1
getFavData()
} else refillData(data['index'])
nextTick(() => {
masonryInstance.reloadItems();
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) => {
stat.value['listing']--
@ -301,7 +326,7 @@ const handleDelete = (index, status) => {
if (status == 0) stat.value['draft']--
else if (status == 1) stat.value['listing']--
else stat.value['offshelf']--
count.value['publish'] --
count.value['publish']--
publishData.value['list'].splice(index, 1)
nextTick(() => {
masonryInstancepublish.reloadItems();