index.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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/recom/index?act_tags=xpsj`
  56. // url: `/pagesHome/market/search`
  57. url: `/pages/home/index`
  58. })
  59. }
  60. });
  61. }
  62. });
  63. },
  64. }
  65. }
  66. </script>
  67. <style lang="scss">
  68. .main {
  69. display: flex;
  70. flex-direction: column;
  71. width: 100vw;
  72. height: 100vh;
  73. .one {
  74. text-align: center;
  75. margin: 40vw 0 0 0;
  76. .logo {
  77. width: 50vw;
  78. height: 50vw;
  79. border-radius: 90px;
  80. box-shadow: 0 0 5px #f1f1f1;
  81. }
  82. }
  83. }
  84. </style>