pull/1/head
袁野 4 years ago
commit d9302f7a5a
  1. 2
      .gitignore
  2. 36
      src/app/admin/audit/audit-coupon/audit-coupon.component.html
  3. 6
      src/app/admin/coupon/coupon-list/coupon-list.component.html
  4. 2
      src/app/admin/coupon/sales-code-list/sales-code-list.component.html
  5. 2
      src/app/admin/merchant/merchant-edit/merchant-edit.component.ts
  6. 123
      src/app/admin/order/order-coupons/order-coupons.component.html
  7. 4
      src/app/admin/order/order-coupons/order-coupons.component.scss
  8. 114
      src/app/admin/order/order-coupons/order-coupons.component.ts
  9. 2
      src/app/admin/order/order-routing.module.ts
  10. 3
      src/app/admin/order/order.module.ts
  11. 2
      src/app/admin/system/sinopec-config/sinopec-config.component.html
  12. 9
      src/app/admin/system/sinopec-edit/sinopec-edit.component.html
  13. 1
      src/app/admin/system/sinopec-edit/sinopec-edit.component.ts
  14. 72
      src/app/admin/user/user-gold/user-gold.component.html
  15. 4
      src/app/admin/user/user-gold/user-gold.component.scss
  16. 69
      src/app/admin/user/user-gold/user-gold.component.ts
  17. 8
      src/app/admin/user/user-list/user-list.component.html
  18. 2
      src/app/admin/user/user-list/user-list.component.scss
  19. 2
      src/app/admin/user/user-routing.module.ts
  20. 3
      src/app/admin/user/user.module.ts
  21. 19
      src/app/services/agent.service.ts
  22. 12
      src/app/services/user.service.ts

2
.gitignore vendored

@ -1,7 +1,7 @@
.git/ .git/
.idea/ .idea/
node_modules/ node_modules/
dist/

