index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. <image class="logo" :src="logoUrl" mode=""></image>
  6. </view>
  7. </view>
  8. </mobile-frame>
  9. </template>
  10. <script>
  11. export default {
  12. components: {},
  13. data() {
  14. return {
  15. logoUrl: '',
  16. };
  17. },
  18. onLoad: function() {},
  19. onShow: function() {
  20. const that = this;
  21. that.searchConfig();
  22. that.search();
  23. },
  24. methods: {
  25. // 查询基本设置
  26. async searchConfig() {
  27. const that = this;
  28. let res = await that.$api(`/config`, 'GET', {});
  29. if (res.errcode == '0') {
  30. let config = res.data;
  31. that.$set(that, `logoUrl`, config.config.logo[0].url)
  32. uni.setStorage({
  33. key: 'config',
  34. data: config,
  35. success: function() {}
  36. });
  37. // 赋值默认值
  38. that.$config.share = {
  39. title: config.title,
  40. path: '/pages/index/index',
  41. imageUrl: config.config.share[0].url
  42. }
  43. }
  44. },
  45. async search() {
  46. const that = this;
  47. // 查询当前所在平台
  48. uni.getSystemInfo({
  49. success: async function(res) {
  50. uni.setStorage({
  51. key: 'system',
  52. data: res,
  53. success: function() {
  54. uni.redirectTo({
  55. // url: `/pagesRest/activity/list`
  56. url: `/pages/home/index`
  57. })
  58. }
  59. });
  60. }
  61. });
  62. },
  63. }
  64. }
  65. </script>
  66. <style lang="scss">
  67. .main {
  68. display: flex;
  69. flex-direction: column;
  70. width: 100vw;
  71. height: 100vh;
  72. .one {
  73. text-align: center;
  74. margin: 40vw 0 0 0;
  75. .logo {
  76. width: 50vw;
  77. height: 50vw;
  78. border-radius: 90px;
  79. box-shadow: 0 0 5px #f1f1f1;
  80. }
  81. }
  82. }
  83. </style>