city.vue 762 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <t-index-address @select="select"></t-index-address>
  3. </template>
  4. <script>
  5. export default {
  6. data() {
  7. return {
  8. type:''
  9. }
  10. },
  11. onLoad(options) {
  12. if(options.type=='indent'){
  13. this.type = options.type
  14. }
  15. // 计算出可用高度
  16. // this.windowHeight = uni.getSystemInfoSync().windowHeight-100+"px";
  17. },
  18. methods: {
  19. // 选中事件
  20. select(data) {
  21. if(this.type== 'indent'){
  22. uni.setStorage({
  23. key: 'jsCity',
  24. data: data.name,
  25. success: function () {
  26. uni.navigateBack()
  27. }
  28. });
  29. }else{
  30. uni.setStorage({
  31. key: 'selectCity',
  32. data: data.name,
  33. success: function () {
  34. uni.navigateBack()
  35. }
  36. });
  37. }
  38. }
  39. }
  40. }
  41. </script>
  42. <style>
  43. </style>