oil-station/gasStation-uni/pagesMy/details/details.vue
2024-01-24 14:35:00 +08:00

210 lines
5.1 KiB
Vue

<template>
<view class="content">
<view class="container">
<view class="my-header">
<view class="my-icons" @click="goback"> <uni-icons type="left" color="#ffffff" size="16"></uni-icons>
</view>
<view class="my-text">详情页</view>
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
<view class="top-size">
<!-- <view style="font-weight: bold;margin-bottom: 5px;">已支付订单</view> -->
<view style="font-weight: bold;margin-bottom: 5px;" v-if="oilOrder.orderStatus=='paid'">已支付订单</view>
<view style="font-weight: bold;margin-bottom: 5px;" v-else-if="oilOrder.orderStatus=='payFail'">支付失败订单</view>
<view style="font-weight: bold;margin-bottom: 5px;" v-else-if="oilOrder.orderStatus=='refund'">已退款订单</view>
<view style="font-weight: bold;margin-bottom: 5px;" v-else-if="oilOrder.orderStatus=='refunding'">退款中订单</view>
<view style="font-weight: bold;margin-bottom: 5px;" v-else>未支付订单</view>
<view class="">如果有疑问请向商家进行咨询</view>
</view>
<view class="centen-box">
<view class="box-title">订单信息</view>
<view class="dis-fx">
<view class="hui-size">油站名称</view>
<view class="">{{oilOrder.storeName}}{{oilOrder.description ? "("+oilOrder.description+")" : ""}}</view>
</view>
<view class="dis-fx">
<view class="hui-size">加油员工</view>
<view class="">{{oilOrder.realName}}</view>
</view>
<view class="dis-fx">
<view class="hui-size">油号油枪</view>
<view class="">{{oilOrder.oilName}}/{{oilOrder.gunName}}</view>
</view>
<view class="dis-fx">
<view class="hui-size">油品单价</view>
<view class="">{{oilPrice}}/L</view>
</view>
<view class="box-title">加油信息</view>
<view class="dis-fx">
<view class="hui-size">加油金额</view>
<view class="">{{oilOrder.orderAmount}}</view>
</view>
<view class="dis-fx">
<view class="hui-size">实付金额</view>
<view class="">{{oilOrder.payAmount}}</view>
</view>
<view class="dis-fx">
<view class="hui-size">储值卡或囤油卡消费金额</view>
<view class="">{{oilOrder.orderAmount - oilOrder.discountAmount - oilOrder.payAmount}}</view>
</view>
<view class="dis-fx">
<view class="hui-size">加油数量</view>
<view class="">{{oilOrder.oilNum}}</view>
</view>
<!-- <view class="box-title">优惠信息</view> -->
<view class="dis-fx" v-if="oilOrder.discountAmount>0">
<view class="hui-size">优惠金额</view>
<view class="">{{oilOrder.discountAmount}}</view>
</view>
</view>
<view class="anniu" v-if="oilOrder.orderStatus=='paid' && oilOrder.remark" @click="gocomment()">
<text>去评价</text>
</view>
</view>
</view>
</template>
<script>
import request from '../../utils/request'
export default {
data() {
return {
title: '',
orderId:"",
oilOrder:{},
oilPrice:"",
}
},
onLoad(e) {
this.orderId = e.orderId
this.getOilOrder()
},
components: {
},
methods: {
// 获取油品订单
getOilOrder() {
request({
url: "business/oilOrder/oilOrderId/" + this.orderId,
method: 'get',
}).then((res) => {
if(res.data){
this.oilOrder = res.data
this.getOilNumber(res.data.storeId)
}
})
},
// 获取当前店铺油号信息
getOilNumber(storeId) {
let _this = this;
request({
url: "business/petrolStationManagement/oilNumber/getOilNumberName/" + storeId,
method: 'get',
}).then((res) => {
res.data.forEach(item => {
if (item.oilName == _this.oilOrder.oils) {
_this.oilPrice = item.oilPrice;
}
})
})
},
gocomment() {
uni.navigateTo({
url: '/pagesMy/comment/comment'
})
},
goback() {
uni.navigateBack()
}
}
}
</script>
<style scoped lang="scss">
.content {
background: #f4f5f6;
}
.container {
width: 100%;
height: 100vh;
box-sizing: border-box;
padding-top: 88px;
}
.my-header {
width: 100%;
height: 88px;
background: #1678ff;
display: flex;
align-items: center;
justify-content: space-between;
color: #ffffff;
box-sizing: border-box;
padding: 0px 15px;
padding-top: 40px;
.my-icons {
width: 20px;
}
position: fixed;
top: 0px;
}
.top-size {
width: 100%;
height: 80px;
background: #1678ff;
color: white;
box-sizing: border-box;
padding: 20px;
}
.centen-box {
width: 100%;
box-sizing: border-box;
padding: 20px;
background-color: #ffffff;
}
.box-title {
width: 100%;
box-sizing: border-box;
padding-bottom: 8px;
border-bottom: 1px solid #dfdfdf;
margin-top: 10px;
}
.dis-fx {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin: 0px auto;
margin-top: 10px;
font-size: 14px;
}
.hui-size {
color: #999999;
}
.anniu {
width: 95%;
height: 55px;
background: #1678ff;
color: white;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8px;
margin: 30px auto;
}
</style>