xsh_1997 hace 1 semana
padre
commit
88c7814b34

+ 55 - 0
ruoyi-ui-app/mixins/pageViewport.js

@@ -0,0 +1,55 @@
1
+/**
2
+ * 分包页视口高度:iOS 上 scroll-view 需父级固定 px 高度,避免 flex+height:0 导致空白
3
+ */
4
+export default {
5
+  data() {
6
+    return {
7
+      pageHeightPx: 0
8
+    }
9
+  },
10
+  computed: {
11
+    pageStyle() {
12
+      if (this.pageHeightPx > 0) {
13
+        return { height: `${this.pageHeightPx}px` }
14
+      }
15
+      return {}
16
+    }
17
+  },
18
+  onLoad() {
19
+    this.applyPageHeight()
20
+  },
21
+  onReady() {
22
+    this.applyPageHeight()
23
+  },
24
+  methods: {
25
+    getNavigationBarHeight() {
26
+      const sys = uni.getSystemInfoSync()
27
+      const statusBar = sys.statusBarHeight || 0
28
+      // #ifdef MP-WEIXIN
29
+      try {
30
+        const menu = uni.getMenuButtonBoundingClientRect()
31
+        if (menu && menu.height) {
32
+          return statusBar + (menu.top - statusBar) * 2 + menu.height
33
+        }
34
+      } catch (e) {
35
+        /* noop */
36
+      }
37
+      // #endif
38
+      return statusBar + 44
39
+    },
40
+    getViewportContentHeight() {
41
+      const sys = uni.getSystemInfoSync()
42
+      const navH = this.getNavigationBarHeight()
43
+      // #ifdef H5
44
+      if (typeof window !== 'undefined' && window.innerHeight) {
45
+        return Math.max(320, window.innerHeight - navH)
46
+      }
47
+      // #endif
48
+      const screenH = sys.screenHeight || sys.windowHeight || 600
49
+      return Math.max(320, screenH - navH)
50
+    },
51
+    applyPageHeight() {
52
+      this.pageHeightPx = this.getViewportContentHeight()
53
+    }
54
+  }
55
+}

+ 6 - 2
ruoyi-ui-app/package-a/booking-expert/index.vue

@@ -1,6 +1,6 @@
1
 <template>
1
 <template>
2
   <!-- 预约专家:见 doc/app/预约服务/预约服务接口说明.md -->
2
   <!-- 预约专家:见 doc/app/预约服务/预约服务接口说明.md -->
3
-  <view :class="pageRootClass" class="tab-page be-page">
3
+  <view :class="pageRootClass" class="tab-page be-page" :style="pageStyle">
4
     <scroll-view scroll-y class="be-scroll" enable-back-to-top :show-scrollbar="false">
4
     <scroll-view scroll-y class="be-scroll" enable-back-to-top :show-scrollbar="false">
5
       <view class="be-card be-card--top">
5
       <view class="be-card be-card--top">
6
         <!-- 第一行:左头像 | 中标题区 | 右评分(可点击) -->
6
         <!-- 第一行:左头像 | 中标题区 | 右评分(可点击) -->
@@ -203,6 +203,7 @@ import UPopup from 'uview-plus/components/u-popup/u-popup.vue'
203
 import URate from 'uview-plus/components/u-rate/u-rate.vue'
203
 import URate from 'uview-plus/components/u-rate/u-rate.vue'
204
 import UTextarea from 'uview-plus/components/u-textarea/u-textarea.vue'
204
 import UTextarea from 'uview-plus/components/u-textarea/u-textarea.vue'
205
 import tabPage from '@/mixins/tabPage'
205
 import tabPage from '@/mixins/tabPage'
206
+import pageViewport from '@/mixins/pageViewport'
206
 import { resolveResourceUrl } from '@/utils/resourceUrl'
207
 import { resolveResourceUrl } from '@/utils/resourceUrl'
207
 import { ensureApiToken } from '@/utils/apiAuth'
208
 import { ensureApiToken } from '@/utils/apiAuth'
208
 import { useUserStore } from '@/store/user'
209
 import { useUserStore } from '@/store/user'
@@ -288,7 +289,7 @@ export default {
288
     'up-rate': URate,
289
     'up-rate': URate,
289
     'up-textarea': UTextarea
290
     'up-textarea': UTextarea
290
   },
291
   },
