Commit 431a06ce authored by youjie's avatar youjie

no message

parent 4975f684
......@@ -147,7 +147,7 @@
</div>
<div class="dayPage-box row">
<div class="dayPage-form">
<template v-show="!item.isHide">
<template v-if="!item.isHide">
<travelDays :index="index" :dataAll="dataAll" :item="item"></travelDays>
</template>
</div>
......
......@@ -58,7 +58,8 @@
</div>
<div class="travelDaysMasterMap-text absolute z-index2">
<vEditDiv v-if="ScenicArrayList.length==0" :canEdit='canEdit' v-model="item.TrafficObj.trafficIntroduce.IntroduceTitle"></vEditDiv>
<vEditDiv v-if="ScenicArrayList.length>0" :canEdit='canEdit' v-model="ScenicArrayList[0].CouponsName"></vEditDiv>
<template v-if="ScenicArrayList.length>0">{{ScenicArrayList[0].CouponsName}}</template>
<!-- <vEditDiv v-if="ScenicArrayList.length>0" :canEdit='canEdit' v-model="ScenicArrayList[0].CouponsName"></vEditDiv> -->
</div>
</div>
<div class="travelDaysMasterMap-two absolute z-index2" v-if="ScenicArrayList.length>1||ScenicArrayList.length>2"
......@@ -67,7 +68,7 @@
:style="{'color':'#fff'}"
:id="'viewSpotBox_'+(item*4)+'_1'+index"
v-if="ScenicArrayList.length>1">
<div class="featureDay-vToolBar absolute z-index3">
<div class="featureDay-vToolBar absolute z-index3" style="display: none;">
<FeatureControls :index="index" :FeatureData="item" :ControlsType="'row'" :isTemplate="false"
:isUploadImg="true" :isSelectImg="true"
@toUploadImg="UploadImg(1)" @toSelectImg="SelectImg(1)"
......@@ -93,7 +94,7 @@
:style="{'color':'#fff'}"
:id="'viewSpotBox_'+(item*4)+'_2'+index"
v-if="ScenicArrayList.length>2">
<div class="featureDay-vToolBar absolute z-index3">
<div class="featureDay-vToolBar absolute z-index3" style="display: none;">
<FeatureControls :index="index" :FeatureData="item" :ControlsType="'row'" :isTemplate="false"
:isUploadImg="true" :isSelectImg="true"
@toUploadImg="UploadImg(2)" @toSelectImg="SelectImg(2)"
......@@ -130,7 +131,10 @@
<div class="travelDaysContent">
<div class="travelDaysContent-text" v-for="(jindian,j) in item.ScenicArray"
v-if="item.ScenicArray.length>0">
<span class="textBold"><vEditDiv class="dayCouponsName" :canEdit='canEdit' v-model="'【'+jindian.CouponsName+'】'"></vEditDiv></span>
<span class="textBold">
【{{jindian.CouponsName}}】
<!-- <vEditDiv class="dayCouponsName" :canEdit='canEdit' v-model="'【'+jindian.CouponsName+'】'"></vEditDiv> -->
</span>
<span><vEditDiv :canEdit='canEdit' v-model="jindian.Description"></vEditDiv></span>
</div>
<div v-if="item.ScenicArray.length==0" class="travelDaysContent-text">
......@@ -333,6 +337,7 @@
that.item.TrafficObj.trafficIntroduce.IntroduceImage = allPath
that.item.TrafficObj.trafficIntroduce.x = 0
that.item.TrafficObj.trafficIntroduce.y = 0
that.item.TrafficObj.Introduce = JSON.stringify(this.item.TrafficObj.trafficIntroduce);
}
that.$message.success('上传成功');
that.item.ScenicArray = JSON.parse(JSON.stringify(that.ScenicArrayList))
......@@ -346,13 +351,33 @@
},
getDMCimg(selectImgArr) {
if(this.ScenicArrayList.length>0){
this.ScenicArrayList[this.imgIndex].NewImaArray[0].Url = selectImgArr[0].Path
this.ScenicArrayList[this.imgIndex].NewImaArray[0].x = 0
this.ScenicArrayList[this.imgIndex].NewImaArray[0].y = 0
var that = this;
selectImgArr.forEach(imgItem => {
var obj = {
Name: imgItem.Name,
Url: imgItem.Path,
fileName: imgItem.Name
};
if (imgItem.VideoPath) {
obj.VideoPath = imgItem.VideoPath;
}
if (imgItem.FileType) {
obj.FileType = imgItem.FileType;
}
that.ScenicArrayList[that.imgIndex].NewImaArray = [];
that.ScenicArrayList[that.imgIndex].NewImaArray.push(obj);
that.ScenicArrayList[that.imgIndex].ScenicJson.x = 0
that.ScenicArrayList[that.imgIndex].ScenicJson.y = 0
that.ScenicArrayList[that.imgIndex].NewScenicImg = JSON.stringify(that.ScenicArrayList[0].NewImaArray);
});
// this.ScenicArrayList[this.imgIndex].NewImaArray[0].Url = selectImgArr[0].Path
// this.ScenicArrayList[this.imgIndex].NewImaArray[0].x = 0
// this.ScenicArrayList[this.imgIndex].NewImaArray[0].y = 0
}else{
this.item.TrafficObj.trafficIntroduce.IntroduceImage = selectImgArr[0].Path
this.item.TrafficObj.trafficIntroduce.x = 0
this.item.TrafficObj.trafficIntroduce.y = 0
this.item.TrafficObj.Introduce = JSON.stringify(this.item.TrafficObj.trafficIntroduce);
}
this.isShowScenicImg = false;
this.item.ScenicArray = JSON.parse(JSON.stringify(this.ScenicArrayList))
......@@ -370,7 +395,6 @@
}
});
if(this.ScenicArrayList&&this.ScenicArrayList.length>0) this.ScenicArrayList.sort((a, b)=>{return a.Rank - b.Rank})
console.log(val.ScenicArray,'-----------')
},
deep: true,
immediate: true
......
......@@ -6,6 +6,7 @@
}
.TC-itemContent {
position: relative;
/* max-height: 700px; */
}
.TD_OperaContent {
......@@ -207,7 +208,8 @@
<div>
<span v-if="ishasScenic">默认展示图</span>
<el-select v-if="ishasScenic&&NoticeParameters.IsDirect==1" class="w220 Ht_hotelSelect" size="mini"
:placeholder="$t('pub.pleaseSel')" :multiple-limit="1" v-model="ScenicArray" multiple filterable
:placeholder="$t('pub.pleaseSel')" v-model="ScenicArraySingle"
filterable
@change="getScenicArray">
<el-option v-for="(item,index) in dayObj.ScenicArray" :label="item.CouponsName" :value="item.CouponsId" :key="index">
<span style="float: left">{{ item.CouponsName }}</span>
......@@ -320,6 +322,7 @@
],
data() {
return {
ScenicArraySingle: this.dayObj.ScenicArrayImg?this.dayObj.ScenicArrayImg:'',//单选默认图
ScenicArray: this.dayObj.ScenicArrayImg?this.dayObj.ScenicArrayImg:[],//默认展示图
DefaultSelectValue: 0,
QScenicList: [],
......@@ -340,28 +343,36 @@
};
},
methods: {
// 默认需要展示的图
getScenicArray(){
let i = 1
let list = []
this.ScenicArray.forEach(y=>{
this.dayObj.ScenicArray.forEach(x=>{
x.Rank = 0
if(x.CouponsId==y){
list.push(x)
}
})
})
list.forEach((x,index)=>{
x.Rank = index+1
})
// this.ScenicArray.forEach(y=>{
// this.dayObj.ScenicArray.forEach(x=>{
// x.Rank = 0
// if(x.CouponsId==y){
// list.push(x)
// }
// })
// })
// this.dayObj.ScenicArrayImg = JSON.parse(JSON.stringify(this.ScenicArray));
// list.forEach((x,index)=>{
// x.Rank = index+1
// })
// this.dayObj.ScenicArray.forEach(x=>{
// list.forEach(y=>{
// if(x.CouponsId==y.CouponsId){
// x.Rank = y.Rank
// }
// })
// })
this.dayObj.ScenicArray.forEach(x=>{
list.forEach(y=>{
if(x.CouponsId==y.CouponsId){
x.Rank = y.Rank
}
})
x.Rank = 0
if(x.CouponsId===this.ScenicArraySingle){
x.Rank = 1
}
})
if(this.ScenicArray&&this.ScenicArray.length>0) this.dayObj.ScenicArrayImg = JSON.parse(JSON.stringify(this.ScenicArray));
this.dayObj.ScenicArrayImg = this.ScenicArraySingle;
this.dayObj.ScenicArray = this.dayObj.ScenicArray.sort((a, b)=>{return b.Rank - a.Rank});
},
//非直采切换
......@@ -602,23 +613,29 @@
this.dayObj.TitleObj.DayNum = this.dayObj.DayNum;
this.dayObj.ChooseScenicArray = [];
this.ChooseScenicArray = [];
let status = false
this.dayObj.ScenicArray.forEach(x => {
this.dayObj.ChooseScenicArray.push(x.CouponsId);
if(x.Rank>0){
// this.ScenicArray.push(x.CouponsId)
this.ScenicArray = [x.CouponsId]
if(!status&&x.Rank>0){
// this.ScenicArray = [x.CouponsId]
this.ScenicArraySingle = x.CouponsId
status = true
}
});
if(!status&&this.dayObj.ScenicArray.length>0){
this.ScenicArraySingle = this.dayObj.ScenicArray[0].CouponsId
}
if(this.ScenicArray&&this.ScenicArray.length>0) {
this.ScenicArray.sort((a, b)=>{return a.Rank - b.Rank})
this.dayObj.ScenicArrayImg = JSON.parse(JSON.stringify(this.ScenicArray));
}
if(this.ScenicArraySingle){
this.dayObj.ScenicArrayImg = this.ScenicArraySingle;
}
if (this.dayObj.ChooseScenicArray.length > 0) {
this.ChooseScenicArray = JSON.parse(JSON.stringify(this.dayObj.ChooseScenicArray));
}
if (this.dayObj.ScenicArray != null && this.dayObj.ScenicArray.length > 0) {
this.ishasScenic = true;
this.QScenicList = [];
......@@ -655,10 +672,13 @@
//选中的景点
'ChooseScenicArray': {
handler: function (val, oldVal) {
if(val.length==0) this.ScenicArray = []
if(val.length==0) {
this.ScenicArray = [];
this.ScenicArraySingle = '';
}
let list = []
//新增
this.ChooseScenicArray.forEach(x => {
val.forEach(x => {
let isExist = false;
this.dayObj.ScenicArray.forEach(y => {
if (x === y.CouponsId) {
......@@ -700,8 +720,7 @@
}
}
});
list.push(scenic)
this.dayObj.ScenicArray = list.sort((a, b)=>{return b.Rank - a.Rank});
this.dayObj.ScenicArray.push(scenic)
}
});
//移除
......@@ -719,7 +738,7 @@
}
});
this.dayObj.ScenicArray = newScenicObj.sort((a, b)=>{return b.Rank - a.Rank});
if(this.dayObj.ScenicArray&&this.dayObj.ScenicArray.length>0) this.dayObj.ScenicArray.sort((a, b)=>{return a.Rank - b.Rank})
//清除数据
let scenicDescribeArr = [];
this.WarmTripDescribe.ScenicDescribeArr.forEach(x => {
......@@ -733,9 +752,35 @@
scenicDescribeArr.push(x);
}
});
this.WarmTripDescribe.ScenicDescribeArr = scenicDescribeArr;
this.dayObj.ChooseScenicArray = JSON.parse(JSON.stringify(this.ChooseScenicArray));
// 默认第一个为默认图
// if(this.ScenicArray,length==0&&this.ChooseScenicArray&&this.ChooseScenicArray.length>0){
// this.ScenicArray = [this.ChooseScenicArray[0]]
// this.getScenicArray()
// }
if(!this.ScenicArraySingle&&this.ChooseScenicArray&&this.ChooseScenicArray.length>0){
this.ScenicArraySingle = this.ChooseScenicArray[0]
this.getScenicArray()
}else{
let status = false
this.dayObj.ScenicArray.forEach(x=>{
x.Rank = 0
if(x.CouponsId===this.ScenicArraySingle){
status = true
x.Rank = 1
}
})
if(!status) {
this.ScenicArraySingle = this.ChooseScenicArray[0]
this.getScenicArray()
this.dayObj.ScenicArrayImg = this.ScenicArraySingle;
}
}
if(this.dayObj.ScenicArray&&this.dayObj.ScenicArray.length>0) this.dayObj.ScenicArray.sort((a, b)=>{return a.Rank - b.Rank})
}
},
WarmTripDescribe: {
......
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