index.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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' && res.total > 0) {
  30. let config = res.data[0];
  31. that.$set(that, `logoUrl`, config.config.share[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: `/pages/home/index`
  56. })
  57. }
  58. });
  59. }
  60. });
  61. },
  62. }
  63. }
  64. </script>
  65. <style lang="scss">
  66. .main {
  67. display: flex;
  68. flex-direction: column;
  69. width: 100vw;
  70. height: 100vh;
  71. .one {
  72. text-align: center;
  73. margin: 40vw 0 0 0;
  74. .logo {
  75. width: 50vw;
  76. height: 50vw;
  77. border-radius: 90px;
  78. box-shadow: 0 0 5px #f1f1f1;
  79. }
  80. }
  81. }
  82. </style>