Merge branch 'dev_vite' of http://18.167.251.121:10003/aidlab/aida_front into dev_vite

This commit is contained in:
李志鹏
2026-04-27 10:49:38 +08:00
3 changed files with 55 additions and 5 deletions

View 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: "*/*" }
})
}

View File

@@ -230,14 +230,14 @@
</template>
<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 SellerHeader from "../../seller-header.vue"
import testImg from "@/assets/images/test.png"
import Radio from "./components/Radio.vue"
import ImageClipDialog from "../../BrandProfile/image-clip-dialog.vue"
import { Https } from "@/tool/https"
import { useStore } from "vuex"
import { fetchSketchDetail, uploadFile } from "./api"
const ROUTER = useRouter()
@@ -400,7 +400,7 @@ const handleSelectProdImg = (index: number) => {
const cropType = ref("")
const handleClickCrop = (data, type) => {
console.log(data, type)
// console.log(data, type)
const titleList = {
sketch: "Crop Sketch",
mainProductImage: "Crop Main Product Image",
@@ -412,7 +412,11 @@ const handleClickCrop = (data, type) => {
imageClipDialogRef.value.open(
data,
(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 }
)
@@ -429,6 +433,13 @@ const handleClickMenu = (status: "draft" | "publish") => {
ROUTER.push({ name: "Status", params: { status: "publish" } })
}
}
onMounted(() => {
fetchSketchDetail([666163, 666164]).then(res => {
console.log(res)
})
})
</script>
<style lang="less" scoped>

View File

@@ -3,17 +3,32 @@ import { ref, onMounted, onUnmounted, reactive, toRefs } from "vue";
import sellerHeader from "../../seller-header.vue"
import sellerContent from "./content.vue"
import myEvent from "@/tool/myEvents.js"
import { Https } from '@/tool/https'
import { useStore } from "vuex";
//const props = defineProps({
//})
//const emit = defineEmits([
//])
const store = useStore()
let data = reactive({
listingPopup: true,
})
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(()=>{
let listingPopup = sessionStorage.getItem('listingPopup')
})
onUnmounted(()=>{
})