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