Merge branch 'develop' into 'sit'
Develop See merge request K17_AITS/tra-app!102
This commit is contained in:
+6
-11
@@ -6,7 +6,7 @@ ENV = 'development'
|
||||
# VITE_APP_BASE_API_Url = 'http://25.18.122.78:9786'
|
||||
|
||||
# DEV
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
|
||||
# VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
|
||||
|
||||
# app入口
|
||||
#VITE_APP_BASE_API_Url = 'http://25.16.122.65:7001'
|
||||
@@ -15,23 +15,18 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
|
||||
|
||||
# h5专用地址
|
||||
|
||||
# 王洋洋
|
||||
# VITE_APP_BASE_H5_API_Url = 'http://25.64.16.140:9604'
|
||||
# 岳世凯
|
||||
# VITE_APP_BASE_H5_API_Url = 'http://25.64.16.141:9701'
|
||||
# 任东
|
||||
# VITE_APP_BASE_H5_API_Url = 'http://25.64.16.130:9602'
|
||||
# 线上
|
||||
|
||||
VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
#VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001'
|
||||
# VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
# VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001'
|
||||
#VITE_APP_BASE_H5_API_Url = 'http://25.18.122.116:7001'
|
||||
|
||||
# 任东
|
||||
# VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.16.130:9601'
|
||||
# VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602'
|
||||
# VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.16.130:9604'
|
||||
# 张建成
|
||||
# VITE_APP_BASE_H5_API_Url_TRAASK = 'http://25.64.16.144:9605'
|
||||
VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.144:9602'
|
||||
# 王洋洋
|
||||
# VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.16.140:9604'
|
||||
# 于嘉文
|
||||
|
||||
@@ -414,6 +414,7 @@ const audioCacheObj = computed(() => storageStore.audioObj)
|
||||
}
|
||||
const playVoice = (readType = 'pgth') =>{
|
||||
let _content = showContent.value
|
||||
console.log(_content)
|
||||
if(!_content){
|
||||
common.msg('没有可以播放的文字信息!')
|
||||
return
|
||||
|
||||
@@ -276,6 +276,9 @@
|
||||
const getRecordPermission = (obj) => {
|
||||
if (isTalking.value) {
|
||||
common.msg('操作频繁,请稍后重试!')
|
||||
setTimeout(() => {
|
||||
isTalking.value = false
|
||||
}, 500)
|
||||
return
|
||||
}
|
||||
showOverlayTalking(obj)
|
||||
|
||||
@@ -345,6 +345,9 @@ import { onShow } from "@dcloudio/uni-app"
|
||||
})
|
||||
changeTab({name:activeTab.value || '全部'})
|
||||
});
|
||||
onShow(()=>{
|
||||
changeTab({name:activeTab.value || '全部'})
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -768,6 +768,7 @@ const uploadRecordNow = voicePath => {
|
||||
})
|
||||
.then(res => {
|
||||
let _res = JSON.parse(res.data)
|
||||
console.log(_res)
|
||||
if (_res.rtnCode === '0000') {
|
||||
talkingList.value = talkingList.value.map(t => {
|
||||
if (t.id === _id) {
|
||||
@@ -778,7 +779,9 @@ const uploadRecordNow = voicePath => {
|
||||
qnsId: _data.qnsId,
|
||||
talkingContent: '',
|
||||
talkingVoice: voicePath,
|
||||
intrctId: _res.body.chatBody,
|
||||
recordId: _res.body.chatBody.recordId,
|
||||
asrStartTm: unref(lastTalkingInfo).asrStartTm,
|
||||
stdyPgrphId: _res.body.chatBody.stdyPgrphId,
|
||||
type: 1,
|
||||
userInfo: {
|
||||
...choiceTeacherInfo.value
|
||||
@@ -789,12 +792,14 @@ const uploadRecordNow = voicePath => {
|
||||
return t
|
||||
}
|
||||
})
|
||||
console.log(11111,_res.body.chatBody)
|
||||
scrollToBottomNow()
|
||||
} else {
|
||||
}
|
||||
setIsUploadingVoice()
|
||||
})
|
||||
.catch(err => {
|
||||
console.log('err',err)
|
||||
setIsUploadingVoice()
|
||||
talkingList.value = talkingList.value.filter(t => t.id !== _id)
|
||||
uni.showToast({
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
<!-- 1. 插槽优先 -->
|
||||
<slot name="title" v-if="$slots.title"></slot>
|
||||
<!-- 2. 有HTML内容且不为空时使用v-html -->
|
||||
<!-- <view v-else-if="html && html.trim() !== ''" v-html="html"></view> -->
|
||||
<view v-else-if="html && html.trim() !== ''" v-html="html"></view>
|
||||
<!-- 3. 最后显示默认标题 -->
|
||||
<template v-else>{{ title }}</template>
|
||||
</view>
|
||||
<view class="button_div">
|
||||
<view class="button_item" v-for="item in buttonList" :style="item?.style" @click="click_button(item)">
|
||||
{{item?.name || ''}}
|
||||
{{ item?.name || '' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -19,35 +19,32 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
dialogConfiguration: {
|
||||
type: Object,
|
||||
required: false,
|
||||
required: false
|
||||
}
|
||||
});
|
||||
const emit = defineEmits(['button_click'])
|
||||
const emit = defineEmits(['button_click']);
|
||||
|
||||
const title = ref('')
|
||||
const html = ref('')
|
||||
const buttonList = ref([])
|
||||
const PopupRef = ref(null)
|
||||
const title = ref('');
|
||||
const html = ref('');
|
||||
const buttonList = ref([]);
|
||||
const PopupRef = ref(null);
|
||||
// 点击按钮
|
||||
const click_button = (value) => {
|
||||
emit('button_click', value)
|
||||
}
|
||||
emit('button_click', value);
|
||||
};
|
||||
|
||||
const close = () => PopupRef.value?.close()
|
||||
const close = () => PopupRef.value?.close();
|
||||
const open = (dialogConfiguration) => {
|
||||
console.log('dialogConfiguration', dialogConfiguration);
|
||||
// 解构赋值更清晰
|
||||
const {
|
||||
title: t,
|
||||
html: h,
|
||||
buttonList: bl = []
|
||||
} = dialogConfiguration || props.dialogConfiguration || {};
|
||||
const { title: t, html: h, buttonList: bl = [] } = dialogConfiguration || props.dialogConfiguration || {};
|
||||
|
||||
console.log('title', title);
|
||||
title.value = t || '';
|
||||
html.value = h || '';
|
||||
buttonList.value = Array.isArray(bl) ? bl : [];
|
||||
@@ -56,11 +53,11 @@
|
||||
if (PopupRef.value) {
|
||||
PopupRef.value.open('bottom');
|
||||
}
|
||||
}
|
||||
};
|
||||
defineExpose({
|
||||
open,
|
||||
close
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -68,12 +65,12 @@
|
||||
z-index: 1810;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, .9);
|
||||
background-color: rgba(0, 0, 0, 0.9);
|
||||
}
|
||||
|
||||
.popup_div {
|
||||
width: 80%;
|
||||
background-color: #FFFFFF;
|
||||
background-color: #ffffff;
|
||||
padding: 20rpx 34rpx 50rpx 34rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -106,7 +103,5 @@
|
||||
line-height: 80rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -318,6 +318,7 @@
|
||||
});
|
||||
|
||||
const result_click = ({ key }) => {
|
||||
console.log('杀杀杀', key);
|
||||
if (key === 'hand_in_paper') {
|
||||
// 现在交卷
|
||||
hand_in_paper('弹窗确认交卷');
|
||||
@@ -332,13 +333,13 @@
|
||||
console.log('点击交卷', paperData);
|
||||
// 判断是否完成所有题目
|
||||
const completeList = topicList
|
||||
.filter((res) => !!(Array.isArray(res.my_answer) ? res.my_answer.length : res.my_answer))
|
||||
.filter((res) => !!(Array.isArray(res.my_answer) ? res.my_answer.length>0 : res.my_answer?.anserResult !==''))
|
||||
.map((res) => ({
|
||||
a: res.qnsId,
|
||||
b: res.my_answer,
|
||||
c: !!res.my_answer
|
||||
}));
|
||||
dialogConfiguration.title = '确认现在交卷吗?';
|
||||
|
||||
const style_button_1 = {
|
||||
color: '#FFFFFF',
|
||||
fontSize: '30rpx',
|
||||
@@ -352,10 +353,12 @@
|
||||
borderRadius: '8rpx'
|
||||
};
|
||||
const incompleteNumber = topicList.length - completeList.length;
|
||||
console.log('completeList', completeList);
|
||||
console.log('incompleteNumber', incompleteNumber);
|
||||
if (incompleteNumber === 0) {
|
||||
// 完成
|
||||
dialogConfiguration.type = 'complete';
|
||||
dialogConfiguration.title = '确认现在交卷吗?';
|
||||
dialogConfiguration.html = '';
|
||||
dialogConfiguration.buttonList = [
|
||||
{
|
||||
key: 'hand_in_paper',
|
||||
@@ -369,7 +372,7 @@
|
||||
}
|
||||
];
|
||||
} else {
|
||||
dialogConfiguration.type = 'incomplete'; // 未完成
|
||||
dialogConfiguration.title = '';
|
||||
dialogConfiguration.html = `当前考试进度:<text style="color:#0066FF;font-weight:bold;">${completeList.length}/${topicList.length}</text> 题 还有<text style="color:#0066FF;font-weight:bold;">${incompleteNumber}</text>道题未作答,确认交卷吗?`;
|
||||
dialogConfiguration.buttonList = [
|
||||
{
|
||||
|
||||
@@ -406,10 +406,10 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// 进入搜索页
|
||||
const goto_search_page = () => {
|
||||
common.navigateTo('/pages/search/search');
|
||||
common.navigateTo('/pages/search/search?from=index');
|
||||
};
|
||||
// 进入课程详情页
|
||||
const goto_course_detail = (crsId) => {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<template>
|
||||
<view class="main_div max_page">
|
||||
<!-- <nav-bar :is_seat="false"></nav-bar> -->
|
||||
<view class="back_div" @click="common.navigateBack()" v-if="from==='setting'">
|
||||
<view class="back-icon"></view>
|
||||
</view>
|
||||
<view class="bg_img">
|
||||
<image src="@/static/images/mascot/bg_1.png" class="img" mode="aspectFit"></image>
|
||||
</view>
|
||||
@@ -88,7 +91,7 @@
|
||||
const swiperCount = computed(() => mascotList.length)
|
||||
let swiperIndex = ref(0); // 当前显示第1个(索引0)
|
||||
const isAnimating = ref(false); // 标记动画是否进行中
|
||||
|
||||
|
||||
const animationfinish = ({
|
||||
detail
|
||||
}) => {
|
||||
@@ -130,7 +133,9 @@
|
||||
common.hideLoading()
|
||||
})
|
||||
}
|
||||
onLoad(() => {
|
||||
const from = ref('')
|
||||
onLoad((e) => {
|
||||
from.value = e.from ?? ''
|
||||
common.loading()
|
||||
queryValidTraMascotInfo().then(({
|
||||
body
|
||||
@@ -153,6 +158,38 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.back_div{
|
||||
position: absolute;
|
||||
top: calc(var(--status-bar-height));
|
||||
left: 20rpx;
|
||||
// margin-right: 10rpx;
|
||||
padding: 10rpx 10rpx 10rpx 20rpx;
|
||||
|
||||
// background-color: red;
|
||||
.back-icon {
|
||||
position: relative;
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.back-icon::before,
|
||||
.back-icon::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.back-icon::after {
|
||||
top: 25%;
|
||||
left: 25%;
|
||||
width: 40%;
|
||||
height: 40%;
|
||||
border-top: 4rpx solid #eaeaea;
|
||||
border-left: 4rpx solid #eaeaea;
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
}
|
||||
.title_div {
|
||||
width: 60vw;
|
||||
|
||||
|
||||
+188
-151
@@ -5,18 +5,32 @@
|
||||
<view class="back-icon"></view>
|
||||
</view>
|
||||
<view class="fixed_search_input_div fl1">
|
||||
<uv-input v-model="inputValue" shape="circle" :customStyle="fixedCustomStyles" confirmType="search"
|
||||
placeholderStyle='color:#999999;font-size:26rpx' placeholder="请输入关键字" :adjust-position="false"
|
||||
@confirm="search">
|
||||
<template #suffix><uv-icon name="search" color="#2c8ef2" size="24" @click="search()"></uv-icon></template>
|
||||
<uv-input
|
||||
v-model="inputValue"
|
||||
shape="circle"
|
||||
:customStyle="fixedCustomStyles"
|
||||
confirmType="search"
|
||||
placeholderStyle="color:#999999;font-size:26rpx"
|
||||
placeholder="请输入关键字"
|
||||
:adjust-position="false"
|
||||
@confirm="search"
|
||||
>
|
||||
<template #suffix>
|
||||
<uv-icon name="search" color="#2c8ef2" size="24" @click="search()"></uv-icon>
|
||||
</template>
|
||||
</uv-input>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 主体 -->
|
||||
<view class="search_content" v-if="!fromType">
|
||||
<view class="tabs-view">
|
||||
<uv-tabs :list="tabList" @click="changeTab" :scrollable="false" active-style="font-weight:bold; color:#000;"
|
||||
line-color="#06f"></uv-tabs>
|
||||
<uv-tabs
|
||||
:list="tabList"
|
||||
@click="changeTab"
|
||||
:scrollable="false"
|
||||
active-style="font-weight:bold; color:#000;"
|
||||
line-color="#06f"
|
||||
></uv-tabs>
|
||||
</view>
|
||||
<scroll-view class="lists-view" :scroll-y="true">
|
||||
<view class="ability-view model-view" v-show="!fromType || fromType === 'ability'">
|
||||
@@ -26,27 +40,50 @@
|
||||
</view>
|
||||
<view class="view-list">
|
||||
<view class="ability-view-item" v-for="item in abilityListShow" @click="clickAbility(item)">
|
||||
<image class="icon" v-if="item.type === 'course'" src="@/static/images/index/navigation_course.png">
|
||||
</image>
|
||||
<image class="icon" v-if="item.type === 'dialog'"
|
||||
src="@/static/images/index/navigation_question_answering.png"></image>
|
||||
<image class="icon" v-if="item.type === 'test'" src="@/static/images/index/navigation_ai.png"></image>
|
||||
<image class="icon" v-if="item.type === 'task'" src="@/static/images/index/navigation_learning_tasks.png">
|
||||
</image>
|
||||
<image class="icon" v-if="item.type === 'exam'" src="@/static/images/index/navigation_examination.png">
|
||||
</image>
|
||||
<image class="icon" v-if="item.type === 'examTest'" src="@/static/images/index/navigation_practice.png">
|
||||
</image>
|
||||
<image class="icon" v-if="item.type === 'wrong'"
|
||||
src="@/static/images/index/navigation_wrong_question.png"></image>
|
||||
<image class="icon" v-if="item.type === 'analysis'"
|
||||
src="@/static/images/index/navigation_learning_analysis.png"></image>
|
||||
<view class="title">{{item.title}}</view>
|
||||
<image
|
||||
class="icon"
|
||||
v-if="item.type === 'course'"
|
||||
src="@/static/images/index/navigation_course.png"
|
||||
></image>
|
||||
<image
|
||||
class="icon"
|
||||
v-if="item.type === 'dialog'"
|
||||
src="@/static/images/index/navigation_question_answering.png"
|
||||
></image>
|
||||
<image
|
||||
class="icon"
|
||||
v-if="item.type === 'test'"
|
||||
src="@/static/images/index/navigation_ai.png"
|
||||
></image>
|
||||
<image
|
||||
class="icon"
|
||||
v-if="item.type === 'task'"
|
||||
src="@/static/images/index/navigation_learning_tasks.png"
|
||||
></image>
|
||||
<image
|
||||
class="icon"
|
||||
v-if="item.type === 'exam'"
|
||||
src="@/static/images/index/navigation_examination.png"
|
||||
></image>
|
||||
<image
|
||||
class="icon"
|
||||
v-if="item.type === 'examTest'"
|
||||
src="@/static/images/index/navigation_practice.png"
|
||||
></image>
|
||||
<image
|
||||
class="icon"
|
||||
v-if="item.type === 'wrong'"
|
||||
src="@/static/images/index/navigation_wrong_question.png"
|
||||
></image>
|
||||
<image
|
||||
class="icon"
|
||||
v-if="item.type === 'analysis'"
|
||||
src="@/static/images/index/navigation_learning_analysis.png"
|
||||
></image>
|
||||
<view class="title">{{ item.title }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="view-result" v-show="abilityListShow.length === 0">
|
||||
暂无数据
|
||||
</view>
|
||||
<view class="view-result" v-show="abilityListShow.length === 0">暂无数据</view>
|
||||
</view>
|
||||
|
||||
<view class="course-view model-view" v-show="!fromType || fromType === 'course'">
|
||||
@@ -55,11 +92,15 @@
|
||||
课程
|
||||
</view>
|
||||
<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>
|
||||
<view class="view-result" v-show="courseList.length === 0">
|
||||
暂无数据
|
||||
<course-item
|
||||
class="course-item"
|
||||
v-for="itemC in courseList"
|
||||
:key="itemC.crsNum"
|
||||
:itemInfo="itemC"
|
||||
@clickItem="toCourseDetail(itemC)"
|
||||
/>
|
||||
</view>
|
||||
<view class="view-result" v-show="courseList.length === 0">暂无数据</view>
|
||||
</view>
|
||||
<view class="task-view model-view" v-show="!fromType || fromType === 'task'">
|
||||
<view class="view-title">
|
||||
@@ -67,22 +108,17 @@
|
||||
任务
|
||||
</view>
|
||||
<view class="view-list">
|
||||
<TaskItem :item="item" v-for="(item, index) in taskList"></TaskItem>
|
||||
</view>
|
||||
<view class="view-result" v-show="taskList.length === 0">
|
||||
暂无数据
|
||||
<TaskItem :item="item" v-for="(item, index) in taskList"></TaskItem>
|
||||
</view>
|
||||
<view class="view-result" v-show="taskList.length === 0">暂无数据</view>
|
||||
</view>
|
||||
<view class="test-view model-view" v-if="false">
|
||||
<view class="view-title">
|
||||
<image src="@/static/images/search/result/test.png" class="view-title-img"></image>
|
||||
AI陪练
|
||||
</view>
|
||||
<view class="view-list">
|
||||
</view>
|
||||
<view class="view-result" v-show="testList.length === 0">
|
||||
暂无数据
|
||||
</view>
|
||||
<view class="view-list"></view>
|
||||
<view class="view-result" v-show="testList.length === 0">暂无数据</view>
|
||||
</view>
|
||||
<view class="exam-view model-view" v-show="!fromType || fromType === 'exam'">
|
||||
<view class="view-title">
|
||||
@@ -90,70 +126,63 @@
|
||||
考试
|
||||
</view>
|
||||
<view class="view-list">
|
||||
<ExamItem class="exam-list" :item="item" v-for="item in examList"></ExamItem>
|
||||
</view>
|
||||
<view class="view-result" v-show="examList.length === 0">
|
||||
暂无数据
|
||||
<ExamItem class="exam-list" :item="item" v-for="item in examList"></ExamItem>
|
||||
</view>
|
||||
<view class="view-result" v-show="examList.length === 0">暂无数据</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="search_content" v-if="fromType === 'course'">
|
||||
<scroll-view class="lists-view lists-view-course" :scroll-y="true" @scrolltolower="scrolltolower">
|
||||
<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">
|
||||
{{hasMore?'滚动加载更多':'加载完成'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="view-result" v-show="courseList.length === 0">
|
||||
暂无数据
|
||||
<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">
|
||||
{{ hasMore ? '滚动加载更多' : '加载完成' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="view-result" v-show="courseList.length === 0">暂无数据</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
watchEffect,
|
||||
nextTick,
|
||||
onMounted,
|
||||
computed
|
||||
} from 'vue';
|
||||
import common from '@/common/common.js'
|
||||
import {
|
||||
onShow
|
||||
} from '@dcloudio/uni-app';
|
||||
import { ref, watchEffect, nextTick, onMounted, computed } from 'vue';
|
||||
import common from '@/common/common.js';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import TaskItem from '@/pages/learningTasks/components/content-item.vue';
|
||||
import ExamItem from '@/pages/testingHall/components/content-item.vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { appSearchCrsApi } from '@/api/search.js'
|
||||
|
||||
import { appSearchCrsApi } from '@/api/search.js';
|
||||
|
||||
const fromType = ref('')
|
||||
const fromType = ref('');
|
||||
onLoad((params) => {
|
||||
inputValue.value = params.searchName
|
||||
inputValue.value = params.searchName;
|
||||
fromType.value = params.from;
|
||||
pageInfo.value.limit = fromType.value === 'course'? 15 : 3
|
||||
pageInfo.value.limit = fromType.value === 'course' ? 15 : 3;
|
||||
});
|
||||
onShow(() => {
|
||||
search()
|
||||
search();
|
||||
});
|
||||
// 静态样式配置
|
||||
const fixedCustomStyles = {
|
||||
backgroundColor: "#ffffff",
|
||||
paddingLeft: "40rpx",
|
||||
paddingTop: "5px",
|
||||
paddingBottom: "5px",
|
||||
border: "none"
|
||||
}
|
||||
backgroundColor: '#ffffff',
|
||||
paddingLeft: '40rpx',
|
||||
paddingTop: '5px',
|
||||
paddingBottom: '5px',
|
||||
border: 'none'
|
||||
};
|
||||
const inputValue = ref('');
|
||||
const searchValue = ref('');
|
||||
const activeTab = ref('')
|
||||
const tabList = ref([{
|
||||
const activeTab = ref('');
|
||||
const tabList = ref([
|
||||
{
|
||||
name: '全部',
|
||||
type: 'all'
|
||||
},
|
||||
@@ -176,23 +205,24 @@
|
||||
{
|
||||
name: '考试',
|
||||
type: 'exam'
|
||||
},
|
||||
])
|
||||
}
|
||||
]);
|
||||
const abilityListShow = computed(() => {
|
||||
if (searchValue.value) {
|
||||
let _arr = abilityList.value.filter(t => t.title.includes(searchValue.value))
|
||||
let _sum = 4 - (_arr.length % 4)
|
||||
let _arr = abilityList.value.filter((t) => t.title.includes(searchValue.value));
|
||||
let _sum = 4 - (_arr.length % 4);
|
||||
if (_sum !== 4) {
|
||||
for (let i = 0; i < _sum; i++) {
|
||||
_arr.push({})
|
||||
_arr.push({});
|
||||
}
|
||||
}
|
||||
return _arr
|
||||
return _arr;
|
||||
} else {
|
||||
return abilityList.value
|
||||
return abilityList.value;
|
||||
}
|
||||
})
|
||||
const abilityList = ref([{
|
||||
});
|
||||
const abilityList = ref([
|
||||
{
|
||||
title: 'AI学习',
|
||||
type: 'course',
|
||||
path: '/pages/course/index',
|
||||
@@ -204,48 +234,48 @@
|
||||
path: '/pages/index/dialog',
|
||||
params: {
|
||||
animationType: 'slide-in-bottom'
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'AI陪练',
|
||||
type: 'test',
|
||||
path: '',
|
||||
path: ''
|
||||
},
|
||||
{
|
||||
title: '学习任务',
|
||||
type: 'task',
|
||||
path: '/pages/learningTasks/index',
|
||||
path: '/pages/learningTasks/index'
|
||||
},
|
||||
{
|
||||
title: '考试中心',
|
||||
type: 'exam',
|
||||
path: '/pages/testingHall/index',
|
||||
path: '/pages/testingHall/index'
|
||||
},
|
||||
{
|
||||
title: '竞赛练习',
|
||||
type: 'examTest',
|
||||
path: '',
|
||||
path: ''
|
||||
},
|
||||
{
|
||||
title: '错题本',
|
||||
type: 'wrong',
|
||||
path: '/pages/wrongQuestionRecord/index',
|
||||
path: '/pages/wrongQuestionRecord/index'
|
||||
},
|
||||
{
|
||||
title: '学习分析',
|
||||
type: 'analysis',
|
||||
path: '',
|
||||
},
|
||||
])
|
||||
const testList = ref([])
|
||||
const taskList = ref([])
|
||||
const examList = ref([])
|
||||
const courseList = ref([])
|
||||
path: ''
|
||||
}
|
||||
]);
|
||||
const testList = ref([]);
|
||||
const taskList = ref([]);
|
||||
const examList = ref([]);
|
||||
const courseList = ref([]);
|
||||
|
||||
const changeTab = (item) => {
|
||||
if (!item) return
|
||||
activeTab.value = item.type
|
||||
console.log(item)
|
||||
if (!item) return;
|
||||
activeTab.value = item.type;
|
||||
console.log(item);
|
||||
switch (item.name) {
|
||||
case 'all':
|
||||
break;
|
||||
@@ -262,55 +292,65 @@
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
const clickAbility = (item) => {
|
||||
if(item.isTab){
|
||||
common.switchTab(item.path)
|
||||
}else{
|
||||
common.navigateTo(item.path,item.params|| {})
|
||||
if (item.isTab) {
|
||||
common.switchTab(item.path);
|
||||
} else {
|
||||
common.navigateTo(item.path, item.params || {});
|
||||
}
|
||||
}
|
||||
};
|
||||
const pageInfo = ref({
|
||||
page: 1,
|
||||
limit: 3,
|
||||
total: 0
|
||||
})
|
||||
});
|
||||
const search = () => {
|
||||
searchValue.value = inputValue.value
|
||||
getData(1)
|
||||
}
|
||||
const getData = (flag=null) => {
|
||||
if(flag){
|
||||
pageInfo.value.page = 1
|
||||
courseList.value = []
|
||||
searchValue.value = inputValue.value;
|
||||
const pages = getCurrentPages();
|
||||
if (pages.length >= 2) {
|
||||
const prevPage = pages[pages.length - 2];
|
||||
if (prevPage.route === 'pages/search/search') {
|
||||
if (prevPage.$vm && typeof prevPage.$vm.$?.exposed?.search === 'function') {
|
||||
prevPage.$vm.$?.exposed?.search(searchValue.value, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getData(1);
|
||||
};
|
||||
const getData = (flag = null) => {
|
||||
if (flag) {
|
||||
pageInfo.value.page = 1;
|
||||
courseList.value = [];
|
||||
}
|
||||
appSearchCrsApi({
|
||||
type: fromType.value === 'course'?'01':'00',//00 首页搜索 01课程搜索
|
||||
type: fromType.value === 'course' ? '01' : '00', //00 首页搜索 01课程搜索
|
||||
searchName: searchValue.value,
|
||||
page: pageInfo.value.page,
|
||||
limit: pageInfo.value.limit
|
||||
}).then(res=>{
|
||||
pageInfo.value.total = res.total || 0
|
||||
courseList.value = courseList.value.concat(res.body.traCrsInfoVoList||[])
|
||||
if(fromType.value !== 'course'){
|
||||
examList.value = res.body.traExamPapersExtVoList||[]
|
||||
taskList.value = res.body.traTaskInfoExtVoList||[]
|
||||
}).then((res) => {
|
||||
pageInfo.value.total = res.total || 0;
|
||||
courseList.value = courseList.value.concat(res.body.traCrsInfoVoList || []);
|
||||
if (fromType.value !== 'course') {
|
||||
examList.value = res.body.traExamPapersExtVoList || [];
|
||||
taskList.value = res.body.traTaskInfoExtVoList || [];
|
||||
}
|
||||
})
|
||||
}
|
||||
const hasMore = computed(()=> {
|
||||
return (pageInfo.value.limit * pageInfo.value.page) <= pageInfo.value.total
|
||||
})
|
||||
});
|
||||
};
|
||||
const hasMore = computed(() => {
|
||||
return pageInfo.value.limit * pageInfo.value.page <= pageInfo.value.total;
|
||||
});
|
||||
const scrolltolower = () => {
|
||||
if(!hasMore.value){
|
||||
return
|
||||
if (!hasMore.value) {
|
||||
return;
|
||||
}
|
||||
pageInfo.value.page += 1
|
||||
getData()
|
||||
}
|
||||
const toCourseDetail = (item)=>{
|
||||
common.navigateTo("/pages/courseDetail/index?crsId=" + item.crsId);
|
||||
}
|
||||
pageInfo.value.page += 1;
|
||||
getData();
|
||||
};
|
||||
const toCourseDetail = (item) => {
|
||||
common.navigateTo('/pages/courseDetail/index?crsId=' + item.crsId);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -327,7 +367,7 @@
|
||||
height: calc(100% - 90rpx);
|
||||
box-sizing: border-box;
|
||||
padding: 24rpx 30rpx;
|
||||
&.lists-view-course{
|
||||
&.lists-view-course {
|
||||
height: 100%;
|
||||
}
|
||||
.view-result {
|
||||
@@ -337,7 +377,7 @@
|
||||
line-height: 100rpx;
|
||||
color: #999;
|
||||
}
|
||||
.view-tips{
|
||||
.view-tips {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
@@ -364,7 +404,7 @@
|
||||
height: 30rpx;
|
||||
}
|
||||
}
|
||||
&.ability-view{
|
||||
&.ability-view {
|
||||
.view-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
@@ -382,11 +422,11 @@
|
||||
box-shadow: #eaeaea 0 0 6rpx;
|
||||
padding: 32rpx 22rpx 36rpx 26rpx;
|
||||
}
|
||||
&.course-list{
|
||||
&.course-list {
|
||||
margin: 6rpx -20rpx 0;
|
||||
}
|
||||
.exam-list{
|
||||
border:2rpx solid #e8e8e8;
|
||||
.exam-list {
|
||||
border: 2rpx solid #e8e8e8;
|
||||
}
|
||||
.course-item {
|
||||
display: flex;
|
||||
@@ -427,29 +467,26 @@
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
|
||||
}
|
||||
|
||||
.button_div {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
|
||||
.button {
|
||||
text-align: center;
|
||||
line-height: 62rpx;
|
||||
width: 138rpx;
|
||||
height: 62rpx;
|
||||
background: #EBF1FF;
|
||||
background: #ebf1ff;
|
||||
border-radius: 30rpx;
|
||||
font-weight: 500;
|
||||
font-size: 30rpx;
|
||||
color: #0066FF;
|
||||
color: #0066ff;
|
||||
font-style: normal;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -515,8 +552,8 @@
|
||||
left: 25%;
|
||||
width: 40%;
|
||||
height: 40%;
|
||||
border-top: 4rpx solid #2B2C2E;
|
||||
border-left: 4rpx solid #2B2C2E;
|
||||
border-top: 4rpx solid #2b2c2e;
|
||||
border-left: 4rpx solid #2b2c2e;
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
}
|
||||
@@ -524,12 +561,12 @@
|
||||
|
||||
.main_div {
|
||||
width: 100vw;
|
||||
background: linear-gradient(90deg, #F1F7FF 0%, #D8EDFF 50%, #C3E6FF 100%);
|
||||
background: linear-gradient(90deg, #f1f7ff 0%, #d8edff 50%, #c3e6ff 100%);
|
||||
padding-top: var(--status-bar-height);
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
::v-deep .uv-tabs__wrapper__nav__item__text{
|
||||
::v-deep .uv-tabs__wrapper__nav__item__text {
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
placeholderStyle="color:#999999;font-size:26rpx"
|
||||
placeholder="请输入关键字"
|
||||
:focus="true"
|
||||
:maxlength="60"
|
||||
:adjust-position="false"
|
||||
@confirm="search"
|
||||
>
|
||||
@@ -54,6 +55,7 @@
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import common from '@/common/common.js';
|
||||
import { getUserInfo } from '@/common/common.js';
|
||||
import { onShow, onLoad } from '@dcloudio/uni-app';
|
||||
|
||||
// 静态样式配置
|
||||
@@ -65,7 +67,7 @@
|
||||
border: 'none',
|
||||
borderRadius: '6px'
|
||||
};
|
||||
const storageKey = 'history_search_list';
|
||||
let storageKey = 'history_search_list';
|
||||
const asssss = ref(false);
|
||||
const inputValue = ref('');
|
||||
const fromType = ref('');
|
||||
@@ -74,6 +76,8 @@
|
||||
|
||||
onLoad((params) => {
|
||||
fromType.value = params.from || '';
|
||||
const userInfo = getUserInfo();
|
||||
storageKey = `${userInfo.userId}_${fromType.value}_history_search_list`;
|
||||
});
|
||||
onShow(() => {
|
||||
let storageList = common.getValue(storageKey);
|
||||
@@ -92,7 +96,7 @@
|
||||
});
|
||||
};
|
||||
|
||||
const search = (text) => {
|
||||
const search = (text, jump = true) => {
|
||||
inputValue.value = text;
|
||||
const searchValue = text.trim();
|
||||
if (searchValue) {
|
||||
@@ -113,10 +117,14 @@
|
||||
}
|
||||
// 保存到本地存储
|
||||
common.setValue(storageKey, uniqueList);
|
||||
// 导航到搜索结果页,使用encodeURIComponent处理特殊字符
|
||||
common.navigateTo(`/pages/search/result?searchName=${searchValue}&from=${fromType.value}`);
|
||||
if (jump) {
|
||||
common.navigateTo(`/pages/search/result?searchName=${searchValue}&from=${fromType.value}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
defineExpose({
|
||||
search
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -134,7 +142,6 @@
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
//、、xxxxxxx
|
||||
.history_div {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -105,8 +105,7 @@
|
||||
|
||||
// 去选择百禄
|
||||
const gotoMascot = () => {
|
||||
|
||||
common.navigateTo('/pages/mascot/mascot_select_list')
|
||||
common.navigateTo('/pages/mascot/mascot_select_list?from=setting')
|
||||
|
||||
// common.loading()
|
||||
// queryValidTraMascotInfo().then(({body}) => {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
:activeStyle="{color:'#0066FF',fontSize:'30rpx', fontWeight:'600'}"
|
||||
:lineColor="`url(${LineBg}) 10% 10%`"></uv-tabs>
|
||||
</view>
|
||||
|
||||
|
||||
<swiper class="swiper" :current="tabAct" :indicator-dots="false" @change="swiperChange">
|
||||
<swiper-item>
|
||||
<Content :ref="el => contentRefs[0] = el" :index="tabAct"
|
||||
|
||||
Reference in New Issue
Block a user