合并自建站代码到话费修改

pull/1/head
袁野 3 years ago
commit 8d3c6dd3ec
  1. 10
      src/app/admin/login/login/login.component.ts
  2. 18
      src/app/admin/navigation/navigation.component.ts
  3. 26
      src/app/admin/recharge-order/order-list/order-list.component.html
  4. 291
      src/app/admin/recharge-order/price-list/price-list.component.html
  5. 143
      src/app/admin/recharge-order/price-list/price-list.component.ts
  6. 16
      src/app/app-common.module.ts
  7. 2
      src/app/pipes/index.ts
  8. 6
      src/app/pipes/recharge-price.pipe.ts
  9. 680
      src/app/services/commons.service.ts
  10. 1
      src/app/services/local-storage.namespace.ts
  11. 8
      src/app/services/recharge.service.ts
  12. 8
      src/environments/environment.ts

@ -1,12 +1,13 @@
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {FormGroup, Validators, FormBuilder} from '@angular/forms'; import {FormGroup, Validators, FormBuilder} from '@angular/forms';
import {LoginService} from '../../../services/login.service'; import {LoginService} from '../../../services/login.service';
import {NzModalService} from 'ng-zorro-antd'; import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {ADMIN_INFO_OBJECT, TOKEN, INIT_FLAG, LOGINTYPE} from '../../../services/local-storage.namespace'; import {ADMIN_INFO_OBJECT, TOKEN, INIT_FLAG, LOGINTYPE} from '../../../services/local-storage.namespace';
import {LocalStorageService} from '../../../services/local-storage.service'; import {LocalStorageService} from '../../../services/local-storage.service';
import {Router} from '@angular/router'; import {Router} from '@angular/router';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
@Component({ @Component({
selector: 'app-login', selector: 'app-login',
templateUrl: './login.component.html', templateUrl: './login.component.html',
@ -21,6 +22,7 @@ export class LoginComponent implements OnInit {
private form: FormBuilder, // 表单校验 private form: FormBuilder, // 表单校验
private http: HttpClient, // http请求 private http: HttpClient, // http请求
private loginService: LoginService, private loginService: LoginService,
private message: NzMessageService,
private modal: NzModalService) { private modal: NzModalService) {
} }
@ -55,11 +57,9 @@ export class LoginComponent implements OnInit {
this.store.set(LOGINTYPE, data['return_data']['type']); this.store.set(LOGINTYPE, data['return_data']['type']);
this.router.navigateByUrl('/admin/index').then(); this.router.navigateByUrl('/admin/index').then();
} else { } else {
this.modal.warning({ this.message.error(data['return_msg']);
nzTitle: '提示',
nzContent: data['return_msg']
});
} }
}); });
} }
} }

