提交会员充值 千猪api 肯德基

pull/1/head
袁野 2 years ago
parent f21bd84fd3
commit 218762cf7b
  1. 10
      src/app/admin/api-merchants/list/list.component.html
  2. 6
      src/app/admin/api-merchants/list/list.component.ts
  3. 4
      src/app/admin/config-manage/brand/brand.component.html
  4. 371
      src/app/admin/config-manage/brand/brand.component.ts
  5. 4
      src/app/admin/config-manage/config-manage-routing.module.ts
  6. 26
      src/app/admin/config-manage/config-manage.module.ts
  7. 9
      src/app/admin/config-manage/goods-type/goods-type.component.html
  8. 350
      src/app/admin/config-manage/goods-type/goods-type.component.ts
  9. 1
      src/app/admin/merchant-store/store-edit/store-edit.component.ts
  10. 2
      src/app/admin/recharge-order/user/user.component.html
  11. 128
      src/app/services/api-product.service.ts
  12. 3
      src/app/services/config.service.ts
  13. 4
      src/environments/environment.ts

@ -206,7 +206,7 @@
</nz-table> </nz-table>
</nz-modal> </nz-modal>
<nz-modal [(nzVisible)]="configVisible" nzTitle="产品配置" (nzOnCancel)="configVisible = false" (nzOnOk)="handleOkConfig()"> <nz-modal [(nzVisible)]="configVisible" nzTitle="产品配置" (nzOnCancel)="handleCancelConfig()" (nzOnOk)="handleOkConfig()">
<form nz-form [formGroup]="configValidateForm" class="login-form"> <form nz-form [formGroup]="configValidateForm" class="login-form">
<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>
@ -252,9 +252,8 @@
<th nzWidth="90px">折扣金额</th> <th nzWidth="90px">折扣金额</th>
<th nzWidth="120px">运营商</th> <th nzWidth="120px">运营商</th>
<th nzWidth="90px">充值类型</th> <th nzWidth="90px">充值类型</th>
<th nzWidth="120px">创建时间</th> <th nzWidth="80px">状态</th>
<th nzRight nzWidth="80px">状态</th> <th nzRight nzWidth="100px">操作</th>
<th nzRight nzWidth="160px">操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -264,8 +263,7 @@
<td>{{data.discountPrice}}</td> <td>{{data.discountPrice}}</td>
<td>{{data.operatorType | rechargePrice}}</td> <td>{{data.operatorType | rechargePrice}}</td>
<td>{{data.phoneRechargeType== 1? '快充':'慢充'}}</td> <td>{{data.phoneRechargeType== 1? '快充':'慢充'}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data.configStatus== 101? '正常':'下架中'}}</td>
<td nzRight>{{data.configStatus== 101? '正常':'下架中'}}</td>
<td nzRight class="table-td-operation"> <td nzRight class="table-td-operation">
<a *ngIf="data.configStatus != 101" (click)="getEditConfigProduct(data.apiConfigProductId)">编辑</a> <a *ngIf="data.configStatus != 101" (click)="getEditConfigProduct(data.apiConfigProductId)">编辑</a>
<a style="margin-left: 20px;" (click)='getEditConfigProductStatus(data.apiConfigProductId , data.configStatus)'>{{data.configStatus === 101 ? '下线': '上线'}}</a> <a style="margin-left: 20px;" (click)='getEditConfigProductStatus(data.apiConfigProductId , data.configStatus)'>{{data.configStatus === 101 ? '下线': '上线'}}</a>

@ -405,6 +405,7 @@ export class ListComponent implements OnInit {
this.apiMerchants.configApiProduct(this.configValidateForm.value , data => { this.apiMerchants.configApiProduct(this.configValidateForm.value , data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.configVisible = false; this.configVisible = false;
this.configValidateForm.reset();
this.message.success('提交成功'); this.message.success('提交成功');
} else { } else {
this.message.error(data['return_msg']); this.message.error(data['return_msg']);
@ -462,4 +463,9 @@ export class ListComponent implements OnInit {
}); });
} }
handleCancelConfig() {
this.configVisible = false;
this.configValidateForm.reset();
}
} }

