index.vue 924 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view class="content">
  3. <image class="logo" src="/static/logo.png"></image>
  4. <view class="text-area">
  5. <text class="title">{{title}}</text>
  6. <button @click="testQuery">测试查询</button>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. import Demo from "@/libs/model/demo.js";
  12. export default {
  13. data() {
  14. return {
  15. title: 'Hello'
  16. }
  17. },
  18. onLoad() {
  19. },
  20. methods: {
  21. async testQuery(){
  22. let res = await Demo.getInstance().getList();
  23. uni.showModal({
  24. content:JSON.stringify(res)
  25. })
  26. }
  27. }
  28. }
  29. </script>
  30. <style>
  31. .content {
  32. display: flex;
  33. flex-direction: column;
  34. align-items: center;
  35. justify-content: center;
  36. }
  37. .logo {
  38. height: 200rpx;
  39. width: 200rpx;
  40. margin-top: 200rpx;
  41. margin-left: auto;
  42. margin-right: auto;
  43. margin-bottom: 50rpx;
  44. }
  45. .text-area {
  46. display: flex;
  47. justify-content: center;
  48. }
  49. .title {
  50. font-size: 36rpx;
  51. color: #8f8f94;
  52. }
  53. </style>