index.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. if (res.data &&res.data._id ) {
  43. that.$set(that, `basicInfo`, res.data)
  44. uni.setStorage({
  45. key: 'basicInfo',
  46. data: res.data,
  47. success: function() {
  48. uni.redirectTo({
  49. url
  50. })
  51. }
  52. });
  53. } else {
  54. uni.showToast({
  55. title: '程序缺少必要信息,暂不可使用!',
  56. icon: 'none'
  57. })
  58. }
  59. } else {
  60. uni.showToast({
  61. title: res.errmsg,
  62. icon: 'none'
  63. })
  64. }
  65. },
  66. }
  67. }
  68. </script>
  69. <style lang="scss">
  70. .content {
  71. .one {
  72. flex-grow: 1;
  73. text-align: center;
  74. image {
  75. width: 50vw;
  76. height: 50vw;
  77. border-radius: 90%;
  78. box-shadow: 0 0 5px var(--rgbf1f);
  79. margin: 30vw 0 0 0;
  80. }
  81. .version {
  82. margin: 2vw 0 0 0;
  83. }
  84. }
  85. .two {
  86. text-align: center;
  87. padding: 10px 0;
  88. .two_1 {
  89. padding: 0 0 10px 0;
  90. font-size: 14px;
  91. }
  92. }
  93. }
  94. </style>