Merge branch 'main' of http://154.8.193.216:3030/admin1/jiangchengfeiyi-Web
This commit is contained in:
commit
60d9e78b89
|
@ -109,7 +109,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref,reactive,onMounted } from 'vue';
|
||||
import { Delete, Plus, ZoomIn } from '@element-plus/icons-vue';
|
||||
import type { UploadFile } from 'element-plus';
|
||||
import {ElMessage, type UploadFile} from 'element-plus';
|
||||
import myAxios from "@/api/myAxios";
|
||||
|
||||
const dialogImageUrl = ref('');
|
||||
|
@ -134,9 +134,41 @@ const form = reactive({
|
|||
region:'',//是否为限定
|
||||
festivalName:'',//节日名称
|
||||
resource:'',//类型
|
||||
label:[],//商品标签
|
||||
label:'',//商品标签
|
||||
desc:'',//详情描述
|
||||
})
|
||||
onMounted(()=>{
|
||||
addProduct()
|
||||
upload()
|
||||
})
|
||||
const addProduct = async () => {
|
||||
const res = await myAxios.post('goods/add',{
|
||||
name : form.name,
|
||||
price : form.price,
|
||||
inventory : form.quantity,
|
||||
type: form.resource,
|
||||
label : form.label,
|
||||
intro : form.desc,
|
||||
festivalOrder : form.festivalName
|
||||
})
|
||||
if(res.data.code == 1){
|
||||
ElMessage({
|
||||
message: '上架成功',
|
||||
type: 'success'
|
||||
})
|
||||
}else{
|
||||
ElMessage({
|
||||
message: '上架失败',
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
}
|
||||
const upload = async () => {
|
||||
const res = await myAxios.post('file/upload/server',{
|
||||
multipartFile : uploadedFiles.value,
|
||||
biz : uploadedDescription.value
|
||||
})
|
||||
}
|
||||
// onMounted(() => {
|
||||
// getProductInformation()
|
||||
// })
|
||||
|
|
Loading…
Reference in New Issue
Block a user