From e2d6660d8c7029993b26e2663d4441a2c0a7c7b2 Mon Sep 17 00:00:00 2001 From: Enzo <1284707383@qq.com> Date: Fri, 17 Sep 2021 10:23:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E7=9A=84=E6=94=B6=E8=97=8F=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/config.js | 2 +- pages/user/my/collect.vue | 40 ++++++++++++++++++++++++--------------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/common/js/config.js b/common/js/config.js index 8c40c53..da13764 100644 --- a/common/js/config.js +++ b/common/js/config.js @@ -16,7 +16,7 @@ export default { //https://demo-guojiang-ec-api.guojiang.club/ baseUrl: process.env.NODE_ENV === 'development' ? - 'http://192.168.3.29/' : 'https://v3-ec-admin-dev.guojiang.club/', // 运行时自动替换变量 + 'http://192.168.43.69/' : 'https://v3-ec-admin-dev.guojiang.club/', // 运行时自动替换变量 }, PACKAGES: { activity: false, diff --git a/pages/user/my/collect.vue b/pages/user/my/collect.vue index d7b5d62..e578c6a 100644 --- a/pages/user/my/collect.vue +++ b/pages/user/my/collect.vue @@ -4,9 +4,8 @@ - - + luckin coffee 瑞幸瑞幸咖啡瑞幸咖啡瑞幸咖啡瑞幸咖啡咖啡 @@ -18,12 +17,15 @@ + + {{ tab_list[title_current].loadingText }} + + - - + - {{ loading_text }} + {{ tab_list[title_current].loadingText }} @@ -104,16 +106,23 @@ isRefresher: true } }, + computed: { + autoHeight(){ + return `calc(${this.scrollH}px - ${this.nav_height}px - 86rpx)`; + } + }, components: { lfWaterfall }, onShow(){ - this.windowHeight = getApp().globalData.windowHeight; + let info = uni.getSystemInfoSync(); + this.scrollH = info.screenHeight; this.getData(); }, methods: { titletabChange(index){ this.title_current = index; + this.getData(); }, getData(options = {}) { let tab_item = this.tab_list[this.title_current]; @@ -121,7 +130,7 @@ .get({ api: 'api/collect', data: { - type: 'jc_goods' + type: tab_item.type }, header: { Authorization: this.$cookieStorage.get('user_token') @@ -139,6 +148,7 @@ if(options.type == 'pageRefresh') { uni.stopPullDownRefresh(); }else if(options.type == 'scrollRefresh') { + console.log('进入了') this.isRefresher = false; } if(tab_item.page == 1) { @@ -161,12 +171,13 @@ }, // 滑块下标值变化 swiperChange(event){ - this.current = event.detail.current; + this.title_current = event.detail.current; if(event.detail.source == '') return; // 如果是被动出发,没有事件类型则不做处理 + this.getData(); }, // 页面触底,加载下一页 onScrolltolower(){ - let tab_item = this.tab_list[this.current]; + let tab_item = this.tab_list[this.title_current]; if(tab_item.isPage){ tab_item.page = tab_item.page + 1; this.getData(); @@ -175,20 +186,19 @@ // scroll-view 下拉刷新 onRefresherrefresh(){ this.$u.throttle(() => { - this.clearTabItem(); - this.getData(); + this.clearTabItem({type: 'scrollRefresh'}); }, 200); }, - clearTabItem(){ - let tab_item = this.tab_list[this.current]; + clearTabItem(options){ + let tab_item = this.tab_list[this.title_current]; tab_item.page = 1; tab_item.isPage = true; tab_item.isRefresher = true; tab_item.loadingClass = true; tab_item.loadingText = '正在加载中'; tab_item.list = []; - this.$set(this.tab_list, this.current, tab_item); - // this.$refs.uWaterfallFather[this.current].clear(); + this.getData(options); + // this.$refs.uWaterfallFather[this.title_current].clear(); } } }