diff --git a/src/app/data/goods/goods.namespace.ts b/src/app/data/goods/goods.namespace.ts index 514be3f..427ceff 100644 --- a/src/app/data/goods/goods.namespace.ts +++ b/src/app/data/goods/goods.namespace.ts @@ -1,15 +1,14 @@ export const fallbackImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZ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dAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=='; -export const orderGoodsStatus = [ - {name: "待发货" , key: 1} , - {name: "已发货" , key: 2}, - {name: "配送中" , key: 3}, - {name: "已送达" , key: 4}, - {name: "已取消" , key: 5}, - {name: "退货中" , key: 6}, - {name: "已退货" , key: 7}, - {name: "待支付" , key: 8} +export const logisticsStatus = [ + {name: "派件中" , key: "DELIVERING"} , + {name: "运输中" , key: "TRANSPORT"}, + {name: "已代签收" , key: "AGENT_SIGN"}, + {name: "已签收" , key: "SIGN"}, + {name: "已揽收" , key: "ACCEPT"}, + {name: "包裹异常" , key: "FAILED"}, + {name: "待揽收" , key: "WAIT_ACCEPT"} ]; export const orderGoodsChild = [ {name: "待支付" , key: 1} , 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 c456ac6..78ad508 100644 --- a/src/app/pages/trade/goods-list/goods-list.component.html +++ b/src/app/pages/trade/goods-list/goods-list.component.html @@ -26,25 +26,22 @@
- 用户手机号 + 子订单号 - +
- -
+
- 创建时间 + 用户手机号 - - - - +
-
+ +
商品分类 @@ -57,7 +54,7 @@
-
+
商品品牌 @@ -68,25 +65,48 @@
- -
+
+ + 物流状态 + + + + + + +
+
+ + 支付类型 + + + + + + +
+
- 订单状态 + 支付状态 - +
+
+ + 创建时间 + + + + +
- - - 更多查询条件 - - +
@@ -103,7 +123,7 @@ [nzData]="tableData.list" > - 商品名称 + 商品名称 商户名称 商品图片 商品分类 @@ -112,10 +132,12 @@ 订单号 子订单号 物流单号 - 创建时间 - 更新时间 - 物流状态 - 操作 + 创建时间 + 更新时间 + 支付类型 + 支付状态 + 物流状态 + 操作 @@ -134,8 +156,19 @@ {{ data.createTime | date: 'yyyy-MM-dd HH:mm'}} {{ data.updateTime | date: 'yyyy-MM-dd HH:mm'}} - {{data.status | orderGoodsStatus}} - {{data.logisticsStatusDesc}} + + + + {{data.status | orderChildStatus}} + + + + + + + + + 详情 @@ -146,7 +179,6 @@ @@ -173,9 +205,6 @@ - - {{orderGoodsData.status | orderGoodsStatus}} - @@ -210,13 +239,11 @@ {{ orderGoodsData?.updateTime | date: 'yyyy-MM-dd HH:mm' }} - - + + {{deliveryAddress?.consignee}} {{ deliveryAddress?.phone }} - {{ deliveryAddress?.regionName }} - {{ deliveryAddress?.address }} - {{deliveryAddress?.consignee}} -{{ deliveryAddress?.phone }} -{{ deliveryAddress?.address }} + {{ deliveryAddress?.regionName }} -{{deliveryAddress?.consignee}} -{{ deliveryAddress?.phone }} -{{ deliveryAddress?.address }} @@ -225,20 +252,6 @@ - - -
-
- - 物流单号 - - - - -
-
-
-
diff --git a/src/app/pages/trade/goods-list/goods-list.component.ts b/src/app/pages/trade/goods-list/goods-list.component.ts index 5471a43..bc6d458 100644 --- a/src/app/pages/trade/goods-list/goods-list.component.ts +++ b/src/app/pages/trade/goods-list/goods-list.component.ts @@ -18,11 +18,10 @@ import {NzTreeSelectComponent} from "ng-zorro-antd/tree-select"; import {environment} from "../../../../environments/environment"; import {NzMessageService} from "ng-zorro-antd/message"; import {GoodsService} from "../../../services/goods/goods.service"; -import {fallbackImg, orderGoodsStatus} from '../../../data/goods/goods.namespace'; +import {fallbackImg, logisticsStatus, orderGoodsChild, orderPayType} from '../../../data/goods/goods.namespace'; import {GoodsStatusPipe} from "../../../pipes/goods/goods-status.pipe"; import {NzModalModule} from "ng-zorro-antd/modal"; import {OrderGoodsService} from "../../../services/trade/order-goods.service"; -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 {NzPopconfirmDirective} from "ng-zorro-antd/popconfirm"; @@ -39,6 +38,9 @@ import {NzResultComponent} from "ng-zorro-antd/result"; import {DateSelectType, DateUtils} from "../../../utils/dateUtils.service"; import {NzDatePickerComponent, NzRangePickerComponent} from "ng-zorro-antd/date-picker"; import {NzRadioButtonDirective, NzRadioComponent, NzRadioGroupComponent} from "ng-zorro-antd/radio"; +import {PayTypePipe} from "../../../pipes/goods/pay-type.pipe"; +import {IconService} from "../../../services/common/icon.service"; +import {OrderChildStatusPipe} from "../../../pipes/goods/order-child-status.pipe"; @Component({ selector: 'app-goods-list', @@ -63,7 +65,6 @@ import {NzRadioButtonDirective, NzRadioComponent, NzRadioGroupComponent} from "n NzImageDirective, GoodsStatusPipe, DatePipe, - OrderGoodsStatusPipe, NzDropdownMenuComponent, NgIf, NzMenuDirective, @@ -89,6 +90,8 @@ import {NzRadioButtonDirective, NzRadioComponent, NzRadioGroupComponent} from "n NzRadioComponent, NzRadioGroupComponent, NzRangePickerComponent, + PayTypePipe, + OrderChildStatusPipe, ], templateUrl: './goods-list.component.html', @@ -121,16 +124,15 @@ export class GoodsListComponent { logisticsTraceDetails: any; goodsOrderId: any; deliveryAddress: any; - // 时间类型选择 - dateTypeSelect = DateSelectType; - // 更多查询条件 - isCollapse = false; + protected readonly fallbackImg = fallbackImg; - protected readonly orderGoodsStatus = orderGoodsStatus; + protected readonly logisticsStatus = logisticsStatus; + protected readonly orderGoodsChild = orderGoodsChild; constructor(private fb: NonNullableFormBuilder, private msg: NzMessageService, + private iconService: IconService, private orderGoodsService: OrderGoodsService, private goodsService: GoodsService) { @@ -139,6 +141,8 @@ export class GoodsListComponent { this.searchForm = this.fb.group({ logisticsNo: [''], orderNo: [''], + childOrderNo: [''], + logisticsStatus: [''], goodsType: [''], goodsBrand: [''], userPhone: [''], @@ -148,11 +152,9 @@ export class GoodsListComponent { createTimeS: [''], createTimeE: [''], goodsName: [''], - payType: [''], status: [''], + payType: [''], }); - - this.createTimeInit(); this.getRequest(); this.getGoodsTypeNode(); this.getGoodsBrandNode(); @@ -164,8 +166,8 @@ export class GoodsListComponent { if (this.searchForm.controls['createTimeArray'].value != null && this.searchForm.controls['createTimeArray'].value.length > 0) { - this.searchForm.controls['createTimeS'].setValue(new Date(this.searchForm.controls['createTimeArray'].value[0]).getTime()); - this.searchForm.controls['createTimeE'].setValue(new Date(this.searchForm.controls['createTimeArray'].value[1]).getTime()); + this.searchForm.controls['createTimeS'].setValue(DateUtils.getDateHMS(new Date(this.searchForm.controls['createTimeArray'].value[0]) , 1).getTime()); + this.searchForm.controls['createTimeE'].setValue(DateUtils.getDateHMS(new Date(this.searchForm.controls['createTimeArray'].value[1]) , 2).getTime()); } else { this.searchForm.controls['createTimeS'].setValue(null) this.searchForm.controls['createTimeE'].setValue(null) @@ -189,6 +191,12 @@ export class GoodsListComponent { }); } + // 重制 + public reset() { + this.searchForm.reset(); + this.getRequest(); + } + // 获取商品分类 getGoodsTypeNode() { this.goodsService.getList({time: new Date().getTime()}, (data: any) => { @@ -198,17 +206,6 @@ export class GoodsListComponent { }); } - /** - * 创建时间初始化 - */ - 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]); - } - } - // 配置数据 getNode(array: any): any { array.forEach((item: any) => { @@ -290,4 +287,5 @@ export class GoodsListComponent { } + protected readonly orderPayType = orderPayType; } diff --git a/src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.html b/src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.html new file mode 100644 index 0000000..effed5e --- /dev/null +++ b/src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.html @@ -0,0 +1,274 @@ +
+
+
+ + 商品名称 + + + + +
+
+ + 物流订单号 + + + + +
+
+ + 订单号 + + + + +
+
+ + 子订单号 + + + + +
+
+ + 用户手机号 + + + + +
+ +
+ + 商品分类 + + + + +
+
+ + 商品品牌 + + + + + + +
+ +
+ + 物流状态 + + + + + + +
+
+ + 支付类型 + + + + + + +
+
+ + 创建时间 + + + + +
+ +
+ + +
+
+
+ + + + + 商品名称 + 商户名称 + 商品图片 + 商品分类 + 商品品牌 + 用户手机号 + 订单号 + 子订单号 + 物流单号 + 创建时间 + 更新时间 + 支付类型 + 支付状态 + 物流状态 + 操作 + + + + + {{data.goodsName}} - {{data.goodsSpecsName}} + {{data.merName}} + + + + {{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'}} + + + + + {{data.status | orderChildStatus}} + + + + + + + + + + + + 详情 + + + 更多 + + + + + + + + + 总计 {{ total }} 条 + + + + + + + + {{orderGoodsData?.goodsName}} - {{orderGoodsData?.goodsSpecsName}} + {{ orderGoodsData?.userPhone }}//. + 0 {{ orderGoodsData?.goodsTypeName }} + {{ orderGoodsData?.goodsBrandName }} + {{ orderGoodsData?.goodsSpecsOriginalPrice }} + {{ orderGoodsData?.goodsCount }} + + + + + + + + + + + + + + + + + + + + + {{ 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' }} + + + + + {{deliveryAddress?.consignee}} + {{ deliveryAddress?.phone }} + {{ deliveryAddress?.regionName }} -{{deliveryAddress?.consignee}} -{{ deliveryAddress?.phone }} -{{ deliveryAddress?.address }} + + + + + + + + + + +
+
+ + 物流单号 + + + + +
+
+
+
+ + + + + + +

{{item['desc']}}

+

{{item.time | date : 'yyyy-MM-dd HH:mm:ss'}}

+
+
+ +
+
+
diff --git a/src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.less b/src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.less new file mode 100644 index 0000000..4056a86 --- /dev/null +++ b/src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.less @@ -0,0 +1,6 @@ +.search-area { + margin-bottom: 10px; +} +.search-area button { + margin-right: 8px; +} diff --git a/src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.ts b/src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.ts new file mode 100644 index 0000000..6124b27 --- /dev/null +++ b/src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.ts @@ -0,0 +1,284 @@ +import { Component } from '@angular/core'; +import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule} from "@angular/forms"; +import {NzMessageService} from "ng-zorro-antd/message"; +import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; +import { NzFormDirective, NzFormModule} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {NzDatePickerComponent, NzRangePickerComponent} from "ng-zorro-antd/date-picker"; +import {NzRadioButtonDirective, NzRadioComponent, NzRadioGroupComponent} from "ng-zorro-antd/radio"; +import {NzCellFixedDirective, NzTableComponent, NzTableModule, NzThMeasureDirective} from "ng-zorro-antd/table"; +import {NzModalComponent, NzModalContentDirective, NzModalModule} from "ng-zorro-antd/modal"; +import {DatePipe, NgClass, NgForOf, NgIf, NgOptimizedImage} from "@angular/common"; +import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; +import {NzButtonComponent} from "ng-zorro-antd/button"; +import {NzTabSetComponent, NzTabsModule} from "ng-zorro-antd/tabs"; +import {NzDescriptionsModule} from "ng-zorro-antd/descriptions"; +import {NzImageDirective, NzImageModule} from "ng-zorro-antd/image"; + +import {NzIconDirective} from "ng-zorro-antd/icon"; +import {NzBadgeComponent} from "ng-zorro-antd/badge"; +import {fallbackImg, logisticsStatus, orderPayType} from '../../../data/goods/goods.namespace'; +import {NzDividerComponent} from "ng-zorro-antd/divider"; +import {NzDropDownADirective, NzDropDownDirective, NzDropdownMenuComponent} from "ng-zorro-antd/dropdown"; +import {NzMenuDirective, NzMenuItemComponent} from "ng-zorro-antd/menu"; +import {NzResultComponent} from "ng-zorro-antd/result"; +import {NzSpinComponent} from "ng-zorro-antd/spin"; +import {NzTimelineComponent, NzTimelineItemComponent} from "ng-zorro-antd/timeline"; +import {NzTreeSelectComponent} from "ng-zorro-antd/tree-select"; +import {environment} from "../../../../environments/environment"; +import {OrderGoodsService} from "../../../services/trade/order-goods.service"; +import {GoodsService} from "../../../services/goods/goods.service"; +import {OrderGoodsData} from "../../../model/order.interface"; +import {GoodsStatusPipe} from "../../../pipes/goods/goods-status.pipe"; +import {NzPopconfirmDirective} from "ng-zorro-antd/popconfirm"; +import {AuditStatusPipe} from "../../../pipes/audit/audit-status.pipe"; +import {IconService} from "../../../services/common/icon.service"; +import {PayTypePipe} from "../../../pipes/goods/pay-type.pipe"; +import {OrderChildStatusPipe} from "../../../pipes/goods/order-child-status.pipe"; + +@Component({ + selector: 'app-goods-logistics-list', + standalone: true, + imports: [ + NzColDirective, + NzRowDirective, + NzFormDirective, + ReactiveFormsModule, + NzTreeSelectComponent, + NzInputDirective, + NzSelectComponent, + NzOptionComponent, + NzButtonComponent, + NzTableComponent, + NzImageModule, + NzModalModule, + NzTableModule, + NzFormModule, + NzThMeasureDirective, + NgForOf, + NzImageDirective, + GoodsStatusPipe, + DatePipe, + 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, + PayTypePipe, + OrderChildStatusPipe, + + ], + templateUrl: './goods-logistics-list.component.html', + styleUrl: './goods-logistics-list.component.less' +}) +export class GoodsLogisticsListComponent { + // 表单页数 + tablePageNum = 1; + // 表单数据 + tableData: any = { + total: 0, + loading: false, + list: [], + }; + // 搜索表单 + searchForm: FormGroup; + + baseUrl = environment.baseUrl; + imageUrl = environment.imageUrl; + + // 商品类型数据 + nodes = []; + nodesBrand = []; + orderGoodsData: any; + orderDetailModal = false; + isVisible = false; + orderDetailModalChild = false; + orderDetailModalLoading = false; + logisticsNo: any; + logisticsTraceDetails: any; + goodsOrderId: any; + deliveryAddress: any; + + + protected readonly fallbackImg = fallbackImg; + protected readonly orderPayType = orderPayType; + protected readonly logisticsStatus = logisticsStatus; + + constructor(private fb: NonNullableFormBuilder, + private msg: NzMessageService, + private iconService: IconService, + private orderGoodsService: OrderGoodsService, + private goodsService: GoodsService) { + + + // 初始化搜索框 + this.searchForm = this.fb.group({ + logisticsNo: [''], + orderNo: [''], + childOrderNo: [''], + goodsType: [''], + goodsBrand: [''], + userPhone: [''], + goodsSpecsName: [''], + createTimeArray: [[]], + createTimeSelect: ['1'], + createTimeS: [''], + createTimeE: [''], + goodsName: [''], + payType: [''], + status: [''], + logisticsStatus: [''], + }); + this.getRequest(); + this.getGoodsTypeNode(); + this.getGoodsBrandNode(); + + } + + // 查询列表 + public getRequest(reset: boolean = false) { + + this.searchForm.controls['status'].setValue(2) + if (this.searchForm.controls['createTimeArray'].value != null + && this.searchForm.controls['createTimeArray'].value.length > 0) { + this.searchForm.controls['createTimeS'].setValue(new Date(this.searchForm.controls['createTimeArray'].value[0]).getTime()); + this.searchForm.controls['createTimeE'].setValue(new Date(this.searchForm.controls['createTimeArray'].value[1]).getTime()); + } 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.orderGoodsService.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; + }); + } + + // 获取商品分类 + getGoodsTypeNode() { + this.goodsService.getList({time: new Date().getTime()}, (data: any) => { + if (data['return_code'] === '000000') { + this.getNode(data['return_data']); + } + }); + } + + // 重制 + public reset() { + this.searchForm.reset(); + this.getRequest(); + } + + // 配置数据 + getNode(array: any): any { + array.forEach((item: any) => { + if (item.children) { + this.getNode(item.children); + }else { + item["isLeaf"] = true; + } + item["key"] = item.id; + + }); + this.nodes = array; + } + + // 获取商品品牌 + getGoodsBrandNode() { + this.goodsService.getListBrandAll( (data: any) => { + if (data['return_code'] == '000000') { + this.nodesBrand = data['return_data']; + } + }); + } + + getLogisticsNo(id: number): void { + this.goodsOrderId = id; + this.isVisible = true; + } + + showDetail(data: OrderGoodsData): void { + this.orderGoodsData = data; + this.findDeliveryAddressById(data.deliveryAddressId); + this.orderDetailModal = true; + } + + handleOk(): void { + let params = { + id: this.goodsOrderId, + logisticsNo: this.logisticsNo, + time: new Date().getTime() + } + + this.orderGoodsService.updateLogisticsNo(params , (data: any) => { + if (data['return_code'] == '000000') { + this.isVisible = false; + this.getRequest(false); + this.msg.success("成功") + } else { + this.msg.error(data['return_msg']); + } + }); + } + + showLogisticsNo(id: number): void { + let params = { + id:id, + time: new Date().getTime() + } + + this.orderGoodsService.getLogisticsMsg(params , (data: any) => { + if (data['return_code'] == '000000') { + this.orderDetailModalChild = true; + this.getRequest(false); + this.logisticsTraceDetails = data['return_data']['logisticsTraceDetails']; + } else { + this.msg.error(data['return_msg']); + } + }); + } + + findDeliveryAddressById(id: number): void { + this.goodsService.findDeliveryAddressById(id, (data: any) => { + if (data['return_code'] == '000000') { + this.deliveryAddress = data['return_data']; + } else { + this.msg.error(data['return_msg']); + } + }); + } + + +} diff --git a/src/app/pages/trade/order-cinema/order-cinema.component.ts b/src/app/pages/trade/order-cinema/order-cinema.component.ts index 4aba796..fcbb2d2 100644 --- a/src/app/pages/trade/order-cinema/order-cinema.component.ts +++ b/src/app/pages/trade/order-cinema/order-cinema.component.ts @@ -15,7 +15,6 @@ 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"; @@ -57,7 +56,6 @@ import {OrderCinemaStatusPipe} from "../../../pipes/goods/order-cinema-status.pi NzImageDirective, GoodsStatusPipe, DatePipe, - OrderGoodsStatusPipe, NzDropdownMenuComponent, NgIf, NzMenuDirective, diff --git a/src/app/pages/trade/trade.routes.ts b/src/app/pages/trade/trade.routes.ts index c018d56..52a34b3 100644 --- a/src/app/pages/trade/trade.routes.ts +++ b/src/app/pages/trade/trade.routes.ts @@ -5,6 +5,7 @@ import {GoodsListComponent} from "./goods-list/goods-list.component"; import {OrderRefundComponent} from "./order-refund/order-refund.component"; import {OrderCinemaComponent} from "./order-cinema/order-cinema.component"; import {OrderStarbucksComponent} from "./order-starbucks/order-starbucks.component"; +import {GoodsLogisticsListComponent} from "./goods-logistics-list/goods-logistics-list.component"; export const TRADE_ROUTES: Routes = [ { path: 'goods-list', component: GoodsListComponent }, @@ -13,4 +14,5 @@ export const TRADE_ROUTES: Routes = [ { path: 'order-refund', component: OrderRefundComponent }, { path: 'order-cinema', component: OrderCinemaComponent }, { path: 'order-starbucks', component: OrderStarbucksComponent }, + { path: 'goods-logistics-list', component: GoodsLogisticsListComponent }, ]; diff --git a/src/app/pipes/order/order-goods-status.pipe.ts b/src/app/pipes/order/order-goods-status.pipe.ts deleted file mode 100644 index f543cfa..0000000 --- a/src/app/pipes/order/order-goods-status.pipe.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Pipe, PipeTransform } from '@angular/core'; - -@Pipe({ - name: 'orderGoodsStatus', - standalone: true -}) -export class OrderGoodsStatusPipe implements PipeTransform { - - transform(value: number): any { - switch (value) { - case 1: - return '待发货'; - case 2: - return '已发货'; - case 3: - return '配送中'; - case 4: - return '已送达'; - case 5: - return '已取消'; - case 6: - return '退货中'; - case 7: - return '已退货'; - case 8: - return '待支付'; - default: - return '未知状态' - } - } - -} diff --git a/src/environments/environment.ts b/src/environments/environment.ts index ee124eb..ec6ab5c 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,15 +4,15 @@ 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: '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/', + // 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/', };