Commit c87e0258 authored by hanfeng zhang's avatar hanfeng zhang

321

parent 3c80252b
...@@ -54,7 +54,7 @@ export class NFTService extends Service { ...@@ -54,7 +54,7 @@ export class NFTService extends Service {
* @param id * @param id
* @returns * @returns
*/ */
async getNFTdetail(id: number){ async getNFTdetail(id: number):Promise<any>{
return await this.service.get(this.router.detail.path+'/'+id,{ return await this.service.get(this.router.detail.path+'/'+id,{
headers: { headers: {
Authorization: this.getAuth(), Authorization: this.getAuth(),
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
<Layout-Child> <Layout-Child>
<div class='w-11/12 mx-auto mt-6'> <div class='w-11/12 mx-auto mt-6'>
<div class='collection-list'> <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>
</div> </div>
...@@ -27,6 +30,10 @@ export default Vue.extend({ ...@@ -27,6 +30,10 @@ export default Vue.extend({
// 'app-cell':()=>import('@/components/common/Cell.vue'), // 'app-cell':()=>import('@/components/common/Cell.vue'),
// 'app-btn':()=>import('@/components/common/Btn.vue') // 'app-btn':()=>import('@/components/common/Btn.vue')
}, },
methods:{
goDetail(id:any){
this.$router.push({ name: 'Nftdetail', params: { id: id }})
}
}
}); });
</script> </script>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</div> --> </div> -->
<div class="w-11/12 mx-auto mt-6 text-font-white"> <div class="w-11/12 mx-auto mt-6 text-font-white">
<app-collectionCard :colletionData='nftData'></app-collectionCard> <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 <div
v-for="(i, index) in apps" v-for="(i, index) in apps"
:key="index" :key="index"
...@@ -151,14 +151,18 @@ export default Vue.extend({ ...@@ -151,14 +151,18 @@ export default Vue.extend({
return { return {
id: this.$route.params.id, id: this.$route.params.id,
apps, apps,
nftData:{}, nftData:{} as any,
collectionData:{}, collectionData:{},
inMyCollection:false inMyCollection:false,
isOwner:false,
user:this.$util.userMsg.getUserMsg() as any
// loading:true // loading:true
}; };
}, },
async created() { async created() {
this.nftData =await this.$service.nftService.getNFTdetail(parseInt(this.id)) 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() 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