2025-05-28 15:00:31 +08:00
|
|
|
|
<script setup>
|
2025-07-01 00:25:17 +08:00
|
|
|
|
import { ref, onMounted } from "vue";
|
2025-05-28 15:00:31 +08:00
|
|
|
|
import Container from "@/components/Container.vue";
|
2025-07-01 00:25:17 +08:00
|
|
|
|
import SButton from "@/components/SButton.vue";
|
|
|
|
|
|
import { payOrderAPI, cancelOrderListAPI } from "@/apis";
|
|
|
|
|
|
import { orderStatusNames } from "@/constants";
|
2025-05-28 15:00:31 +08:00
|
|
|
|
|
2025-07-01 00:25:17 +08:00
|
|
|
|
const data = ref({});
|
2025-05-28 15:00:31 +08:00
|
|
|
|
|
2025-07-01 00:25:17 +08:00
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
const order = uni.getStorageSync("order");
|
|
|
|
|
|
data.value = order || {};
|
2025-05-28 15:00:31 +08:00
|
|
|
|
});
|
2025-07-01 00:25:17 +08:00
|
|
|
|
|
|
|
|
|
|
const goPay = async () => {
|
|
|
|
|
|
const result = await payOrderAPI(data.value.orderId);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const cancelOrder = async () => {
|
|
|
|
|
|
const result = await cancelOrderListAPI(data.value.orderId);
|
|
|
|
|
|
data.value = result;
|
|
|
|
|
|
};
|
2025-05-28 15:00:31 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
|
<Container title="订单详情">
|
|
|
|
|
|
<view class="container">
|
|
|
|
|
|
<view class="order">
|
2025-07-01 00:25:17 +08:00
|
|
|
|
<view>
|
|
|
|
|
|
<text>商品名:{{ data.vipName }}</text>
|
|
|
|
|
|
<text>订单号:{{ data.orderId }}</text>
|
|
|
|
|
|
<text>下单时间:{{ data.vipCreateAt }}</text>
|
|
|
|
|
|
<text>支付时间:2025-01-31 09:27:34</text>
|
|
|
|
|
|
<text>金额:{{ data.vipPrice }} 元</text>
|
|
|
|
|
|
<text>支付方式:微信</text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view v-if="data.orderStatus === 1">
|
|
|
|
|
|
<SButton :onClick="goPay">去支付</SButton>
|
|
|
|
|
|
<SButton :onClick="cancelOrder">取消订单</SButton>
|
|
|
|
|
|
</view>
|
2025-05-28 15:00:31 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</Container>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.container {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
background-color: #e4e4e4;
|
|
|
|
|
|
padding-top: 10px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.order {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
background-color: #fff;
|
2025-07-01 00:25:17 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
}
|
|
|
|
|
|
.order > view:first-child {
|
2025-05-28 15:00:31 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
padding: 15px;
|
|
|
|
|
|
}
|
2025-07-01 00:25:17 +08:00
|
|
|
|
.order > view:first-child > text:first-child {
|
2025-05-28 15:00:31 +08:00
|
|
|
|
color: #000;
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
}
|
2025-07-01 00:25:17 +08:00
|
|
|
|
.order > view:first-child > text {
|
2025-05-28 15:00:31 +08:00
|
|
|
|
color: #666666;
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
margin-top: 5px;
|
|
|
|
|
|
}
|
2025-07-01 00:25:17 +08:00
|
|
|
|
.order > view:last-child {
|
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
|
}
|
2025-05-28 15:00:31 +08:00
|
|
|
|
</style>
|