xsh_1997 1 週間 前
コミット
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 1
 <template>
2 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 4
     <scroll-view scroll-y class="be-scroll" enable-back-to-top :show-scrollbar="false">
5 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 203
 import URate from 'uview-plus/components/u-rate/u-rate.vue'
204 204
 import UTextarea from 'uview-plus/components/u-textarea/u-textarea.vue'
205 205
 import tabPage from '@/mixins/tabPage'
206
+import pageViewport from '@/mixins/pageViewport'
206 207
 import { resolveResourceUrl } from '@/utils/resourceUrl'
207 208
 import { ensureApiToken } from '@/utils/apiAuth'
208 209
 import { useUserStore } from '@/store/user'
@@ -288,7 +289,7 @@ export default {
288 289
     'up-rate': URate,
289 290
     'up-textarea': UTextarea
290 291
   },
291
-  mixins: [tabPage],
292
+  mixins: [tabPage, pageViewport],
292 293
   data() {
293 294
     const slots = DEFAULT_TIME_SLOTS.slice()
294 295
     const defaultSlot = slots[slotIndexFromHour(slots)] || slots[0]
@@ -685,7 +686,10 @@ export default {
685 686
   display: flex;
686 687
   flex-direction: column;
687 688
   min-width: 0;
689
+  width: 100%;
690
+  height: 100%;
688 691
   min-height: 100%;
692
+  overflow: hidden;
689 693
   box-sizing: border-box;
690 694
   background: $morandi-bg-page;
691 695
 }

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

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

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

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

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

@@ -1,6 +1,6 @@
1 1
 <template>
2 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 4
     <scroll-view scroll-y class="mt-scroll" enable-back-to-top :show-scrollbar="false">
5 5
       <view class="mt-tabs-wrap">
6 6
         <up-tabs
@@ -166,6 +166,7 @@ import UButton from 'uview-plus/components/u-button/u-button.vue'
166 166
 import UIcon from 'uview-plus/components/u-icon/u-icon.vue'
167 167
 import UCalendar from 'uview-plus/components/u-calendar/u-calendar.vue'
168 168
 import tabPage from '@/mixins/tabPage'
169
+import pageViewport from '@/mixins/pageViewport'
169 170
 import { queryDrug, calculateWithdrawal, checkCompatibility } from '@/api/medication'
170 171
 
171 172
 function todayYmd() {
@@ -221,7 +222,7 @@ export default {
221 222
     'up-icon': UIcon,
222 223
     'up-calendar': UCalendar
223 224
   },
224
-  mixins: [tabPage],
225
+  mixins: [tabPage, pageViewport],
225 226
   data() {
226 227
     return {
227 228
       navTitleKey: 'homeGrid.medicineTools',
@@ -428,7 +429,10 @@ export default {
428 429
   display: flex;
429 430
   flex-direction: column;
430 431
   min-width: 0;
432
+  width: 100%;
433
+  height: 100%;
431 434
   min-height: 100%;
435
+  overflow: hidden;
432 436
   box-sizing: border-box;
433 437
   background: #ffffff;
434 438
 }

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

@@ -1,6 +1,6 @@
1 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 4
     <scroll-view scroll-y class="vp-scroll" enable-back-to-top :show-scrollbar="false">
5 5
       <view class="vp-card">
6 6
         <view class="vp-hero">
@@ -49,6 +49,7 @@
49 49
 import UAvatar from 'uview-plus/components/u-avatar/u-avatar.vue'
50 50
 import UButton from 'uview-plus/components/u-button/u-button.vue'
51 51
 import tabPage from '@/mixins/tabPage'
52
+import pageViewport from '@/mixins/pageViewport'
52 53
 import { resolveResourceUrl } from '@/utils/resourceUrl'
53 54
 import { ensureApiToken } from '@/utils/apiAuth'
54 55
 import {
@@ -64,7 +65,7 @@ export default {
64 65
     'up-avatar': UAvatar,
65 66
     'up-button': UButton
66 67
   },
67
-  mixins: [tabPage],
68
+  mixins: [tabPage, pageViewport],
68 69
   data() {
69 70
     return {
70 71
       navTitleKey: 'vetProfilePage.navTitle',
@@ -171,7 +172,10 @@ export default {
171 172
   display: flex;
172 173
   flex-direction: column;
173 174
   min-width: 0;
175
+  width: 100%;
176
+  height: 100%;
174 177
   min-height: 100%;
178
+  overflow: hidden;
175 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 1
 <template>
2 2
   <!-- 牦牛行情:顶卡主价;中段走势/预测;底虚拟列表每日行情(见 doc/耗牛行情.md) -->
3
-  <view :class="pageRootClass" class="tab-page ym-page">
3
+  <view :class="pageRootClass" class="tab-page ym-page" :style="pageStyle">
4 4
     <scroll-view scroll-y class="ym-scroll" enable-back-to-top :show-scrollbar="false" @scrolltolower="onScrollToLower">
5 5
       <!-- 1. 主行情卡 -->
6 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 162
 import UDivider from 'uview-plus/components/u-divider/u-divider.vue'
163 163
 import UVirtualList from 'uview-plus/components/u-virtual-list/u-virtual-list.vue'
164 164
 import tabPage from '@/mixins/tabPage'
165
+import pageViewport from '@/mixins/pageViewport'
165 166
 import {
166 167
   getYakMarketYesterday,
167 168
   getYakMarketStats7,
@@ -212,7 +213,7 @@ export default {
212 213
     'up-virtual-list': UVirtualList,
213 214
     mpvueEcharts
214 215
   },
215
-  mixins: [tabPage],
216
+  mixins: [tabPage, pageViewport],
216 217
   data() {
217 218
     return {
218 219
       navTitleKey: 'yakMarketPage.navTitle',
@@ -553,7 +554,10 @@ export default {
553 554
   display: flex;
554 555
   flex-direction: column;
555 556
   min-width: 0;
557
+  width: 100%;
558
+  height: 100%;
556 559
   min-height: 100%;
560
+  overflow: hidden;
557 561
   box-sizing: border-box;
558 562
   background: $morandi-bg-page;
559 563
 }

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

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