Commit c87e0258 authored by hanfeng zhang's avatar hanfeng zhang

321

parent 3c80252b
......@@ -54,7 +54,7 @@ export class NFTService extends Service {
* @param id
* @returns
*/
async getNFTdetail(id: number){
async getNFTdetail(id: number):Promise<any>{
return await this.service.get(this.router.detail.path+'/'+id,{
headers: {
Authorization: this.getAuth(),
......
......@@ -2,7 +2,10 @@
<Layout-Child>
<div class='w-11/12 mx-auto mt-6'>
<div class='collection-list'>
<app-collectionCard v-for="i in collectionList" :key="i.id" :colletionData='i' class='mt-3'></app-collectionCard>
<div v-for="i in collectionList" :key="i.id" class='mt-3' @click="goDetail(i.id)" >
<app-collectionCard :colletionData='i' ></app-collectionCard>
</div>
</div>
</div>
......@@ -27,6 +30,10 @@ export default Vue.extend({
// 'app-cell':()=>import('@/components/common/Cell.vue'),
// 'app-btn':()=>import('@/components/common/Btn.vue')
},
methods:{
goDetail(id:any){
this.$router.push({ name: 'Nftdetail', params: { id: id }})
}
}
});
</script>
......@@ -5,7 +5,7 @@
</div> -->
<div class="w-11/12 mx-auto mt-6 text-font-white">
<app-collectionCard :colletionData='nftData'></app-collectionCard>
<div class="app-icons mx-auto grid grid-cols-4 my-6">
<div class="app-icons mx-auto grid grid-cols-4 my-6" v-if="isOwner">
<div
v-for="(i, index) in apps"
:key="index"
......@@ -151,14 +151,18 @@ export default Vue.extend({
return {
id: this.$route.params.id,
apps,
nftData:{},
nftData:{} as any,
collectionData:{},
inMyCollection:false
inMyCollection:false,
isOwner:false,
user:this.$util.userMsg.getUserMsg() as any
// loading:true
};
},
async created() {
this.nftData =await this.$service.nftService.getNFTdetail(parseInt(this.id))
console.log(this.nftData.wallet);
this.nftData.wallet == this.user.wallet? this.isOwner=true:this.isOwner=false
await this.setMyCollection()
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment