提交会员充值 千猪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-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">
<nz-form-item *ngIf="!edit">
<nz-form-label [nzSpan]="6" nzRequired>选择产品</nz-form-label>
@ -252,9 +252,8 @@
<th nzWidth="90px">折扣金额</th>
<th nzWidth="120px">运营商</th>
<th nzWidth="90px">充值类型</th>
<th nzWidth="120px">创建时间</th>
<th nzRight nzWidth="80px">状态</th>
<th nzRight nzWidth="160px">操作</th>
<th nzWidth="80px">状态</th>
<th nzRight nzWidth="100px">操作</th>
</tr>
</thead>
<tbody>
@ -264,8 +263,7 @@
<td>{{data.discountPrice}}</td>
<td>{{data.operatorType | rechargePrice}}</td>
<td>{{data.phoneRechargeType== 1? '快充':'慢充'}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td nzRight>{{data.configStatus== 101? '正常':'下架中'}}</td>
<td>{{data.configStatus== 101? '正常':'下架中'}}</td>
<td nzRight class="table-td-operation">
<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>

@ -405,6 +405,7 @@ export class ListComponent implements OnInit {
this.apiMerchants.configApiProduct(this.configValidateForm.value , data => {
if (data['return_code'] === '000000') {
this.configVisible = false;
this.configValidateForm.reset();
this.message.success('提交成功');
} else {
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>{{data.title}}</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>{{data.createdTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data.updatedTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td nzRight="0px" class="table-td-operation">
<a (click)="getEdit(data.id)">编辑</a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)="getDetail(data.id)">删除</a>
<a (click)="showDeleteConfirm(data.id)">删除</a>
</td>
</tbody>
</nz-table>

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {environment} from '../../../../environments/environment';
import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms';
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';
function getBase64(file: File): Promise<string | ArrayBuffer | null> {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
@Component({
selector: 'app-brand',
templateUrl: './brand.component.html',
styleUrls: ['./brand.component.scss']
selector: 'app-brand',
templateUrl: './brand.component.html',
styleUrls: ['./brand.component.scss']
})
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;
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,
) {
}
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);
ngOnInit(): void {
this.init();
}
this.config.getListGoodsType({
pageNum: 1 ,
pageSize: 1000000 ,
} , data => {
this.goodTypData = data['return_data']['list'];
});
}
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);
// 图片查看
handlePreview = async (file: NzUploadFile) => {
if (!file.url && !file.preview) {
// tslint:disable-next-line:no-non-null-assertion
file.preview = await getBase64(file.originFileObj!);
this.config.getListGoodsType({
pageNum: 1,
pageSize: 1000000,
}, data => {
this.goodTypData = data['return_data']['list'];
});
}
this.previewImage = file.url || file.preview;
this.previewVisible = true;
}
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
this.loading = false;
if (reset) {
this.pageNum = 1;
// 图片查看
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;
}
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();
}
// 修改
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;
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
this.loading = false;
if (reset) {
this.pageNum = 1;
}
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 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;
}
// 修改
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']);
});
}
this.isVisible = true;
}
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;
}
// 查看详情
public getDetail(id: number): void {
this.router.navigate(['/admin/company/company-detail'], {
queryParams: {
companyId: id
}
}).then(r => console.log(r));
}
if (this.editFlag) {
this.validateForm.value.id = this.id;
this.config.updateBrand(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']);
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;
}
}
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;
}
}
});
} else {
this.config.insertBrand(this.validateForm.value, data => {
if (data['return_code'] === '000000') {
this.message.success('添加成功');
this.isVisible = false;
this.getRequest(true, this.searchForm.value);
if (this.editFlag) {
this.validateForm.value.id = this.id;
this.config.updateBrand(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']);
}
});
} 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 {
this.isVisible = false;
}
handleCancel(): void {
this.isVisible = false;
}
// 對話框删除
showDeleteConfirm(id): void {
this.modalService.confirm({
nzTitle: '确定删除',
nzOkText: '是',
nzOnOk: () => this.onDelete(id),
nzCancelText: '否',
});
}
onDelete(ids) {
this.config.getByDelete({
id: ids
}, data => {
if (data['return_code'] === '000000') {
this.message.create('success', `删除成功!`);
this.getRequest(true, this.searchForm.value);
} else {
this.message.create('error', data['return_msg']);
}
});
}
// 對話框删除
showDeleteConfirm(id): void {
this.modalService.confirm({
nzTitle: '确定删除',
nzOkText: '是',
nzOnOk: () => this.onDelete(id),
nzCancelText: '否',
});
}
onDelete(ids) {
this.config.getByDelete({
id: ids
}, data => {
if (data['return_code'] === '000000') {
this.message.create('success', `删除成功!`);
this.getRequest(true, this.searchForm.value);
} else {
this.message.create('error', data['return_msg']);
}
});
}
}

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

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

@ -59,7 +59,7 @@
<td>{{i+1}}</td>
<td>{{data.title}}</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>{{data.createdTime | 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'" />
</nz-form-control>
</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-label [nzSpan]="4" nzRequired>图片</nz-form-label>
<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 {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms';
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';
function getBase64(file: File): Promise<string | ArrayBuffer | null> {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
@Component({
selector: 'app-goods-type',
templateUrl: './goods-type.component.html',
styleUrls: ['./goods-type.component.scss']
selector: 'app-goods-type',
templateUrl: './goods-type.component.html',
styleUrls: ['./goods-type.component.scss']
})
export class GoodsTypeComponent implements OnInit {
WEB_SERVE_URL = environment.baseUrl;
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;
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],
});
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!);
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;
constructor(
private form: FormBuilder,
private config: ConfigService,
private iconService: IconService,
private message: NzMessageService,
private router: Router,
private modalService: NzModalService,
private fb: FormBuilder,
) {
}
this.previewImage = file.url || file.preview;
this.previewVisible = true;
}
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
ngOnInit(): void {
this.init();
}
this.loading = false;
if (reset) {
this.pageNum = 1;
public init(): void {
this.searchForm = this.form.group({
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 => {
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 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;
// 图片查看
handlePreview = async (file: NzUploadFile) => {
if (!file.url && !file.preview) {
// tslint:disable-next-line:no-non-null-assertion
file.preview = await getBase64(file.originFileObj!);
}
this.validateForm.patchValue(data['return_data']);
});
} else {
this.validateForm.reset();
this.editFlag = false;
this.imgFile = [];
this.previewImage = file.url || file.preview;
this.previewVisible = true;
}
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;
}
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
this.loading = false;
if (reset) {
this.pageNum = 1;
}
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
this.config.getListGoodsType(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']);
}
});
}
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;
}
// 重置
public resetForm(): void {
this.searchForm.reset();
}
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);
// 修改
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']);
});
} 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 {
this.config.insertGoodsType(this.validateForm.value, data => {
if (data['return_code'] === '000000') {
this.message.success('添加成功');
this.isVisible = false;
this.getRequest(true, this.searchForm.value);
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) {
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 {
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 {
this.isVisible = false;
}
handleCancel(): void {
this.isVisible = false;
}
// 對話框删除
showDeleteConfirm(id): void {
this.modalService.confirm({
nzTitle: '确定删除',
nzOkText: '是',
nzOnOk: () => this.onDelete(id),
nzCancelText: '否',
});
}
onDelete(ids) {
this.config.getGoodsTypeByDelete({
id: ids
}, data => {
if (data['return_code'] === '000000') {
this.message.create('success', `删除成功!`);
this.getRequest(true, this.searchForm.value);
} else {
this.message.create('error', data['return_msg']);
}
});
}
// 對話框删除
showDeleteConfirm(id): void {
this.modalService.confirm({
nzTitle: '确定删除',
nzOkText: '是',
nzOnOk: () => this.onDelete(id),
nzCancelText: '否',
});
}
onDelete(ids) {
this.config.getGoodsTypeByDelete({
id: ids
}, data => {
if (data['return_code'] === '000000') {
this.message.create('success', `删除成功!`);
this.getRequest(true, this.searchForm.value);
} else {
this.message.create('error', data['return_msg']);
}
});
}
}

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

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

@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http';
import {CommonsService} from './commons.service';
import {environment} from "../../environments/environment";
import {environment} from '../../environments/environment';
@Injectable({
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) {
this.http.post(environment.baseUrl + 'highBrand/insertBrand', params).subscribe(data => {
callBack(data);
});
}
@ -133,7 +134,7 @@ export class ConfigService {
* @param 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);
});
}

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

Loading…
Cancel
Save