提交代码

pull/1/head
胡锐 3 years ago
parent 5315c6f9f4
commit 7bd5cb0827
  1. 2
      src/app/admin/activate/activate-list/activate-list.component.html
  2. 9
      src/app/admin/activate/activate-list/activate-list.component.ts
  3. 72
      src/app/admin/activate/activate-lottery-record/activate-lottery-record.component.html
  4. 0
      src/app/admin/activate/activate-lottery-record/activate-lottery-record.component.scss
  5. 25
      src/app/admin/activate/activate-lottery-record/activate-lottery-record.component.spec.ts
  6. 80
      src/app/admin/activate/activate-lottery-record/activate-lottery-record.component.ts
  7. 2
      src/app/admin/activate/activate-routing.module.ts
  8. 3
      src/app/admin/activate/activate.module.ts
  9. 11
      src/app/services/activate.service.ts

@ -90,6 +90,8 @@
<a (click)="getEdit(data.id)">编辑</a> <a (click)="getEdit(data.id)">编辑</a>
<nz-divider nzType="vertical"></nz-divider> <nz-divider nzType="vertical"></nz-divider>
<a (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 1 ? '禁用': '启用'}}</a> <a (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 1 ? '禁用': '启用'}}</a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)='jumpLotteryRecord(data.id )'>中奖记录</a>
</td> </td>
</tbody> </tbody>
</nz-table> </nz-table>

@ -96,7 +96,14 @@ export class ActivateListComponent implements OnInit {
}).then(r => console.log(r)); }).then(r => console.log(r));
} }
// 跳转中奖记录
public jumpLotteryRecord(id: number): void {
this.router.navigate(['/admin/activate/activate-lottery-record'], {
queryParams: {
activityId: id
}
}).then(r => console.log(r));
}
} }

@ -0,0 +1,72 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)">
<div nz-row>
<div nz-col nzSpan="6">
<nz-form-item>
<nz-form-label [nzSpan]="8">用户手机号</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="userPhone" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="6">
<nz-form-item>
<nz-form-label [nzSpan]="8">中奖名称</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="awardName" />
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col nzSpan="24" class="search-button">
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button>
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button>
</div>
</div>
</form>
</div>
<div class="inner-content">
<span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span>
<div class="operating-button"></div>
<!--数组表格 -->
<nz-table #basicTable
[nzData]="dataObject.list"
[nzTotal]="dataObject.total"
[nzFrontPagination]="false"
[nzLoading]="tableLoading"
[nzPageIndex]="whereObject.pageNum"
(nzPageIndexChange)="requestData($event)"
[nzScroll]="{ x: '1150px'}">
<thead>
<tr>
<th nzWidth="150px">用户手机号</th>
<th nzWidth="150px">用户昵称</th>
<th nzWidth="200px">中奖名称</th>
<th nzWidth="200px">中奖时间</th>
<!-- <th nzWidth="80px" nzRight="0px">操作</th>-->
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data;let i = index">
<td>{{data.userPhone}}</td>
<td>{{data.userName}}</td>
<td>{{data.awardName}}</td>
<td>{{data.winLotteryTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<!-- <td nzRight="0px" class="table-td-operation">
<a [routerLink]="['/admin/audit/pendingApprovedDetail']" [queryParams]="{id: data.id, entrance: 2, classId: data.classId, classType: data.classType, applyType: data.applyType,applyId:data.applyId}">详情</a>
</td>-->
</tr>
</tbody>
</nz-table>
</div>

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ActivateLotteryRecordComponent } from './activate-lottery-record.component';
describe('ActivateLotteryRecordComponent', () => {
let component: ActivateLotteryRecordComponent;
let fixture: ComponentFixture<ActivateLotteryRecordComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ActivateLotteryRecordComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ActivateLotteryRecordComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,80 @@
import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup} from "_@angular_forms@9.0.7@@angular/forms";
import {ActivateService} from "../../../services/activate.service";
import {IconService} from "../../../services/icon.service";
import {NzMessageService} from "_ng-zorro-antd@9.3.0@ng-zorro-antd";
import { Params, ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-activate-lottery-record',
templateUrl: './activate-lottery-record.component.html',
styleUrls: ['./activate-lottery-record.component.scss']
})
export class ActivateLotteryRecordComponent implements OnInit {
FILE_URL;
dataObject: any = {};
tableLoading = true;
searchForm: FormGroup;
pageNum: number;
whereObject: any = {};
activityId;
constructor(
private form: FormBuilder,
private activate: ActivateService,
private iconService: IconService,
private activatedRoute: ActivatedRoute,
private message: NzMessageService,
) {
}
ngOnInit(): void {
this.searchForm = this.form.group({
userPhone: [null],
awardName: [null],
});
this.activatedRoute.queryParams.subscribe((queryParams: Params) => {
if (queryParams['activityId']) {
this.activityId = queryParams['activityId'];
this.requestData(1);
}
});
}
/**
*
*/
requestData(pageNum) {
this.tableLoading = true;
this.whereObject['activityId'] = this.activityId;
this.whereObject['pageNum'] = pageNum;
this.whereObject['pageSize'] = 10;
this.activate.getWinLotteryList(this.whereObject, data => {
if (data['return_code'] === '000000') {
this.dataObject = data['return_data'];
} else {
this.message.warning('获取失败!');
}
this.tableLoading = false;
});
}
/**
*
* @param whereObject
*/
search(whereObject: object) {
this.whereObject = whereObject;
this.requestData(1);
}
/**
*
*/
public resetForm(): void {
this.searchForm.reset();
}
}

@ -2,11 +2,13 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import {ActivateListComponent} from './activate-list/activate-list.component'; import {ActivateListComponent} from './activate-list/activate-list.component';
import {ActivateEditComponent} from './activate-edit/activate-edit.component'; import {ActivateEditComponent} from './activate-edit/activate-edit.component';
import { ActivateLotteryRecordComponent } from './activate-lottery-record/activate-lottery-record.component';
const routes: Routes = [ const routes: Routes = [
{ path: 'activate-list', component: ActivateListComponent }, { path: 'activate-list', component: ActivateListComponent },
{ path: 'activate-edit', component: ActivateEditComponent}, { path: 'activate-edit', component: ActivateEditComponent},
{ path: 'activate-lottery-record', component: ActivateLotteryRecordComponent},
]; ];
@NgModule({ @NgModule({

@ -10,10 +10,11 @@ import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/f
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
import {RegionSelectorModule} from '../../common/region-selector/region-selector.module'; import {RegionSelectorModule} from '../../common/region-selector/region-selector.module';
import {AppCommonModule} from "../../app-common.module"; import {AppCommonModule} from "../../app-common.module";
import { ActivateLotteryRecordComponent } from './activate-lottery-record/activate-lottery-record.component';
@NgModule({ @NgModule({
declarations: [ActivateListComponent, ActivateEditComponent], declarations: [ActivateListComponent, ActivateEditComponent, ActivateLotteryRecordComponent],
imports: [ imports: [
CommonModule, CommonModule,
ActivateRoutingModule, ActivateRoutingModule,

@ -53,4 +53,15 @@ export class ActivateService {
callBack(data); callBack(data);
}); });
} }
/**
*
* @param param
* @param callBack
*/
public getWinLotteryList(param: object, callBack) {
this.http.get(environment.baseUrl + 'activity/getWinLotteryList?' + this.common.getWhereCondition(param)).subscribe(data => {
callBack(data);
});
}
} }

Loading…
Cancel
Save