transitionPage.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <view>
  3. </view>
  4. </template>
  5. <script>
  6. import {apiReportList} from '@/api/report'
  7. export default {
  8. data() {
  9. return {
  10. }
  11. },
  12. onLoad(opt){
  13. if(opt.type=='week'){
  14. this.getWeekList()
  15. }
  16. },
  17. methods: {
  18. // 获取最新周报跳转过去
  19. async getWeekList(){
  20. const env=uni.getAccountInfoSync().miniProgram
  21. let id
  22. if(env.envVersion==='release'){
  23. id=125
  24. }else{
  25. id=198
  26. }
  27. const res=await apiReportList({
  28. classify_id_first:id
  29. })
  30. if(res.code===200){
  31. const arr=res.data.list||[]
  32. uni.reLaunch({
  33. url: '/pages-report/chapterList?reportId='+arr[0].report_id,
  34. success: (result) => {},
  35. fail: () => {},
  36. complete: () => {}
  37. });
  38. }
  39. }
  40. },
  41. }
  42. </script>
  43. <style>
  44. </style>