Browse Source

增加临时跳转页

jwyu 1 year ago
parent
commit
db033f8e6f
2 changed files with 52 additions and 0 deletions
  1. 3 0
      pages.json
  2. 49 0
      pages/transitionPage.vue

+ 3 - 0
pages.json

@@ -106,6 +106,9 @@
 			"style": {
 				"navigationBarTitleText": "持仓分析"
 			}
+		},
+		{
+			"path":"pages/transitionPage"
 		}
 	],
 	"subPackages":[

+ 49 - 0
pages/transitionPage.vue

@@ -0,0 +1,49 @@
+<template>
+    <view>
+        
+    </view>
+</template>
+
+<script>
+import {apiReportList} from '@/api/report'
+export default {
+    data() {
+        return {
+            
+        }
+    },
+    onLoad(opt){
+        if(opt.type=='week'){
+            this.getWeekList()
+        }
+    },
+    methods: {
+        // 获取最新周报跳转过去
+        async getWeekList(){
+            const env=uni.getAccountInfoSync().miniProgram
+            let id
+            if(env.envVersion==='release'){
+                id=125
+            }else{
+                id=198
+            }
+            const res=await apiReportList({
+                classify_id_first:id
+            })
+            if(res.code===200){
+                const arr=res.data.list||[]
+                uni.reLaunch({
+                    url: '/pages-report/chapterList?reportId='+arr[0].report_id,
+                    success: (result) => {},
+                    fail: () => {},
+                    complete: () => {}
+                });
+            }
+        }
+    },
+}
+</script>
+
+<style>
+
+</style>