pull/1/head
parent
698e4d2738
commit
ce9300e22e
@ -1,40 +1,47 @@ |
|||||||
import { Component, OnInit } from '@angular/core'; |
import {Component, OnInit} from '@angular/core'; |
||||||
import {NzMessageService} from 'ng-zorro-antd'; |
import {NzMessageService} from 'ng-zorro-antd'; |
||||||
import {ActivatedRoute} from '@angular/router'; |
import {ActivatedRoute} from '@angular/router'; |
||||||
import {MerchantStoreService} from '../../../services/merchant-store.service'; |
import {MerchantStoreService} from '../../../services/merchant-store.service'; |
||||||
|
|
||||||
@Component({ |
@Component({ |
||||||
selector: 'app-store-detail', |
selector: 'app-store-detail', |
||||||
templateUrl: './store-detail.component.html', |
templateUrl: './store-detail.component.html', |
||||||
styleUrls: ['./store-detail.component.scss'] |
styleUrls: ['./store-detail.component.scss'] |
||||||
}) |
}) |
||||||
export class StoreDetailComponent implements OnInit { |
export class StoreDetailComponent implements OnInit { |
||||||
|
|
||||||
data: any = {}; |
data: any = {}; |
||||||
id: number; |
id: number; |
||||||
constructor( |
|
||||||
private merchantStore: MerchantStoreService, |
constructor( |
||||||
private message: NzMessageService, // 信息提示
|
private merchantStore: MerchantStoreService, |
||||||
private activatedRoute: ActivatedRoute, |
private message: NzMessageService, // 信息提示
|
||||||
) { } |
private activatedRoute: ActivatedRoute, |
||||||
|
) { |
||||||
ngOnInit(): void { |
} |
||||||
this.activatedRoute.queryParams.subscribe(queryParams => { |
|
||||||
if (queryParams.storeId != null) { |
ngOnInit(): void { |
||||||
this.id = queryParams.storeId; |
this.activatedRoute.queryParams.subscribe(queryParams => { |
||||||
this.getDetails(queryParams.storeId); |
if (queryParams.storeId != null) { |
||||||
} |
this.id = queryParams.storeId; |
||||||
}); |
this.getDetails(queryParams.storeId); |
||||||
} |
} |
||||||
|
}); |
||||||
// 查询详情
|
} |
||||||
public getDetails(id: number) { |
|
||||||
this.merchantStore.getMerchantStoreById(id , data => { |
// 查询详情
|
||||||
this.data = data['return_data']; |
public getDetails(id: number) { |
||||||
|
this.merchantStore.getMerchantStoreById(id, data => { |
||||||
}); |
console.log(data); |
||||||
} |
this.data = data['return_data']; |
||||||
|
|
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
// 返回
|
||||||
|
getBack() { |
||||||
|
history.back(); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
} |
} |
||||||
|
@ -1,39 +1,46 @@ |
|||||||
import { Component, OnInit } from '@angular/core'; |
import {Component, OnInit} from '@angular/core'; |
||||||
import {MerchantService} from '../../../services/merchant.service'; |
import {MerchantService} from '../../../services/merchant.service'; |
||||||
import {NzMessageService} from 'ng-zorro-antd'; |
import {NzMessageService} from 'ng-zorro-antd'; |
||||||
import {ActivatedRoute} from '@angular/router'; |
import {ActivatedRoute} from '@angular/router'; |
||||||
import {environment} from '../../../../environments/environment'; |
import {environment} from '../../../../environments/environment'; |
||||||
|
|
||||||
@Component({ |
@Component({ |
||||||
selector: 'app-merchant-detail', |
selector: 'app-merchant-detail', |
||||||
templateUrl: './merchant-detail.component.html', |
templateUrl: './merchant-detail.component.html', |
||||||
styleUrls: ['./merchant-detail.component.scss'] |
styleUrls: ['./merchant-detail.component.scss'] |
||||||
}) |
}) |
||||||
export class MerchantDetailComponent implements OnInit { |
export class MerchantDetailComponent implements OnInit { |
||||||
|
|
||||||
data: any = {}; |
data: any = {}; |
||||||
id: number; |
id: number; |
||||||
FILE_URL = environment.imageUrl; |
FILE_URL = environment.imageUrl; |
||||||
constructor( |
|
||||||
private merchant: MerchantService, |
|
||||||
private message: NzMessageService, // 信息提示
|
|
||||||
private activatedRoute: ActivatedRoute, |
|
||||||
) { } |
|
||||||
|
|
||||||
ngOnInit(): void { |
constructor( |
||||||
this.activatedRoute.queryParams.subscribe(queryParams => { |
private merchant: MerchantService, |
||||||
if (queryParams.merchantId != null) { |
private message: NzMessageService, // 信息提示
|
||||||
this.id = queryParams.merchantId; |
private activatedRoute: ActivatedRoute, |
||||||
this.getDetails(queryParams.merchantId); |
) { |
||||||
} |
} |
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
// 查询详情
|
ngOnInit(): void { |
||||||
public getDetails(id: number) { |
this.activatedRoute.queryParams.subscribe(queryParams => { |
||||||
this.merchant.getMerchantById(id , data => { |
if (queryParams.merchantId != null) { |
||||||
this.data = data['return_data']; |
this.id = queryParams.merchantId; |
||||||
}); |
this.getDetails(queryParams.merchantId); |
||||||
} |
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
// 查询详情
|
||||||
|
public getDetails(id: number) { |
||||||
|
this.merchant.getMerchantById(id, data => { |
||||||
|
this.data = data['return_data']; |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
// 返回
|
||||||
|
getBack() { |
||||||
|
history.back(); |
||||||
|
} |
||||||
|
|
||||||
} |
} |
||||||
|
Loading…
Reference in new issue