selectCity.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view class="">
  3. <citySelect @back_city="back_city"></citySelect>
  4. </view>
  5. </template>
  6. <script>
  7. import citySelect from '@/components/linzq-citySelect/linzq-citySelect.vue';
  8. export default {
  9. components: {
  10. citySelect
  11. },
  12. data() {
  13. return {
  14. statusBarHeight:''
  15. }
  16. },
  17. onLoad() {
  18. let that = this
  19. uni.getSystemInfo({
  20. success: function(res) {
  21. console.log("statusBarHeight", res.statusBarHeight)
  22. that.statusBarHeight += res.statusBarHeight + "px"; //这就是状态栏的高度
  23. },
  24. });
  25. },
  26. methods: {
  27. back_city(e) {
  28. if (e.positionName !== 'no') {
  29. this.region = e.positionName.cityName
  30. }
  31. if(!e.positionName.cityName){
  32. var tmp = e.positionName
  33. e.positionName = {}
  34. e.positionName.cityName = tmp
  35. }
  36. console.log("city:",e)
  37. uni.setStorage({
  38. key: 'depotAcquisition_selectCity',
  39. data: e,
  40. success() {
  41. uni.navigateBack()
  42. }
  43. });
  44. }
  45. }
  46. }
  47. </script>
  48. <style>
  49. .container {
  50. padding: 20px;
  51. font-size: 14px;
  52. line-height: 24px;
  53. }
  54. </style>