|
|
@@ -27,12 +27,13 @@
|
|
|
</view>
|
|
|
<view class="upload-row">
|
|
|
<text class="label required">菜品封面图</text>
|
|
|
- <view class="tip">支持jpg、png格式,尺寸为750px * 750px</view>
|
|
|
+ <view class="tip">支持jpg、png格式,大小不超过2M</view>
|
|
|
<u-upload
|
|
|
:action="uploadAction"
|
|
|
:file-list="fileList.cover"
|
|
|
:form-data="uploadFormData"
|
|
|
:max-count="4"
|
|
|
+ :max-size="2 * 1024 * 1024"
|
|
|
:multiple="true"
|
|
|
:deletable="true"
|
|
|
:custom-btn="true"
|
|
|
@@ -42,6 +43,7 @@
|
|
|
preview-full-image
|
|
|
@on-success="onCoverSuccess"
|
|
|
@on-remove="onCoverRemove"
|
|
|
+ @on-oversize="onUploadOversize"
|
|
|
>
|
|
|
<view slot="addBtn" class="upload-btn">
|
|
|
<image class="upload-icon" src="/static/merchantDish/photo.png" mode="aspectFit"></image>
|
|
|
@@ -51,12 +53,13 @@
|
|
|
</view>
|
|
|
<view class="upload-row last">
|
|
|
<text class="label required">菜品图片详情</text>
|
|
|
- <view class="tip">支持jpg、png格式,尺寸为750px * 750px</view>
|
|
|
+ <view class="tip">支持jpg、png格式,大小不超过2M</view>
|
|
|
<u-upload
|
|
|
:action="uploadAction"
|
|
|
:file-list="fileList.detail"
|
|
|
:form-data="uploadFormData"
|
|
|
:max-count="20"
|
|
|
+ :max-size="2 * 1024 * 1024"
|
|
|
:multiple="true"
|
|
|
:deletable="true"
|
|
|
:custom-btn="true"
|
|
|
@@ -66,6 +69,7 @@
|
|
|
preview-full-image
|
|
|
@on-success="onDetailSuccess"
|
|
|
@on-remove="onDetailRemove"
|
|
|
+ @on-oversize="onUploadOversize"
|
|
|
>
|
|
|
<view slot="addBtn" class="upload-btn">
|
|
|
<image class="upload-icon" src="/static/merchantDish/photo.png" mode="aspectFit"></image>
|
|
|
@@ -596,6 +600,9 @@ export default {
|
|
|
.filter(Boolean);
|
|
|
this.form[formKey] = urls.join(',');
|
|
|
},
|
|
|
+ onUploadOversize() {
|
|
|
+ uni.showToast({ title: '图片大小不能超过2M', icon: 'none' });
|
|
|
+ },
|
|
|
onCoverSuccess(res, index, lists) {
|
|
|
this.fileList.cover = lists;
|
|
|
this.processImageList(lists, 'cover');
|