fix
This commit is contained in:
@@ -45,8 +45,8 @@ const next = ()=>{
|
||||
router.push({
|
||||
path:'/home/seller/myListings/edit',
|
||||
state: {
|
||||
id:route.params.collectionId,
|
||||
designItemIds,
|
||||
type:'create'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import contentItem from "./contentItem.vue"
|
||||
import selectMenu from '@/component/modules/selectMenu.vue'
|
||||
import deleteDrafts from './deleteDrafts.vue'
|
||||
import { Https } from '@/tool/https'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
//const props = defineProps({
|
||||
//})
|
||||
@@ -63,10 +65,13 @@ const domSizeList = ref([
|
||||
|
||||
const visible = ref(false)
|
||||
const deleteDraftsRef = ref(null)
|
||||
const router = useRouter()
|
||||
|
||||
const deleteDraft = (item: any)=>{
|
||||
deleteDraftsRef.value.open(()=>{
|
||||
list2.value = list2.value.filter((v: any)=>v.id != item.id)
|
||||
deleteDraftsRef.value.open(item,()=>{
|
||||
putListingStatus(item,2).then(()=>{
|
||||
list2.value = list2.value.filter((v: any)=>v.id != item.id)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -99,6 +104,7 @@ const getPublishedData = async ()=>{
|
||||
}
|
||||
await getPublishList(value).then((res)=>{
|
||||
if(res.content.length == 0)publishData.isNoData = true
|
||||
publishData.pageNum += 1
|
||||
list.value.push(...res.content)
|
||||
})
|
||||
publishData.isShowMark = false
|
||||
@@ -113,6 +119,7 @@ const getNoPublishedData = async ()=>{
|
||||
}
|
||||
await getPublishList(value).then((res)=>{
|
||||
if(res.content.length == 0)noPublishData.isNoData = true
|
||||
noPublishData.pageNum += 1
|
||||
list2.value.push(...res.content)
|
||||
})
|
||||
noPublishData.isShowMark = false
|
||||
@@ -127,28 +134,46 @@ const getPublishList = (data:any)=>{
|
||||
})
|
||||
}
|
||||
|
||||
const putListingStatus = ()=>{
|
||||
let data = {
|
||||
id:'',
|
||||
status:'',
|
||||
}
|
||||
Https.axiosPut(Https.httpUrls.putListingStatus,data).then((res:any)=>{
|
||||
const putListingStatus = async (item,status:number)=>{
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
let data = {
|
||||
id:item.id,
|
||||
status:status,
|
||||
}
|
||||
Https.axiosPut(Https.httpUrls.putListingStatus,data).then((res:any)=>{
|
||||
resolve(res)
|
||||
}).catch((err:any)=>{
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const draftListing = (item: any)=>{
|
||||
const draftListing = async (item: any)=>{
|
||||
//数组前面添加item
|
||||
list2.value.unshift(item)
|
||||
list.value = list.value.filter((v: any)=>v.id != item.id)
|
||||
await putListingStatus(item,0).then(()=>{
|
||||
list2.value.unshift(item)
|
||||
list.value = list.value.filter((v: any)=>v.id != item.id)
|
||||
})
|
||||
message.success('Product moved to drafts and stats reset.')
|
||||
}
|
||||
|
||||
const publishListing = (item: any)=>{
|
||||
list.value.unshift(item)
|
||||
list2.value = list2.value.filter((v: any)=>v.id != item.id)
|
||||
const publishListing = async (item: any)=>{
|
||||
await putListingStatus(item,1).then(()=>{
|
||||
list.value.unshift(item)
|
||||
list2.value = list2.value.filter((v: any)=>v.id != item.id)
|
||||
})
|
||||
message.success('Item is now live on the Marketplace.')
|
||||
}
|
||||
|
||||
const editListing = (item: any)=>{
|
||||
router.push({
|
||||
path:'/home/seller/myListings/edit',
|
||||
state: {
|
||||
id:item.id,
|
||||
type:'edit'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ const {} = toRefs(data);
|
||||
<template>
|
||||
<div class="item" :draging="true" :class="domSize">
|
||||
<div class="imgBox">
|
||||
<img src="" alt="">
|
||||
<img :src="item.cover" alt="">
|
||||
<div class="maskBtn">
|
||||
<div @click="$emit('editListing',item)">
|
||||
<svgIcon name="seller-edit" :size="domSize == 'Small'?32:domSize == 'Medium'?40:48" />
|
||||
@@ -50,21 +50,21 @@ const {} = toRefs(data);
|
||||
</div>
|
||||
<div class="detail">
|
||||
<div class="left">
|
||||
<div class="name">item name</div>
|
||||
<div class="price">$1123</div>
|
||||
<div class="name">{{item.title}}</div>
|
||||
<div class="price">${{item.price}}</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="detailItem" v-if="type == 'listings'">
|
||||
<div class="shopping1">
|
||||
<i class="fi fi-rr-shopping-bag-add"></i>
|
||||
</div>
|
||||
<span>123</span>
|
||||
<span>{{ item.price }}</span>
|
||||
</div>
|
||||
<div class="detailItem" v-if="type == 'listings'">
|
||||
<div class="eye1">
|
||||
<i class="fi fi-rs-eye"></i>
|
||||
</div>
|
||||
<span>123</span>
|
||||
<span>{{ item.viewCount }}</span>
|
||||
</div>
|
||||
<div class="detailItem drafts" v-if="type == 'drafts'" @click="$emit('deleteDraft',item)">
|
||||
<div class="">
|
||||
@@ -128,6 +128,11 @@ const {} = toRefs(data);
|
||||
position: relative;
|
||||
height: var(--itemImgHeight);
|
||||
width: 100%;
|
||||
> img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
> .maskBtn{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
@@ -182,6 +187,7 @@ const {} = toRefs(data);
|
||||
gap: var(--detailRightItemGap);
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
> div{
|
||||
color: var(--rightColor);
|
||||
display: flex;
|
||||
|
||||
@@ -15,12 +15,13 @@ const router = useRouter()
|
||||
const {t} = useI18n()
|
||||
let data = reactive({
|
||||
})
|
||||
|
||||
const item = ref<any>()
|
||||
const fun = ref(null)
|
||||
|
||||
let deleteDraftsRef = ref(null)
|
||||
|
||||
const open = (deleteFun)=>{
|
||||
const open = (data:any,deleteFun)=>{
|
||||
item.value = data
|
||||
fun.value = deleteFun
|
||||
emit('update:visible', true)
|
||||
}
|
||||
@@ -35,6 +36,7 @@ const deleteDrafts = ()=>{
|
||||
|
||||
|
||||
const cleardata = ()=>{
|
||||
item.value = null
|
||||
emit('update:visible', false)
|
||||
}
|
||||
|
||||
@@ -78,11 +80,11 @@ const { showAgain } = toRefs(data);
|
||||
</div>
|
||||
<div class="deleteContent">
|
||||
<div class="img">
|
||||
<img src="" alt="">
|
||||
<img :src="item?.value?.cover" alt="">
|
||||
</div>
|
||||
<div class="detail">
|
||||
<div class="name">Item Name</div>
|
||||
<div class="price">HK$392.00 · Draft</div>
|
||||
<div class="name">{{ item?.value?.title }}</div>
|
||||
<div class="price">HK${{ item?.value?.price }} · Draft</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btnBox">
|
||||
|
||||
Reference in New Issue
Block a user