|
|
@@ -16,7 +16,7 @@
|
|
|
<view class="path-title">请选择路线</view>
|
|
|
<view class="path-list" v-if="pathList.length">
|
|
|
<view
|
|
|
- :class="currentIndex1 === index ? 'active path-item' : 'path-item'"
|
|
|
+ :class="[index % 2 === 1 ? 'active path-item' : 'path-item', { scale: currentIndex1 === index }]"
|
|
|
v-for="(item, index) in pathList"
|
|
|
:key="index"
|
|
|
@click="handleChangeCurrentIndex(1, index, item)"
|
|
|
@@ -31,7 +31,7 @@
|
|
|
<view class="carList">
|
|
|
<view class="carList-title">请选择车辆</view>
|
|
|
<view
|
|
|
- :class="[currentIndex2 === index ? 'active ' : '', item.can_order == 0 ? 'unactive' : '', 'carList-item']"
|
|
|
+ :class="[currentIndex1 === 0 ? 'yellow ' : 'blue', item.can_order == 0 ? 'unactive' : '', 'carList-item']"
|
|
|
v-for="(item, index) in busList"
|
|
|
:key="index"
|
|
|
@click="handleChangeCurrentIndex(2, index, item)"
|
|
|
@@ -44,6 +44,7 @@
|
|
|
<span>容量:{{ item.boarde_num + '/' + item.contain }}</span>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view v-if="currentIndex2 === index" class="item-check" :class="currentIndex1 === 0 ? 'type ' : 'type2'">✔</view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 没有数据时展示的区域 -->
|
|
|
@@ -56,14 +57,16 @@
|
|
|
<!-- 立即预约按钮区域 -->
|
|
|
<view class="btn-box" v-if="busList.length">
|
|
|
<view class="btn">
|
|
|
- <view class="btn-clock"><img src="../../static/clock.png" /></view>
|
|
|
+ <view class="btn-clock">
|
|
|
+ <img src="../../static/clock.png" />
|
|
|
+ </view>
|
|
|
<view class="btn-info" v-if="status">
|
|
|
<view class="btn-info-title">开始预约时间段</view>
|
|
|
<view>{{ yy_duration }}</view>
|
|
|
</view>
|
|
|
<view class="btn-info" v-else>
|
|
|
<view class="btn-info-title2">候补截止时间</view>
|
|
|
- <view class="btn-info-time">{{ currentPath == '墨轩湖校区-黄家湖校区' ? mxh_end : hjh_end }}</view>
|
|
|
+ <view class="btn-info-time">{{ currentPath == '靖安-南昌' ? mxh_end : hjh_end }}</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="btn-button" @click="handleSub">{{ status ? '立即预约' : '候补预约' }}</view>
|
|
|
@@ -130,7 +133,7 @@ onPullDownRefresh(() => {
|
|
|
currentBusId.value = null
|
|
|
busList.value = []
|
|
|
|
|
|
- setTimeout(function() {
|
|
|
+ setTimeout(function () {
|
|
|
currentPath.value = pathList.value[0].route
|
|
|
getBusList(pathList.value[0].route)
|
|
|
uni.stopPullDownRefresh()
|
|
|
@@ -163,9 +166,9 @@ const currentBusId = ref(null)
|
|
|
const yy_duration = ref('')
|
|
|
// 预约截止时间
|
|
|
const yy_end = ref('')
|
|
|
-// 黄家湖校区-墨轩湖校区 候补截止时间
|
|
|
+// 南昌-靖安 候补截止时间
|
|
|
const hjh_end = ref('')
|
|
|
-// 墨轩湖校区-黄家湖校区 候补截止时间
|
|
|
+// 靖安-南昌 候补截止时间
|
|
|
const mxh_end = ref('')
|
|
|
// 爽约次数
|
|
|
const black_count = ref('')
|
|
|
@@ -176,9 +179,9 @@ const status = ref(true)
|
|
|
// 监听车辆列表更改候补预约状态
|
|
|
watch(
|
|
|
() => busList.value,
|
|
|
- newValue => {
|
|
|
+ (newValue) => {
|
|
|
if (newValue.length) {
|
|
|
- let flag = newValue.some(item => item.can_order == 1)
|
|
|
+ let flag = newValue.some((item) => item.can_order == 1)
|
|
|
let count = newValue.length
|
|
|
let LastObj = newValue[count - 1]
|
|
|
if (LastObj.boarde_num == LastObj.contain && !flag) {
|
|
|
@@ -200,7 +203,7 @@ const getPathList = async () => {
|
|
|
}
|
|
|
|
|
|
// 根据路线查询所有车次
|
|
|
-const getBusList = async route => {
|
|
|
+const getBusList = async (route) => {
|
|
|
busList.value = []
|
|
|
// 处理时间参数
|
|
|
let date = new Date()
|
|
|
@@ -251,7 +254,7 @@ const handleSub = () => {
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
content: '确定预约吗?',
|
|
|
- success: res => {
|
|
|
+ success: (res) => {
|
|
|
if (res.confirm) {
|
|
|
handleSubscribe()
|
|
|
} else if (res.cancel) {
|
|
|
@@ -283,7 +286,7 @@ const handleSub = () => {
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
content: '确定候补预约吗?',
|
|
|
- success: res => {
|
|
|
+ success: (res) => {
|
|
|
if (res.confirm) {
|
|
|
handleStandby()
|
|
|
} else if (res.cancel) {
|
|
|
@@ -330,7 +333,7 @@ const handleStandby = async () => {
|
|
|
data: {
|
|
|
route: currentPath.value,
|
|
|
card_number: card_number.value,
|
|
|
- hh_end: currentPath.value == '墨轩湖校区-黄家湖校区' ? mxh_end.value : hjh_end.value
|
|
|
+ hh_end: currentPath.value == '靖安-南昌' ? mxh_end.value : hjh_end.value
|
|
|
}
|
|
|
})
|
|
|
// console.log(res);
|
|
|
@@ -360,6 +363,13 @@ const handleChangeCurrentIndex = (type, index, item) => {
|
|
|
// 如果车辆不能预约则不进行任何操作
|
|
|
if (item.can_order == 0) {
|
|
|
} else {
|
|
|
+ if (currentIndex1.value === 0) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '只到黄家湖不前往墨轩湖不需要预约',
|
|
|
+ icon: 'none',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ }
|
|
|
currentIndex2.value = index
|
|
|
currentBusId.value = item.id
|
|
|
}
|
|
|
@@ -389,7 +399,7 @@ const handleChangeTime = () => {
|
|
|
}
|
|
|
|
|
|
// 获取格式化时间 日期 和 星期
|
|
|
-const getTimeFormat = dayType => {
|
|
|
+const getTimeFormat = (dayType) => {
|
|
|
let date = new Date()
|
|
|
if (dayType) {
|
|
|
let targetday = date.getTime() + 1000 * 60 * 60 * 24
|
|
|
@@ -406,7 +416,7 @@ const getTimeFormat = dayType => {
|
|
|
}
|
|
|
|
|
|
// 点击电话回调
|
|
|
-const handlePhone = phone => {
|
|
|
+const handlePhone = (phone) => {
|
|
|
uni.makePhoneCall({
|
|
|
phoneNumber: phone
|
|
|
})
|
|
|
@@ -469,14 +479,19 @@ const handlePhone = phone => {
|
|
|
min-width: 45%;
|
|
|
line-height: 96rpx;
|
|
|
text-align: center;
|
|
|
- font-size: 27rpx;
|
|
|
+ font-size: 40rpx;
|
|
|
+ font-weight: bold;
|
|
|
border-radius: 14rpx;
|
|
|
- background-color: #ebebeb;
|
|
|
+ background-color: #ffdb6e;
|
|
|
+ }
|
|
|
+
|
|
|
+ .scale {
|
|
|
+ transform: scale(1.08);
|
|
|
}
|
|
|
|
|
|
.active {
|
|
|
color: #fff;
|
|
|
- background-color: #5c60f3;
|
|
|
+ background-color: #3d51e8;
|
|
|
|
|
|
.item-info {
|
|
|
.item-info-detail {
|
|
|
@@ -517,11 +532,15 @@ const handlePhone = phone => {
|
|
|
}
|
|
|
|
|
|
.carList-item {
|
|
|
+ position: relative;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
box-sizing: border-box;
|
|
|
- padding: 37rpx 30rpx 32rpx;
|
|
|
- height: 163rpx;
|
|
|
+ padding: 37rpx 100rpx 32rpx 30rpx;
|
|
|
+ margin: 0 auto 20rpx;
|
|
|
+ width: 690rpx;
|
|
|
+ height: 224rpx;
|
|
|
+ border-radius: 24rpx;
|
|
|
|
|
|
.item-time {
|
|
|
position: relative;
|
|
|
@@ -534,11 +553,12 @@ const handlePhone = phone => {
|
|
|
height: 77rpx;
|
|
|
position: absolute;
|
|
|
top: -15rpx;
|
|
|
- right: 0;
|
|
|
+ right: 0rpx;
|
|
|
border-right: 1px solid #a6a6a6;
|
|
|
}
|
|
|
|
|
|
.item-info {
|
|
|
+ flex: 1;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
justify-content: space-around;
|
|
|
@@ -550,7 +570,6 @@ const handlePhone = phone => {
|
|
|
}
|
|
|
|
|
|
.item-info-detail {
|
|
|
- color: #999999;
|
|
|
font-size: 26rpx;
|
|
|
|
|
|
span {
|
|
|
@@ -558,17 +577,38 @@ const handlePhone = phone => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- .active {
|
|
|
- color: #fff;
|
|
|
- background-color: #5c60f3;
|
|
|
+ .item-check {
|
|
|
+ position: absolute;
|
|
|
+ right: 2rpx;
|
|
|
+ bottom: 2rpx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ width: 100rpx;
|
|
|
+ height: 70rpx;
|
|
|
+ font-size: 50rpx;
|
|
|
+ border-radius: 24rpx 0 22rpx 0;
|
|
|
+ }
|
|
|
|
|
|
- .item-info {
|
|
|
- .item-info-detail {
|
|
|
- color: #fff;
|
|
|
- }
|
|
|
+ .type {
|
|
|
+ color: #fff;
|
|
|
+ background-color: #d43030;
|
|
|
}
|
|
|
+
|
|
|
+ .type2 {
|
|
|
+ color: #3d51e8;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .yellow {
|
|
|
+ color: #e01f1f;
|
|
|
+ background-color: #ffdb6e;
|
|
|
+ }
|
|
|
+
|
|
|
+ .blue {
|
|
|
+ color: #fff;
|
|
|
+ background-color: #3d51e8;
|
|
|
}
|
|
|
|
|
|
.unactive {
|
|
|
@@ -626,7 +666,7 @@ const handlePhone = phone => {
|
|
|
flex-direction: column;
|
|
|
justify-content: center;
|
|
|
font-size: 24rpx;
|
|
|
- color: #5863f1;
|
|
|
+ color: #d43030;
|
|
|
|
|
|
.btn-info-title {
|
|
|
margin-bottom: 8rpx;
|