diff --git a/src/app/pages/body/index/index.component.html b/src/app/pages/body/index/index.component.html index 0892f4c..7e9693a 100644 --- a/src/app/pages/body/index/index.component.html +++ b/src/app/pages/body/index/index.component.html @@ -20,8 +20,8 @@ @@ -124,3 +124,51 @@ + + +
+ + 旧密码 + + + + + + 新密码 + + + + + + + 确认密码 + + + + @if (control.errors?.['required']) { + 请确认您的密码! + } + @if (control.errors?.['confirm']) { + 您输入的两个密码不一致! + } + + + + + + +
+
+
diff --git a/src/app/pages/body/index/index.component.ts b/src/app/pages/body/index/index.component.ts index 0849aff..41b08da 100644 --- a/src/app/pages/body/index/index.component.ts +++ b/src/app/pages/body/index/index.component.ts @@ -1,4 +1,4 @@ -import {AfterViewInit, Component, TemplateRef, ViewChild} from '@angular/core'; +import {AfterViewInit, Component, OnDestroy, OnInit, TemplateRef, ViewChild} from '@angular/core'; import {Router, RouterLink, RouterOutlet} from "@angular/router"; import { NzContentComponent, @@ -29,7 +29,7 @@ import {IconService} from "../../../services/common/icon.service"; import {FileService} from "../../../services/file/file.service"; import {DataUtilsPipe} from "../../../pipes/common/data-utils.pipe"; import {GoodsListComponent} from "../../trade/goods-list/goods-list.component"; -import {Subject} from "rxjs"; +import {Subject, takeUntil} from "rxjs"; import {CommunicationService} from "../../../services/common/communication.service"; import {NzModalComponent, NzModalContentDirective, NzModalModule, NzModalService} from "ng-zorro-antd/modal"; import {NzResultComponent} from "ng-zorro-antd/result"; @@ -43,6 +43,24 @@ import {NzButtonComponent} from "ng-zorro-antd/button"; import {NzBadgeComponent} from "ng-zorro-antd/badge"; import {NzNotificationComponent, NzNotificationService} from "ng-zorro-antd/notification"; import {OrderGoodsService} from "../../../services/trade/order-goods.service"; +import {NzDrawerComponent, NzDrawerContentDirective} from "ng-zorro-antd/drawer"; +import { + AbstractControl, FormControl, + FormGroup, + FormsModule, + NonNullableFormBuilder, + ReactiveFormsModule, ValidationErrors, ValidatorFn, + Validators +} from "@angular/forms"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import { + NzFormControlComponent, + NzFormDirective, + NzFormItemComponent, + NzFormLabelComponent, + NzFormTooltipIcon +} from "ng-zorro-antd/form"; +import {NzInputDirective, NzInputGroupComponent} from "ng-zorro-antd/input"; @Component({ selector: 'app-index', @@ -93,7 +111,18 @@ import {OrderGoodsService} from "../../../services/trade/order-goods.service"; StatusPipe, NzPopconfirmDirective, NzButtonComponent, - NzBadgeComponent + NzBadgeComponent, + NzDrawerComponent, + NzDrawerContentDirective, + FormsModule, + NzFlexDirective, + NzFormControlComponent, + NzFormDirective, + NzFormItemComponent, + NzFormLabelComponent, + NzInputDirective, + ReactiveFormsModule, + NzInputGroupComponent ], templateUrl: './index.component.html', styleUrl: './index.component.less' @@ -115,15 +144,24 @@ export class IndexComponent { isCollapse = true; loading = false; isVisible = false; + visibleUpdatePwd = false; // 当前顶级菜单 currentParentMenu: any = {}; downloadType = 1; interval: any; showComponent = false; + + validateForm: FormGroup<{ + oldPassword: FormControl; + newPassword: FormControl; + checkPassword: FormControl; + }> + constructor( private commonService: CommonService, private storage: BrowserStorageService, private communicationService: CommunicationService, + private fb: NonNullableFormBuilder, private nzConfigService: NzConfigService, private fileService: FileService, private message: NzMessageService, @@ -133,6 +171,12 @@ export class IndexComponent { private login: LoginService ) { + this.validateForm = this.fb.group({ + oldPassword: ['', [Validators.required]], + newPassword: ['', [Validators.required]], + checkPassword: ['', [Validators.required, this.confirmationValidator]], + }); + this.orderGoodsService.goodsOrderCount((data: any) => { if (data['return_code'] == '000000') { @@ -186,6 +230,46 @@ export class IndexComponent { this.fileRecords(); } + + submitForm(): void { + if (this.validateForm.valid) { + this.login.sendUserPass( this.validateForm.value , (data: any) => { + if (data['return_code'] === '000000') { + this.storage.remove(LOGIN_DATA); + this.storage.remove(DATA); + this.storage.remove(USER_TOKEN); + this.storage.remove(INIT_FLAG); + location.reload(); + this.message.success("修改成功"); + this.router.navigateByUrl('/login').then(); + } else { + this.message.error(data['return_msg']); + } + }); + } else { + Object.values(this.validateForm.controls).forEach(control => { + if (control.invalid) { + control.markAsDirty(); + control.updateValueAndValidity({ onlySelf: true }); + } + }); + } + } + + updateConfirmValidator(): void { + /** wait for refresh value */ + Promise.resolve().then(() => this.validateForm.controls.checkPassword.updateValueAndValidity()); + } + + confirmationValidator: ValidatorFn = (control: AbstractControl): { [s: string]: boolean } => { + if (!control.value) { + return { required: true }; + } else if (control.value !== this.validateForm.controls.newPassword.value) { + return { confirm: true, error: true }; + } + return {}; + }; + // 选择操作 isSelected(item: any) { this.menuData.map((data: any) => { @@ -275,4 +359,10 @@ export class IndexComponent { }) } + // 打开抽屉 + openUpdatePwd(): void { + this.visibleUpdatePwd = true; + } + + } diff --git a/src/app/pages/system/cms/cms.component.html b/src/app/pages/system/cms/cms.component.html index 0e3c24a..99e5a92 100644 --- a/src/app/pages/system/cms/cms.component.html +++ b/src/app/pages/system/cms/cms.component.html @@ -115,6 +115,22 @@ + + 展示类型 + + + + + + + + + + 数据展示ID + + + + 跳转类型 diff --git a/src/app/pages/system/cms/cms.component.ts b/src/app/pages/system/cms/cms.component.ts index 5a92063..a9d25f3 100644 --- a/src/app/pages/system/cms/cms.component.ts +++ b/src/app/pages/system/cms/cms.component.ts @@ -8,7 +8,7 @@ import {DatePipe, NgForOf, NgIf, NgStyle} from "@angular/common"; import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzImageDirective, NzImageModule} from "ng-zorro-antd/image"; -import {NzModalComponent, NzModalModule} from "ng-zorro-antd/modal"; +import { NzModalModule} from "ng-zorro-antd/modal"; import {NzPopconfirmDirective} from "ng-zorro-antd/popconfirm"; import { NzTableComponent, NzTableModule @@ -19,7 +19,6 @@ import {NzUploadComponent, NzUploadFile} from "ng-zorro-antd/upload"; import {environment} from "../../../../environments/environment"; import {NzMessageService} from "ng-zorro-antd/message"; import {CommonService} from "../../../services/common/common.service"; -import {GoodsTypeData} from "../../../model/goods.interface"; import {fallbackImg, platformCode} from '../../../data/goods/goods.namespace'; import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; import {CmsService} from "../../../services/cms/cms.service"; @@ -141,6 +140,8 @@ export class CmsComponent { id: [null], img: [''], jumpType: [null], + showType: [null], + showDataId: [null], jumpUrl: [null], appid: [null], }); diff --git a/src/app/pages/trade/member/member-list.component.html b/src/app/pages/trade/member/member-list.component.html new file mode 100644 index 0000000..b8cedb9 --- /dev/null +++ b/src/app/pages/trade/member/member-list.component.html @@ -0,0 +1,182 @@ +
+
+ +
+ + 订单号 + + + + +
+
+ + 完成时间 + + + + +
+
+ + 创建时间 + + + + +
+
+ + 支付状态 + + + + + + +
+ +
+ + 商品名称 + + + + +
+ +
+ + 子订单号 + + + + +
+
+ + 用户手机号 + + + + +
+
+ + 支付类型 + + + + + + +
+ + + +
+ + + +
+
+
+ + + + + 商品名称 + 用户手机号 + 订单号 + 子订单号 + 商品价格 + 销售价格 + 支付金额 + 创建时间 + 更新时间 + 完成时间 + 支付类型 + 支付状态 + 操作 + + + + + {{data.goodsName}} + {{data.userPhone}} + {{data.orderNo}} + {{data.childOrderNo}} + ¥{{data.goodsSpescOriginalPrice}} + ¥{{data.goodsSpescSalePrice}} + ¥{{data.payRealPrice}} + {{ data.createTime | date: 'yyyy-MM-dd HH:mm'}} + {{ data.updateTime | date: 'yyyy-MM-dd HH:mm'}} + {{ data.finishTime | date: 'yyyy-MM-dd HH:mm'}} + + + + + {{data.status | orderChildStatus}} + + + 详情 + + + + 总计 {{ total }} 条 + + + + + + + + +

+
+ {{ orderGoodsData?.userPhone }}//. + {{ orderGoodsData?.status | orderChildStatus }}//. +
+
+ + + {{ orderGoodsData?.orderNo }} + {{ orderGoodsData?.childOrderNo }} + {{ orderGoodsData?.paySerialNo }} + {{ orderGoodsData?.totalPrice }} + {{ orderGoodsData?.couponDiscountPrice }} + {{ orderGoodsData?.integralDiscountPrice }} + {{ orderGoodsData?.totalDeductionPrice }} + {{ orderGoodsData?.tradeAmount }} + {{ orderGoodsData?.servicePrice }} + {{ 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/member/member-list.component.less b/src/app/pages/trade/member/member-list.component.less new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/trade/member/member-list.component.ts b/src/app/pages/trade/member/member-list.component.ts new file mode 100644 index 0000000..777e109 --- /dev/null +++ b/src/app/pages/trade/member/member-list.component.ts @@ -0,0 +1,196 @@ + +import { + fallbackImg, + logisticsStatus, + orderCinemaStatus, + orderGoodsChild, + orderPayType +} from '../../../data/goods/goods.namespace'; +import {NzTabSetComponent, NzTabsModule} from "ng-zorro-antd/tabs"; +import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; +import {NzFormDirective, NzFormModule} from "ng-zorro-antd/form"; +import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule} from "@angular/forms"; +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 {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 {NzIconDirective} from "ng-zorro-antd/icon"; +import {NzBadgeComponent} from "ng-zorro-antd/badge"; +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 {Component} from "@angular/core"; +import {PayTypePipe} from "../../../pipes/goods/pay-type.pipe"; +import {OrderChildStatusPipe} from "../../../pipes/goods/order-child-status.pipe"; +import {NzMessageService} from "ng-zorro-antd/message"; +import {BrowserStorageService} from "../../../utils/localStorage.service"; +import {MerService} from "../../../services/merchant/mer.service"; +import {IconService} from "../../../services/common/icon.service"; +import {MeituanService} from "../../../services/trade/meituan.service"; +import {DateUtils} from "../../../utils/dateUtils.service"; +import {CommunicationService} from "../../../services/common/communication.service"; +import {OrderCinemaStatusPipe} from "../../../pipes/goods/order-cinema-status.pipe"; +import {OrderGoodsData} from "../../../model/order.interface"; +import {MemberService} from "../../../services/trade/member.service"; +@Component({ + selector: 'app-meituan-list', + standalone: true, + imports: [ + NzColDirective, + NzRowDirective, + NzFormDirective, + ReactiveFormsModule, + NzTreeSelectComponent, + NzInputDirective, + NzSelectComponent, + NzOptionComponent, + NzButtonComponent, + NzTableComponent, + NzImageModule, + NzModalModule, + NzTableModule, + NzFormModule, + NzThMeasureDirective, + NgForOf, + NzImageDirective, + DatePipe, + NzDropdownMenuComponent, + NgIf, + NzMenuDirective, + NzDescriptionsModule, + NzMenuItemComponent, + NzPopconfirmDirective, + NzDividerComponent, + NzDropDownADirective, + NzDropDownDirective, + NzTabsModule, + NzIconDirective, + NzBadgeComponent, + NzTabSetComponent, + FormsModule, + NzSpinComponent, + NzTimelineItemComponent, + NgClass, + NzResultComponent, + NzTimelineComponent, + NzDatePickerComponent, + NzRadioButtonDirective, + NzRadioComponent, + NzRadioGroupComponent, + NzRangePickerComponent, + PayTypePipe, + OrderChildStatusPipe, + OrderCinemaStatusPipe, + ], + templateUrl: './member-list.component.html', + styleUrl: './member-list.component.less' +}) +export class MemberListComponent { + // 表单页数 + tablePageNum = 1; + // 表单数据 + tableData: any = { + total: 0, + loading: false, + list: [], + }; + // 搜索表单 + searchForm: FormGroup; + orderDetailModal = false; + // 更多查询条件 + isCollapse = false; + orderGoodsData: any; + + protected readonly orderGoodsChild = orderGoodsChild; + protected readonly orderPayType = orderPayType; + + constructor(private fb: NonNullableFormBuilder, + private msg: NzMessageService, + private iconService: IconService, + private communicationService: CommunicationService, + private memberService: MemberService,) { + + + + + // 初始化搜索框 + this.searchForm = this.fb.group({ + orderNo: [''], + childOrderNo: [''], + userPhone: [''], + createTimeArray: [[]], + finishTimeArray: [[]], + createTimeS: [''], + createTimeE: [''], + finishTimeS: [''], + finishTimeE: [''], + goodsName: [''], + status: [''], + payType: [''], + }); + 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(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) + } + if (this.searchForm.controls['finishTimeArray'].value != null + && this.searchForm.controls['finishTimeArray'].value.length > 0) { + this.searchForm.controls['finishTimeS'].setValue(DateUtils.getDateHMS(new Date(this.searchForm.controls['finishTimeArray'].value[0]) , 1).getTime()); + this.searchForm.controls['finishTimeE'].setValue(DateUtils.getDateHMS(new Date(this.searchForm.controls['finishTimeArray'].value[1]) , 2).getTime()); + } else { + this.searchForm.controls['finishTimeS'].setValue(null) + this.searchForm.controls['finishTimeE'].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.memberService.getListMember(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; + }); + } + + // 重制 + public reset() { + this.searchForm.reset(); + this.getRequest(); + } + + + + 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 5c5dbd6..c19e5c6 100644 --- a/src/app/pages/trade/trade.routes.ts +++ b/src/app/pages/trade/trade.routes.ts @@ -7,6 +7,7 @@ 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"; import {MeituanListComponent} from "./meituan/meituan-list.component"; +import {MemberListComponent} from "./member/member-list.component"; export const TRADE_ROUTES: Routes = [ { path: 'goods-list', component: GoodsListComponent }, @@ -17,4 +18,5 @@ export const TRADE_ROUTES: Routes = [ { path: 'order-starbucks', component: OrderStarbucksComponent }, { path: 'goods-logistics-list', component: GoodsLogisticsListComponent }, { path: 'meituan-list', component: MeituanListComponent }, + { path: 'member-list', component: MemberListComponent }, ]; diff --git a/src/app/services/login/login.service.ts b/src/app/services/login/login.service.ts index a8f28b4..69ee027 100644 --- a/src/app/services/login/login.service.ts +++ b/src/app/services/login/login.service.ts @@ -35,4 +35,18 @@ export class LoginService { callBack(data); }); } + + /** + * @Author Sum1Dream + * @Name sendUserPass + * @Description // 修改用户密码 + * @Date 15:52 2024/4/18 + * @Param params + * @Param callBack + */ + public sendUserPass(params: object, callBack:any) { + this.http.post(environment.userUrl + 'secUser/sendUserPass', params).subscribe(data => { + callBack(data); + }); + } } diff --git a/src/app/services/trade/member.service.ts b/src/app/services/trade/member.service.ts new file mode 100644 index 0000000..2683b53 --- /dev/null +++ b/src/app/services/trade/member.service.ts @@ -0,0 +1,25 @@ +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 MemberService { + constructor(private http: HttpClient) { } + + /** + * 查询订单列表 + * @param param + * @param callBack + */ + public getListMember(param: object, callBack:any) { + this.http.get(environment.orderUrl + 'orderMember/getListMember?'+ObjectData.objectByString(param)).subscribe(data => { + callBack(data); + }); + } + + + +}