Commit 4af826e3 authored by 黄奎's avatar 黄奎

酒店新增跳转链接

parent 01b2d0ca
......@@ -33,6 +33,7 @@
</ul>
</div>
<div>
<div style="color:red;margin-bottom:5px;">价格实时变动,以下价格仅供参考。</div>
<el-table :data="processedData" border style="width: 100%" v-loading='loading' :span-method="objectSpanMethod"
:header-cell-style="{background: '#f5f7fa', fontWeight: 'bold'}" max-height="690px" highlight-current-row>
<el-table-column prop="DiDaHotelName" label="酒店名称" width="200" align="center" fixed></el-table-column>
......@@ -41,11 +42,13 @@
min-width="75">
<template slot-scope="scope">
<span v-if="scope.row.priceType === '直客价'"
:style="{color: scope.row.priceArray[index] < scope.row.teamPriceArray[index] ? 'red' : ''}">
{{ scope.row.priceArray[index] }}
:style="{color: scope.row.SubList[index].Price <scope.row.SubList[index].TeamPrice ? 'red' : ''}"
@click="gotoPage(1,scope.row.SubList[index])" style="cursor:pointer; text-decoration: underline">
{{ scope.row.SubList[index].Price }}
</span>
<span v-else>
{{ scope.row.priceArray[index] }}
<span v-else @click="gotoPage(2,scope.row.SubList[index])"
style="cursor:pointer;text-decoration: underline">
{{ scope.row.SubList[index].TeamPrice}}
</span>
</template>
</el-table-column>
......@@ -116,15 +119,14 @@
result.push({
DiDaHotelName: hotel.DiDaHotelName,
priceType: '直客价',
priceArray: hotel.SubList.map(item => item.Price),
teamPriceArray: hotel.SubList.map(item => item.TeamPrice),
SubList: hotel.SubList,
rowspan: 2 // 用于合并单元格
});
// 道旅价行
result.push({
priceType: '道旅价',
priceArray: hotel.SubList.map(item => item.TeamPrice),
SubList: hotel.SubList,
rowspan: 0 // 用于合并单元格
});
});
......@@ -132,6 +134,22 @@
}
},
methods: {
gotoPage(type, item) {
//直客,天巡
if (type == 1) {
var txUrl = "https://www.tianxun.com/hotels/search?entity_id=" + item.HotelId + "&checkin=" + item
.CheckInDate + "&checkout=" + item.CheckOutDate + "&adults=2&rooms=1&sort=-relevance";
window.open(txUrl);
}
//道旅
else if (type == 2) {
var dlUrl = `http://${window.location.host}/#/` + "HotelDetails?id=" + item.DiDaHotelId + "&StartDate=" + item
.CheckInDate + "&EndDate=" + item.CheckOutDate;
window.open(dlUrl);
}
console.log("type", type);
console.log("row", row);
},
// 单元格合并方法
objectSpanMethod({
row,
......
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