Merge branch 'dev_vite' of http://18.167.251.121:10003/aidlab/aida_front into dev_vite
This commit is contained in:
24
src/views/SellerDashboard/MyListings/EditDetail/api.ts
Normal file
24
src/views/SellerDashboard/MyListings/EditDetail/api.ts
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import { Https } from "@/tool/https"
|
||||||
|
|
||||||
|
interface SketchIDs {
|
||||||
|
designItemIds: Array
|
||||||
|
}
|
||||||
|
export const fetchSketchDetail = (data: SketchIDs) => {
|
||||||
|
let params = "?"
|
||||||
|
data.forEach((id, index) => {
|
||||||
|
if (index === data.length - 1) {
|
||||||
|
params += `designItemIds=${id}`
|
||||||
|
} else {
|
||||||
|
params += `designItemIds=${id}&`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return Https.axiosGet(`/api/seller/sketchDetail${params}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const uploadFile = (file) => {
|
||||||
|
const formData = new FormData()
|
||||||
|
formData.append("file", file)
|
||||||
|
return Https.axiosPost("/seller/file/ upload", formData, {
|
||||||
|
headers: { "Content-Type": "multipart/form-data", Accept: "*/*" }
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -230,14 +230,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref, watch, defineOptions } from "vue"
|
import { computed, ref, watch, defineOptions,onMounted } from "vue"
|
||||||
import { useRouter } from "vue-router"
|
import { useRouter } from "vue-router"
|
||||||
import SellerHeader from "../../seller-header.vue"
|
import SellerHeader from "../../seller-header.vue"
|
||||||
import testImg from "@/assets/images/test.png"
|
import testImg from "@/assets/images/test.png"
|
||||||
import Radio from "./components/Radio.vue"
|
import Radio from "./components/Radio.vue"
|
||||||
import ImageClipDialog from "../../BrandProfile/image-clip-dialog.vue"
|
import ImageClipDialog from "../../BrandProfile/image-clip-dialog.vue"
|
||||||
import { Https } from "@/tool/https"
|
|
||||||
import { useStore } from "vuex"
|
import { useStore } from "vuex"
|
||||||
|
import { fetchSketchDetail, uploadFile } from "./api"
|
||||||
|
|
||||||
const ROUTER = useRouter()
|
const ROUTER = useRouter()
|
||||||
|
|
||||||
@@ -400,7 +400,7 @@ const handleSelectProdImg = (index: number) => {
|
|||||||
|
|
||||||
const cropType = ref("")
|
const cropType = ref("")
|
||||||
const handleClickCrop = (data, type) => {
|
const handleClickCrop = (data, type) => {
|
||||||
console.log(data, type)
|
// console.log(data, type)
|
||||||
const titleList = {
|
const titleList = {
|
||||||
sketch: "Crop Sketch",
|
sketch: "Crop Sketch",
|
||||||
mainProductImage: "Crop Main Product Image",
|
mainProductImage: "Crop Main Product Image",
|
||||||
@@ -412,7 +412,11 @@ const handleClickCrop = (data, type) => {
|
|||||||
imageClipDialogRef.value.open(
|
imageClipDialogRef.value.open(
|
||||||
data,
|
data,
|
||||||
(file) => {
|
(file) => {
|
||||||
selectList.value[currentIndex.value].sketch = URL.createObjectURL(file)
|
// console.log(file)
|
||||||
|
uploadFile(file).then((res) => {
|
||||||
|
console.log(res)
|
||||||
|
selectList.value[currentIndex.value].sketch = res
|
||||||
|
})
|
||||||
},
|
},
|
||||||
{ ratio, isPreview: true, title: titleList[type], isProduct: true }
|
{ ratio, isPreview: true, title: titleList[type], isProduct: true }
|
||||||
)
|
)
|
||||||
@@ -429,6 +433,13 @@ const handleClickMenu = (status: "draft" | "publish") => {
|
|||||||
ROUTER.push({ name: "Status", params: { status: "publish" } })
|
ROUTER.push({ name: "Status", params: { status: "publish" } })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
fetchSketchDetail([666163, 666164]).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|||||||
@@ -3,17 +3,32 @@ import { ref, onMounted, onUnmounted, reactive, toRefs } from "vue";
|
|||||||
import sellerHeader from "../../seller-header.vue"
|
import sellerHeader from "../../seller-header.vue"
|
||||||
import sellerContent from "./content.vue"
|
import sellerContent from "./content.vue"
|
||||||
import myEvent from "@/tool/myEvents.js"
|
import myEvent from "@/tool/myEvents.js"
|
||||||
|
import { Https } from '@/tool/https'
|
||||||
|
import { useStore } from "vuex";
|
||||||
|
|
||||||
|
|
||||||
//const props = defineProps({
|
//const props = defineProps({
|
||||||
//})
|
//})
|
||||||
//const emit = defineEmits([
|
//const emit = defineEmits([
|
||||||
//])
|
//])
|
||||||
|
const store = useStore()
|
||||||
let data = reactive({
|
let data = reactive({
|
||||||
|
listingPopup: true,
|
||||||
})
|
})
|
||||||
const newListing = ()=>{
|
const newListing = ()=>{
|
||||||
myEvent.emit('newListing')
|
myEvent.emit('newListing',)
|
||||||
|
}
|
||||||
|
const getListingPopup = ()=>{
|
||||||
|
store.commit("set_loading", true)
|
||||||
|
Https.getListingPopup().then(res=>{
|
||||||
|
store.commit("set_loading", false)
|
||||||
|
data.listingPopup = res.data
|
||||||
|
}).catch(()=>{
|
||||||
|
store.commit("set_loading", false)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
|
let listingPopup = sessionStorage.getItem('listingPopup')
|
||||||
})
|
})
|
||||||
onUnmounted(()=>{
|
onUnmounted(()=>{
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user