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 {ActivatedRoute} from '@angular/router'; |
||||
import {MerchantStoreService} from '../../../services/merchant-store.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-store-detail', |
||||
templateUrl: './store-detail.component.html', |
||||
styleUrls: ['./store-detail.component.scss'] |
||||
selector: 'app-store-detail', |
||||
templateUrl: './store-detail.component.html', |
||||
styleUrls: ['./store-detail.component.scss'] |
||||
}) |
||||
export class StoreDetailComponent implements OnInit { |
||||
|
||||
data: any = {}; |
||||
id: number; |
||||
constructor( |
||||
private merchantStore: MerchantStoreService, |
||||
private message: NzMessageService, // 信息提示
|
||||
private activatedRoute: ActivatedRoute, |
||||
) { } |
||||
|
||||
ngOnInit(): void { |
||||
this.activatedRoute.queryParams.subscribe(queryParams => { |
||||
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']; |
||||
|
||||
}); |
||||
} |
||||
|
||||
data: any = {}; |
||||
id: number; |
||||
|
||||
constructor( |
||||
private merchantStore: MerchantStoreService, |
||||
private message: NzMessageService, // 信息提示
|
||||
private activatedRoute: ActivatedRoute, |
||||
) { |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.activatedRoute.queryParams.subscribe(queryParams => { |
||||
if (queryParams.storeId != null) { |
||||
this.id = queryParams.storeId; |
||||
this.getDetails(queryParams.storeId); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
// 查询详情
|
||||
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 {NzMessageService} from 'ng-zorro-antd'; |
||||
import {ActivatedRoute} from '@angular/router'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
|
||||
@Component({ |
||||
selector: 'app-merchant-detail', |
||||
templateUrl: './merchant-detail.component.html', |
||||
styleUrls: ['./merchant-detail.component.scss'] |
||||
selector: 'app-merchant-detail', |
||||
templateUrl: './merchant-detail.component.html', |
||||
styleUrls: ['./merchant-detail.component.scss'] |
||||
}) |
||||
export class MerchantDetailComponent implements OnInit { |
||||
|
||||
data: any = {}; |
||||
id: number; |
||||
FILE_URL = environment.imageUrl; |
||||
constructor( |
||||
private merchant: MerchantService, |
||||
private message: NzMessageService, // 信息提示
|
||||
private activatedRoute: ActivatedRoute, |
||||
) { } |
||||
data: any = {}; |
||||
id: number; |
||||
FILE_URL = environment.imageUrl; |
||||
|
||||
ngOnInit(): void { |
||||
this.activatedRoute.queryParams.subscribe(queryParams => { |
||||
if (queryParams.merchantId != null) { |
||||
this.id = queryParams.merchantId; |
||||
this.getDetails(queryParams.merchantId); |
||||
} |
||||
}); |
||||
} |
||||
constructor( |
||||
private merchant: MerchantService, |
||||
private message: NzMessageService, // 信息提示
|
||||
private activatedRoute: ActivatedRoute, |
||||
) { |
||||
} |
||||
|
||||
// 查询详情
|
||||
public getDetails(id: number) { |
||||
this.merchant.getMerchantById(id , data => { |
||||
this.data = data['return_data']; |
||||
}); |
||||
} |
||||
ngOnInit(): void { |
||||
this.activatedRoute.queryParams.subscribe(queryParams => { |
||||
if (queryParams.merchantId != null) { |
||||
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