index.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view class="main">
  3. <view class="one">
  4. <image class="logo" :src="logoUrl"></image>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. data() {
  11. return {
  12. logoUrl: ''
  13. };
  14. },
  15. onLoad: async function() {
  16. const that = this;
  17. await that.searchConfig();
  18. },
  19. methods: {
  20. // 查询基本设置
  21. async searchConfig() {
  22. const that = this;
  23. let res = await that.$api(`/config`, 'GET', {});
  24. if (res.errcode == '0') {
  25. that.$set(that, `logoUrl`, res.data.logo_url[0].url);
  26. uni.setStorage({
  27. key: 'config',
  28. data: res.data,
  29. success: function(res) {
  30. let url = `/pages/home/index`;
  31. uni.reLaunch({
  32. url
  33. })
  34. },
  35. fail: function(err) {
  36. console.log(err);
  37. }
  38. })
  39. }
  40. }
  41. },
  42. }
  43. </script>
  44. <style lang="scss" scoped>
  45. .main {
  46. display: flex;
  47. flex-direction: column;
  48. width: 100vw;
  49. height: 100vh;
  50. .one {
  51. text-align: center;
  52. margin: 40vw 0 0 0;
  53. .logo {
  54. width: 50vw;
  55. height: 50vw;
  56. border-radius: 90px;
  57. box-shadow: 0 0 5px var(--f1Color);
  58. }
  59. }
  60. }
  61. </style>