Commit 21827683 authored by 沈良进's avatar 沈良进

订单详情页完善

parent 985bbd80
......@@ -2,7 +2,7 @@ import Vue from 'vue'
import axios from 'axios'
import md5 from 'js-md5'
// import {eventBus} from './eventBus'
import VueCoreVideoPlayer from 'vue-core-video-players'
// import VueCoreVideoPlayer from 'vue-core-video-players'
import 'viewerjs/dist/viewer.css'
import user from './user'
import message from './message'
......@@ -10,7 +10,7 @@ import product from './product'
import VueViewer from 'v-viewer'
// import VueCoreVideoPlayer from 'vue-core-video-player'
Vue.prototype.$EventBus = new Vue()
Vue.use(VueCoreVideoPlayer)
// Vue.use(VueCoreVideoPlayer)
Vue.use(VueViewer)
Vue.prototype.$md5 = md5;
Vue.prototype.$message = message
......
......@@ -3,79 +3,131 @@
</style>
<template>
<div>
<div
class="rounded-borders bg-white q-py-md"
style="width: 300px"
:style="{
width:
$q.screen.width < 1200 || $q.platform.is.mobile
? 'unset'
: '300px',
position:$q.platform.is.mobile?'unset':'sticky',
top:$q.platform.is.mobile?'unset':'50px',
}"
>
<!-- <div class="text-subtitle1 text-weight-bolder">付款明細</div> -->
<!-- <div class="q-mt-md text-grey-6">
<div class="row q-pb-xs no-wrap" v-if="AirportObj&&AirportObj.Name">
<div style="width: 80px">{{details.CarType==1?'接':'送'}}機機場:</div>
<div class="q-ml-md ellipsis-2-lines">{{AirportObj.Name}}</div>
</div>
<div class="row q-pb-xs no-wrap" v-if="AirportObj&&AirportObj.Name">
<div style="width: 80px">{{details.CarType==1?'抵達':'起飛'}}時間:</div>
<div class="q-ml-md ellipsis-2-lines">{{parameters.FlightTime}}</div>
</div>
<div class="row q-pb-xs no-wrap" v-if="parameters.GetonAddress">
<div style="width: 80px">上車點:</div>
<div class="q-ml-md ellipsis-2-lines">{{parameters.GetonAddress}}</div>
</div>
<div class="row q-pb-xs no-wrap" v-if="parameters.GetoffAddress">
<div style="width: 80px">下車點:</div>
<div class="q-ml-md ellipsis-2-lines">{{parameters.GetoffAddress}}</div>
</div>
<div class="row">
<div style="width: 80px">
接駁日期:</div>
<div class="q-ml-md">
{{parameters.OrderDate}}
</div>
</div>
</div>
<q-separator color="grey-2" class="q-my-md"/> -->
<div class="text-grey-9">
<!-- <div class="row q-mb-sm" v-if="chosenObj.Count>0&&CarObj">
<div class="col">{{CarObj.CarName}} x {{ chosenObj.Count }}</div>
<div>{{details.CurrencyCode}} {{ moneyFormat(OrderDate.originalB2CPrice,2) }}</div>
</div> -->
<!-- <hr
style="border: none; border-top: 1px dashed #eee !important"
class="bg-transparent q-mb-sm"
/> -->
<div class="row q-mb-sm items-center">
<div class="q-mr-lg">總金額</div>
<div class="text-subtitle2 text-weight-bolder">
CNY {{ moneyFormat(sumPrice, 2) }}
</div>
</div>
<hr style="border:none;" class="bg-transparent q-mb-sm" />
<div class="row q-mb-sm items-center">
<div class="q-mr-lg">優惠金額</div>
<div
class="text-subtitle2 text-weight-bolder text-teal"
v-if="DiscountsMoney > 0"
>
CNY - {{ moneyFormat(DiscountsMoney, 2) }}
<div
class="rounded-borders bg-white q-py-md"
style="width: 300px"
:style="{
width:
$q.platform.is.mobile
? 'unset'
: '300px',
position: $q.platform.is.mobile ? 'unset' : 'sticky',
top: $q.platform.is.mobile ? 'unset' : '50px',
}"
>
<div class="text-grey-9">
<div class="row q-mb-sm" v-if="chosenObj.ManNum > 0">
<div class="col">成人佔床 x {{ chosenObj.ManNum }}</div>
<div>CNY {{ moneyFormat(price.B2CMemberPrice, 2) }}</div>
</div>
<div class="row q-mb-sm" v-if="chosenObj.ChirdNeedBedNum > 0">
<div class="col">兒童佔床 x {{ chosenObj.ChirdNeedBedNum }}</div>
<div>
CNY
{{
moneyFormat(price.B2CMemberPrice + price.ChildNeedPrice, 2)
}}
</div>
</div>
<div class="row q-mb-sm" v-if="chosenObj.ChirdNum - chosenObj.ChirdNeedBedNum > 0">
<div class="col">兒童不佔床 x {{ chosenObj.ChirdNum - chosenObj.ChirdNeedBedNum }}</div>
<div>
CNY
{{
moneyFormat(
price.B2CMemberPrice - price.ChildNoNeedPrice,
2
)
}}
</div>
</div>
<div class="text-grey-5" v-else>暫無優惠</div>
<div class="row q-mb-sm" v-if="chosenObj.BabyNum > 0">
<div class="col">嬰兒不佔床 x {{ chosenObj.BabyNum }}</div>
<div>CNY {{ moneyFormat(price.BabyPrice, 2) }}</div>
</div>
<div v-if="price.safeMoney > 0">
<div class="row q-mb-sm" v-if="price.safeMoney > 0">
<div class="col">保險費 x {{ price.safeMoney }}/人</div>
<div>
CNY
{{
moneyFormat(
price.safeMoney *
(chosenObj.ManNum +
chosenObj.ChirdNum +
chosenObj.BabyNum),
2
)
}}
</div>
</div>
</div>
<div v-if="price.VisaPrice > 0 || price.OtherPrice > 0">
<div class="row q-mb-sm" v-if="price.VisaPrice > 0">
<div class="col">簽證費 x {{ price.VisaPrice }}/人</div>
<div>
CNY
{{
moneyFormat(
price.VisaPrice *
(chosenObj.ManNum +
chosenObj.ChirdNum +
chosenObj.BabyNum),
2
)
}}
</div>
</div>
<div class="row q-mb-sm" v-if="price.OtherPrice > 0">
<div class="col">雜費 x {{ price.OtherPrice }}/人</div>
<div>
CNY
{{
moneyFormat(
price.OtherPrice *
(chosenObj.ManNum +
chosenObj.ChirdNum +
chosenObj.BabyNum),
2
)
}}
</div>
</div>
</div>
<div class="row q-mb-sm" v-if="chosenObj.ChirdNum > 0">
<div class="col">兒童附加費 x {{ chosenObj.ChirdNum }}</div>
<div>CNY {{ moneyFormat(price.BabyChargePrice, 2) }}</div>
</div>
<div class="row q-mb-sm" v-if="chosenObj.SingleRoomNum > 0">
<div class="col">單房差價 x {{ chosenObj.SingleRoomNum }}</div>
<div>CNY {{ moneyFormat(price.SingleRoomPrice, 2) }}</div>
</div>
<div class="row q-mb-sm items-center">
<div class="col">總金額</div>
<div class="text-subtitle2 text-weight-bolder text-primary">
CNY {{ moneyFormat(sumPrice, 2) }}
</div>
</div>
<div class="row q-mb-sm items-center">
<div class="col">優惠金額</div>
<div
class="text-subtitle2 text-weight-bolder text-teal"
v-if="price.discountPrice > 0"
>
CNY - {{ moneyFormat(price.discountPrice, 2) }}
</div>
<div class="text-grey-5" v-else>暫無優惠</div>
</div>
<!-- <div class="row q-mb-sm items-center">
<div class="col">支付金額</div>
<div
class="text-h6 text-weight-bolder text-primary product-price"
>
CNY {{ moneyFormat(sumPrice - price.discountPrice, 2) }}
</div>
</div> -->
</div>
<!-- <hr style="border:none;" class="bg-transparent q-mb-sm" />
<div class="row q-mb-sm items-center">
<div class="q-mr-lg">支付金額</div>
<div class="text-h6 text-weight-bolder text-primary product-price">{{details.CurrencyCode}} {{ moneyFormat(Money,2) }}</div>
</div> -->
</div>
</div>
</div>
</div>
</template>
<script>
......@@ -88,50 +140,26 @@ export default {
},
data() {
return {
details: null,
sumPrice: 0,//总金额
DiscountsMoney: 0,//优惠金额
Money: 0, // 支付金額
chosenObj: {},
price: {},
sumPrice: 0,
}
},
mounted() {
this.getGroupData()
this.getCarOrder()
this.getOrder()
},
methods: {
// 获取团的详情
getGroupData() {
// this.$q.loading.show();
this.apipost(
"b2c_get_GetCarSingleProductDetail",
{ ProductId: this.orderInfo.GoodsId },
(r) => {
if (r.data.resultCode == 1) {
this.dataList = r.data.data;
this.emitAddress()
} else {
this.$q.notify({
type: "negative",
message: r.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
// this.$q.loading.hide();
},
null
);
},
getCarOrder() {
getOrder() {
this.$q.loading.show();
this.apipost(
"CarSingle_post_GetTYMyCarOrderInfo",
{ OrderId: this.orderInfo.ErpOrderId },
"sellorder_post_GetOrderEntity",
{ ID: this.orderInfo.ErpOrderId },
(r) => {
if (r.data.resultCode == 1) {
this.dataList = r.data.data;
this.Money = r.data.data.Money;
this.chosenObj = r.data.data.model;
this.price = r.data.data.modelPrice;
this.calcMoney()
} else {
this.$q.notify({
type: "negative",
......@@ -146,11 +174,38 @@ export default {
);
},
emitAddress() {
const {PlaceList} = this.dataList
PlaceList.findItem(item => item.id === this.id)
this.$emit('address', this.dataList)
}
calcMoney() {
let money = this.price.B2CMemberPrice * this.chosenObj.ManNum;
console.log('money1', money, this.price.B2CMemberPrice * this.chosenObj.ManNum)
money +=
(this.price.B2CMemberPrice -
this.price.ChildNoNeedPrice +
this.price.BabyChargePrice) *(this.chosenObj.ChirdNum - this.chosenObj.ChirdNeedBedNum);
console.log('money2', money, (this.price.B2CMemberPrice -
this.price.ChildNoNeedPrice +
this.price.BabyChargePrice) *(this.chosenObj.ChirdNum - this.chosenObj.ChirdNeedBedNum))
money +=
(this.price.B2CMemberPrice +
this.price.ChildNeedPrice +
this.price.BabyChargePrice) *(this.chosenObj.ChirdNum - this.chosenObj.ChirdNeedBedNum)
console.log('money3', money, (this.price.B2CMemberPrice +
this.price.ChildNeedPrice +
this.price.BabyChargePrice) *(this.chosenObj.ChirdNum - this.chosenObj.ChirdNeedBedNum))
money += this.price.BabyPrice * this.chosenObj.BabyNum;
console.log('money4', money, this.price.BabyPrice * this.chosenObj.BabyNum)
money += this.price.SingleRoomPrice * this.chosenObj.SingleRoomNum;
console.log('money5', money, this.price.SingleRoomPrice * this.chosenObj.SingleRoomNum)
let sumCount = this.chosenObj.ManNum + this.chosenObj.ChirdNum;
money += (this.price.VisaPrice||0) * sumCount;
console.log('money6', money, (this.price.VisaPrice||0) * sumCount)
money += (this.price.safeMoney||0) * sumCount;
console.log('money7', money, (this.price.safeMoney||0) * sumCount)
money += (this.price.OtherPrice||0) * sumCount;
console.log('money8', money, (this.price.OtherPrice||0) * sumCount)
this.sumPrice = money;
},
}
}
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment