parkingFindCar.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. import uniPop from '@/components/uni-popup/uni-popup.vue';
  2. import { Dialog } from 'vant';
  3. import LoginDom from '@/components/Login/Login.vue';
  4. import {initWxJsSdkConfig} from '@/utils/login';
  5. // const app = getApp()
  6. const app = {};
  7. import {
  8. kipGetMemberVehicles,
  9. kipDeleteMemberVehicles,
  10. } from '@/utils/api-kip.js';
  11. import { LICENSE_PLATE_TYPE_ARR } from '@/constants.js';
  12. import { mapState } from 'vuex';
  13. // import authorize from '@/components/authorize/authorize.vue';
  14. import { isCruMarketByKey } from '@/utils/location-util.js';
  15. import MemberCacheTool from '@/utils/member-cache-tool.js';
  16. import { REG_SOURCE } from '@/constants.js';
  17. import uni from '@/utils/uniHooks.js';
  18. // import { vehicles as vehiclesList } from './list';
  19. import { wxToLoginCallback, isHZ } from '@/utils/index';
  20. import { Toast } from 'vant';
  21. import { getVehicles, delVehicle, parkingLots , getCarInformation} from '@/api/parking/index'
  22. export default {
  23. components: {
  24. uniPop,
  25. // authorize,
  26. LoginDom,
  27. },
  28. computed: {
  29. ...mapState({
  30. custTypeId: (state) => state.custTypeId,
  31. member: (state) => state.member,
  32. groupId: (state) => state.groupId,
  33. openid: (state) => state.openid,
  34. mallid: (state) => state.mallId,
  35. mobile: (state) => state.mobile,
  36. kipUserId: (state) => state.kipUserId,
  37. isLogin: (state) => state.isLogin,
  38. }),
  39. isNoLogin() {
  40. return JSON.stringify(this.member) === '{}'
  41. },
  42. isHZ() {
  43. return isHZ(this.mallid)
  44. }
  45. },
  46. data() {
  47. return {
  48. list: [],
  49. activeId: '',
  50. activeCarno: '',
  51. licensePlateList: [],
  52. isBeijing: false,
  53. options: null,
  54. preUrl: '',
  55. deleteDialogSwitch: false,
  56. deleteSuccessDialogSwitch: false,
  57. show: false, // 删除车牌时提示内容
  58. parkingLotsInfo: {},
  59. enableDiscountVehicle: false,
  60. dataObject: {
  61. vehicleNo: '',
  62. area: '',
  63. spaceNo: '',
  64. floorName: '',
  65. carImage: '',
  66. parkId: ''
  67. }
  68. };
  69. },
  70. async created() {
  71. this.options = this.$route.query;
  72. // this.parkingLots()
  73. },
  74. async mounted() {
  75. this.$nextTick(()=>{
  76. this.getCarInformations(this.options.vehicleNo)
  77. })
  78. await initWxJsSdkConfig(['checkJsApi', 'scanQRCode']);
  79. setTimeout(() => {
  80. uni.setNavigationBarTitle({
  81. title: '反向寻车',
  82. });
  83. }, 300);
  84. // setTimeout(() => {
  85. // window?.toWXSendMsg({
  86. // type: 'uni_func',
  87. // funcName: 'setNavigationBarColor',
  88. // options: {
  89. // frontColor: '#000000',
  90. // backgroundColor: '#FBFCFF',
  91. // },
  92. // });
  93. // }, 500)
  94. },
  95. onUnload() {
  96. // #ifdef MP-WEIXIN
  97. var pages = getCurrentPages();
  98. var prevPage = pages[pages.length - 2];
  99. console.log('==> 车牌管理-返回上一页');
  100. prevPage.setData({
  101. parkData: 'parkData',
  102. });
  103. // #endif
  104. // #ifdef H5
  105. uni.setStorage({
  106. key: 'parkData',
  107. data: 'parkData',
  108. success: function () {
  109. console.log('parkData-success');
  110. },
  111. });
  112. // #endif
  113. },
  114. methods: {
  115. // 获取反向寻车信息
  116. async getCarInformations(carNum) {
  117. const res = await getCarInformation(carNum)
  118. if (res.data) {
  119. this.dataObject = res.data
  120. }
  121. },
  122. isQHKC() {
  123. const lbsList = ['8a88a9fd7f73ffcd017f968739870006','8a8486a37f48f7bd017f4e5bddd10000','8a8486a37f48f7bd017f4e5bddd10000', '8aaa82ea804d07cd0180516ff03b0008']
  124. return lbsList.indexOf(this.mallid) > -1
  125. },
  126. findcarNum (){
  127. // 如果是北京的ETCP 微信支付宝通用版
  128. // if (this.isQHKC()) {
  129. wx.miniProgram.navigateTo({
  130. url: `../package-parkingFee/findCar?lotId=${encodeURIComponent(
  131. this.dataObject.parkId
  132. )}&parkNo=${encodeURIComponent(
  133. this.dataObject.spaceNo
  134. )}&carNo=${encodeURIComponent(
  135. this.dataObject.vehicleNo
  136. )}`,
  137. complete: function (res) {
  138. console.log('回调::', res)
  139. },
  140. success: function (res) {
  141. console.log('跳转成功::', res)
  142. },
  143. fail: function (err) {
  144. console.log('跳转失败::', res)
  145. }
  146. });
  147. // this.$router.back()
  148. return
  149. // }
  150. },
  151. },
  152. };