提交代码

dev
胡锐 1 month ago
parent e0afb604c4
commit 55d4b86192
  1. 4
      src/app/pages/agent/agent-list/agent-list.component.html
  2. 41
      src/app/pages/agent/agent-list/agent-list.component.ts
  3. 20
      src/app/pages/cms/cms-list/cms-list.component.html
  4. 3
      src/app/pages/cms/cms-list/cms-list.component.less
  5. 2
      src/app/pages/cms/cms-list/cms-list.component.ts
  6. 84
      src/app/pages/spread/spread-user-withdraw-record/spread-user-withdraw-record.component.html
  7. 0
      src/app/pages/spread/spread-user-withdraw-record/spread-user-withdraw-record.component.less
  8. 200
      src/app/pages/spread/spread-user-withdraw-record/spread-user-withdraw-record.component.ts
  9. 2
      src/app/pages/spread/spread.routes.ts
  10. 24
      src/app/services/agent/agent.service.ts
  11. 12
      src/app/services/spread/spread-user.service.ts

@ -63,6 +63,7 @@
<th nzWidth="100px">代理名称</th>
<th nzWidth="100px">联系人</th>
<th nzWidth="100px">联系方式</th>
<th nzWidth="50px">状态</th>
<th nzWidth="100px">创建时间</th>
<th nzRight nzWidth="70px">操作</th>
</tr>
@ -74,6 +75,7 @@
<td>{{data.name}}</td>
<td>{{data.contactsName}}</td>
<td>{{data.contactsTelephone}}</td>
<td>{{data.status | dictionary : 'AGENT_STATUS'}}</td>
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td nzRight>
<a nz-dropdown [nzDropdownMenu]="menu">
@ -86,6 +88,8 @@
<li nz-menu-item *ngIf="data.type == 2"><a (click)="showApiRecharge(data)">余额充值</a></li>
<li nz-menu-item *ngIf="data.type == 2"><a (click)="showRecord(data.id)">动账记录</a></li>
<li nz-menu-item *ngIf="data.type == 2"><a (click)="showApiParam(data)">接入参数</a></li>
<li nz-menu-item *ngIf="data.status == 1"><a (click)="disabled(data.agentNo)">禁用账户</a></li>
<li nz-menu-item *ngIf="data.status == 2"><a (click)="enable(data.agentNo)">恢复账户</a></li>
</ul>
</nz-dropdown-menu></td>
</tr>

@ -388,4 +388,45 @@ export class AgentListComponent {
closeRecord() {
this.agentApiRecordModal = false;
}
/**
*
*/
enable(agentNo: string) {
this.modal.confirm({
nzTitle: '提示',
nzContent: '确定启用账户吗?',
nzOnOk: () =>
this.agentService.enable({agentNo: agentNo}, (data: any) => {
if (data['return_code'] == '000000') {
// 刷新数据
this.queryData();
this.message.create('success', '操作成功');
} else {
this.message.create('error', data['return_msg']);
}
})
});
}
/**
*
*/
disabled(agentNo: string) {
this.modal.confirm({
nzTitle: '提示',
nzContent: '确定禁用账户吗?',
nzOnOk: () =>
this.agentService.disable({agentNo: agentNo}, (data: any) => {
if (data['return_code'] == '000000') {
// 刷新数据
this.queryData();
this.message.create('success', '操作成功');
} else {
this.message.create('error', data['return_msg']);
}
})
});
}
}

