From 0bfd4909fdafdaeeeb160264b27163f7cf5f50b7 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Tue, 9 Jul 2024 15:08:40 +0800 Subject: [PATCH] 1 --- src/app/data/goods/goods.namespace.ts | 10 + .../goods-list/goods-list.component.html | 4 +- .../goods/goods-list/goods-list.component.ts | 83 ++++---- src/app/pages/goods/goods.routes.ts | 2 + .../price-list/price-list.component.html | 112 +++++++++++ .../price-list/price-list.component.less | 12 ++ .../price-list/price-list.component.ts | 178 +++++++++++++++++ .../pages/login/login/login.component.html | 19 +- .../pages/login/login/login.component.less | 3 + src/app/pages/login/login/login.component.ts | 7 +- .../merchant/mer-list/mer-list.component.html | 64 ++++++ .../merchant/mer-list/mer-list.component.ts | 90 ++++++++- .../goods-list/goods-list.component.html | 4 +- .../order-cinema/order-cinema.component.html | 163 ++++++++++++++++ .../order-cinema/order-cinema.component.less | 6 + .../order-cinema/order-cinema.component.ts | 184 ++++++++++++++++++ src/app/pages/trade/trade.routes.ts | 2 + src/app/pipes/recharge/price-type.pipe.ts | 20 ++ src/app/services/goods/goods.service.ts | 36 +++- src/app/services/merchant/mer.service.ts | 34 ++++ src/app/services/recharge/recharge.service.ts | 45 +++++ .../services/trade/order-cinema.service.ts | 23 +++ src/environments/environment.ts | 16 +- 23 files changed, 1055 insertions(+), 62 deletions(-) create mode 100644 src/app/pages/goods/recharge/price-list/price-list.component.html create mode 100644 src/app/pages/goods/recharge/price-list/price-list.component.less create mode 100644 src/app/pages/goods/recharge/price-list/price-list.component.ts create mode 100644 src/app/pages/trade/order-cinema/order-cinema.component.html create mode 100644 src/app/pages/trade/order-cinema/order-cinema.component.less create mode 100644 src/app/pages/trade/order-cinema/order-cinema.component.ts create mode 100644 src/app/pipes/recharge/price-type.pipe.ts create mode 100644 src/app/services/recharge/recharge.service.ts create mode 100644 src/app/services/trade/order-cinema.service.ts diff --git a/src/app/data/goods/goods.namespace.ts b/src/app/data/goods/goods.namespace.ts index 74b6a34..8371454 100644 --- a/src/app/data/goods/goods.namespace.ts +++ b/src/app/data/goods/goods.namespace.ts @@ -11,3 +11,13 @@ export const orderGoodsStatus = [ {name: "已退货" , key: 7}, {name: "待支付" , key: 8} ]; + + +export const orderCinemaStatus = [ + {name: "待付款" , key: 0} , + {name: "待出票" , key: 5}, + {name: "已出票" , key: 10}, + {name: "交易成功" , key: 15}, + {name: "已取消" , key: -5}, + +]; diff --git a/src/app/pages/goods/goods-list/goods-list.component.html b/src/app/pages/goods/goods-list/goods-list.component.html index 4794481..f496e95 100644 --- a/src/app/pages/goods/goods-list/goods-list.component.html +++ b/src/app/pages/goods/goods-list/goods-list.component.html @@ -221,6 +221,7 @@ nzAction="{{baseUrl}}fileUpload/fileUpload" nzListType="picture-card" [(nzFileList)]="bannerImg" + [nzMultiple]="true" [nzShowButton]="bannerImg.length < 20" [nzPreview]="handlePreview" [nzBeforeUpload]="beforeUpload" @@ -250,6 +251,7 @@ nzAction="{{baseUrl}}fileUpload/fileUpload" nzListType="picture-card" [(nzFileList)]="detailImg" + [nzMultiple]="true" [nzShowButton]="detailImg.length < 20" [nzPreview]="handlePreview" [nzBeforeUpload]="beforeUpload" @@ -455,6 +457,7 @@ [(nzFileList)]="showImg" [nzShowButton]="showImg.length < 1" [nzPreview]="handlePreview" + [nzBeforeUpload]="beforeUpload" nzAccept="image/*" > @@ -467,7 +470,6 @@ [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 d5a9eff..8967682 100644 --- a/src/app/pages/goods/goods-list/goods-list.component.ts +++ b/src/app/pages/goods/goods-list/goods-list.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import {Component} from '@angular/core'; import {DatePipe, NgForOf, NgIf, NgStyle} from "@angular/common"; import {NzButtonComponent} from "ng-zorro-antd/button"; import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; @@ -11,17 +11,14 @@ import {environment} from "../../../../environments/environment"; import {NzMessageService} from "ng-zorro-antd/message"; import {CommonService} from "../../../services/common/common.service"; import {GoodsService} from "../../../services/goods/goods.service"; -import { fallbackImg } from '../../../data/goods/goods.namespace'; +import {fallbackImg} from '../../../data/goods/goods.namespace'; import {GoodsMsgData, SpecsData} from "../../../model/goods.interface"; import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzImageDirective, NzImageModule} from "ng-zorro-antd/image"; import {NzModalModule} from "ng-zorro-antd/modal"; import {NzPopconfirmDirective} from "ng-zorro-antd/popconfirm"; -import { - NzTableComponent, NzTableModule, - NzTdAddOnComponent, -} from "ng-zorro-antd/table"; +import {NzTableComponent, NzTableModule, NzTdAddOnComponent,} from "ng-zorro-antd/table"; import {NzTreeSelectComponent} from "ng-zorro-antd/tree-select"; import {DictionaryPipe} from "../../../pipes/common/dictionary.pipe"; import {GoodsStatusPipe} from "../../../pipes/goods/goods-status.pipe"; @@ -133,7 +130,7 @@ export class GoodsListComponent { // 商品类型数据 nodes = []; nodesBrand = []; - nodesSpecs:SpecsData[] = []; + nodesSpecs: SpecsData[] = []; nodesVpdSource; merData: any; objectType: number; @@ -164,23 +161,23 @@ export class GoodsListComponent { // 初始化 this.editForm = this.fb.group({ - title: ['' , [Validators.required]], - goodsType: ['' , [Validators.required]], - type: ['' , [Validators.required]], - goodsBrand: ['' , [Validators.required]], + title: ['', [Validators.required]], + goodsType: ['', [Validators.required]], + type: ['', [Validators.required]], + goodsBrand: ['', [Validators.required]], id: [null], goodsLabel: [''], goodsExplain: [''], }); // 初始化 this.editSpecsForm = this.fb.group({ - name: ['' , [Validators.required]], + name: ['', [Validators.required]], // purLimit: ['' , [Validators.required]], - salePrice: ['' , [Validators.required]], - originalPrice: ['' , [Validators.required]], - stock: ['' , [Validators.required]], - validDay: ['' , [Validators.required]], - salesEndTime: [new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDay(), 23, 59, 59) , [Validators.required]], + salePrice: ['', [Validators.required]], + originalPrice: ['', [Validators.required]], + stock: ['', [Validators.required]], + validDay: ['', [Validators.required]], + salesEndTime: [new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDay(), 23, 59, 59), [Validators.required]], type: [''], source: [''], id: [null], @@ -199,7 +196,7 @@ export class GoodsListComponent { // 查询列表 public getRequest(reset: boolean = false) { - this.tableData.loading = true; + this.tableData.loading = true; if (reset) { this.tablePageNum = 1; } @@ -207,13 +204,13 @@ export class GoodsListComponent { this.searchForm.value.pageSize = 10; this.searchForm.value.time = new Date().getTime(); - this.goodsService.getListGoods(this.searchForm.value , (data: any) => { + this.goodsService.getListGoods(this.searchForm.value, (data: any) => { if (data['return_code'] == '000000') { this.tableData = data['return_data']; } else { this.msg.error(data['return_msg']); } - this.tableData.loading = false; + this.tableData.loading = false; }); } @@ -241,6 +238,7 @@ export class GoodsListComponent { } this.isVisibleEdit = true; } + // 编辑表单提交 handleEdit(): void { @@ -255,7 +253,7 @@ export class GoodsListComponent { this.editForm.value.bannerImg = this.commonService.postImg(this.bannerImg); this.editForm.value.detailImg = this.commonService.postImg(this.detailImg); - this.goodsService.editGoodsMsg(this.editForm.value , (data: any) => { + this.goodsService.editGoodsMsg(this.editForm.value, (data: any) => { if (data['return_code'] === '000000') { this.msg.success("成功!"); this.isVisibleEdit = false; @@ -268,7 +266,7 @@ export class GoodsListComponent { Object.values(this.editForm.controls).forEach(control => { if (control.invalid) { control.markAsDirty(); - control.updateValueAndValidity({ onlySelf: true }); + control.updateValueAndValidity({onlySelf: true}); } }); } @@ -286,7 +284,7 @@ export class GoodsListComponent { // 删除 delete(id: number): void { - this.goodsService.deleteGoodsMsg(id , (data: any) => { + this.goodsService.deleteGoods(id, (data: any) => { if (data['return_code'] === '000000') { this.msg.success("成功!"); this.getRequest(); @@ -298,7 +296,7 @@ export class GoodsListComponent { // 删除 deleteGoodsSpecs(id: number): void { - this.goodsService.deleteGoodsSpecs(id , (data: any) => { + this.goodsService.deleteGoodsSpecs(id, (data: any) => { if (data['return_code'] === '000000') { this.msg.success("成功!"); this.getSpecsList(); @@ -322,7 +320,7 @@ export class GoodsListComponent { array.forEach((item: any) => { if (item.children) { this.getNode(item.children); - }else { + } else { item["isLeaf"] = true; } item["key"] = item.id; @@ -333,7 +331,7 @@ export class GoodsListComponent { // 获取商品品牌 getGoodsBrandNode() { - this.goodsService.getListBrandAll( (data: any) => { + this.goodsService.getListBrandAll((data: any) => { if (data['return_code'] == '000000') { this.nodesBrand = data['return_data']; } @@ -374,17 +372,18 @@ export class GoodsListComponent { // 查询规格列表 getSpecsList(): void { this.loadingSpecs = true; - let params = { - id: this.goodsMsg?.id, - time: new Date().getTime() + let params = { + id: this.goodsMsg?.id, + time: new Date().getTime() } - this.goodsService.getGoodsSpecsList(params , (data: any) => { + this.goodsService.getGoodsSpecsList(params, (data: any) => { this.loadingSpecs = false; if (data['return_code'] == '000000') { this.nodesSpecs = data['return_data']; } }); } + // 添加规格 showEditSpecs(item?: any): void { @@ -396,7 +395,7 @@ export class GoodsListComponent { if (!this.commonService.whetherStringIsNull(item.showImg)) { this.showImg = this.commonService.stitchImg(item.showImg); } - } else{ + } else { this.showImg = []; this.editSpecsForm.reset(); } @@ -412,7 +411,7 @@ export class GoodsListComponent { return; } this.editSpecsForm.value.goodsId = this.goodsMsg?.id; - this.goodsService.editGoodsSpecs(this.editSpecsForm.value , (data: any) => { + this.goodsService.editGoodsSpecs(this.editSpecsForm.value, (data: any) => { if (data['return_code'] === '000000') { this.msg.success("成功!"); this.editSpecs = false; @@ -425,7 +424,7 @@ export class GoodsListComponent { Object.values(this.editSpecsForm.controls).forEach(control => { if (control.invalid) { control.markAsDirty(); - control.updateValueAndValidity({ onlySelf: true }); + control.updateValueAndValidity({onlySelf: true}); } }); } @@ -447,7 +446,7 @@ export class GoodsListComponent { } jumpTypeChange(type: string): void { - console.log("type" , type); + console.log("type", type); if (type == "2") { this.editSpecsForm.controls['appid'].clearValidators(); this.editSpecsForm.controls['appid'].markAsPristine(); @@ -460,11 +459,11 @@ export class GoodsListComponent { // 上下线 goodsAudit(id: number): void { - let params = { + let params = { id: id, time: new Date().getTime() } - this.goodsService.goodsAudit(params , (data: any) => { + this.goodsService.goodsAudit(params, (data: any) => { if (data['return_code'] === '000000') { this.msg.success("成功!"); this.getRequest(); @@ -475,15 +474,17 @@ export class GoodsListComponent { } // 图片上传操作 - beforeUpload = (file: NzUploadFile, _fileList: NzUploadFile[]): Observable => - new Observable((observer: Observer) => { + beforeUpload = (file: NzUploadFile, _fileList: NzUploadFile[]): Observable => { + return 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(); @@ -492,11 +493,11 @@ export class GoodsListComponent { observer.next(isJpgOrPng && isLt2M); observer.complete(); }); - + }; merList() { - let params = { - pageNum: 1 , + let params = { + pageNum: 1, pageSize: 10000 } this.merService.queryList(params, (data: any) => { diff --git a/src/app/pages/goods/goods.routes.ts b/src/app/pages/goods/goods.routes.ts index 5fe8d36..6bfdd09 100644 --- a/src/app/pages/goods/goods.routes.ts +++ b/src/app/pages/goods/goods.routes.ts @@ -2,11 +2,13 @@ import { Routes } from '@angular/router'; import {GoodsTypeComponent} from "./goods-type/goods-type.component"; import {GoodsBrandComponent} from "./goods-brand/goods-brand.component"; import {GoodsListComponent} from "./goods-list/goods-list.component"; +import {PriceListComponent} from "./recharge/price-list/price-list.component"; export const GOODS_ROUTES: Routes = [ { path: 'goods_type', component: GoodsTypeComponent}, { path: 'goods_brand', component: GoodsBrandComponent}, { path: 'goods-list', component: GoodsListComponent}, + { path: 'recharge-price', component: PriceListComponent}, ]; diff --git a/src/app/pages/goods/recharge/price-list/price-list.component.html b/src/app/pages/goods/recharge/price-list/price-list.component.html new file mode 100644 index 0000000..9ca95d1 --- /dev/null +++ b/src/app/pages/goods/recharge/price-list/price-list.component.html @@ -0,0 +1,112 @@ +
+
+
+ + 运营商 + + + + + + + + +
+ +
+ + + +
+
+
+ + + + + 运营商 + 充值金额 + 折扣金额 + 创建时间 + 更新时间 + 操作 + + + + + {{data.type | priceType}} + ¥{{data.price}} + ¥{{data.payPrice}} + {{ data.createTime | date: 'yyyy-MM-dd HH:mm'}} + {{ data.updateTime | date: 'yyyy-MM-dd HH:mm'}} + + 修改 + + + 更多 + + + + + + + + + 总计 {{ total }} 条 + + + + + +
+ + 运营商 + + + + + + + + + + + 售卖价格 + + + + + + + + 充值金额 + + + + + + + + 排序 + + + + + +
+
+
+ diff --git a/src/app/pages/goods/recharge/price-list/price-list.component.less b/src/app/pages/goods/recharge/price-list/price-list.component.less new file mode 100644 index 0000000..6d5c351 --- /dev/null +++ b/src/app/pages/goods/recharge/price-list/price-list.component.less @@ -0,0 +1,12 @@ +[nz-form-label] { + overflow: visible; +} +button { + margin-left: 8px; +} +.submit-btn { + width: 150px; +} +.search-area { + margin-top: 30px; +} diff --git a/src/app/pages/goods/recharge/price-list/price-list.component.ts b/src/app/pages/goods/recharge/price-list/price-list.component.ts new file mode 100644 index 0000000..3baceb4 --- /dev/null +++ b/src/app/pages/goods/recharge/price-list/price-list.component.ts @@ -0,0 +1,178 @@ +import { Component } from '@angular/core'; +import {DatePipe, NgForOf, NgIf} from "@angular/common"; +import {NzButtonComponent} from "ng-zorro-antd/button"; +import { + NzTableComponent, NzTableModule, + NzThMeasureDirective +} from "ng-zorro-antd/table"; +import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; +import {NzDividerComponent} from "ng-zorro-antd/divider"; +import {NzDropDownADirective, NzDropDownDirective, NzDropdownMenuComponent} from "ng-zorro-antd/dropdown"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzIconDirective} from "ng-zorro-antd/icon"; + +import { + NzInputNumberComponent, + NzInputNumberGroupComponent, +} from "ng-zorro-antd/input-number"; +import {NzMenuDirective, NzMenuItemComponent} from "ng-zorro-antd/menu"; +import {NzModalComponent, NzModalContentDirective, NzModalModule} from "ng-zorro-antd/modal"; +import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; +import {NzPopconfirmDirective} from "ng-zorro-antd/popconfirm"; +import {FormGroup, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms"; + +import {NzMessageService} from "ng-zorro-antd/message"; +import {CommonService} from "../../../../services/common/common.service"; +import {RechargeService} from "../../../../services/recharge/recharge.service"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {PriceTypePipe} from "../../../../pipes/recharge/price-type.pipe"; + +@Component({ + selector: 'app-price-list', + standalone: true, + imports: [ + NzModalComponent, + NzFormLabelComponent, + NzRowDirective, + NzFormDirective, + ReactiveFormsModule, + NzColDirective, + NzSelectComponent, + NzOptionComponent, + NzButtonComponent, + NzTableComponent, + NzThMeasureDirective, + NgForOf, + NzModalModule, + NzDividerComponent, + NzTableModule, + NzDropDownADirective, + DatePipe, + NzDropDownDirective, + NzDropdownMenuComponent, + NzIconDirective, + NzPopconfirmDirective, + NzMenuDirective, + NzMenuItemComponent, + NzModalContentDirective, + NzInputNumberGroupComponent, + NzInputNumberComponent, + NzFormControlComponent, + NzFormItemComponent, + NzInputDirective, + PriceTypePipe + + ], + templateUrl: './price-list.component.html', + styleUrl: './price-list.component.less' +}) +export class PriceListComponent { + // 表单页数 + tablePageNum = 1; + // 表单数据 + tableData: any = { + total: 0, + loading: false, + list: [], + }; + // 搜索表单 + searchForm: FormGroup; + + // 编辑产品类型表单 + editForm: FormGroup; + // 编辑弹出框 + isVisibleEdit = false; + + + constructor(private fb: NonNullableFormBuilder, + private msg: NzMessageService, + private commonService: CommonService, + private rechargeService: RechargeService) { + + // 初始化搜索框 + this.searchForm = this.fb.group({ + type: [''], + }); + + // 初始化 + this.editForm = this.fb.group({ + type: ['' , [Validators.required]], + sort: ['' , [Validators.required]], + price: ['' , [Validators.required]], + payPrice: ['' , [Validators.required]], + id: [null], + }); + this.getRequest(); + + } + + // 查询列表 + public getRequest(reset: boolean = false) { + this.tableData.loading = true; + if (reset) { + this.tablePageNum = 1; + } + this.searchForm.value.pageNum = this.tablePageNum; + this.searchForm.value.pageSize = 10; + this.searchForm.value.time = new Date().getTime(); + + this.rechargeService.getList(this.searchForm.value , (data: any) => { + if (data['return_code'] == '000000') { + this.tableData = data['return_data']; + } else { + this.msg.error(data['return_msg']); + } + this.tableData.loading = false; + }); + } + + + // 唤醒编辑表单 + showEdit(item?: any) { + if (item != null) { + item.type = String(item.type); + this.editForm.patchValue(item); + } else { + this.editForm.reset(); + } + this.isVisibleEdit = true; + } + // 编辑表单提交 + handleEdit(): void { + if (this.editForm.valid) { + + this.rechargeService.editPrice(this.editForm.value , (data: any) => { + if (data['return_code'] === '000000') { + this.msg.success("成功!"); + this.isVisibleEdit = false; + this.getRequest(); + } else { + this.msg.error(data['return_msg']); + } + }); + } else { + Object.values(this.editForm.controls).forEach(control => { + if (control.invalid) { + control.markAsDirty(); + control.updateValueAndValidity({ onlySelf: true }); + } + }); + } + + } + + + // 删除 + delete(id: number): void { + this.rechargeService.delete(id , (data: any) => { + if (data['return_code'] === '000000') { + this.msg.success("成功!"); + this.getRequest(); + } else { + this.msg.error(data['return_msg']); + } + }); + } + + +} diff --git a/src/app/pages/login/login/login.component.html b/src/app/pages/login/login/login.component.html index 40003d9..c189486 100644 --- a/src/app/pages/login/login/login.component.html +++ b/src/app/pages/login/login/login.component.html @@ -23,9 +23,22 @@ - - - + + + + + + diff --git a/src/app/pages/login/login/login.component.less b/src/app/pages/login/login/login.component.less index 5781420..96a4b5c 100644 --- a/src/app/pages/login/login/login.component.less +++ b/src/app/pages/login/login/login.component.less @@ -76,3 +76,6 @@ margin-top: 20px; width: 100%; } +i { + cursor: pointer; +} diff --git a/src/app/pages/login/login/login.component.ts b/src/app/pages/login/login/login.component.ts index d8f4c4b..d32a347 100644 --- a/src/app/pages/login/login/login.component.ts +++ b/src/app/pages/login/login/login.component.ts @@ -21,6 +21,7 @@ import {DATA, INIT_FLAG, LOGIN_DATA, USER_TOKEN} from "../../../data/login/local import {Router} from "@angular/router"; import {BrowserStorageService} from "../../../utils/localStorage.service"; import {LoginService} from "../../../services/login/login.service"; +import {NzIconDirective} from "ng-zorro-antd/icon"; @@ -45,6 +46,7 @@ import {LoginService} from "../../../services/login/login.service"; NzRowDirective, NzFormDirective, NzSliderComponent, + NzIconDirective, ], @@ -64,6 +66,7 @@ export class LoginComponent { // 背景图片 backgroundImage = backgroundImage; + passwordVisible = false; // 验证随机数 randomNumber = MathUtils.generateRandomNumber(100); @@ -71,12 +74,12 @@ export class LoginComponent { validateForm: FormGroup<{ loginName: FormControl; password: FormControl; - slider: FormControl; + slider: FormControl; remember: FormControl; }> = this.fb.group({ loginName: ['', [Validators.required]], password: ['', [Validators.required]], - slider: ['', [Validators.required]], + slider: [0, [Validators.required]], remember: [true] }); diff --git a/src/app/pages/merchant/mer-list/mer-list.component.html b/src/app/pages/merchant/mer-list/mer-list.component.html index af0465e..353ebbf 100644 --- a/src/app/pages/merchant/mer-list/mer-list.component.html +++ b/src/app/pages/merchant/mer-list/mer-list.component.html @@ -85,6 +85,7 @@ @@ -283,3 +284,66 @@ + + + + + + + +
+
+ + + + 产品名称 + 折扣 + 创建时间 + 操作 + + + + + {{data.productName}} + {{data.discount}}% + + {{ data.createTime | date: 'yyyy-MM-dd HH:mm'}} + + 修改 + + 删除 + + + + + +
+
+ + + + + +
+ + 类型 + + + + + + + + + + 折扣比例 + + + + + + + +
+
+
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 5680b2a..d916463 100644 --- a/src/app/pages/merchant/mer-list/mer-list.component.ts +++ b/src/app/pages/merchant/mer-list/mer-list.component.ts @@ -29,10 +29,10 @@ import {NzAvatarModule} from "ng-zorro-antd/avatar"; import {MerService} from "../../../services/merchant/mer.service"; import {RoleService} from "../../../services/role/role.service"; import {NzImageModule} from "ng-zorro-antd/image"; -import {GoodsTypeData} from "../../../model/goods.interface"; import {NzPopconfirmDirective} from "ng-zorro-antd/popconfirm"; import {NzTypographyComponent} from "ng-zorro-antd/typography"; import {payPlatform} from "../../../pipes/mer/payPlatform.pipe"; +import {NzInputNumberComponent, NzInputNumberGroupComponent} from "ng-zorro-antd/input-number"; @Component({ selector: 'app-mer-list', @@ -77,7 +77,9 @@ import {payPlatform} from "../../../pipes/mer/payPlatform.pipe"; NzImageModule, NzPopconfirmDirective, NzTypographyComponent, - payPlatform + payPlatform, + NzInputNumberComponent, + NzInputNumberGroupComponent ], templateUrl: './mer-list.component.html', styleUrl: './mer-list.component.less' @@ -99,7 +101,6 @@ export class MerListComponent { merDetailVisible = false; merDetailObject: any = {}; - merLogo = ''; uploadLoading = false; updateMerVisible = false; @@ -108,9 +109,13 @@ export class MerListComponent { // 编辑商品规格弹出框 isVisiblePay = false; nodesPayConfig: any; + productConfig: any; editPayForm: FormGroup; + editProductForm: FormGroup; // 编辑弹出框 isVisibleEdit = false; + isVisibleProduct = false; + isVisibleProductConfig = false; constructor(private fb: NonNullableFormBuilder, private merService: MerService, @@ -148,6 +153,14 @@ export class MerListComponent { id: [null], }); + // 初始化 + this.editProductForm = this.fb.group({ + id: [''], + merId: [''], + productType: ['' , [Validators.required]], + discount: ['', [Validators.required]], + }); + // 获取角色数据 this.roleService.queryAllRole((data: any) => { this.roleData = data['return_data']; @@ -439,4 +452,75 @@ export class MerListComponent { this.editPayForm.controls['payMerKey'].updateValueAndValidity(); } + + // 展示产品配置 + showProductConfig(data: any) { + this.isVisibleProductConfig = true; + this.merPayConfig = data; + this.getProductConfig(data.id); + } + + // 查询配置列表 + getProductConfig(merId: number): any { + let params = { + merId: merId, + } + this.merService.getList(params , (data: any) => { + if (data['return_code'] === '000000') { + this.productConfig = data['return_data']; + } else { + this.message.error(data['return_msg']); + } + }); + } + + // 唤醒编辑表单 + showEditProductConfig(item?:any) { + if (item != null) { + + item.productType = String(item.productType); + this.editProductForm.patchValue(item); + + } else { + this.editProductForm.reset(); + } + this.isVisibleProduct = true; + } + + // 编辑表单提交 + handleEditProductConfig(): void { + + if (this.editProductForm.valid) { + this.editProductForm.value.merId = this.merPayConfig.id; + this.merService.editProductConfig(this.editProductForm.value , (data: any) => { + if (data['return_code'] === '000000') { + this.message.success("成功!"); + this.isVisibleProduct = false; + this.getProductConfig(this.merPayConfig.id); + } else { + this.message.error(data['return_msg']); + } + }); + } else { + Object.values(this.editProductForm.controls).forEach(control => { + if (control.invalid) { + control.markAsDirty(); + control.updateValueAndValidity({ onlySelf: true }); + } + }); + } + + } + + // 删除 + deleteProductConfig(id: number): void { + this.merService.deleteProductConfig(id , (data: any) => { + if (data['return_code'] === '000000') { + this.message.success("成功!"); + this.getProductConfig(this.merPayConfig.id); + } else { + this.message.error(data['return_msg']); + } + }); + } } 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 04d55c6..dfed88a 100644 --- a/src/app/pages/trade/goods-list/goods-list.component.html +++ b/src/app/pages/trade/goods-list/goods-list.component.html @@ -160,8 +160,8 @@ {{orderGoodsData?.goodsName}} - {{orderGoodsData?.goodsSpecsName}} - {{ orderGoodsData?.userPhone }} - {{ orderGoodsData?.goodsTypeName }} + {{ orderGoodsData?.userPhone }}//. +0 {{ orderGoodsData?.goodsTypeName }} {{ orderGoodsData?.goodsBrandName }} {{ orderGoodsData?.goodsSpecsOriginalPrice }} {{ orderGoodsData?.goodsCount }} diff --git a/src/app/pages/trade/order-cinema/order-cinema.component.html b/src/app/pages/trade/order-cinema/order-cinema.component.html new file mode 100644 index 0000000..ba016b4 --- /dev/null +++ b/src/app/pages/trade/order-cinema/order-cinema.component.html @@ -0,0 +1,163 @@ +
+
+
+ + 商品名称 + + + + +
+ +
+ + 订单号 + + + + +
+
+ + 用户手机号 + + + + +
+ +
+ + 创建时间 + + + + + + + +
+
+ + 订单状态 + + + + + + +
+ +
+ + +
+
+
+ + + + + 商品名称 + 商品图片 + 商品分类 + 商品品牌 + 用户手机号 + 订单号 + 子订单号 + 创建时间 + 更新时间 + 物流状态 + 操作 + + + + + {{data.goodsName}} - {{data.goodsSpecsName}} + + + + {{data.goodsTypeName}} + {{data.goodsBrandName}} + {{data.userPhone}} + {{data.orderNo}} + {{data.childOrderNo}} + {{data.logisticsNo}} + {{ data.createTime | date: 'yyyy-MM-dd HH:mm'}} + {{ data.updateTime | date: 'yyyy-MM-dd HH:mm'}} + + 详情 + + + + 总计 {{ total }} 条 + + + + + + + + {{orderGoodsData?.goodsName}} - {{orderGoodsData?.goodsSpecsName}} + {{ orderGoodsData?.userPhone }}//. + 0 {{ orderGoodsData?.goodsTypeName }} + {{ orderGoodsData?.goodsBrandName }} + {{ orderGoodsData?.goodsSpecsOriginalPrice }} + {{ orderGoodsData?.goodsCount }} + + + + + + + + {{orderGoodsData.status | orderGoodsStatus}} + + + + + + + + + + + + + + + + {{ orderGoodsData?.orderNo }} + {{ orderGoodsData?.childOrderNo }} + {{ orderGoodsData?.paySerialNo }} + {{ orderGoodsData?.totalPrice }} + {{ orderGoodsData?.couponDiscountPrice }} + {{ orderGoodsData?.integralDiscountPrice }} + {{ orderGoodsData?.totalDeductionPrice }} + {{ orderGoodsData?.payRealPrice }} + + + + + {{ orderGoodsData?.createTime | date: 'yyyy-MM-dd HH:mm' }} + {{ orderGoodsData?.payTime | date: 'yyyy-MM-dd HH:mm' }} + {{ orderGoodsData?.cancelTime | date: 'yyyy-MM-dd HH:mm' }} + {{ orderGoodsData?.refundTime | date: 'yyyy-MM-dd HH:mm' }} + {{ orderGoodsData?.finishTime | date: 'yyyy-MM-dd HH:mm' }} + {{ orderGoodsData?.updateTime | date: 'yyyy-MM-dd HH:mm' }} + + + + + + + diff --git a/src/app/pages/trade/order-cinema/order-cinema.component.less b/src/app/pages/trade/order-cinema/order-cinema.component.less new file mode 100644 index 0000000..4056a86 --- /dev/null +++ b/src/app/pages/trade/order-cinema/order-cinema.component.less @@ -0,0 +1,6 @@ +.search-area { + margin-bottom: 10px; +} +.search-area button { + margin-right: 8px; +} diff --git a/src/app/pages/trade/order-cinema/order-cinema.component.ts b/src/app/pages/trade/order-cinema/order-cinema.component.ts new file mode 100644 index 0000000..943ede4 --- /dev/null +++ b/src/app/pages/trade/order-cinema/order-cinema.component.ts @@ -0,0 +1,184 @@ +import { Component } from '@angular/core'; +import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule} from "@angular/forms"; +import {environment} from "../../../../environments/environment"; +import {DateSelectType, DateUtils} from "../../../utils/dateUtils.service"; +import {NzMessageService} from "ng-zorro-antd/message"; +import {OrderGoodsData} from "../../../model/order.interface"; +import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; +import {NzFormDirective, NzFormModule} from "ng-zorro-antd/form"; +import {NzTreeSelectComponent} from "ng-zorro-antd/tree-select"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; +import {NzButtonComponent} from "ng-zorro-antd/button"; +import {NzTableComponent, NzTableModule, NzThMeasureDirective} from "ng-zorro-antd/table"; +import {NzImageDirective, NzImageModule} from "ng-zorro-antd/image"; +import {NzModalModule} from "ng-zorro-antd/modal"; +import {DatePipe, NgClass, NgForOf, NgIf} from "@angular/common"; +import {GoodsStatusPipe} from "../../../pipes/goods/goods-status.pipe"; +import {OrderGoodsStatusPipe} from "../../../pipes/order/order-goods-status.pipe"; +import {NzDropDownADirective, NzDropDownDirective, NzDropdownMenuComponent} from "ng-zorro-antd/dropdown"; +import {NzMenuDirective, NzMenuItemComponent} from "ng-zorro-antd/menu"; +import {NzDescriptionsModule} from "ng-zorro-antd/descriptions"; +import {NzPopconfirmDirective} from "ng-zorro-antd/popconfirm"; +import {NzDividerComponent} from "ng-zorro-antd/divider"; +import {NzTabSetComponent, NzTabsModule} from "ng-zorro-antd/tabs"; +import {NzIconDirective} from "ng-zorro-antd/icon"; +import {fallbackImg, orderCinemaStatus} from '../../../data/goods/goods.namespace'; +import {NzBadgeComponent} from "ng-zorro-antd/badge"; +import {AuditStatusPipe} from "../../../pipes/audit/audit-status.pipe"; +import {NzSpinComponent} from "ng-zorro-antd/spin"; +import {NzTimelineComponent, NzTimelineItemComponent} from "ng-zorro-antd/timeline"; +import {NzResultComponent} from "ng-zorro-antd/result"; +import {NzDatePickerComponent, NzRangePickerComponent} from "ng-zorro-antd/date-picker"; +import {NzRadioButtonDirective, NzRadioComponent, NzRadioGroupComponent} from "ng-zorro-antd/radio"; +import {OrderCinemaService} from "../../../services/trade/order-cinema.service"; + +@Component({ + selector: 'app-order-cinema', + standalone: true, + imports: [ + NzColDirective, + NzRowDirective, + NzFormDirective, + ReactiveFormsModule, + NzTreeSelectComponent, + NzInputDirective, + NzSelectComponent, + NzOptionComponent, + NzButtonComponent, + NzTableComponent, + NzImageModule, + NzModalModule, + NzTableModule, + NzFormModule, + NzThMeasureDirective, + NgForOf, + NzImageDirective, + GoodsStatusPipe, + DatePipe, + OrderGoodsStatusPipe, + NzDropdownMenuComponent, + NgIf, + NzMenuDirective, + NzDescriptionsModule, + NzMenuItemComponent, + NzPopconfirmDirective, + NzDividerComponent, + NzDropDownADirective, + NzDropDownDirective, + NzTabsModule, + NzIconDirective, + NzBadgeComponent, + AuditStatusPipe, + NzTabSetComponent, + FormsModule, + NzSpinComponent, + NzTimelineItemComponent, + NgClass, + NzResultComponent, + NzTimelineComponent, + NzDatePickerComponent, + NzRadioButtonDirective, + NzRadioComponent, + NzRadioGroupComponent, + NzRangePickerComponent, + ], + templateUrl: './order-cinema.component.html', + styleUrl: './order-cinema.component.less' +}) +export class OrderCinemaComponent { + // 表单页数 + tablePageNum = 1; + // 表单数据 + tableData: any = { + total: 0, + loading: false, + list: [], + }; + // 搜索表单 + searchForm: FormGroup; + + baseUrl = environment.baseUrl; + imageUrl = environment.imageUrl; + + orderGoodsData: any; + orderDetailModal = false; + // 时间类型选择 + dateTypeSelect = DateSelectType; + + + protected readonly fallbackImg = fallbackImg; + protected readonly orderCinemaStatus = orderCinemaStatus; + + constructor(private fb: NonNullableFormBuilder, + private msg: NzMessageService, + private orderCinema: OrderCinemaService) { + + + // 初始化搜索框 + this.searchForm = this.fb.group({ + orderNo: [''], + userPhone: [''], + goodsSpecsName: [''], + createTimeArray: [[]], + createTimeSelect: ['1'], + createTimeS: [''], + createTimeE: [''], + goodsName: [''], + payType: [''], + status: [''], + }); + + this.getRequest(); + } + + // 查询列表 + public getRequest(reset: boolean = false) { + + if (this.searchForm.controls['createTimeArray'].value != null + && this.searchForm.controls['createTimeArray'].value.length > 0) { + this.searchForm.controls['createTimeS'].setValue(this.searchForm.controls['createTimeArray'].value[0]); + this.searchForm.controls['createTimeE'].setValue(this.searchForm.controls['createTimeArray'].value[1]); + } else { + this.searchForm.controls['createTimeS'].setValue(null) + this.searchForm.controls['createTimeE'].setValue(null) + } + + this.tableData.loading = true; + if (reset) { + this.tablePageNum = 1; + } + this.searchForm.value.pageNum = this.tablePageNum; + this.searchForm.value.pageSize = 10; + this.searchForm.value.time = new Date().getTime(); + + this.orderCinema.getListCinema(this.searchForm.value , (data: any) => { + if (data['return_code'] == '000000') { + this.tableData = data['return_data']; + } else { + this.msg.error(data['return_msg']); + } + this.tableData.loading = false; + }); + } + + /** + * 创建时间初始化 + */ + createTimeInit() { + let createTimeSelect = this.searchForm.controls['createTimeSelect'].value; + if (createTimeSelect != null) { + let timeObj = DateUtils.getDate(new Date(), Number(createTimeSelect)); + this.searchForm.controls['createTimeArray'].setValue([timeObj.timeS, timeObj.timeE]); + } + } + + + showDetail(data: OrderGoodsData): void { + this.orderGoodsData = data; + this.orderDetailModal = true; + } + + + +} diff --git a/src/app/pages/trade/trade.routes.ts b/src/app/pages/trade/trade.routes.ts index 82c2b0d..e7cedec 100644 --- a/src/app/pages/trade/trade.routes.ts +++ b/src/app/pages/trade/trade.routes.ts @@ -3,10 +3,12 @@ import {CompOrderComponent} from "./comp-order/comp-order.component"; import {OrderAfterSalesComponent} from "./order-after-sales/order-after-sales.component"; import {GoodsListComponent} from "./goods-list/goods-list.component"; import {OrderRefundComponent} from "./order-refund/order-refund.component"; +import {OrderCinemaComponent} from "./order-cinema/order-cinema.component"; export const TRADE_ROUTES: Routes = [ { path: 'goods-list', component: GoodsListComponent }, { path: 'comp-order', component: CompOrderComponent }, { path: 'order-after-sales', component: OrderAfterSalesComponent }, { path: 'order-refund', component: OrderRefundComponent }, + { path: 'order-cinema', component: OrderCinemaComponent }, ]; diff --git a/src/app/pipes/recharge/price-type.pipe.ts b/src/app/pipes/recharge/price-type.pipe.ts new file mode 100644 index 0000000..cfe4507 --- /dev/null +++ b/src/app/pipes/recharge/price-type.pipe.ts @@ -0,0 +1,20 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'priceType', + standalone: true +}) +export class PriceTypePipe implements PipeTransform { + + transform(value: number): any { + switch (value) { + case 1: + return '电信运营商'; + case 2: + return '移动运营商'; + case 3: + return '联通运营商'; + } + } + +} diff --git a/src/app/services/goods/goods.service.ts b/src/app/services/goods/goods.service.ts index 419acb1..43993ef 100644 --- a/src/app/services/goods/goods.service.ts +++ b/src/app/services/goods/goods.service.ts @@ -132,8 +132,8 @@ export class GoodsService { * @param id * @param callBack */ - public deleteGoodsMsg(id: number, callBack:any) { - this.http.get(environment.baseUrl + 'goods/deleteGoodsMsg?id=' + id ).subscribe(data => { + public deleteGoods(id: number, callBack:any) { + this.http.get(environment.baseUrl + 'goods/deleteGoods?id=' + id ).subscribe(data => { callBack(data); }); } @@ -181,5 +181,37 @@ export class GoodsService { }); } + /** + * 查询列表 + * @param params + * @param callBack + */ + public getListPrice(params: object, callBack:any) { + this.http.post(environment.baseUrl + 'price/getListPrice', params).subscribe(data => { + callBack(data); + }); + } + + /** + * 编辑金额 + * @param params + * @param callBack + */ + public editPrice(params: object, callBack:any) { + this.http.post(environment.baseUrl + 'price/editPrice', params).subscribe(data => { + callBack(data); + }); + } + + /** + * 删除金额 + * @param params + * @param callBack + */ + public deletePrice(id: number, callBack:any) { + this.http.get(environment.baseUrl + 'price/deletePrice?id=' + id ).subscribe(data => { + callBack(data); + }); + } } diff --git a/src/app/services/merchant/mer.service.ts b/src/app/services/merchant/mer.service.ts index 6ceccd6..0d19b62 100644 --- a/src/app/services/merchant/mer.service.ts +++ b/src/app/services/merchant/mer.service.ts @@ -94,4 +94,38 @@ export class MerService { callBack(data); }); } + + /** + * 查询产品配置列表 + * @param params + * @param callBack + */ + public getList(params: any, callBack:any) { + params.time = new Date().getTime(); + this.http.get(environment.baseUrl + 'productConfig/getList?' + ObjectData.objectByString(params)).subscribe(data => { + callBack(data); + }); + } + + /** + * 编辑产品配置 + * @param params + * @param callBack + */ + public editProductConfig(params: any, callBack:any) { + this.http.post(environment.baseUrl + 'productConfig/editProductConfig', params).subscribe(data => { + callBack(data); + }); + } + + /** + * 删除产品 + * @param id + * @param callBack + */ + public deleteProductConfig(id: number, callBack:any) { + this.http.get(environment.baseUrl + 'productConfig/delete?id=' + id ).subscribe(data => { + callBack(data); + }); + } } diff --git a/src/app/services/recharge/recharge.service.ts b/src/app/services/recharge/recharge.service.ts new file mode 100644 index 0000000..746492d --- /dev/null +++ b/src/app/services/recharge/recharge.service.ts @@ -0,0 +1,45 @@ +import { Injectable } from '@angular/core'; +import {HttpClient} from "@angular/common/http"; +import {environment} from "../../../environments/environment"; +import {ObjectData} from "../../utils/objectData.service"; + +@Injectable({ + providedIn: 'root' +}) +export class RechargeService { + + constructor(private http: HttpClient) { } + + /** + * 编辑金额 + * @param params + * @param callBack + */ + public editPrice(params: object, callBack:any) { + this.http.post(environment.baseUrl + 'price/editPrice', params).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询列表 + * @param params + * @param callBack + */ + public getList(params: object, callBack:any) { + this.http.get(environment.baseUrl + 'price/getListPrice?' + ObjectData.objectByString(params)).subscribe(data => { + callBack(data); + }); + } + + /** + * 删除 + * @param id + * @param callBack + */ + public delete(id: number, callBack:any) { + this.http.get(environment.baseUrl + 'price/delete?id=' + id ).subscribe(data => { + callBack(data); + }); + } +} diff --git a/src/app/services/trade/order-cinema.service.ts b/src/app/services/trade/order-cinema.service.ts new file mode 100644 index 0000000..8942718 --- /dev/null +++ b/src/app/services/trade/order-cinema.service.ts @@ -0,0 +1,23 @@ +import { Injectable } from '@angular/core'; +import {HttpClient} from "@angular/common/http"; +import {environment} from "../../../environments/environment"; +import {ObjectData} from "../../utils/objectData.service"; + +@Injectable({ + providedIn: 'root' +}) +export class OrderCinemaService { + + constructor(private http: HttpClient) { } + + /** + * 查询订单列表 + * @param param + * @param callBack + */ + public getListCinema(param: object, callBack:any) { + this.http.get(environment.orderUrl + 'orderCinema/getListCinema?'+ObjectData.objectByString(param)).subscribe(data => { + callBack(data); + }); + } +} diff --git a/src/environments/environment.ts b/src/environments/environment.ts index efdd6ff..9928d62 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,14 +4,14 @@ export const environment = { production: false, - baseUrl: 'https://phg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - orderUrl: 'https://phg.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) - userUrl: 'https://phg.dctpay.com/user/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'https://phg.obs.cn-southwest-2.myhuaweicloud.com/', - // baseUrl: 'http://localhost:9702/brest/', // 测试环境服务器地址(请求数据地址) - // orderUrl: 'http://localhost:9703/order/', // 测试环境服务器地址(请求数据地址) - // userUrl: 'http://localhost:9704/user/', // 测试环境服务器地址(请求数据地址) - // imageUrl: 'https://phgcs.dctpay.com/filesystem/', + // baseUrl: 'https://phg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) + // orderUrl: 'https://phg.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) + // userUrl: 'https://phg.dctpay.com/user/', // 测试环境服务器地址(请求数据地址) + // imageUrl: 'https://phg.obs.cn-southwest-2.myhuaweicloud.com/', + baseUrl: 'http://localhost:9702/brest/', // 测试环境服务器地址(请求数据地址) + orderUrl: 'http://localhost:9703/order/', // 测试环境服务器地址(请求数据地址) + userUrl: 'http://localhost:9704/user/', // 测试环境服务器地址(请求数据地址) + imageUrl: 'https://phg-test.obs.cn-southwest-2.myhuaweicloud.com/', };