@ -20,12 +20,11 @@ import {Md5} from 'ts-md5';
import {environment} from '../../../environments/environment'; import {environment} from '../../../environments/environment';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import {CompanyTwoPwdService} from '../../services/company-two-pwd.service'; import {CompanyTwoPwdService} from '../../services/company-two-pwd.service';
import {WebsocketService} from '../../services/websocket.service';
@Component({ @Component({
selector: 'app-navigation', selector: 'app-navigation',
templateUrl: './navigation.component.html', templateUrl: './navigation.component.html',
styleUrls: ['./navigation.component.less'], styleUrls: ['./navigation.component.less']
}) })
export class NavigationComponent implements OnInit { export class NavigationComponent implements OnInit {
@ -47,9 +46,8 @@ export class NavigationComponent implements OnInit {
private companyTwoPwdService: CompanyTwoPwdService, private companyTwoPwdService: CompanyTwoPwdService,
private http: HttpClient, // http请求 private http: HttpClient, // http请求
private iconService: IconService, private iconService: IconService,
private webSocketService: WebsocketService,
private store: LocalStorageService, // 数据请求
private modal: NzModalService, private modal: NzModalService,
private common: CommonsService,
private fb: FormBuilder, // 表单 private fb: FormBuilder, // 表单
private router: Router, private router: Router,
) { ) {
@ -68,12 +66,16 @@ export class NavigationComponent implements OnInit {
this.switchValue = data['return_data']['codeValue'] === '1'; this.switchValue = data['return_data']['codeValue'] === '1';
}); });
this.menuList = this.storage.getList(ADMIN_INFO_OBJECT)['menuList']; // 定义菜单数据 this.menuList = this.storage.getList(ADMIN_INFO_OBJECT)['menuList']; // 定义菜单数据
this.common.getDictionaries(data => {
// 连接websocket if (data['return_code'] === '000000') {
// this.webSocketService.connect(`wss://hsgcs.dctpay.com/msg/WebSocket/` + this.store.get(ADMIN_INFO_OBJECT)['merchantStore'].id); console.log(data);
} else {
this.message.error(data['return_msg']);
}
});
} }
public activeLi(routeName): void { public activeLi(routeName): void {
this.routeName = routeName; this.routeName = routeName;
this.storage.set(ROUTENAME, routeName); this.storage.set(ROUTENAME, routeName);

@ -125,15 +125,15 @@
<div class="inner-content"> <div class="inner-content">
<span>共计 {{total}} 条数据</span> <span>共计 {{total}} 条数据</span>
<div class="operating-button"> <div class="operating-button">
<nz-upload <!-- <nz-upload-->
[nzAccept]="'.xls,.xlsx'" <!-- [nzAccept]="'.xls,.xlsx'"-->
nzAction="{{WEB_SERVE_URL}}outRechargeOrder/importRechargeOrder" <!-- nzAction="{{WEB_SERVE_URL}}outRechargeOrder/importRechargeOrder"-->
[nzHeaders]="{ authorization: 'authorization-text' }" <!-- [nzHeaders]="{ authorization: 'authorization-text' }"-->
(nzChange)="handleChange($event)" <!-- (nzChange)="handleChange($event)"-->
[nzShowUploadList]="false" <!-- [nzShowUploadList]="false"-->
> <!-- >-->
<button nz-button nzType="primary" ><i nz-icon nzType="import" nzTheme="outline"></i>导入充值订单</button> <!-- <button nz-button nzType="primary" ><i nz-icon nzType="import" nzTheme="outline"></i>导入充值订单</button>-->
</nz-upload> <!-- </nz-upload>-->
<button nz-button nzType="primary" class="right-btn" (click)="downloadTemplate(searchForm.value)" ><i nz-icon nzType="download" nzTheme="outline"></i>导出订单</button> <button nz-button nzType="primary" class="right-btn" (click)="downloadTemplate(searchForm.value)" ><i nz-icon nzType="download" nzTheme="outline"></i>导出订单</button>
</div> </div>
<nz-table <nz-table
@ -189,8 +189,8 @@
<td nzRight>{{data.status | rechargeStatus}}</td> <td nzRight>{{data.status | rechargeStatus}}</td>
<td nzRight class="table-td-operation"> <td nzRight class="table-td-operation">
<a (click)="getDetail(data.id)">详情</a> <a (click)="getDetail(data.id)">详情</a>
<a *ngIf="data.rechargeStatus === 1" (click)="getMobileRechargeByOrderId(data.id)">再次充值</a> <!-- <a *ngIf="data.rechargeStatus === 1" (click)="getMobileRechargeByOrderId(data.id)">再次充值</a>-->
<a *ngIf="data.status === 2" (click)="postRefund(data.orderNo)">申请退款</a> <!-- <a *ngIf="data.status === 2" (click)="postRefund(data.orderNo)">申请退款</a>-->
</td> </td>
</tbody> </tbody>
</nz-table> </nz-table>
@ -215,10 +215,6 @@
<nz-descriptions-item *ngIf="data['refundTime'] != null" nzTitle="退款时间">{{data['refundTime'] | date: 'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item> <nz-descriptions-item *ngIf="data['refundTime'] != null" nzTitle="退款时间">{{data['refundTime'] | date: 'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="状态">{{data['status'] | rechargeStatus}}</nz-descriptions-item> <nz-descriptions-item nzTitle="状态">{{data['status'] | rechargeStatus}}</nz-descriptions-item>
</nz-descriptions> </nz-descriptions>
<!-- <div *nzModalFooter>-->
<!-- <button nz-button nzType="default" (click)="handleCancel()">取消</button>-->
<!-- <button nz-button *ngIf="data['status'] === 2" nzType="primary" (click)="finishOrder(id)">完成充值</button>-->
<!-- </div>-->
</nz-modal> </nz-modal>
<nz-modal [(nzVisible)]="errorStudentVisible" nzTitle="导入失败数据" (nzOnCancel)="errorStudentVisible = false" nzWidth="1200px" [nzFooter]="null"> <nz-modal [(nzVisible)]="errorStudentVisible" nzTitle="导入失败数据" (nzOnCancel)="errorStudentVisible = false" nzWidth="1200px" [nzFooter]="null">

@ -9,24 +9,23 @@
<div nz-col nzSpan="8"> <div nz-col nzSpan="8">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6">金额类型</nz-form-label> <nz-form-label [nzSpan]="6">运营商</nz-form-label>
<nz-form-control [nzSpan]="16"> <nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="type" nzPlaceHolder="请选择金额类型"> <nz-select nzShowSearch nzAllowClear formControlName="operatorType" nzPlaceHolder="请选择运营商">
<nz-option nzLabel="电信充值" nzValue="1"></nz-option> <nz-option nzLabel="电信运营商" nzValue="1"></nz-option>
<nz-option nzLabel="移动充值" nzValue="2"></nz-option> <nz-option nzLabel="移动运营商" nzValue="2"></nz-option>
<nz-option nzLabel="联通充值" nzValue="3"></nz-option> <nz-option nzLabel="联通运营商" nzValue="3"></nz-option>
</nz-select> </nz-select>
</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 [nzSpan]="6">展示区域</nz-form-label> <nz-form-label [nzSpan]="6">充值平台</nz-form-label>
<nz-form-control [nzSpan]="16"> <nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="showType" nzPlaceHolder="请选择展示区域"> <nz-select nzShowSearch nzAllowClear formControlName="rechargePlatform" nzPlaceHolder="请选择充值平台">
<nz-option nzLabel="小程序" [nzValue]="1"></nz-option> <nz-option nzLabel="尖椒" [nzValue]="1"></nz-option>
<nz-option nzLabel="H5" [nzValue]="2"></nz-option> <nz-option nzLabel="龙阅" [nzValue]="2"></nz-option>
<nz-option nzLabel="银联" [nzValue]="3"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
@ -42,6 +41,42 @@
</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 [nzSpan]="6">展示平台</nz-form-label>-->
<!-- <nz-form-control [nzSpan]="16">-->
<!-- <nz-select nzShowSearch nzAllowClear formControlName="rechargeType" nzPlaceHolder="请选择充值类型">-->
<!-- <nz-option nzLabel="小程序" [nzValue]="1"></nz-option>-->
<!-- <nz-option nzLabel="H5" [nzValue]="2"></nz-option>-->
<!-- <nz-option nzLabel="银联" [nzValue]="3"></nz-option>-->
<!-- </nz-select>-->
<!-- </nz-form-control>-->
<!-- </nz-form-item>-->
<!-- </div>-->
<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="rechargeWay" 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 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="rechargeWay" nzPlaceHolder="请选择价格状态">
<nz-option nzLabel="正常" [nzValue]="1"></nz-option>
<nz-option nzLabel="售空" [nzValue]="2"></nz-option>
<nz-option nzLabel="编辑中" [nzValue]="3"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div> </div>
@ -73,35 +108,46 @@
[nzTotal]="total" [nzTotal]="total"
[(nzPageIndex)]="pageNum" [(nzPageIndex)]="pageNum"
[(nzPageSize)]="pageSize" [(nzPageSize)]="pageSize"
[nzScroll]="{ x: '1200px' }"
(nzPageIndexChange)="getRequest(false , searchForm.value)" (nzPageIndexChange)="getRequest(false , searchForm.value)"
(nzPageSizeChange)="getRequest(false , searchForm.value)"> (nzPageSizeChange)="getRequest(false , searchForm.value)">
<thead nzSingleSort> <thead nzSingleSort>
<tr> <tr>
<th>编号</th> <th nzWidth="60px">编号</th>
<th>金额类型</th> <th nzWidth="90px">充值金额</th>
<th>充值类型</th> <th nzWidth="90px">折扣比例</th>
<th>展示区域</th> <th nzWidth="90px">支付金额</th>
<!-- <th>供货商编号</th>--> <th nzWidth="120px">积分抵扣比例</th>
<!-- <th>商品ID</th>--> <th nzWidth="120px">运营商</th>
<th>充值金额</th> <th nzWidth="90px">充值类型</th>
<th>支付金额</th> <th nzWidth="100px">充值平台</th>
<th>创建时间</th> <th nzWidth="100px">支付方式</th>
<th>操作</th> <th nzWidth="100px">展示平台</th>
<th nzWidth="80px">商品ID</th>
<th nzWidth="120px">创建时间</th>
<th nzRight nzWidth="80px">状态</th>
<th nzRight nzWidth="160px">操作</th>
</tr> </tr>
</thead> </thead>
<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.type | rechargePrice}}</td> <td>{{data.rechargePrice}}</td>
<td>{{data.discount + "%"}}</td>
<td>{{data.payPrice}}</td>
<td>{{data.integralDiscount + "%"}}</td>
<td>{{data.operatorType | rechargePrice}}</td>
<td>{{data.rechargeType== 1? '快充':'慢充'}}</td> <td>{{data.rechargeType== 1? '快充':'慢充'}}</td>
<td>{{data.showType | showType}}</td> <td>{{data.rechargePlatform | rechargePlatform}}</td>
<td>{{data.price}}</td> <td>{{data.productPayTypeString.substring(0 , data.productPayTypeString.length - 1)}}</td>
<td>{{data.realPrice}}</td> <td>{{data.productPlatformString.substring(0 , data.productPlatformString.length - 1)}}</td>
<td>{{data.goodsId == null ? '暂未配置' : data.goodsId}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td class="table-td-operation"> <td nzRight="">{{data.status | priceStatus}}</td>
<a (click)="getEdit(data.id)">编辑</a> <td nzRight class="table-td-operation">
<a style="margin-left: 20px;" (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 1 ? '禁用': '启用'}}</a> <a *ngIf="data.status != 1" (click)="getEdit(data.id)">编辑</a>
<a style="margin-left: 20px;" (click)="getForbiddenUserD(data.id)">删除</a> <a style="margin-left: 20px;" (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 1 ? '售空': '上线'}}</a>
<a *ngIf="data.status != 1" style="margin-left: 20px;" (click)="getForbiddenUserD(data.id)">删除</a>
</td> </td>
</tbody> </tbody>
</nz-table> </nz-table>
@ -112,24 +158,80 @@
<nz-form-item *ngIf="!edit"> <nz-form-item *ngIf="!edit">
<nz-form-label [nzSpan]="6" nzRequired>金额类型</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired>金额类型</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择类型!"> <nz-form-control [nzSpan]="16" nzErrorTip="请选择类型!">
<nz-select nzShowSearch nzAllowClear formControlName="type" nzPlaceHolder="请选择类型"> <nz-select
<nz-option nzLabel="电信充值" nzValue="1"></nz-option> nzMode="multiple"
<nz-option nzLabel="移动充值" nzValue="2"></nz-option> formControlName="rechargePrices"
<nz-option nzLabel="联通充值" nzValue="3"></nz-option> nzPlaceHolder="请选择充值金额"
>
<nz-option *ngFor="let item of priceArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select> </nz-select>
<input *ngIf="edit" readonly nz-input formControlName="rechargePrice" />
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item > <nz-form-item *ngIf="edit">
<nz-form-label [nzSpan]="6" nzRequired>展示区域</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired>充值金额</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择展示区域!"> <nz-form-control [nzSpan]="16" nzErrorTip="请输入充值金额!">
<nz-select nzShowSearch nzAllowClear formControlName="showType" nzPlaceHolder="请选择展示区域"> <input readonly nz-input formControlName="rechargePrice" />
<nz-option nzLabel="小程序" [nzValue] ="1"></nz-option> </nz-form-control>
<nz-option nzLabel="H5" [nzValue] ="2"></nz-option> </nz-form-item>
<nz-option nzLabel="银联" [nzValue] ="3"></nz-option> <nz-form-item *ngIf="edit">
<nz-form-label [nzSpan]="6" nzRequired>支付金额</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入支付金额!">
<input readonly nz-input formControlName="payPrice" [(ngModel)]="payPrice" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>运营商</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择运营商!">
<nz-select nzShowSearch nzAllowClear formControlName="operatorType" nzPlaceHolder="请选择运营商!">
<nz-option nzLabel="电信运营商" [nzValue]="1"></nz-option>
<nz-option nzLabel="移动运营商" [nzValue]="2"></nz-option>
<nz-option nzLabel="联通运营商" [nzValue]="3"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item > <nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>展示平台</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择展示平台!">
<nz-select
nzMode="multiple"
formControlName="productPlatform"
nzPlaceHolder="请选择展示平台"
>
<nz-option *ngFor="let item of productPlatformArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>充值平台</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择充值平台!">
<nz-select nzShowSearch nzAllowClear nzMode="multiple" formControlName="rechargePlatform" nzPlaceHolder="请选择充值平台">
<nz-option *ngFor="let item of platformArray" [nzValue]="item.codeValue" [nzLabel]="item.codeName"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>支付方式</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择支付方式!">
<nz-select
nzMode="multiple"
formControlName="payType"
nzPlaceHolder="请选择支付方式"
>
<nz-option *ngFor="let item of priceTypeArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>充值方式</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择充值方式!">
<nz-select nzShowSearch nzAllowClear formControlName="rechargeWay" nzPlaceHolder="请选择充值方式">
<nz-option nzLabel="自动" [nzValue]="1"></nz-option>
<nz-option nzLabel="手动" [nzValue]="2"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>充值类型</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired>充值类型</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择充值类型!"> <nz-form-control [nzSpan]="16" nzErrorTip="请选择充值类型!">
<nz-select nzShowSearch nzAllowClear formControlName="rechargeType" nzPlaceHolder="请选择充值类型"> <nz-select nzShowSearch nzAllowClear formControlName="rechargeType" nzPlaceHolder="请选择充值类型">
@ -139,73 +241,66 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>商品排序</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired>折扣比例</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入商品排序!"> <nz-form-control [nzSpan]="16" nzErrorTip="请输入折扣比例!">
<input [type]="'number'" nz-input formControlName="sort" /> <nz-input-number
style="width: 200px"
formControlName="discount"
[nzMin]="1"
[nzMax]="100"
[nzStep]="1"
[nzPrecision]="2"
nzPrecisionMode="cut"
(ngModelChange)="changePayType($event)"
nzPlaceHolder="请输入折扣比例!"
[nzFormatter]="formatterPercent"
[nzParser]="parserPercent"
></nz-input-number>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<!-- <nz-form-item>-->
<!-- <nz-form-label [nzSpan]="6" nzRequired>供货商编号</nz-form-label>-->
<!-- <nz-form-control [nzSpan]="16" nzErrorTip="请输入供货商编号!">-->
<!-- <input [type]="'number'" nz-input formControlName="channel" />-->
<!-- </nz-form-control>-->
<!-- </nz-form-item>-->
<!-- <nz-form-item>-->
<!-- <nz-form-label [nzSpan]="6" nzRequired>商品ID</nz-form-label>-->
<!-- <nz-form-control [nzSpan]="16" nzErrorTip="请输入商品ID!">-->
<!-- <input [type]="'number'" nz-input formControlName="goodsId" />-->
<!-- </nz-form-control>-->
<!-- </nz-form-item>-->
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>充值金额</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired>积分支付比例</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入充值金额!"> <nz-form-control [nzSpan]="16" nzErrorTip="请输入积分支付比例!">
<nz-input-group nzSuffix="RMB" nzPrefix="¥"> <nz-input-number
<input [type]="'number'" (ngModelChange)="getPrice()" nz-input formControlName="price" /> style="width: 200px"
</nz-input-group> formControlName="integralDiscount"
[nzMin]="0"
[nzMax]="100"
[nzStep]="1"
[nzPrecision]="2"
nzPrecisionMode="cut"
nzPlaceHolder="请输入积分支付比例!"
[nzFormatter]="formatterPercent"
[nzParser]="parserPercent"
></nz-input-number>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item *ngIf="edit">
<nz-form-label [nzSpan]="6" nzRequired>折扣比例</nz-form-label> <nz-form-label [nzSpan]="6" >商品编号</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入折扣比例!"> <nz-form-control [nzSpan]="16" nzErrorTip="请输入商品编号!">
<nz-input-group nzSuffix="%" > <nz-input-number
<input [type]="'number'" (ngModelChange)="getPrice()" nz-input formControlName="discount" /> style="width: 200px"
</nz-input-group> formControlName="goodsId"
[nzMin]="1"
[nzMax]="10000"
[nzStep]="1"
nzPlaceHolder="请输入商品编号!"
></nz-input-number>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item *ngIf="edit">
<nz-form-label [nzSpan]="6" nzRequired>支付金额</nz-form-label> <nz-form-label [nzSpan]="6" >排序</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入支付金额!"> <nz-form-control [nzSpan]="16" nzErrorTip="请输入排序!">
<nz-input-group nzSuffix="RMB" nzPrefix="¥"> <nz-input-number
<input [type]="'number'" nz-input [(ngModel)]="realPrice" formControlName="realPrice" /> style="width: 200px"
</nz-input-group> formControlName="sort"
[nzMin]="1"
[nzMax]="100"
[nzStep]="1"
nzPlaceHolder="请输入排序!"
></nz-input-number>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</form> </form>
</nz-modal> </nz-modal>
<nz-modal [(nzVisible)]="isVisibleGoods" nzWidth="900" nzTitle="渠道商获取关联商品" (nzOnCancel)="handleCancelGoods()" (nzOnOk)="handleCancelGoods()">
<nz-table #basicTable [nzData]="goodsArray">
<thead>
<tr>
<th>供货商编号</th>
<th>商品ID</th>
<th>渠道商标识符</th>
<th>折扣比例</th>
<th>商品名称</th>
<th>渠道商名称</th>
<th>状态</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>{{data.channel}}</td>
<td>{{data.goodsId}}</td>
<td>{{data.channelMark | channelMark}}</td>
<td>{{data.discountRatio}}%</td>
<td>{{data.goodsName}}</td>
<td>{{data.memberName}}</td>
<td>{{data.state == 1 ? '上架' : '下架'}}</td>
</tr>
</tbody>
</nz-table>
</nz-modal>

@ -19,6 +19,10 @@ export class PriceListComponent implements OnInit {
searchForm: FormGroup; // 搜索框 searchForm: FormGroup; // 搜索框
validateForm: FormGroup; // 添加框 validateForm: FormGroup; // 添加框
requestData = []; // 列表数据 requestData = []; // 列表数据
priceArray = []; // 价格数据
priceTypeArray = []; // 支付类型数据
platformArray = []; // 充值平台数据
productPlatformArray = []; // 展示平台数据
total: number; // 页码 total: number; // 页码
pageNum = 1; // 页码 pageNum = 1; // 页码
@ -27,10 +31,13 @@ export class PriceListComponent implements OnInit {
isVisible = false; isVisible = false;
id: number; id: number;
edit = false; edit = false;
payPrice;
isVisibleGoods = false; isVisibleGoods = false;
realPrice = 0; realPrice = 0;
goodsArray;
formatterPercent = (value: number): string => `${value == null ? 0 : value} %`;
parserPercent = (value: string): string => value.replace(' %', '');
constructor( constructor(
private form: FormBuilder, private form: FormBuilder,
private recharge: RechargeService, private recharge: RechargeService,
@ -45,23 +52,53 @@ export class PriceListComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.init(); this.init();
this.getInitData();
}
// 获取初始化数据
private getInitData(): void {
// 获取价格数据
this.common.getDictionary('RECHARGE_AMOUNT ', data => {
this.priceArray = data['return_data'];
});
// 获取支付类型
this.common.getDictionary('PAY_TYPE ', data => {
this.priceTypeArray = data['return_data'];
});
// 获取充值平台
this.common.getDictionary('RECHARGE_PLATFORM ', data => {
this.platformArray = data['return_data'];
});
// 获取展示平台
this.common.getDictionary('SHOW_PLATFORM ', data => {
this.productPlatformArray = data['return_data'];
});
} }
public init(): void { public init(): void {
this.searchForm = this.form.group({ this.searchForm = this.form.group({
type: [null], operatorType : [null],
rechargePlatform: [null],
rechargeType: [null], rechargeType: [null],
showType: [null], rechargeWay: [null],
status: [null],
}); });
this.validateForm = this.form.group({ this.validateForm = this.form.group({
type: [null, [Validators.required]],
showType: [null, [Validators.required]],
price: [null, [Validators.required]],
rechargeType: [null, [Validators.required]],
realPrice: [{value: null, disabled: true}, [Validators.required]],
discount: [null, [Validators.required]], discount: [null, [Validators.required]],
sort: [null, [Validators.required]], integralDiscount: [0],
// channel: [null, [Validators.required]], operatorType: [null, [Validators.required]],
rechargePrices: [null, [Validators.required]],
productPlatform: [null, [Validators.required]],
rechargeType: [null, [Validators.required]],
rechargePlatform: [null, [Validators.required]],
rechargeWay: [null, [Validators.required]],
payType: [null, [Validators.required]],
rechargePrice: [null],
payPrice: [null],
sort: [null],
goodsId: [null],
}); });
@ -98,6 +135,10 @@ export class PriceListComponent implements OnInit {
this.id = id; this.id = id;
this.edit = true; this.edit = true;
this.recharge.findById(id, data => { this.recharge.findById(id, data => {
data['return_data']['productPlatform'] = data['return_data']['productPlatformString'].substring(0 , data['return_data']['productPlatformString'].length - 1).split(',');
data['return_data']['rechargePlatform'] = data['return_data']['rechargePlatform'].substring(1 , data['return_data']['rechargePlatform'].length - 1).split('-');
data['return_data']['payType'] = data['return_data']['productPayTypeString'].substring(0 , data['return_data']['productPayTypeString'].length - 1).split(',');
data['return_data']['rechargePrices'] = ['1'];
this.validateForm.patchValue(data['return_data']); this.validateForm.patchValue(data['return_data']);
this.isVisible = true; this.isVisible = true;
}); });
@ -108,17 +149,8 @@ export class PriceListComponent implements OnInit {
} }
} }
// 查看详情
public getDetail(id: number): void {
this.router.navigate(['/admin/company/company-detail'], {
queryParams: {
companyId: id
}
}).then(r => console.log(r));
}
handleOk(): void { handleOk(): void {
const wait = this.message.loading('提交中..', { nzDuration: 0 }).messageId;
// tslint:disable-next-line:forin // tslint:disable-next-line:forin
for (const i in this.validateForm.controls) { for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty(); this.validateForm.controls[i].markAsDirty();
@ -128,14 +160,15 @@ export class PriceListComponent implements OnInit {
return; return;
} }
} }
this.validateForm.value.realPrice = this.validateForm.value.price * this.validateForm.value.discount / 100;
if (this.edit) { if (this.edit) {
this.validateForm.value['id'] = this.id; this.validateForm.value['id'] = this.id;
this.recharge.updatePrice(this.validateForm.value, data => { this.recharge.updatePrice(this.validateForm.value, data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.message.remove(wait);
this.message.success('修改成功'); this.message.success('修改成功');
this.getRequest(false, this.searchForm.value); this.getRequest(false, this.searchForm.value);
this.validateForm.reset();
this.isVisible = false; this.isVisible = false;
} else { } else {
this.message.error(data['return_msg']); this.message.error(data['return_msg']);
@ -144,9 +177,11 @@ export class PriceListComponent implements OnInit {
} else { } else {
this.recharge.insertPrice(this.validateForm.value, data => { this.recharge.insertPrice(this.validateForm.value, data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.message.remove(wait);
this.message.success('添加成功'); this.message.success('添加成功');
this.getRequest(false, this.searchForm.value); this.getRequest(false, this.searchForm.value);
this.isVisible = false; this.isVisible = false;
this.validateForm.reset();
} else { } else {
this.message.error(data['return_msg']); this.message.error(data['return_msg']);
} }
@ -156,35 +191,59 @@ export class PriceListComponent implements OnInit {
} }
handleCancel(): void { handleCancel(): void {
this.validateForm.reset();
this.isVisible = false; this.isVisible = false;
} }
handleCancelGoods(): void {
this.isVisibleGoods = false;
}
public getForbiddenUser(id, status: any): void {
const message = (status === 1 ? '是否禁用' : '是否启用'); public getForbiddenUser(idPost, status: any): void {
let statusPost;
let message;
this.common.showConfirm(message, data => { switch (status) {
if (data) { case 1:
this.recharge.onAndOffShelves(id, dataUser => { statusPost = 2;
if (dataUser['return_code'] === '000000') { message = '是否售空';
this.message.success('操作成功'); break;
this.getRequest(false , this.searchForm.value); case 2:
statusPost = 1;
message = '是否上线';
break;
case 3:
statusPost = 1;
message = '是否上线';
break;
}
this.common.showConfirm(message, item => {
if (item) {
this.recharge.editPriceStatus( {
id: idPost,
status: statusPost
}, data => {
if (data['return_code'] === '000000') {
this.message.success('提交成功');
this.getRequest(false, this.searchForm.value);
} else { } else {
this.message.error(dataUser['return_msg']); this.message.error(data['return_msg']);
} }
}); });
} }
}); });
console.log(status);
console.log(statusPost);
console.log(message);
} }
public getForbiddenUserD(id): void { public getForbiddenUserD(idPost): void {
this.common.showConfirm('是否删除', item => { this.common.showConfirm('是否删除', item => {
if (item) { if (item) {
this.recharge.deletePrice(id, data => { this.recharge.editPriceStatus({
id: idPost,
status: 0
}, data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.message.success('删除成功'); this.message.success('删除成功');
this.getRequest(false, this.searchForm.value); this.getRequest(false, this.searchForm.value);
@ -196,17 +255,9 @@ export class PriceListComponent implements OnInit {
}); });
} }
public getMemberGoods(): void { public changePayType(e): void {
this.isVisibleGoods = true; this.payPrice = this.validateForm.value['rechargePrice'] * e / 100;
this.recharge.getMemberGoods(data => {
this.goodsArray = data['return_data']['data'];
});
} }
public getPrice(): void {
this.realPrice = this.validateForm.value.price * this.validateForm.value.discount / 100;
}
} }

@ -41,15 +41,11 @@ import {
CompanyAmountRecordTypePipe, CompanyAmountRecordTypePipe,
CompanyAmountRecordSourceTypePipe, CompanyAmountRecordSourceTypePipe,
OilCardBindStatusPipe, OilCardBindStatusPipe,
OilCardRecordTypePipe, OilCardRecordSourceTypePipe OilCardRecordTypePipe, OilCardRecordSourceTypePipe, RechargePlatformPipe, PriceStatusPipe
} from './pipes'; } from './pipes';
import {OilCardStatusPipe} from './pipes/oil-card/oil-card-status.pipe'; import {OilCardStatusPipe} from './pipes';
import { OilTypePipe } from './pipes/store/oil-type.pipe'; import { OilTypePipe } from './pipes/store/oil-type.pipe';
import {GasStaffStatusPipe} from './pipes/gas-staff/gas-staff-status.pipe'; import {GasStaffStatusPipe} from './pipes';
const PIPES = [ const PIPES = [
TimesPipe, TimesPipe,
@ -88,6 +84,10 @@ const PIPES = [
OilCardRecordTypePipe, OilCardRecordTypePipe,
OilCardRecordSourceTypePipe, OilCardRecordSourceTypePipe,
GasStaffStatusPipe, GasStaffStatusPipe,
OilTypePipe,
RechargePlatformPipe,
PriceStatusPipe,
]; ];
@ -101,8 +101,6 @@ const PIPES = [
], ],
declarations: [ declarations: [
...PIPES, ...PIPES,
OilTypePipe,
], ],
exports: [ exports: [

@ -33,3 +33,5 @@ export * from './oil-card/oil-card-bind-status.pipe';
export * from './oil-card/oil-card-record-type.pipe'; export * from './oil-card/oil-card-record-type.pipe';
export * from './oil-card/oil-card-record-source-type.pipe'; export * from './oil-card/oil-card-record-source-type.pipe';
export * from './gas-staff/gas-staff-status.pipe'; export * from './gas-staff/gas-staff-status.pipe';
export * from './recharge-price/recharge-platform.pipe';
export * from './recharge-price/price-status.pipe';

@ -8,11 +8,11 @@ export class RechargePricePipe implements PipeTransform {
transform(value: number): string { transform(value: number): string {
switch (value) { switch (value) {
case 1: case 1:
return '电信充值'; return '电信运营商';
case 2: case 2:
return '移动充值'; return '移动运营商';
case 3: case 3:
return '联通充值'; return '联通运营商';
} }
} }

@ -6,353 +6,365 @@ import {environment} from '../../environments/environment';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class CommonsService { export class CommonsService {
constructor( constructor(
private storage: LocalStorageService, private storage: LocalStorageService,
private modalService: NzModalService, // 对话框 private modalService: NzModalService, // 对话框
private http: HttpClient, private http: HttpClient,
private notification: NzNotificationService private notification: NzNotificationService
) { } ) {
}
/**
* GET请求参数 key1=value1&key2=value2 /**
* @param object * GET请求参数 key1=value1&key2=value2
*/ * @param object
getWhereCondition(object: object): string { */
let str = ''; getWhereCondition(object: object): string {
for (const i in object) { let str = '';
if (object[i] != null && object[i] !== '') { for (const i in object) {
if (str === '') { if (object[i] != null && object[i] !== '') {
str = i + '=' + object[i]; if (str === '') {
} else { str = i + '=' + object[i];
str += '&' + i + '=' + object[i]; } else {
str += '&' + i + '=' + object[i];
}
}
}
return str;
}
/**
*
* @param btnCode
*/
public isBtnCompetence(btnCode: string): boolean {
let buttonList = [];
buttonList = this.storage.get(DATA).buttonList;
if (buttonList != null && buttonList.length > 0) {
if (buttonList.find(b => b.permissionCode === btnCode) != null) {
return true;
}
}
return false;
}
/**
*
* @param message
* @param callback
*/
public showConfirm(message, callback) {
this.modalService.confirm({
nzTitle: message,
nzOkText: '是',
nzOkType: 'danger',
nzOnOk: () => callback(true),
nzCancelText: '否',
});
}
/**
* estateId
*
* @param estateId id
* @param callBack
*/
public getMallCategoryTree(estateId: number, callBack) {
this.http.get(environment.baseUrl + 'categoryEstates/getMallCategoryTree?estateId=' + estateId).subscribe(data => {
callBack(data);
});
}
/**
*
* @param callBack
*/
public getParentInfosByRegionId(regionId: number, callBack) {
this.http.get(environment.baseUrl + 'common/getParentInfosByRegionId?regionId=' + regionId).subscribe(data => {
callBack(data);
});
}
/**
*
* @param callBack
*/
public getAllRegion(callBack) {
this.http.get(environment.baseUrl + 'common/getAllProvinceAndCity').subscribe(data => {
callBack(data);
});
}
/**
*
* @param callBack
*/
public getAllProvinceAndCityRegion(callBack) {
this.http.get(environment.baseUrl + 'common/getAllProvinceAndCityRegion').subscribe(data => {
callBack(data);
});
}
/**
*
* @param callBack
*/
public getAllIndustry(callBack) {
this.http.get(environment.baseUrl + 'secCompanyIndustry/findIndustryTree').subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param object
*/
public getUniqueObject<T>(object: any): any {
const map = {};
// 1、把数组元素作为对象的键存起来(这样就算有重复的元素,也会相互替换掉)
object.forEach(item => map[JSON.stringify(item)] = item);
// 2、再把对象的值抽成一个数组返回即为不重复的集合
return Object.keys(map).map(key => map[key]) as T[];
}
/**
* String
*
* @param name String
*/
public getStringIsNull<T>(name: string): boolean {
if (name == null) {
return true;
} }
} if (name === '') {
return true;
}
}
/**
*
*
* @param phone String
*/
public verifyPhone<T>(phone: string): boolean {
return phone.length === 11;
}
/**
*
*
* @param codeType
* @param callback
*/
public getDictionary(codeType: string, callback): any {
this.http.get(environment.baseUrl + '/common/getDictionaryByCodeType?codeType=' + codeType).subscribe(data => {
callback(data);
});
} }
return str;
} public mappingSysNameOl(codeType: string, callback): any {
this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeOl?codeType=' + codeType).subscribe(data => {
/** callback(data);
* });
* @param btnCode
*/
public isBtnCompetence(btnCode: string): boolean {
let buttonList = [];
buttonList = this.storage.get(DATA).buttonList;
if (buttonList != null && buttonList.length > 0) {
if (buttonList.find(b => b.permissionCode === btnCode) != null) {
return true;
}
} }
return false;
} public updateDictionary(codeType: string, codeValue: string, callback): any {
this.http.get(environment.baseUrl + '/common/updateDictionary?codeType=' + codeType + '&codeValue=' + codeValue).subscribe(data => {
/** callback(data);
* });
* @param message
* @param callback
*/
public showConfirm(message , callback) {
this.modalService.confirm({
nzTitle: message,
nzOkText: '是',
nzOkType: 'danger',
nzOnOk: () => callback(true),
nzCancelText: '否',
});
}
/**
* estateId
*
* @param estateId id
* @param callBack
*/
public getMallCategoryTree(estateId: number , callBack) {
this.http.get(environment.baseUrl + 'categoryEstates/getMallCategoryTree?estateId=' + estateId).subscribe(data => {
callBack(data);
});
}
/**
*
* @param callBack
*/
public getParentInfosByRegionId(regionId: number, callBack) {
this.http.get(environment.baseUrl + 'common/getParentInfosByRegionId?regionId=' + regionId).subscribe(data => {
callBack(data);
});
}
/**
*
* @param callBack
*/
public getAllRegion(callBack) {
this.http.get(environment.baseUrl + 'common/getAllProvinceAndCity').subscribe(data => {
callBack(data);
});
}
/**
*
* @param callBack
*/
public getAllProvinceAndCityRegion(callBack) {
this.http.get(environment.baseUrl + 'common/getAllProvinceAndCityRegion').subscribe(data => {
callBack(data);
});
}
/**
*
* @param callBack
*/
public getAllIndustry(callBack) {
this.http.get(environment.baseUrl + 'secCompanyIndustry/findIndustryTree').subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param object
*/
public getUniqueObject<T>(object: any): any {
const map = {};
// 1、把数组元素作为对象的键存起来(这样就算有重复的元素,也会相互替换掉)
object.forEach(item => map[JSON.stringify(item)] = item);
// 2、再把对象的值抽成一个数组返回即为不重复的集合
return Object.keys(map).map(key => map[key]) as T[];
}
/**
* String
*
* @param name String
*/
public getStringIsNull<T>(name: string): boolean {
if (name == null) {
return true;
}
if (name === '') {
return true;
}
}
/**
*
*
* @param phone String
*/
public verifyPhone<T>(phone: string): boolean {
return phone.length === 11;
}
/**
*
*
* @param codeType
* @param callback
*/
public getDictionary(codeType: string , callback): any {
this.http.get(environment.baseUrl + '/common/getDictionaryByCodeType?codeType=' + codeType).subscribe( data => {
callback(data);
});
}
public mappingSysNameOl(codeType: string , callback): any {
this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeOl?codeType=' + codeType).subscribe( data => {
callback(data);
});
}
public updateDictionary(codeType: string , codeValue: string , callback): any {
this.http.get(environment.baseUrl + '/common/updateDictionary?codeType=' + codeType + '&codeValue=' + codeValue).subscribe( data => {
callback(data);
});
}
/**
*
*
*
* @param callback
*/
getAllJobType(callback) {
this.http.get('assets/json/jobType.json').subscribe( data => {
callback(data);
});
}
/**
*
* timestamp: 时间戳
* formatformatArr里保持一致
*/
public formatTime(timestamp: number, format: string) {
const formatArr = ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss'];
const returnArr = [];
const date = new Date(timestamp);
returnArr.push(date.getFullYear());
returnArr.push(this.formatNumber(date.getMonth() + 1));
returnArr.push(this.formatNumber(date.getDate()));
returnArr.push(this.formatNumber(date.getHours()));
returnArr.push(this.formatNumber(date.getMinutes()));
returnArr.push(this.formatNumber(date.getSeconds()));
// tslint:disable-next-line:forin
for (const i in returnArr) {
format = format.replace(formatArr[i], returnArr[i]);
} }
return format;
} /**
*
// 数据转化 *
formatNumber(n) { *
n = n.toString(); * @param callback
return n[1] ? n : '0' + n; */
} getAllJobType(callback) {
this.http.get('assets/json/jobType.json').subscribe(data => {
/** callback(data);
* Notification通知提醒框 });
* }
* @param type
* @param title /**
* @param content *
*/ * timestamp: 时间戳
public createNotification(type: string , title: string , content: string): void { * formatformatArr里保持一致
this.notification.create( */
type, public formatTime(timestamp: number, format: string) {
title,
content const formatArr = ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss'];
); const returnArr = [];
} const date = new Date(timestamp);
/** returnArr.push(date.getFullYear());
* key查询value returnArr.push(this.formatNumber(date.getMonth() + 1));
* returnArr.push(this.formatNumber(date.getDate()));
* @param value string
* @param object object returnArr.push(this.formatNumber(date.getHours()));
* @param callback returnArr.push(this.formatNumber(date.getMinutes()));
*/ returnArr.push(this.formatNumber(date.getSeconds()));
public positionKeyValue<T>(value: string , object: Array<any> , callback): void {
// tslint:disable-next-line:forin // tslint:disable-next-line:forin
for (const i in object) { for (const i in returnArr) {
if (object[i].value === value) { format = format.replace(formatArr[i], returnArr[i]);
callback(object[i].label); }
} else { return format;
this.positionKeyValue(value , object[i].children , callback); }
}
// 数据转化
formatNumber(n) {
n = n.toString();
return n[1] ? n : '0' + n;
}
/**
* Notification通知提醒框
*
* @param type
* @param title
* @param content
*/
public createNotification(type: string, title: string, content: string): void {
this.notification.create(
type,
title,
content
);
}
/**
* key查询value
*
* @param value string
* @param object object
* @param callback
*/
public positionKeyValue<T>(value: string, object: Array<any>, callback): void {
// tslint:disable-next-line:forin
for (const i in object) {
if (object[i].value === value) {
callback(object[i].label);
} else {
this.positionKeyValue(value, object[i].children, callback);
}
}
}
/**
*
*
* @param codeType
* @param codeValue value
* @param callback
*/
public getDictionaryByCodeTypeAndValue(codeType: string, codeValue: string, callback): any {
this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeAndValue?codeType=' + codeType + '&codeValue=' + codeValue).subscribe(data => {
callback(data);
});
}
/**
*
*
* @param codeType
* @param codeValue value
* @param callback
*/
public getDictionaryByCodeTypeAndValuePromise(codeType: string, codeValue: string): any {
return new Promise(resolve => {
this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeAndValue?codeType=' + codeType + '&codeValue=' + codeValue).subscribe(data => {
resolve(data['return_data']['codeName']);
});
});
} }
}
/**
*
*
* @param codeType
* @param codeValue value
* @param callback
*/
public getDictionaryByCodeTypeAndValue(codeType: string , codeValue: string , callback): any {
this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeAndValue?codeType=' + codeType + '&codeValue=' + codeValue).subscribe( data => {
callback(data);
});
}
/**
*
*
* @param codeType
* @param codeValue value
* @param callback
*/
public getDictionaryByCodeTypeAndValuePromise(codeType: string , codeValue: string): any {
return new Promise(resolve => {
this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeAndValue?codeType=' + codeType + '&codeValue=' + codeValue).subscribe(data => {
resolve(data['return_data']['codeName']);
});
});
}
/** /**
* *
* @param param * @param param
* @param callback * @param callback
*/ */
public getHomeCompanyList(param: object, callback): any { public getHomeCompanyList(param: object, callback): any {
this.http.get(environment.baseUrl + 'common/getHomeCompanyList?' + this.getWhereCondition(param)).subscribe( data => { this.http.get(environment.baseUrl + 'common/getHomeCompanyList?' + this.getWhereCondition(param)).subscribe(data => {
callback(data); callback(data);
}); });
} }
/** /**
* *
* *
* @param params * @param params
* @param callBack * @param callBack
* @return data * @return data
*/ */
public editGasDiscountOilPrice(params: object, callBack) { public editGasDiscountOilPrice(params: object, callBack) {
this.http.post(environment.baseUrl + 'highGasDiscountOilPrice/editGasDiscountOilPrice', params).subscribe(data => { this.http.post(environment.baseUrl + 'highGasDiscountOilPrice/editGasDiscountOilPrice', params).subscribe(data => {
callBack(data); callBack(data);
}); });
} }
/** /**
* *
* *
* @param paramsObject * @param paramsObject
* @param callBack * @param callBack
*/ */
public getList(paramsObject: object, callBack) { public getList(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'highGasDiscountOilPrice/getList?' + this.getWhereCondition(paramsObject)).subscribe(data => { this.http.get(environment.baseUrl + 'highGasDiscountOilPrice/getList?' + this.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data); callBack(data);
}); });
} }
/** /**
* estateId * estateId
* *
* @param id id * @param id id
* @param callBack * @param callBack
*/ */
public getDetailById(id: number , callBack) { public getDetailById(id: number, callBack) {
this.http.get(environment.baseUrl + 'highGasDiscountOilPrice/getDetailById?id=' + id).subscribe(data => { this.http.get(environment.baseUrl + 'highGasDiscountOilPrice/getDetailById?id=' + id).subscribe(data => {
callBack(data); callBack(data);
}); });
} }
/** /**
* estateId * estateId
* *
* @param id id * @param id id
* @param callBack * @param callBack
*/ */
public delete(id: number , callBack) { public delete(id: number, callBack) {
this.http.post(environment.baseUrl + 'highGasDiscountOilPrice/delete' , { id: id}).subscribe(data => { this.http.post(environment.baseUrl + 'highGasDiscountOilPrice/delete', {id: id}).subscribe(data => {
callBack(data); callBack(data);
}); });
} }
/** /**
* *
* @param param * @param param
* @param callback * @param callback
*/ */
public getOrganizationList(param: object, callback): any { public getOrganizationList(param: object, callback): any {
this.http.get(environment.baseUrl + 'bsOrganization/getOrganizationList?' + this.getWhereCondition(param)).subscribe( data => { this.http.get(environment.baseUrl + 'bsOrganization/getOrganizationList?' + this.getWhereCondition(param)).subscribe(data => {
callback(data); callback(data);
}); });
} }
/**
*
* @param param
* @param callback
*/
public getDictionaries(callback): any {
this.http.get(environment.baseUrl + 'bsOrganization/getOrganizationList').subscribe(data => {
callback(data);
});
}
} }

@ -14,3 +14,4 @@ export const RESUME_STATUS = 'resume_status';
export const RESUME_STATUS_NAME = 'resume_status_name'; export const RESUME_STATUS_NAME = 'resume_status_name';
export const LOGINTYPE = 'loginType'; // 1 pc端登录 2 后台登录 export const LOGINTYPE = 'loginType'; // 1 pc端登录 2 后台登录
export const COMPANYMENU = 'companyMenu'; // 1 公司路由 export const COMPANYMENU = 'companyMenu'; // 1 公司路由
export const ALL_DICTIONARY = 'dictionary'; // 数据字典

@ -28,13 +28,13 @@ export class RechargeService {
/** /**
* @Author Sum1Dream * @Author Sum1Dream
* @methodName deletePrice * @methodName editPriceStatus
* @Description //上下架 * @Description // 修改价格状态
* @Date 15:03 2021/8/12 * @Date 15:03 2021/8/12
* @Param mod * @Param mod
**/ **/
public onAndOffShelves(id: number, callBack) { public editPriceStatus(params: object, callBack) {
this.http.get(environment.baseUrl + 'outRechargePrice/onAndOffShelves?id=' + id).subscribe(data => { this.http.post(environment.baseUrl + 'outRechargePrice/editPriceStatus' , params ).subscribe(data => {
callBack(data); callBack(data);
}); });
} }

@ -4,10 +4,10 @@
export const environment = { export const environment = {
production: false, production: false,
// baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
// imageUrl: 'http://localhost:9302/filesystem/', imageUrl: 'http://localhost:9302/filesystem/',
baseUrl: 'https://hsg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) // baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://hsg.dctpay.com/filesystem/', // imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=', key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=',
inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=', inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=',
}; };

Loading…
Cancel
Save