This commit is contained in:
faiz 2024-06-28 17:06:01 +08:00
parent 633d7ec474
commit f3ca8f3812
5 changed files with 71 additions and 22 deletions

View File

@ -39,3 +39,10 @@ export default {
} }
} }
</script> </script>
<style scoped>
@import "./assets/fonts/font.css";
body{
font-family: PingFang !important;
}
</style>

Binary file not shown.

View File

@ -0,0 +1,6 @@
@font-face {
font-family: 'PingFang';
src: url('./PingFang SC.ttf');
font-weight: normal;
font-style: normal;
}

View File

@ -19,14 +19,18 @@
<div @click="handleQacityl(item.city_id)" class="btn" v-for="item in getQaCityList">{{ item.city_name }}</div> <div @click="handleQacityl(item.city_id)" class="btn" v-for="item in getQaCityList">{{ item.city_name }}</div>
</div> </div>
<div class="problem_right"> <div class="problem_right">
<ul class="infinite-list" v-infinite-scroll="load" style="overflow:auto"> <ul class="infinite-list" v-infinite-scroll="load" :infinite-scroll-immediate="false" style="overflow:auto">
<li class="problem_right_container" v-for="item in getQaLists"> <li class="problem_right_container" v-for="item in getQaLists">
<div class="title"> <div class="title">
<span v-html="item.title"></span> <span v-html="item.title"></span>
<el-button @click="handleZip(item.img_zip)" type="primary">下载图片</el-button> <el-button @click="handleZip(item.img_zip)" type="primary">下载图片</el-button>
<el-button @click="handleZip(item.trip_zip)" type="primary">下载行程</el-button> <el-button @click="handleZip(item.trip_zip)" type="primary">下载行程</el-button>
</div> </div>
<div class="desc" v-html="item.content"></div> <div class="desc_container" v-for="list in item.qaQuestions">
<div style="font-weight: 700;" class="desc" v-html="list.title"></div>
<div class="desc" v-html="handleprant(list.content)"></div>
</div>
</li> </li>
</ul> </ul>
</div> </div>
@ -72,6 +76,11 @@ export default {
load(){ load(){
console.log('load') console.log('load')
}, },
handleprant(val){
let replaceReg = new RegExp(7, "ig");
let replaceString = `<span style="color: #fca104">7</span>`;
return val.replace(replaceReg, replaceString);
},
onSubmit(){ onSubmit(){
getQaList(this.dataForm).then(res => { getQaList(this.dataForm).then(res => {
this.getQaLists = res.data.data.map((item, index) => { this.getQaLists = res.data.data.map((item, index) => {
@ -84,13 +93,41 @@ export default {
return item return item
}); });
}) })
// this.getQaLists
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "~@/assets/fonts/font.css";
body{
font-family: PingFang !important;
}
.infinite-list{
list-style-type: none;
height: calc(100vh - 154px);
padding: 0;
margin: 0;
}
.desc_container{
& + .desc_container{
margin-top: 10px;
padding-top: 10px;
// border-top: 1px solid #333333;
}
.desc_title{
font-size: 18px;
font-weight: 500;
color: #333333;
line-height: 25px;
margin-bottom: 10px;
}
.desc_content{
font-size: 14px;
font-weight: 300;
}
}
.problem{ .problem{
.problem_form{ .problem_form{
margin-top: 10px; margin-top: 10px;
@ -100,12 +137,13 @@ export default {
.problem_container{ .problem_container{
display: flex; display: flex;
.problem_left{ .problem_left{
font-family: PingFang, sans-serif;
font-weight: 300;
width: 18%; width: 18%;
background: #fff; background: #fff;
padding: 10px 20px; padding: 0 20px;
border-right: 1px solid #46a6ff; border-right: 2px solid #46a6ff;
height: calc(100vh - 154px); height: calc(100vh - 154px);
// border-left: 1px solid #46a6ff;
.btn{ .btn{
padding: 10px 20px; padding: 10px 20px;
cursor: pointer; cursor: pointer;
@ -120,9 +158,8 @@ export default {
.problem_right{ .problem_right{
width: 100%; width: 100%;
background: #fff; background: #fff;
padding: 20px; padding: 0 20px;
.problem_right_container{ .problem_right_container{
// border: 1px solid #ccc;
& + .problem_right_container{ & + .problem_right_container{
margin-top: 20px; margin-top: 20px;
} }
@ -132,7 +169,7 @@ export default {
margin-bottom: 10px; margin-bottom: 10px;
color: #46a6ff; color: #46a6ff;
&>:nth-child(1){ &>:nth-child(1){
margin-right: 20px; margin-right: 40px;
} }
} }
.desc{ .desc{

View File

@ -49,7 +49,7 @@
<el-input v-model="anchors.title" type="text" placeholder="请输入旅游路线" /> <el-input v-model="anchors.title" type="text" placeholder="请输入旅游路线" />
</el-form-item> </el-form-item>
<el-form-item label="QA内容"> <el-form-item label="QA内容">
<div class="mistake-content" v-for="(item, index) in anchors.qa_question"> <div class="mistake-content" v-for="(item, index) in anchors.qaQuestions">
<div class="mistake-left"> <div class="mistake-left">
<div>副标题</div> <div>副标题</div>
<div class="qa-desc"> <div class="qa-desc">
@ -122,7 +122,7 @@
<el-input v-model="anchors.content" :rows="6" style="height: 120px" type="textarea" placeholder="QA内容" /> <el-input v-model="anchors.content" :rows="6" style="height: 120px" type="textarea" placeholder="QA内容" />
</el-form-item> --> </el-form-item> -->
<el-form-item label="QA内容"> <el-form-item label="QA内容">
<div class="mistake-content" v-for="(item,index) in anchors.qa_question"> <div class="mistake-content" v-for="(item,index) in anchors.qaQuestions">
<div class="mistake-left"> <div class="mistake-left">
<div>副标题</div> <div>副标题</div>
<div class="qa-desc"> <div class="qa-desc">
@ -204,7 +204,7 @@ export default {
imageUrl:'', imageUrl:'',
imageUrls:'', imageUrls:'',
anchors: { anchors: {
qa_question:[] qaQuestions:[]
}, },
getQaCitys: {} getQaCitys: {}
} }
@ -217,21 +217,21 @@ export default {
}, },
methods: { methods: {
handleAdd(){ handleAdd(){
this.anchors.qa_question.push({ this.anchors.qaQuestions.push({
sort:this.anchors.qa_question.length, sort:this.anchors.qaQuestions[this.anchors.qaQuestions.length-1].sort+1,
title: '', title: '',
content: '' content: ''
}) })
}, },
handleDel(id){ handleDel(id){
if(this.anchors.qa_question.length==1){ if(this.anchors.qaQuestions.length==1){
this.$message({ this.$message({
message: '至少保留一条', message: '至少保留一条',
type: 'warning' type: 'warning'
}); });
return return
} }
this.anchors.qa_question = this.anchors.qa_question.filter((item,i)=>i!==id) this.anchors.qaQuestions = this.anchors.qaQuestions.filter((item,i)=>i!==id)
}, },
getQa() { getQa() {
this.listLoading = true this.listLoading = true
@ -254,8 +254,8 @@ export default {
}, },
onAdd() { onAdd() {
this.anchors = { this.anchors = {
qa_question:[{ qaQuestions:[{
sort:0, sort:1,
title: '', title: '',
content: '' content: ''
}] }]
@ -263,11 +263,11 @@ export default {
this.dialogCreate = true this.dialogCreate = true
}, },
onEdit(item) { onEdit(item) {
if(!item.qa_question){ if(!item.qaQuestions){
this.anchors = { this.anchors = {
...item, ...item,
qa_question:[{ qaQuestions:[{
sort:0, sort:1,
title: '', title: '',
content: '' content: ''
}] }]
@ -330,7 +330,6 @@ export default {
width: 90%; width: 90%;
} }
.mistake-right{ .mistake-right{
width: 10%;
padding-left: 20px; padding-left: 20px;
height: auto; height: auto;
display: flex; display: flex;