list.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <indexed-list :options="list" :showSelect="false" @click="bindClick" />
  3. </template>
  4. <script>
  5. import {
  6. mapMutations
  7. } from "vuex"
  8. import airport from '@/common/utils/airport.js'
  9. import IndexedList from '@/components/indexed-list/indexed-list.vue'
  10. export default {
  11. components: {
  12. IndexedList
  13. },
  14. data() {
  15. return {
  16. list: airport.list
  17. }
  18. },
  19. methods: {
  20. ...mapMutations(["setCity"]),
  21. bindClick(e) {
  22. console.log('点击item,返回数据' + e.item.name + JSON.stringify(e))
  23. this.setCity(e.item.name)
  24. setTimeout(function() {
  25. uni.navigateBack({
  26. delta: 1
  27. })
  28. }, 500);
  29. }
  30. }
  31. }
  32. </script>
  33. <style>
  34. page {
  35. display: flex;
  36. flex-direction: column;
  37. box-sizing: border-box;
  38. background-color: #fff
  39. }
  40. view {
  41. font-size: 28upx;
  42. line-height: inherit
  43. }
  44. .example {
  45. padding: 0 30upx 30upx
  46. }
  47. .example-title {
  48. font-size: 32upx;
  49. line-height: 32upx;
  50. color: #777;
  51. margin: 40upx 25upx;
  52. position: relative
  53. }
  54. .example .example-title {
  55. margin: 40upx 0
  56. }
  57. .example-body {
  58. padding: 0 40upx
  59. }
  60. </style>