Quellcode durchsuchen

屏幕旋转提示在pc端不需要;pc端滚轮操作列表滚动

任一存 vor 1 Jahr
Ursprung
Commit
55a9508228
3 geänderte Dateien mit 24 neuen und 4 gelöschten Zeilen
  1. 3 4
      src/App.vue
  2. 14 0
      src/views/CommonDrawList.vue
  3. 7 0
      src/views/EntryList.vue

+ 3 - 4
src/App.vue

@@ -5,7 +5,7 @@
       <ToastComp v-if="isShowToast" />
     </Transition>
     <div
-      v-if="windowOrientation === 'portrait' && route.meta.windowOrientation === 'landscape'"
+      v-if="$isMobile && windowOrientation === 'portrait' && route.meta.windowOrientation === 'landscape'"
       class="force-landscape window-orientation-tip"
     >
       <div class="wrap">
@@ -24,7 +24,7 @@
       </div>
     </div>
     <div
-      v-if="windowOrientation === 'landscape' && route.meta.windowOrientation === 'portrait'"
+      v-if="$isMobile && windowOrientation === 'landscape' && route.meta.windowOrientation === 'portrait'"
       class="force-portrait window-orientation-tip"
     >
       <div class="wrap">
@@ -57,8 +57,7 @@ const {
   windowSizeWhenDesignForRef,
 } = useSizeAdapt()
 
-// inject('$uaInfo')
-// inject('$env')
+const $isMobile = inject('$isMobile')
 
 const { width: windowWidth, height: windowHeight } = useWindowSize()
 console.log(windowWidth)

+ 14 - 0
src/views/CommonDrawList.vue

@@ -13,7 +13,9 @@
     </div>
     <ul
       v-if="route.query.idx !== '5'"
+      ref="drawUlEl"
       class="common-draw-list"
+      @wheel="onDrawUlWheel"
     >
       <li
         v-for="(drawName, idx) in drawList"
@@ -30,7 +32,9 @@
     </ul>
     <ul
       v-if="route.query.idx !== '5'"
+      ref="groupUlEl"
       class="group-list"
+      @wheel="onGroupUlWheel"
     >
       <li
         v-for="(groupName, idx) in Object.keys(groupList)"
@@ -173,6 +177,16 @@ function onClickLike(e) {
     utils.animateCSS(e.target, 'heartBeat')
   }, 0)
 }
+
+const drawUlEl = ref(null)
+function onDrawUlWheel(e) {
+  drawUlEl.value.scrollLeft -= e.wheelDelta
+}
+
+const groupUlEl = ref(null)
+function onGroupUlWheel(e) {
+  groupUlEl.value.scrollLeft -= e.wheelDelta
+}
 </script>
 
 <style>

+ 7 - 0
src/views/EntryList.vue

@@ -21,7 +21,9 @@
 
     <ul
       v-show="!isShowForeword || hasShownForword"
+      ref="ulEl"
       class="entry-list"
+      @wheel="onWheel"
     >
       <li
         v-for="idx in 6"
@@ -95,6 +97,11 @@ function onClickSkip() {
     hasShownForword.value = true
   }
 }
+
+const ulEl = ref(null)
+function onWheel(e) {
+  ulEl.value.scrollLeft -= e.wheelDelta
+}
 </script>
 
 <style lang="less" scoped>