index.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <view class="content">
  3. <CustomNavbar></CustomNavbar>
  4. <view class="text-area">
  5. <text class="title">{{ title }}</text>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import CustomNavbar from '../../components/CustomNavbar.vue'
  11. export default {
  12. components: {
  13. CustomNavbar
  14. },
  15. data() {
  16. return {
  17. title: 'Hello'
  18. }
  19. },
  20. onLoad() {
  21. },
  22. async onShow() {
  23. },
  24. methods: {
  25. //获取天气(随便网上找的接口 可能会失效
  26. getWeatherList(page) {
  27. return new Promise((resolve, reject) => {
  28. this.$api('test', {}).then(res => {
  29. console.log('getWeatherList', res);
  30. resolve(true);
  31. }).catch((e) => {
  32. resolve(false);
  33. // console.log(e);
  34. });
  35. })
  36. },
  37. }
  38. }
  39. </script>
  40. <style lang="scss">
  41. .content {
  42. display: flex;
  43. flex-direction: column;
  44. align-items: center;
  45. justify-content: center;
  46. }
  47. .logo {
  48. height: 200rpx;
  49. width: 200rpx;
  50. margin-top: 200rpx;
  51. margin-left: auto;
  52. margin-right: auto;
  53. margin-bottom: 50rpx;
  54. }
  55. .text-area {
  56. display: flex;
  57. justify-content: center;
  58. }
  59. .title {
  60. font-size: 36rpx;
  61. color: #8f8f94;
  62. }
  63. </style>