291
-  mixins: [tabPage],
292
+  mixins: [tabPage, pageViewport],
292
   data() {
293
   data() {
293
     const slots = DEFAULT_TIME_SLOTS.slice()
294
     const slots = DEFAULT_TIME_SLOTS.slice()
294
     const defaultSlot = slots[slotIndexFromHour(slots)] || slots[0]
295
     const defaultSlot = slots[slotIndexFromHour(slots)] || slots[0]
@@ -685,7 +686,10 @@ export default {
685
   display: flex;
686
   display: flex;
686
   flex-direction: column;
687
   flex-direction: column;
687
   min-width: 0;
688
   min-width: 0;
689
+  width: 100%;
690
+  height: 100%;
688
   min-height: 100%;
691
   min-height: 100%;
692
+  overflow: hidden;
689
   box-sizing: border-box;
693
   box-sizing: border-box;
690
   background: $morandi-bg-page;
694
   background: $morandi-bg-page;
691
 }
695
 }

+ 6 - 2
ruoyi-ui-app/package-a/booking-org/index.vue

@@ -1,6 +1,6 @@
1
 <template>
1
 <template>
2
   <!-- 预约机构:见 doc/app/预约服务/预约服务接口说明.md -->
2
   <!-- 预约机构:见 doc/app/预约服务/预约服务接口说明.md -->
3
-  <view :class="pageRootClass" class="tab-page bgo-page">
3
+  <view :class="pageRootClass" class="tab-page bgo-page" :style="pageStyle">
4
     <scroll-view scroll-y class="bgo-scroll" enable-back-to-top :show-scrollbar="false">
4
     <scroll-view scroll-y class="bgo-scroll" enable-back-to-top :show-scrollbar="false">
5
       <view class="bgo-card bgo-card--top">
5
       <view class="bgo-card bgo-card--top">
6
         <view class="bgo-hero">
6
         <view class="bgo-hero">
@@ -132,6 +132,7 @@ import UFormItem from 'uview-plus/components/u-form-item/u-form-item.vue'
132
 import UInput from 'uview-plus/components/u-input/u-input.vue'
132
 import UInput from 'uview-plus/components/u-input/u-input.vue'
133
 import UPopup from 'uview-plus/components/u-popup/u-popup.vue'
133
 import UPopup from 'uview-plus/components/u-popup/u-popup.vue'
134
 import tabPage from '@/mixins/tabPage'
134
 import tabPage from '@/mixins/tabPage'
135
+import pageViewport from '@/mixins/pageViewport'
135
 import { resolveResourceUrl } from '@/utils/resourceUrl'
136
 import { resolveResourceUrl } from '@/utils/resourceUrl'
136
 import { ensureApiToken } from '@/utils/apiAuth'
137
 import { ensureApiToken } from '@/utils/apiAuth'
137
 import { useUserStore } from '@/store/user'
138
 import { useUserStore } from '@/store/user'
@@ -165,7 +166,7 @@ export default {
165
     'up-input': UInput,
166
     'up-input': UInput,
166
     'up-popup': UPopup
167
     'up-popup': UPopup
167
   },
168
   },
