提交 a17525de authored 作者: flex's avatar flex

提示

上级 23979b1c
...@@ -120,10 +120,11 @@ export function createOrder () { ...@@ -120,10 +120,11 @@ export function createOrder () {
}) })
} }
export function payOrder () { export function payOrder (data) {
return request({ return request({
url: '/hotel/payOrder', url: '/hotel/payOrder',
method:'post', method:'post',
data
}) })
} }
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</div> </div>
</div> </div>
<div class="content"> <div class="content">
<div class="list" v-for="(item,index) in orderData" :key="index"> <div class="list" v-for="(item, index) in orderData" :key="index">
<div class="header"> <div class="header">
<div class="left"> <div class="left">
<div class="time">Submission time:{{ item.update_time }}</div> <div class="time">Submission time:{{ item.update_time }}</div>
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
size="small" size="small"
plain plain
type="success" type="success"
>{{tabs[tabIndex].text}}</van-button >{{ tabs[tabIndex].text }}</van-button
> >
</div> </div>
<van-button <van-button
...@@ -67,28 +67,35 @@ ...@@ -67,28 +67,35 @@
:hairline="false" :hairline="false"
color="#2a2a2a" color="#2a2a2a"
type="success" type="success"
loading-text="Pay"
:Loading="btnLoading"
@click="onPay(item.orderNo)"
>Pay</van-button >Pay</van-button
> >
</div> </div>
<div class="pr-detail"> <div class="pr-detail">
<div class="pr-left"> <div class="pr-left">
<van-image src="./img/c_bg1.jpg"></van-image> <van-image :src="item.goods_pic"></van-image>
</div> </div>
<div class="pr-right"> <div class="pr-right">
<div class="title">{{item.goods_name}}</div> <div class="title">{{ item.goods_name }}</div>
<div class="tag"> <div class="tag">
<span>{{10.0}}</span> <!-- <span>10.0</span> -->
</div> </div>
<div class="bb"> <div class="bb">
<span>{{item.orderNo}}</span> <span>{{ item.orderNo }}</span>
</div>
<div class="num">
<span>{{ item.goods_price }} $</span>
</div>
<div class="desc">
<span>Includes taxes and service charges</span>
</div> </div>
<div class="num"><span>{{item.goods_price}} $</span></div>
<div class="desc"><span>Includes taxes and service charges</span></div>
</div> </div>
</div> </div>
<div class="desc-list"> <div class="desc-list">
<span>Total amount</span> <span>Total amount</span>
<span>1524.48</span> <span>{{ item.goods_price }}</span>
</div> </div>
<div class="desc-list"> <div class="desc-list">
<span>Order quantity</span> <span>Order quantity</span>
...@@ -96,7 +103,7 @@ ...@@ -96,7 +103,7 @@
</div> </div>
<div class="desc-list"> <div class="desc-list">
<span>Expected return</span> <span>Expected return</span>
<span>228.82</span> <span>{{ item.goods_lr }}</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -106,9 +113,11 @@ ...@@ -106,9 +113,11 @@
<script> <script>
import { openChat1 } from "@/utils/chat"; import { openChat1 } from "@/utils/chat";
import { jiudianList, lunbo,payOrder,orderList } from "@/api/contract"; import { jiudianList, lunbo, payOrder, orderList } from "@/api/contract";
import { nowLocationUrl } from "@/utils/tools"; import { nowLocationUrl } from "@/utils/tools";
import router from "@/router"; import router from "@/router";
import { Dialog, Loading } from "vant";
import { Toast } from 'vant';
export default { export default {
data() { data() {
...@@ -120,10 +129,36 @@ export default { ...@@ -120,10 +129,36 @@ export default {
{ text: "Completed", value: 2 }, { text: "Completed", value: 2 },
], ],
tabIndex: 0, tabIndex: 0,
orderData:[] orderData: [],
btnLoading:false
}; };
}, },
methods: { methods: {
onPay(orderId) {
Dialog.confirm({
title: "pay",
message: "The order is about to be paid",
confirmButtonText: "confirm",
cancelButtonText: "cancel",
})
.then(() => {
this.btnLoading=true;
payOrder({
orderNo: orderId,
}).then((res) => {
if(res.code==200){
Toast('Payment successful');
}else{
Toast(res.msg);
}
}).finally(()=>{
this.btnLoading=false;
});
})
.catch(() => {
// on cancel
});
},
openHotelChat() { openHotelChat() {
openChat1(); openChat1();
}, },
...@@ -139,15 +174,15 @@ export default { ...@@ -139,15 +174,15 @@ export default {
} }
console.log("酒店轮播图:", res.data); console.log("酒店轮播图:", res.data);
}, },
getOrderList(){ getOrderList() {
orderList({ orderList({
status:0, status: 0,
page:1, page: 1,
size:999 size: 999,
}).then(res=>{ }).then((res) => {
this.orderData=res.data; this.orderData = res.data;
}) });
} },
}, },
mounted() { mounted() {
this.getLunBoHotel(); this.getLunBoHotel();
...@@ -193,44 +228,44 @@ export default { ...@@ -193,44 +228,44 @@ export default {
} }
.pr-right { .pr-right {
margin-left: 20px; margin-left: 20px;
.title{ .title {
font-size: 1.1rem; font-size: 1.1rem;
font-weight: bold; font-weight: bold;
} }
.tag{ .tag {
margin: 30px 0; margin: 30px 0;
span{ span {
background: #755153; background: #755153;
padding: 5px 10px; padding: 5px 10px;
border-radius: 5px; border-radius: 5px;
color: #fff; color: #fff;
font-size: .8rem; font-size: 0.8rem;
} }
} }
.bb{ .bb {
margin-bottom: 20px; margin-bottom: 20px;
span{ span {
font-size: 1.1rem; font-size: 1.1rem;
background: #000; background: #000;
padding: 5px 20px; padding: 5px 20px;
color: #fff; color: #fff;
} }
} }
.num{ .num {
margin-bottom: 20px; margin-bottom: 20px;
display: flex; display: flex;
font-weight: bold; font-weight: bold;
justify-content: flex-end; justify-content: flex-end;
} }
.desc{ .desc {
color: #848484; color: #848484;
font-size: .8rem; font-size: 0.8rem;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
} }
} }
} }
.desc-list{ .desc-list {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
color: #787878; color: #787878;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论