diff --git a/.gitignore b/.gitignore index eef909b..121a30d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ node_modules/ dist/ + + diff --git a/angular.json b/angular.json index 1253466..0a5bfcf 100644 --- a/angular.json +++ b/angular.json @@ -42,7 +42,7 @@ ] }, "configurations": { - "production": { + "prod": { "fileReplacements": [ { "replace": "src/environments/environment.ts", diff --git a/src/app/admin/audit/audit-coupon/audit-coupon.component.html b/src/app/admin/audit/audit-coupon/audit-coupon.component.html index 64917a8..f902d70 100644 --- a/src/app/admin/audit/audit-coupon/audit-coupon.component.html +++ b/src/app/admin/audit/audit-coupon/audit-coupon.component.html @@ -85,6 +85,10 @@ {{data.status | auditStatus}} + + + + @@ -110,8 +114,9 @@
- - + + +
diff --git a/src/app/admin/audit/audit-coupon/audit-coupon.component.ts b/src/app/admin/audit/audit-coupon/audit-coupon.component.ts index be0ce01..682bb47 100644 --- a/src/app/admin/audit/audit-coupon/audit-coupon.component.ts +++ b/src/app/admin/audit/audit-coupon/audit-coupon.component.ts @@ -25,6 +25,7 @@ export class AuditCouponComponent implements OnInit { approve: {}, object: {} }; + constructor( private form: FormBuilder, private audit: AuditService, @@ -91,16 +92,17 @@ export class AuditCouponComponent implements OnInit { this.isVisible = false; } - public approveProcessed(statusD: number): void { + public approveProcessed(statusD: number, id: number): void { + this.id = id; const p = { approveId: this.id, status: statusD, remarks: '', }; - this.common.showConfirm('是否确定' , r => { + this.common.showConfirm('是否确定', r => { if (r) { - this.audit.approveProcessed(p , data => { + this.audit.approveProcessed(p, data => { if (data['return_code'] === '000000') { this.isVisible = false; this.getRequest(true, this.searchForm.value); 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 3f1f9bc..3ebb5d1 100644 --- a/src/app/admin/coupon/coupon-edit/coupon-edit.component.html +++ b/src/app/admin/coupon/coupon-edit/coupon-edit.component.html @@ -31,6 +31,16 @@ +
+ + 卡券来源 + + + + + + +
展示区域 @@ -53,14 +63,6 @@
-
- - 卡券面值 - - - - -
销售价格 @@ -209,7 +211,21 @@ 卡券介紹 - + + +
上传图片
+
+ + + + +
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 acd91ed..a857fe5 100644 --- a/src/app/admin/coupon/coupon-edit/coupon-edit.component.ts +++ b/src/app/admin/coupon/coupon-edit/coupon-edit.component.ts @@ -31,6 +31,7 @@ export class CouponEditComponent implements OnInit { id: number; couponImg = []; couponCarouselImg = []; + couponDescImg = []; WEB_SERVE_URL = environment.baseUrl; previewImage: string | undefined = ''; previewVisible = false; @@ -69,7 +70,6 @@ export class CouponEditComponent implements OnInit { }); this.validateForm = this.fb.group({ couponName: [null, [Validators.required]], - couponPrice: [null, [Validators.required]], couponDesc: [null], couponType: [null, [Validators.required]], salesEndTime: [null, [Validators.required]], @@ -81,6 +81,7 @@ export class CouponEditComponent implements OnInit { isPresent: [false, [Validators.required]], payType: [false, [Validators.required]], displayArea: [false, [Validators.required]], + couponSource: [null], handselCouponId: [null], status: [null], couponKey: [null], @@ -214,8 +215,23 @@ export class CouponEditComponent implements OnInit { this.message.error('请上传卡券轮播图'); 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.couponDesc = this.content; + this.validateForm.value.couponDesc = couponDescImg.join(','); if (this.editFlag) { this.common.showConfirm('是否确定修改,确定将下架' , dataR => { if (dataR) { @@ -259,7 +275,7 @@ export class CouponEditComponent implements OnInit { data['return_data']['couponType'] = String(data['return_data']['couponType']); data['return_data']['displayArea'] = String(data['return_data']['displayArea']); data['return_data']['payType'] = String(data['return_data']['payType']); - this.content = data['return_data']['couponDesc']; + data['return_data']['couponSource'] = String(data['return_data']['couponSource']); if (data['return_data']['couponImg'] != null && data['return_data']['couponImg'] !== '') { const couponImg = String(data['return_data']['couponImg']); const couponArray = []; @@ -286,6 +302,21 @@ export class CouponEditComponent implements OnInit { } 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']); } else { this.message.create('error', data['return_msg']); 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 5c2988f..d04cdff 100644 --- a/src/app/admin/coupon/coupon-list/coupon-list.component.html +++ b/src/app/admin/coupon/coupon-list/coupon-list.component.html @@ -99,15 +99,14 @@ 编号 - 卡券编号 - 卡券名称 - 卡券面值 + 卡券编号 + 卡券名称 销售价格 有效库存 卡券类型 - 卡券状态 - 销售截止时间 - 创建时间 + 卡券状态 + 销售截止时间 + 创建时间 操作 @@ -116,7 +115,6 @@ {{i+1}} {{data.couponKey}} {{data.couponName}} - ¥{{data.couponPrice}} ¥{{data.salesPrice}} {{data.stockCount}} {{data.couponType === 1 ? '内部卷' : '外部卷'}} @@ -131,8 +129,8 @@ - - + + 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 63c7835..e010336 100644 --- a/src/app/admin/coupon/coupon-list/coupon-list.component.ts +++ b/src/app/admin/coupon/coupon-list/coupon-list.component.ts @@ -195,6 +195,7 @@ export class CouponListComponent implements OnInit { // 查看门店列表 public getList(id: number , couponName: string , couponType: number): void { + console.log(couponType); this.router.navigate(['/admin/coupon/salesCode-list'], { queryParams: { couponId: id, diff --git a/src/app/admin/coupon/sales-code-list/sales-code-list.component.html b/src/app/admin/coupon/sales-code-list/sales-code-list.component.html index 0de2db3..e06fe07 100644 --- a/src/app/admin/coupon/sales-code-list/sales-code-list.component.html +++ b/src/app/admin/coupon/sales-code-list/sales-code-list.component.html @@ -46,7 +46,7 @@ 共计 {{total}} 条数据 卡券名称: - {{name}}({{type === 1 ? '内部卷' : '外部卷'}}) + {{name}}({{type === 1 ? '内部券' : '外部券'}})
- + 77 登录密码 @@ -34,14 +34,6 @@
-
- - 商户编号 - - - - -
商户名称 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 f82331a..dd91d47 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,6 @@ export class MerchantEditComponent implements OnInit { this.validateForm = this.fb.group({ loginTelephone: [null, [Validators.required, ValidatorsService.mobile]], password: [null, [Validators.required, ValidatorsService.minLength(6)]], - merchantKey: [null, [Validators.required, ValidatorsService.maxLength(10)]], merchantName: [null, [Validators.required, ValidatorsService.pwdLength(2, 12)]], telephone: [null, [Validators.required]], address: [null, [Validators.required]], @@ -75,7 +74,7 @@ export class MerchantEditComponent implements OnInit { this.validateForm.reset(); } - // 课程保存 + // 保存 public getSave(): void { // tslint:disable-next-line:forin for (const i in this.validateForm.controls) { @@ -104,7 +103,7 @@ export class MerchantEditComponent implements OnInit { this.getBack(); this.message.success('修改成功'); } else { - this.message.create('error', '修改失败'); + this.message.create('error', data['return_msg']); } }); } else { @@ -115,7 +114,7 @@ export class MerchantEditComponent implements OnInit { this.getBack(); this.message.success('添加成功'); } else { - this.message.create('error', '保存失败'); + this.message.create('error', data['return_msg']); } }); } diff --git a/src/app/admin/merchant/merchant-list/merchant-list.component.ts b/src/app/admin/merchant/merchant-list/merchant-list.component.ts index 57d0e1d..53fd260 100644 --- a/src/app/admin/merchant/merchant-list/merchant-list.component.ts +++ b/src/app/admin/merchant/merchant-list/merchant-list.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit } from '@angular/core'; import {FormBuilder, FormGroup} from '@angular/forms'; -import {UserService} from '../../../services/user.service'; import {IconService} from '../../../services/icon.service'; import {NzMessageService} from 'ng-zorro-antd'; import {CommonsService} from '../../../services/commons.service'; @@ -14,7 +13,7 @@ import {environment} from '../../../../environments/environment'; styleUrls: ['./merchant-list.component.scss'] }) export class MerchantListComponent implements OnInit { - WEB_SERVE_URL = environment.baseUrl; + WEB_SERVE_URL = environment.imageUrl; searchForm: FormGroup; // 搜索框 requestData = []; // 列表数据 total: number; // 页码 diff --git a/src/app/admin/order/order-list/order-list.component.html b/src/app/admin/order/order-list/order-list.component.html new file mode 100644 index 0000000..e311aa6 --- /dev/null +++ b/src/app/admin/order/order-list/order-list.component.html @@ -0,0 +1,101 @@ + + + + + +
+
+
+
+ + 订单号 + + + + +
+
+ + 客户手机号 + + + + +
+
+ + 状态 + + + + + + + + + + +
+
+ +
+
+ + +
+
+
+
+ + +
+ 共计 {{total}} 条数据 + + + + 编号 + 订单号 + 支付流水号 + 客户名称 + 客户电话 + 支付模式 + 支付方式 + 支付金额 + 支付时间 + 取消时间 + 创建时间 + 状态 + + + + + {{i+1}} + {{data.orderNo}} + {{data.paySerialNo == null ? '暂无': 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.createTime | date: 'yyyy-MM-dd HH:mm'}} + {{data.orderStatus | orderCouponStatus}} + + +
+ + + diff --git a/src/app/admin/order/order-list/order-list.component.scss b/src/app/admin/order/order-list/order-list.component.scss new file mode 100644 index 0000000..8bee3fb --- /dev/null +++ b/src/app/admin/order/order-list/order-list.component.scss @@ -0,0 +1,4 @@ +.head_img { + height: 60px; + width: 60px; +} diff --git a/src/app/admin/order/order-list/order-list.component.ts b/src/app/admin/order/order-list/order-list.component.ts new file mode 100644 index 0000000..87ba687 --- /dev/null +++ b/src/app/admin/order/order-list/order-list.component.ts @@ -0,0 +1,84 @@ +import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../environments/environment'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MerchantService} from '../../../services/merchant.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 {OrderService} from '../../../services/order.service'; + +@Component({ + selector: 'app-order-list', + templateUrl: './order-list.component.html', + styleUrls: ['./order-list.component.scss'] +}) +export class OrderListComponent implements OnInit { + + WEB_SERVE_URL = environment.baseUrl; + searchForm: FormGroup; // 搜索框 + requestData = []; // 列表数据 + total: number; // 页码 + pageNum = 1; // 页码 + pageSize = 10; // 条码 + loading = true; + + constructor( + private form: FormBuilder, + private order: OrderService, + private iconService: IconService, + private message: NzMessageService, + private router: Router, + private common: CommonsService + ) { + } + + ngOnInit(): void { + this.init(); + } + + public init(): void { + this.searchForm = this.form.group({ + phone: [null], + orderNo: [null], + status: [null], + }); + 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.order.getOrderCouponList(whereObject, data => { + if (data['return_code'] === '000000') { + console.log(data); + 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 getDetail(id: number): void { + this.router.navigate(['/admin/merchant/merchant-detail'], { + queryParams: { + merchantId: id + } + }).then(r => console.log(r)); + } + +} diff --git a/src/app/admin/order/order-routing.module.ts b/src/app/admin/order/order-routing.module.ts new file mode 100644 index 0000000..67bba9b --- /dev/null +++ b/src/app/admin/order/order-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import {OrderListComponent} from './order-list/order-list.component'; + + +const routes: Routes = [ + { path: 'order-list', component: OrderListComponent }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class OrderRoutingModule { } diff --git a/src/app/admin/order/order.module.ts b/src/app/admin/order/order.module.ts new file mode 100644 index 0000000..6f9c393 --- /dev/null +++ b/src/app/admin/order/order.module.ts @@ -0,0 +1,28 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { OrderRoutingModule } from './order-routing.module'; +import { OrderListComponent } from './order-list/order-list.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 {RegionSelectorModule} from '../../common/region-selector/region-selector.module'; +import {AppCommonModule} from "../../app-common.module"; + + +@NgModule({ + declarations: [OrderListComponent], + imports: [ + CommonModule, + OrderRoutingModule, + NgZorroAntdModule, + SeparateModule, + ReactiveFormsModule, + FormsModule, + BreadcrumbModule, + RegionSelectorModule, + AppCommonModule + ] +}) +export class OrderModule { } diff --git a/src/app/admin/price/price-list/price-list.component.html b/src/app/admin/price/price-list/price-list.component.html index 8462cfb..dcecb3d 100644 --- a/src/app/admin/price/price-list/price-list.component.html +++ b/src/app/admin/price/price-list/price-list.component.html @@ -1 +1,112 @@ -

price-list works!

+ + + + + +
+
+
+
+ + 商户编号 + + + + +
+
+ + 商户名称 + + + + +
+
+ + 商户电话 + + + + +
+
+ + 商户状态 + + + + + + + +
+
+ +
+
+ + +
+
+
+
+ + +
+ 共计 {{total}} 条数据 +
+ +
+ + + + 编号 + 商户编号 + 商户名称 + 商户LOGO + 商户电话 + 创建时间 + 状态 + 操作 + + + + + {{i+1}} + {{data.merchantKey}} + {{data.merchantName}} + + + + {{data.telephone}} + {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} + {{data.status ===1 ? '正常' : '禁用'}} + + + + + + + + + + + + +
+ + + diff --git a/src/app/admin/price/price-list/price-list.component.scss b/src/app/admin/price/price-list/price-list.component.scss index e69de29..8bee3fb 100644 --- a/src/app/admin/price/price-list/price-list.component.scss +++ b/src/app/admin/price/price-list/price-list.component.scss @@ -0,0 +1,4 @@ +.head_img { + height: 60px; + width: 60px; +} diff --git a/src/app/admin/price/price-list/price-list.component.ts b/src/app/admin/price/price-list/price-list.component.ts index e576ed9..9620b52 100644 --- a/src/app/admin/price/price-list/price-list.component.ts +++ b/src/app/admin/price/price-list/price-list.component.ts @@ -1,4 +1,11 @@ import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../environments/environment'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MerchantService} from '../../../services/merchant.service'; +import {IconService} from '../../../services/icon.service'; +import {NzMessageService} from 'ng-zorro-antd'; +import {Router} from '@angular/router'; +import {CommonsService} from '../../../services/commons.service'; @Component({ selector: 'app-price-list', @@ -7,9 +14,122 @@ import { Component, OnInit } from '@angular/core'; }) export class PriceListComponent implements OnInit { - constructor() { } + WEB_SERVE_URL = environment.imageUrl; + searchForm: FormGroup; // 搜索框 + requestData = []; // 列表数据 + total: number; // 页码 + pageNum = 1; // 页码 + pageSize = 10; // 条码 + loading = true; + + constructor( + private form: FormBuilder, + private merchant: MerchantService, + private iconService: IconService, + private message: NzMessageService, + private router: Router, + private common: CommonsService + ) { + } ngOnInit(): void { + this.init(); + } + + public init(): void { + this.searchForm = this.form.group({ + merchantKey: [null], + merchantName: [null], + telephone: [null], + status: [null], + }); + 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.merchant.getMerchantList(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 disableMerchant(id): void { + const message = '是否禁用商户'; + this.common.showConfirm(message, data => { + if (data) { + this.merchant.disableMerchant(id, dataReturn => { + if (dataReturn['return_code'] === '000000') { + this.message.success('操作成功'); + this.getRequest(false , this.searchForm.value); + } else { + this.message.warning(dataReturn['return_msg']); + } + }); + } + }); + } + + // 启动商户 + public enableMerchant(id): void { + const message = '是否启用商户'; + this.common.showConfirm(message, data => { + if (data) { + this.merchant.enableMerchant(id, dataReturn => { + if (dataReturn['return_code'] === '000000') { + this.message.success('操作成功'); + this.getRequest(false , this.searchForm.value); + } else { + this.message.warning(dataReturn['return_msg']); + } + }); + } + }); + } + + + // 修改 + public getEdit(id: number): void { + this.router.navigate(['/admin/merchant/merchant-edit'], { + queryParams: { + merchantId: id + } + }).then(r => console.log(r)); + } + + // 查看详情 + public getDetail(id: number): void { + this.router.navigate(['/admin/merchant/merchant-detail'], { + queryParams: { + merchantId: id + } + }).then(r => console.log(r)); + } + + // 查看门店列表 + public getList(id: number , merchantName: string): void { + this.router.navigate(['/admin/merchantStore/store-list'], { + queryParams: { + merchantId: id, + name: merchantName, + } + }).then(r => console.log(r)); + } } diff --git a/src/app/admin/system/sinopec-config/sinopec-config.component.html b/src/app/admin/system/sinopec-config/sinopec-config.component.html new file mode 100644 index 0000000..32447ec --- /dev/null +++ b/src/app/admin/system/sinopec-config/sinopec-config.component.html @@ -0,0 +1,50 @@ + + + + +
+ 共计 {{total}} 条数据 +
+ +
+ + + + 编号 + 客户AppId + 客户密码 + 客户编码 + 客户KEY + 创建时间 + 操作 + + + + + {{i+1}} + {{data.appId}} + {{data.appSecret}} + {{data.code}} + {{data.signkey}} + {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} + + + + + +
+ + + diff --git a/src/app/admin/system/sinopec-config/sinopec-config.component.scss b/src/app/admin/system/sinopec-config/sinopec-config.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/admin/system/sinopec-config/sinopec-config.component.ts b/src/app/admin/system/sinopec-config/sinopec-config.component.ts new file mode 100644 index 0000000..fa4f333 --- /dev/null +++ b/src/app/admin/system/sinopec-config/sinopec-config.component.ts @@ -0,0 +1,90 @@ +import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../environments/environment'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MerchantService} from '../../../services/merchant.service'; +import {IconService} from '../../../services/icon.service'; +import {NzMessageService} from 'ng-zorro-antd'; +import {Router} from '@angular/router'; +import {SystemService} from '../../../services/system.service'; + +@Component({ + selector: 'app-sinopec-config', + templateUrl: './sinopec-config.component.html', + styleUrls: ['./sinopec-config.component.scss'] +}) +export class SinopecConfigComponent implements OnInit { + + WEB_SERVE_URL = environment.imageUrl; + searchForm: FormGroup; // 搜索框 + requestData = []; // 列表数据 + total: number; // 页码 + pageNum = 1; // 页码 + pageSize = 10; // 条码 + loading = true; + + constructor( + private form: FormBuilder, + private system: SystemService, + private iconService: IconService, + private message: NzMessageService, + private router: Router, + ) { + } + + ngOnInit(): void { + this.init(); + } + + public init(): void { + this.searchForm = this.form.group({ + merchantKey: [null], + merchantName: [null], + telephone: [null], + status: [null], + }); + 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.system.getListSinopecConfig(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 getEdit(id: number): void { + this.router.navigate(['/admin/system/sinopec-edit'], { + queryParams: { + sinopecId: id + } + }).then(r => console.log(r)); + } + + // // 查看详情 + // public getDetail(id: number): void { + // this.router.navigate(['/admin/system/sinopec-detail'], { + // queryParams: { + // merchantId: id + // } + // }).then(r => console.log(r)); + // } + +} diff --git a/src/app/admin/system/sinopec-edit/sinopec-edit.component.html b/src/app/admin/system/sinopec-edit/sinopec-edit.component.html new file mode 100644 index 0000000..2508fae --- /dev/null +++ b/src/app/admin/system/sinopec-edit/sinopec-edit.component.html @@ -0,0 +1,56 @@ + + + + 系统管理 + + + 编辑配置 + + + + + +
+
+
+ + 客户AppId + + + + +
+
+ + 客户密码 + + + + +
+
+ + 客户编码 + + + + +
+
+ + 客户KEY + + + + +
+
+
+
+ + +
+
+
+ +
diff --git a/src/app/admin/system/sinopec-edit/sinopec-edit.component.scss b/src/app/admin/system/sinopec-edit/sinopec-edit.component.scss new file mode 100644 index 0000000..ac60fb8 --- /dev/null +++ b/src/app/admin/system/sinopec-edit/sinopec-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/system/sinopec-edit/sinopec-edit.component.ts b/src/app/admin/system/sinopec-edit/sinopec-edit.component.ts new file mode 100644 index 0000000..52e7269 --- /dev/null +++ b/src/app/admin/system/sinopec-edit/sinopec-edit.component.ts @@ -0,0 +1,100 @@ +import { Component, OnInit } from '@angular/core'; +import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import {environment} from '../../../../environments/environment'; +import {MerchantService} from '../../../services/merchant.service'; +import {NzMessageService} from 'ng-zorro-antd'; +import {ActivatedRoute} from '@angular/router'; +import {SystemService} from '../../../services/system.service'; + +@Component({ + selector: 'app-sinopec-edit', + templateUrl: './sinopec-edit.component.html', + styleUrls: ['./sinopec-edit.component.scss'] +}) +export class SinopecEditComponent implements OnInit { + + validateForm!: FormGroup; + data: any; + editFlag = false; + id: number; + WEB_SERVE_URL = environment.baseUrl; + + constructor( + private fb: FormBuilder, + private system: SystemService, + private message: NzMessageService, // 信息提示 + private activatedRoute: ActivatedRoute, + ) { + } + + ngOnInit(): void { + this.activatedRoute.queryParams.subscribe(queryParams => { + if (queryParams.sinopecId != null) { + this.editFlag = true; + this.id = queryParams.sinopecId; + this.getDetails(queryParams.sinopecId); + } + }); + this.validateForm = this.fb.group({ + appId: [null, [Validators.required]], + appSecret: [null, [Validators.required]], + code: [null, [Validators.required]], + signkey: [null, [Validators.required]], + }); + } + + // 返回 + 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.editFlag) { + this.validateForm.value.id = this.id; + this.system.updateMerchant(this.validateForm.value, data => { + if (data['return_code'] === '000000') { + this.getBack(); + this.message.success('修改成功'); + } else { + this.message.create('error', data['return_msg']); + } + }); + } else { + this.system.insertMerchant(this.validateForm.value, data => { + if (data['return_code'] === '000000') { + this.getBack(); + this.message.success('添加成功'); + } else { + this.message.create('error', data['return_msg']); + } + }); + } + } + + + + public getDetails(id) { + this.system.findById(id, data => { + if (data['return_code'] === '000000') { + this.validateForm.patchValue(data['return_data']); + } else { + this.message.create('error', data['return_msg']); + } + }); + } +} diff --git a/src/app/admin/system/system-routing.module.ts b/src/app/admin/system/system-routing.module.ts index 9b210c8..d682601 100644 --- a/src/app/admin/system/system-routing.module.ts +++ b/src/app/admin/system/system-routing.module.ts @@ -7,6 +7,8 @@ import {SystemUserComponent} from './system-user/system-user.component'; import {PermissionComponent} from './permission/permission.component'; import {MenuComponent} from './menu/menu.component'; import {PositionRelComponent} from './position-rel/position-rel.component'; +import {SinopecConfigComponent} from './sinopec-config/sinopec-config.component'; +import {SinopecEditComponent} from './sinopec-edit/sinopec-edit.component'; const routes: Routes = [ { path: 'systemorganization', component: SystemOrganizationComponent}, @@ -16,6 +18,8 @@ const routes: Routes = [ { path: 'menu', component: MenuComponent }, { path: 'permission', component: PermissionComponent }, { path: 'positionrel', component: PositionRelComponent }, + { path: 'sinopec-config', component: SinopecConfigComponent }, + { path: 'sinopec-edit', component: SinopecEditComponent }, ]; @NgModule({ diff --git a/src/app/admin/system/system.module.ts b/src/app/admin/system/system.module.ts index 516d838..1a39276 100644 --- a/src/app/admin/system/system.module.ts +++ b/src/app/admin/system/system.module.ts @@ -16,8 +16,10 @@ import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; import {RegionSelectorModule} from '../../common/region-selector/region-selector.module'; import { PositionRelComponent } from './position-rel/position-rel.component'; import {AppCommonModule} from '../../app-common.module'; +import { SinopecConfigComponent } from './sinopec-config/sinopec-config.component'; +import { SinopecEditComponent } from './sinopec-edit/sinopec-edit.component'; @NgModule({ - declarations: [SystemOrganizationComponent, SystemRoleComponent, SystemRoleShowComponent, SystemUserComponent, MenuComponent, PermissionComponent, PositionRelComponent], + declarations: [SystemOrganizationComponent, SystemRoleComponent, SystemRoleShowComponent, SystemUserComponent, MenuComponent, PermissionComponent, PositionRelComponent, SinopecConfigComponent, SinopecEditComponent], imports: [ CommonModule, SystemRoutingModule, diff --git a/src/app/admin/user/user-list/user-list.component.ts b/src/app/admin/user/user-list/user-list.component.ts index ab6e1df..9cd45f1 100644 --- a/src/app/admin/user/user-list/user-list.component.ts +++ b/src/app/admin/user/user-list/user-list.component.ts @@ -85,5 +85,4 @@ export class UserListComponent implements OnInit { }); } - } diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts index 22e464e..dfb3e53 100644 --- a/src/app/app-common.module.ts +++ b/src/app/app-common.module.ts @@ -18,6 +18,7 @@ import { AuditTypePipe, AuditStatusPipe } from './pipes'; +import { OrderCouponStatusPipe } from './pipes/order/order-coupon-status.pipe'; const PIPES = [ TimesPipe, @@ -27,6 +28,7 @@ const PIPES = [ CouponCodePipe, AuditTypePipe, AuditStatusPipe, + OrderCouponStatusPipe, ]; diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 6e6afe7..d9efb45 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -56,6 +56,11 @@ const routes: Routes = [ loadChildren: () => import('./admin/audit/audit.module').then(m => m.AuditModule), canActivate: [InitGuardService] }, + { + path: 'order', + loadChildren: () => import('./admin/order/order.module').then(m => m.OrderModule), + canActivate: [InitGuardService] + }, { path: 'system', loadChildren: () => import('./admin/system/system.module').then(m => m.SystemModule), diff --git a/src/app/pipes/index.ts b/src/app/pipes/index.ts index e07dc9f..ddadb9b 100644 --- a/src/app/pipes/index.ts +++ b/src/app/pipes/index.ts @@ -5,3 +5,4 @@ export * from './coupon-status.pipe'; export * from './coupon-code.pipe'; export * from './audit-status.pipe'; export * from './audit-type.pipe'; +export * from './order/order-coupon-status.pipe'; diff --git a/src/app/pipes/order/order-coupon-status.pipe.ts b/src/app/pipes/order/order-coupon-status.pipe.ts new file mode 100644 index 0000000..f0c6b8f --- /dev/null +++ b/src/app/pipes/order/order-coupon-status.pipe.ts @@ -0,0 +1,22 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'orderCouponStatus' +}) +export class OrderCouponStatusPipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 1: + return '待支付'; + case 2: + return '已支付'; + case 3: + return '已完成'; + case 4: + return '已退款'; + case 5: + return '已取消'; + } + } +} diff --git a/src/app/pipes/system.pipe.ts b/src/app/pipes/system.pipe.ts index 9249d55..fc258f5 100644 --- a/src/app/pipes/system.pipe.ts +++ b/src/app/pipes/system.pipe.ts @@ -10,11 +10,15 @@ export class SystemPipe implements PipeTransform { case 0: return '超级管理员'; case 1: - return '区域账号'; + return '运营中心账户'; case 2: return '商户账号'; case 3: return '门店账号'; + case 4: + return '代理商账号'; + case 5: + return '分公司账号'; } } diff --git a/src/app/services/company.service.ts b/src/app/services/company.service.ts index 2fbd83d..88a111e 100644 --- a/src/app/services/company.service.ts +++ b/src/app/services/company.service.ts @@ -26,7 +26,7 @@ export class CompanyService { } /** - * 新增卡券 + * 新增 * * @param params 上传对象 * @param callBack 回调 diff --git a/src/app/services/icon.service.ts b/src/app/services/icon.service.ts index 28e4b80..e9882fc 100644 --- a/src/app/services/icon.service.ts +++ b/src/app/services/icon.service.ts @@ -12,7 +12,7 @@ export class IconService { constructor(private iconService: NzIconService) { this.iconService.fetchFromIconfont({ - scriptUrl: 'https://at.alicdn.com/t/font_2424521_j7tpclfptw.js' + scriptUrl: 'https://at.alicdn.com/t/font_2424521_9lbh3xk0u0h.js' }); } } diff --git a/src/app/services/order.service.ts b/src/app/services/order.service.ts new file mode 100644 index 0000000..49898c2 --- /dev/null +++ b/src/app/services/order.service.ts @@ -0,0 +1,27 @@ +import { Injectable } from '@angular/core'; +import {environment} from '../../environments/environment'; +import {HttpClient} from '@angular/common/http'; +import {CommonsService} from './commons.service'; + +@Injectable({ + providedIn: 'root' +}) +export class OrderService { + + constructor( + private http: HttpClient, + private common: CommonsService + ) { } + + /** + * 查询订单列表 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getOrderCouponList(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'highOrder/getOrderList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } +} diff --git a/src/app/services/system.service.ts b/src/app/services/system.service.ts index f9b0e54..76fe726 100644 --- a/src/app/services/system.service.ts +++ b/src/app/services/system.service.ts @@ -1,6 +1,7 @@ import {Injectable} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {environment} from '../../environments/environment'; +import {CommonsService} from './commons.service'; /** * 胡锐 @@ -11,7 +12,10 @@ import {environment} from '../../environments/environment'; }) export class SystemService { - constructor(private http: HttpClient) { } + constructor( + private http: HttpClient, + private common: CommonsService + ) { } /** * 删除菜单 @@ -110,4 +114,57 @@ export class SystemService { callBack(data); }); } + + /** + * 查询中石化配置列表 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getListSinopecConfig(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'secSinopecConfig/getListSinopecConfig?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } + + /** + * 新增商户 + * + * @param params 上传对象 + * @param callBack 回调 + * @return data 返回结果 + */ + public insertMerchant(params: object, callBack) { + this.http.post(environment.baseUrl + 'secSinopecConfig/insertSinopec', params).subscribe(data => { + callBack(data); + }); + } + + /** + * 修改商户 + * + * @param params 上传对象 + * @param callBack 回调 + * @return data 返回结果 + */ + public updateMerchant(params: object, callBack) { + this.http.post(environment.baseUrl + 'secSinopecConfig/updateSinopec', params).subscribe(data => { + callBack(data); + }); + } + + /** + * 根据id查询详情 + * + * @param sinopecId id + * @param callBack 回调 + */ + public findById(sinopecId: number, callBack) { + this.http.get(environment.baseUrl + 'secSinopecConfig/findById?sinopecId=' + sinopecId).subscribe(data => { + callBack(data); + }); + } + + + } diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 726b1dc..2e60ec0 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,5 +1,5 @@ export const environment = { production: true, - baseUrl: 'https://hsgcs.dctpay.com/brest/', // 正式环境服务器地址(请求数据地址) - imageUrl: 'https://hsgcs.dctpay.com/filesystem/', + baseUrl: 'https://hsg.dctpay.com/brest/', // 正式环境服务器地址(请求数据地址) + imageUrl: 'https://hsg.dctpay.com/filesystem/', }; diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts index 3ee1a1c..cee7c78 100644 --- a/src/environments/environment.test.ts +++ b/src/environments/environment.test.ts @@ -1,5 +1,5 @@ export const environment = { production: true, - baseUrl: 'https://newhigh.shinwoten.cn/crest/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'http://newhigh.shinwoten.cn/filesystem/', + baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) + imageUrl: 'https://hsgcs.dctpay.com/filesystem/', };