@ -37,7 +37,7 @@
</form>
<nz-table #basicTable
[nzScroll]="{ x: '2400' }"
[nzScroll]="{ x: '1500' }"
[nzBordered]="true"
[nzFrontPagination]="false"
[nzShowQuickJumper]="true"
@ -56,6 +56,8 @@
<th nzWidth="100px">跳转地址</th>
<th nzWidth="100px">图片</th>
<th nzWidth="100px">状态</th>
<th nzWidth="100px">定时上线时间</th>
<th nzWidth="100px">定时下线时间</th>
<th nzWidth="100px">创建时间</th>
<th nzRight nzWidth="70px">操作</th>
</tr>
@ -70,6 +72,8 @@
<td>{{data.jumpUrl}}</td>
<td><img nz-image width="100px" height="100px" nzSrc="{{IMAGE_URL + data.imgUrl}}" alt="" style="object-fit: contain;"></td>
<td>{{data.status | dictionary : 'CMS_STATUS'}}</td>
<td>{{data.startTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.endTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td nzRight>
<a nz-dropdown [nzDropdownMenu]="menu">
@ -144,6 +148,20 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>定时上线时间</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-range-picker formControlName="startTime" [nzShowTime]="true"></nz-range-picker>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>定时下线时间</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-range-picker formControlName="endTime" [nzShowTime]="true"></nz-range-picker>
</nz-form-control>
</nz-form-item>
<div nz-flex style="margin-top: 15px" [nzJustify]="'center'">
<button nz-button nzType="primary" (click)="submitData()" class="submit-btn">保存</button>
</div>

@ -7,3 +7,6 @@ nz-date-picker {
.submit-btn {
width: 150px;
}
nz-range-picker {
width: 100%;
}

@ -129,6 +129,8 @@ export class CmsListComponent {
imgUrl: ['', [Validators.required]],
jumpType: [''],
jumpUrl: [''],
startTime: [''],
endTime: [''],
});
// 查询数据
this.queryData();

@ -0,0 +1,84 @@
<nz-row [nzGutter]="6" style="margin-bottom: 15px;">
<nz-col [nzSpan]="6">
<nz-statistic [nzValue]="''+this.countRecordAmount" [nzTitle]="'提现总额'"></nz-statistic>
</nz-col>
</nz-row>
<form nz-form [formGroup]="searchForm" class="search_form">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="16">
<nz-form-item>
<nz-form-label>时间</nz-form-label>
<nz-form-control>
<nz-range-picker formControlName="createTimeArray" nzShowTime [nzAllowClear]="false" [nzFormat]="'yyyy/MM/dd HH:mm:ss'"></nz-range-picker>
<nz-radio-group nzButtonStyle="solid" formControlName="createTimeSelect" (ngModelChange)="payTimeInit()">
<label nz-radio-button *ngFor="let item of dateTypeSelect" nzValue="{{item.value}}">{{item.name}}</label>
</nz-radio-group>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>用户手机号</nz-form-label>
<nz-form-control>
<input nz-input formControlName="userPhone" placeholder="请输入" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="2">
<nz-form-item>
<nz-form-label [nzNoColon]="true"></nz-form-label>
<nz-form-control>
<button nz-button style="margin-right: 8px" [nzType]="'primary'" (click)="searchFormSubmit()">查询</button>
</nz-form-control>
</nz-form-item>
</div>
</div>
</form>
<nz-table #basicTable
[nzScroll]="{ x: '1200' }"
[nzBordered]="true"
[nzFrontPagination]="false"
[nzShowQuickJumper]="true"
[nzShowTotal]="totalTemplate"
[(nzPageIndex)]="tablePageNum"
(nzPageIndexChange)="queryData()"
nzShowSizeChanger
(nzPageSizeChange)="this.tablePageSize = $event;queryData()"
[nzPageSizeOptions]="[ 10, 20, 30, 50, 100 ]"
[nzTotal]="tableData.total"
[nzData]="tableData.list" >
<thead>
<tr>
<th nzWidth="60px">用户手机号</th>
<th nzWidth="60px">提现金额</th>
<th nzWidth="60px">提现前余额</th>
<th nzWidth="60px">提现后余额</th>
<th nzWidth="150px">来源内容</th>
<th nzWidth="100px">创建时间</th>
<!-- <th nzRight nzWidth="80px">操作</th>-->
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>{{data.userPhone}}</td>
<td>¥{{data.transactionAmount}}</td>
<td>¥{{data.beforeAmount}}</td>
<td>¥{{data.afterAmount}}</td>
<td>{{data.sourceContent}}</td>
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<!-- <td nzRight>
<a nz-dropdown [nzDropdownMenu]="menu">
操作列表
<span nz-icon nzType="down"></span>
</a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li nz-menu-item ><a >详情</a></li>
</ul>
</nz-dropdown-menu>
</td>-->
</tr>
</tbody>
<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template>
</nz-table>

@ -0,0 +1,200 @@
import {Component, Input} from '@angular/core';
import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule} from "@angular/forms";
import {DateSelectType, DateUtils} from "../../../utils/dateUtils.service";
import {NzMessageService} from "ng-zorro-antd/message";
import {BrowserStorageService} from "../../../utils/localStorage.service";
import {SpreadUserService} from "../../../services/spread/spread-user.service";
import {CommonService} from "../../../services/common/common.service";
import {NzModalModule, NzModalService} from "ng-zorro-antd/modal";
import {DatePipe, NgForOf, NgIf} from "@angular/common";
import {DictionaryPipe} from "../../../pipes/common/dictionary.pipe";
import {NzButtonComponent} from "ng-zorro-antd/button";
import {
NzCellFixedDirective,
NzTableCellDirective,
NzTableComponent, NzTableModule,
NzTbodyComponent, NzTheadComponent,
NzThMeasureDirective, NzTrDirective
} 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 {NzInputDirective} from "ng-zorro-antd/input";
import {NzMenuDirective, NzMenuItemComponent} from "ng-zorro-antd/menu";
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select";
import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzDescriptionsModule} from "ng-zorro-antd/descriptions";
import {NzUploadComponent} from "ng-zorro-antd/upload";
import {NzAvatarModule} from "ng-zorro-antd/avatar";
import {NzImageModule} from "ng-zorro-antd/image";
import {NzSwitchComponent} from "ng-zorro-antd/switch";
import {NzDatePickerComponent, NzDatePickerModule} from "ng-zorro-antd/date-picker";
import {NzInputNumberModule} from "ng-zorro-antd/input-number";
import {WeekPipe} from "../../../pipes/common/week.pipe";
import {NzStatisticModule} from "ng-zorro-antd/statistic";
import {NzRadioModule} from "ng-zorro-antd/radio";
@Component({
selector: 'app-spread-user-withdraw-record',
standalone: true,
imports: [
DatePipe,
DictionaryPipe,
FormsModule,
NgForOf,
NgIf,
NzButtonComponent,
NzCellFixedDirective,
NzColDirective,
NzDividerComponent,
NzDropDownADirective,
NzDropDownDirective,
NzDropdownMenuComponent,
NzFormControlComponent,
NzFormDirective,
NzFormItemComponent,
NzFormLabelComponent,
NzIconDirective,
NzInputDirective,
NzMenuDirective,
NzMenuItemComponent,
NzOptionComponent,
NzRowDirective,
NzSelectComponent,
NzTableCellDirective,
NzTableComponent,
NzTbodyComponent,
NzThMeasureDirective,
NzTheadComponent,
NzTrDirective,
ReactiveFormsModule,
NzTableModule,
NzModalModule,
NzFlexDirective,
NzDescriptionsModule,
NzUploadComponent,
NzAvatarModule,
NzImageModule,
NzSwitchComponent,
NzDatePickerComponent,
NzInputNumberModule,
WeekPipe,
NzStatisticModule,
NzRadioModule,
NzDatePickerModule
],
templateUrl: './spread-user-withdraw-record.component.html',
styleUrl: './spread-user-withdraw-record.component.less'
})
export class SpreadUserWithdrawRecordComponent {
// 表单页数
tablePageNum = 1;
// 每页数量
tablePageSize = 10;
// 表单数据
tableData: any = [];
// 搜索表单
searchForm: FormGroup;
// 时间快速选择项
dateTypeSelect = DateSelectType;
// 记录金额
countRecordAmount = 0;
constructor(private fb: NonNullableFormBuilder,
private message: NzMessageService,
private storage: BrowserStorageService,
private spreadUserService: SpreadUserService,
private commonService: CommonService,
private modal: NzModalService) {
// 初始化搜索框
this.searchForm = this.fb.group({
userPhone: [null],
sourceType: ['2'],
createTimeSelect: ['1'],
createTimeArray: [[]],
createTimeS: [null],
createTimeE: [null],
});
// 初始化创建时间
this.payTimeInit();
// 统计数据
this.queryCount();
// 记录数据
this.queryData();
}
/**
*
*/
payTimeInit() {
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]);
}
}
/**
*
*/
queryCount() {
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.searchForm.value.sourceType = 2;
this.searchForm.value.pageNum = this.tablePageNum;
this.searchForm.value.pageSize = this.tablePageSize;
this.searchForm.value.time = new Date().getTime();
this.spreadUserService.countRecordAmount(this.searchForm.value, (data: any) => {
if (data['return_code'] == '000000') {
this.countRecordAmount = data['return_data'];
}
});
}
/**
*
*/
queryData() {
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.searchForm.value.sourceType = 2;
this.searchForm.value.pageNum = this.tablePageNum;
this.searchForm.value.pageSize = this.tablePageSize;
this.searchForm.value.time = new Date().getTime();
this.spreadUserService.getRecordList(this.searchForm.value, (data: any) => {
if (data['return_code'] == '000000') {
this.tableData = data['return_data'];
}
});
}
/**
*
*/
searchFormSubmit(): void {
// 统计
this.queryCount();
// 记录数据
this.queryData();
}
/**
*
*/
searchFormReset(): void {
this.searchForm.reset();
}
}

