Commit 8e5fc6bc authored by hanfeng zhang's avatar hanfeng zhang

321

parent 0dc5db95
......@@ -2,7 +2,7 @@
<div class="w-full flex justify-between py-3 items-center">
<div class="flex-grow flex flex-row ">
<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-tabs>
</div>
......@@ -45,7 +45,7 @@ export default Vue.extend({
},
methods:{
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 {
* @param categoryId
* @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, {
headers: {
Authorization: this.auth,
......
......@@ -66,7 +66,11 @@ export default Vue.extend({
data() {
return{
mokeData,
categoryTypes:[] as any[]
categoryTypes:[] as any[],
currentCategory:0,
pageSize:100,
currentPage:1,
pagesize:100
}
},
components:{
......@@ -78,8 +82,9 @@ export default Vue.extend({
name: 'Home',
async created(){
this.categoryTypes = await this.$service.nftService.getCategory()
console.log(this.categoryTypes);
},
mounted() {
this.$service.nftService.getList(this.currentPage,10)
},
methods:{
search(){
......@@ -90,7 +95,7 @@ export default Vue.extend({
console.log(222);
},
getDataByCategory(item:any){
console.log(item);
this.currentCategory = item.activeIndex
}
}
});
......
......@@ -28,12 +28,17 @@ import Vue from 'vue';
export default Vue.extend({
data(){
return{
categoryTypes:[] as any[]
categoryTypes:[] as any[],
listData:{},
currentCategory:0
}
},
async created(){
this.categoryTypes = await this.$service.nftService.getCategory()
},
mounted() {
this.listData = this.$service.nftService.getMyList()
},
methods: {
getDataByCategory(item:any){
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