parent
16732b508b
commit
ff98e5da6d
@ -0,0 +1,38 @@ |
||||
<!-- start 面包屑 --> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
<!-- end 面包屑 --> |
||||
|
||||
<div class="inner-content"> |
||||
<span>共计 {{total}} 条数据</span> |
||||
<nz-table |
||||
class="table" |
||||
#ajaxTable |
||||
nzBordered |
||||
nzShowSizeChanger |
||||
[nzData]="requestData" |
||||
[nzLoading]="loading" |
||||
[nzTotal]="total" |
||||
[(nzPageSize)]="pageSize" |
||||
> |
||||
<thead nzSingleSort> |
||||
<tr> |
||||
<th nzWidth="90px">编号</th> |
||||
<th >产品ID</th> |
||||
<th>标题</th> |
||||
<th>规格ID </th> |
||||
<th>面值</th> |
||||
<th>成本价</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i + 1}}</td> |
||||
<td>{{data.goodsId}}</td> |
||||
<td>{{data.title}}</td> |
||||
<td>{{data.goodsOptionId}}</td> |
||||
<td>{{data.officialPrice}}元</td> |
||||
<td>{{data.platPrice}}元</td> |
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
@ -0,0 +1,42 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { ApiProductService } from '../../../services/api-product.service'; |
||||
import { NzMessageService } from 'ng-zorro-antd'; |
||||
|
||||
|
||||
@Component({ |
||||
selector: 'app-jianniu-list', |
||||
templateUrl: './jianniu-list.component.html', |
||||
styleUrls: ['./jianniu-list.component.scss'] |
||||
}) |
||||
export class JianniuListComponent implements OnInit { |
||||
|
||||
total: number; // 总计
|
||||
loading = true; |
||||
requestData = []; // 列表数据
|
||||
pageNum = 1; // 页码
|
||||
pageSize = 10; // 条码
|
||||
|
||||
constructor( |
||||
private apiProduct: ApiProductService, |
||||
private message: NzMessageService, |
||||
) { } |
||||
|
||||
ngOnInit() { |
||||
this.getRequest(); |
||||
} |
||||
|
||||
|
||||
// 查询列表
|
||||
public getRequest() { |
||||
this.apiProduct.jNiuGoodsList( data => { |
||||
this.loading = false; |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData = data['return_data']; |
||||
this.total = data['return_data'].length; |
||||
} else { |
||||
this.message.error(data['return_msg']); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue