Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
meihua-island-book
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2023-12-19 11:23:39 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9d744aa39d2feeea756be29f533d585d01ce20e7
9d744aa3
1 parent
9726038a
页面载入显示优化
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
10 deletions
src/pages/book/index.vue
src/pages/my/index.vue
src/pages/book/index.vue
View file @
9d744aa
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-1
8 10:16
:03
* @LastEditTime: 2023-12-1
9 11:19
:03
* @FilePath: /meihuaApp/src/pages/book/index.vue
* @Description: 文件描述
-->
<template>
<view class="book-page">
<view
v-if="showContent"
id="book-content" class="book-content">
<view id="book-content" class="book-content">
<view id="book-cal" class="book-cal">
<calendar-select @on-dates-change="onDatesChange"></calendar-select>
</view>
<view class="book-type">
<nut-tabs v-model="value" title-scroll title-gutter="10" name="tabName" background="#FFF" color="#4C2E08" animated-time="0">
<nut-tab-pane v-for="item in list" :title="'Tab ' + item" :pane-key="item">
<view class="book-list">
<scroll-view :style="scrollStyle" :scroll-y="true" :scroll-with-animation="true" @scrolltolower="onScrollToLower">
<view
v-if="showContent"
class="book-list">
<scroll-view
ref="refScrollView"
:style="scrollStyle" :scroll-y="true" :scroll-with-animation="true" @scrolltolower="onScrollToLower">
<view v-for="(item, index) in 10" :key="index">
<room-card :key="index"></room-card>
<view v-if="index === 9" style="height: 2rem;"></view>
...
...
@@ -54,23 +54,36 @@ export default {
computed: {
scrollStyle() {
return {
refScrollView: null,
height: this.indexCoverHeight + 'px',
// paddingBottom: 50 + 'px',
};
},
},
mounted () {
Taro.showLoading({
title: '加载中',
});
// 设置首页封面高度
const windowHeight = wx.getSystemInfoSync().windowHeight;
// 处理切换显示白屏问题
setTimeout(() => {
this.showContent = true;
}, 100);
setTimeout(async () => {
// setTimeout(async () => {
// const navHeight = await $('#navbar-page').height();
// const calHeight = await $('#book-cal').height();
// this.indexCoverHeight = windowHeight - navHeight - calHeight - 50;
// }, 500);
this.$nextTick(async () => {
const navHeight = await $('#navbar-page').height();
const calHeight = await $('#book-cal').height();
this.indexCoverHeight = windowHeight - navHeight - calHeight - 50;
}, 500);
if (this.$refs.refScrollView) {
Taro.hideLoading();
console.warn('加载完成');
}
});
},
data() {
return {
...
...
src/pages/my/index.vue
View file @
9d744aa
<!--
* @Date: 2023-12-13 11:13:13
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-19 1
0:46:0
4
* @LastEditTime: 2023-12-19 1
1:22:2
4
* @FilePath: /meihuaApp/src/pages/my/index.vue
* @Description: 文件描述
-->
...
...
@@ -25,7 +25,7 @@
<nut-tabs v-model="value" title-scroll title-gutter="0" name="tabName" background="#FFF" color="#6A4925" animated-time="0">
<nut-tab-pane v-for="item in tabList" :title="item.title" :pane-key="item.key">
<view v-if="showContent" class="book-list">
<scroll-view :style="scrollStyle" :scroll-y="true" :scroll-with-animation="true" @scrolltolower="onScrollToLower">
<scroll-view
ref="refScrollView"
:style="scrollStyle" :scroll-y="true" :scroll-with-animation="true" @scrolltolower="onScrollToLower">
<view v-for="(item, index) in 10" :key="index">
<order-card :key="index" @onPay="onPay"></order-card>
<view v-if="index === 9" style="height: 2rem;"></view>
...
...
@@ -55,6 +55,8 @@ import { IconFont } from '@nutui/icons-vue-taro';
import navBar from '@/components/navBar.vue'
import orderCard from '@/components/orderCard.vue'
const refScrollView = ref(null);
const value = ref('0');
const tabList = ref([{
title: '全部订单',
...
...
@@ -103,18 +105,31 @@ export default {
},
},
mounted () {
Taro.showLoading({
title: '加载中',
});
// 设置首页封面高度
const windowHeight = wx.getSystemInfoSync().windowHeight;
// 处理切换显示白屏问题
setTimeout(() => {
this.showContent = true;
}, 100);
setTimeout(async () => {
// setTimeout(async () => {
// const navHeight = await $('#navbar-page').height();
// const avatorHeight = await $('#avator').height();
// const titleHeight = await $('#title').height();
// this.indexCoverHeight = windowHeight - navHeight - avatorHeight - titleHeight - 50;
// }, 500);
this.$nextTick(async () => {
const navHeight = await $('#navbar-page').height();
const avatorHeight = await $('#avator').height();
const titleHeight = await $('#title').height();
this.indexCoverHeight = windowHeight - navHeight - avatorHeight - titleHeight - 50;
}, 500);
if (this.$refs.refScrollView) {
Taro.hideLoading();
console.warn('加载完成');
}
});
},
data() {
return {
...
...
Please
register
or
login
to post a comment