|
|
@@ -4,322 +4,353 @@
|
|
|
<Search :typeList="typeList" :timeList="timeList" @handLeConveyData="getConveyData" />
|
|
|
|
|
|
<!-- 列表区域 -->
|
|
|
- <view class="list" v-for="(item,index) in listData" :key="index">
|
|
|
+ <view class="list" v-for="(item, index) in listData" :key="index">
|
|
|
<view class="list-title">
|
|
|
- <view>
|
|
|
- {{item.route }}
|
|
|
- </view>
|
|
|
- <view class="list-img" :class="item.state ===1 ? 'mr-30':''">
|
|
|
- <img v-if="item.state===1" src="../../static/success.png">
|
|
|
- <img v-if="item.state===2" src="../../static/pass.png">
|
|
|
- <img v-if="item.state===3" src="../../static/waiting.png">
|
|
|
- <img v-if="item.state===4" src="../../static/cancel.png">
|
|
|
+ <view>{{ item.route }}</view>
|
|
|
+ <view class="list-img" :class="item.state === 1 ? 'mr-30' : ''">
|
|
|
+ <img v-if="item.state === 1" src="../../static/success.png" />
|
|
|
+ <img v-if="item.state === 2" src="../../static/pass.png" />
|
|
|
+ <img v-if="item.state === 3" src="../../static/waiting.png" />
|
|
|
+ <img v-if="item.state === 4" src="../../static/cancel.png" />
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="list-info">
|
|
|
<view class="list-info-item">
|
|
|
- <span>预约号:</span>{{item.row_num}}
|
|
|
+ <span>预约号:</span>
|
|
|
+ {{ item.row_num }}
|
|
|
</view>
|
|
|
<view class="list-info-item">
|
|
|
- <span>下单时间:</span>{{item.yy_time}}
|
|
|
+ <span>下单时间:</span>
|
|
|
+ {{ item.yy_time }}
|
|
|
</view>
|
|
|
- <view class="list-info-item" v-if="item.state===1">
|
|
|
- <span>发车时间:</span>{{item.yy_date}}
|
|
|
+ <view class="list-info-item" v-if="item.state === 1">
|
|
|
+ <span>发车时间:</span>
|
|
|
+ {{ item.yy_date }}
|
|
|
</view>
|
|
|
- <view class="list-info-item" v-if="item.state===1||item.state===2">
|
|
|
- <span>车牌号:</span>{{item.car_number}}
|
|
|
+ <view class="list-info-item" v-if="item.state === 1 || item.state === 2">
|
|
|
+ <span>车牌号:</span>
|
|
|
+ {{ item.car_number }}
|
|
|
</view>
|
|
|
<view class="list-info-item">
|
|
|
- <span>终点站:</span>{{item.route_end}}
|
|
|
+ <span>终点站:</span>
|
|
|
+ {{ item.route_end }}
|
|
|
</view>
|
|
|
- <view class="list-info-item" v-if="item.state===1||item.state===2">
|
|
|
- <span>容 量:</span>{{item.contain}}人
|
|
|
+ <view class="list-info-item" v-if="item.state === 1 || item.state === 2">
|
|
|
+ <span>容 量:</span>
|
|
|
+ {{ item.contain }}人
|
|
|
</view>
|
|
|
- <view class="list-info-item2" v-if="item.state===1||item.state===2">
|
|
|
- <span>变更信息:</span>{{item.remark!=''?item.remark:'无'}}
|
|
|
+ <view class="list-info-item2" v-if="item.state === 1 || item.state === 2">
|
|
|
+ <span>变更信息:</span>
|
|
|
+ {{ item.remark != '' ? item.remark : '无' }}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="list-button">
|
|
|
<!-- <view class="list-button-change" v-if="item.state ===1" @click="handleChange">
|
|
|
更换车次
|
|
|
</view> -->
|
|
|
- <view class="list-button-change" v-if="item.state ===1&&item.contain==6" @click="handleOnCar(item.id)">
|
|
|
- 我已上车
|
|
|
- </view>
|
|
|
- <view class="list-button-cancel" v-if="item.state ===1||item.state ===3" @click="handleCancel(item.id)">
|
|
|
- 取消预约
|
|
|
- </view>
|
|
|
+ <view class="list-button-change" v-if="item.state === 1 && item.contain == 6" @click="handleOnCar(item.id)">我已上车</view>
|
|
|
+ <view class="list-button-cancel" v-if="item.state === 1 || item.state === 3" @click="handleCancel(item.id)">取消预约</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 无数据时展示的区域 -->
|
|
|
- <view class="list-nodata" v-if="listData.length ==0">
|
|
|
- <img src="../../static/no-bus.png">
|
|
|
- <view>
|
|
|
- 暂无数据
|
|
|
- </view>
|
|
|
+ <view class="list-nodata" v-if="listData.length == 0">
|
|
|
+ <img src="../../static/no-bus.png" />
|
|
|
+ <view>暂无数据</view>
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
- import {
|
|
|
- ref
|
|
|
- } from "vue"
|
|
|
-
|
|
|
- import {
|
|
|
- onLoad,
|
|
|
- onShow,
|
|
|
- onPullDownRefresh
|
|
|
- } from "@dcloudio/uni-app"
|
|
|
-
|
|
|
- import {
|
|
|
- myRequest
|
|
|
- } from "../../util/api.js"
|
|
|
-
|
|
|
- import {
|
|
|
- isWeixin
|
|
|
- } from "../../util/isWeixin.js"
|
|
|
-
|
|
|
- import Search from '../../components/search'
|
|
|
-
|
|
|
- onLoad(() => {
|
|
|
- if (isWeixin()) {
|
|
|
- card_number.value = uni.getStorageSync('bus_card_number')
|
|
|
- } else {
|
|
|
- uni.redirectTo({
|
|
|
- url: "/pages/404/404?message=请在微信客户端打开链接"
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- onShow(() => {
|
|
|
- getMyData()
|
|
|
- })
|
|
|
+import { ref } from 'vue'
|
|
|
|
|
|
- onPullDownRefresh(() => {
|
|
|
- getMyData()
|
|
|
- setTimeout(function() {
|
|
|
- uni.stopPullDownRefresh();
|
|
|
- }, 500);
|
|
|
- })
|
|
|
+import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app'
|
|
|
|
|
|
- // 用户card_number
|
|
|
- const card_number = ref('')
|
|
|
- // 筛选条件状态列表
|
|
|
- const typeList = ref(['全部', '预约成功', '已乘车', '候补中', '已取消'])
|
|
|
- // 筛选条件时间列表
|
|
|
- const timeList = ref(['全部', '当天', '本周', '本月'])
|
|
|
- // 预约状态 0:全部 1:预约成功 2:已乘车 3:候补中 4:已取消
|
|
|
- const result_state = ref(0)
|
|
|
- // 时间状态 1:全部 2:当天 3:本周 4:本月
|
|
|
- const date_state = ref(1)
|
|
|
-
|
|
|
- // 预约记录数据
|
|
|
- // 1代表成功,2代表已乘车,3代表已分配,4代表候补中,5代表已取消
|
|
|
- const listData = ref([])
|
|
|
-
|
|
|
- // 获取用户预约数据
|
|
|
- const getMyData = async () => {
|
|
|
- listData.value = []
|
|
|
- const res = await myRequest({
|
|
|
- url: '/appqueryUserOrders.action',
|
|
|
- data: {
|
|
|
- result_state: result_state.value,
|
|
|
- date_state: date_state.value,
|
|
|
- card_number: card_number.value,
|
|
|
- }
|
|
|
- })
|
|
|
- // console.log(res);
|
|
|
- listData.value = res.data
|
|
|
- }
|
|
|
+import { myRequest } from '../../util/api.js'
|
|
|
|
|
|
- // 更换车次按钮回调
|
|
|
- const handleChange = () => {
|
|
|
- uni.switchTab({
|
|
|
- url: "/pages/home/home"
|
|
|
- })
|
|
|
- }
|
|
|
+import { isWeixin } from '../../util/isWeixin.js'
|
|
|
|
|
|
- // 我已上车按钮回调
|
|
|
- const handleOnCar = (id) => {
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '确定已经上车吗?',
|
|
|
- success: (res) => {
|
|
|
- if (res.confirm) {
|
|
|
- handleOnCarRequest(id)
|
|
|
- } else if (res.cancel) {}
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+import Search from '../../components/search'
|
|
|
|
|
|
- // 已上车请求
|
|
|
- const handleOnCarRequest = async (id) => {
|
|
|
- const res = await myRequest({
|
|
|
- url: '/appBoarding.action',
|
|
|
- data: {
|
|
|
- card_number: card_number.value,
|
|
|
- record_id: id
|
|
|
- }
|
|
|
+onLoad(() => {
|
|
|
+ if (isWeixin()) {
|
|
|
+ card_number.value = uni.getStorageSync('bus_card_number')
|
|
|
+ } else {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/404/404?message=请在微信客户端打开链接'
|
|
|
})
|
|
|
- // console.log(res);
|
|
|
- if (res) {
|
|
|
- uni.showToast({
|
|
|
- title: res.message
|
|
|
- })
|
|
|
- setTimeout(() => {
|
|
|
- getMyData()
|
|
|
- }, 1500)
|
|
|
- }
|
|
|
}
|
|
|
-
|
|
|
- // 取消预约按钮回调
|
|
|
- const handleCancel = (id) => {
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '确定取消预约吗?',
|
|
|
- success: (res) => {
|
|
|
- if (res.confirm) {
|
|
|
- handleCancelRequest(id)
|
|
|
- } else if (res.cancel) {}
|
|
|
- }
|
|
|
- });
|
|
|
+})
|
|
|
+onShow(() => {
|
|
|
+ result_state.value = 0
|
|
|
+ date_state.value = 1
|
|
|
+ getMyData()
|
|
|
+})
|
|
|
+
|
|
|
+onPullDownRefresh(() => {
|
|
|
+ getMyData()
|
|
|
+ setTimeout(function() {
|
|
|
+ uni.stopPullDownRefresh()
|
|
|
+ }, 500)
|
|
|
+})
|
|
|
+
|
|
|
+// 用户card_number
|
|
|
+const card_number = ref('')
|
|
|
+// 筛选条件状态列表
|
|
|
+const typeList = ref([
|
|
|
+ {
|
|
|
+ text: '全部',
|
|
|
+ value: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '预约成功',
|
|
|
+ value: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '已乘车',
|
|
|
+ value: 2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '候补中',
|
|
|
+ value: 3
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '已取消',
|
|
|
+ value: 4
|
|
|
}
|
|
|
- // 取消预约请求
|
|
|
- const handleCancelRequest = async (id) => {
|
|
|
- const res = await myRequest({
|
|
|
- url: '/appcancelOrder.action',
|
|
|
- data: {
|
|
|
- card_number: card_number.value,
|
|
|
- record_id: id
|
|
|
+])
|
|
|
+// 筛选条件时间列表
|
|
|
+const timeList = ref([
|
|
|
+ {
|
|
|
+ text: '全部',
|
|
|
+ value: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '当天',
|
|
|
+ value: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '本周',
|
|
|
+ value: 2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '本月',
|
|
|
+ value: 3
|
|
|
+ }
|
|
|
+])
|
|
|
+
|
|
|
+// 预约状态 0:全部 1:预约成功 2:已乘车 3:候补中 4:已取消
|
|
|
+const result_state = ref(0)
|
|
|
+// 时间状态 1:全部 2:当天 3:本周 4:本月
|
|
|
+const date_state = ref(1)
|
|
|
+
|
|
|
+// 预约记录数据
|
|
|
+// 1代表成功,2代表已乘车,3代表已分配,4代表候补中,5代表已取消
|
|
|
+const listData = ref([])
|
|
|
+
|
|
|
+// 获取用户预约数据
|
|
|
+const getMyData = async () => {
|
|
|
+ listData.value = []
|
|
|
+ const res = await myRequest({
|
|
|
+ url: '/appqueryUserOrders.action',
|
|
|
+ data: {
|
|
|
+ result_state: result_state.value,
|
|
|
+ date_state: date_state.value,
|
|
|
+ card_number: card_number.value
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // console.log(res);
|
|
|
+ listData.value = res.data
|
|
|
+}
|
|
|
+
|
|
|
+// 更换车次按钮回调
|
|
|
+const handleChange = () => {
|
|
|
+ uni.switchTab({
|
|
|
+ url: '/pages/home/home'
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 我已上车按钮回调
|
|
|
+const handleOnCar = id => {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '确定已经上车吗?',
|
|
|
+ success: res => {
|
|
|
+ if (res.confirm) {
|
|
|
+ handleOnCarRequest(id)
|
|
|
+ } else if (res.cancel) {
|
|
|
}
|
|
|
- })
|
|
|
- // console.log(res);
|
|
|
- if (res) {
|
|
|
- uni.showToast({
|
|
|
- title: res.message
|
|
|
- })
|
|
|
- setTimeout(() => {
|
|
|
- getMyData()
|
|
|
- }, 1500)
|
|
|
}
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 已上车请求
|
|
|
+const handleOnCarRequest = async id => {
|
|
|
+ const res = await myRequest({
|
|
|
+ url: '/appBoarding.action',
|
|
|
+ data: {
|
|
|
+ card_number: card_number.value,
|
|
|
+ record_id: id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // console.log(res);
|
|
|
+ if (res) {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.message
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ getMyData()
|
|
|
+ }, 1500)
|
|
|
}
|
|
|
-
|
|
|
- // 筛选下拉框确定选择回调
|
|
|
- const getConveyData = (Obj) => {
|
|
|
- // console.log(Obj);
|
|
|
- result_state.value = Obj.typeIndex
|
|
|
- date_state.value = Obj.timeIndex - 0 + 1
|
|
|
- getMyData()
|
|
|
+}
|
|
|
+
|
|
|
+// 取消预约按钮回调
|
|
|
+const handleCancel = id => {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '确定取消预约吗?',
|
|
|
+ success: res => {
|
|
|
+ if (res.confirm) {
|
|
|
+ handleCancelRequest(id)
|
|
|
+ } else if (res.cancel) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+// 取消预约请求
|
|
|
+const handleCancelRequest = async id => {
|
|
|
+ const res = await myRequest({
|
|
|
+ url: '/appcancelOrder.action',
|
|
|
+ data: {
|
|
|
+ card_number: card_number.value,
|
|
|
+ record_id: id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // console.log(res);
|
|
|
+ if (res) {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.message
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ getMyData()
|
|
|
+ }, 1500)
|
|
|
}
|
|
|
+}
|
|
|
+
|
|
|
+// 筛选下拉框确定选择回调
|
|
|
+const getConveyData = Obj => {
|
|
|
+ // console.log(Obj)
|
|
|
+ result_state.value = Obj.typeIndex
|
|
|
+ date_state.value = Obj.timeIndex - 0 + 1
|
|
|
+ getMyData()
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
- .container {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- background-color: #F2F2F2;
|
|
|
-
|
|
|
- .list {
|
|
|
- margin-bottom: 20rpx;
|
|
|
+.container {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ background-color: #f2f2f2;
|
|
|
+
|
|
|
+ .list {
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ font-size: 32rpx;
|
|
|
+ background-color: #fff;
|
|
|
+
|
|
|
+ .list-title {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 30rpx;
|
|
|
+ height: 94rpx;
|
|
|
+ font-weight: bold;
|
|
|
font-size: 32rpx;
|
|
|
- background-color: #fff;
|
|
|
+ border-bottom: 1rpx solid #e6e6e6;
|
|
|
|
|
|
- .list-title {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
- padding: 0 30rpx;
|
|
|
- height: 94rpx;
|
|
|
- font-weight: bold;
|
|
|
- font-size: 32rpx;
|
|
|
- border-bottom: 1rpx solid #E6E6E6;
|
|
|
-
|
|
|
- .list-img {
|
|
|
- width: 121rpx;
|
|
|
- height: 34rpx;
|
|
|
-
|
|
|
- img {
|
|
|
- // width: 100%;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
- }
|
|
|
+ .list-img {
|
|
|
+ width: 121rpx;
|
|
|
+ height: 34rpx;
|
|
|
|
|
|
- .mr-30 {
|
|
|
- margin-right: 30rpx;
|
|
|
+ img {
|
|
|
+ // width: 100%;
|
|
|
+ height: 100%;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .list-info {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- justify-content: space-evenly;
|
|
|
- padding: 0 30rpx;
|
|
|
- margin-top: 15rpx;
|
|
|
-
|
|
|
- .list-info-item,
|
|
|
- .list-info-item2 {
|
|
|
- line-height: 60rpx;
|
|
|
- font-size: 28rpx;
|
|
|
- color: #333333;
|
|
|
-
|
|
|
- span {
|
|
|
- display: inline-block;
|
|
|
- width: 160rpx;
|
|
|
- text-align-last: justify;
|
|
|
- color: #999999;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .list-info-item {
|
|
|
- height: 60rpx;
|
|
|
- }
|
|
|
+ .mr-30 {
|
|
|
+ margin-right: 30rpx;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- .list-button {
|
|
|
- display: flex;
|
|
|
- justify-content: flex-end;
|
|
|
- align-items: center;
|
|
|
+ .list-info {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-evenly;
|
|
|
+ padding: 0 30rpx;
|
|
|
+ margin-top: 15rpx;
|
|
|
+
|
|
|
+ .list-info-item,
|
|
|
+ .list-info-item2 {
|
|
|
+ line-height: 60rpx;
|
|
|
font-size: 28rpx;
|
|
|
- text-align: center;
|
|
|
-
|
|
|
- .list-button-change {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
- margin: 17rpx 0 40rpx 0;
|
|
|
- width: 170rpx;
|
|
|
- height: 70rpx;
|
|
|
- color: #fff;
|
|
|
- border-radius: 15rpx;
|
|
|
- background: linear-gradient(#8684FF, #3C50E8);
|
|
|
- }
|
|
|
+ color: #333333;
|
|
|
|
|
|
- .list-button-cancel {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
- margin: 17rpx 30rpx 40rpx;
|
|
|
- width: 170rpx;
|
|
|
- height: 70rpx;
|
|
|
+ span {
|
|
|
+ display: inline-block;
|
|
|
+ width: 160rpx;
|
|
|
+ text-align-last: justify;
|
|
|
color: #999999;
|
|
|
- border-radius: 15rpx;
|
|
|
- background-color: #E6E6E6;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .list-info-item {
|
|
|
+ height: 60rpx;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- .list-nodata {
|
|
|
- margin-top: -20rpx;
|
|
|
- padding-top: 100rpx;
|
|
|
- background-color: #fff;
|
|
|
+ .list-button {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 28rpx;
|
|
|
text-align: center;
|
|
|
- color: #999999;
|
|
|
|
|
|
- img {
|
|
|
- width: 600rpx;
|
|
|
+ .list-button-change {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ margin: 17rpx 0 40rpx 0;
|
|
|
+ width: 170rpx;
|
|
|
+ height: 70rpx;
|
|
|
+ color: #fff;
|
|
|
+ border-radius: 15rpx;
|
|
|
+ background: linear-gradient(#8684ff, #3c50e8);
|
|
|
}
|
|
|
+
|
|
|
+ .list-button-cancel {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ margin: 17rpx 30rpx 40rpx;
|
|
|
+ width: 170rpx;
|
|
|
+ height: 70rpx;
|
|
|
+ color: #999999;
|
|
|
+ border-radius: 15rpx;
|
|
|
+ background-color: #e6e6e6;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .list-nodata {
|
|
|
+ margin-top: -20rpx;
|
|
|
+ padding-top: 100rpx;
|
|
|
+ background-color: #fff;
|
|
|
+ text-align: center;
|
|
|
+ color: #999999;
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 600rpx;
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+}
|
|
|
+</style>
|