@ -3,10 +3,12 @@ import {SpreadUserListComponent} from "./spread-user-list/spread-user-list.compo
import {SpreadChannelConfigComponent} from "./spread-channel-config/spread-channel-config.component";
import {SpreadUserAccountRecordComponent} from "./spread-user-account-record/spread-user-account-record.component";
import {SpreadCommissionComponent} from "./spread-commission/spread-commission.component";
import {SpreadUserWithdrawRecordComponent} from "./spread-user-withdraw-record/spread-user-withdraw-record.component";
export const SPREAD_ROUTES: Routes = [
{ path : 'user-list', component: SpreadUserListComponent },
{ path : 'user-commission', component: SpreadCommissionComponent },
{ path : 'channel-config', component: SpreadChannelConfigComponent },
{ path : 'withdraw-list', component: SpreadUserWithdrawRecordComponent },
];

@ -57,4 +57,28 @@ export class AgentService {
callBack(data);
});
}
/**
*
* @param param
* @param callBack
*/
public disable(param: any, callBack:any) {
param.tm = new Date().getTime();
this.http.post(environment.baseUrl + 'agent/disable', param).subscribe(data => {
callBack(data);
});
}
/**
*
* @param param
* @param callBack
*/
public enable(param: any, callBack:any) {
param.tm = new Date().getTime();
this.http.post(environment.baseUrl + 'agent/enable', param).subscribe(data => {
callBack(data);
});
}
}

@ -67,6 +67,18 @@ export class SpreadUserService {
callBack(data);
});
}
/**
*
* @param params
* @param callBack
*/
public countRecordAmount(params: any, callBack:any) {
this.http.get(environment.baseUrl + 'userSpread/countRecordAmount?'+ObjectData.objectByString(params)).subscribe(data => {
callBack(data);
});
}
/**
* 广
* @param params

Loading…
Cancel
Save