harry hai 1 ano
pai
achega
ab4d6afb41
Modificáronse 4 ficheiros con 16 adicións e 25 borrados
  1. 0 18
      package.json
  2. 8 4
      src/pages/category/index.tsx
  3. 0 1
      src/pages/share/share.tsx
  4. 8 2
      src/utils/index.ts

+ 0 - 18
package.json

@@ -11,25 +11,13 @@
   },
   "scripts": {
     "build:weapp": "taro build --type weapp",
-    "build:swan": "taro build --type swan",
-    "build:alipay": "taro build --type alipay",
-    "build:tt": "taro build --type tt",
     "build:h5": "taro build --type h5",
     "build:rn": "taro build --type rn",
-    "build:qq": "taro build --type qq",
-    "build:jd": "taro build --type jd",
     "build:quickapp": "taro build --type quickapp",
-    "build:harmony-hybrid": "taro build --type harmony-hybrid",
     "dev:weapp": "npm run build:weapp -- --watch",
-    "dev:swan": "npm run build:swan -- --watch",
-    "dev:alipay": "npm run build:alipay -- --watch",
-    "dev:tt": "npm run build:tt -- --watch",
     "dev:h5": "npm run build:h5 -- --watch",
     "dev:rn": "npm run build:rn -- --watch",
-    "dev:qq": "npm run build:qq -- --watch",
-    "dev:jd": "npm run build:jd -- --watch",
     "dev:quickapp": "npm run build:quickapp -- --watch",
-    "dev:harmony-hybrid": "npm run build:harmony-hybrid -- --watch",
     "test": "jest",
     "script": "node ./script/index.mjs"
   },
@@ -45,13 +33,7 @@
     "@tarojs/components": "3.6.23",
     "@tarojs/helper": "3.6.23",
     "@tarojs/plugin-platform-weapp": "3.6.23",
-    "@tarojs/plugin-platform-alipay": "3.6.23",
-    "@tarojs/plugin-platform-tt": "3.6.23",
-    "@tarojs/plugin-platform-swan": "3.6.23",
-    "@tarojs/plugin-platform-jd": "3.6.23",
-    "@tarojs/plugin-platform-qq": "3.6.23",
     "@tarojs/plugin-platform-h5": "3.6.23",
-    "@tarojs/plugin-platform-harmony-hybrid": "3.6.23",
     "@tarojs/runtime": "3.6.23",
     "@tarojs/shared": "3.6.23",
     "@tarojs/taro": "3.6.23",

+ 8 - 4
src/pages/category/index.tsx

@@ -7,7 +7,7 @@ import { videoListV2 } from '@/http/api'
 import VideoSwiper from '@/components/VideoSwiper'
 import { sharePageAppMessage } from '@/shareHelper'
 import Route from '@/class/Route'
-import { filterCardProps } from '@/utils/index'
+import { filterCardProps, pxToRpx } from '@/utils/index'
 import { CATEGORY_PAGESOURCE } from '@/const/index'
 
 // import { getTopSafeHeight, throttle, formatSecondsAsTime, getPreIds } from '@/utils'
@@ -28,7 +28,7 @@ export default function Index() {
     const [needResumePlay, setNeedResumePlay] = useState(false)
     const [toSharePage, setToSharePage] = useState(false)
     const [flushList, setFlushList] = useState(false)
-
+    const [botHeight, setBotHeight] = useState(0)
     useLoad(() => {
         const { redirect } = params
         let dur = 0
@@ -42,6 +42,11 @@ export default function Index() {
         setTimeout(() => {
             fecthVideoListV2()
         }, dur);
+
+        const systemInfo = Taro.$global.get('systemInfo')
+        let { screenHeight = 0 } = systemInfo
+        let { bottom = 0 } = systemInfo.safeArea || {}
+        setBotHeight(screenHeight - bottom)
     })
 
     useDidShow(() => {
@@ -126,9 +131,8 @@ export default function Index() {
         }
     }
 
-
     return (
-        <View className='category-page'>
+        <View className='category-page' style={{ height: 'calc(100% - ' +  `${Math.floor(pxToRpx(55))}px - ` + `${botHeight}px);` }}>
             <VideoSwiper
                 list={videoList}
                 flushList={flushList}

+ 0 - 1
src/pages/share/share.tsx

@@ -4,7 +4,6 @@ import { View, Image } from '@tarojs/components'
 import { VideoInfo } from '@/constants/commentTypes'
 import VideoSwiper from "@/components/VideoSwiper";
 import { videoDetail, recommendSharePageList } from '@/http/api'
-import { guid } from '@/utils/index'
 import { USER_SHARE_PAGESOURCE, RECOMMEND_PAGESOURCE } from '@/const/index'
 import './share.less'
 import { filterCardProps } from '@/utils/index'

+ 8 - 2
src/utils/index.ts

@@ -248,7 +248,7 @@ export function filterCardProps(list, pageSource) {
 export function getOption(options) {
     const { query } = options
     const { params, jumpPage } = formatQuery(query)
-  
+
     return {
         path: options.path || '',
         params: params,
@@ -256,4 +256,10 @@ export function getOption(options) {
         tabIndex: 0,
         categoryIndex: 55
     }
-  }
+}
+
+export function pxToRpx(num) {
+    const systemInfo = Taro.$global.get('systemInfo')
+    let { screenWidth = 375 } = systemInfo
+    return num / 375 * screenWidth
+}