|
|
@ -31,6 +31,7 @@ export class CouponEditComponent implements OnInit { |
|
|
|
id: number; |
|
|
|
id: number; |
|
|
|
couponImg = []; |
|
|
|
couponImg = []; |
|
|
|
couponCarouselImg = []; |
|
|
|
couponCarouselImg = []; |
|
|
|
|
|
|
|
couponDescImg = []; |
|
|
|
WEB_SERVE_URL = environment.baseUrl; |
|
|
|
WEB_SERVE_URL = environment.baseUrl; |
|
|
|
previewImage: string | undefined = ''; |
|
|
|
previewImage: string | undefined = ''; |
|
|
|
previewVisible = false; |
|
|
|
previewVisible = false; |
|
|
@ -213,8 +214,23 @@ export class CouponEditComponent implements OnInit { |
|
|
|
this.message.error('请上传卡券轮播图'); |
|
|
|
this.message.error('请上传卡券轮播图'); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const couponDescImg = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.couponDescImg.length !== 0) { |
|
|
|
|
|
|
|
for (const i of this.couponDescImg) { |
|
|
|
|
|
|
|
if (i['response'] != null) { |
|
|
|
|
|
|
|
couponDescImg.push(i['response']['return_data'][0]); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
couponDescImg.push(i.name); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.message.error('请上传卡券详情图'); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.validateForm.value.couponCarouselImg = couponCarouselImg.join(','); |
|
|
|
this.validateForm.value.couponCarouselImg = couponCarouselImg.join(','); |
|
|
|
this.validateForm.value.couponDesc = this.content; |
|
|
|
this.validateForm.value.couponDesc = couponDescImg.join(','); |
|
|
|
if (this.editFlag) { |
|
|
|
if (this.editFlag) { |
|
|
|
this.common.showConfirm('是否确定修改,确定将下架' , dataR => { |
|
|
|
this.common.showConfirm('是否确定修改,确定将下架' , dataR => { |
|
|
|
if (dataR) { |
|
|
|
if (dataR) { |
|
|
@ -258,7 +274,6 @@ export class CouponEditComponent implements OnInit { |
|
|
|
data['return_data']['couponType'] = String(data['return_data']['couponType']); |
|
|
|
data['return_data']['couponType'] = String(data['return_data']['couponType']); |
|
|
|
data['return_data']['displayArea'] = String(data['return_data']['displayArea']); |
|
|
|
data['return_data']['displayArea'] = String(data['return_data']['displayArea']); |
|
|
|
data['return_data']['payType'] = String(data['return_data']['payType']); |
|
|
|
data['return_data']['payType'] = String(data['return_data']['payType']); |
|
|
|
this.content = data['return_data']['couponDesc']; |
|
|
|
|
|
|
|
if (data['return_data']['couponImg'] != null && data['return_data']['couponImg'] !== '') { |
|
|
|
if (data['return_data']['couponImg'] != null && data['return_data']['couponImg'] !== '') { |
|
|
|
const couponImg = String(data['return_data']['couponImg']); |
|
|
|
const couponImg = String(data['return_data']['couponImg']); |
|
|
|
const couponArray = []; |
|
|
|
const couponArray = []; |
|
|
@ -285,6 +300,21 @@ export class CouponEditComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
this.couponCarouselImg = couponCarouselArray; |
|
|
|
this.couponCarouselImg = couponCarouselArray; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (data['return_data']['couponDesc'] != null && data['return_data']['couponDesc'] !== '') { |
|
|
|
|
|
|
|
const couponDescImg = data['return_data']['couponDesc'].split(','); |
|
|
|
|
|
|
|
const couponDescArray = []; |
|
|
|
|
|
|
|
for (const i of couponDescImg) { |
|
|
|
|
|
|
|
couponDescArray.push( |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
uid: 1, |
|
|
|
|
|
|
|
name: i, |
|
|
|
|
|
|
|
status: 'done', |
|
|
|
|
|
|
|
url: environment.imageUrl + i |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.couponDescImg = couponDescArray; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.validateForm.patchValue(data['return_data']); |
|
|
|
this.validateForm.patchValue(data['return_data']); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.message.create('error', data['return_msg']); |
|
|
|
this.message.create('error', data['return_msg']); |
|
|
|