Commit 14646010 authored by 黄奎's avatar 黄奎

新增排序

parent 9553bac7
......@@ -5,7 +5,7 @@
<tbody>
<tr>
<td>
行程內容頁 功能開關
行程內容頁 功能開關 <el-button type="primary" size="small" @click="saveData()">保存</el-button>
</td>
</tr>
</tbody>
......@@ -13,11 +13,11 @@
<tr>
<td>
行程頁背版
<el-radio v-model="postMsg.IsShowBgImg" :label="1">開啟</el-radio>
<el-radio v-model="postMsg.IsShowBgImg" :label="0">關閉</el-radio>
<el-radio v-model="TripBgImgItem.plugData.IsShowBgImg" :label="1">開啟</el-radio>
<el-radio v-model="TripBgImgItem.plugData.IsShowBgImg" :label="0">關閉</el-radio>
</td>
</tr>
<tr v-if="postMsg.IsShowBgImg==1">
<tr v-if="TripBgImgItem.plugData.IsShowBgImg==1">
<td>
<img :src="DefaultBgImg" style="width:100px;height:60px;" />
</td>
......@@ -27,7 +27,7 @@
<tr>
<td>
動態橫幅
<el-select v-model="postMsg.TripBottonStyle">
<el-select v-model="TripBottonItem.plugData.TripBottonStyle">
<el-option v-for="(item,index) in TripBottonStyleArray" :key="index" :label="item.Name" :value="item.Id">
</el-option>
</el-select>
......@@ -47,93 +47,114 @@
</td>
</tr>
</tbody>
<tbody>
<tr>
<td>
標題
<img :src="DefaultTitleImg" style="width:100px;height:60px;" />
</td>
</tr>
</tbody>
<tbody>
<tr>
<td>
行程資訊(無設定團位時則不顯示)
<el-select v-model="postMsg.TripListStyle">
<el-option v-for="(item,index) in TripListStyleArray" :key="index" :label="item.Name" :value="item.Id">
</el-option>
</el-select>
</td>
</tr>
<tr>
<td>
<img v-if="getListStyleImg()" :src="getListStyleImg()" style="width:100px;height:60px;" />
</td>
</tr>
</tbody>
<tbody>
<tr>
<td>
每日行程(無設定團位時則不顯示)
<el-radio v-model="postMsg.TripDayIsOpen" :label="1">展開</el-radio>
<el-radio v-model="postMsg.TripDayIsOpen" :label="0">收合</el-radio>
<br />
<el-select v-model="postMsg.TripDayStyle">
<el-option v-for="(item,index) in TripDayStyleArray" :key="index" :label="item.Name" :value="item.Id">
</el-option>
</el-select>
</td>
</tr>
<tr>
<td>
<img v-if="getDayStyleImg()" :src="getDayStyleImg()" style="width:100px;height:60px;" />
</td>
</tr>
</tbody>
<template v-for="(item,index) in OtherList">
<tbody>
<tr>
<td>
行程特色
<el-radio v-model="postMsg.TripFeatureIsOpen" :label="1">展開</el-radio>
<el-radio v-model="postMsg.TripFeatureIsOpen" :label="0">收合</el-radio>
</td>
</tr>
<tr>
<td>
<img :src="DefaultFeatureImg" style="width:100px;height:60px;" />
</td>
</tr>
</tbody>
<tbody v-if="item.Id=='TripTitleItem'" :key="index+1">
<tr>
<td>
<a @click="MoveData(index,1)">上移</a>
<a @click="MoveData(index,2)">下移</a>
<tbody>
<tr>
<td>
注意事項
<el-radio v-model="postMsg.NoticeItemIsOpen" :label="1">展開</el-radio>
<el-radio v-model="postMsg.NoticeItemIsOpen" :label="0">收合</el-radio>
</td>
</tr>
<tr>
<td>
<img :src="DefaultNoticeImg" style="width:100px;height:60px;" />
</td>
</tr>
</tbody>
標題
<img :src="DefaultTitleImg" style="width:100px;height:60px;" />
</td>
</tr>
</tbody>
<tbody v-if="item.Id=='TripListItem'" :key="index+100">
<tr>
<td>
<a @click="MoveData(index,1)">上移</a>
<a @click="MoveData(index,2)">下移</a>
<tbody>
<tr>
<td>
立即預訂
<span class="tip">(有設定團位時則不顯示)</span>
</td>
</tr>
<tr>
<td>
<img :src="DefaultOrderImg" style="width:100px;height:60px;" />
</td>
</tr>
</tbody>
行程資訊(無設定團位時則不顯示)
<el-select v-model="item.plugData.TripListStyle">
<el-option v-for="(item,index) in TripListStyleArray" :key="index" :label="item.Name" :value="item.Id">
</el-option>
</el-select>
</td>
</tr>
<tr>
<td>
<img v-if="getListStyleImg(item)" :src="getListStyleImg(item)" style="width:100px;height:60px;" />
</td>
</tr>
</tbody>
<tbody v-if="item.Id=='TripDayItem'" :key="index+200">
<tr>
<td>
<a @click="MoveData(index,1)">上移</a>
<a @click="MoveData(index,2)">下移</a>
每日行程(無設定團位時則不顯示)
<el-radio v-model="item.plugData.TripDayIsOpen" :label="1">展開</el-radio>
<el-radio v-model="item.plugData.TripDayIsOpen" :label="0">收合</el-radio>
<br />
<el-select v-model="item.plugData.TripDayStyle">
<el-option v-for="(item,index) in TripDayStyleArray" :key="index" :label="item.Name" :value="item.Id">
</el-option>
</el-select>
</td>
</tr>
<tr>
<td>
<img v-if="getDayStyleImg(item)" :src="getDayStyleImg(item)" style="width:100px;height:60px;" />
</td>
</tr>
</tbody>
<tbody v-if="item.Id=='TripFeatureItem'" :key="index+300">
<tr>
<td>
<a @click="MoveData(index,1)">上移</a>
<a @click="MoveData(index,2)">下移</a>
行程特色
<el-radio v-model="item.plugData.TripFeatureIsOpen" :label="1">展開</el-radio>
<el-radio v-model="item.plugData.TripFeatureIsOpen" :label="0">收合</el-radio>
</td>
</tr>
<tr>
<td>
<img :src="DefaultFeatureImg" style="width:100px;height:60px;" />
</td>
</tr>
</tbody>
<tbody v-if="item.Id=='NoticeItem'" :key="index+400">
<tr>
<td>
<a @click="MoveData(index,1)">上移</a>
<a @click="MoveData(index,2)">下移</a>
注意事項
<el-radio v-model="postMsg.NoticeItemIsOpen" :label="1">展開</el-radio>
<el-radio v-model="postMsg.NoticeItemIsOpen" :label="0">收合</el-radio>
</td>
</tr>
<tr>
<td>
<img :src="DefaultNoticeImg" style="width:100px;height:60px;" />
</td>
</tr>
</tbody>
<tbody v-if="item.Id=='OrderItem'" :key="index+500">
<tr>
<td>
<a @click="MoveData(index,1)">上移</a>
<a @click="MoveData(index,2)">下移</a>
立即預訂
<span class="tip">(有設定團位時則不顯示)</span>
</td>
</tr>
<tr>
<td>
<img :src="DefaultOrderImg" style="width:100px;height:60px;" />
</td>
</tr>
</tbody>
</template>
</table>
</div>
</template>
......@@ -197,16 +218,16 @@
Img: "http://imgfile.oytour.com/static/websiteimg/daily2.png"
},
],
//背景图配置
TripBgImgItem: {},
//行程按钮项
TripBottonItem: {},
//其他项
OtherList: [],
postMsg: {
Id: 0,
IsShowBgImg: 1, //是否显示背景图【行程頁背版0-关闭,1-开启】
TripBottonStyle: 1, //动态样式【動態橫幅】【0-無,1-顏色:溫暖,2-顏色:海洋,3-顏色:自然,4-顏色:神秘,5-顏色:青檸】
TripListStyle: 1, //行程列表样式【0-行程資訊:月曆,1-行程資訊:列表】
TripDayIsOpen: 1, //每日行程【0-收起,1-展开】
TripDayStyle: 1, //每日行程样式【1-每日行程:版本1,2-每日行程:版本2】
TripFeatureIsOpen: 1, //行程特色【0-收起,1-展开】
NoticeItemIsOpen:1,//注意事项【0-收起,1-展开】
AboutDataList: [],
//行程数据
TripDataList: [],
}
};
},
......@@ -214,11 +235,31 @@
this.getData();
},
methods: {
//上移下移
MoveData(index, type) {
var currentItem = this.OtherList[index];
//上移
if (type == 1) {
if (index != 0) {
var upItem = this.OtherList[index - 1];
this.$set(this.OtherList, index - 1, currentItem);
this.$set(this.OtherList, index, upItem);
}
}
//下移
else {
if (index != this.OtherList.length - 1) {
var downItem = this.OtherList[index + 1];
this.$set(this.OtherList, index + 1, currentItem);
this.$set(this.OtherList, index, downItem);
}
}
},
//获取按钮样式图片
getBottonStyleImg() {
var str = "";
var bottomStyleItem = this.TripBottonStyleArray.find(member => {
return member.Id == this.postMsg.TripBottonStyle;
return member.Id == this.TripBottonItem.plugData.TripBottonStyle;
});
if (bottomStyleItem) {
str = bottomStyleItem.Img
......@@ -226,10 +267,10 @@
return str;
},
//获取行程列表样式图片
getListStyleImg() {
getListStyleImg(item) {
var str = "";
var listStyleItem = this.TripListStyleArray.find(member => {
return member.Id == this.postMsg.TripListStyle;
return member.Id == item.plugData.TripListStyle;
});
if (listStyleItem) {
str = listStyleItem.Img
......@@ -237,10 +278,10 @@
return str;
},
//每日行程图片
getDayStyleImg() {
getDayStyleImg(item) {
var str = "";
var dayStyleItem = this.TripDayStyleArray.find(member => {
return member.Id == this.postMsg.TripDayStyle;
return member.Id == item.plugData.TripDayStyle;
});
if (dayStyleItem) {
str = dayStyleItem.Img
......@@ -259,8 +300,16 @@
if (tempData.Id) {
this.postMsg.Id = tempData.Id;
}
if (tempData.AboutDataList && tempData.AboutDataList.length > 0) {
this.postMsg.AboutDataList = tempData.AboutDataList;
if (tempData.TripDataList && tempData.TripDataList.length > 0) {
tempData.TripDataList.forEach(item => {
if (item.Id == "TripBgImgItem") {
this.TripBgImgItem = item;
} else if (item.Id == "TripBottonItem") {
this.TripBottonItem = item;
} else {
this.OtherList.push(item);
}
});
}
}
} else {
......@@ -272,6 +321,11 @@
},
//保存数据
saveData() {
this.postMsg.TripDataList.push(this.TripBgImgItem);
this.postMsg.TripDataList.push(this.TripBottonItem);
this.OtherList.forEach(item => {
this.postMsg.TripDataList.push(item);
})
this.apipost(
"ws_post_SetTripData", this.postMsg,
res => {
......
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