@@ -237,6 +241,7 @@
[(nzFileList)]="detailImg"
[nzShowButton]="detailImg.length < 20"
[nzPreview]="handlePreview"
+ [nzBeforeUpload]="beforeUpload"
nzAccept="image/*"
>
@@ -439,6 +444,7 @@
[(nzFileList)]="showImg"
[nzShowButton]="showImg.length < 1"
[nzPreview]="handlePreview"
+ [nzBeforeUpload]="beforeUpload"
nzAccept="image/*"
>
@@ -450,6 +456,7 @@
[nzVisible]="previewVisible"
[nzContent]="modalContent"
[nzFooter]="null"
+
(nzOnCancel)="previewVisible = false"
>
diff --git a/src/app/pages/goods/goods-list/goods-list.component.ts b/src/app/pages/goods/goods-list/goods-list.component.ts
index c5304c1..2fb352f 100644
--- a/src/app/pages/goods/goods-list/goods-list.component.ts
+++ b/src/app/pages/goods/goods-list/goods-list.component.ts
@@ -36,6 +36,7 @@ import {
import {NzSpaceItemDirective} from "ng-zorro-antd/space";
import {NzDatePickerComponent} from "ng-zorro-antd/date-picker";
import {NzTypographyComponent} from "ng-zorro-antd/typography";
+import {Observable, Observer} from "rxjs";
const getBase64 = (file: File): Promise =>
new Promise((resolve, reject) => {
@@ -135,6 +136,8 @@ export class GoodsListComponent {
goodsMsg?: GoodsMsgData;
+
+
protected readonly fallbackImg = fallbackImg;
constructor(private fb: NonNullableFormBuilder,
@@ -145,6 +148,7 @@ export class GoodsListComponent {
this.nodesVpdSource = new DictionaryPipe().getDictionaryList('GOODS_VPD_SOURCE');
+
// 初始化搜索框
this.searchForm = this.fb.group({
title: [''],
@@ -172,7 +176,7 @@ export class GoodsListComponent {
originalPrice: ['' , [Validators.required]],
stock: ['' , [Validators.required]],
validDay: ['' , [Validators.required]],
- salesEndTime: ['' , [Validators.required]],
+ salesEndTime: [new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDay(), 23, 59, 59) , [Validators.required]],
type: [''],
source: [''],
id: [null],
@@ -388,8 +392,9 @@ export class GoodsListComponent {
if (!this.commonService.whetherStringIsNull(item.showImg)) {
this.showImg = this.commonService.stitchImg(item.showImg);
}
- } else {
- this.editSpecsForm.reset()
+ } else{
+ this.showImg = [];
+ this.editSpecsForm.reset();
}
this.editSpecs = true;
}
@@ -465,6 +470,25 @@ export class GoodsListComponent {
});
}
+ // 图片上传操作
+ beforeUpload = (file: NzUploadFile, _fileList: NzUploadFile[]): Observable =>
+ new Observable((observer: Observer) => {
+ const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
+ if (!isJpgOrPng) {
+ this.msg.error('上传格式错误!');
+ observer.complete();
+ return;
+ }
+ const isLt2M = file.size! / 1024 / 1024 < 5;
+ if (!isLt2M) {
+ this.msg.error('图片大小超过5MB!');
+ observer.complete();
+ return;
+ }
+ observer.next(isJpgOrPng && isLt2M);
+ observer.complete();
+ });
+
}
diff --git a/src/app/pages/merchant/mer-list/mer-list.component.ts b/src/app/pages/merchant/mer-list/mer-list.component.ts
index dd055e5..5680b2a 100644
--- a/src/app/pages/merchant/mer-list/mer-list.component.ts
+++ b/src/app/pages/merchant/mer-list/mer-list.component.ts
@@ -365,8 +365,10 @@ export class MerListComponent {
}
// 唤醒编辑表单
- showEdit(item?: GoodsTypeData) {
+ showEdit(item?:any) {
if (item != null) {
+
+ item.payPlatform = String(item.payPlatform);
this.editPayForm.patchValue(item);
} else {
diff --git a/src/app/pages/trade/goods-list/goods-list.component.html b/src/app/pages/trade/goods-list/goods-list.component.html
index 4797125..04d55c6 100644
--- a/src/app/pages/trade/goods-list/goods-list.component.html
+++ b/src/app/pages/trade/goods-list/goods-list.component.html
@@ -107,6 +107,7 @@
商品图片 |
商品分类 |
商品品牌 |
+ 用户手机号 |
订单号 |
子订单号 |
物流单号 |
@@ -124,6 +125,7 @@