diff --git a/src/app/admin/company/company-edit/company-edit.component.ts b/src/app/admin/company/company-edit/company-edit.component.ts
index 9572b03..6eef281 100644
--- a/src/app/admin/company/company-edit/company-edit.component.ts
+++ b/src/app/admin/company/company-edit/company-edit.component.ts
@@ -54,10 +54,8 @@ export class CompanyEditComponent implements OnInit {
this.validateForm = this.fb.group({
loginName: [null, [Validators.required, ValidatorsService.maxLength(20)]],
password: [null, [Validators.required]],
- phone: [null, [Validators.required, ValidatorsService.mobile]],
regionId: [null],
name: [null, [Validators.required, ValidatorsService.maxLength(50)]],
- address: [null, [Validators.required, ValidatorsService.maxLength(80)]],
logo: [null],
regionName: [null],
company: {},
@@ -96,8 +94,6 @@ export class CompanyEditComponent implements OnInit {
}
this.validateForm.value['company']['name'] = this.validateForm.value.name;
this.validateForm.value['company']['regionId'] = this.regionId;
- this.validateForm.value['company']['address'] = this.validateForm.value.address;
- this.validateForm.value['company']['phone'] = this.validateForm.value.phone;
this.validateForm.value['company']['logo'] = this.validateForm.value.logo;
this.validateForm.value['user']['loginName'] = this.validateForm.value.loginName;
this.validateForm.value['user']['password'] = this.validateForm.value.password;
diff --git a/src/app/admin/company/company-list/company-list.component.html b/src/app/admin/company/company-list/company-list.component.html
index 499f69b..f78e537 100644
--- a/src/app/admin/company/company-list/company-list.component.html
+++ b/src/app/admin/company/company-list/company-list.component.html
@@ -52,8 +52,6 @@
所属地区 |
公司名称 |
公司LOGO |
- 联系方式 |
- 地址 |
创建时间 |
更新时间 |
操作 |
@@ -67,8 +65,6 @@
|
- {{data.phone}} |
- {{data.address}} |
{{data.createTime | date: 'yyyy-MM-dd HH:mm'}} |
{{data.updateTime | date: 'yyyy-MM-dd HH:mm'}} |
diff --git a/src/app/admin/coupon/coupon-edit/coupon-edit.component.html b/src/app/admin/coupon/coupon-edit/coupon-edit.component.html
index 3ebb5d1..d5e0930 100644
--- a/src/app/admin/coupon/coupon-edit/coupon-edit.component.html
+++ b/src/app/admin/coupon/coupon-edit/coupon-edit.component.html
@@ -24,7 +24,7 @@
卡券类型
-
+
@@ -35,15 +35,17 @@
卡券来源
-
+
+
+
-
+
- 展示区域
+ 展示区域
@@ -124,7 +126,7 @@
归库天数
-
+
@@ -192,6 +194,7 @@
@@ -232,8 +236,8 @@
diff --git a/src/app/admin/coupon/coupon-edit/coupon-edit.component.ts b/src/app/admin/coupon/coupon-edit/coupon-edit.component.ts
index a857fe5..01fbc0c 100644
--- a/src/app/admin/coupon/coupon-edit/coupon-edit.component.ts
+++ b/src/app/admin/coupon/coupon-edit/coupon-edit.component.ts
@@ -78,9 +78,9 @@ export class CouponEditComponent implements OnInit {
salesPrice: [null, [Validators.required]],
discountPrice: [null, [Validators.required]],
merchantId: [null, [Validators.required]],
- isPresent: [false, [Validators.required]],
- payType: [false, [Validators.required]],
- displayArea: [false, [Validators.required]],
+ isPresent: [false],
+ payType: [null, [Validators.required]],
+ displayArea: [null],
couponSource: [null],
handselCouponId: [null],
status: [null],
@@ -150,6 +150,7 @@ export class CouponEditComponent implements OnInit {
pageNum: this.pageNumCoupon,
pageSize: this.pageSizeCoupon,
merchantName: e,
+ status: 2,
};
this.getCouponList(paramsObject);
}
@@ -190,6 +191,14 @@ export class CouponEditComponent implements OnInit {
}
}
+ if (this.validateForm.value.isPresent == null) {
+ this.validateForm.value.isPresent = false;
+ }
+
+ if (this.validateForm.value.isPresent === false) {
+ this.validateForm.value.handselCouponId = [];
+ }
+
if (this.couponImg.length !== 0) {
if (this.couponImg[0]['response'] != null) {
this.validateForm.value.couponImg = this.couponImg[0]['response']['return_data'][0];
@@ -294,7 +303,7 @@ export class CouponEditComponent implements OnInit {
for (const i of couponCarouselImg) {
couponCarouselArray.push(
{
- uid: 1,
+ uid: i,
name: i,
status: 'done',
url: environment.imageUrl + i
@@ -308,7 +317,7 @@ export class CouponEditComponent implements OnInit {
for (const i of couponDescImg) {
couponDescArray.push(
{
- uid: 1,
+ uid: i,
name: i,
status: 'done',
url: environment.imageUrl + i
diff --git a/src/app/admin/coupon/coupon-list/coupon-list.component.html b/src/app/admin/coupon/coupon-list/coupon-list.component.html
index d04cdff..8c1f9a4 100644
--- a/src/app/admin/coupon/coupon-list/coupon-list.component.html
+++ b/src/app/admin/coupon/coupon-list/coupon-list.component.html
@@ -41,7 +41,7 @@
卡券类型
-
+
@@ -52,7 +52,7 @@
卡券状态
-
+
diff --git a/src/app/admin/coupon/coupon-list/coupon-list.component.ts b/src/app/admin/coupon/coupon-list/coupon-list.component.ts
index e010336..fdbcf43 100644
--- a/src/app/admin/coupon/coupon-list/coupon-list.component.ts
+++ b/src/app/admin/coupon/coupon-list/coupon-list.component.ts
@@ -1,6 +1,5 @@
import {Component, OnInit} from '@angular/core';
import {FormBuilder, FormGroup} from '@angular/forms';
-import {MerchantStoreService} from '../../../services/merchant-store.service';
import {IconService} from '../../../services/icon.service';
import {NzMessageService} from 'ng-zorro-antd';
import {ActivatedRoute, Router} from '@angular/router';
diff --git a/src/app/admin/discount/discount-coupon/discount-coupon.component.html b/src/app/admin/discount/discount-coupon/discount-coupon.component.html
new file mode 100644
index 0000000..0f7c14f
--- /dev/null
+++ b/src/app/admin/discount/discount-coupon/discount-coupon.component.html
@@ -0,0 +1 @@
+discount-coupon works!
diff --git a/src/app/admin/discount/discount-coupon/discount-coupon.component.scss b/src/app/admin/discount/discount-coupon/discount-coupon.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/admin/discount/discount-coupon/discount-coupon.component.spec.ts b/src/app/admin/discount/discount-coupon/discount-coupon.component.spec.ts
new file mode 100644
index 0000000..dc88035
--- /dev/null
+++ b/src/app/admin/discount/discount-coupon/discount-coupon.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { DiscountCouponComponent } from './discount-coupon.component';
+
+describe('DiscountCouponComponent', () => {
+ let component: DiscountCouponComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ DiscountCouponComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(DiscountCouponComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/admin/discount/discount-coupon/discount-coupon.component.ts b/src/app/admin/discount/discount-coupon/discount-coupon.component.ts
new file mode 100644
index 0000000..7318406
--- /dev/null
+++ b/src/app/admin/discount/discount-coupon/discount-coupon.component.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-discount-coupon',
+ templateUrl: './discount-coupon.component.html',
+ styleUrls: ['./discount-coupon.component.scss']
+})
+export class DiscountCouponComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit(): void {
+ }
+
+}
diff --git a/src/app/admin/discount/discount-detail/discount-detail.component.html b/src/app/admin/discount/discount-detail/discount-detail.component.html
new file mode 100644
index 0000000..ac197e7
--- /dev/null
+++ b/src/app/admin/discount/discount-detail/discount-detail.component.html
@@ -0,0 +1,22 @@
+
+
+
+ |
+ Name |
+ Age |
+ Address |
+
+
+
+
+ |
+ {{ data.name }} |
+ {{ data.age }} |
+ {{ data.address }} |
+
+
+
diff --git a/src/app/admin/discount/discount-detail/discount-detail.component.scss b/src/app/admin/discount/discount-detail/discount-detail.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/admin/discount/discount-detail/discount-detail.component.spec.ts b/src/app/admin/discount/discount-detail/discount-detail.component.spec.ts
new file mode 100644
index 0000000..7d040d3
--- /dev/null
+++ b/src/app/admin/discount/discount-detail/discount-detail.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { DiscountDetailComponent } from './discount-detail.component';
+
+describe('DiscountDetailComponent', () => {
+ let component: DiscountDetailComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ DiscountDetailComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(DiscountDetailComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/admin/discount/discount-detail/discount-detail.component.ts b/src/app/admin/discount/discount-detail/discount-detail.component.ts
new file mode 100644
index 0000000..a5c4147
--- /dev/null
+++ b/src/app/admin/discount/discount-detail/discount-detail.component.ts
@@ -0,0 +1,54 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-discount-detail',
+ templateUrl: './discount-detail.component.html',
+ styleUrls: ['./discount-detail.component.scss']
+})
+export class DiscountDetailComponent implements OnInit {
+
+ constructor() { }
+
+ checked = false;
+ indeterminate = false;
+ listOfData = [];
+ setOfCheckedId = new Set();
+
+ updateCheckedSet(id: number, checked: boolean): void {
+ if (checked) {
+ this.setOfCheckedId.add(id);
+ } else {
+ this.setOfCheckedId.delete(id);
+ }
+ }
+
+ onItemChecked(id: number, checked: boolean): void {
+ this.updateCheckedSet(id, checked);
+ this.refreshCheckedStatus();
+ }
+
+ onAllChecked(value: boolean): void {
+ this.listOfData.forEach(item => this.updateCheckedSet(item.id, value));
+ this.refreshCheckedStatus();
+ }
+
+
+
+ refreshCheckedStatus(): void {
+ this.checked = this.listOfData.every(item => this.setOfCheckedId.has(item.id));
+ this.indeterminate = this.listOfData.some(item => this.setOfCheckedId.has(item.id)) && !this.checked;
+ }
+
+ ngOnInit(): void {
+ this.listOfData = new Array(200).fill(0).map((_, index) => {
+ return {
+ id: index,
+ name: `Edward King ${index}`,
+ age: 32,
+ address: `London, Park Lane no. ${index}`
+ };
+ });
+ this.refreshCheckedStatus();
+
+ }
+}
diff --git a/src/app/admin/discount/discount-edit/discount-edit.component.html b/src/app/admin/discount/discount-edit/discount-edit.component.html
new file mode 100644
index 0000000..34080ef
--- /dev/null
+++ b/src/app/admin/discount/discount-edit/discount-edit.component.html
@@ -0,0 +1,108 @@
+
+
+
+ 卡券管理
+
+
+ 编辑卡券
+
+
+
+
+
+
+
+
diff --git a/src/app/admin/discount/discount-edit/discount-edit.component.scss b/src/app/admin/discount/discount-edit/discount-edit.component.scss
new file mode 100644
index 0000000..ac60fb8
--- /dev/null
+++ b/src/app/admin/discount/discount-edit/discount-edit.component.scss
@@ -0,0 +1,6 @@
+button {
+ margin-left: 8px;
+}
+:host ::ng-deep .ant-upload {
+ background-color: #ffffff;
+}
diff --git a/src/app/admin/discount/discount-edit/discount-edit.component.ts b/src/app/admin/discount/discount-edit/discount-edit.component.ts
new file mode 100644
index 0000000..eac1253
--- /dev/null
+++ b/src/app/admin/discount/discount-edit/discount-edit.component.ts
@@ -0,0 +1,161 @@
+import {Component, OnInit} from '@angular/core';
+import {FormBuilder, FormGroup, Validators} from '@angular/forms';
+import {environment} from '../../../../environments/environment';
+import {CommonsService} from '../../../services/commons.service';
+import {NzMessageService, NzUploadFile} from 'ng-zorro-antd';
+import {ActivatedRoute} from '@angular/router';
+import {DiscountService} from '../../../services/discount.service';
+
+function getBase64(file: File): Promise {
+ return new Promise((resolve, reject) => {
+ const reader = new FileReader();
+ reader.readAsDataURL(file);
+ reader.onload = () => resolve(reader.result);
+ reader.onerror = error => reject(error);
+ });
+}
+
+@Component({
+ selector: 'app-discount-edit',
+ templateUrl: './discount-edit.component.html',
+ styleUrls: ['./discount-edit.component.scss']
+})
+export class DiscountEditComponent implements OnInit {
+
+
+ validateForm!: FormGroup;
+ data: any;
+ editFlag = false;
+ id: number;
+ discountImg = [];
+ WEB_SERVE_URL = environment.baseUrl;
+ previewImage: string | undefined = '';
+ previewVisible = false;
+
+ constructor(
+ private fb: FormBuilder,
+ private discount: DiscountService,
+ private common: CommonsService,
+ private message: NzMessageService, // 信息提示
+ private activatedRoute: ActivatedRoute,
+ ) {
+ }
+
+ ngOnInit(): void {
+ this.activatedRoute.queryParams.subscribe(queryParams => {
+ if (queryParams.discountId != null) {
+ this.editFlag = true;
+ this.id = queryParams.discountId;
+ this.getDetails(queryParams.discountId);
+ }
+ });
+ this.validateForm = this.fb.group({
+ discountName: [null, [Validators.required]],
+ discountCondition: [null],
+ discountType: [null, [Validators.required]],
+ discountPrice: [null, [Validators.required]],
+ salesEndTime: [null, [Validators.required]],
+ effectiveDay: [1, [Validators.required]],
+ status: [null],
+ createTime: [null],
+ secUser: {},
+ });
+ }
+
+
+ // 返回
+ getBack() {
+ history.back();
+ }
+
+ // 重置
+ public resetForm(): void {
+ this.validateForm.reset();
+ }
+
+ // 保存
+
+ public getSave(): void {
+ // tslint:disable-next-line:forin
+ for (const i in this.validateForm.controls) {
+ this.validateForm.controls[i].markAsDirty();
+ this.validateForm.controls[i].updateValueAndValidity();
+ if (this.validateForm.controls[i].errors != null) {
+ this.message.error('必填项不能为空');
+ return;
+ }
+ }
+
+ if (this.discountImg.length !== 0) {
+ if (this.discountImg[0]['response'] != null) {
+ this.validateForm.value.discountImg = this.discountImg[0]['response']['return_data'][0];
+ } else {
+ this.validateForm.value.discountImg = this.discountImg[0].name;
+ }
+ } else {
+ this.message.error('请上传卡券图片');
+ return;
+ }
+
+ if (this.editFlag) {
+ this.common.showConfirm('是否确定修改,确定将下架', dataR => {
+ if (dataR) {
+ this.validateForm.value.id = this.id;
+ this.discount.updateDiscount(this.validateForm.value, data => {
+ if (data['return_code'] === '000000') {
+ this.getBack();
+ this.message.success('修改成功,卡券已下架!');
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ }
+ });
+ } else {
+ this.discount.insertDiscount(this.validateForm.value, data => {
+ if (data['return_code'] === '000000') {
+ this.getBack();
+ this.message.success('添加成功');
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ }
+ }
+
+ // 图片查看
+ handlePreview = async (file: NzUploadFile) => {
+ if (!file.url && !file.preview) {
+ // tslint:disable-next-line:no-non-null-assertion
+ file.preview = await getBase64(file.originFileObj!);
+ }
+ this.previewImage = file.url || file.preview;
+ this.previewVisible = true;
+ }
+
+ public getDetails(id) {
+ this.discount.getDiscountById(id, data => {
+ if (data['return_code'] === '000000') {
+ data['return_data']['discountType'] = String(data['return_data']['discountType']);
+ if (data['return_data']['discountImg'] != null && data['return_data']['discountImg'] !== '') {
+ const discountImg = String(data['return_data']['discountImg']);
+ const couponArray = [];
+ couponArray.push(
+ {
+ uid: 1,
+ name: discountImg,
+ status: 'done',
+ url: environment.imageUrl + discountImg
+ });
+ this.discountImg = couponArray;
+ }
+
+ this.validateForm.patchValue(data['return_data']);
+ } else {
+ this.message.create('error', data['return_msg']);
+ }
+ });
+ }
+
+
+}
diff --git a/src/app/admin/discount/discount-list/discount-list.component.html b/src/app/admin/discount/discount-list/discount-list.component.html
new file mode 100644
index 0000000..32c9112
--- /dev/null
+++ b/src/app/admin/discount/discount-list/discount-list.component.html
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+
+
+
+ 共计 {{total}} 条数据
+
+
+
+
+
+
+ 编号 |
+ 优惠券KEY |
+ 优惠券名称 |
+ 优惠券类型 |
+ 优惠内容 |
+ 有效天数 |
+ 截止日期 |
+ 创建时间 |
+ 状态 |
+ 操作 |
+
+
+
+
+ {{i + 1}} |
+ {{data.discountKey}} |
+ {{data.discountName}} |
+ {{data.discountType | discountType}} |
+
+
+ 满{{data.discountCondition}}抵扣{{data.discountPrice}}
+
+
+ 抵扣{{data.discountPrice}}
+
+
+ {{data.discountPrice}}折
+
+ |
+ {{data.effectiveDay}} |
+ {{data.salesEndTime | date: 'yyyy-MM-dd HH:mm'}} |
+ {{data.createTime}} |
+ {{data.status | discountStatus}} |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+ |
+ 卡券编号 |
+ 卡券名称 |
+ 销售价格 |
+ 有效库存 |
+ 卡券类型 |
+ 卡券状态 |
+ 销售截止时间 |
+
+
+
+
+ |
+ {{data.couponKey}} |
+ {{data.couponName}} |
+ ¥{{data.salesPrice}} |
+ {{data.stockCount}} |
+ {{data.couponType === 1 ? '内部卷' : '外部卷'}} |
+ {{data.status | couponStatus}} |
+ {{data.salesEndTime | date: 'yyyy-MM-dd HH:mm'}} |
+
+
+
+
+
+
+
+
+
+
+ 卡券编号 |
+ 卡券名称 |
+ 销售价格 |
+ 有效库存 |
+ 卡券类型 |
+ 卡券状态 |
+ 销售截止时间 |
+ 绑定时间 |
+ 操作 |
+
+
+
+
+ {{data['highCoupon'].couponKey}} |
+ {{data['highCoupon'].couponName}} |
+ ¥{{data['highCoupon'].salesPrice}} |
+ {{data['highCoupon'].stockCount}} |
+ {{data['highCoupon'].couponType === 1 ? '内部卷' : '外部卷'}} |
+ {{data['highCoupon'].status | couponStatus}} |
+ {{data['highCoupon'].salesEndTime | date: 'yyyy-MM-dd HH:mm'}} |
+ {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} |
+ 删除 |
+
+
+
+
diff --git a/src/app/admin/discount/discount-list/discount-list.component.scss b/src/app/admin/discount/discount-list/discount-list.component.scss
new file mode 100644
index 0000000..8bee3fb
--- /dev/null
+++ b/src/app/admin/discount/discount-list/discount-list.component.scss
@@ -0,0 +1,4 @@
+.head_img {
+ height: 60px;
+ width: 60px;
+}
diff --git a/src/app/admin/discount/discount-list/discount-list.component.ts b/src/app/admin/discount/discount-list/discount-list.component.ts
new file mode 100644
index 0000000..805fce9
--- /dev/null
+++ b/src/app/admin/discount/discount-list/discount-list.component.ts
@@ -0,0 +1,252 @@
+import { Component, OnInit } from '@angular/core';
+import {environment} from '../../../../environments/environment';
+import {FormBuilder, FormGroup} from '@angular/forms';
+import {AgentService} from '../../../services/agent.service';
+import {IconService} from '../../../services/icon.service';
+import {NzMessageService} from 'ng-zorro-antd';
+import {Router} from '@angular/router';
+import {CommonsService} from '../../../services/commons.service';
+import {DiscountService} from '../../../services/discount.service';
+import {CouponService} from '../../../services/coupon.service';
+import {MerchantService} from '../../../services/merchant.service';
+
+@Component({
+ selector: 'app-discount-list',
+ templateUrl: './discount-list.component.html',
+ styleUrls: ['./discount-list.component.scss']
+})
+export class DiscountListComponent implements OnInit {
+
+ WEB_SERVE_URL = environment.imageUrl;
+ searchForm: FormGroup; // 搜索框
+ searchFormCoupon: FormGroup; // 搜索框
+ requestData = []; // 列表数据
+ couponData = []; // 列表数据
+ optionList = []; // 列表数据
+ discountCoupon = []; // 列表数据
+ total: number; // 页码
+ pageNum = 1; // 页码
+ pageSize = 10; // 条码
+ loading = true;
+ isVisible = false;
+ isVisibleList = false;
+ couponList: any;
+ requestCouponData = []; // 列表数据
+ loadingCoupon = true;
+ loadingDiscountCoupon = true;
+ discountId: number;
+ RelByDiscountId: number;
+
+ setOfCheckedId = new Set();
+ checked = false;
+ indeterminate = false;
+
+ updateCheckedSet(id: number, checked: boolean): void {
+ if (checked) {
+ this.setOfCheckedId.add(id);
+ } else {
+ this.setOfCheckedId.delete(id);
+ }
+ }
+
+ onItemChecked(id: number, checked: boolean): void {
+ this.updateCheckedSet(id, checked);
+ this.refreshCheckedStatus();
+ }
+
+ onAllChecked(value: boolean): void {
+ this.requestCouponData.forEach(item => this.updateCheckedSet(item.id, value));
+ this.refreshCheckedStatus();
+ }
+
+
+
+ refreshCheckedStatus(): void {
+ this.checked = this.requestCouponData.every(item => this.setOfCheckedId.has(item.id));
+ this.indeterminate = this.requestCouponData.some(item => this.setOfCheckedId.has(item.id)) && !this.checked;
+ }
+
+ constructor(
+ private form: FormBuilder,
+ private discount: DiscountService,
+ private iconService: IconService,
+ private merchant: MerchantService,
+ private message: NzMessageService,
+ private router: Router,
+ private common: CommonsService,
+ private coupon: CouponService
+ ) {
+ }
+
+ ngOnInit(): void {
+ this.init();
+ const whereObject = {};
+ whereObject['pageNum'] = 1;
+ whereObject['pageSize'] = 30000;
+ this.merchant.getMerchantList(whereObject , data => {
+ if (data['return_code'] === '000000' ) {
+ this.optionList = data['return_data'].list;
+ }
+ });
+ }
+
+ public init(): void {
+ this.searchForm = this.form.group({
+ discountKey: [null],
+ discountName: [null],
+ discountType: [null],
+ });
+ this.searchFormCoupon = this.form.group({
+ merchantId: [null],
+ couponName: [null],
+ couponType: [null],
+ couponSource: [null],
+ status: [2],
+ });
+ this.getRequest(true, this.searchForm.value);
+ }
+
+ // 查询列表
+ public getRequest(reset: boolean = false, whereObject: object) {
+
+ this.loading = false;
+ if (reset) {
+ this.pageNum = 1;
+ }
+ whereObject['pageNum'] = this.pageNum;
+ whereObject['pageSize'] = this.pageSize;
+ this.discount.getDiscountList(whereObject, data => {
+ if (data['return_code'] === '000000') {
+ this.requestData = data['return_data'].list;
+ this.total = data['return_data'].total;
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ }
+
+ // 重置
+ public resetForm(): void {
+ this.searchForm.reset();
+ }
+
+ public getForbiddenUser(id, status: any): void {
+ const message = (status === 2 ? '是否下架当前优惠券' : '是否上架当前优惠券');
+ const s = status === 2 ? 3 : 2;
+ this.common.showConfirm(message, data => {
+ if (data) {
+ this.discount.editStatus(id, s , dataUser => {
+ if (dataUser['return_code'] === '000000') {
+ this.message.success(dataUser['return_data']);
+ } else {
+ this.message.error(dataUser['return_msg']);
+ }
+ this.getRequest(false , this.searchForm.value);
+ });
+ }
+ });
+ }
+
+
+ // 修改
+ public getEdit(id: number): void {
+ this.router.navigate(['/admin/discount/discount-detail'], {
+ queryParams: {
+ discountId: id
+ }
+ }).then(r => console.log(r));
+ }
+
+ // 查看详情
+ public getDetail(id: number): void {
+ this.router.navigate(['/admin/company/company-detail'], {
+ queryParams: {
+ companyId: id
+ }
+ }).then(r => console.log(r));
+ }
+
+ // 绑定卡券
+ public getCoupon(whereObject: object , id: number): void {
+ this.isVisible = true;
+ this.discountId = id;
+ whereObject['pageNum'] = 1;
+ whereObject['pageSize'] = 30000;
+ this.coupon.getCouponList(whereObject, data => {
+ if (data['return_code'] === '000000') {
+ this.loadingCoupon = false;
+ this.requestCouponData = data['return_data'].list;
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+
+ }
+
+ handleOk(): void {
+ const couponIdStr = [];
+ this.setOfCheckedId.forEach(item => couponIdStr.push(item));
+ const params = {
+ discountId : this.discountId,
+ couponIdStr : couponIdStr.join(',')
+ };
+ this.discount.insertDiscountCoupon(params , data => {
+ if (data['return_code'] === '000000') {
+ this.message.success(data['return_data']);
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ this.isVisible = false;
+ }
+
+ handleCancel(): void {
+ this.isVisible = false;
+ }
+
+
+ // 重置
+ public resetCouponForm(): void {
+ this.searchFormCoupon.reset();
+ }
+
+ public getCouponList(id: number): void {
+ this.RelByDiscountId = id;
+ this.getRelByDiscount(id);
+ this.isVisibleList = true;
+ }
+
+ getRelByDiscount(id: number): void {
+ this.loadingDiscountCoupon = true;
+ this.discount.getRelByDiscount(id , data => {
+ if (data['return_code'] === '000000') {
+ this.loadingDiscountCoupon = false;
+ this.discountCoupon = data['return_data'];
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ }
+
+ handleCancelList(): void {
+ this.isVisibleList = false;
+ }
+
+ showDeleteConfirmDelete(id: number): void {
+ this.common.showConfirm('是否确定删除!' , dataR => {
+ if (dataR) {
+ this.discount.delete(id, data => {
+ if (data['return_code'] === '000000') {
+ this.getRelByDiscount(this.RelByDiscountId);
+ this.message.success(data['return_data']);
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ }
+ });
+ }
+
+
+}
+
diff --git a/src/app/admin/discount/discount-routing.module.ts b/src/app/admin/discount/discount-routing.module.ts
new file mode 100644
index 0000000..ade5001
--- /dev/null
+++ b/src/app/admin/discount/discount-routing.module.ts
@@ -0,0 +1,21 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import {DiscountListComponent} from './discount-list/discount-list.component';
+import {DiscountEditComponent} from './discount-edit/discount-edit.component';
+import {DiscountDetailComponent} from './discount-detail/discount-detail.component';
+import {DiscountCouponComponent} from './discount-coupon/discount-coupon.component';
+
+
+const routes: Routes = [
+ { path: 'discount-list', component: DiscountListComponent },
+ { path: 'discount-edit', component: DiscountEditComponent },
+ { path: 'discount-detail', component: DiscountDetailComponent },
+ { path: 'discount-coupon', component: DiscountCouponComponent },
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class DiscountRoutingModule { }
diff --git a/src/app/admin/discount/discount.module.ts b/src/app/admin/discount/discount.module.ts
new file mode 100644
index 0000000..a483d7f
--- /dev/null
+++ b/src/app/admin/discount/discount.module.ts
@@ -0,0 +1,31 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { DiscountRoutingModule } from './discount-routing.module';
+import { DiscountListComponent } from './discount-list/discount-list.component';
+import { DiscountEditComponent } from './discount-edit/discount-edit.component';
+import { DiscountDetailComponent } from './discount-detail/discount-detail.component';
+import {NgZorroAntdModule} from 'ng-zorro-antd';
+import {SeparateModule} from '../../common/separate/separate.module';
+import {FormsModule, ReactiveFormsModule} from '@angular/forms';
+import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
+import {RichtextModule} from '../../common/richtext/richtext.module';
+import {AppCommonModule} from '../../app-common.module';
+import { DiscountCouponComponent } from './discount-coupon/discount-coupon.component';
+
+
+@NgModule({
+ declarations: [DiscountListComponent, DiscountEditComponent, DiscountDetailComponent, DiscountCouponComponent],
+ imports: [
+ CommonModule,
+ DiscountRoutingModule,
+ NgZorroAntdModule,
+ SeparateModule,
+ ReactiveFormsModule,
+ FormsModule,
+ BreadcrumbModule,
+ RichtextModule,
+ AppCommonModule
+ ]
+})
+export class DiscountModule { }
diff --git a/src/app/admin/merchant/merchant-detail/merchant-detail.component.html b/src/app/admin/merchant/merchant-detail/merchant-detail.component.html
index 5ea9a7b..31ec073 100644
--- a/src/app/admin/merchant/merchant-detail/merchant-detail.component.html
+++ b/src/app/admin/merchant/merchant-detail/merchant-detail.component.html
@@ -1,7 +1,7 @@
-
+
{{data['secUser']['loginName']}}
{{data['merchantKey']}}
diff --git a/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts b/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts
index 88d34a1..dd25626 100644
--- a/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts
+++ b/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import {MerchantService} from '../../../services/merchant.service';
import {NzMessageService} from 'ng-zorro-antd';
import {ActivatedRoute} from '@angular/router';
+import {environment} from '../../../../environments/environment';
@Component({
selector: 'app-merchant-detail',
@@ -12,6 +13,7 @@ export class MerchantDetailComponent implements OnInit {
data: any = {};
id: number;
+ FILE_URL = environment.imageUrl;
constructor(
private merchant: MerchantService,
private message: NzMessageService, // 信息提示
diff --git a/src/app/admin/merchant/merchant-edit/merchant-edit.component.html b/src/app/admin/merchant/merchant-edit/merchant-edit.component.html
index 5e6c7fa..7a4537d 100644
--- a/src/app/admin/merchant/merchant-edit/merchant-edit.component.html
+++ b/src/app/admin/merchant/merchant-edit/merchant-edit.component.html
@@ -22,7 +22,7 @@
- 77
+
登录密码
diff --git a/src/app/admin/merchant/merchant-edit/merchant-edit.component.ts b/src/app/admin/merchant/merchant-edit/merchant-edit.component.ts
index dd91d47..0a88cb1 100644
--- a/src/app/admin/merchant/merchant-edit/merchant-edit.component.ts
+++ b/src/app/admin/merchant/merchant-edit/merchant-edit.component.ts
@@ -51,7 +51,7 @@ export class MerchantEditComponent implements OnInit {
this.validateForm = this.fb.group({
loginTelephone: [null, [Validators.required, ValidatorsService.mobile]],
password: [null, [Validators.required, ValidatorsService.minLength(6)]],
- merchantName: [null, [Validators.required, ValidatorsService.pwdLength(2, 12)]],
+ merchantName: [null, [Validators.required, ValidatorsService.pwdLength(2, 5)]],
telephone: [null, [Validators.required]],
address: [null, [Validators.required]],
bankName: [null],
@@ -86,6 +86,7 @@ export class MerchantEditComponent implements OnInit {
}
}
+ console.log(this.validateForm.value);
this.validateForm.value['secUser']['telephone'] = this.validateForm.value.loginTelephone;
this.validateForm.value['secUser']['password'] = this.validateForm.value.password;
if (this.logoFile.length !== 0) {
diff --git a/src/app/admin/order/order-detail/order-detail.component.html b/src/app/admin/order/order-detail/order-detail.component.html
new file mode 100644
index 0000000..d128785
--- /dev/null
+++ b/src/app/admin/order/order-detail/order-detail.component.html
@@ -0,0 +1 @@
+order-detail works!
diff --git a/src/app/admin/order/order-detail/order-detail.component.scss b/src/app/admin/order/order-detail/order-detail.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/admin/order/order-detail/order-detail.component.ts b/src/app/admin/order/order-detail/order-detail.component.ts
new file mode 100644
index 0000000..66e9666
--- /dev/null
+++ b/src/app/admin/order/order-detail/order-detail.component.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-order-detail',
+ templateUrl: './order-detail.component.html',
+ styleUrls: ['./order-detail.component.scss']
+})
+export class OrderDetailComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit(): void {
+ }
+
+}
diff --git a/src/app/admin/order/order-list/order-list.component.html b/src/app/admin/order/order-list/order-list.component.html
index e311aa6..4ebe375 100644
--- a/src/app/admin/order/order-list/order-list.component.html
+++ b/src/app/admin/order/order-list/order-list.component.html
@@ -18,7 +18,7 @@
客户手机号
-
+
@@ -26,7 +26,7 @@
状态
-
+
@@ -66,33 +66,79 @@
编号 |
+ 商品名称 |
+ 订单来源 |
订单号 |
支付流水号 |
客户名称 |
客户电话 |
- 支付模式 |
+ 支付模式 |
支付方式 |
支付金额 |
- 支付时间 |
- 取消时间 |
创建时间 |
状态 |
+
{{i+1}} |
- {{data.orderNo}} |
- {{data.paySerialNo == null ? '暂无': data.paySerialNo}} |
+ {{data.goodsName}} |
+ {{data.giveawayType === true ? '赠送' : '购买'}} |
+
+
+ 赠送订单
+
+
+ {{data.orderNo}}
+
+ |
+
+
+ 赠送订单
+
+
+ {{data.paySerialNo}}
+
+ |
{{data.memName == null ? '暂无': data.memName}} |
{{data.memPhone == null ? '暂无': data.memPhone}} |
- {{data.payModel == null ? '暂无': data.payModel}} |
- {{data.payType == null ? '暂无': data.payType}} |
- {{data.payPrice == null ? '暂无': data.payPrice}} |
- {{data.payTime | date: 'yyyy-MM-dd HH:mm'}} |
- {{data.cancelTime | date: 'yyyy-MM-dd HH:mm'}} |
+
+
+ 赠送
+
+
+ {{data.payModel == null ? '暂无': data.payModel | paymodel}}
+
+ |
+
+
+ 赠送
+
+
+ {{data.payType == null ? '暂无': data.payType | paytype}}
+
+ |
+
+
+ 0
+
+
+ {{data.payPrice == null ? '暂无': data.payPrice}}
+
+ |
{{data.createTime | date: 'yyyy-MM-dd HH:mm'}} |
- {{data.orderStatus | orderCouponStatus}} |
+
+
+ 赠送订单
+
+
+ {{data.orderStatus | orderCouponStatus}}
+
+ |
+
+
+
diff --git a/src/app/admin/order/order-list/order-list.component.ts b/src/app/admin/order/order-list/order-list.component.ts
index 87ba687..1937b2b 100644
--- a/src/app/admin/order/order-list/order-list.component.ts
+++ b/src/app/admin/order/order-list/order-list.component.ts
@@ -39,9 +39,9 @@ export class OrderListComponent implements OnInit {
public init(): void {
this.searchForm = this.form.group({
- phone: [null],
+ memPhone: [null],
orderNo: [null],
- status: [null],
+ orderStatus: [null],
});
this.getRequest(true, this.searchForm.value);
}
@@ -74,7 +74,7 @@ export class OrderListComponent implements OnInit {
// 查看详情
public getDetail(id: number): void {
- this.router.navigate(['/admin/merchant/merchant-detail'], {
+ this.router.navigate(['/admin/order/order-detail'], {
queryParams: {
merchantId: id
}
diff --git a/src/app/admin/order/order-routing.module.ts b/src/app/admin/order/order-routing.module.ts
index 67bba9b..4d2bf72 100644
--- a/src/app/admin/order/order-routing.module.ts
+++ b/src/app/admin/order/order-routing.module.ts
@@ -1,10 +1,12 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {OrderListComponent} from './order-list/order-list.component';
+import {OrderDetailComponent} from './order-detail/order-detail.component';
const routes: Routes = [
{ path: 'order-list', component: OrderListComponent },
+ { path: 'order-detail', component: OrderDetailComponent },
];
@NgModule({
diff --git a/src/app/admin/order/order.module.ts b/src/app/admin/order/order.module.ts
index 6f9c393..a75b6ac 100644
--- a/src/app/admin/order/order.module.ts
+++ b/src/app/admin/order/order.module.ts
@@ -9,10 +9,11 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
import {RegionSelectorModule} from '../../common/region-selector/region-selector.module';
import {AppCommonModule} from "../../app-common.module";
+import { OrderDetailComponent } from './order-detail/order-detail.component';
@NgModule({
- declarations: [OrderListComponent],
+ declarations: [OrderListComponent, OrderDetailComponent],
imports: [
CommonModule,
OrderRoutingModule,
diff --git a/src/app/admin/system/system-organization/system-organization.component.html b/src/app/admin/system/system-organization/system-organization.component.html
index 19bbb3a..c198290 100644
--- a/src/app/admin/system/system-organization/system-organization.component.html
+++ b/src/app/admin/system/system-organization/system-organization.component.html
@@ -71,12 +71,12 @@
|