@ -69,14 +69,14 @@
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td>{{data.title}}</td> <td>{{data.title}}</td>
<td> <td>
<img class="head_img" src="{{WEB_SERVE_URL + data.img}}" onerror="this.src='../../../../assets/admin/navigation/icon.png'" alt=""> <img class="head_img" src="{{imageUrl + data.img}}" onerror="this.src='../../../../assets/admin/navigation/icon.png'" alt="">
</td> </td>
<td>{{data.createdTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data.createdTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data.updatedTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data.updatedTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td nzRight="0px" class="table-td-operation"> <td nzRight="0px" class="table-td-operation">
<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)="getDetail(data.id)">删除</a> <a (click)="showDeleteConfirm(data.id)">删除</a>
</td> </td>
</tbody> </tbody>
</nz-table> </nz-table>

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {environment} from '../../../../environments/environment'; import {environment} from '../../../../environments/environment';
import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms'; import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms';
import {IconService} from '../../../services/icon.service'; import {IconService} from '../../../services/icon.service';
@ -7,212 +7,213 @@ import {Router} from '_@angular_router@9.0.7@@angular/router';
import {ConfigService} from '../../../services/config.service'; import {ConfigService} from '../../../services/config.service';
function getBase64(file: File): Promise<string | ArrayBuffer | null> { function getBase64(file: File): Promise<string | ArrayBuffer | null> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const reader = new FileReader(); const reader = new FileReader();
reader.readAsDataURL(file); reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result); reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error); reader.onerror = error => reject(error);
}); });
} }
@Component({ @Component({
selector: 'app-brand', selector: 'app-brand',
templateUrl: './brand.component.html', templateUrl: './brand.component.html',
styleUrls: ['./brand.component.scss'] styleUrls: ['./brand.component.scss']
}) })
export class BrandComponent implements OnInit { export class BrandComponent implements OnInit {
WEB_SERVE_URL = environment.baseUrl;
imageUrl = environment.imageUrl;
searchForm: FormGroup; // 搜索框
requestData = []; // 列表数据
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
isVisible = false;
editFlag = false;
id: number;
validateForm!: FormGroup;
imgFile = [];
previewImage: string | undefined = '';
previewVisible = false;
goodTypData;
constructor(
private form: FormBuilder,
private config: ConfigService,
private iconService: IconService,
private message: NzMessageService,
private router: Router,
private modalService: NzModalService,
private fb: FormBuilder,
) {
}
WEB_SERVE_URL = environment.baseUrl; ngOnInit(): void {
searchForm: FormGroup; // 搜索框 this.init();
requestData = []; // 列表数据 }
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
isVisible = false;
editFlag = false;
id: number;
validateForm!: FormGroup;
imgFile = [];
previewImage: string | undefined = '';
previewVisible = false;
goodTypData;
constructor(
private form: FormBuilder,
private config: ConfigService,
private iconService: IconService,
private message: NzMessageService,
private router: Router,
private modalService: NzModalService,
private fb: FormBuilder,
) {
}
ngOnInit(): void {
this.init();
}
public init(): void {
this.searchForm = this.form.group({
title: [null],
goodTypeId: [null],
});
this.validateForm = this.fb.group({
title: [null, [Validators.required]],
goodTypeId: [null, [Validators.required]],
});
this.getRequest(true, this.searchForm.value);
this.config.getListGoodsType({ public init(): void {
pageNum: 1 , this.searchForm = this.form.group({
pageSize: 1000000 , title: [null],
} , data => { goodTypeId: [null],
this.goodTypData = data['return_data']['list']; });
}); this.validateForm = this.fb.group({
} title: [null, [Validators.required]],
goodTypeId: [null, [Validators.required]],
});
this.getRequest(true, this.searchForm.value);
// 图片查看 this.config.getListGoodsType({
handlePreview = async (file: NzUploadFile) => { pageNum: 1,
if (!file.url && !file.preview) { pageSize: 1000000,
// tslint:disable-next-line:no-non-null-assertion }, data => {
file.preview = await getBase64(file.originFileObj!); this.goodTypData = data['return_data']['list'];
});
} }
this.previewImage = file.url || file.preview;
this.previewVisible = true;
}
// 查询列表 // 图片查看
public getRequest(reset: boolean = false, whereObject: object) { handlePreview = async (file: NzUploadFile) => {
if (!file.url && !file.preview) {
this.loading = false; // tslint:disable-next-line:no-non-null-assertion
if (reset) { file.preview = await getBase64(file.originFileObj!);
this.pageNum = 1; }
this.previewImage = file.url || file.preview;
this.previewVisible = true;
} }
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize; // 查询列表
this.config.getBrandByList(whereObject, data => { public getRequest(reset: boolean = false, whereObject: object) {
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list; this.loading = false;
this.total = data['return_data'].total; if (reset) {
} else { this.pageNum = 1;
this.message.error(data['return_msg']);
}
});
}
// 重置
public resetForm(): void {
this.searchForm.reset();
}
// 修改
public getEdit(id?: number): void {
this.validateForm.reset();
this.editFlag = false;
this.imgFile = [];
this.id = id;
if (id != null) {
this.editFlag = true;
this.config.findById(id , data => {
data['return_data'].goodTypeId = String(data['return_data'].goodTypeId);
if (data['return_data']['img'] != null && data['return_data']['img'] !== '') {
const img = String(data['return_data']['img']);
const imgArray = [];
imgArray.push(
{
uid: 1,
name: img,
status: 'done',
url: environment.imageUrl + img
});
this.imgFile = imgArray;
} }
this.validateForm.patchValue(data['return_data']); whereObject['pageNum'] = this.pageNum;
}); whereObject['pageSize'] = this.pageSize;
this.config.getBrandByList(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();
} }
this.isVisible = true;
}
// 修改
// 查看详情 public getEdit(id?: number): void {
public getDetail(id: number): void { this.validateForm.reset();
this.router.navigate(['/admin/company/company-detail'], { this.editFlag = false;
queryParams: { this.imgFile = [];
companyId: id this.id = id;
} if (id != null) {
}).then(r => console.log(r)); this.editFlag = true;
} this.config.findById(id, data => {
data['return_data'].goodTypeId = String(data['return_data'].goodTypeId);
handleOk(): void { if (data['return_data']['img'] != null && data['return_data']['img'] !== '') {
// tslint:disable-next-line:forin const img = String(data['return_data']['img']);
for (const i in this.validateForm.controls) { const imgArray = [];
this.validateForm.controls[i].markAsDirty(); imgArray.push(
this.validateForm.controls[i].updateValueAndValidity(); {
if (this.validateForm.controls[i].errors != null) { uid: 1,
this.message.error('必填项不能为空'); name: img,
return; status: 'done',
} url: environment.imageUrl + img
});
this.imgFile = imgArray;
}
this.validateForm.patchValue(data['return_data']);
});
}
this.isVisible = true;
} }
if (this.imgFile.length !== 0) { // 查看详情
if (this.imgFile[0]['response'] != null) { public getDetail(id: number): void {
this.validateForm.value.img = this.imgFile[0]['response']['return_data'][0]; this.router.navigate(['/admin/company/company-detail'], {
} else { queryParams: {
this.validateForm.value.img = this.imgFile[0].name; companyId: id
} }
}).then(r => console.log(r));
} }
if (this.editFlag) {
this.validateForm.value.id = this.id; handleOk(): void {
this.config.updateBrand(this.validateForm.value, data => { // tslint:disable-next-line:forin
if (data['return_code'] === '000000') { for (const i in this.validateForm.controls) {
this.message.success('修改成功'); this.validateForm.controls[i].markAsDirty();
this.isVisible = false; this.validateForm.controls[i].updateValueAndValidity();
this.getRequest(true, this.searchForm.value); if (this.validateForm.controls[i].errors != null) {
} else { this.message.error('必填项不能为空');
this.message.create('error', data['return_msg']); return;
}
}
if (this.imgFile.length !== 0) {
if (this.imgFile[0]['response'] != null) {
this.validateForm.value.img = this.imgFile[0]['response']['return_data'][0];
} else {
this.validateForm.value.img = this.imgFile[0].name;
}
} }
}); if (this.editFlag) {
} else { this.validateForm.value.id = this.id;
this.config.insertBrand(this.validateForm.value, data => { this.config.updateBrand(this.validateForm.value, data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.message.success('添加成功'); this.isVisible = false;
this.isVisible = false; this.message.success('修改成功');
this.getRequest(true, this.searchForm.value); this.getRequest(true, this.searchForm.value);
} else {
this.message.create('error', data['return_msg']);
}
});
} else { } else {
this.message.create('error', data['return_msg']); console.log('123');
this.config.insertBrand(this.validateForm.value, data => {
if (data['return_code'] === '000000') {
this.isVisible = false;
this.message.success('添加成功');
this.getRequest(true, this.searchForm.value);
} else {
this.message.create('error', data['return_msg']);
}
});
} }
});
} }
}
handleCancel(): void { handleCancel(): void {
this.isVisible = false; this.isVisible = false;
} }
// 對話框删除 // 對話框删除
showDeleteConfirm(id): void { showDeleteConfirm(id): void {
this.modalService.confirm({ this.modalService.confirm({
nzTitle: '确定删除', nzTitle: '确定删除',
nzOkText: '是', nzOkText: '是',
nzOnOk: () => this.onDelete(id), nzOnOk: () => this.onDelete(id),
nzCancelText: '否', nzCancelText: '否',
}); });
} }
onDelete(ids) { onDelete(ids) {
this.config.getByDelete({ this.config.getByDelete({
id: ids id: ids
}, data => { }, data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.message.create('success', `删除成功!`); this.message.create('success', `删除成功!`);
this.getRequest(true, this.searchForm.value); this.getRequest(true, this.searchForm.value);
} else { } else {
this.message.create('error', data['return_msg']); this.message.create('error', data['return_msg']);
} }
}); });
} }
} }

