Browse Source

修改问题

lex 1 year ago
parent
commit
b5f13abc56
2 changed files with 17 additions and 10 deletions
  1. 1 1
      src/tenant/ranking-list/index.module.less
  2. 16 9
      src/tenant/ranking-list/index.tsx

+ 1 - 1
src/tenant/ranking-list/index.module.less

@@ -84,7 +84,7 @@
     position: absolute;
     z-index: 10;
     left: 13px;
-    top: 14px;
+    bottom: 8px;
     display: inline-block;
     font: 0.37333rem/1 vant-icon;
     font-size: inherit;

+ 16 - 9
src/tenant/ranking-list/index.tsx

@@ -1,6 +1,6 @@
 import TheSticky from '@/components/the-sticky'
 import { computed, defineComponent, onMounted, reactive } from 'vue'
-import { useRoute } from 'vue-router'
+import { useRoute, useRouter } from 'vue-router'
 import styles from './index.module.less'
 import ColHeader from '@/components/col-header'
 import bgImg from './images/time-bg.png'
@@ -16,9 +16,12 @@ import { state as baseState } from '@/state'
 import studentLogo from '@/common/images/icon_student.png'
 import emptyLogo from './images/empty-logo.png'
 import ColResult from '@/components/col-result'
+import { browser } from '@/helpers/utils'
+import { postMessage } from '@/helpers/native-message'
 export default defineComponent({
   name: 'ranking-list',
   setup() {
+    const router = useRouter()
     const route = useRoute()
     const state = reactive({
       showPopoverTime: false,
@@ -85,13 +88,7 @@ export default defineComponent({
         )
         state.beforListShow = data.detail && data.detail.length > 0
         state.myInfo = data.head || {}
-        state.myInfo.trainTime = state.myInfo.trainTime
-          ? Math.floor(state.myInfo.trainTime / 60)
-          : 0
         state.list = data.detail || []
-        state.list.forEach((item: any) => {
-          item.trainTime = item.trainTime ? Math.floor(item.trainTime / 60) : 0
-        })
         state.firstInfo =
           state.list.length > 0 ? state.list.splice(0, 1)[0] : {}
         state.secondInfo =
@@ -128,7 +125,17 @@ export default defineComponent({
               {{
                 content: () => (
                   <>
-                    <Icon name="arrow-left" class={styles.backArrow} />
+                    <Icon
+                      name="arrow-left"
+                      class={styles.backArrow}
+                      onClick={() => {
+                        if (browser().isApp) {
+                          postMessage({ api: 'goBack' })
+                        } else {
+                          router.back()
+                        }
+                      }}
+                    />
                     <Tabs
                       lineWidth={22}
                       lineHeight={4}
@@ -290,7 +297,7 @@ export default defineComponent({
             )}
           </div>
           {state.myInfo?.userId ? (
-            <TheSticky position="bottom">
+            <TheSticky position="bottom" varName="--bottom-height">
               <Cell class={styles.selfInfo} border={false} center>
                 {{
                   icon: () => (