按城市的反馈表

master
Lei OT 2 years ago
parent 53956fde7e
commit f8b9c0d411

@ -246,9 +246,9 @@
align-items: baseline; align-items: baseline;
} }
.question-items h5 { /* .question-items h5 {
/* flex-basis: 150px; */ flex-basis: 150px;
} } */
.question-items .options { .question-items .options {
flex: 1 1 auto; flex: 1 1 auto;
@ -385,9 +385,9 @@
transition: background-color 0.3s; transition: background-color 0.3s;
} }
.city-list li:last-child { /* .city-list li:last-child {
/* border-bottom: none; */ border-bottom: none;
} } */
.city-list li:hover { .city-list li:hover {
background-color: #d54e21; background-color: #d54e21;
@ -514,17 +514,6 @@
vertical-align: middle; vertical-align: middle;
color: #d54e21; color: #d54e21;
} }
.rate-icon {
width: 20px;
height: 20px;
vertical-align: middle;
/* background: url('thumbsup.svg') no-repeat center; */
/* background-size: contain; */
filter: invert(27%) sepia(97%) saturate(7482%) hue-rotate(359deg) brightness(100%) contrast(107%);
}
.rate-icon path {
/* stroke: #d54e21; */
}
</style> </style>
<script src="./utils.js"></script> <script src="./utils.js"></script>
<script src="./vue@2.js"></script> <script src="./vue@2.js"></script>
@ -559,7 +548,7 @@
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.5-4.5a.5.5 0 0 0-.707 0L8 7.293 5.207 4.5a.5.5 0 0 0-.707.707L7.293 8l-2.793 2.793a.5.5 0 0 0 .707.707L8 8.707l2.793 2.793a.5.5 0 0 0 .707-.707L8.707 8l2.793-2.793a.5.5 0 0 0 0-.707z" /> <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.5-4.5a.5.5 0 0 0-.707 0L8 7.293 5.207 4.5a.5.5 0 0 0-.707.707L7.293 8l-2.793 2.793a.5.5 0 0 0 .707.707L8 8.707l2.793 2.793a.5.5 0 0 0 .707-.707L8.707 8l2.793-2.793a.5.5 0 0 0 0-.707z" />
</svg> </svg>
<h2>Error!</h2> <h2>Error!</h2>
<p>The entered URL is wrong.</p> <p>{{errorMsg}}</p>
</div> </div>
<template v-else> <template v-else>
@ -626,7 +615,6 @@
<options-item-star v-else question="Experience" v-bind:qitem="q" v-bind:si="3" v-bind:qi="qi" v-bind:key="q.id"></options-item> <options-item-star v-else question="Experience" v-bind:qitem="q" v-bind:si="3" v-bind:qi="qi" v-bind:key="q.id"></options-item>
</div> </div>
</div> </div>
<!-- debug: showPhotos -->
<div class="question " v-if="showPhotos"> <div class="question " v-if="showPhotos">
<h4>4. Would you give Asia Highlights permission to use photos taken by your tour guide(s) that contain your picture?</h2> <h4>4. Would you give Asia Highlights permission to use photos taken by your tour guide(s) that contain your picture?</h2>
<judgment-item question="photo" v-bind:qitem="{id: 'photo_permission', rate: feedbackEvaluation.usePhotos}" si="photo" qi="photo" key="photo"></judgment-item> <judgment-item question="photo" v-bind:qitem="{id: 'photo_permission', rate: feedbackEvaluation.usePhotos}" si="photo" qi="photo" key="photo"></judgment-item>
@ -757,7 +745,7 @@
}, },
}); });
const defaultHeaders = { mode: 'no-cors', 'Sec-Fetch-Mode': 'no-cors' }; const defaultHeaders = { mode: 'no-cors', 'Sec-Fetch-Mode': 'no-cors' };
const HOST100 = ''; // `http://202.103.68.144:890/service-CooperateSOA`; const HOST100 = `http://202.103.68.144:890/service-CooperateSOA`;
const HOST = HOST100 || `https://p9axztuwd7x8a7.mycht.cn/service-CooperateSOA`; const HOST = HOST100 || `https://p9axztuwd7x8a7.mycht.cn/service-CooperateSOA`;
const index = new Vue({ const index = new Vue({
el: '#app', el: '#app',
@ -770,6 +758,7 @@
return { return {
timer: null, timer: null,
error: false, error: false,
errorMsg: '',
webcode: 'ah', webcode: 'ah',
param: {}, param: {},
@ -804,6 +793,7 @@
} }
if (!(this.param.v && this.param.g)) { if (!(this.param.v && this.param.g)) {
this.error = true; this.error = true;
this.errorMsg = 'Invalid URL';
return false; return false;
} }
this.loading = true; this.loading = true;
@ -823,6 +813,7 @@
that.loading = false; that.loading = false;
that.cityList = res.cityList; that.cityList = res.cityList;
that.error = res.cityList.length === 0; that.error = res.cityList.length === 0;
that.errorMsg = 'No city found';
}); });
}, },
selectCity(city) { selectCity(city) {
@ -831,8 +822,6 @@
const _param = { const _param = {
GRI_SN: this.param.g, GRI_SN: this.param.g,
VEI_SN: this.param.v, VEI_SN: this.param.v,
// EOI_SN: this.param.e,
EOI_SN: city.cii_sn === 1186 ? 245176 : 245988, // debug: 接口未返回
CITY_SN: city.cii_sn, CITY_SN: city.cii_sn,
lgc: 1 lgc: 1
}; };
@ -868,6 +857,10 @@
{ headers: { ...{} } } { headers: { ...{} } }
).then((res) => { ).then((res) => {
that.loading = false; that.loading = false;
if (res.errcode !== 0) {
that.error = true;
that.errorMsg = 'Data error.';
}
const itemGroup = groupBy(res.feedbackItemList, ele => ele.type); const itemGroup = groupBy(res.feedbackItemList, ele => ele.type);
that.feedbackItem.guide = itemGroup.W ? itemGroup.W : []; that.feedbackItem.guide = itemGroup.W ? itemGroup.W : [];
that.feedbackItem.driver = itemGroup.Y ? itemGroup.Y : []; that.feedbackItem.driver = itemGroup.Y ? itemGroup.Y : [];
@ -895,13 +888,14 @@
that.tourGuideList = res.tourGuideList; that.tourGuideList = res.tourGuideList;
that.feedbackEvaluation = res.feedbackEvaluation[0]; that.feedbackEvaluation = res.feedbackEvaluation[0];
that.group = res.group[0]; that.group = res.group[0];
that.webcode = that.group.webcode ? that.group.webcode : that.webcode; that.webcode = that.group.webcode ? that.group.webcode.toLowerCase() : that.webcode; // todo:
// that.signaturePad.fromDataURL(that.feedbackEvaluation.signatureDataUrl); // debug: -1 // that.signaturePad.fromDataURL(that.feedbackEvaluation.signatureDataUrl); // debug: -1
that.isFilled = isEmpty(res.feedbackEvaluation[0].feedbackId); // debug: !isEmpty // that.isFilled = isEmpty(res.feedbackEvaluation[0].feedbackId); // debug: !isEmpty
that.isFilled = false;
that.showPhotos = res.group[0].inTheEnd; that.showPhotos = res.group[0].inTheEnd;
// alert("Thank you for completing the Feedback Evaluation. Once submitted the tour guide would not be able to view your comments. "); // debug: 1 // alert("Thank you for completing the Feedback Evaluation. Once submitted the tour guide would not be able to view your comments. ");
that.initSignature(); that.initSignature();
}); });
@ -938,16 +932,17 @@
postForm( postForm(
`${HOST}/save_feedback`, `${HOST}/save_feedback`,
{ {
EOI_SN: that.currentCity.EOI_SN, EOI_SN: that.group.EOI_SN,
GRI_SN: that.currentCity.GRI_SN, GRI_SN: that.currentCity.GRI_SN,
VEI_SN: that.currentCity.VEI_SN, VEI_SN: that.currentCity.VEI_SN,
// country_id:, // country_id:,
city_id: that.currentCity.cii_sn, city_sn: that.currentCity.cii_sn,
tour_guide_id: that.currentCity.tourGuideId, tour_guide_id: that.currentCity.tourGuideId,
use_the_photos: formValues.photo_permission || -1, // todo: 没有更新成功 use_the_photos: formValues.photo_permission || -1,
other_comments: formValues.comments, other_comments: formValues.comments,
service_item_answer: JSON.stringify(rateArr), service_item_answer: JSON.stringify(rateArr),
signature_data_url: formValues.signature, // todo: 没有更新成功 signature_data_url: formValues.signature,
feedback_id: that.feedbackEvaluation.feedbackId || undefined,
}, },
{ headers: { ...{} } } { headers: { ...{} } }
).then(res => { ).then(res => {

Loading…
Cancel
Save