Commit 77986b1c authored by chenqikuai's avatar chenqikuai

Merge branch 'main' of gitlab.33.cn:HF_web/NFT

parents 24fe6e6d 68117b7e
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="w-full flex justify-between py-3 items-center"> <div class="w-full flex justify-between py-3 items-center">
<div class="flex-grow flex flex-row "> <div class="flex-grow flex flex-row ">
<van-tabs v-model="active" class='w-11/12' swipeable @change="tabChange"> <van-tabs v-model="active" class='w-11/12' swipeable @change="tabChange">
<van-tab v-for='(i,index) in list' :key="index" :title='i.categoryName' :id='i.id'> <van-tab v-for='i in list' :key="i.id" :title='i.categoryName' :id='i.id'>
</van-tab> </van-tab>
</van-tabs> </van-tabs>
</div> </div>
...@@ -45,7 +45,7 @@ export default Vue.extend({ ...@@ -45,7 +45,7 @@ export default Vue.extend({
}, },
methods:{ methods:{
tabChange(item:any){ tabChange(item:any){
this.$emit('tabChange',this.list[item]) this.$emit('tabChange',{data:this.list[item],activeIndex:this.active})
} }
} }
......
...@@ -88,7 +88,7 @@ export class NFTService extends Service { ...@@ -88,7 +88,7 @@ export class NFTService extends Service {
* @param categoryId * @param categoryId
* @returns * @returns
*/ */
async getList(pageNum?: number, pageSize?: number, categoryId?: number) { async getList(pageNum: number, pageSize: number, categoryId?: number) {
return await this.service.get(this.router.getList.path, { return await this.service.get(this.router.getList.path, {
headers: { headers: {
Authorization: this.auth, Authorization: this.auth,
......
...@@ -66,7 +66,11 @@ export default Vue.extend({ ...@@ -66,7 +66,11 @@ export default Vue.extend({
data() { data() {
return{ return{
mokeData, mokeData,
categoryTypes:[] as any[] categoryTypes:[] as any[],
currentCategory:0,
pageSize:100,
currentPage:1,
pagesize:100
} }
}, },
components:{ components:{
...@@ -78,8 +82,9 @@ export default Vue.extend({ ...@@ -78,8 +82,9 @@ export default Vue.extend({
name: 'Home', name: 'Home',
async created(){ async created(){
this.categoryTypes = await this.$service.nftService.getCategory() this.categoryTypes = await this.$service.nftService.getCategory()
console.log(this.categoryTypes); },
mounted() {
this.$service.nftService.getList(this.currentPage,10)
}, },
methods:{ methods:{
search(){ search(){
...@@ -90,7 +95,7 @@ export default Vue.extend({ ...@@ -90,7 +95,7 @@ export default Vue.extend({
console.log(222); console.log(222);
}, },
getDataByCategory(item:any){ getDataByCategory(item:any){
console.log(item); this.currentCategory = item.activeIndex
} }
} }
}); });
......
...@@ -28,12 +28,17 @@ import Vue from 'vue'; ...@@ -28,12 +28,17 @@ import Vue from 'vue';
export default Vue.extend({ export default Vue.extend({
data(){ data(){
return{ return{
categoryTypes:[] as any[] categoryTypes:[] as any[],
listData:{},
currentCategory:0
} }
}, },
async created(){ async created(){
this.categoryTypes = await this.$service.nftService.getCategory() this.categoryTypes = await this.$service.nftService.getCategory()
}, },
mounted() {
this.listData = this.$service.nftService.getMyList()
},
methods: { methods: {
getDataByCategory(item:any){ getDataByCategory(item:any){
console.log(item); console.log(item);
......
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