Commit 214a658a authored by Facius's avatar Facius

Merge branch 'dev-v1.0.0' of https://git.banshouhui.com/wuzhenzhe/study into dev-v1.0.0

parents 96d020d6 9d5ce57c
......@@ -149,16 +149,15 @@ export default {
background-size: 100% 920rpx;
background-repeat: no-repeat;
background-color: #2953ff;
position: absolute;
top: 0;
width: 100%;
height: 100vh;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 30rpx 24rpx 50rpx 24rpx;
overflow: auto;
height: 100%;
}
.cert-body {
width: 100%;
......@@ -172,7 +171,7 @@ export default {
}
.table-list {
margin-top: 20rpx;
margin-bottom: 200rpx;
margin-bottom: 40rpx;
.name {
font-size: 28rpx;
text-align: left;
......@@ -180,6 +179,9 @@ export default {
color: #191c27;
font-weight: bold;
}
.item {
margin-bottom: 20rpx;
}
.table {
/* background-color: #2953ff; */
min-height: 200rpx;
......@@ -195,17 +197,14 @@ export default {
}
}
.foot {
position: absolute;
bottom: 41px;
left: 0;
height: 100rpx;
width: 100%;
text-align: left;
padding-left: 24rpx;
display: flex;
flex-direction: column;
font-size: 28rpx;
color: #5a6073;
margin-bottom: 20rpx;
}
.cert-foot {
height: 100rpx;
......
......@@ -21,9 +21,9 @@
></u-search>
</view>
<view v-if="lists.length > 0" class="results">
<view class="results" v-if="lists.length > 0">
<view class="title"
>共找到含有<text>“{{ keyword }}”</text>相关试题<text>{{ count }}</text
>共找到含有<text>“{{ keyword }}”</text>相关试题<text>{{ total }}</text
>道</view
>
<view class="result">
......@@ -87,7 +87,7 @@
</view>
</view>
<view class="u-flex default" v-if="count === 0">
<view class="u-flex default" v-if="lists.length === 0">
<view>
<image :src="defaultImg" />
</view>
......@@ -110,12 +110,6 @@ export default {
},
data() {
return {
itemStyle: {
background: '#fff',
padding: '0rpx 20rpx',
margin: '10rpx 0',
'border-radius': '30rpx 30rpx 0 0',
},
keyword: '',
lists: [],
arrIndex: '',
......@@ -123,6 +117,7 @@ export default {
pageSize: 10,
loadStatus: 'loadmore',
isLoadMore: false, //是否加载中
total: 0
}
},
onLoad(e) {
......@@ -133,9 +128,6 @@ export default {
defaultImg() {
return process.uniEnv.qn_base_url + 'no-search.png'
},
count() {
return this.lists.length
},
collectImg() {
const info = this.lists.find((v) => v.index === this.arrIndex)
const name = info?.collectionFlag ? 'collected.png' : 'collect.png'
......@@ -170,9 +162,10 @@ export default {
this.loadStatus = 'loading'
this.$u.api.searchQuestion(data).then((res) => {
uni.hideLoading()
this.total = res.total
const lists =
res?.records.length > 0
? res?.records.map((v, i) => {
? res?.records.map(v => {
const rightKey = v.answer.split(',')
const content = JSON.parse(v.content)
const answerList = content.choiceList.map((item) => {
......@@ -186,7 +179,6 @@ export default {
return {
id: v.id,
index: i,
answer: v.answer,
title: content.title,
type: v.echoMap.questionTypeId,
......@@ -200,7 +192,6 @@ export default {
: []
this.lists = this.lists.concat(lists)
if (res.records.length < this.pageSize) {
//判断接口返回数据量小于请求数据量,则表示此为最后一页
this.isLoadMore = true
......@@ -223,6 +214,7 @@ export default {
history.splice(9, 1)
}
this.$u.vuex('searchHistory', history)
this.lists = []
this.init()
}
},
......@@ -245,7 +237,7 @@ export default {
<style lang="scss" scoped>
.search {
height: 100vh;
min-height: 100vh;
flex-direction: column;
background-color: #f8fafd;
background-image: linear-gradient(to top, #f8fafd 0%, #e9f3ff 50%);
......
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