feat: sketchDetail接口
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user