index.vue 1.8 KB

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