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

订单详情页完善

parent 985bbd80
...@@ -2,7 +2,7 @@ import Vue from 'vue' ...@@ -2,7 +2,7 @@ import Vue from 'vue'
import axios from 'axios' import axios from 'axios'
import md5 from 'js-md5' import md5 from 'js-md5'
// import {eventBus} from './eventBus' // import {eventBus} from './eventBus'
import VueCoreVideoPlayer from 'vue-core-video-players' // import VueCoreVideoPlayer from 'vue-core-video-players'
import 'viewerjs/dist/viewer.css' import 'viewerjs/dist/viewer.css'
import user from './user' import user from './user'
import message from './message' import message from './message'
...@@ -10,7 +10,7 @@ import product from './product' ...@@ -10,7 +10,7 @@ import product from './product'
import VueViewer from 'v-viewer' import VueViewer from 'v-viewer'
// import VueCoreVideoPlayer from 'vue-core-video-player' // import VueCoreVideoPlayer from 'vue-core-video-player'
Vue.prototype.$EventBus = new Vue() Vue.prototype.$EventBus = new Vue()
Vue.use(VueCoreVideoPlayer) // Vue.use(VueCoreVideoPlayer)
Vue.use(VueViewer) Vue.use(VueViewer)
Vue.prototype.$md5 = md5; Vue.prototype.$md5 = md5;
Vue.prototype.$message = message Vue.prototype.$message = message
......
...@@ -3,79 +3,131 @@ ...@@ -3,79 +3,131 @@
</style> </style>
<template> <template>
<div> <div>
<div <div
class="rounded-borders bg-white q-py-md" class="rounded-borders bg-white q-py-md"
style="width: 300px" style="width: 300px"
:style="{ :style="{
width: width:
$q.screen.width < 1200 || $q.platform.is.mobile $q.platform.is.mobile
? 'unset' ? 'unset'
: '300px', : '300px',
position:$q.platform.is.mobile?'unset':'sticky', position: $q.platform.is.mobile ? 'unset' : 'sticky',
top:$q.platform.is.mobile?'unset':'50px', top: $q.platform.is.mobile ? 'unset' : '50px',
}" }"
> >
<!-- <div class="text-subtitle1 text-weight-bolder">付款明細</div> --> <div class="text-grey-9">
<!-- <div class="q-mt-md text-grey-6"> <div class="row q-mb-sm" v-if="chosenObj.ManNum > 0">
<div class="row q-pb-xs no-wrap" v-if="AirportObj&&AirportObj.Name"> <div class="col">成人佔床 x {{ chosenObj.ManNum }}</div>
<div style="width: 80px">{{details.CarType==1?'接':'送'}}機機場:</div> <div>CNY {{ moneyFormat(price.B2CMemberPrice, 2) }}</div>
<div class="q-ml-md ellipsis-2-lines">{{AirportObj.Name}}</div> </div>
</div> <div class="row q-mb-sm" v-if="chosenObj.ChirdNeedBedNum > 0">
<div class="row q-pb-xs no-wrap" v-if="AirportObj&&AirportObj.Name"> <div class="col">兒童佔床 x {{ chosenObj.ChirdNeedBedNum }}</div>
<div style="width: 80px">{{details.CarType==1?'抵達':'起飛'}}時間:</div> <div>
<div class="q-ml-md ellipsis-2-lines">{{parameters.FlightTime}}</div> CNY
</div> {{
<div class="row q-pb-xs no-wrap" v-if="parameters.GetonAddress"> moneyFormat(price.B2CMemberPrice + price.ChildNeedPrice, 2)
<div style="width: 80px">上車點:</div> }}
<div class="q-ml-md ellipsis-2-lines">{{parameters.GetonAddress}}</div> </div>
</div> </div>
<div class="row q-pb-xs no-wrap" v-if="parameters.GetoffAddress"> <div class="row q-mb-sm" v-if="chosenObj.ChirdNum - chosenObj.ChirdNeedBedNum > 0">
<div style="width: 80px">下車點:</div> <div class="col">兒童不佔床 x {{ chosenObj.ChirdNum - chosenObj.ChirdNeedBedNum }}</div>
<div class="q-ml-md ellipsis-2-lines">{{parameters.GetoffAddress}}</div> <div>
</div> CNY
<div class="row"> {{
<div style="width: 80px"> moneyFormat(
接駁日期:</div> price.B2CMemberPrice - price.ChildNoNeedPrice,
<div class="q-ml-md"> 2
{{parameters.OrderDate}} )
</div> }}
</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> </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> </div>
<!-- <hr style="border:none;" class="bg-transparent q-mb-sm" /> </div>
<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> </template>
<script> <script>
...@@ -88,50 +140,26 @@ export default { ...@@ -88,50 +140,26 @@ export default {
}, },
data() { data() {
return { return {
details: null, chosenObj: {},
sumPrice: 0,//总金额 price: {},
DiscountsMoney: 0,//优惠金额 sumPrice: 0,
Money: 0, // 支付金額
} }
}, },
mounted() { mounted() {
this.getGroupData() this.getOrder()
this.getCarOrder()
}, },
methods: { methods: {
// 获取团的详情 getOrder() {
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() {
this.$q.loading.show(); this.$q.loading.show();
this.apipost( this.apipost(
"CarSingle_post_GetTYMyCarOrderInfo", "sellorder_post_GetOrderEntity",
{ OrderId: this.orderInfo.ErpOrderId }, { ID: this.orderInfo.ErpOrderId },
(r) => { (r) => {
if (r.data.resultCode == 1) { if (r.data.resultCode == 1) {
this.dataList = r.data.data; this.chosenObj = r.data.data.model;
this.Money = r.data.data.Money; this.price = r.data.data.modelPrice;
this.calcMoney()
} else { } else {
this.$q.notify({ this.$q.notify({
type: "negative", type: "negative",
...@@ -146,11 +174,38 @@ export default { ...@@ -146,11 +174,38 @@ export default {
); );
}, },
emitAddress() {
const {PlaceList} = this.dataList calcMoney() {
PlaceList.findItem(item => item.id === this.id) let money = this.price.B2CMemberPrice * this.chosenObj.ManNum;
this.$emit('address', this.dataList) 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> </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