Compare commits

..

No commits in common. "81298faedc45f20e031c361a9a0583b9b78c4ccd" and "9ae7f9e0881b6ef15e7ef721f5c1aa8e17846eff" have entirely different histories.

14 changed files with 141 additions and 412 deletions

View File

@ -121,7 +121,6 @@ page {
-webkit-line-clamp: 1; -webkit-line-clamp: 1;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;
font-size: 26rpx;
} }
.enter-btn { .enter-btn {

View File

@ -3,11 +3,11 @@
<view class="community-list"> <view class="community-list">
<view class="community-item-box" v-for="(item, index) in communityList" :key="index"> <view class="community-item-box" v-for="(item, index) in communityList" :key="index">
<view class="community-item"> <view class="community-item">
<view class="community-image" @tap="enterCommunity(item)"> <view class="community-image">
<image :src="item.pic" mode="aspectFill"></image> <image :src="item.pic" mode="aspectFill"></image>
</view> </view>
<view class="community-info"> <view class="community-info">
<view class="community-name" @tap="enterCommunity(item)">{{ item.name }}</view> <view class="community-name">{{ item.name }}</view>
<view class="community-property">物业公司{{ item.property || '-' }}</view> <view class="community-property">物业公司{{ item.property || '-' }}</view>
<view class="community-distance">距我当前{{ item.distance || '未知' }}</view> <view class="community-distance">距我当前{{ item.distance || '未知' }}</view>
<view class="community-buttons"> <view class="community-buttons">

View File

@ -254,21 +254,21 @@ export default {
methods: { methods: {
// //
chooseLocation() { chooseLocation() {
// uni.navigateTo({ uni.navigateTo({
// url: "/packages/areaPopup/index", url: "/packages/areaPopup/index",
// }); });
}, },
// //
searchService() { searchService() {
// uni.navigateTo({ uni.navigateTo({
// url: "/packages/homeServer/search/index", url: "/packages/homeServer/search/index",
// }); });
}, },
// //
navigateToService(item) { navigateToService(item) {
// uni.navigateTo({ uni.navigateTo({
// url: "/packages/homeServer/classify/index", url: "/packages/homeServer/classify/index",
// }); });
// uni.navigateTo({ // uni.navigateTo({
// url: `/packages/homeServer/serverInfo/index?service=${encodeURIComponent( // url: `/packages/homeServer/serverInfo/index?service=${encodeURIComponent(
// JSON.stringify(item) // JSON.stringify(item)
@ -280,7 +280,7 @@ export default {
// uni.navigateTo({ // uni.navigateTo({
// url: `/packages/homeServer/reservation/index?id=${service.id}&name=${service.name}`, // url: `/packages/homeServer/reservation/index?id=${service.id}&name=${service.name}`,
// }); // });
// NavgateTo("/packages/homeServer/searchInfo/index"); NavgateTo("/packages/homeServer/searchInfo/index");
}, },
// //
contactService() { contactService() {
@ -304,7 +304,7 @@ export default {
// //
lookNotice() { lookNotice() {
// NavgateTo("/packages/homeServer/noticeManage/index"); NavgateTo("/packages/homeServer/noticeManage/index");
}, },
}, },
onLoad() { onLoad() {

View File

@ -59,25 +59,9 @@ page {
border-bottom: 1rpx solid #eee; border-bottom: 1rpx solid #eee;
} }
.orderTitle {
width: 100%;
font-size: 24rpx;
font-weight: bold;
}
.orderTitleSupplier {
font-size: 28rpx;
color: #333;
font-weight: bold;
margin-bottom: 10rpx;
display: flex;
justify-content: space-between;
}
.status { .status {
color: #ff5252; color: #ff5252;
font-weight: bold; font-weight: bold;
font-size: 24rpx;
} }
.status2 { .status2 {
@ -87,7 +71,6 @@ page {
display: flex; display: flex;
padding: 10rpx; padding: 10rpx;
border-radius: 10rpx; border-radius: 10rpx;
font-size: 24rpx;
} }
.status2 img { .status2 img {
@ -99,13 +82,6 @@ page {
.status3 { .status3 {
color: #949494; color: #949494;
font-weight: bold; font-weight: bold;
font-size: 24rpx;
}
.order_status{
color: #333;
font-weight: bold;
font-size: 24rpx;
} }
.goods-list { .goods-list {

View File

@ -23,20 +23,16 @@
<view class="contentList"> <view class="contentList">
<!-- 订单头部信息 --> <!-- 订单头部信息 -->
<view class="order-header" @click="toDetails(item)"> <view class="order-header" @click="toDetails(item)">
<view class="orderTitle"> <text>提交订单{{ item.order_time }}</text>
<view class="orderTitleSupplier">{{ item.supplier_name }} <view v-if="item.order_status == 6 || item.order_status == 5" class="status3">{{
<view v-if="item.order_status == 6 || item.order_status == 5" class="status3">{{ getOrderStatus(item.order_status) }}</view>
getOrderStatus(item.order_status) }}</view> <view v-else-if="item.order_status == 7" class="status2">
<view v-else-if="item.order_status == 7" class="status2"> <img src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/refund.png" />
<img src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/refund.png" /> {{ getOrderStatus(item.order_status) }}
{{ getOrderStatus(item.order_status) }}
</view>
<view v-else class="order_status">{{
getOrderStatus(item.order_status)
}}</view>
</view>
<text>提交订单{{ item.order_time }}</text>
</view> </view>
<view v-else class="order_status">{{
getOrderStatus(item.order_status)
}}</view>
</view> </view>
<!-- 商品列表 --> <!-- 商品列表 -->
@ -69,7 +65,7 @@
<view class="btn-group" v-if="item.order_status === 5"> <view class="btn-group" v-if="item.order_status === 5">
<text class="afterSaleNum">{{ item.commodity_order_item_list.length }}笔售后</text> <text class="afterSaleNum">{{ item.commodity_order_item_list.length }}笔售后</text>
<button class="cancel-btn" @click="afterSale(item)">退换/售后</button> <button class="cancel-btn" @click="afterSale(item)">退换/售后</button>
<button class="pay-btn">评价</button> <button class="pay-btn" @click="cancelOrder">评价</button>
</view> </view>
<view class="btn-group" v-if="item.order_status === 6"> <view class="btn-group" v-if="item.order_status === 6">
<!-- <button class="cancel-btn" @click="orderEvaluate"> <!-- <button class="cancel-btn" @click="orderEvaluate">

View File

@ -39,9 +39,9 @@
<!-- 订单金额 --> <!-- 订单金额 -->
<view class="amount-section"> <view class="amount-section">
<view v-if="status !== '退款中'"> <view v-if="status !== '退款中'">
<view class="total-amount">¥{{ orderInfo.total_amount }}</view> <view class="total-amount">¥{{ orderInfo.payment_amount }}</view>
<view class="original-price">商品下单应付 <view class="original-price">商品下单应付
<text> ¥{{ orderInfo.total_amount }}</text> <text> ¥{{ orderInfo.payment_amount }}</text>
</view> </view>
</view> </view>
<view class="goods-item" v-for="(item, index) in orderInfo.commodity_order_item_list" :key="index"> <view class="goods-item" v-for="(item, index) in orderInfo.commodity_order_item_list" :key="index">
@ -62,7 +62,7 @@
</view> </view>
<view class="hr"></view> <view class="hr"></view>
<view class="info-item"> <view class="info-item">
<view class="info-label1">下单总金额( ¥{{ orderInfo.total_amount }} )</view> <view class="info-label1">下单总金额( ¥{{ orderInfo.orderAmount }} )</view>
<view class="info-action">明细</view> <view class="info-action">明细</view>
</view> </view>
<view class="info-item"> <view class="info-item">
@ -134,7 +134,7 @@
</view> </view>
<view class="bottom-buttons" v-if="status === '3'"> <view class="bottom-buttons" v-if="status === '3'">
<!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> --> <!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> -->
<button class="cancel-btn" @click="applyRefund">申请退款</button> <button class="cancel-btn" @click="cancelOrder">取消订单</button>
<!-- <button class="pay-btn" @click="gotoPayment">立即支付</button> --> <!-- <button class="pay-btn" @click="gotoPayment">立即支付</button> -->
</view> </view>
<view class="bottom-buttons" v-if="status === '4'"> <view class="bottom-buttons" v-if="status === '4'">
@ -143,14 +143,14 @@
<button class="pay-btn" @click="gotoPayment">立即支付</button> <button class="pay-btn" @click="gotoPayment">立即支付</button>
</view> </view>
<view class="bottom-buttons" v-if="status === '5'"> <view class="bottom-buttons" v-if="status === '5'">
<!-- <button class="cancel-btn" @click="orderEvaluate">服务评价</button> --> <button class="cancel-btn" @click="orderEvaluate">服务评价</button>
<!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> --> <!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> -->
<button class="pay-btn" @click="gotoPayment">立即支付</button> <button class="pay-btn" @click="gotoPayment">立即支付</button>
</view> </view>
<view class="bottom-buttons" v-if="status === '6'"> <view class="bottom-buttons" v-if="status === '6'">
<!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> --> <!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> -->
<!-- <button class="cancel-btn" @click="cancelOrder">服务评价</button> --> <!-- <button class="cancel-btn" @click="cancelOrder">服务评价</button> -->
<!-- <button class="pay-btn" @click="gotoPayment">再来一单</button> --> <button class="pay-btn" @click="gotoPayment">再来一单</button>
</view> </view>
</view> </view>
</view> </view>
@ -158,8 +158,7 @@
</template> </template>
<script> <script>
import { picUrl, NavgateTo, request } from "../../../utils"; import { picUrl, NavgateTo } from "../../../utils";
import { apiArr as afterSaleApi } from "../../../api/afterSale";
export default { export default {
data() { data() {
@ -171,6 +170,7 @@ export default {
}, },
onLoad(options) { onLoad(options) {
const item = JSON.parse(options?.item); const item = JSON.parse(options?.item);
console.log("🚀 ~ onLoad ~ item:", item)
// //
item.order_status == "1" ? this.startCountdown() : ""; item.order_status == "1" ? this.startCountdown() : "";
this.status = JSON.stringify(item.order_status); this.status = JSON.stringify(item.order_status);
@ -202,71 +202,15 @@ export default {
content: "确定要取消订单吗?", content: "确定要取消订单吗?",
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
const params = { // API
order_id: this.orderInfo.id, uni.showToast({ title: "订单已取消", icon: "none" });
method: 1, setTimeout(() => uni.navigateBack(), 1500);
cancel_reason: '用户主动取消',
}
request(afterSaleApi.cancelOrConfirm, "POST", params).then((res) => {
uni.showToast({ title: "订单已取消", icon: "none" });
setTimeout(() => {
uni.navigateBack();
}, 1500);
});
}
},
});
},
// 退
applyRefund() {
uni.showModal({
title: "申请退款",
content: "确定要申请退款吗?",
success: (res) => {
if (res.confirm) {
const params = {
nick_name: uni.getStorageSync("nickName"),
order_id: this.orderInfo.id,
goods_ids: this.orderInfo.commodity_order_item_list.map(item => item.goods_id),
after_sales_type: 1,
after_sales_reason: '用户申请退款',
refund_amount: this.orderInfo.total_amount,
order_status: 3
}
request(afterSaleApi.afterSaleCreate, "POST", params).then((res) => {
uni.showToast({ title: "退款申请已提交", icon: "none" });
setTimeout(() => {
uni.navigateBack();
}, 1500);
});
}
}
});
},
//
confirmReceiving() {
uni.showModal({
title: "确认收货",
content: "确认收货后订单状态将变为【已完成】,如有售后需求可正常申请退款/售后,确定要确认收货吗?",
success: (res) => {
if (res.confirm) {
const params = {
order_id: this.orderInfo.id,
method: 2,
}
request(afterSaleApi.cancelOrConfirm, "POST", params).then((res) => {
uni.showToast({ title: "已确认收货", icon: "none" });
setTimeout(() => {
uni.navigateBack();
}, 1500);
});
} }
}, },
}); });
}, },
gotoPayment() { gotoPayment() {
console.log("🚀 ~ gotoPayment ~ 去支付:");
// //
// uni.navigateTo({ // uni.navigateTo({
// url: "/kitchen/pay/index", // url: "/kitchen/pay/index",

View File

@ -62,11 +62,6 @@ page{
background: linear-gradient(to right, #ffe7e7, #ffffff); background: linear-gradient(to right, #ffe7e7, #ffffff);
} }
.copy-icon {
width: 30rpx;
height: 30rpx;
}
.order-number { .order-number {
font-size: 26rpx; font-size: 26rpx;
color: #333; color: #333;

View File

@ -12,8 +12,6 @@
<view v-for="(order, index) in orders" :key="index" class="order-card"> <view v-for="(order, index) in orders" :key="index" class="order-card">
<view class="order-header"> <view class="order-header">
<text class="order-number">订单编号{{ order.order_sn }}</text> <text class="order-number">订单编号{{ order.order_sn }}</text>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/copy.png" class="copy-icon"
@click="copyOrderNo(order.order_sn)" />
<text class="order-status" :class="{ <text class="order-status" :class="{
'pending': order.status == 1, 'pending': order.status == 1,
'using': order.status == 2, 'using': order.status == 2,
@ -61,7 +59,7 @@
</view> </view>
<!-- 待支付订单显示操作按钮 --> <!-- 待支付订单显示操作按钮 -->
<view v-if="order.status == 1" class="order-footer"> <view v-if="order.status === 'pending'" class="order-footer">
<view class="cancel-button" @tap="cancelOrder(order)">取消订单</view> <view class="cancel-button" @tap="cancelOrder(order)">取消订单</view>
<view class="pay-button" @tap="goToPayment(order)">去支付</view> <view class="pay-button" @tap="goToPayment(order)">去支付</view>
</view> </view>
@ -106,24 +104,6 @@ export default {
} }
}, },
methods: { methods: {
//
copyOrderNo(order_sn) {
uni.setClipboardData({
data: order_sn,
success: () => {
uni.showToast({
title: '复制成功',
icon: 'success'
});
},
fail: () => {
uni.showToast({
title: '复制失败',
icon: 'none'
});
}
});
},
selectTab(index, item) { selectTab(index, item) {
this.selectedTab = index; this.selectedTab = index;
this.getOrderList() this.getOrderList()
@ -134,7 +114,7 @@ export default {
}, },
// //
goToPayment(order) { goToPayment(order) {
NavgateTo('../parkOrderDetail/index?item=' + JSON.stringify(order)); NavgateTo('../parkOrderDetail/index');
}, },
// //
getOrderList() { getOrderList() {

View File

@ -7,9 +7,8 @@
<text class="park-name">{{ orderDetail.parking.parking_name }}</text> <text class="park-name">{{ orderDetail.parking.parking_name }}</text>
</view> </view>
<view class="status-right"> <view class="status-right">
<image class="success-icon" <image class="success-icon" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/park_orderOk.png"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/park_orderOk.png" mode="aspectFit"> mode="aspectFit"></image>
</image>
</view> </view>
</view> </view>
@ -31,7 +30,7 @@
<!-- 电商服务区域 --> <!-- 电商服务区域 -->
<view class="service-section"> <view class="service-section">
<text class="section-title">订单信息</text> <text class="section-title">电商服务</text>
<view class="info-item"> <view class="info-item">
<text class="info-label">车牌号码</text> <text class="info-label">车牌号码</text>
@ -72,11 +71,11 @@
<script> <script>
import { import {
isPhone, isPhone,
picUrl, picUrl,
request, request,
upload, upload,
NavgateTo NavgateTo
} from '../../../utils'; } from '../../../utils';
import { apiArr } from '@/api/park.js' import { apiArr } from '@/api/park.js'
@ -116,22 +115,22 @@ export default {
} }
}); });
}, },
// //
calculateParkingDuration() { calculateParkingDuration() {
if (!this.orderDetail || !this.orderDetail.parking_record) { if (!this.orderDetail || !this.orderDetail.parking_record) {
return '0分钟'; return '0分钟';
} }
const inTime = new Date(this.orderDetail.parking_record.in_time); const inTime = new Date(this.orderDetail.parking_record.in_time);
const outTime = new Date(this.orderDetail.parking_record.out_time); const outTime = new Date(this.orderDetail.parking_record.out_time);
// //
const diffMs = outTime - inTime; const diffMs = outTime - inTime;
// //
const diffMinutes = Math.floor(diffMs / (1000 * 60)); const diffMinutes = Math.floor(diffMs / (1000 * 60));
if (diffMinutes < 60) { if (diffMinutes < 60) {
return `${diffMinutes}分钟`; return `${diffMinutes}分钟`;
} else { } else {
@ -146,17 +145,9 @@ export default {
} }
}, },
onLoad(options) { onLoad(options) {
console.log("接收的原始参数:", options); const order = options.order;
if (options && options.order) { if (order) {
try { this.orderDetail = JSON.parse(order);
//
const decodedOrder = decodeURIComponent(options.order);
this.orderDetail = JSON.parse(decodedOrder);
console.log("解析成功:", this.orderDetail);
} catch (err) {
console.error("解析失败:", err);
//
}
} }
} }
} }

View File

@ -8,36 +8,33 @@
</view> </view>
<!-- 订单列表 --> <!-- 订单列表 -->
<view v-if="orderData.length > 0"> <view class="order-item" v-for="order in monthGroup.orders" :key="order.id" @tap="viewOrderDetail(order)">
<view class="order-item" v-for="order in monthGroup.orders" :key="order.id" <view class="order-left">
@tap="viewOrderDetail(order)"> <view class="order-type">
<view class="order-left"> <view class="order-type1">
<view class="order-type"> <image class="order-icon"
<view class="order-type1"> src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/park_p.png"
<image class="order-icon" mode="aspectFit"></image>
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/park_p.png" <text class="order-type-text">停车</text>
mode="aspectFit"></image>
<text class="order-type-text">停车</text>
</view>
<text class="order-status">{{ order.status == 1 ? '待支付' : '已支付' }}</text>
</view> </view>
<text class="order-status">{{ order.status == 1 ? '待支付' : '已支付' }}</text>
<view class="order-park-info">
<text class="order-park-name">{{ order.record_info.parking_info.parking_name }}</text>
<text class="order-amount">¥{{ order.amount.toFixed(2) }}</text>
</view>
<view class="order-car-info">
<text class="order-car-number">{{ order.record_info.car_number }}</text>
<text class="order-car-type">{{ order.record_info.car_billing_type == 1 ? '月租车' :
(order.record_info.car_billing_type == 2) ? '临时车' : '贵宾车' }}</text>
</view>
<text class="order-time">{{ order.pay_time }}</text>
</view> </view>
<view class="delete-button" @tap.stop="deleteOrder(order)">
<u-icon name="trash" size="45rpx"></u-icon> <view class="order-park-info">
<text class="order-park-name">{{ order.record_info.parking_info.parking_name }}</text>
<text class="order-amount">¥{{ order.amount.toFixed(2) }}</text>
</view> </view>
<view class="order-car-info">
<text class="order-car-number">{{ order.record_info.car_number }}</text>
<text class="order-car-type">{{ order.record_info.car_billing_type == 1 ? '月租车' :
(order.record_info.car_billing_type == 2) ? '临时车' : '贵宾车' }}</text>
</view>
<text class="order-time">{{ order.pay_time }}</text>
</view>
<view class="delete-button" @tap.stop="deleteOrder(order)">
<u-icon name="trash" size="45rpx"></u-icon>
</view> </view>
</view> </view>
</view> </view>
@ -72,10 +69,7 @@ export default {
methods: { methods: {
// //
viewOrderDetail(order) { viewOrderDetail(order) {
const orderStr = JSON.stringify(order); NavgateTo('../orderDetail/index?order=' + JSON.stringify(order))
// &?
const encodedOrder = encodeURIComponent(orderStr);
NavgateTo(`../orderDetail/index?order=${encodedOrder}`);
}, },
// //
@ -95,7 +89,9 @@ export default {
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}); });
that.getOrderData(); setTimeout(() => {
that.getOrderData();
}, 1000);
}) })
} }
} }
@ -163,7 +159,7 @@ export default {
// //
this.getOrderData(); this.getOrderData();
}, },
// //
onReachBottom() { onReachBottom() {
this.page_size += 10; this.page_size += 10;

View File

@ -136,49 +136,7 @@ export default {
} }
}, },
onLoad(options) { onLoad(options) {
const rawData = JSON.parse(decodeURIComponent(options.item)); this.itemObj = JSON.parse(decodeURIComponent(options.item));
// month_card_order_list
if (rawData.carInfo) {
// trans_type
// : 71, App: 51
const systemInfo = uni.getSystemInfoSync();
let trans_type = 51; // App
//
if (systemInfo.platform === 'devtools' || systemInfo.platform === 'unknown') {
trans_type = 71; //
}
//
// #ifdef MP
trans_type = 71; //
// #endif
// #ifdef APP-PLUS
trans_type = 51; // App
// #endif
this.itemObj = {
endTime: rawData.carInfo.deadline_time || '',
headerTitle: rawData.parkingInfo.parking_name || '',
monthCount: rawData.month_num || 0,
monthPrice: rawData.monthly_rental_fee || 0,
order_id: rawData.id || 0,
paymentAmount: rawData.amount || 0,
selectedBillingRule: rawData.billing_rule_id || '',
selectedCarPlate: rawData.carInfo.car_no || '',
selectedCarPlateId: rawData.carInfo.id || 0,
selectedParkId: rawData.parking_id || 0,
selectedParkType: rawData.parkingInfo.space_type || 0,
startTime: rawData.carInfo.enable_time || '',
trans_type: trans_type,
user_id: rawData.user_id || 0
};
} else {
// 使
this.itemObj = rawData;
}
} }
} }
</script> </script>

