提交代码

pull/1/head
胡锐 3 years ago
parent 7bd5cb0827
commit 77954ab1f8
  1. 28
      src/app/admin/activate/activate-list/activate-list.component.html
  2. 3
      src/app/admin/activate/activate-list/activate-list.component.scss
  3. 28
      src/app/admin/activate/activate-list/activate-list.component.ts
  4. 24
      src/app/services/activate.service.ts

@ -70,12 +70,13 @@
<thead nzSingleSort>
<tr>
<th nzWidth="50px">编号</th>
<th nzWidth="80px">活动标题</th>
<th nzWidth="80px">活动类型</th>
<th nzWidth="150px">活动标题</th>
<th nzWidth="70px">活动类型</th>
<th nzWidth="100px">开始时间</th>
<th nzWidth="100px">结束时间</th>
<th nzWidth="100px">创建时间</th>
<th nzWidth="100px">更新时间</th>
<th nzWidth="70px" nzRight>活动状态</th>
<th nzWidth="80px" nzRight>操作</th>
<th nzWidth="80px" nzRight>活动状态</th>
<th nzWidth="120px" nzRight>操作</th>
</tr>
</thead>
<tbody>
@ -83,15 +84,20 @@
<td>{{i+1}}</td>
<td>{{data.title}}</td>
<td>{{data.type | type}}</td>
<td>{{data.startTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data.endTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data.updateTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td nzRight>{{data.status | status}}</td>
<td nzRight class="table-td-operation">
<a (click)="getEdit(data.id)">编辑</a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 1 ? '禁用': '启用'}}</a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)='jumpLotteryRecord(data.id )'>中奖记录</a>
<a *ngIf="data.status != 3" (click)="getEdit(data.id)">编辑</a>
<a (click)="startActivity(data.id)" *ngIf="data.status == 1">发布</a>
<a (click)="endActivity(data.id)" *ngIf="data.status == 2">结束</a>
<a nz-dropdown [nzDropdownMenu]="menu">更多操作<i nz-icon nzType="down"></i></a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li nz-menu-item><a (click)='jumpLotteryRecord(data.id )'>中奖记录</a></li>
</ul>
</nz-dropdown-menu>
</td>
</tbody>
</nz-table>

@ -0,0 +1,3 @@
.table-td-operation a {
margin-right: 8px;
}

@ -72,16 +72,26 @@ export class ActivateListComponent implements OnInit {
this.searchForm.reset();
}
public getForbiddenUser(id, status: any): void {
const message = (status === 1 ? '是否禁用当前公司' : '是否启用当前公司');
const s = status === 1 ? 0 : 1;
// 活动开始
public startActivity(id: number): void {
this.activate.startActivity({activityId : id}, data => {
if (data['return_code'] === '000000') {
this.message.success(data['return_msg']);
this.getRequest(true, this.searchForm.value);
} else {
this.message.error(data['return_msg']);
}
});
}
this.common.showConfirm(message, data => {
if (data) {
this.company.editStatus(id, s , dataUser => {
this.getRequest(false , this.searchForm.value);
});
// 活动结束
public endActivity(id: number): void {
this.activate.endActivity({activityId : id}, data => {
if (data['return_code'] === '000000') {
this.message.success(data['return_msg']);
this.getRequest(true, this.searchForm.value);
} else {
this.message.error(data['return_msg']);
}
});
}

@ -60,7 +60,29 @@ export class ActivateService {
* @param callBack
*/
public getWinLotteryList(param: object, callBack) {
this.http.get(environment.baseUrl + 'activity/getWinLotteryList?' + this.common.getWhereCondition(param)).subscribe(data => {
this.http.get(environment.baseUrl + 'activityAward/getWinLotteryList?' + this.common.getWhereCondition(param)).subscribe(data => {
callBack(data);
});
}
/**
*
* @param param
* @param callBack
*/
public startActivity(param: object, callBack) {
this.http.post(environment.baseUrl + 'activity/startActivity', param).subscribe(data => {
callBack(data);
});
}
/**
*
* @param param
* @param callBack
*/
public endActivity(param: object, callBack) {
this.http.post(environment.baseUrl + 'activity/endActivity', param).subscribe(data => {
callBack(data);
});
}

Loading…
Cancel
Save