@ -2,11 +2,15 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import {GoodsTypeComponent} from './goods-type/goods-type.component'; import {GoodsTypeComponent} from './goods-type/goods-type.component';
import {BrandComponent} from './brand/brand.component'; import {BrandComponent} from './brand/brand.component';
import {ThirdProductComponent} from './third-product/third-product.component';
import {MemberProductComponent} from './member-product/member-product.component';
const routes: Routes = [ const routes: Routes = [
{ path: 'goods-type', component: GoodsTypeComponent }, { path: 'goods-type', component: GoodsTypeComponent },
{ path: 'brand', component: BrandComponent }, { path: 'brand', component: BrandComponent },
{ path: 'third-product', component: ThirdProductComponent },
{ path: 'member-product', component: MemberProductComponent },
]; ];
@NgModule({ @NgModule({

@ -9,19 +9,23 @@ import {SeparateModule} from '../../common/separate/separate.module';
import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/forms'; import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/forms';
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 { ThirdProductComponent } from './third-product/third-product.component';
import {AppCommonModule} from "../../app-common.module";
import { MemberProductComponent } from './member-product/member-product.component';
@NgModule({ @NgModule({
declarations: [GoodsTypeComponent, BrandComponent], declarations: [GoodsTypeComponent, BrandComponent, ThirdProductComponent, MemberProductComponent],
imports: [ imports: [
CommonModule, CommonModule,
ConfigManageRoutingModule, ConfigManageRoutingModule,
NgZorroAntdModule, NgZorroAntdModule,
SeparateModule, SeparateModule,
ReactiveFormsModule, ReactiveFormsModule,
FormsModule, FormsModule,
BreadcrumbModule, BreadcrumbModule,
RegionSelectorModule RegionSelectorModule,
] AppCommonModule
]
}) })
export class ConfigManageModule { } export class ConfigManageModule { }

@ -59,7 +59,7 @@
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td>{{data.title}}</td> <td>{{data.title}}</td>
<td> <td>
<img class="head_img" src="{{WEB_SERVE_URL + data.img}}" onerror="this.src='../../../../assets/admin/navigation/icon.png'" alt=""> <img class="head_img" src="{{imageUrl + data.img}}" onerror="this.src='../../../../assets/admin/navigation/icon.png'" alt="">
</td> </td>
<td>{{data.createdTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data.createdTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data.updatedTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data.updatedTime | date: 'yyyy-MM-dd HH:mm'}}</td>
@ -80,6 +80,13 @@
<input nz-input placeholder="请输入标题..." [formControlName]="'title'" /> <input nz-input placeholder="请输入标题..." [formControlName]="'title'" />
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="4">使用业务</nz-form-label>
<nz-form-control [nzSpan]="12">
<input nz-input placeholder="请输入使用业务..." [formControlName]="'userService'" />
</nz-form-control>
</nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired>图片</nz-form-label> <nz-form-label [nzSpan]="4" nzRequired>图片</nz-form-label>
<nz-form-control [nzSpan]="20" nzErrorTip="请上传图片!"> <nz-form-control [nzSpan]="20" nzErrorTip="请上传图片!">

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {environment} from '../../../../environments/environment'; import {environment} from '../../../../environments/environment';
import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms'; import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms';
import {IconService} from '../../../services/icon.service'; import {IconService} from '../../../services/icon.service';
@ -7,201 +7,203 @@ import {Router} from '_@angular_router@9.0.7@@angular/router';
import {ConfigService} from '../../../services/config.service'; import {ConfigService} from '../../../services/config.service';
function getBase64(file: File): Promise<string | ArrayBuffer | null> { function getBase64(file: File): Promise<string | ArrayBuffer | null> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const reader = new FileReader(); const reader = new FileReader();
reader.readAsDataURL(file); reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result); reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error); reader.onerror = error => reject(error);
}); });
} }
@Component({ @Component({
selector: 'app-goods-type', selector: 'app-goods-type',
templateUrl: './goods-type.component.html', templateUrl: './goods-type.component.html',
styleUrls: ['./goods-type.component.scss'] styleUrls: ['./goods-type.component.scss']
}) })
export class GoodsTypeComponent implements OnInit { export class GoodsTypeComponent implements OnInit {
WEB_SERVE_URL = environment.baseUrl; WEB_SERVE_URL = environment.baseUrl;
searchForm: FormGroup; // 搜索框 imageUrl = environment.imageUrl;
requestData = []; // 列表数据 searchForm: FormGroup; // 搜索框
total: number; // 页码 requestData = []; // 列表数据
pageNum = 1; // 页码 total: number; // 页码
pageSize = 10; // 条码 pageNum = 1; // 页码
loading = true; pageSize = 10; // 条码
isVisible = false; loading = true;
editFlag = false; isVisible = false;
id: number; editFlag = false;
validateForm!: FormGroup; id: number;
imgFile = []; validateForm!: FormGroup;
previewImage: string | undefined = ''; imgFile = [];
previewVisible = false; previewImage: string | undefined = '';
constructor( previewVisible = false;
private form: FormBuilder,
private config: ConfigService, constructor(
private iconService: IconService, private form: FormBuilder,
private message: NzMessageService, private config: ConfigService,
private router: Router, private iconService: IconService,
private modalService: NzModalService, private message: NzMessageService,
private fb: FormBuilder, private router: Router,
) { private modalService: NzModalService,
} private fb: FormBuilder,
) {
ngOnInit(): void {
this.init();
}
public init(): void {
this.searchForm = this.form.group({
title: [null],
});
this.validateForm = this.fb.group({
title: [null, [Validators.required]],
});
this.getRequest(true, this.searchForm.value);
}
// 图片查看
handlePreview = async (file: NzUploadFile) => {
if (!file.url && !file.preview) {
// tslint:disable-next-line:no-non-null-assertion
file.preview = await getBase64(file.originFileObj!);
} }
this.previewImage = file.url || file.preview;
this.previewVisible = true;
}
// 查询列表 ngOnInit(): void {
public getRequest(reset: boolean = false, whereObject: object) { this.init();
}
this.loading = false; public init(): void {
if (reset) { this.searchForm = this.form.group({
this.pageNum = 1; title: [null],
});
this.validateForm = this.fb.group({
title: [null, [Validators.required]],
userService: [null],
});
this.getRequest(true, this.searchForm.value);
} }
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize; // 图片查看
this.config.getListGoodsType(whereObject, data => { handlePreview = async (file: NzUploadFile) => {
if (data['return_code'] === '000000') { if (!file.url && !file.preview) {
this.requestData = data['return_data'].list; // tslint:disable-next-line:no-non-null-assertion
this.total = data['return_data'].total; file.preview = await getBase64(file.originFileObj!);
} else {
this.message.error(data['return_msg']);
}
});
}
// 重置
public resetForm(): void {
this.searchForm.reset();
}
// 修改
public getEdit(id?: number): void {
this.id = id;
if (id != null) {
this.editFlag = true;
this.config.getGoodsTypeById(id , data => {
if (data['return_data']['img'] != null && data['return_data']['img'] !== '') {
const img = String(data['return_data']['img']);
const imgArray = [];
imgArray.push(
{
uid: 1,
name: img,
status: 'done',
url: environment.imageUrl + img
});
this.imgFile = imgArray;
} }
this.validateForm.patchValue(data['return_data']); this.previewImage = file.url || file.preview;
}); this.previewVisible = true;
} else {
this.validateForm.reset();
this.editFlag = false;
this.imgFile = [];
} }
this.isVisible = true;
} // 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
// 查看详情
public getDetail(id: number): void { this.loading = false;
this.router.navigate(['/admin/company/company-detail'], { if (reset) {
queryParams: { this.pageNum = 1;
companyId: id }
} whereObject['pageNum'] = this.pageNum;
}).then(r => console.log(r)); whereObject['pageSize'] = this.pageSize;
} this.config.getListGoodsType(whereObject, data => {
if (data['return_code'] === '000000') {
handleOk(): void { this.requestData = data['return_data'].list;
// tslint:disable-next-line:forin this.total = data['return_data'].total;
for (const i in this.validateForm.controls) { } else {
this.validateForm.controls[i].markAsDirty(); this.message.error(data['return_msg']);
this.validateForm.controls[i].updateValueAndValidity(); }
if (this.validateForm.controls[i].errors != null) { });
this.message.error('必填项不能为空');
return;
}
} }
if (this.imgFile.length !== 0) { // 重置
if (this.imgFile[0]['response'] != null) { public resetForm(): void {
this.validateForm.value.img = this.imgFile[0]['response']['return_data'][0]; this.searchForm.reset();
} else {
this.validateForm.value.img = this.imgFile[0].name;
}
} }
if (this.editFlag) {
this.validateForm.value.id = this.id;
this.config.updateGoodsType(this.validateForm.value, data => { // 修改
if (data['return_code'] === '000000') { public getEdit(id?: number): void {
this.message.success('修改成功'); this.id = id;
this.isVisible = false; if (id != null) {
this.getRequest(true, this.searchForm.value); this.editFlag = true;
this.config.getGoodsTypeById(id, data => {
if (data['return_data']['img'] != null && data['return_data']['img'] !== '') {
const img = String(data['return_data']['img']);
const imgArray = [];
imgArray.push(
{
uid: 1,
name: img,
status: 'done',
url: environment.imageUrl + img
});
this.imgFile = imgArray;
}
this.validateForm.patchValue(data['return_data']);
});
} else { } else {
this.message.create('error', data['return_msg']); this.validateForm.reset();
this.editFlag = false;
this.imgFile = [];
}
this.isVisible = true;
}
// 查看详情
public getDetail(id: number): void {
this.router.navigate(['/admin/company/company-detail'], {
queryParams: {
companyId: id
}
}).then(r => console.log(r));
}
handleOk(): void {
// tslint:disable-next-line:forin
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
if (this.validateForm.controls[i].errors != null) {
this.message.error('必填项不能为空');
return;
}
} }
});
} else { if (this.imgFile.length !== 0) {
this.config.insertGoodsType(this.validateForm.value, data => { if (this.imgFile[0]['response'] != null) {
if (data['return_code'] === '000000') { this.validateForm.value.img = this.imgFile[0]['response']['return_data'][0];
this.message.success('添加成功'); } else {
this.isVisible = false; this.validateForm.value.img = this.imgFile[0].name;
this.getRequest(true, this.searchForm.value); }
}
if (this.editFlag) {
this.validateForm.value.id = this.id;
this.config.updateGoodsType(this.validateForm.value, data => {
if (data['return_code'] === '000000') {
this.message.success('修改成功');
this.isVisible = false;
this.getRequest(true, this.searchForm.value);
} else {
this.message.create('error', data['return_msg']);
}
});
} else { } else {
this.message.create('error', data['return_msg']); this.config.insertGoodsType(this.validateForm.value, data => {
if (data['return_code'] === '000000') {
this.message.success('添加成功');
this.isVisible = false;
this.getRequest(true, this.searchForm.value);
} else {
this.message.create('error', data['return_msg']);
}
});
} }
});
} }
}
handleCancel(): void { handleCancel(): void {
this.isVisible = false; this.isVisible = false;
} }
// 對話框删除 // 對話框删除
showDeleteConfirm(id): void { showDeleteConfirm(id): void {
this.modalService.confirm({ this.modalService.confirm({
nzTitle: '确定删除', nzTitle: '确定删除',
nzOkText: '是', nzOkText: '是',
nzOnOk: () => this.onDelete(id), nzOnOk: () => this.onDelete(id),
nzCancelText: '否', nzCancelText: '否',
}); });
} }
onDelete(ids) { onDelete(ids) {
this.config.getGoodsTypeByDelete({ this.config.getGoodsTypeByDelete({
id: ids id: ids
}, data => { }, data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.message.create('success', `删除成功!`); this.message.create('success', `删除成功!`);
this.getRequest(true, this.searchForm.value); this.getRequest(true, this.searchForm.value);
} else { } else {
this.message.create('error', data['return_msg']); this.message.create('error', data['return_msg']);
} }
}); });
} }
} }