View File

@ -410,12 +410,6 @@ page {
display: block; display: block;
} }
.notice-text2 {
font-size: 28rpx;
color: #999999;
text-align: center;
}
.payment-methods { .payment-methods {
margin-bottom: 40rpx; margin-bottom: 40rpx;
} }

View File

@ -67,61 +67,49 @@
</view> </view>
<!-- 停车费展示部分 --> <!-- 停车费展示部分 -->
<view v-if="showCost1"> <view v-if="showCost1" class="cost-container">
<view v-if="payStatus === 2" class="cost-container"> <view>
<view> <image class="cost-image"
<image class="cost-image" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/park_orderLoading.png"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/park_orderLoading.png" mode="aspectFit" />
mode="aspectFit" />
</view>
<view class="cost-header">
<text class="cost-title">{{ parkingLotName }} <text class="cost-title2">待支付</text></text>
</view>
<view class="cost-amount">
<text class="amount-symbol">¥</text>
<text class="amount-number">{{ costAmount }}</text>
</view>
<view class="cost-info">
<view class="info-item">
<text class="info-label">车牌号</text>
<text class="info-value">{{ currentCarNumber }}</text>
</view>
<view class="info-item">
<text class="info-label">进场时间</text>
<text class="info-value">{{ entryTime }}</text>
</view>
<view class="info-item">
<text class="info-label">计费时间</text>
<text class="info-value">{{ billingTime }}</text>
</view>
</view>
<view class="notice">
<!-- 未支付状态显示 -->
<text class="notice-text"> 请于付款后{{ feeOutTime }}分钟内离场否则将加收停车费</text>
</view>
<view class="payment-methods">
<view class="payment-item" :class="{ 'selected': paymentMethod === 'wechat' }"
@tap="selectPayment('wechat')">
<view class="payment-item-content">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_wechat.png"
mode="aspectFit" class="payment-icon"></image>
<text class="payment-name">微信支付</text>
</view>
<view v-if="paymentMethod === 'wechat'" class="payment-selected"></view>
</view>
</view>
<view class="pay-button" @tap="confirmPayment">立即付款</view>
</view> </view>
<view v-else class="cost-container notice-text2"> <view class="cost-header">
<view> <text class="cost-title">{{ parkingLotName }} <text class="cost-title2">待支付</text></text>
<image class="cost-image"
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/park_orderLoading.png"
mode="aspectFit" />
</view>
<span v-if="!isTimeout"> 支付成功请于{{ countdownTime }}内离场否则将加收停车费</span>
<span v-else> 您已超时未离场已重新计费</span>
</view> </view>
<view class="cost-amount">
<text class="amount-symbol">¥</text>
<text class="amount-number">{{ costAmount }}</text>
</view>
<view class="cost-info">
<view class="info-item">
<text class="info-label">车牌号</text>
<text class="info-value">{{ currentCarNumber }}</text>
</view>
<view class="info-item">
<text class="info-label">进场时间</text>
<text class="info-value">{{ entryTime }}</text>
</view>
<view class="info-item">
<text class="info-label">计费时间</text>
<text class="info-value">{{ billingTime }}</text>
</view>
</view>
<view class="notice">
<text class="notice-text"> 请于付款后15分钟内离场否则将加收停车费</text>
</view>
<view class="payment-methods">
<view class="payment-item" :class="{ 'selected': paymentMethod === 'wechat' }"
@tap="selectPayment('wechat')">
<view class="payment-item-content">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_wechat.png"
mode="aspectFit" class="payment-icon"></image>
<text class="payment-name">微信支付</text>
</view>
<view v-if="paymentMethod === 'wechat'" class="payment-selected"></view>
</view>
</view>
<view class="pay-button" @tap="confirmPayment">立即付款</view>
</view> </view>
<view v-if="showCost2" class="cost-container not-found"> <view v-if="showCost2" class="cost-container not-found">
未找到停车记录 未找到停车记录
@ -185,18 +173,11 @@ export default {
parkingLotName: '', parkingLotName: '',
costAmount: '', costAmount: '',
currentCarNumber: '', currentCarNumber: '',
feeOutTime: '',//
entryTime: '', entryTime: '',
billingTime: '', billingTime: '',
paymentMethod: 'wechat', paymentMethod: 'wechat',
// ID // ID
timerId: null, timerId: null
//
payStatus: 0,
payTime: '',
countdownTime: '',
isTimeout: false
} }
}, },
onLoad() { onLoad() {
@ -233,10 +214,6 @@ export default {
numberInputResult(e) { numberInputResult(e) {
this.defaultNum = e; this.defaultNum = e;
//
this.showCost1 = false;
this.showCost2 = false;
// 使$nextTickDOM // 使$nextTickDOM
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.carNumberInput) { if (this.$refs.carNumberInput) {
@ -288,31 +265,6 @@ export default {
this.billingTime = timeStr; this.billingTime = timeStr;
}, },
//
updateCountdown() {
const payDateTime = new Date(this.payTime);
const currentDateTime = new Date();
//
const expireDateTime = new Date(payDateTime.getTime() + parseInt(this.feeOutTime) * 60 * 1000);
//
if (currentDateTime > expireDateTime) {
this.isTimeout = true;
//
if (this.timerId) {
clearInterval(this.timerId);
this.timerId = null;
}
} else {
//
const remainingSeconds = Math.floor((expireDateTime - currentDateTime) / 1000);
// :
const minutes = Math.floor(remainingSeconds / 60);
const seconds = remainingSeconds % 60;
this.countdownTime = `${minutes}${seconds}`;
}
},
// //
selectColor(index) { selectColor(index) {
this.selectedColorIndex = index; this.selectedColorIndex = index;
@ -367,40 +319,23 @@ export default {
this.costAmount = res.fee_amount; this.costAmount = res.fee_amount;
this.currentCarNumber = res.car_number; this.currentCarNumber = res.car_number;
this.entryTime = res.in_time; this.entryTime = res.in_time;
this.feeOutTime = res.parking.free_out_time
// //
if (this.timerId) { if (this.timerId) {
clearInterval(this.timerId); clearInterval(this.timerId);
this.timerId = null; this.timerId = null;
} }
// if (res.car_billing_type == 1) {
this.payStatus = res.pay_status || 0; this.billingTime = '月租车';
this.payTime = res.pay_time || ''; } else if (res.car_billing_type == 2) {
this.countdownTime = ''; this.billingTime = '临时车';
this.isTimeout = false;
// (pay_status=1)
if (this.payStatus === 1 && this.payTime) {
//
this.updateCountdown();
//
this.timerId = setInterval(() => {
this.updateCountdown();
}, 1000);
} else { } else {
if (res.car_billing_type == 1) { //
this.billingTime = '月租车'; this.updateBillingTime();
} else if (res.car_billing_type == 2) { //
this.billingTime = '临时车'; this.timerId = setInterval(() => {
} else {
//
this.updateBillingTime(); this.updateBillingTime();
// }, 1000);
this.timerId = setInterval(() => {
this.updateBillingTime();
}, 1000);
}
} }
this.showCost1 = true; this.showCost1 = true;
@ -458,51 +393,23 @@ export default {
signType: res.signType, signType: res.signType,
paySign: res.paySign, paySign: res.paySign,
success: (payRes) => { success: (payRes) => {
//
//
if (this.timerId) {
clearInterval(this.timerId);
this.timerId = null;
}
//
this.showCost1 = false;
this.showCost2 = false;
this.parkingLotName = '';
this.costAmount = '';
this.currentCarNumber = '';
this.entryTime = '';
this.billingTime = '';
this.feeOutTime = '';
//
this.paymentMethod = 'wechat';
const params = { const params = {
order_id: resVal.order_id, order_id: resVal.order_id,
} }
request(apiArr.tempParkingOrderQuery, "POST", params).then(res => { request(apiArr.tempParkingOrderQuery, "POST", params).then(res => {
this.selectCost() this.selectCost()
}) })
}, },
fail: (payErr) => { fail: (payErr) => {
const params = {
order_id: resVal.order_id
}
request(apiArr.tempParkingOrderDelete, "POST", params).then((res) => {
})
uni.showToast({ uni.showToast({
title: payErr.errMsg == 'requestPayment:fail cancel' ? '用户取消支付' : '支付失败', title: payErr.errMsg == 'requestPayment:fail cancel' ? '用户取消支付' : '支付失败',
icon: 'none' icon: 'none'
}) })
//
} }
}) })
} else { } else {
const params = {
order_id: resVal.order_id
}
request(apiArr.tempParkingOrderDelete, "POST", params).then((res) => {
})
console.error("获取支付参数失败,缺少必要参数") console.error("获取支付参数失败,缺少必要参数")
uni.showToast({ uni.showToast({
title: '获取支付信息失败', title: '获取支付信息失败',
@ -510,13 +417,6 @@ export default {
}) })
} }
}) })
}).catch(error => {
console.log("111"); // 111
console.error("创建临时停车订单失败", error);
uni.showToast({
title: '创建订单失败',
icon: 'none'
})
}) })
}, },
// //

View File

@ -228,11 +228,11 @@ export default {
name: "临停缴费", name: "临停缴费",
url: "/packages/park/temporaryOrder/index", url: "/packages/park/temporaryOrder/index",
}, },
// { {
// image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/parkIndex_icon2.png", image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/parkIndex_icon2.png",
// name: "", name: "月卡充值",
// url: "/packages/park/monthlyPayment/index", url: "/packages/park/monthlyPayment/index",
// }, },
{ {
image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/parkIndex_icon3.png", image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/park/parkIndex_icon3.png",
name: "停车订单", name: "停车订单",