index.vue 1.9 KB

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