|
@@ -1,378 +1,377 @@
|
|
|
- import uniPop from '@/components/uni-popup/uni-popup.vue';
|
|
|
- import { Dialog } from 'vant';
|
|
|
- import LoginDom from '@/components/Login/Login.vue';
|
|
|
- // const app = getApp()
|
|
|
- const app = {};
|
|
|
- import {
|
|
|
+import uniPop from '@/components/uni-popup/uni-popup.vue';
|
|
|
+import { Dialog } from 'vant';
|
|
|
+import LoginDom from '@/components/Login/Login.vue';
|
|
|
+// const app = getApp()
|
|
|
+const app = {};
|
|
|
+import {
|
|
|
kipGetMemberVehicles,
|
|
|
kipDeleteMemberVehicles,
|
|
|
} from '@/utils/api-kip.js';
|
|
|
- import { LICENSE_PLATE_TYPE_ARR } from '@/constants.js';
|
|
|
- import { mapState } from 'vuex';
|
|
|
- // import authorize from '@/components/authorize/authorize.vue';
|
|
|
- import { isCruMarketByKey } from '@/utils/location-util.js';
|
|
|
- import MemberCacheTool from '@/utils/member-cache-tool.js';
|
|
|
- import { REG_SOURCE } from '@/constants.js';
|
|
|
- import uni from '@/utils/uniHooks.js';
|
|
|
- // import { vehicles as vehiclesList } from './list';
|
|
|
- import { wxToLoginCallback } from '@/utils/index';
|
|
|
- import { Toast } from 'vant';
|
|
|
+import { LICENSE_PLATE_TYPE_ARR } from '@/constants.js';
|
|
|
+import { mapState } from 'vuex';
|
|
|
+// import authorize from '@/components/authorize/authorize.vue';
|
|
|
+import { isCruMarketByKey } from '@/utils/location-util.js';
|
|
|
+import MemberCacheTool from '@/utils/member-cache-tool.js';
|
|
|
+import { REG_SOURCE } from '@/constants.js';
|
|
|
+import uni from '@/utils/uniHooks.js';
|
|
|
+// import { vehicles as vehiclesList } from './list';
|
|
|
+import { wxToLoginCallback } from '@/utils/index';
|
|
|
+import { Toast } from 'vant';
|
|
|
|
|
|
- export default {
|
|
|
+export default {
|
|
|
components: {
|
|
|
- uniPop,
|
|
|
- // authorize,
|
|
|
- LoginDom,
|
|
|
-},
|
|
|
+ uniPop,
|
|
|
+ // authorize,
|
|
|
+ LoginDom,
|
|
|
+ },
|
|
|
computed: {
|
|
|
- ...mapState({
|
|
|
- custTypeId: (state) => state.custTypeId,
|
|
|
- member: (state) => state.member,
|
|
|
- groupId: (state) => state.groupId,
|
|
|
- openid: (state) => state.openid,
|
|
|
- mallid: (state) => state.mallId,
|
|
|
- mobile: (state) => state.mobile,
|
|
|
-}),
|
|
|
-},
|
|
|
+ ...mapState({
|
|
|
+ custTypeId: (state) => state.custTypeId,
|
|
|
+ member: (state) => state.member,
|
|
|
+ groupId: (state) => state.groupId,
|
|
|
+ openid: (state) => state.openid,
|
|
|
+ mallid: (state) => state.mallId,
|
|
|
+ mobile: (state) => state.mobile,
|
|
|
+ }),
|
|
|
+ },
|
|
|
data() {
|
|
|
- return {
|
|
|
- list: [],
|
|
|
- activeId: '',
|
|
|
- activeCarno: '',
|
|
|
- licensePlateList: [],
|
|
|
- isBeijing: false,
|
|
|
- options: null,
|
|
|
- preUrl: '',
|
|
|
- deleteDialogSwitch: false,
|
|
|
- deleteSuccessDialogSwitch: false,
|
|
|
-};
|
|
|
-},
|
|
|
+ return {
|
|
|
+ list: [],
|
|
|
+ activeId: '',
|
|
|
+ activeCarno: '',
|
|
|
+ licensePlateList: [],
|
|
|
+ isBeijing: false,
|
|
|
+ options: null,
|
|
|
+ preUrl: '',
|
|
|
+ deleteDialogSwitch: false,
|
|
|
+ deleteSuccessDialogSwitch: false,
|
|
|
+ };
|
|
|
+ },
|
|
|
|
|
|
async created() {
|
|
|
- const option = this.$route.query;
|
|
|
- this.options = option;
|
|
|
- await this.$onLaunched;
|
|
|
- this.localimgPic = this.$staticPicUrl + '/wxminilocalimg/parkingFee/';
|
|
|
- // #ifdef H5
|
|
|
- app.globalData.member = JSON.parse(uni.getStorageSync('member'));
|
|
|
- // #endif
|
|
|
- // 场景二维码记录(是否扫码进入)
|
|
|
- app.globalData.paramsScene = {};
|
|
|
- this.$saveSceneQrcodeDetail(
|
|
|
- 'page',
|
|
|
- 'vehicleManagement',
|
|
|
- '车牌管理',
|
|
|
- '',
|
|
|
- '',
|
|
|
- '',
|
|
|
- ''
|
|
|
- );
|
|
|
- // 埋点本地化
|
|
|
- this.preUrl = uni.getStorageSync('previousUrl');
|
|
|
- uni.setStorageSync(
|
|
|
- 'previousUrl',
|
|
|
- '/pages/parkingFee/vehicleManagement.vue'
|
|
|
- );
|
|
|
-},
|
|
|
+ const option = this.$route.query;
|
|
|
+ this.options = option;
|
|
|
+ await this.$onLaunched;
|
|
|
+ this.localimgPic = this.$staticPicUrl + '/wxminilocalimg/parkingFee/';
|
|
|
+ // #ifdef H5
|
|
|
+ app.globalData.member = JSON.parse(uni.getStorageSync('member'));
|
|
|
+ // #endif
|
|
|
+ // 场景二维码记录(是否扫码进入)
|
|
|
+ app.globalData.paramsScene = {};
|
|
|
+ this.$saveSceneQrcodeDetail(
|
|
|
+ 'page',
|
|
|
+ 'vehicleManagement',
|
|
|
+ '车牌管理',
|
|
|
+ '',
|
|
|
+ '',
|
|
|
+ '',
|
|
|
+ ''
|
|
|
+ );
|
|
|
+ // 埋点本地化
|
|
|
+ this.preUrl = uni.getStorageSync('previousUrl');
|
|
|
+ uni.setStorageSync(
|
|
|
+ 'previousUrl',
|
|
|
+ '/pages/parkingFee/vehicleManagement.vue'
|
|
|
+ );
|
|
|
+ },
|
|
|
async mounted() {
|
|
|
- setTimeout(() => {
|
|
|
- uni.setNavigationBarTitle({
|
|
|
- title: '车辆管理',
|
|
|
-});
|
|
|
-}, 300);
|
|
|
- // await this.$onLaunched
|
|
|
- this.isBeijing = isCruMarketByKey('北京');
|
|
|
- const member = uni.getStorageSync('member');
|
|
|
- if (JSON.stringify(this.member) !== '{}') {
|
|
|
- this.getKipMemberVehicles();
|
|
|
-} else {
|
|
|
- wxToLoginCallback('vehicleManagement', (options) => {
|
|
|
- // console.log(229, options);
|
|
|
- if ( options?.noLoginParkingFeeWebView === 'fail' ) {
|
|
|
- // 如果是用户明确拒绝登录,执行这段逻辑
|
|
|
- Toast({
|
|
|
- message: '您还未登录,请登录',
|
|
|
- icon: 'none',
|
|
|
- onClose: () => {
|
|
|
- this.$router.back();
|
|
|
-},
|
|
|
-});
|
|
|
-
|
|
|
-} else {
|
|
|
- this.$router.back()
|
|
|
-}
|
|
|
-});
|
|
|
- // const regSource = REG_SOURCE.PARKING;
|
|
|
- // app.globalData.regSource = regSource;
|
|
|
- // if (this.options?.regSource) {
|
|
|
- // app.globalData.regSource = REG_SOURCE[this.options?.regSource];
|
|
|
- // }
|
|
|
- // if (this.options?.tpName) {
|
|
|
- // app.globalData.tpName = this.options?.tpName;
|
|
|
- // }
|
|
|
- // // this.$refs.authorize.login('/pages/parkingFee/parkingFee', () => {
|
|
|
- // // this.getKipMemberVehicles()
|
|
|
- // // })
|
|
|
- // this.getKipMemberVehicles();
|
|
|
-}
|
|
|
-},
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title: '车辆管理',
|
|
|
+ });
|
|
|
+ }, 300);
|
|
|
+ // await this.$onLaunched
|
|
|
+ this.isBeijing = isCruMarketByKey('北京');
|
|
|
+ const member = uni.getStorageSync('member');
|
|
|
+ if (JSON.stringify(this.member) !== '{}') {
|
|
|
+ this.getKipMemberVehicles();
|
|
|
+ } else {
|
|
|
+ wxToLoginCallback('vehicleManagement', (options) => {
|
|
|
+ // console.log(229, options);
|
|
|
+ if (options?.noLoginParkingFeeWebView === 'fail') {
|
|
|
+ // 如果是用户明确拒绝登录,执行这段逻辑
|
|
|
+ Toast({
|
|
|
+ message: '您还未登录,请登录',
|
|
|
+ icon: 'none',
|
|
|
+ onClose: () => {
|
|
|
+ this.$router.back();
|
|
|
+ },
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$router.back();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // const regSource = REG_SOURCE.PARKING;
|
|
|
+ // app.globalData.regSource = regSource;
|
|
|
+ // if (this.options?.regSource) {
|
|
|
+ // app.globalData.regSource = REG_SOURCE[this.options?.regSource];
|
|
|
+ // }
|
|
|
+ // if (this.options?.tpName) {
|
|
|
+ // app.globalData.tpName = this.options?.tpName;
|
|
|
+ // }
|
|
|
+ // // this.$refs.authorize.login('/pages/parkingFee/parkingFee', () => {
|
|
|
+ // // this.getKipMemberVehicles()
|
|
|
+ // // })
|
|
|
+ // this.getKipMemberVehicles();
|
|
|
+ }
|
|
|
+ },
|
|
|
onUnload() {
|
|
|
- // #ifdef MP-WEIXIN
|
|
|
- var pages = getCurrentPages();
|
|
|
- var prevPage = pages[pages.length - 2];
|
|
|
- console.log('==> 车牌管理-返回上一页');
|
|
|
- prevPage.setData({
|
|
|
- parkData: 'parkData',
|
|
|
-});
|
|
|
- // #endif
|
|
|
- // #ifdef H5
|
|
|
- uni.setStorage({
|
|
|
- key: 'parkData',
|
|
|
- data: 'parkData',
|
|
|
- success: function () {
|
|
|
- console.log('parkData-success');
|
|
|
-},
|
|
|
-});
|
|
|
- // #endif
|
|
|
-},
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+ var pages = getCurrentPages();
|
|
|
+ var prevPage = pages[pages.length - 2];
|
|
|
+ console.log('==> 车牌管理-返回上一页');
|
|
|
+ prevPage.setData({
|
|
|
+ parkData: 'parkData',
|
|
|
+ });
|
|
|
+ // #endif
|
|
|
+ // #ifdef H5
|
|
|
+ uni.setStorage({
|
|
|
+ key: 'parkData',
|
|
|
+ data: 'parkData',
|
|
|
+ success: function () {
|
|
|
+ console.log('parkData-success');
|
|
|
+ },
|
|
|
+ });
|
|
|
+ // #endif
|
|
|
+ },
|
|
|
methods: {
|
|
|
- // 添加车牌号
|
|
|
- toAdd() {
|
|
|
- this.$router.push({ path: 'vehicleAddOrEdit' });
|
|
|
-},
|
|
|
- // 跳转支付页面
|
|
|
- toPay(carno) {
|
|
|
- this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
|
|
|
- name: 'parkingFeeDetail'
|
|
|
-});
|
|
|
- // 查询车费信息
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中',
|
|
|
-});
|
|
|
- // const openId = MemberCacheTool.getOpenId(app)
|
|
|
- const params = {
|
|
|
- carno,
|
|
|
- mallid: this.mallid,
|
|
|
- openid: this.openid,
|
|
|
- vipcode: this.member?.vipcode,
|
|
|
- mobile: this.mobile,
|
|
|
- groupId: this.groupId,
|
|
|
- createuser: 'sys_miniprogram',
|
|
|
-};
|
|
|
- this.$md(params);
|
|
|
- this.$request({
|
|
|
- url: this.$baseURL + 'api/1.0/park/checkCarIsInPark',
|
|
|
- data: params,
|
|
|
- method: 'POST',
|
|
|
- header: JSON.parse(uni.getStorageSync('handleUser')),
|
|
|
- timeout: 10000,
|
|
|
-})
|
|
|
- .then((res) => {
|
|
|
- // console.log(227, res);
|
|
|
- uni.hideLoading();
|
|
|
- if (res.data.code === 0) {
|
|
|
- this.$router.push({
|
|
|
- path: 'parkingFeeDetail?carno=' + carno,
|
|
|
-});
|
|
|
-} else if (res.data.code === 1) {
|
|
|
- // 当前车辆没有查到账单
|
|
|
- this.$router.push({
|
|
|
- path: 'parkingFeePayment?msg=' + res.data.msg + '&carno=' + carno,
|
|
|
-});
|
|
|
-} else if (res.data.code === 2) {
|
|
|
- // 月租车
|
|
|
- this.$router.push({
|
|
|
- path: './parkingFeeHint/parkingFeeHint?carno=' + carno,
|
|
|
-});
|
|
|
-} else {
|
|
|
- uni.showToast({
|
|
|
- title: res.data.msg,
|
|
|
- duration: 2000,
|
|
|
- icon: 'none',
|
|
|
-});
|
|
|
-}
|
|
|
-})
|
|
|
- .catch((err) => {
|
|
|
- uni.hideLoading();
|
|
|
- uni.showToast({
|
|
|
- title: '网络超时请稍后再试',
|
|
|
- duration: 2000,
|
|
|
- icon: 'none',
|
|
|
-});
|
|
|
- console.log(err);
|
|
|
-});
|
|
|
-},
|
|
|
- // 编辑
|
|
|
- toEdit(item) {
|
|
|
- if (!item) {
|
|
|
- return;
|
|
|
-}
|
|
|
- const { id, vehicleNo, licensePlateType } = item;
|
|
|
- const carType = LICENSE_PLATE_TYPE_ARR.findIndex(
|
|
|
- (e) => e.value == licensePlateType
|
|
|
- );
|
|
|
- this.sensorsClick('$ClickEditLicensePlate', {
|
|
|
- carno_old: item.vehicleNo,
|
|
|
- redirect_url: 'pages/parkingFee/vehicleAddOrEdit',
|
|
|
-});
|
|
|
- this.$router.push({
|
|
|
- path: `vehicleAddOrEdit?id=${id}&carno=${vehicleNo}&carType=${carType}`,
|
|
|
-});
|
|
|
-},
|
|
|
- // 删除
|
|
|
- toDelete(item) {
|
|
|
- this.activeId = item.id;
|
|
|
- this.activeCarno = item.vehicleNo;
|
|
|
+ // 添加车牌号
|
|
|
+ toAdd() {
|
|
|
+ this.$router.push({ path: 'vehicleAddOrEdit' });
|
|
|
+ },
|
|
|
+ // 跳转支付页面
|
|
|
+ toPay(carno) {
|
|
|
+ this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
|
|
|
+ name: 'parkingFeeDetail',
|
|
|
+ });
|
|
|
+ // 查询车费信息
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ });
|
|
|
+ // const openId = MemberCacheTool.getOpenId(app)
|
|
|
+ const params = {
|
|
|
+ carno,
|
|
|
+ mallid: this.mallid,
|
|
|
+ openid: this.openid,
|
|
|
+ vipcode: this.member?.vipcode,
|
|
|
+ mobile: this.mobile,
|
|
|
+ groupId: this.groupId,
|
|
|
+ createuser: 'sys_miniprogram',
|
|
|
+ };
|
|
|
+ this.$md(params);
|
|
|
+ this.$request({
|
|
|
+ url: this.$baseURL + 'api/1.0/park/checkCarIsInPark',
|
|
|
+ data: params,
|
|
|
+ method: 'POST',
|
|
|
+ header: JSON.parse(uni.getStorageSync('handleUser')),
|
|
|
+ timeout: 10000,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ // console.log(227, res);
|
|
|
+ uni.hideLoading();
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.$router.push({
|
|
|
+ path: 'parkingFeeDetail?carno=' + carno,
|
|
|
+ });
|
|
|
+ } else if (res.data.code === 1) {
|
|
|
+ // 当前车辆没有查到账单
|
|
|
+ this.$router.push({
|
|
|
+ path: 'parkingFeePayment?msg=' + res.data.msg + '&carno=' + carno,
|
|
|
+ });
|
|
|
+ } else if (res.data.code === 2) {
|
|
|
+ // 月租车
|
|
|
+ this.$router.push({
|
|
|
+ path: './parkingFeeHint/parkingFeeHint?carno=' + carno,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.data.msg,
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ uni.showToast({
|
|
|
+ title: '网络超时请稍后再试',
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none',
|
|
|
+ });
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 编辑
|
|
|
+ toEdit(item) {
|
|
|
+ if (!item) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const { id, vehicleNo, licensePlateType } = item;
|
|
|
+ const carType = LICENSE_PLATE_TYPE_ARR.findIndex(
|
|
|
+ (e) => e.value == licensePlateType
|
|
|
+ );
|
|
|
+ this.sensorsClick('$ClickEditLicensePlate', {
|
|
|
+ carno_old: item.vehicleNo,
|
|
|
+ redirect_url: 'pages/parkingFee/vehicleAddOrEdit',
|
|
|
+ });
|
|
|
+ this.$router.push({
|
|
|
+ path: `vehicleAddOrEdit?id=${id}&carno=${vehicleNo}&carType=${carType}`,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ toDelete(item) {
|
|
|
+ this.activeId = item.id;
|
|
|
+ this.activeCarno = item.vehicleNo;
|
|
|
|
|
|
- Dialog.confirm({
|
|
|
- title: '删除已绑定车牌',
|
|
|
- message: '是否确认删除已经绑定车牌' + '\n' + this.activeCarno,
|
|
|
- confirmButtonColor: '#333',
|
|
|
-})
|
|
|
- .then(() => {
|
|
|
- // on confirm
|
|
|
- this.doDelete();
|
|
|
-})
|
|
|
- .catch(() => {
|
|
|
- // on cancel
|
|
|
- // this.cancelDelete();
|
|
|
-});
|
|
|
- // this.deleteDialogSwitch = true;
|
|
|
-},
|
|
|
- doDelete() {
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中',
|
|
|
-});
|
|
|
- const _this = this;
|
|
|
- kipDeleteMemberVehicles(this.activeId)
|
|
|
- .then((result) => {
|
|
|
- uni.hideLoading();
|
|
|
- // console.log(resp)
|
|
|
- // const result = resp.data
|
|
|
- if (result && result.code == '000000') {
|
|
|
- this.sensorsClick('$ClickDeleteLicensePlate', {
|
|
|
- carno_old: this.activeCarno,
|
|
|
- redirect_url: '',
|
|
|
-});
|
|
|
- if (result.data) {
|
|
|
- // this.deleteDialogSwitch = false;
|
|
|
- // this.deleteSuccessDialogSwitch = true;
|
|
|
+ Dialog.confirm({
|
|
|
+ title: '删除已绑定车牌',
|
|
|
+ message: '是否确认删除已经绑定车牌' + '\n' + this.activeCarno,
|
|
|
+ confirmButtonColor: '#333',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ // on confirm
|
|
|
+ this.doDelete();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ // on cancel
|
|
|
+ // this.cancelDelete();
|
|
|
+ });
|
|
|
+ // this.deleteDialogSwitch = true;
|
|
|
+ },
|
|
|
+ doDelete() {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ });
|
|
|
+ const _this = this;
|
|
|
+ kipDeleteMemberVehicles(this.activeId)
|
|
|
+ .then((result) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ // console.log(resp)
|
|
|
+ // const result = resp.data
|
|
|
+ if (result && result.code == '000000') {
|
|
|
+ this.sensorsClick('$ClickDeleteLicensePlate', {
|
|
|
+ carno_old: this.activeCarno,
|
|
|
+ redirect_url: '',
|
|
|
+ });
|
|
|
+ if (result.data) {
|
|
|
+ // this.deleteDialogSwitch = false;
|
|
|
+ // this.deleteSuccessDialogSwitch = true;
|
|
|
|
|
|
- Dialog.alert({
|
|
|
- message: '删除成功',
|
|
|
- confirmButtonColor: '#333',
|
|
|
-}).then(() => {
|
|
|
- // on confirm
|
|
|
- // this.doDelete();
|
|
|
- this.getKipMemberVehicles();
|
|
|
-});
|
|
|
- // _this.$refs.deleteSuccessDialog.open()
|
|
|
- return;
|
|
|
-}
|
|
|
-}
|
|
|
- const message = result.message || '删除失败';
|
|
|
- uni.showToast({
|
|
|
- title: message,
|
|
|
- duration: 2000,
|
|
|
- icon: 'none',
|
|
|
-});
|
|
|
-})
|
|
|
- .catch((err) => {
|
|
|
- uni.hideLoading();
|
|
|
- console.log(err);
|
|
|
- uni.showToast({
|
|
|
- title: '删除失败',
|
|
|
- duration: 2000,
|
|
|
- icon: 'none',
|
|
|
-});
|
|
|
-});
|
|
|
-},
|
|
|
- // 埋点方法
|
|
|
- sensorsClick(eventName, params) {
|
|
|
- let optionsQuery = uni.getStorageSync('options_query');
|
|
|
- let fixedParams = {
|
|
|
- cta_itemno: '',
|
|
|
- cta_name: '',
|
|
|
- previous_url: this.preUrl || '',
|
|
|
- // 原previous_url: uni.getStorageSync('previousUrl') || ''
|
|
|
- // previous_url: 使用sdk预置参数$referrer,
|
|
|
- $brand_id: this.groupId,
|
|
|
- redirect_url: params.redirect_url || '',
|
|
|
- $location: this.mallid,
|
|
|
- $channel: optionsQuery.channel || '',
|
|
|
- // $utm_lbs: this.optionsQuery.utm_lbs || '',
|
|
|
- $utm_channel: optionsQuery.utm_channel || '',
|
|
|
- $utm_method: optionsQuery.utm_method || '',
|
|
|
- $utm_source: optionsQuery.utm_source || '',
|
|
|
- $utm_function: optionsQuery.utm_function || '',
|
|
|
- $utm_user: optionsQuery.utm_user || '',
|
|
|
-},
|
|
|
- finalParams = Object.assign(fixedParams, params);
|
|
|
- this.$sensors.track(eventName, finalParams);
|
|
|
-},
|
|
|
- cancelDelete() {
|
|
|
- this.deleteDialogSwitch = true;
|
|
|
-},
|
|
|
- confirmDialog() {
|
|
|
- // this.$refs.deleteSuccessDialog.close()
|
|
|
- this.deleteSuccessDialogSwitch = false;
|
|
|
+ Dialog.alert({
|
|
|
+ message: '删除成功',
|
|
|
+ confirmButtonColor: '#333',
|
|
|
+ }).then(() => {
|
|
|
+ // on confirm
|
|
|
+ // this.doDelete();
|
|
|
+ this.getKipMemberVehicles();
|
|
|
+ });
|
|
|
+ // _this.$refs.deleteSuccessDialog.open()
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const message = result.message || '删除失败';
|
|
|
+ uni.showToast({
|
|
|
+ title: message,
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none',
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ console.log(err);
|
|
|
+ uni.showToast({
|
|
|
+ title: '删除失败',
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none',
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 埋点方法
|
|
|
+ sensorsClick(eventName, params) {
|
|
|
+ let optionsQuery = uni.getStorageSync('options_query');
|
|
|
+ let fixedParams = {
|
|
|
+ cta_itemno: '',
|
|
|
+ cta_name: '',
|
|
|
+ previous_url: this.preUrl || '',
|
|
|
+ // 原previous_url: uni.getStorageSync('previousUrl') || ''
|
|
|
+ // previous_url: 使用sdk预置参数$referrer,
|
|
|
+ $brand_id: this.groupId,
|
|
|
+ redirect_url: params.redirect_url || '',
|
|
|
+ $location: this.mallid,
|
|
|
+ $channel: optionsQuery.channel || '',
|
|
|
+ // $utm_lbs: this.optionsQuery.utm_lbs || '',
|
|
|
+ $utm_channel: optionsQuery.utm_channel || '',
|
|
|
+ $utm_method: optionsQuery.utm_method || '',
|
|
|
+ $utm_source: optionsQuery.utm_source || '',
|
|
|
+ $utm_function: optionsQuery.utm_function || '',
|
|
|
+ $utm_user: optionsQuery.utm_user || '',
|
|
|
+ },
|
|
|
+ finalParams = Object.assign(fixedParams, params);
|
|
|
+ this.$sensors.track(eventName, finalParams);
|
|
|
+ },
|
|
|
+ cancelDelete() {
|
|
|
+ this.deleteDialogSwitch = true;
|
|
|
+ },
|
|
|
+ confirmDialog() {
|
|
|
+ // this.$refs.deleteSuccessDialog.close()
|
|
|
+ this.deleteSuccessDialogSwitch = false;
|
|
|
|
|
|
- this.getKipMemberVehicles();
|
|
|
-},
|
|
|
- // 获取会员绑定的车牌列表
|
|
|
- getKipMemberVehicles() {
|
|
|
- // console.log(453);
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中',
|
|
|
-});
|
|
|
- kipGetMemberVehicles()
|
|
|
- .then((result) => {
|
|
|
- uni.hideLoading();
|
|
|
- console.log(result);
|
|
|
- // const result = resp.data
|
|
|
- if (result && result.code == '000000') {
|
|
|
- const data = result.data || [];
|
|
|
- if (data && data.length > 0) {
|
|
|
- // data.forEach((item) => {
|
|
|
- // const curLicensePlateType = LICENSE_PLATE_TYPE_ARR.find(
|
|
|
- // (e) => e.value == item.licensePlateType
|
|
|
- // )
|
|
|
- // if (curLicensePlateType) {
|
|
|
- // item.licensePlateTypeDesc = curLicensePlateType.label
|
|
|
- // }
|
|
|
- // })
|
|
|
- this.licensePlateList = this.setLicensePlateList(data);
|
|
|
-} else {
|
|
|
- this.licensePlateList = [];
|
|
|
-}
|
|
|
- // this.licensePlateList = vehiclesList.data;
|
|
|
-} else {
|
|
|
- const message = result.message || '获取信息失败';
|
|
|
- uni.showToast({
|
|
|
- title: message,
|
|
|
- duration: 2000,
|
|
|
- icon: 'none',
|
|
|
-});
|
|
|
-}
|
|
|
- // console.log(380, this.licensePlateList);
|
|
|
-})
|
|
|
- .catch((err) => {
|
|
|
- uni.hideLoading();
|
|
|
- console.error(err);
|
|
|
-});
|
|
|
- // this.licensePlateList = this.setLicensePlateList(vehiclesList.data);
|
|
|
-},
|
|
|
- setLicensePlateList(data) {
|
|
|
- if (!data.length) return [];
|
|
|
- return data.map((item) => {
|
|
|
- const curLicensePlateType = LICENSE_PLATE_TYPE_ARR.find(
|
|
|
- (e) => e.value == item.licensePlateType
|
|
|
- );
|
|
|
- if (curLicensePlateType) {
|
|
|
- item.licensePlateTypeDesc = curLicensePlateType.label;
|
|
|
-}
|
|
|
- return item;
|
|
|
-});
|
|
|
-},
|
|
|
-},
|
|
|
+ this.getKipMemberVehicles();
|
|
|
+ },
|
|
|
+ // 获取会员绑定的车牌列表
|
|
|
+ getKipMemberVehicles() {
|
|
|
+ // console.log(453);
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ });
|
|
|
+ kipGetMemberVehicles()
|
|
|
+ .then((result) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ console.log(result);
|
|
|
+ // const result = resp.data
|
|
|
+ if (result && result.code == '000000') {
|
|
|
+ const data = result.data || [];
|
|
|
+ if (data && data.length > 0) {
|
|
|
+ // data.forEach((item) => {
|
|
|
+ // const curLicensePlateType = LICENSE_PLATE_TYPE_ARR.find(
|
|
|
+ // (e) => e.value == item.licensePlateType
|
|
|
+ // )
|
|
|
+ // if (curLicensePlateType) {
|
|
|
+ // item.licensePlateTypeDesc = curLicensePlateType.label
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ this.licensePlateList = this.setLicensePlateList(data);
|
|
|
+ } else {
|
|
|
+ this.licensePlateList = [];
|
|
|
+ }
|
|
|
+ // this.licensePlateList = vehiclesList.data;
|
|
|
+ } else {
|
|
|
+ const message = result.message || '获取信息失败';
|
|
|
+ uni.showToast({
|
|
|
+ title: message,
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // console.log(380, this.licensePlateList);
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ // this.licensePlateList = this.setLicensePlateList(vehiclesList.data);
|
|
|
+ },
|
|
|
+ setLicensePlateList(data) {
|
|
|
+ if (!data.length) return [];
|
|
|
+ return data.map((item) => {
|
|
|
+ const curLicensePlateType = LICENSE_PLATE_TYPE_ARR.find(
|
|
|
+ (e) => e.value == item.licensePlateType
|
|
|
+ );
|
|
|
+ if (curLicensePlateType) {
|
|
|
+ item.licensePlateTypeDesc = curLicensePlateType.label;
|
|
|
+ }
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|