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 class="two">
  8. <button @tap="toPopup('1')">打开弹框1</button>
  9. <button @tap="toPopup('2')">打开弹框2</button>
  10. <uni-popup ref="popup" background-color="#fff" type="bottom">
  11. <view class="popup">
  12. <view class="popup_1" v-if="popup.type=='1'">
  13. 弹框一
  14. </view>
  15. <view class="popup_1" v-else-if="popup.type=='2'">
  16. 弹框二
  17. </view>
  18. </view>
  19. </uni-popup>
  20. </view>
  21. </view>
  22. </mobile-frame>
  23. </template>
  24. <script>
  25. export default {
  26. components: {},
  27. data() {
  28. return {
  29. logoUrl: '',
  30. popup: {
  31. type: '1'
  32. }
  33. };
  34. },
  35. onLoad: function() {},
  36. onShow: function() {
  37. const that = this;
  38. that.search();
  39. },
  40. methods: {
  41. toPopup(e) {
  42. const that = this;
  43. that.$set(that.popup, `type`, e);
  44. that.$refs.popup.open();
  45. },
  46. search() {
  47. const that = this;
  48. that.$set(that, `logoUrl`, that.$config.logoUrl);
  49. // 查询当前所在平台
  50. uni.getSystemInfo({
  51. success: async function(res) {
  52. uni.setStorage({
  53. key: 'system',
  54. data: res,
  55. success: function() {
  56. // uni.redirectTo({
  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>