fix : bug
This commit is contained in:
@@ -540,7 +540,10 @@ const nextQuestionSuccess = (info, type = 'next') => {
|
||||
// 重新回答
|
||||
unref(ajaxApi)({
|
||||
processType: 'NEW-ANSER', //NEW-KNOW
|
||||
requestBody: info.qnsId
|
||||
requestBody: JSON.stringify({
|
||||
stdyId: unref(stdyId),
|
||||
qnsId: info.qnsId
|
||||
})
|
||||
}).then(res => {
|
||||
let _body = res.body || {}
|
||||
if (!_body.chatBody) {
|
||||
|
||||
+19
-11
@@ -18,7 +18,7 @@
|
||||
<view class="view-list course-list">
|
||||
<course-item class="course-item" v-for="itemC in courseList" :key="itemC.crsNum" :itemInfo="itemC" @clickItem="toCourseDetail(itemC)" />
|
||||
<view class="view-tips" v-show="courseList.length > 0">
|
||||
{{ hasMore ? '滚动加载更多' : '全部加载完成' }}
|
||||
{{ showGetMore ? '滚动加载更多' : '全部加载完成' }}
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="view-result" v-show="courseList.length === 0">暂无数据</view> -->
|
||||
@@ -60,7 +60,7 @@
|
||||
<course-item class="course-item" v-for="itemC in courseList" :key="itemC.crsNum" :itemInfo="itemC" @clickItem="toCourseDetail(itemC)" />
|
||||
</view>
|
||||
<view class="view-tips" v-if="activeTab === 'course' && courseList.length > 0">
|
||||
{{ hasMore ? '滚动加载更多' : '全部加载完成' }}
|
||||
{{ showGetMore ? '滚动加载更多' : '全部加载完成' }}
|
||||
</view>
|
||||
<view class="view-result" v-show="courseList.length === 0">暂无数据</view>
|
||||
</view>
|
||||
@@ -73,7 +73,7 @@
|
||||
<TaskItem :item="item" v-for="(item, index) in taskList"></TaskItem>
|
||||
</view>
|
||||
<view class="view-tips" v-if="activeTab === 'task' && taskList.length > 0">
|
||||
{{ hasMore ? '滚动加载更多' : '全部加载完成' }}
|
||||
{{ showGetMore ? '滚动加载更多' : '全部加载完成' }}
|
||||
</view>
|
||||
<view class="view-result" v-show="taskList.length === 0">暂无数据</view>
|
||||
</view>
|
||||
@@ -94,7 +94,7 @@
|
||||
<ExamItem class="exam-list" :item="item" v-for="item in examList"></ExamItem>
|
||||
</view>
|
||||
<view class="view-tips" v-if="activeTab === 'exam' && examList.length > 0">
|
||||
{{ hasMore ? '滚动加载更多' : '全部加载完成' }}
|
||||
{{ showGetMore ? '滚动加载更多' : '全部加载完成' }}
|
||||
</view>
|
||||
<view class="view-result" v-show="examList.length === 0">暂无数据</view>
|
||||
</view>
|
||||
@@ -116,7 +116,7 @@ const fromType = ref('')
|
||||
onLoad(params => {
|
||||
inputValue.value = params.searchName
|
||||
fromType.value = params.from
|
||||
pageInfo.value.limit = fromType.value === 'course' ? 15 : 3
|
||||
pageInfo.value.limit = fromType.value === 'course' ? 20 : 3
|
||||
})
|
||||
onShow(() => {
|
||||
search()
|
||||
@@ -236,16 +236,16 @@ const changeTab = item => {
|
||||
case 'ability':
|
||||
break
|
||||
case 'course':
|
||||
pageInfo.value.limit = 15
|
||||
pageInfo.value.limit = 20
|
||||
break
|
||||
case 'task':
|
||||
pageInfo.value.limit = 15
|
||||
pageInfo.value.limit = 20
|
||||
break
|
||||
case 'test':
|
||||
pageInfo.value.limit = 15
|
||||
pageInfo.value.limit = 20
|
||||
break
|
||||
case 'exam':
|
||||
pageInfo.value.limit = 15
|
||||
pageInfo.value.limit = 20
|
||||
break
|
||||
default:
|
||||
pageInfo.value.limit = 3
|
||||
@@ -292,6 +292,7 @@ const getData = (flag = null) => {
|
||||
taskList.value = []
|
||||
}
|
||||
let _isCourse = fromType.value === 'course' || activeTab.value==='course'
|
||||
isLoading.value = true
|
||||
appSearchCrsApi({
|
||||
type: _isCourse ? '01'
|
||||
: activeTab.value==='exam' ? '02'
|
||||
@@ -328,15 +329,22 @@ const getData = (flag = null) => {
|
||||
// pageInfo.value.total = res.total || 0
|
||||
// break
|
||||
// }
|
||||
})
|
||||
}).finally(()=> {
|
||||
isLoading.value = false
|
||||
})
|
||||
}
|
||||
const isLoading = ref(false)
|
||||
const hasMore = computed(() => {
|
||||
return pageInfo.value.limit * pageInfo.value.page <= pageInfo.value.total
|
||||
return (pageInfo.value.limit * pageInfo.value.page <= pageInfo.value.total)
|
||||
})
|
||||
const showGetMore = computed(() => {
|
||||
return hasMore.value || isLoading.value
|
||||
})
|
||||
const scrolltolower = () => {
|
||||
if (!hasMore.value) {
|
||||
return
|
||||
}
|
||||
if(!activeTab.value || activeTab.value === 'all') return
|
||||
pageInfo.value.page += 1
|
||||
getData()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user