|
@@ -7,17 +7,17 @@
|
|
|
<u-icon name="arrow-down" color="#fff" size="32"></u-icon>
|
|
|
</view>
|
|
|
<u-search placeholder="搜索停车点" :show-action="false" @search="handleSearch" v-model="keyword"></u-search>
|
|
|
- <!-- <u-icon class="scan" name="scan" color="#fff" size="48" @click="$refs.uToast.show({title: '建设中'})"></u-icon> -->
|
|
|
</view>
|
|
|
|
|
|
<!-- ===================================== 轮播图 ===================================== -->
|
|
|
- <u-swiper :list="bannerList" border-radius="0" mode="none" @click="swiperClick"></u-swiper>
|
|
|
-
|
|
|
+ <view v-if="bannerList.length">
|
|
|
+ <u-swiper :list="bannerList" border-radius="0" mode="none" @click="swiperClick"></u-swiper>
|
|
|
+ </view>
|
|
|
<!-- ===================================== 城市选择器 ===================================== -->
|
|
|
<u-city-select v-model="cityOpen" @city-change="cityChange" :areaCode="['52', '5201']"></u-city-select>
|
|
|
|
|
|
<!-- ===================================== 滚动信息栏 ===================================== -->
|
|
|
- <view class="notice-bar-wrap u-flex" v-if="noticeList.length >= 1" @click="openPage('pages/message/message', true)">
|
|
|
+ <view class="notice-bar-wrap u-flex" v-if="noticeList.length" @click="openPage('pages/message/message', true)">
|
|
|
<u-icon custom-prefix="custom-icon" size="50" name="xiaoxi" color="#008CFF"></u-icon>
|
|
|
<u-notice-bar
|
|
|
class="u-flex-1"
|
|
@@ -57,10 +57,6 @@
|
|
|
>
|
|
|
</view>
|
|
|
</u-card>
|
|
|
- <!-- ===================================== 无停车信息 ===================================== -->
|
|
|
- <view class="empty-data-box" v-if="!orderList || orderList.length < 1">
|
|
|
- <u-empty text="暂无停车信息" mode="list"></u-empty>
|
|
|
- </view>
|
|
|
|
|
|
<!-- ===================================== 停车列表 ===================================== -->
|
|
|
<view v-for="item in orderList" :key="item.id">
|
|
@@ -141,6 +137,11 @@
|
|
|
</u-card>
|
|
|
</view>
|
|
|
|
|
|
+ <!-- ===================================== 无停车信息 ===================================== -->
|
|
|
+ <view class="empty-data-box" v-if="!orderList.length">
|
|
|
+ <u-empty text="暂无停车信息" mode="list"></u-empty>
|
|
|
+ </view>
|
|
|
+
|
|
|
<!-- ===================================== 优惠活动 ===================================== -->
|
|
|
<view class="promotion-box">
|
|
|
<view class="promotion-title">
|
|
@@ -159,7 +160,7 @@
|
|
|
confirm-text="去绑定"
|
|
|
content="首次使用请先绑定您的车牌"
|
|
|
@confirm="$u.route({ url: 'pages/myCars/myCars' })"
|
|
|
- ></u-modal>
|
|
|
+ />
|
|
|
|
|
|
<!-- ===================================== 停车场信息弹框 ===================================== -->
|
|
|
<u-popup class="popup-order-details" v-model="showOrderDetails" mode="center" width="90%" border-radius="20">
|
|
@@ -185,9 +186,6 @@
|
|
|
<view class="popup-order-details-footer" @click="closeOrderDetails">知道了</view>
|
|
|
</u-popup>
|
|
|
|
|
|
- <!-- ===================================== 支付方式弹框 ===================================== -->
|
|
|
- <!-- <PaymentMethod :payWayPop="payWayPop" :curOrderList="curOrderList" :jumpUrl="jumpUrl" @closePaymentMethod="closePaymentMethod"></PaymentMethod> -->
|
|
|
-
|
|
|
<!-- ===================================== 0元提示弹出层 ===================================== -->
|
|
|
<u-modal v-model="jumpMsgModal" :content="jumpMsgContent" :show-title="false" :show-confirm-button="false" />
|
|
|
<u-toast ref="uToast" />
|
|
@@ -211,14 +209,7 @@
|
|
|
</u-popup>
|
|
|
|
|
|
<u-action-sheet :list="colorList" @click="confirmColor" v-model="colorShow"></u-action-sheet>
|
|
|
- <u-keyboard
|
|
|
- ref="uKeyboard"
|
|
|
- mode="car"
|
|
|
- @change="keyboardChange"
|
|
|
- @confirm="keyboardConfirm"
|
|
|
- @backspace="backspace"
|
|
|
- v-model="keyboardshow"
|
|
|
- ></u-keyboard>
|
|
|
+ <u-keyboard ref="uKeyboard" mode="car" @change="keyboardChange" @confirm="keyboardConfirm" @backspace="backspace" v-model="keyboardshow" />
|
|
|
|
|
|
<!-- ===================================== 更换车牌弹出层 ===================================== -->
|
|
|
<u-popup class="popup-vehicleNo" v-model="ShowchangevehicleNo" mode="center" border-radius="20" width="710rpx" height="auto">
|
|
@@ -293,11 +284,7 @@ export default {
|
|
|
// 搜索框值
|
|
|
keyword: '',
|
|
|
// 轮播图
|
|
|
- bannerList: [
|
|
|
- {
|
|
|
- image: require('@/static/img/index-banner01.png')
|
|
|
- }
|
|
|
- ],
|
|
|
+ bannerList: [],
|
|
|
// 订单列表
|
|
|
orderList: [],
|
|
|
// 微信code
|
|
@@ -371,17 +358,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
onLoad(page) {
|
|
|
- // 获取参数免费时长
|
|
|
- this.$u.api
|
|
|
- .getParamsApi({
|
|
|
- key: 'park.lock.freetime'
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$u.vuex('free_time', res.msg);
|
|
|
- }
|
|
|
- });
|
|
|
- const locationLocaturl = window.location.href;
|
|
|
+ const locationLocaturl = location.href;
|
|
|
// 微信聚合支付完成跳转过来重定向到详情页
|
|
|
const type = getUrlParams(locationLocaturl, 'type');
|
|
|
if (type && type === 'jumpurl') {
|
|
@@ -405,17 +382,23 @@ export default {
|
|
|
this.jumpMsgModal = false;
|
|
|
}, 3000);
|
|
|
}
|
|
|
+ this.getParams();
|
|
|
this.getLocation();
|
|
|
- },
|
|
|
- onShow() {
|
|
|
this.handleGetIndexData();
|
|
|
- const locationLocaturl = window.location.search;
|
|
|
- this.code = getUrlParams(locationLocaturl, 'code');
|
|
|
- if (this.code && !this.$store.state.vuex_wxinfo.openId) {
|
|
|
- this.handleGetWXInfo(this.code);
|
|
|
- }
|
|
|
},
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * @description: 获取参数免费时长
|
|
|
+ * @return {*}
|
|
|
+ */
|
|
|
+ async getParams() {
|
|
|
+ const { code, msg } = await this.$u.api.getParamsApi({
|
|
|
+ key: 'park.lock.freetime'
|
|
|
+ });
|
|
|
+ if (code === 200) {
|
|
|
+ this.$u.vuex('free_time', msg);
|
|
|
+ }
|
|
|
+ },
|
|
|
radioGroupChange(e) {
|
|
|
this.newPlateNumber = e;
|
|
|
},
|
|
@@ -430,11 +413,6 @@ export default {
|
|
|
// dom元素更新后执行,因此这里能正确打印更改之后的值
|
|
|
console.log(that.$refs.refValue.init()); // 改变了的值
|
|
|
});
|
|
|
- } else {
|
|
|
- this.$refs.uToast.show({
|
|
|
- title: res.msg,
|
|
|
- type: 'error'
|
|
|
- });
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -458,20 +436,14 @@ export default {
|
|
|
vehicleNo: this.newPlateNumber,
|
|
|
vehicleColor: this.vehicleColor
|
|
|
};
|
|
|
- let that = this;
|
|
|
this.$u.api.bindVehicleNo(param).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
this.$refs.uToast.show({
|
|
|
title: res.msg,
|
|
|
type: 'success'
|
|
|
});
|
|
|
- that.handleGetIndexData();
|
|
|
- that.ShowchangevehicleNo = false;
|
|
|
- } else {
|
|
|
- this.$refs.uToast.show({
|
|
|
- title: res.msg,
|
|
|
- type: 'error'
|
|
|
- });
|
|
|
+ this.handleGetIndexData();
|
|
|
+ this.ShowchangevehicleNo = false;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -523,21 +495,6 @@ export default {
|
|
|
that.getCityNameByLonLat(that.latLongItude);
|
|
|
},
|
|
|
function (err) {
|
|
|
- // 错误处理
|
|
|
- // switch (err.code) {
|
|
|
- // case 1:
|
|
|
- // alert('位置服务被拒绝。');
|
|
|
- // break;
|
|
|
- // case 2:
|
|
|
- // alert('暂时获取不到位置信息。');
|
|
|
- // break;
|
|
|
- // case 3:
|
|
|
- // alert('获取信息超时。');
|
|
|
- // break;
|
|
|
- // default:
|
|
|
- // alert('未知错误。');
|
|
|
- // break;
|
|
|
- // }
|
|
|
uni.getLocation({
|
|
|
type: 'gcj02',
|
|
|
success: function (res) {
|
|
@@ -601,16 +558,8 @@ export default {
|
|
|
console.log('res', res);
|
|
|
if (res?.code == 200) {
|
|
|
this.handleGetIndexData();
|
|
|
- } else {
|
|
|
- // this.$refs.uToast.show({
|
|
|
- // title: res?.msg,
|
|
|
- // type: 'error'
|
|
|
- // })
|
|
|
}
|
|
|
uni.hideLoading();
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- console.log('orderNavclick err', err);
|
|
|
});
|
|
|
},
|
|
|
/**
|
|
@@ -654,20 +603,14 @@ export default {
|
|
|
this.$u.api.getIndexData().then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
// 轮播
|
|
|
- const bannerList = [];
|
|
|
- const banner = res.data?.advs;
|
|
|
- banner.forEach((item) => {
|
|
|
- const obj = {
|
|
|
+ this.bannerList = (res?.data?.advs ?? []).map((item) => {
|
|
|
+ return {
|
|
|
image: item.bannerUrl,
|
|
|
id: item.id,
|
|
|
name: item.name,
|
|
|
content: item.content
|
|
|
};
|
|
|
- bannerList.push(obj);
|
|
|
});
|
|
|
- if (bannerList.length > 0) {
|
|
|
- this.bannerList = bannerList;
|
|
|
- }
|
|
|
// 是否有绑定车牌: 没有则通过弹框去绑定
|
|
|
const vehicleList = res.data?.vehicleList ?? [];
|
|
|
if (vehicleList.length === 0) {
|
|
@@ -689,14 +632,15 @@ export default {
|
|
|
enableFeepay.push(0);
|
|
|
}
|
|
|
});
|
|
|
+ this.recordList = enableFeepay;
|
|
|
+ if (enableFeepay.length) this.orderNav = enableFeepay[0];
|
|
|
+ if (enableFeepay.length === 3) this.contractStatus = enableFeepay[2];
|
|
|
+ // 统计
|
|
|
this.totalActualAmount = res.data?.payedInfo?.totalActualAmount;
|
|
|
this.totalCount = res.data?.payedInfo?.totalCount;
|
|
|
this.totalPayAmount = res.data?.payingInfo?.totalPayAmount;
|
|
|
this.totalPayCount = res.data?.payingInfo?.totalCount;
|
|
|
- this.recordList = enableFeepay;
|
|
|
- this.orderNav = enableFeepay[0];
|
|
|
- this.contractStatus = enableFeepay[2];
|
|
|
- this.orderList = res.data.orderList;
|
|
|
+ this.orderList = orderList;
|
|
|
// 消息提示
|
|
|
const newsList = [];
|
|
|
const news = res.data?.news ?? [];
|
|
@@ -704,11 +648,6 @@ export default {
|
|
|
newsList.push(item.content);
|
|
|
});
|
|
|
this.noticeList = newsList;
|
|
|
- } else {
|
|
|
- this.$refs.uToast.show({
|
|
|
- title: res.msg,
|
|
|
- type: 'error'
|
|
|
- });
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -716,27 +655,26 @@ export default {
|
|
|
goPay(item) {
|
|
|
const href = location.origin;
|
|
|
this.jumpUrl = href + '/pages/center/order/orderDetails/orderDetails?orderId=' + item.id + '&type=open';
|
|
|
- // this.payWayPop = true;
|
|
|
this.curOrderList = [];
|
|
|
this.curOrderList.push(item.id);
|
|
|
this.$refs['choosePayment'].openPopup({ ...item }, 'single', 'road');
|
|
|
},
|
|
|
// 获取路段详情
|
|
|
- onRoadInfo(item) {
|
|
|
- this.$u.api
|
|
|
- .roadInfoById({
|
|
|
- id: item.roadId
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- this.popupOrderDetails = res.data;
|
|
|
+ async onRoadInfo(item) {
|
|
|
+ const { code, data } = await this.$u.api.roadInfoById({
|
|
|
+ id: item.roadId
|
|
|
+ });
|
|
|
+ if (code === 200) {
|
|
|
+ if (data) {
|
|
|
+ this.popupOrderDetails = data;
|
|
|
this.showOrderDetails = true;
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
+ } else {
|
|
|
this.$refs.uToast.show({
|
|
|
- title: '系统异常',
|
|
|
- type: 'error'
|
|
|
+ title: '暂无停车点数据!',
|
|
|
+ type: 'warning'
|
|
|
});
|
|
|
- });
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
// 关闭路段详情弹框
|
|
|
closeOrderDetails() {
|
|
@@ -766,7 +704,7 @@ export default {
|
|
|
},
|
|
|
// 关闭支付弹框
|
|
|
closePaymentMethod() {
|
|
|
- this.payWayPop = false;
|
|
|
+ // this.payWayPop = false;
|
|
|
}
|
|
|
}
|
|
|
};
|