提交
This commit is contained in:
@@ -70,13 +70,13 @@
|
||||
}} | 下架 {{ stat['offshelf'] }})</div>
|
||||
|
||||
<div class="list wid1200 flexflex" v-if="tabState == 'fav'">
|
||||
<div class="item" v-for="item in favData['list']">
|
||||
<public-list-item :item="item"></public-list-item>
|
||||
<div class="item" v-for="(item, index) in favData['list']" :key="index">
|
||||
<public-list-item :item="item" :index="index" @cancelCollection="cancelCollection"></public-list-item>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list wid1200 flexflex" v-if="tabState == 'publish'">
|
||||
<div class="item" v-for="item in publishData['list']">
|
||||
<public-list-item :item="item"></public-list-item>
|
||||
<div class="item" v-for="(item, index) in publishData['list']" :key="index">
|
||||
<public-list-item :item="item" :index="index" @cancelCollection="cancelCollection"></public-list-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -141,7 +141,14 @@ async function init() {
|
||||
});
|
||||
}
|
||||
|
||||
let loading = null
|
||||
// let loading = null
|
||||
|
||||
let loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
visible: false
|
||||
});
|
||||
|
||||
let publishData = ref({
|
||||
page: 1,
|
||||
@@ -151,7 +158,7 @@ let publishData = ref({
|
||||
let stat = ref({}) // 我的发布的详细数量
|
||||
// 获取发布数据
|
||||
const getPublishData = () => {
|
||||
if (publishData.value['page'] == 0 || loading) return
|
||||
if (publishData.value['page'] == 0 || loading['visible'].value) return
|
||||
loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
@@ -177,7 +184,7 @@ let favData = ref({
|
||||
|
||||
// 获取收藏数据
|
||||
const getFavData = () => {
|
||||
if (favData.value['page'] == 0 || loading) return
|
||||
if (favData.value['page'] == 0 || loading['visible'].value) return
|
||||
loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
@@ -202,6 +209,16 @@ const cutTab = (value) => {
|
||||
else if (tabState.value == 'fav' && favData.value['list'].length == 0) getFavData()
|
||||
}
|
||||
|
||||
let cancelCollection = data => {
|
||||
|
||||
favData.value.list.splice(data['index'], 1)
|
||||
|
||||
// proxy.$post("/tenement/pc/api/user/favList", {
|
||||
// }).then(res => {
|
||||
// console.log(res, "res");
|
||||
// })
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
||||
Reference in New Issue
Block a user