diff --git a/src/app/data/goods/goods.namespace.ts b/src/app/data/goods/goods.namespace.ts index 8371454..ce12f75 100644 --- a/src/app/data/goods/goods.namespace.ts +++ b/src/app/data/goods/goods.namespace.ts @@ -14,7 +14,7 @@ export const orderGoodsStatus = [ export const orderCinemaStatus = [ - {name: "待付款" , key: 0} , + {name: "未上送" , key: 0} , {name: "待出票" , key: 5}, {name: "已出票" , key: 10}, {name: "交易成功" , key: 15}, 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 353ebbf..2bfd972 100644 --- a/src/app/pages/merchant/mer-list/mer-list.component.html +++ b/src/app/pages/merchant/mer-list/mer-list.component.html @@ -336,8 +336,8 @@ - 折扣比例 - + 利润点 + diff --git a/src/app/pages/trade/comp-order/comp-order.component.ts b/src/app/pages/trade/comp-order/comp-order.component.ts index bae4e6e..fd1cc19 100644 --- a/src/app/pages/trade/comp-order/comp-order.component.ts +++ b/src/app/pages/trade/comp-order/comp-order.component.ts @@ -144,8 +144,8 @@ export class CompOrderComponent { queryData() { 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]); + this.searchForm.controls['createTimeS'].setValue(this.searchForm.controls['createTimeArray'].value[0].getTime()); + this.searchForm.controls['createTimeE'].setValue(this.searchForm.controls['createTimeArray'].value[1].getTime()); } else { this.searchForm.controls['createTimeS'].setValue(null) this.searchForm.controls['createTimeE'].setValue(null) @@ -183,6 +183,7 @@ export class CompOrderComponent { */ createTimeInit() { let createTimeSelect = this.searchForm.controls['createTimeSelect'].value; + console.log(createTimeSelect); if (createTimeSelect != null) { let timeObj = DateUtils.getDate(new Date(), Number(createTimeSelect)); this.searchForm.controls['createTimeArray'].setValue([timeObj.timeS, timeObj.timeE]); 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 87e976a..61b042d 100644 --- a/src/app/pages/trade/goods-list/goods-list.component.ts +++ b/src/app/pages/trade/goods-list/goods-list.component.ts @@ -152,7 +152,7 @@ export class GoodsListComponent { status: [''], }); - + this.createTimeInit(); this.getRequest(); this.getGoodsTypeNode(); this.getGoodsBrandNode(); @@ -164,8 +164,8 @@ export class GoodsListComponent { 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]); + this.searchForm.controls['createTimeS'].setValue(this.searchForm.controls['createTimeArray'].value[0].getTime()); + this.searchForm.controls['createTimeE'].setValue(this.searchForm.controls['createTimeArray'].value[1].getTime()); } else { this.searchForm.controls['createTimeS'].setValue(null) this.searchForm.controls['createTimeE'].setValue(null) diff --git a/src/app/pages/trade/order-after-sales/order-after-sales.component.ts b/src/app/pages/trade/order-after-sales/order-after-sales.component.ts index 8562342..f00f2c0 100644 --- a/src/app/pages/trade/order-after-sales/order-after-sales.component.ts +++ b/src/app/pages/trade/order-after-sales/order-after-sales.component.ts @@ -145,6 +145,7 @@ export class OrderAfterSalesComponent { remarks: [''], }); this.createTimeInit(); + this.createTimeInit(); this.queryData(); } @@ -154,8 +155,8 @@ export class OrderAfterSalesComponent { queryData() { 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]); + this.searchForm.controls['createTimeS'].setValue(this.searchForm.controls['createTimeArray'].value[0].getTime()); + this.searchForm.controls['createTimeE'].setValue(this.searchForm.controls['createTimeArray'].value[1].getTime()); } else { this.searchForm.controls['createTimeS'].setValue(null) this.searchForm.controls['createTimeE'].setValue(null) diff --git a/src/app/pages/trade/order-cinema/order-cinema.component.html b/src/app/pages/trade/order-cinema/order-cinema.component.html index ba016b4..d6458fc 100644 --- a/src/app/pages/trade/order-cinema/order-cinema.component.html +++ b/src/app/pages/trade/order-cinema/order-cinema.component.html @@ -69,31 +69,31 @@ 商品名称 商品图片 - 商品分类 - 商品品牌 用户手机号 订单号 子订单号 + 状态 创建时间 更新时间 - 物流状态 + 异常问题 操作 - - {{data.goodsName}} - {{data.goodsSpecsName}} + - +

+ + + - {{data.goodsTypeName}} - {{data.goodsBrandName}} {{data.userPhone}} {{data.orderNo}} {{data.childOrderNo}} - {{data.logisticsNo}} + {{data.status | orderCinemaStatus}} {{ data.createTime | date: 'yyyy-MM-dd HH:mm'}} {{ data.updateTime | date: 'yyyy-MM-dd HH:mm'}} + {{data.exceptionMsg}} 详情 @@ -107,31 +107,16 @@ - {{orderGoodsData?.goodsName}} - {{orderGoodsData?.goodsSpecsName}} + +

+
{{ orderGoodsData?.userPhone }}//. - 0 {{ orderGoodsData?.goodsTypeName }} - {{ orderGoodsData?.goodsBrandName }} - {{ orderGoodsData?.goodsSpecsOriginalPrice }} - {{ orderGoodsData?.goodsCount }} + {{ orderGoodsData?.status | orderCinemaStatus }}//. - + - - - {{orderGoodsData.status | orderGoodsStatus}} - - - - - - - - - - -
diff --git a/src/app/pages/trade/order-cinema/order-cinema.component.less b/src/app/pages/trade/order-cinema/order-cinema.component.less index 4056a86..cb045d5 100644 --- a/src/app/pages/trade/order-cinema/order-cinema.component.less +++ b/src/app/pages/trade/order-cinema/order-cinema.component.less @@ -4,3 +4,6 @@ .search-area button { margin-right: 8px; } +.fontColor { + color: red; +} 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 943ede4..3873fac 100644 --- a/src/app/pages/trade/order-cinema/order-cinema.component.ts +++ b/src/app/pages/trade/order-cinema/order-cinema.component.ts @@ -32,6 +32,7 @@ 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"; +import {OrderCinemaStatusPipe} from "../../../pipes/goods/order-cinema-status.pipe"; @Component({ selector: 'app-order-cinema', @@ -82,6 +83,7 @@ import {OrderCinemaService} from "../../../services/trade/order-cinema.service"; NzRadioComponent, NzRadioGroupComponent, NzRangePickerComponent, + OrderCinemaStatusPipe, ], templateUrl: './order-cinema.component.html', styleUrl: './order-cinema.component.less' @@ -128,7 +130,7 @@ export class OrderCinemaComponent { payType: [''], status: [''], }); - + this.createTimeInit(); this.getRequest(); } @@ -137,8 +139,8 @@ export class OrderCinemaComponent { 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]); + this.searchForm.controls['createTimeS'].setValue(this.searchForm.controls['createTimeArray'].value[0].getTime()); + this.searchForm.controls['createTimeE'].setValue(this.searchForm.controls['createTimeArray'].value[1].getTime()); } else { this.searchForm.controls['createTimeS'].setValue(null) this.searchForm.controls['createTimeE'].setValue(null) @@ -168,13 +170,14 @@ export class OrderCinemaComponent { createTimeInit() { let createTimeSelect = this.searchForm.controls['createTimeSelect'].value; if (createTimeSelect != null) { + console.log("createTimeSelect", createTimeSelect); let timeObj = DateUtils.getDate(new Date(), Number(createTimeSelect)); this.searchForm.controls['createTimeArray'].setValue([timeObj.timeS, timeObj.timeE]); } } - showDetail(data: OrderGoodsData): void { + showDetail(data: any): void { this.orderGoodsData = data; this.orderDetailModal = true; } diff --git a/src/app/pages/trade/order-refund/order-refund.component.ts b/src/app/pages/trade/order-refund/order-refund.component.ts index 0a82533..a5690dd 100644 --- a/src/app/pages/trade/order-refund/order-refund.component.ts +++ b/src/app/pages/trade/order-refund/order-refund.component.ts @@ -142,8 +142,8 @@ export class OrderRefundComponent { queryData() { 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]); + this.searchForm.controls['createTimeS'].setValue(this.searchForm.controls['createTimeArray'].value[0].getTime()); + this.searchForm.controls['createTimeE'].setValue(this.searchForm.controls['createTimeArray'].value[1].getTime()); } else { this.searchForm.controls['createTimeS'].setValue(null); this.searchForm.controls['createTimeE'].setValue(null); diff --git a/src/app/pipes/goods/order-cinema-status.pipe.ts b/src/app/pipes/goods/order-cinema-status.pipe.ts new file mode 100644 index 0000000..ff6cbf2 --- /dev/null +++ b/src/app/pipes/goods/order-cinema-status.pipe.ts @@ -0,0 +1,26 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'orderCinemaStatus', + standalone: true +}) +export class OrderCinemaStatusPipe implements PipeTransform { + + transform(value: number): any { + switch (value) { + case 0: + return '未上送'; + case 5: + return '待出票'; + case 10: + return '已出票'; + case 15: + return '交易成功'; + case -5: + return '已取消'; + default: + return '未知状态' + } + } + +} diff --git a/src/app/services/trade/order-cinema.service.ts b/src/app/services/trade/order-cinema.service.ts index 8942718..36fff01 100644 --- a/src/app/services/trade/order-cinema.service.ts +++ b/src/app/services/trade/order-cinema.service.ts @@ -20,4 +20,11 @@ export class OrderCinemaService { callBack(data); }); } + + public queryOrder(param: any, callBack:any) { + param.time = new Date().getTime(); + this.http.get(environment.orderUrl + 'orderCinema/queryOrder?'+ObjectData.objectByString(param)).subscribe(data => { + callBack(data); + }); + } } diff --git a/src/app/utils/dateUtils.service.ts b/src/app/utils/dateUtils.service.ts index 7ef2e54..33859c6 100644 --- a/src/app/utils/dateUtils.service.ts +++ b/src/app/utils/dateUtils.service.ts @@ -22,30 +22,39 @@ export class DateUtils { */ public static getDate(currentDate: Date, type: number): any { const returnObj = { - timeS: 0, - timeE: 0, + timeS: new Date(), + timeE: new Date(), } if (type === 1) { - currentDate.setHours(0); - currentDate.setMinutes(0); - currentDate.setSeconds(0); - returnObj.timeS = currentDate.getTime(); - currentDate.setHours(23); - currentDate.setMinutes(59); - currentDate.setSeconds(59); - returnObj.timeE = currentDate.getTime(); + const start = new Date(currentDate); + + start.setHours(0); + start.setMinutes(0); + start.setSeconds(0); + returnObj.timeS = start; + + const end = new Date(currentDate); + end.setHours(23); + end.setMinutes(59); + end.setSeconds(59); + returnObj.timeE = currentDate; } else if (type === 2) { - currentDate.setDate(currentDate.getDate() - 1) - currentDate.setHours(0); - currentDate.setMinutes(0); - currentDate.setSeconds(0); - returnObj.timeS = currentDate.getTime(); - currentDate.setHours(23); - currentDate.setMinutes(59); - currentDate.setSeconds(59); - returnObj.timeE = currentDate.getTime(); + + const start = new Date(currentDate); + start.setDate(currentDate.getDate() - 1) + start.setHours(0); + start.setMinutes(0); + start.setSeconds(0); + returnObj.timeS = start; + + const end = new Date(currentDate); + end.setDate(currentDate.getDate() - 1) + end.setHours(23); + end.setMinutes(59); + end.setSeconds(59); + returnObj.timeE = end; } else if (type === 3) { const dayOfWeek = currentDate.getDay(); @@ -56,14 +65,14 @@ export class DateUtils { start.setHours(0); start.setMinutes(0); start.setSeconds(0); - returnObj.timeS = start.getTime(); + returnObj.timeS = start; const end = new Date(currentDate); end.setDate(end.getDate() + 6) end.setHours(23); end.setMinutes(59); end.setSeconds(59); - returnObj.timeE = end.getTime(); + returnObj.timeE = end; } else if (type === 4) { const startOfThisWeek = new Date(currentDate.getFullYear(),currentDate.getMonth(),currentDate.getDate() - currentDate.getDay() + 1); @@ -73,12 +82,12 @@ export class DateUtils { startOfLastWeek .setHours(0); startOfLastWeek .setMinutes(0); startOfLastWeek .setSeconds(0); - returnObj.timeS = startOfLastWeek .getTime(); + returnObj.timeS = startOfLastWeek; endOfLastWeek.setHours(23); endOfLastWeek.setMinutes(59); endOfLastWeek.setSeconds(59); - returnObj.timeE = endOfLastWeek.getTime(); + returnObj.timeE = endOfLastWeek; } else if (type === 5) { var daysInMonth = new Date(currentDate.getFullYear(), currentDate.getMonth()+1, 0).getDate(); @@ -88,14 +97,14 @@ export class DateUtils { start.setHours(0); start.setMinutes(0); start.setSeconds(0); - returnObj.timeS = start.getTime(); + returnObj.timeS = start; const end = new Date(currentDate); end.setDate(daysInMonth) end.setHours(23); end.setMinutes(59); end.setSeconds(59); - returnObj.timeE = end.getTime(); + returnObj.timeE = end; } else if (type === 6) { var daysInMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).getDate(); @@ -106,7 +115,7 @@ export class DateUtils { start.setHours(0); start.setMinutes(0); start.setSeconds(0); - returnObj.timeS = start.getTime(); + returnObj.timeS = start; const end = new Date(currentDate); end.setMonth(currentDate.getMonth() - 1); @@ -114,7 +123,7 @@ export class DateUtils { end.setHours(23); end.setMinutes(59); end.setSeconds(59); - returnObj.timeE = end.getTime(); + returnObj.timeE = end; } return returnObj; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 9928d62..ec6ab5c 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,14 +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: '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: '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/', };