168
-  mixins: [tabPage],
169
+  mixins: [tabPage, pageViewport],
169
   data() {
170
   data() {
170
     return {
171
     return {
171
       navTitleKey: 'bookingOrgPage.navTitle',
172
       navTitleKey: 'bookingOrgPage.navTitle',
@@ -495,7 +496,10 @@ export default {
495
   display: flex;
496
   display: flex;
496
   flex-direction: column;
497
   flex-direction: column;
497
   min-width: 0;
498
   min-width: 0;
499
+  width: 100%;
500
+  height: 100%;
498
   min-height: 100%;
501
   min-height: 100%;
502
+  overflow: hidden;
499
   box-sizing: border-box;
503
   box-sizing: border-box;
500
   background: $morandi-bg-page;
504
   background: $morandi-bg-page;
501
 }
505
 }

+ 6 - 2
ruoyi-ui-app/package-a/booking-vet/index.vue

@@ -1,6 +1,6 @@
1
 <template>
1
 <template>
2
   <!-- 预约兽医:见 doc/app/预约服务/预约服务接口说明.md -->
2
   <!-- 预约兽医:见 doc/app/预约服务/预约服务接口说明.md -->
3
-  <view :class="pageRootClass" class="tab-page bv-page">
3
+  <view :class="pageRootClass" class="tab-page bv-page" :style="pageStyle">
4
     <scroll-view scroll-y class="bv-scroll" enable-back-to-top :show-scrollbar="false">
4
     <scroll-view scroll-y class="bv-scroll" enable-back-to-top :show-scrollbar="false">
5
       <!-- 上:兽医信息 -->
5
       <!-- 上:兽医信息 -->
6
       <view class="bv-card bv-card--top">
6
       <view class="bv-card bv-card--top">
@@ -184,6 +184,7 @@ import UPicker from 'uview-plus/components/u-picker/u-picker.vue'
184
 import UPopup from 'uview-plus/components/u-popup/u-popup.vue'
184
 import UPopup from 'uview-plus/components/u-popup/u-popup.vue'
185
 import UTextarea from 'uview-plus/components/u-textarea/u-textarea.vue'
185
 import UTextarea from 'uview-plus/components/u-textarea/u-textarea.vue'
186
 import tabPage from '@/mixins/tabPage'
186
 import tabPage from '@/mixins/tabPage'
187
+import pageViewport from '@/mixins/pageViewport'
187
 import { resolveResourceUrl } from '@/utils/resourceUrl'
188
 import { resolveResourceUrl } from '@/utils/resourceUrl'
188
 import { ensureApiToken } from '@/utils/apiAuth'
189
 import { ensureApiToken } from '@/utils/apiAuth'
189
 import { useUserStore } from '@/store/user'
190
 import { useUserStore } from '@/store/user'
@@ -269,7 +270,7 @@ export default {
269
     'up-popup': UPopup,
270
     'up-popup': UPopup,
270
     'up-textarea': UTextarea
271
     'up-textarea': UTextarea
271
   },
272
   },
272
-  mixins: [tabPage],
273
+  mixins: [tabPage, pageViewport],
273
   data() {
274
   data() {
274
     const slots = DEFAULT_TIME_SLOTS.slice()
275
     const slots = DEFAULT_TIME_SLOTS.slice()
275
     const defaultSlot = slots[slotIndexFromHour(slots)] || slots[0]
276
     const defaultSlot = slots[slotIndexFromHour(slots)] || slots[0]
@@ -643,7 +644,10 @@ export default {
643
   display: flex;
644
   display: flex;
644
   flex-direction: column;
645
   flex-direction: column;
645
   min-width: 0;
646
   min-width: 0;
647
+  width: 100%;
648
+  height: 100%;
646
   min-height: 100%;
649
   min-height: 100%;
650
+  overflow: hidden;
647
   box-sizing: border-box;
651
   box-sizing: border-box;
648
   background: $morandi-bg-page;
652
   background: $morandi-bg-page;
649
 }
653
 }

+ 6 - 2
ruoyi-ui-app/package-a/medicine-tools/index.vue

@@ -1,6 +1,6 @@
1
 <template>
1
 <template>
2
   <!-- 用药工具:顶区 up-tabs;下为三个 Tab 表单与结果区(文案 i18n),白底 -->
2
   <!-- 用药工具:顶区 up-tabs;下为三个 Tab 表单与结果区(文案 i18n),白底 -->
3
-  <view :class="pageRootClass" class="tab-page mt-page">
3
+  <view :class="pageRootClass" class="tab-page mt-page" :style="pageStyle">
4
     <scroll-view scroll-y class="mt-scroll" enable-back-to-top :show-scrollbar="false">
4
     <scroll-view scroll-y class="mt-scroll" enable-back-to-top :show-scrollbar="false">
5
       <view class="mt-tabs-wrap">
5
       <view class="mt-tabs-wrap">
6
         <up-tabs
6
         <up-tabs
@@ -166,6 +166,7 @@ import UButton from 'uview-plus/components/u-button/u-button.vue'
166
 import UIcon from 'uview-plus/components/u-icon/u-icon.vue'
166
 import UIcon from 'uview-plus/components/u-icon/u-icon.vue'
167
 import UCalendar from 'uview-plus/components/u-calendar/u-calendar.vue'
167
 import UCalendar from 'uview-plus/components/u-calendar/u-calendar.vue'
168
 import tabPage from '@/mixins/tabPage'
168
 import tabPage from '@/mixins/tabPage'
169
+import pageViewport from '@/mixins/pageViewport'
169
 import { queryDrug, calculateWithdrawal, checkCompatibility } from '@/api/medication'
170
 import { queryDrug, calculateWithdrawal, checkCompatibility } from '@/api/medication'
170
 
171
 
171
 function todayYmd() {
172
 function todayYmd() {
@@ -221,7 +222,7 @@ export default {
221
     'up-icon': UIcon,
222
     'up-icon': UIcon,
222
     'up-calendar': UCalendar
223
     'up-calendar': UCalendar
223
   },
224
   },
224
-  mixins: [tabPage],
225
+  mixins: [tabPage, pageViewport],
225
   data() {
226
   data() {
226
     return {
227
     return {
227
       navTitleKey: 'homeGrid.medicineTools',
228
       navTitleKey: 'homeGrid.medicineTools',
@@ -428,7 +429,10 @@ export default {
428
   display: flex;
429
   display: flex;
429
   flex-direction: column;
430
   flex-direction: column;
430
   min-width: 0;
431
   min-width: 0;
432
+  width: 100%;
433
+  height: 100%;
431
   min-height: 100%;
434
   min-height: 100%;
435
+  overflow: hidden;
432
   box-sizing: border-box;
436
   box-sizing: border-box;
433
   background: #ffffff;
437
   background: #ffffff;
434
 }
438
 }

+ 6 - 2
ruoyi-ui-app/package-a/vet-profile/index.vue

@@ -1,6 +1,6 @@
1
 <template>
1
 <template>
2
   <!-- 兽医资料:列表项已含全部字段,见在线问诊接口说明 -->
2
   <!-- 兽医资料:列表项已含全部字段,见在线问诊接口说明 -->
3
-  <view :class="pageRootClass" class="tab-page vp-page">
3
+  <view :class="pageRootClass" class="tab-page vp-page" :style="pageStyle">
4
     <scroll-view scroll-y class="vp-scroll" enable-back-to-top :show-scrollbar="false">
4
     <scroll-view scroll-y class="vp-scroll" enable-back-to-top :show-scrollbar="false">
5
       <view class="vp-card">
5
       <view class="vp-card">
6
         <view class="vp-hero">
6
         <view class="vp-hero">
@@ -49,6 +49,7 @@
49
 import UAvatar from 'uview-plus/components/u-avatar/u-avatar.vue'
49
 import UAvatar from 'uview-plus/components/u-avatar/u-avatar.vue'
50
 import UButton from 'uview-plus/components/u-button/u-button.vue'
50
 import UButton from 'uview-plus/components/u-button/u-button.vue'
51
 import tabPage from '@/mixins/tabPage'
51
 import tabPage from '@/mixins/tabPage'
52
+import pageViewport from '@/mixins/pageViewport'
52
 import { resolveResourceUrl } from '@/utils/resourceUrl'
53
 import { resolveResourceUrl } from '@/utils/resourceUrl'
53
 import { ensureApiToken } from '@/utils/apiAuth'
54
 import { ensureApiToken } from '@/utils/apiAuth'
54
 import {
55
 import {
@@ -64,7 +65,7 @@ export default {
64
     'up-avatar': UAvatar,
65
     'up-avatar': UAvatar,
65
     'up-button': UButton
66
     'up-button': UButton
66
   },
67
   },
67
-  mixins: [tabPage],
68
+  mixins: [tabPage, pageViewport],
68
   data() {
69
   data() {
69
     return {
70
     return {
70
       navTitleKey: 'vetProfilePage.navTitle',
71
       navTitleKey: 'vetProfilePage.navTitle',
@@ -171,7 +172,10 @@ export default {
171
   display: flex;
172
   display: flex;
172
   flex-direction: column;
173
   flex-direction: column;
173
   min-width: 0;
174
   min-width: 0;
175
+  width: 100%;
176
+  height: 100%;
174
   min-height: 100%;
177
   min-height: 100%;
178
+  overflow: hidden;
175
   box-sizing: border-box;
179
   box-sizing: border-box;
176
 }
180
 }
177
 
181
 

+ 6 - 2
ruoyi-ui-app/package-a/yak-market/index.vue

@@ -1,6 +1,6 @@
1
 <template>
1
 <template>
2
   <!-- 牦牛行情:顶卡主价;中段走势/预测;底虚拟列表每日行情(见 doc/耗牛行情.md) -->
2
   <!-- 牦牛行情:顶卡主价;中段走势/预测;底虚拟列表每日行情(见 doc/耗牛行情.md) -->
3
-  <view :class="pageRootClass" class="tab-page ym-page">
3
+  <view :class="pageRootClass" class="tab-page ym-page" :style="pageStyle">
4
     <scroll-view scroll-y class="ym-scroll" enable-back-to-top :show-scrollbar="false" @scrolltolower="onScrollToLower">
4
     <scroll-view scroll-y class="ym-scroll" enable-back-to-top :show-scrollbar="false" @scrolltolower="onScrollToLower">
5
       <!-- 1. 主行情卡 -->
5
       <!-- 1. 主行情卡 -->
6
       <up-card :show-head="false" :show-foot="false" :border="true" :border-radius="16" margin="24rpx 24rpx 0" :body-style="{ padding: '24rpx' }">
6
       <up-card :show-head="false" :show-foot="false" :border="true" :border-radius="16" margin="24rpx 24rpx 0" :body-style="{ padding: '24rpx' }">
@@ -162,6 +162,7 @@ import USubsection from 'uview-plus/components/u-subsection/u-subsection.vue'
162
 import UDivider from 'uview-plus/components/u-divider/u-divider.vue'
162
 import UDivider from 'uview-plus/components/u-divider/u-divider.vue'
163
 import UVirtualList from 'uview-plus/components/u-virtual-list/u-virtual-list.vue'
163
 import UVirtualList from 'uview-plus/components/u-virtual-list/u-virtual-list.vue'
164
 import tabPage from '@/mixins/tabPage'
164
 import tabPage from '@/mixins/tabPage'
165
+import pageViewport from '@/mixins/pageViewport'
165
 import {
166
 import {
166
   getYakMarketYesterday,
167
   getYakMarketYesterday,
167
   getYakMarketStats7,
168
   getYakMarketStats7,
@@ -212,7 +213,7 @@ export default {
212
     'up-virtual-list': UVirtualList,
213
     'up-virtual-list': UVirtualList,
213
     mpvueEcharts
214
     mpvueEcharts
214
   },
215
   },
215
-  mixins: [tabPage],
216
+  mixins: [tabPage, pageViewport],
216
   data() {
217
   data() {
217
     return {
218
     return {
218
       navTitleKey: 'yakMarketPage.navTitle',
219
       navTitleKey: 'yakMarketPage.navTitle',
@@ -553,7 +554,10 @@ export default {
553
   display: flex;
554
   display: flex;
554
   flex-direction: column;
555
   flex-direction: column;
555
   min-width: 0;
556
   min-width: 0;
557
+  width: 100%;
558
+  height: 100%;
556
   min-height: 100%;
559
   min-height: 100%;
560
+  overflow: hidden;
557
   box-sizing: border-box;
561
   box-sizing: border-box;
558
   background: $morandi-bg-page;
562
   background: $morandi-bg-page;
559
 }
563
 }

+ 10 - 5
ruoyi-ui-app/pages.json

@@ -182,13 +182,15 @@
182
         {
182
         {
183
           "path": "booking-vet/index",
183
           "path": "booking-vet/index",
184
           "style": {
184
           "style": {
185
-            "navigationBarTitleText": "预约兽医"
185
+            "navigationBarTitleText": "预约兽医",
186
+            "disableScroll": true
186
           }
187
           }
187
         },
188
         },
188
         {
189
         {
189
           "path": "booking-expert/index",
190
           "path": "booking-expert/index",
190
           "style": {
191
           "style": {
191
-            "navigationBarTitleText": "预约专家"
192
+            "navigationBarTitleText": "预约专家",
193
+            "disableScroll": true
192
           }
194
           }
193
         },
195
         },
194
         {
196
         {
@@ -201,19 +203,22 @@
201
         {
203
         {
202
           "path": "booking-org/index",
204
           "path": "booking-org/index",
203
           "style": {
205
           "style": {
204
-            "navigationBarTitleText": "预约机构"
206
+            "navigationBarTitleText": "预约机构",
207
+            "disableScroll": true
205
           }
208
           }
206
         },
209
         },
207
         {
210
         {
208
           "path": "online-clinic/index",
211
           "path": "online-clinic/index",
209
           "style": {
212
           "style": {
210
-            "navigationBarTitleText": "在线问诊"
213
+            "navigationBarTitleText": "在线问诊",
214
+            "disableScroll": true
211
           }
215
           }
212
         },
216
         },
213
         {
217
         {
214
           "path": "vet-profile/index",
218
           "path": "vet-profile/index",
215
           "style": {
219
           "style": {
216
-            "navigationBarTitleText": "兽医资料"
220
+            "navigationBarTitleText": "兽医资料",
221
+            "disableScroll": true
217
           }
222
           }
218
         },
223
         },
219
         {
224
         {