Commit 14646010 authored by 黄奎's avatar 黄奎

新增排序

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