index.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view class="content">
  3. <view class="one">
  4. <image :src="logoUrl" mode="aspectFit"></image>
  5. <view class="version">{{versionInfo.version}}</view>
  6. </view>
  7. <view class="two">
  8. <view class="two_1">
  9. 抵制不良游戏,拒绝盗版游戏。
  10. </view>
  11. <view class="two_1">
  12. 注意自我保护,谨防受骗上当。
  13. </view>
  14. <view class="two_1">
  15. 适度游戏宜脑,沉迷游戏伤身体。
  16. </view>
  17. <view class="two_1">
  18. 合理安排时间,享受健康时间。
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. data() {
  26. return {
  27. logoUrl: 'https://broadcast.waityou24.cn/files/test/20230116145912.jpg',
  28. timer: null,
  29. versionInfo: {},
  30. }
  31. },
  32. onLoad() {
  33. const that = this;
  34. that.search('/pagesHome/home/index');
  35. },
  36. onShow() {
  37. const that = this;
  38. // 获取版本信息
  39. plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
  40. that.$set(that, `versionInfo`, wgtinfo)
  41. that.setTitle(wgtinfo)
  42. })
  43. },
  44. methods: {
  45. async search(e) {
  46. const that = this;
  47. uni.redirectTo({
  48. url: e
  49. })
  50. // that.timer = setTimeout(() => {
  51. // uni.redirectTo({
  52. // url: e
  53. // })
  54. // clearTimeout(that.timer);
  55. // that.timer = null;
  56. // }, 2000)
  57. },
  58. // 赋值标题栏
  59. setTitle(e) {
  60. uni.setNavigationBarTitle({
  61. title: e.name
  62. });
  63. }
  64. }
  65. }
  66. </script>
  67. <style lang="scss">
  68. .content {
  69. .one {
  70. flex-grow: 1;
  71. text-align: center;
  72. image {
  73. width: 50vw;
  74. height: 50vw;
  75. border-radius: 90%;
  76. box-shadow: 0 0 5px #f1f1f1;
  77. margin: 30vw 0 0 0;
  78. }
  79. .version {
  80. margin: 2vw 0 0 0;
  81. }
  82. }
  83. .two {
  84. text-align: center;
  85. padding: 10px 0;
  86. .two_1 {
  87. padding: 0 0 10px 0;
  88. font-size: 14px;
  89. }
  90. }
  91. }
  92. </style>