Commit 172ea700 authored by youjie's avatar youjie

优化

parent fc787796
......@@ -26,7 +26,7 @@
:style="{'width': Infor[2].proportion+'%'}">
</view>
</view>
<view class="EvaluationDetail-h-r-num">{{ Infor[2].Score.toFixed(1) }}</view>
<view class="EvaluationDetail-h-r-num">{{ Infor[2].Score?Infor[2].Score.toFixed(1):'0.0' }}</view>
</template>
</view>
<view class="EvaluationDetail-h-r-box col row items-center">
......@@ -37,7 +37,7 @@
:style="{'width': Infor[3].proportion+'%'}">
</view>
</view>
<view class="EvaluationDetail-h-r-num">{{ Infor[3].Score.toFixed(1) }}</view>
<view class="EvaluationDetail-h-r-num">{{ Infor[3].Score?Infor[3].Score.toFixed(1):'0.0' }}</view>
</template>
</view>
</view>
......@@ -51,7 +51,7 @@
:style="{'width': Infor[0].proportion+'%'}">
</view>
</view>
<view class="EvaluationDetail-h-r-num">{{ Infor[0].Score.toFixed(1) }}</view>
<view class="EvaluationDetail-h-r-num">{{ Infor[0].Score?Infor[0].Score.toFixed(1):'0.0' }}</view>
</template>
</view>
<view class="EvaluationDetail-h-r-box col row items-center">
......@@ -62,7 +62,7 @@
:style="{'width': Infor[1].proportion+'%'}">
</view>
</view>
<view class="EvaluationDetail-h-r-num">{{ Infor[1].Score.toFixed(1) }}</view>
<view class="EvaluationDetail-h-r-num">{{ Infor[1].Score?Infor[1].Score.toFixed(1):'0.0' }}</view>
</template>
</view>
</view>
......@@ -299,11 +299,9 @@
this.childTitles[2].num++
}
}
// console.log(this.dataList.length,'dataList---------2222')
},
picturesdate(list){
this.dataList = list.filter((item) => item.images.length > 0)
// console.log(this.dataList.length,'dataList---------111')
},
fatherClick(item){
this.fatherType = item.type
......@@ -364,7 +362,7 @@
min-height: 95vh;
}
.EvaluationDetail-header{
padding: 50rpx 43rpx 36rpx 30rpx;
padding: 50rpx 30rpx 36rpx 30rpx;
}
.EvaluationDetail-header-left{
background: #080A0A;
......@@ -422,6 +420,8 @@
}
.EvaluationDetail-h-r-num{
width: 44rpx;
flex-shrink: 0;
font-weight: bold;
font-size: 28rpx;
color: #080A0A;
......
......@@ -1348,6 +1348,24 @@
]
},
commentTypes: [
{
commentType: 1,
name: '酒店'
},
{
commentType: 2,
name: '餐食'
},
{
commentType: 3,
name: '景点'
},
{
commentType: 4,
name: '用车'
},
]
};
},
computed:{
......@@ -1750,47 +1768,7 @@
if (res.resultCode == 1) {
try {
this.commentList = res.data.commentList
this.Infor = []
let ScoreTotal = 0
for(let x =0; x < this.commentList.length; x++){
let obj = this.commentList[x]
if(obj.score>0){
ScoreTotal+=obj.score
}
this.commentList[x].images = []
for(let y = 0; y < obj.imgList.length; y++){
let img = obj.imgList[y]
if(img){
this.commentList[x].images.push({
url: img,
type: this.checkFileType(img),
})
}
}
let findIndex = this.Infor.findIndex(item=>{return item.commentType == obj.commentType})
if(findIndex==-1){
let types = JSON.parse(JSON.stringify(this.types))
if(obj.commentType==1){
types.commentType = 1
types.commentName = '酒店'
}else if(obj.commentType==2){
types.commentType = 2
types.commentName = '餐食'
}else if(obj.commentType==3){
types.commentType = 3
types.commentName = '景点'
}else if(obj.commentType==4){
types.commentType = 4
types.commentName = '用车'
}
types.SourceList.push(obj)
this.Infor.push(types)
}else{
this.Infor[findIndex].SourceList.push(obj)
}
}
ScoreTotal = ScoreTotal/this.commentList.length
this.ScoreTotal = ScoreTotal.toFixed(1)
this.AssemblyData()
this.getStartCitiesHandler()
this.stepNumber = res.data.orderNum
res.data.tempImgCover = JSON.parse(res.data.imgCover);
......@@ -1872,6 +1850,74 @@
}
);
},
AssemblyData(){
this.Infor = []
let ScoreTotal = 0
for(let x =0; x < this.commentList.length; x++){
let obj = this.commentList[x]
if(obj.score>0){
ScoreTotal+=obj.score
}
this.commentList[x].images = []
for(let y = 0; y < obj.imgList.length; y++){
let img = obj.imgList[y]
if(img){
this.commentList[x].images.push({
url: img,
type: this.checkFileType(img),
})
}
}
let findIndex = this.Infor.findIndex(item=>{return item.commentType == obj.commentType})
if(findIndex==-1){
let types = JSON.parse(JSON.stringify(this.types))
if(obj.commentType==1){
types.commentType = 1
types.commentName = '酒店'
}else if(obj.commentType==2){
types.commentType = 2
types.commentName = '餐食'
}else if(obj.commentType==3){
types.commentType = 3
types.commentName = '景点'
}else if(obj.commentType==4){
types.commentType = 4
types.commentName = '用车'
}
types.SourceList.push(obj)
this.Infor.push(types)
}else{
this.Infor[findIndex].SourceList.push(obj)
}
}
for(let x = 0; x < this.commentTypes.length; x++){
let obj = this.commentTypes[x]
let list = this.Infor.filter(item=> item.commentType == obj.commentType )
if(list.length==0){
let types = JSON.parse(JSON.stringify(this.types))
if(obj.commentType==1){
types.commentType = 1
types.commentName = '酒店'
}else if(obj.commentType==2){
types.commentType = 2
types.commentName = '餐食'
}else if(obj.commentType==3){
types.commentType = 3
types.commentName = '景点'
}else if(obj.commentType==4){
types.commentType = 4
types.commentName = '用车'
}
this.Infor.push(types)
}
}
console.log(this.Infor,'-------')
ScoreTotal = ScoreTotal/this.commentList.length
this.ScoreTotal = ScoreTotal.toFixed(1)
},
formatDay() {
this.d = this.dataList.dayList
if (this.d.length > 0) {
......
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