index.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view class="content">
  3. <view class="one">
  4. <image :src="basicInfo.logo_url&&basicInfo.logo_url.length>0?basicInfo.logo_url[0].url:''" mode="aspectFit">
  5. </image>
  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. basicInfo: {},
  28. timer: null,
  29. }
  30. },
  31. onLoad() {},
  32. onShow() {
  33. const that = this;
  34. that.search();
  35. },
  36. methods: {
  37. async search() {
  38. const that = this;
  39. let url = '/pagesHome/home/index';
  40. let res = await that.$api('appbasic', 'GET', {});
  41. if (res.errcode == '0') {
  42. that.$set(that, `basicInfo`, res.data)
  43. uni.setStorage({
  44. key: 'basicInfo',
  45. data: res.data,
  46. success: function() {
  47. // 不可返回
  48. // uni.redirectTo({
  49. // url
  50. // })
  51. // 可返回
  52. uni.redirectTo({
  53. url
  54. })
  55. }
  56. });
  57. } else {
  58. uni.showToast({
  59. title: res.errmsg,
  60. icon: 'none'
  61. })
  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 var(--rgbf1f);
  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>