Commit 671fe0c3 by liuliufashi

update

parent 166b631d
......@@ -71,17 +71,25 @@
:label-col="{ span: 2 }">
<div class="clearfix">
<div style="display: flex;">
<a-upload v-model:file-list="fileList" :maxCount="1" action="http://43.142.42.187:8899/file/upload"
list-type="picture-card" @preview="handlePreview" @change="handleChange">
<div v-if="fileList.length < 8">
<plus-outlined />
<div style="margin-top: 8px">Upload</div>
<a-upload
v-model:file-list="fileList"
list-type="picture-card"
:show-upload-list="false"
action="http://43.142.42.187:8899/file/upload"
:before-upload="beforeUpload"
@change="handleChange"
>
<img v-if="imageUrl" :src="imageUrl" alt="avatar" style="width: 102px;height: 102px;"/>
<div v-else>
<loading-outlined v-if="loading"></loading-outlined>
<plus-outlined v-else></plus-outlined>
<div class="ant-upload-text">Upload</div>
</div>
</a-upload>
</div>
<div>
<p class="warin">
建议图片比例为4:3,大小不超过20M,图片仅支持JPG、JPEG、PNG格式
建议图片比例为4:3,大小不超过2M,图片仅支持JPG、JPEG、PNG格式
</p>
</div>
</div>
......@@ -95,7 +103,6 @@
style="font-size:28px;"></i> </div>
</a-upload>
</div>
<QuillEditor style="height:200px" ref="myQuillEditor" :options="options" :content="modelRef.body"
content-type="html" @update:content="textChange" @focus="onEditorFocus($event)"
@blur="onEditorBlur($event)" @change="onEditorChange($event)">
......@@ -105,7 +112,7 @@
<div class="editor-text">
<p>1、商品描述需符合《中华人民共和国广告法》</p>
<p>
2、详情图片宽度750,高度不超过5000,每张图片最大不超过1M,图片仅支持JPG、JPEG、PNG格式。
2、详情图片宽度750,高度不超过5000,每张图片最大不超过2M,图片仅支持JPG、JPEG、PNG格式。
</p>
</div>
</a-form-item>
......@@ -153,6 +160,8 @@ import GoodsBagSubs from "./components/goodsubs/index.vue";
const useForm = Form.useForm;
const myQuillEditor = ref<any>(null);
const imageUrl= ref<any>('')
const loading= ref<any>('')
const textarea = ref<any>('')
let upImage = ref<any>(null)
const columns = [
......@@ -272,7 +281,7 @@ const handleOk = async () => {
goods_package_id: modelRef.value.parent,
subject: modelRef.value.subject,
shortname: modelRef.value.shortname,
picurl: fileList.value[0].url,
picurl: imageUrl.value,
body: modelRef.value.body,
price: modelRef.value.price * 100,
markingprice: modelRef.value.markingprice * 100,
......@@ -357,7 +366,7 @@ const onEdit = (e: any) => {
visible.value = !visible.value;
modelRef.value.parent = e.parent
modelRef.value.goodsid = e.goodsid
modelRef.value.picurl = e.picurl
imageUrl.value = e.picurl
modelRef.value.sellamount = e.sellamount
modelRef.value.sellcount = e.sellcount
modelRef.value.shortname = e.shortname
......@@ -466,13 +475,9 @@ const handlePreview = async (file: any) => {
previewTitle.value =
file.name || file.url.substring(file.url.lastIndexOf("/") + 1);
};
const beforeUpload: UploadProps['beforeUpload'] = file => {
if (!(file.type.includes('png') || file.type.includes('jpeg') || file.type.includes('jpg'))) {
message.error(`${file.name}不是png/jpef/jpg格式`);
return Upload.LIST_IGNORE;
}
};
const handleChange = (info: any) => {
const size = info.file.size /1024
if(size <2000){
let resFileList = [...info.fileList];
// 1. Limit the number of uploaded files
......@@ -482,12 +487,28 @@ const handleChange = (info: any) => {
// 2. read from response and show file link
resFileList = resFileList.map((file) => {
if (file.response) {
console.log(fileList, 'fileList');
// Component will show file.url as link
imageUrl.value= file.response.data;
modelRef.value.picurl = imageUrl.value
}
return file;
});
fileList.value = resFileList;
}else{
}
};
const beforeUpload: UploadProps['beforeUpload'] = file => {
const size = file.size /1024
if(size <2000){
if (!(file.type.includes('png') || file.type.includes('jpeg') || file.type.includes('jpg'))) {
message.error(`${file.name}不是png/jpef/jpg格式`);
return Upload.LIST_IGNORE;
}
}else{
message.info('图片最大为2M')
}
};
watch(isEditfileList, (newVal, old) => {
if (newVal[0]) {
......@@ -517,6 +538,8 @@ defineExpose({
textarea,
upImage,
pagination,
imageUrl,
loading,
tableChange,
onPush,
textChange,
......
......@@ -3,7 +3,7 @@
<a-layout class="home-page">
<a-layout-header class="header">
<div class="header-right">
<bell-outlined />
<bell-outlined style="font-size: 18px;color: white;"/>
</div>
<a-dropdown>
<template #overlay>
......@@ -15,11 +15,11 @@
</a-menu>
</template>
<div class="header-right">
<RadarChartOutlined /><span>{{ info.name }}</span>
<RadarChartOutlined style="font-size: 18px;color: white;"/><span style="font-size: 16px;color: white;">{{ info.name }}</span>
</div>
</a-dropdown>
<div class="header-right">
<DashOutlined />
<DashOutlined style="color: white;"/>
</div>
</a-layout-header>
<a-layout>
......
......@@ -233,12 +233,12 @@ const { resetFields, validate, validateInfos } = useForm(modelRef, rulesRef);
const onSubmit = async () => {
validate()
.then(async () => {
const uid = getUid()
let data: any = {};
if (status.value === 1) {
let prarms:any = {
}
if(query.value.paytype == "1"){
prarms = {
amount: dataFrom.value.amount,
id: dataFrom.value.id,
......@@ -249,6 +249,7 @@ const onSubmit = async () => {
mchid: toRaw(modelRef).privatekey,
mchkey: toRaw(modelRef).alipaypublickey,
...toRaw(modelRef),
uid
};
}else{
prarms = {
......@@ -261,6 +262,7 @@ const onSubmit = async () => {
mchid: toRaw(modelRef).mchid,
mchkey: toRaw(modelRef).mchkey,
...toRaw(modelRef),
uid
};
}
......@@ -291,6 +293,7 @@ const onSubmit = async () => {
mchid: toRaw(modelRef).privatekey,
mchkey: toRaw(modelRef).alipaypublickey,
...toRaw(modelRef),
uid,
};
}else{
prarms = {
......@@ -303,6 +306,7 @@ const onSubmit = async () => {
mchid: toRaw(modelRef).mchid,
mchkey: toRaw(modelRef).mchkey,
...toRaw(modelRef),
uid,
};
}
if (query.value.paytype == 1) {
......@@ -317,6 +321,7 @@ const onSubmit = async () => {
message.warning(data.message, 10);
}
await init();
status.value = 0
}
})
.catch((err) => {
......
......@@ -177,7 +177,7 @@ const columns = [
width: 100,
},
{
title: '创人',
title: '创人',
dataIndex: 'userid',
key: 'userid',
},
......@@ -233,6 +233,8 @@ const onGetSearch= async() => {
pagination.total = data.data.count
}
const onEdit = (e: any) => {
console.log(e,'e');
formState.value= {
...e
}
......@@ -241,7 +243,8 @@ const onEdit = (e: any) => {
value4.value = dayjs(moment(e.expireendtime).format(('YYYY-MM-DD')), dateFormat)
value5.value = dayjs(moment(e.expireendtime).format(('HH:mm')), 'HH:mm')
formState.value.payment = formState.value.payment/100
formState.value.paymentmodel = formState.value.paymentmodel+''
formState.value.paymentmodel = '1'
formState.value.fullphone = formState.value.fullphone?true:false
showModal()
}
const onSearch = async () => {
......@@ -329,7 +332,7 @@ const onSelect =(e:any,opt:any)=>{
id
}
formState.value.price = formState.value.price/100
formState.value.paymentmodel= '0'
formState.value.paymentmodel= '1'
}
const onSubSearch = async(value:any)=>{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment