index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <view class="content">
  3. <!-- <u--image :showLoading="true" :src="src" width="80px" height="80px" @click="click"></u--image> -->
  4. 我是首页
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. data() {
  10. return {
  11. src: 'https://cdn.uviewui.com/uview/album/1.jpg'
  12. }
  13. },
  14. onLoad() {
  15. },
  16. methods: {
  17. // get/post请求
  18. // test(){
  19. // // 发出post,假设需要带上token
  20. // postMenu({ custom: { auth: true }}).then(() => {
  21. // }).catch(() =>{
  22. // })
  23. // // await等待,注意与async结合使用
  24. // await postMenu({ custom: { auth: true }})
  25. // // 假设不需要在响应拦截器中自动弹出的toast,以及不想写catch(如果promise中进行reject,但是却没有catch的话会报错)
  26. // postMenu({ custom: { auth: true, toast: false, catch: false }}).then(() => {
  27. // })
  28. // // get请求
  29. // getMenu({ custom: { auth: true }}).then(() => {
  30. // }).catch(() =>{
  31. // })
  32. // // 也可以直接通过uni.$u.post发出请求,注意此处需要写上接口地址
  33. // uni.$u.http.post('/common/menu', { custom: { auth: true }}).then(() => {
  34. // }).catch(() =>{
  35. // })
  36. // }
  37. }
  38. }
  39. </script>
  40. <style>
  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>