fix:手机端搜索页面优化调整接口数据

This commit is contained in:
zyd
2022-06-06 15:15:38 +08:00
parent c3cd41150d
commit c9bc703a40
+234 -89
View File
@@ -24,8 +24,8 @@
<div v-else-if="!loading && standList.length" class="card-content" v-for="item in standList" :key="item.id"> <div v-else-if="!loading && standList.length" class="card-content" v-for="item in standList" :key="item.id">
<div class="standTitle"> <div class="standTitle">
<div v-if="titleType === 'POLICY'" class="title">{{item.lawsNumber}}</div> <div v-if="titleType === 'POLICY'" class="title">{{item.lawsNumber}}</div>
<div v-else-if="titleType !== 'POLICY' && item.standYear" class="title">{{item.standSortShow + '&nbsp&nbsp' + item.standNumber + '-' + item.standYear }}</div> <div v-else-if="titleType !== 'POLICY' && item.standYear" class="title">{{item.standSort + '&nbsp&nbsp' + item.standNumber + '-' + item.standYear }}</div>
<div v-else class="title">{{item.standSortShow + '&nbsp&nbsp' + item.standNumber }}</div> <div v-else class="title">{{item.standSort + '&nbsp&nbsp' + item.standNumber }}</div>
</div> </div>
<div class="standContent"> <div class="standContent">
<div class="standState">{{item.standName}}</div> <div class="standState">{{item.standName}}</div>
@@ -79,10 +79,10 @@
</div> </div>
<div class="content-time"> <div class="content-time">
<div style="margin-top: 10px"> <div style="margin-top: 10px">
<span style="padding: 20px;">发布日期: <span style="padding-left: 10px;min-width: 200px;">发布日期:
{{ item.issueTime ? $moment(item.issueTime).format("YYYY-MM-DD") : "" }}</span> {{ item.issueTime ? (item.issueTime !== '' ? $moment(item.issueTime).format("YYYY-MM-DD") : " ") : " " }}</span>
<span style="padding: 20px;" v-if="titleType === 'POLICY'">实施日期: {{item.XCXSSRQLAWS}}</span> <span style="padding-left: 15px;" v-if="titleType === 'POLICY'">实施日期: {{item.XCXSSRQLAWS}}</span>
<span style="padding: 20px;" v-else>实施日期: {{item.putTime}}</span> <span style="padding-left: 15px;" v-else>实施日期: {{item.SSRQ}}</span>
</div> </div>
</div> </div>
@@ -149,46 +149,31 @@ export default {
this.standList = [] this.standList = []
this.page = 1 this.page = 1
if(this.titleType === 'INLAND'){ if(this.titleType === 'INLAND'){
this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage',{ // this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage',{
// page: this.page,
// standNumber: this.searchKey,
// pageSize: 20,
// standType: 'INLAND'
// },{
// _this: this
// },res=>{
// if (res.ok){
// this.standList = res.data.list
// this.loading = false
// }else {
// this.$message.error(res.message)
// }
// },e=>{
// })
this.$http.post('search/searchCenter/searchSarBykey',{
selectIndex: 'stand',
selectValue: this.searchKey,
selectType: 'titleSearch',
standType: 'INLAND',
page: this.page, page: this.page,
standNumber: this.searchKey, pageSize: 20
pageSize: 20,
standType: 'INLAND'
},{ },{
_this: this _this: this,
},res=>{
if (res.ok){
this.standList = res.data.list
this.loading = false
}else {
this.$message.error(res.message)
}
},e=>{
})
}else if(this.titleType === 'FOREIGN'){
this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage',{
page: 1,
pageSize: 20,
standNumber: this.searchKey,
standType: 'FOREIGN'
},{
_this: this
},res=>{
if (res.ok){
this.standList = res.data.list
this.loading = false
}else {
this.$message.error(res.message)
}
},e=>{
})
}else if(this.titleType === 'POLICY'){
this.$http.get('lawss/sarLawsInfo/page',{
page: 1,
pageSize: 20,
lawsNumber: this.searchKey,
},{
_this: this
}, res => { }, res => {
if (res.ok){ if (res.ok){
this.standList = res.data.list this.standList = res.data.list
@@ -196,9 +181,83 @@ export default {
}else { }else {
this.$message.error(res.message) this.$message.error(res.message)
} }
}, e =>{ }, e => {
console.log(e); console.log(e)
}) })
}else if(this.titleType === 'FOREIGN'){
// this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage',{
// page: 1,
// pageSize: 20,
// standNumber: this.searchKey,
// standType: 'FOREIGN'
// },{
// _this: this
// },res=>{
// if (res.ok){
// this.standList = res.data.list
// this.loading = false
// }else {
// this.$message.error(res.message)
// }
// },e=>{
// })
this.$http.post('search/searchCenter/searchSarBykey',{
selectIndex: 'stand',
selectValue: this.searchKey,
selectType: 'titleSearch',
standType: 'FOREIGN',
page: this.page,
pageSize: 20
},{
_this: this,
}, res => {
if (res.ok){
this.standList = res.data.list
this.loading = false
}else {
this.$message.error(res.message)
}
}, e => {
console.log(e)
})
}else if(this.titleType === 'POLICY'){
// this.$http.get('lawss/sarLawsInfo/page',{
// page: 1,
// pageSize: 20,
// lawsNumber: this.searchKey,
// },{
// _this: this
// }, res => {
// if (res.ok){
// this.standList = res.data.list
// this.loading = false
// }else {
// this.$message.error(res.message)
// }
// }, e =>{
// console.log(e);
// })
this.$http.post('search/searchCenter/searchSarBykey',{
selectIndex: 'laws',
selectValue: this.searchKey,
selectType: 'titleSearch',
type: 'laws',
page: this.page,
pageSize: 20
},{
_this: this,
}, res => {
if (res.ok){
this.standList = res.data.list
this.loading = false
}else {
this.$message.error(res.message)
}
}, e => {
console.log(e)
})
}else{ }else{
this.$http.get("/lawss/NewsFeed/getNewsFeed", { this.$http.get("/lawss/NewsFeed/getNewsFeed", {
messageType: 'ZYBZFG', messageType: 'ZYBZFG',
@@ -223,15 +282,41 @@ export default {
this.listFlag = false this.listFlag = false
this.moreFlag = false this.moreFlag = false
if(this.titleType === 'INLAND'){ if(this.titleType === 'INLAND'){
this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage',{ // this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage',{
// page: this.page,
// pageSize: 20,
// standNumber: this.searchKey,
// standType: 'INLAND'
// },{
// _this: this
// },res=>{
// if (res.ok){
// if(res.data.list.length){
// if(this.standList.length){
// this.standList = this.standList.concat(res.data.list)
// }else{
// this.standList = res.data.list
// }
// this.loading = false
// }else{
// this.listFlag = true
// }
// }else {
// this.$message.error(res.message)
// }
// },e=>{
// })
this.$http.post('search/searchCenter/searchSarBykey',{
selectIndex: 'stand',
selectValue: this.searchKey,
selectType: 'titleSearch',
standType: 'INLAND',
page: this.page, page: this.page,
pageSize: 20, pageSize: 20
standNumber: this.searchKey,
standType: 'INLAND'
},{ },{
_this: this _this: this,
},res=>{ }, res => {
if (res.ok){ if(res.ok){
if(res.data.list.length){ if(res.data.list.length){
if(this.standList.length){ if(this.standList.length){
this.standList = this.standList.concat(res.data.list) this.standList = this.standList.concat(res.data.list)
@@ -240,23 +325,52 @@ export default {
} }
this.loading = false this.loading = false
}else{ }else{
this.loading = false
this.listFlag = true this.listFlag = true
} }
}else { }else{
this.$message.error(res.message) this.$message.error(res.message)
} }
},e=>{ }, e => {
console.log(e)
}) })
}else if(this.titleType === 'FOREIGN'){ }else if(this.titleType === 'FOREIGN'){
this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage',{ // this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage',{
page: 1, // page: 1,
pageSize: 20, // pageSize: 20,
standNumber: this.searchKey, // standNumber: this.searchKey,
standType: 'FOREIGN' // standType: 'FOREIGN'
// },{
// _this: this
// },res=>{
// if (res.ok){
// if(res.data.list.length){
// if(this.standList.length){
// this.standList = this.standList.concat(res.data.list)
// }else{
// this.standList = res.data.list
// }
// this.loading = false
// }else{
// this.listFlag = true
// }
// }else {
// this.$message.error(res.message)
// }
// },e=>{
// })
this.$http.post('search/searchCenter/searchSarBykey',{
selectIndex: 'stand',
selectValue: this.searchKey,
selectType: 'titleSearch',
standType: 'FOREIGN',
page: this.page,
pageSize: 20
},{ },{
_this: this _this: this,
},res=>{ }, res => {
if (res.ok){ if(res.ok){
if(res.data.list.length){ if(res.data.list.length){
if(this.standList.length){ if(this.standList.length){
this.standList = this.standList.concat(res.data.list) this.standList = this.standList.concat(res.data.list)
@@ -265,38 +379,68 @@ export default {
} }
this.loading = false this.loading = false
}else{ }else{
this.loading = false
this.listFlag = true this.listFlag = true
} }
}else { }else{
this.$message.error(res.message) this.$message.error(res.message)
} }
},e=>{ }, e => {
console.log(e)
}) })
}else if(this.titleType === 'POLICY'){ }else if(this.titleType === 'POLICY'){
this.$http.get('lawss/sarLawsInfo/page',{ // this.$http.get('lawss/sarLawsInfo/page',{
lawsNumber: this.searchKey, // lawsNumber: this.searchKey,
page: 1, // page: 1,
pageSize: 20, // pageSize: 20,
},{ // },{
_this: this // _this: this
}, res => { // }, res => {
if (res.ok){ // if (res.ok){
if(res.data.list.length){ // if(res.data.list.length){
if(this.standList.length){ // if(this.standList.length){
this.standList = this.standList.concat(res.data.list) // this.standList = this.standList.concat(res.data.list)
}else{ // }else{
this.standList = res.data.list // this.standList = res.data.list
} // }
this.loading = false // this.loading = false
}else{ // }else{
this.listFlag = true // this.listFlag = true
} // }
}else { // }else {
this.$message.error(res.message) // this.$message.error(res.message)
} // }
}, e =>{ // }, e =>{
console.log(e); // console.log(e);
}) // })
this.$http.post('search/searchCenter/searchSarBykey',{
selectIndex: 'laws',
selectValue: this.searchKey,
selectType: 'titleSearch',
type: 'laws',
page: this.page,
pageSize: 20
},{
_this: this,
}, res => {
if(res.ok){
if(res.data.list.length){
if(this.standList.length){
this.standList = this.standList.concat(res.data.list)
}else{
this.standList = res.data.list
}
this.loading = false
}else{
this.loading = false
this.listFlag = true
}
}else{
this.$message.error(res.message)
}
}, e => {
console.log(e)
})
}else{ }else{
this.$http.get("/lawss/NewsFeed/getNewsFeed", { this.$http.get("/lawss/NewsFeed/getNewsFeed", {
messageType: 'ZYBZFG', messageType: 'ZYBZFG',
@@ -315,6 +459,7 @@ export default {
} }
this.loading = false this.loading = false
}else{ }else{
this.loading = false
this.listFlag = true this.listFlag = true
} }
}else { }else {