@ -96,22 +96,48 @@
<nz-modal [(nzVisible)]="isVisible" nzWidth="900" nzTitle="审核详情" (nzOnCancel)="handleCancel()"> <nz-modal [(nzVisible)]="isVisible" nzWidth="900" nzTitle="审核详情" (nzOnCancel)="handleCancel()">
<ng-container> <ng-container>
<nz-descriptions nzBordered> <nz-descriptions nzTitle="审核基础内容" nzBordered>
<nz-descriptions-item nzTitle="审核类型" >{{data['approve']['objectType'] | auditType}}</nz-descriptions-item> <nz-descriptions-item nzTitle="审核类型" >{{data['approve']['objectType'] | auditType}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="审核状态">{{data['approve']['status'] | auditStatus}}</nz-descriptions-item> <nz-descriptions-item nzTitle="审核状态">{{data['approve']['status'] | auditStatus}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="申请人员">{{data['approve']['submitOperatorName']}}</nz-descriptions-item> <nz-descriptions-item nzTitle="申请人员">{{data['approve']['submitOperatorName']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="审核名称">{{data['approve']['objectName']}}</nz-descriptions-item> <nz-descriptions-item nzTitle="审核名称">{{data['approve']['objectName']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="卡券KEY">{{data['object']['couponKey']}}</nz-descriptions-item> </nz-descriptions>
<nz-descriptions-item nzTitle="卡券面值">¥{{data['object']['couponPrice']}}</nz-descriptions-item> <nz-descriptions style="margin-top: 20px;" nzTitle="审核对象详情" nzBordered>
<nz-descriptions-item nzTitle="卡券类型">{{data['object']['couponType'] === 1 ? '内部卷' : '外部卷'}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="支付类型">{{data['object']['couponType'] === 1 ? '微信支付' : '金币支付'}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="展示区域">{{data['object']['displayArea'] === 1 ? '赠券专区' : '金币专区'}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="销售价格">¥{{data['object']['salesPrice']}}</nz-descriptions-item> <nz-descriptions-item nzTitle="销售价格">¥{{data['object']['salesPrice']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="折扣价格">¥{{data['object']['salesPrice']}}</nz-descriptions-item> <nz-descriptions-item nzTitle="折扣价格">¥{{data['object']['discountPrice']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="销售数量">{{data['object']['salesCount']}}</nz-descriptions-item> <nz-descriptions-item nzTitle="销售数量">{{data['object']['salesCount']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="限购数量">{{data['object']['limitNumber']}}</nz-descriptions-item> <nz-descriptions-item nzTitle="限购数量">{{data['object']['limitNumber']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="归库天数">{{data['object']['recycleDay']}}</nz-descriptions-item> <nz-descriptions-item nzTitle="归库天数">{{data['object']['recycleDay']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="卡券类型">{{data['object']['couponType'] === 1 ? '内部卷' : '外部卷'}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="销售截至时间">{{data['object']['salesEndTime'] | date : 'yyyy-MM-dd'}}</nz-descriptions-item> <nz-descriptions-item nzTitle="销售截至时间">{{data['object']['salesEndTime'] | date : 'yyyy-MM-dd'}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="是否赠送卡券">{{data['object']['isPresent'] === true ? '赠送' : '不赠送'}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="创建时间">{{data['object']['createTime'] | date : 'yyyy-MM-dd'}}</nz-descriptions-item> <nz-descriptions-item nzTitle="创建时间">{{data['object']['createTime'] | date : 'yyyy-MM-dd'}}</nz-descriptions-item>
</nz-descriptions> </nz-descriptions>
<h3 style="margin-top: 20px;" *ngIf="data['object']['isPresent'] === true">赠券列表</h3>
<nz-table *ngIf="data['object']['isPresent'] === true" #basicTable [nzData]="data['object']['handselCouponList']" [nzScroll]="{ x: '1200px' }">
<thead>
<tr>
<th nzWidth="160px">卡券名称</th>
<th nzWidth="100px">销售价格</th>
<th nzWidth="100px">折扣价格</th>
<th nzWidth="100px">展示区域</th>
<th nzWidth="100px">卡券类型</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>{{data['highCouponModel'].couponName}}</td>
<td>¥{{data['highCouponModel'].salesPrice}}</td>
<td>¥{{data['highCouponModel'].discountPrice}}</td>
<td>{{data['highCouponModel'].displayArea === 1 ? '赠券专区' : '金币专区'}}</td>
<td>{{data['highCouponModel'].couponType === 1 ? '内部卷' : '外部卷'}}</td>
</tr>
</tbody>
</nz-table>
</ng-container> </ng-container>
<div *nzModalFooter> <div *nzModalFooter>
<button *ngIf="data['approve']['status'] !== 1" nz-button nzType="default" (click)="handleCancel()">关闭</button> <button *ngIf="data['approve']['status'] !== 1" nz-button nzType="default" (click)="handleCancel()">关闭</button>

@ -102,8 +102,11 @@
<th nzWidth="150px">卡券编号</th> <th nzWidth="150px">卡券编号</th>
<th nzWidth="160px">卡券名称</th> <th nzWidth="160px">卡券名称</th>
<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 nzWidth="100px">卡券类型</th> <th nzWidth="100px">卡券类型</th>
<th nzWidth="100px">是否赠券</th>
<th nzWidth="120px">卡券状态</th> <th nzWidth="120px">卡券状态</th>
<th nzWidth="150px">销售截止时间</th> <th nzWidth="150px">销售截止时间</th>
<th nzWidth="150px">创建时间</th> <th nzWidth="150px">创建时间</th>
@ -116,8 +119,11 @@
<td>{{data.couponKey}}</td> <td>{{data.couponKey}}</td>
<td>{{data.couponName}}</td> <td>{{data.couponName}}</td>
<td>¥{{data.salesPrice}}</td> <td>¥{{data.salesPrice}}</td>
<td>¥{{data.discountPrice}}</td>
<td>{{data.stockCount}}</td> <td>{{data.stockCount}}</td>
<td>{{data.displayArea === 1 ? '赠券专区' : '金币专区'}}</td>
<td>{{data.couponType === 1 ? '内部卷' : '外部卷'}}</td> <td>{{data.couponType === 1 ? '内部卷' : '外部卷'}}</td>
<td>{{data.isPresent === true ? '赠券' : '无赠券'}}</td>
<td>{{data.status | couponStatus}}</td> <td>{{data.status | couponStatus}}</td>
<td>{{data.salesEndTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data.salesEndTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>

@ -82,6 +82,7 @@
<th nzWidth="50px">编号</th> <th nzWidth="50px">编号</th>
<th nzWidth="180px">消费码</th> <th nzWidth="180px">消费码</th>
<th nzWidth="180px">是否分发</th> <th nzWidth="180px">是否分发</th>
<th nzWidth="120px">使用门店</th>
<th nzWidth="120px">领取时间</th> <th nzWidth="120px">领取时间</th>
<th nzWidth="120px">消费时间</th> <th nzWidth="120px">消费时间</th>
<th nzWidth="120px">销售截止时间</th> <th nzWidth="120px">销售截止时间</th>
@ -95,6 +96,7 @@
<td>{{i + 1}}</td> <td>{{i + 1}}</td>
<td>{{data.salesCode}}</td> <td>{{data.salesCode}}</td>
<td>{{data.isAssignAgent === true ? '已分发' : '未分发'}}</td> <td>{{data.isAssignAgent === true ? '已分发' : '未分发'}}</td>
<td>{{data.storeName == null ? '暂无' : data.storeName}}</td>
<td>{{data.receiveTime == null ? '未领取' : data.receiveTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data.receiveTime == null ? '未领取' : data.receiveTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data.consumeTime == null ? '未消费' : data.consumeTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data.consumeTime == null ? '未消费' : data.consumeTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data.salesEndTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data.salesEndTime | date: 'yyyy-MM-dd HH:mm'}}</td>

@ -49,7 +49,7 @@ export class MerchantEditComponent implements OnInit {
} }
}); });
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
loginTelephone: [null, [Validators.required, ValidatorsService.mobile]], loginTelephone: [null, [Validators.required]],
password: [null, [Validators.required, ValidatorsService.minLength(6)]], password: [null, [Validators.required, ValidatorsService.minLength(6)]],
merchantName: [null, [Validators.required]], merchantName: [null, [Validators.required]],
telephone: [null, [Validators.required]], telephone: [null, [Validators.required]],

@ -0,0 +1,123 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<nz-table
class="table"
#ajaxTable
nzShowSizeChanger
[nzFrontPagination]="false"
[nzData]="requestData"
[nzLoading]="loading"
[nzTotal]="total"
[(nzPageIndex)]="pageNum"
[(nzPageSize)]="pageSize"
[nzScroll]="{ x: '1200px' }"
(nzPageIndexChange)="getRequest(false , {})"
(nzPageSizeChange)="getRequest(false , {})">
<thead nzSingleSort>
<tr>
<th nzWidth="50px">编号</th>
<th nzWidth="80px">优惠券KEY</th>
<th nzWidth="80px">优惠券名称</th>
<th nzWidth="80px">优惠券类型</th>
<th nzWidth="70px">优惠内容</th>
<th nzWidth="70px">有效天数</th>
<th nzWidth="100px">截止日期</th>
<th nzWidth="100px">创建时间</th>
<th nzWidth="100px">状态</th>
<th nzWidth="80px" nzRight="0px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i + 1}}</td>
<td>{{data['highDiscount'].discountKey}}</td>
<td>{{data['highDiscount'].discountName}}</td>
<td>{{data['highDiscount'].discountType | discountType}}</td>
<td>
<span *ngIf="data['highDiscount'].discountType === 1">
满{{data['highDiscount'].discountCondition}}抵扣{{data['highDiscount'].discountPrice}}
</span>
<span *ngIf="data['highDiscount'].discountType === 2">
抵扣{{data['highDiscount'].discountPrice}}
</span>
<span *ngIf="data['highDiscount'].discountType === 3">
{{data['highDiscount'].discountPrice}}折
</span>
</td>
<td>{{data['highDiscount'].effectiveDay}}</td>
<td>{{data['highDiscount'].salesEndTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data['highDiscount'].createTime}}</td>
<td>{{data['highDiscount'].status | discountStatus}}</td>
<td nzRight="0px" class="table-td-operation">
<a (click)="getDetail(data.id)">使用情况</a>
</td>
</tbody>
</nz-table>
</div>
<nz-modal [(nzVisible)]="isVisible" nzTitle="使用情况" nzWidth="1000" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()">
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequestCode(true , searchForm.value)">
<div nz-row>
<div nz-col nzSpan="9">
<nz-form-item>
<nz-form-label [nzSpan]="6">优惠券状态</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="status" nzPlaceHolder="请选择优惠券状态">
<nz-option nzLabel="待领取" nzValue="1"></nz-option>
<nz-option nzLabel="待使用" nzValue="2"></nz-option>
<nz-option nzLabel="已使用" nzValue="3"></nz-option>
<nz-option nzLabel="已过期" nzValue="4"></nz-option>
</nz-select>
</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>
<span>共计 {{totalCode}} 条数据</span>
<nz-table
class="table"
#ajaxTableCode
nzShowSizeChanger
[nzFrontPagination]="false"
[nzData]="requestDataCode"
[nzLoading]="loadingCode"
[nzTotal]="totalCode"
[(nzPageIndex)]="pageNumCode"
[(nzPageSize)]="pageSizeCode"
(nzPageIndexChange)="getRequestCode(false , searchForm.value)"
(nzPageSizeChange)="getRequestCode(false , searchForm.value)">
<thead nzSingleSort>
<tr>
<th nzWidth="50px">编号</th>
<th nzWidth="70px">优惠券名称</th>
<th nzWidth="70px">用户名称</th>
<th nzWidth="70px">二维码生成时间</th>
<th nzWidth="50px">状态</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of ajaxTableCode.data; let i = index">
<td>{{i+1}}</td>
<td>{{data['highDiscount'].discountName}}</td>
<td>
{{data['highUser'] == null ? '暂无': data['highUser'].name}}
</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data.status | couponCode}}</td>
</tbody>
</nz-table>
</nz-modal>

@ -0,0 +1,4 @@
.head_img {
height: 60px;
width: 60px;
}

@ -0,0 +1,114 @@
import { Component, OnInit } from '@angular/core';
import {environment} from '../../../../environments/environment';
import {FormBuilder, FormGroup} from '@angular/forms';
import {UserService} from '../../../services/user.service';
import {IconService} from '../../../services/icon.service';
import {NzMessageService} from 'ng-zorro-antd';
import {CommonsService} from '../../../services/commons.service';
import {AgentService} from '../../../services/agent.service';
import {DiscountService} from '../../../services/discount.service';
import {LocalStorageService} from '../../../services/local-storage.service';
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
@Component({
selector: 'app-order-coupons',
templateUrl: './order-coupons.component.html',
styleUrls: ['./order-coupons.component.scss']
})
export class OrderCouponsComponent implements OnInit {
IMAGE_URL = environment.imageUrl;
searchForm: FormGroup; // 搜索框
requestData = []; // 列表数据
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
requestDataCode = []; // 列表数据
totalCode: number; // 页码
pageNumCode = 1; // 页码
pageSizeCode = 10; // 条码
loadingCode = true;
isVisible = false;
id: number;
constructor(
private form: FormBuilder,
private agent: AgentService,
private iconService: IconService,
private message: NzMessageService,
private store: LocalStorageService, // 数据请求
) {
}
ngOnInit(): void {
this.init();
}
public init(): void {
this.searchForm = this.form.group({
status: [null],
});
this.getRequest(true, {});
}
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
this.loading = false;
if (reset) {
this.pageNum = 1;
}
whereObject['agentId'] = this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id;
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
this.agent.getDiscountAgentList(whereObject, data => {
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list;
this.total = data['return_data'].total;
} else {
this.message.error(data['return_msg']);
}
});
}
// 重置
public resetForm(): void {
this.searchForm.reset();
}
// 查看使用情况
public getDetail(id: number): void {
this.id = id;
this.getRequestCode(false , this.searchForm.value);
this.isVisible = true;
}
// 查询列表
public getRequestCode(reset: boolean = false, whereObject: object) {
this.loadingCode = true;
if (reset) {
this.pageNumCode = 1;
}
this.searchForm.value['discountAgentId'] = this.id;
whereObject['pageNum'] = this.pageNumCode;
whereObject['pageSize'] = this.pageSizeCode;
this.agent.getDiscountCodeList(whereObject, data => {
this.loadingCode = false;
if (data['return_code'] === '000000') {
this.requestDataCode = data['return_data'].list;
this.totalCode = data['return_data'].total;
} else {
this.message.error(data['return_msg']);
}
});
}
handleOk(): void {
this.isVisible = false;
}
handleCancel(): void {
this.isVisible = false;
}
}

@ -2,11 +2,13 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import {OrderListComponent} from './order-list/order-list.component'; import {OrderListComponent} from './order-list/order-list.component';
import {OrderDetailComponent} from './order-detail/order-detail.component'; import {OrderDetailComponent} from './order-detail/order-detail.component';
import {OrderCouponsComponent} from './order-coupons/order-coupons.component';
const routes: Routes = [ const routes: Routes = [
{ path: 'order-list', component: OrderListComponent }, { path: 'order-list', component: OrderListComponent },
{ path: 'order-detail', component: OrderDetailComponent }, { path: 'order-detail', component: OrderDetailComponent },
{ path: 'order-coupons', component: OrderCouponsComponent },
]; ];
@NgModule({ @NgModule({

@ -10,10 +10,11 @@ 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 { OrderDetailComponent } from './order-detail/order-detail.component'; import { OrderDetailComponent } from './order-detail/order-detail.component';
import { OrderCouponsComponent } from './order-coupons/order-coupons.component';
@NgModule({ @NgModule({
declarations: [OrderListComponent, OrderDetailComponent], declarations: [OrderListComponent, OrderDetailComponent, OrderCouponsComponent],
imports: [ imports: [
CommonModule, CommonModule,
OrderRoutingModule, OrderRoutingModule,

@ -23,6 +23,7 @@
<thead nzSingleSort> <thead nzSingleSort>
<tr> <tr>
<th nzWidth="50px">编号</th> <th nzWidth="50px">编号</th>
<th nzWidth="80px">客户名称</th>
<th nzWidth="80px">客户AppId</th> <th nzWidth="80px">客户AppId</th>
<th nzWidth="80px">客户密码</th> <th nzWidth="80px">客户密码</th>
<th nzWidth="100px">客户编码</th> <th nzWidth="100px">客户编码</th>
@ -34,6 +35,7 @@
<tbody> <tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index"> <tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td>{{data.name}}</td>
<td>{{data.appId}}</td> <td>{{data.appId}}</td>
<td>{{data.appSecret}}</td> <td>{{data.appSecret}}</td>
<td>{{data.code}}</td> <td>{{data.code}}</td>

@ -20,6 +20,14 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'appId'" nzRequired>客户名称</nz-form-label>
<nz-form-control nzErrorTip="请输入客户名称!">
<input nz-input placeholder="请输入客户名称..." [formControlName]="'name'" id="'name'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8"> <div nz-col [nzSpan]="8">
<nz-form-item> <nz-form-item>
<nz-form-label [nzFor]="'appSecret'" nzRequired>客户密码</nz-form-label> <nz-form-label [nzFor]="'appSecret'" nzRequired>客户密码</nz-form-label>
@ -36,6 +44,7 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col [nzSpan]="8"> <div nz-col [nzSpan]="8">
<nz-form-item> <nz-form-item>
<nz-form-label [nzFor]="'signkey'" nzRequired>客户KEY</nz-form-label> <nz-form-label [nzFor]="'signkey'" nzRequired>客户KEY</nz-form-label>

@ -40,6 +40,7 @@ export class SinopecEditComponent implements OnInit {
appSecret: [null, [Validators.required]], appSecret: [null, [Validators.required]],
code: [null, [Validators.required]], code: [null, [Validators.required]],
signkey: [null, [Validators.required]], signkey: [null, [Validators.required]],
name: [null, [Validators.required]],
}); });
} }

@ -0,0 +1,72 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">金币类型</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="goldType" nzPlaceHolder="请选择金币类型">
<nz-option nzLabel="收入" nzValue="1"></nz-option>
<nz-option nzLabel="支出" nzValue="2"></nz-option>
</nz-select>
</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>共计 {{total}} 条数据</span>
<nz-table
class="table"
#ajaxTable
nzShowSizeChanger
[nzFrontPagination]="false"
[nzData]="requestData"
[nzLoading]="loading"
[nzTotal]="total"
[(nzPageIndex)]="pageNum"
[(nzPageSize)]="pageSize"
[nzScroll]="{ x: '1200px' }"
(nzPageIndexChange)="getRequest(false , searchForm.value)"
(nzPageSizeChange)="getRequest(false , searchForm.value)">
<thead nzSingleSort>
<tr>
<th nzWidth="50px">编号</th>
<th nzWidth="80px">用户名称</th>
<th nzWidth="100px">用户电话</th>
<th nzWidth="100px">金币类型</th>
<th nzWidth="100px">来源类型</th>
<th nzWidth="100px">金币数</th>
<th nzWidth="100px">产生时间</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i+1}}</td>
<td>{{data['highUser'].name}}</td>
<td>{{data['highUser'].phone}}</td>
<td>{{data.goldType === 1 ? '收入' : '支出'}}</td>
<td>{{data.resType === 1 ? '充值' : '订单'}}</td>
<td>{{data.gold}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
</tbody>
</nz-table>
</div>

@ -0,0 +1,4 @@
.head_img {
height: 50px;
width: 50px;
}

@ -0,0 +1,69 @@
import { Component, OnInit } from '@angular/core';
import {environment} from '../../../../environments/environment';
import {FormBuilder, FormGroup} from '@angular/forms';
import {UserService} from '../../../services/user.service';
import {IconService} from '../../../services/icon.service';
import {NzMessageService} from 'ng-zorro-antd';
import {CommonsService} from '../../../services/commons.service';
@Component({
selector: 'app-user-gold',
templateUrl: './user-gold.component.html',
styleUrls: ['./user-gold.component.scss']
})
export class UserGoldComponent implements OnInit {
searchForm: FormGroup; // 搜索框
requestData = []; // 列表数据
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
constructor(
private form: FormBuilder,
private user: UserService,
private iconService: IconService,
private message: NzMessageService,
private common: CommonsService
) {
}
ngOnInit(): void {
this.init();
}
public init(): void {
this.searchForm = this.form.group({
goldType: [null],
});
this.getRequest(true, this.searchForm.value);
}
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
this.loading = false;
if (reset) {
this.pageNum = 1;
}
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
this.user.getGoldRecList(whereObject, data => {
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list;
this.total = data['return_data'].total;
} else {
this.message.error(data['return_msg']);
}
});
}
// 重置
public resetForm(): void {
this.searchForm.reset();
}
}

@ -74,7 +74,6 @@
<th nzWidth="80px">用户名称</th> <th nzWidth="80px">用户名称</th>
<th nzWidth="70px">用户头像</th> <th nzWidth="70px">用户头像</th>
<th nzWidth="100px">用户电话</th> <th nzWidth="100px">用户电话</th>
<th nzWidth="50px">性别</th>
<th nzWidth="50px">金币数量</th> <th nzWidth="50px">金币数量</th>
<th nzWidth="100px">注册时间</th> <th nzWidth="100px">注册时间</th>
<th nzWidth="50px">状态</th> <th nzWidth="50px">状态</th>
@ -86,16 +85,15 @@
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td>{{data.name}}</td> <td>{{data.name}}</td>
<td> <td>
<img class="head_img" src="{{WEB_SERVE_URL + data.headerImg}}" onerror="this.src='../../../../assets/admin/navigation/icon.png'" alt=""> <img class="head_img" src="{{data.headerImg}}" onerror="this.src='../../../../assets/admin/navigation/icon.png'" alt="">
</td> </td>
<td>{{data.phone}}</td> <td>{{data.phone}}</td>
<td>{{data.sex}}</td>
<td>{{data.gold}}</td> <td>{{data.gold}}</td>
<td>{{data.regTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data.regTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data.status ===1 ? '正常' : '禁用'}}</td> <td>{{data.status ===1 ? '正常' : '禁用'}}</td>
<td nzRight="0px" class="table-td-operation"> <td nzRight="0px" class="table-td-operation">
<a ><i nz-icon [nzIconfont]="'icon-dingdanxiangqing_icon'" nz-tooltip="订单列表"></i></a> <!-- <a ><i nz-icon [nzIconfont]="'icon-dingdanxiangqing_icon'" nz-tooltip="订单列表"></i></a>-->
<nz-divider nzType="vertical"></nz-divider> <!-- <nz-divider nzType="vertical"></nz-divider>-->
<!-- <a *ngIf="data.status !== 2" (click)="getEdit(data.id)"><i nz-icon nzType="form" nzTheme="outline" nz-tooltip="修改"></i></a>--> <!-- <a *ngIf="data.status !== 2" (click)="getEdit(data.id)"><i nz-icon nzType="form" nzTheme="outline" nz-tooltip="修改"></i></a>-->
<a (click)='getForbiddenUser(data.id , data.status)'><i nz-icon nzType="{{data.status === 1 ? 'stop': 'check-circle'}}" nzTheme="outline" nz-tooltip="{{data.status === 1 ? '禁用': '启用'}}"></i></a> <a (click)='getForbiddenUser(data.id , data.status)'><i nz-icon nzType="{{data.status === 1 ? 'stop': 'check-circle'}}" nzTheme="outline" nz-tooltip="{{data.status === 1 ? '禁用': '启用'}}"></i></a>
<!-- <a *ngIf="data.status !== 2 && data.status !== 3 " (click)='getDelete(data.id)'><i nz-icon nzType="delete" nzTheme="outline" nz-tooltip="删除"></i></a>--> <!-- <a *ngIf="data.status !== 2 && data.status !== 3 " (click)='getDelete(data.id)'><i nz-icon nzType="delete" nzTheme="outline" nz-tooltip="删除"></i></a>-->

@ -1,4 +1,4 @@
.head_img { .head_img {
height: 60px; height: 50px;
width: 60px; width: 60px;
} }

@ -1,10 +1,12 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import {UserListComponent} from './user-list/user-list.component'; import {UserListComponent} from './user-list/user-list.component';
import {UserGoldComponent} from './user-gold/user-gold.component';
const routes: Routes = [ const routes: Routes = [
{ path: 'user-list', component: UserListComponent }, { path: 'user-list', component: UserListComponent },
{ path: 'user-gold', component: UserGoldComponent },
]; ];
@NgModule({ @NgModule({

@ -7,10 +7,11 @@ import {NgZorroAntdModule} from 'ng-zorro-antd';
import {SeparateModule} from '../../common/separate/separate.module'; import {SeparateModule} from '../../common/separate/separate.module';
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
import { UserGoldComponent } from './user-gold/user-gold.component';
@NgModule({ @NgModule({
declarations: [UserListComponent], declarations: [UserListComponent, UserGoldComponent],
imports: [ imports: [
CommonModule, CommonModule,
UserRoutingModule, UserRoutingModule,

@ -1,4 +1,4 @@
import { Injectable } from '@angular/core'; import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import {CommonsService} from './commons.service'; import {CommonsService} from './commons.service';
import {environment} from '../../environments/environment'; import {environment} from '../../environments/environment';
@ -12,7 +12,8 @@ export class AgentService {
constructor( constructor(
private http: HttpClient, private http: HttpClient,
private common: CommonsService private common: CommonsService
) { } ) {
}
/** /**
* *
@ -73,7 +74,7 @@ export class AgentService {
* @param callBack * @param callBack
*/ */
public editStatus(id: number, callBack) { public editStatus(id: number, callBack) {
this.http.get(environment.baseUrl + 'highAgent/forbiddenUser?agentId=' + id ).subscribe(data => { this.http.get(environment.baseUrl + 'highAgent/forbiddenUser?agentId=' + id).subscribe(data => {
callBack(data); callBack(data);
}); });
} }
@ -128,4 +129,16 @@ export class AgentService {
}); });
} }
/**
*
*
* @param paramsObject
* @param callBack
*/
public getDiscountCodeList(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'discountAgentRel/getDiscountCodeList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
} }

@ -48,6 +48,18 @@ export class UserService {
}); });
} }
/**
*
*
* @param paramsObject
* @param callBack
*/
public getGoldRecList(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'highGoldRec/getGoldRecList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
/** /**
* *
* *

Loading…
Cancel
Save