scan.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px'}">
  3. <image src="https://oss.familydaf.cn/sxsnfile/20260119/2322ddce87aa42e7b4906e4286c7ffe1.png" mode="widthFix" @click="handleHome"></image>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data(){
  9. return {
  10. }
  11. },
  12. onLoad(options) {
  13. this.handleLaunchOrShow(options)
  14. },
  15. methods:{
  16. async handleLaunchOrShow(options) {
  17. if(options.q){
  18. try{
  19. const decodedUrl = decodeURIComponent(options.q);
  20. const codeMatch = decodedUrl.match(/type=([^&]+)/);
  21. const stationCode = codeMatch ? codeMatch[1] : null;
  22. if(stationCode === 'scan') {
  23. // 关闭首页的加载/渲染,避免闪烁
  24. uni.hideHomeButton();
  25. return;
  26. }
  27. uni.reLaunch({ url: '/pages/home' });
  28. }catch(e){
  29. uni.reLaunch({ url: '/pages/home' });
  30. }
  31. }
  32. },
  33. handleHome(){
  34. uni.reLaunch({
  35. url:'/pages/home'
  36. })
  37. }
  38. }
  39. }
  40. </script>
  41. <style scoped lang="scss">
  42. .page{
  43. box-sizing: border-box;
  44. image{
  45. width: 100%;
  46. }
  47. }
  48. </style>