|
@@ -25,14 +25,17 @@
|
|
|
<u-form-item prop="productImage" label="商品封面图" required labelPosition="top">
|
|
<u-form-item prop="productImage" label="商品封面图" required labelPosition="top">
|
|
|
<view class="upload-content">
|
|
<view class="upload-content">
|
|
|
<view class="upload-tip">支持jpg、png格式,建议尺寸为750px*750px,上传1-4张</view>
|
|
<view class="upload-tip">支持jpg、png格式,建议尺寸为750px*750px,上传1-4张</view>
|
|
|
- <Upload
|
|
|
|
|
|
|
+ <u-upload
|
|
|
|
|
+ :action="uploadAction"
|
|
|
|
|
+ :file-list="fileList.cover"
|
|
|
|
|
+ :form-data="uploadFormData"
|
|
|
|
|
+ :max-count="4"
|
|
|
|
|
+ :multiple="true"
|
|
|
width="140"
|
|
width="140"
|
|
|
height="140"
|
|
height="140"
|
|
|
- :maxCount="4"
|
|
|
|
|
- :multiple="true"
|
|
|
|
|
- :fileList.sync="fileList.cover"
|
|
|
|
|
- :previewFullImage="true"
|
|
|
|
|
- @complete="onUpload($event, 'cover')"
|
|
|
|
|
|
|
+ preview-full-image
|
|
|
|
|
+ @on-success="onCoverSuccess"
|
|
|
|
|
+ @on-remove="onCoverRemove"
|
|
|
/>
|
|
/>
|
|
|
</view>
|
|
</view>
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
@@ -40,14 +43,17 @@
|
|
|
<u-form-item prop="detailImages" label="商品详情图" required borderBottom labelPosition="top">
|
|
<u-form-item prop="detailImages" label="商品详情图" required borderBottom labelPosition="top">
|
|
|
<view class="upload-content">
|
|
<view class="upload-content">
|
|
|
<view class="upload-tip">支持jpg、png格式,最多20张</view>
|
|
<view class="upload-tip">支持jpg、png格式,最多20张</view>
|
|
|
- <Upload
|
|
|
|
|
|
|
+ <u-upload
|
|
|
|
|
+ :action="uploadAction"
|
|
|
|
|
+ :file-list="fileList.detail"
|
|
|
|
|
+ :form-data="uploadFormData"
|
|
|
|
|
+ :max-count="20"
|
|
|
|
|
+ :multiple="true"
|
|
|
width="140"
|
|
width="140"
|
|
|
height="140"
|
|
height="140"
|
|
|
- :maxCount="20"
|
|
|
|
|
- :multiple="true"
|
|
|
|
|
- :fileList.sync="fileList.detail"
|
|
|
|
|
- :previewFullImage="true"
|
|
|
|
|
- @complete="onUpload($event, 'detail')"
|
|
|
|
|
|
|
+ preview-full-image
|
|
|
|
|
+ @on-success="onDetailSuccess"
|
|
|
|
|
+ @on-remove="onDetailRemove"
|
|
|
/>
|
|
/>
|
|
|
</view>
|
|
</view>
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
@@ -103,14 +109,17 @@ export default {
|
|
|
return {
|
|
return {
|
|
|
show: false,
|
|
show: false,
|
|
|
showSpecial: false,
|
|
showSpecial: false,
|
|
|
|
|
+ uploadAction: configService.apiUrl + '/sys/common/upload',
|
|
|
|
|
+ imageHttp: configService.apiUrl + '/',
|
|
|
|
|
+ uploadFormData: { biz: 'temp' },
|
|
|
form: {
|
|
form: {
|
|
|
name: '',
|
|
name: '',
|
|
|
category: '',
|
|
category: '',
|
|
|
categoryName: '',
|
|
categoryName: '',
|
|
|
specialCategoryId: '',
|
|
specialCategoryId: '',
|
|
|
specialCategoryName: '',
|
|
specialCategoryName: '',
|
|
|
- productImage: 'https://test.baoxianzhanggui.com/locallive-java/product/企业微信截图_1781494923590_1781494943931.png',
|
|
|
|
|
- detailImages: 'https://test.baoxianzhanggui.com/locallive-java/product/企业微信截图_1781494923590_1781494943931.png',
|
|
|
|
|
|
|
+ productImage: '',
|
|
|
|
|
+ detailImages: '',
|
|
|
price: '',
|
|
price: '',
|
|
|
sellingPrice: '',
|
|
sellingPrice: '',
|
|
|
dailyStock:null,
|
|
dailyStock:null,
|
|
@@ -223,7 +232,6 @@ export default {
|
|
|
|
|
|
|
|
if (query.id) {
|
|
if (query.id) {
|
|
|
this.query = query;
|
|
this.query = query;
|
|
|
- await this.getCategoryList()
|
|
|
|
|
await this.getData();
|
|
await this.getData();
|
|
|
}
|
|
}
|
|
|
// 清除
|
|
// 清除
|
|
@@ -233,15 +241,32 @@ export default {
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
-
|
|
|
|
|
|
|
+ this.getCategoryList()
|
|
|
},
|
|
},
|
|
|
onReady() {
|
|
onReady() {
|
|
|
this.$refs.uForm.setRules(this.rules);
|
|
this.$refs.uForm.setRules(this.rules);
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ onCoverSuccess(res, index, lists) {
|
|
|
|
|
+ this.fileList.cover = lists;
|
|
|
|
|
+ this.processImageList(lists, 'productImage');
|
|
|
|
|
+ },
|
|
|
|
|
+ onCoverRemove(index, lists) {
|
|
|
|
|
+ this.fileList.cover = lists;
|
|
|
|
|
+ this.processImageList(lists, 'productImage');
|
|
|
|
|
+ },
|
|
|
|
|
+ onDetailSuccess(res, index, lists) {
|
|
|
|
|
+ this.fileList.detail = lists;
|
|
|
|
|
+ this.processImageList(lists, 'detailImages');
|
|
|
|
|
+ },
|
|
|
|
|
+ onDetailRemove(index, lists) {
|
|
|
|
|
+ this.fileList.detail = lists;
|
|
|
|
|
+ this.processImageList(lists, 'detailImages');
|
|
|
|
|
+ },
|
|
|
//获取特色分类
|
|
//获取特色分类
|
|
|
getCategoryList(){
|
|
getCategoryList(){
|
|
|
this.$http.get('/groupmeal/gmSpecialCategory/listAll').then(res => {
|
|
this.$http.get('/groupmeal/gmSpecialCategory/listAll').then(res => {
|
|
|
|
|
+ console.log(res)
|
|
|
if (res.data.code === 200 && res.data.result) {
|
|
if (res.data.code === 200 && res.data.result) {
|
|
|
this.categoryList = res.data.result.map(item => {
|
|
this.categoryList = res.data.result.map(item => {
|
|
|
return {
|
|
return {
|
|
@@ -417,18 +442,8 @@ $uni-color-primary: #2979ff;
|
|
|
color: #999999;
|
|
color: #999999;
|
|
|
margin-bottom: 20rpx;
|
|
margin-bottom: 20rpx;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- ::v-deep .u-add-tips {
|
|
|
|
|
- display: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- ::v-deep .u-add-wrap {
|
|
|
|
|
- background: url('/static/groupMeal/upload.png') center center / 100% 100% no-repeat !important;
|
|
|
|
|
- border: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- ::v-deep .u-add-btn {
|
|
|
|
|
- display: none !important;
|
|
|
|
|
|
|
+::v-deep .u-add-tips {
|
|
|
|
|
+ margin-top: 10rpx;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|