@ -199,6 +199,7 @@ export class StoreEditComponent implements OnInit {
map: map map: map
}); });
positionPicker.on('success', positionResult => { positionPicker.on('success', positionResult => {
console.log(positionResult);
positionResult['latitude'] = positionResult.position.lat; positionResult['latitude'] = positionResult.position.lat;
positionResult['longitude'] = positionResult.position.lng; positionResult['longitude'] = positionResult.position.lng;
positionResult['regionId'] = positionResult.regeocode.addressComponent.adcode; positionResult['regionId'] = positionResult.regeocode.addressComponent.adcode;

@ -93,7 +93,7 @@
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td nzRight="0px" class="table-td-operation"> <td nzRight="0px" class="table-td-operation">
<a (click)="getEdit(data.id)">编辑</a> <a (click)="getEdit(data.id)">编辑</a>
<a nz-dropdown [nzDropdownMenu]="menu">更多</a> <a nz-dropdown [nzDropdownMenu]="menu">Sum1Dream</a>
<nz-dropdown-menu #menu="nzDropdownMenu"> <nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable> <ul nz-menu nzSelectable>
<li class="li-a" nz-menu-item><a (click)="generateRechargeAgentQrCode(data.id)">生成二维码</a></li> <li class="li-a" nz-menu-item><a (click)="generateRechargeAgentQrCode(data.id)">生成二维码</a></li>

@ -1,7 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http'; import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http';
import {CommonsService} from './commons.service'; import {CommonsService} from './commons.service';
import {environment} from "../../environments/environment"; import {environment} from '../../environments/environment';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@ -94,4 +94,130 @@ export class ApiProductService {
}); });
} }
/**
* @Author Sum1Dream
* @methodName getStarbucksProducts
* @Description // 查询星巴克产品
* @Date 13:53 2022/6/30
* @Param callBack
*/
public getStarbucksProducts(callBack) {
this.http.get(environment.baseUrl + 'apiProduct/getStarbucksProducts').subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName insertProductConfig
* @Description // 新增第三方产品配置
* @Date 14:22 2022/6/30
* @Param params: object, callBack
*/
public productConfig(params: object, callBack) {
this.http.post(environment.baseUrl + 'bsProductConfig/productConfig', params).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName insertProductConfig
* @Description // 新增第三方产品配置
* @Date 14:22 2022/6/30
* @Param params: object, callBack
*/
public updateProductConfig(params: object, callBack) {
this.http.post(environment.baseUrl + 'bsProductConfig/updateProductConfig', params).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param paramsObject
* @param callBack
*/
public getProductConfig(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'bsProductConfig/getProductConfig?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
/**
* id查询产品详情
*
* @param id id
* @param callBack
*/
public findProductConfig(id: number, callBack) {
this.http.get(environment.baseUrl + 'bsProductConfig/findProductConfig?id=' + id).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName findStarbucksProducts
* @Description // 查询产品详情
* @Date 10:29 2022/7/1
* @Param id: number, callBack
*/
public findStarbucksProducts(id: number, callBack) {
this.http.get(environment.baseUrl + 'bsProductConfig/findStarbucksProducts?id=' + id).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName getListApiMemberProduct
* @Description // 查询会员产品列表
* @Date 10:38 2022/7/12
* @Param paramsObject: object, callBack
*/
public getListApiMemberProduct(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'apiMemberProduct/getListApiMemberProduct?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName insertMemberProduct
* @Description // 新增会员产品
* @Date 10:39 2022/7/12
* @Param params: object, callBack
*/
public insertMemberProduct(params: object, callBack) {
this.http.post(environment.baseUrl + 'apiMemberProduct/insertMemberProduct', params).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName updateMemberProduct
* @Description // 修改会员产品
* @Date 10:40 2022/7/12
* @Param params: object, callBack
*/
public updateMemberProduct(params: object, callBack) {
this.http.post(environment.baseUrl + 'apiMemberProduct/updateMemberProduct', params).subscribe(data => {
callBack(data);
});
}
/**
* id查询详情
*
* @param id id
* @param callBack
*/
public findMemberProductById(id: number, callBack) {
this.http.get(environment.baseUrl + 'apiMemberProduct/findById?id=' + id).subscribe(data => {
callBack(data);
});
}
} }

@ -97,6 +97,7 @@ export class ConfigService {
*/ */
public insertBrand(params: object, callBack) { public insertBrand(params: object, callBack) {
this.http.post(environment.baseUrl + 'highBrand/insertBrand', params).subscribe(data => { this.http.post(environment.baseUrl + 'highBrand/insertBrand', params).subscribe(data => {
callBack(data);
}); });
} }
@ -133,7 +134,7 @@ export class ConfigService {
* @param callBack * @param callBack
*/ */
public getByDelete(params: object, callBack) { public getByDelete(params: object, callBack) {
this.http.get(environment.baseUrl + 'highBrand/getByDelete' , params).subscribe(data => { this.http.post(environment.baseUrl + 'highBrand/getByDelete' , params).subscribe(data => {
callBack(data); callBack(data);
}); });
} }

@ -6,8 +6,8 @@ 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