Merge branch 'dev-20250930' of http://25.13.9.101:9000/K17_AITS/tra-app into dev-20250930

This commit is contained in:
yixiudong
2025-08-20 10:52:56 +08:00
35 changed files with 1531 additions and 648 deletions
+5 -10
View File
@@ -16,19 +16,14 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
# h5专用地址
# 王洋洋
<<<<<<< HEAD
#VITE_APP_BASE_H5_API_Url = 'http://25.64.16.140:9604'
VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7001'
#岳世凯
#VITE_APP_BASE_H5_API_Url = 'http://25.64.16.141:9701'
=======
# 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 = 'http://25.18.122.65:7001'
# VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.18.122.65:7001'
VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7001'
#VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.16.140:9602'
VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602'
>>>>>>> 05085e8e3e537d6cc35d677431086afd747b4eee
+133 -133
View File
@@ -1,149 +1,149 @@
<script>
export default {
onLaunch: function () {
uni.onTabBarMidButtonTap(() => {
uni.navigateTo({
url: '/pages/index/dialog',
animationType: 'slide-in-bottom'
export default {
onLaunch: function () {
uni.onTabBarMidButtonTap(() => {
uni.navigateTo({
url: '/pages/index/dialog',
animationType: 'slide-in-bottom'
});
});
})
// console.log('预加载');
},
onShow: function () {
// console.log('App Show')
},
onHide: function () {
// console.log('App Hide')
}
};
// console.log('预加载');
},
onShow: function () {
// console.log('App Show')
},
onHide: function () {
// console.log('App Hide')
}
};
</script>
<style lang="scss">
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
// @import "@/uni_modules/uview-ui/index.scss";
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
// @import "@/uni_modules/uview-ui/index.scss";
@font-face {
font-family: 'PingFangSC';
src: url('@/static/font/PingFang-SC.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
view {
box-sizing: border-box;
font-family: "PingFangSC";
}
@font-face {
font-family: 'PingFangSC';
src: url('@/static/font/PingFang-SC.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
view {
box-sizing: border-box;
font-family: 'PingFangSC';
}
// 解决uview离线环境下没有图标
@font-face {
font-family: 'uicon-iconfont';
src: url('@/static/font/font_2225171_8kdcwk4po24.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
// 解决uview离线环境下没有图标
@font-face {
font-family: 'uicon-iconfont';
src: url('@/static/font/font_2225171_8kdcwk4po24.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
.max_page {
min-height: 100vh;
}
.mr-10 {
margin-right: 10rpx;
}
.mb-8 {
margin-bottom: 8rpx;
}
.pt-8 {
padding-top: 8rpx;
}
.mb- {
margin-bottom: 10rpx;
}
.mb-18 {
margin-bottom: 18rpx;
}
.mb-64 {
margin-bottom: 64rpx;
}
.mb-30 {
margin-bottom: 30rpx;
}
.mb-36 {
margin-bottom: 36rpx;
}
.mb-4 {
margin-bottom: 4rpx;
}
.fz-30 {
font-size: 30rpx;
}
.fz-28 {
font-size: 28rpx;
}
.fz-24 {
font-size: 24rpx;
}
.w_100 {
width: 100%;
}
.max_page {
min-height: 100vh;
}
.mr-10 {
margin-right: 10rpx;
}
.mb-8 {
margin-bottom: 8rpx;
}
.pt-8 {
padding-top: 8rpx;
}
.mb- {
margin-bottom: 10rpx;
}
.mb-18 {
margin-bottom: 18rpx;
}
.mb-64 {
margin-bottom: 64rpx;
}
.mb-30 {
margin-bottom: 30rpx;
}
.mb-36 {
margin-bottom: 36rpx;
}
.mb-4 {
margin-bottom: 4rpx;
}
.fz-30 {
font-size: 30rpx;
}
.fz-28 {
font-size: 28rpx;
}
.fz-24 {
font-size: 24rpx;
}
.w_100 {
width: 100%;
}
.h_100 {
height: 100%;
}
.h_100 {
height: 100%;
}
.flex {
display: flex;
}
.flex-jcsb {
display: flex;
justify-content: space-between;
}
.flex-c-c {
display: flex;
justify-content: center;
align-items: center;
}
.tar{
text-align: right;
}
.fw-600 {
font-weight: 600;
}
.fw-400 {
font-weight: 400;
}
.img_100 {
width: 100%;
height: 100%;
}
.flex {
display: flex;
}
.flex-jcsb {
display: flex;
justify-content: space-between;
}
.flex-c-c {
display: flex;
justify-content: center;
align-items: center;
}
.tar {
text-align: right;
}
.fw-600 {
font-weight: 600;
}
.fw-400 {
font-weight: 400;
}
.img_100 {
width: 100%;
height: 100%;
}
.fl1 {
flex: 1;
}
.fl1 {
flex: 1;
}
.font_pf {
font-family: 'PingFangSC';
}
.font_pf {
font-family: 'PingFangSC';
}
.ellipsis-text {
white-space: nowrap;
/* 强制不换行 */
overflow: hidden;
/* 超出部分隐藏 */
text-overflow: ellipsis;
/* 超出部分显示省略号 */
}
.ellipsis-text {
white-space: nowrap;
/* 强制不换行 */
overflow: hidden;
/* 超出部分隐藏 */
text-overflow: ellipsis;
/* 超出部分显示省略号 */
}
/* 多行文本溢出 */
.multi-line-ellipsis {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
/* 显示的行数 */
overflow: hidden;
}
/* 多行文本溢出 */
.multi-line-ellipsis {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
/* 显示的行数 */
overflow: hidden;
}
.no-overflow{
overflow: hidden;
}
.bold{
font-weight: bold;
}
.no-overflow {
overflow: hidden;
}
.bold {
font-weight: bold;
}
</style>
+2 -2
View File
@@ -72,7 +72,7 @@ export const commonUploadVoiceFile = (file, url, data = {}, fileKey='voice') =>
};
if (token)
header['summary'] = token
console.log(`${base_url}${url}`)
// console.log(`${base_url}${url}`)
return new Promise((resolve, reject) => {
uni.uploadFile({
url: `${base_url}${url}`,
@@ -83,7 +83,7 @@ export const commonUploadVoiceFile = (file, url, data = {}, fileKey='voice') =>
success(result) {
try {
const res = JSON.parse(result.data);
console.log(res)
// console.log(res)
if (res.rtnCode === '0000') {
resolve(result);
} else {
-1
View File
@@ -7,7 +7,6 @@ const ENV = import.meta.env
export const get_base_url = (url = '') => {
if (ENV.MODE === 'development') { // 开发环境
// H5必须用非https,手机端必须用https
// #ifdef H5
if (url) {
let _str = (url.split('/')[0] || url.split('/')[1])?.toUpperCase()
@@ -1,7 +1,7 @@
<template>
<view class="option_item" @click.stop="click_option()" :class="select_status">
<view class="option_text">
{{props.analysisVo.itemContent}}
{{props.analysisVo.itemNo}}. {{props.analysisVo.itemContent}}
</view>
<!-- <image v-show="select_status==='primary'" class="img" src="@/static/images/common/primary.png" mode="heightFix">
</image>
@@ -47,9 +47,9 @@
});
const select_status = computed(() => {
if (props.backend_answer.length === 0) {
return props.my_answer.includes(props.analysisVo.itemId) ? 'primary' : 'info';
return (props.my_answer||[]).includes(props.analysisVo.itemId) ? 'primary' : 'info';
} else {
return props.my_answer.includes(props.analysisVo.itemId) ? 'success' :
return (props.my_answer||[]).includes(props.analysisVo.itemId) ? 'success' :
'error';
}
})
+37 -24
View File
@@ -4,13 +4,13 @@
<view class="type">
{{subject_type_text}}
</view>
<view class="score">
<view class="score" v-if="mode !== 'study'">
5分
</view>
<view class="fl1">
<view class="fl1" v-if="mode !== 'study'">
</view>
<view class="right">
<view class="right" v-if="mode !== 'study'">
<view class="mark_and_feedback_div">
<image :src="markIcon(props.item.mark?'#0066FF':'#ABABAB')" class="img" @click="mark_click()"></image>
<image :src="feedbackIcon()" class="img" @click="feedback_click()"></image>
@@ -23,13 +23,13 @@
{{subject_data.qnsContent}}
</view>
<view class="option_div">
<radioSubjectItem v-for="(analysisVo,index) in subject_data.itemVos" @click_option="click_option"
:key="index" :analysisVo="analysisVo" :my_answer="props.item.my_answer"
:backend_answer="props.item.backend_answer"></radioSubjectItem>
<radioSubjectItem v-for="(analysisVo,index) in subject_data.itemVos" @click_option="click_option" :key="index"
:analysisVo="analysisVo" :my_answer="props.item.my_answer" :backend_answer="props.item.backend_answer">
</radioSubjectItem>
</view>
<view class="option_div_button" v-if="subject_data.qnsTyp==='MU' && props.mode=='practice'" >
<view class="option_div_button" v-if="subject_data.qnsTyp==='MU' && ['practice','study'].includes(props.mode)">
<uv-button type="primary" class="send_evaluate" :custom-style="customStyle" :throttleTime="300"
:hairline="false" >确定</uv-button>
@click="muCheckbox" :hairline="false">确定</uv-button>
</view>
</view>
</template>
@@ -44,7 +44,8 @@
} from 'vue'
import radioSubjectItem from './radio-subject-item.vue'
import {
markIcon,feedbackIcon
markIcon,
feedbackIcon
} from '@/common/imgSvg'
import {
SUBJECT_TYPE
@@ -66,14 +67,14 @@
required: true,
}
});
const feedback_click = () =>{
const feedback_click = () => {
emit('subject_click', 'feedback', props.item)
}
const mark_click = () =>{
const mark_click = () => {
emit('subject_click', 'mark', props.item)
}
const subject_data = reactive({
qnsId: '',
qnsContent: '',
@@ -97,35 +98,45 @@
// // 无论什么类型如果表里已经有了,再次点击就是弹出
if (props.item.my_answer.includes(analysisVo.itemId)) {
props.item.my_answer = props.item.my_answer.filter(id => id !== analysisVo.itemId);
}
else if (props.item.qnsTyp === 'SN') { // 单选
} else if (props.item.qnsTyp === 'SN') { // 单选
// 单选插入,并且移除其他
props.item.my_answer[0] = analysisVo.itemId
}
else if (props.item.qnsTyp === 'MU') { // 多选题
muCheckbox()
} else if (props.item.qnsTyp === 'MU') { // 多选题
// 多选直接插入
props.item.my_answer.push(analysisVo.itemId)
} else if (props.item.qnsTyp === 'JD') { // 判断题
// 判断插入,并且移除其他
props.item.my_answer = [analysisVo.itemId]
muCheckbox()
}
}
const muCheckbox = () => {
emit('subject_click', 'answer', {
qnsTyp: props.item.qnsTyp,
qnsId: props.item.qnsId,
answer: props.item.my_answer,
answerItems: subject_data.itemVos.filter(t=> props.item.my_answer.includes(t.itemId))
})
}
</script>
<style scoped lang="scss">
.mark_and_feedback_div{
.mark_and_feedback_div {
display: flex;
height: 100%;
justify-content: end;
align-items: center;
.img{
.img {
width: 38rpx;
height: 38rpx;
margin-left: 4rpx;
padding: 4rpx;
}
}
.option_div_button{
.option_div_button {
width: 100%;
height: 84rpx;
padding-top: 30rpx;
@@ -134,16 +145,18 @@
flex-direction: column;
align-items: center;
}
.item {
// height: 170rpx;
overflow: hidden;
display: flex;
flex-direction: column;
padding-bottom: 40rpx;
.top {
display: flex;
align-items: center;
.type {
width: 108rpx;
height: 46rpx;
@@ -168,7 +181,7 @@
.right {
display: flex;
align-items: center;
.right_text {
font-family: PingFangSC;
font-weight: 600;
@@ -178,9 +191,9 @@
font-style: normal;
}
}
}
.question_text {
font-family: PingFangSC;
font-weight: 500;
+107 -115
View File
@@ -1,21 +1,49 @@
<template>
<view class="talk-btns">
<uv-button class="touch-btn" @touchstart="startRecord" @touchend="stopRecord" @touchmove="handleMove"
v-if="!keyboardIsShow" :customStyle="{height:'92rpx'}">按住说话
<uv-button
class="touch-btn"
@touchstart="startRecord"
@touchend="stopRecord"
@touchmove="handleMove"
v-if="!keyboardIsShow"
:customStyle="{ height: '92rpx' }"
>
按住说话
</uv-button>
<view class="touch-btn" v-if="keyboardIsShow">
<uv-input class="input-box" ref="inputRef" v-model="inputText" :maxlength="props.textValueLength"
:adjustPosition="false" placeholderStyle='color:#999999;font-size:26rpx' placeholder="请输入文字">
</uv-input>
<uv-input
class="input-box"
ref="inputRef"
v-model="inputText"
:maxlength="props.textValueLength"
:adjustPosition="false"
placeholderStyle="color:#999999;font-size:26rpx"
placeholder="请输入文字"
></uv-input>
</view>
<view class="talk-btn-box">
<image class="talk-btn-icon" v-show="!keyboardIsShow" src="@/static/images/course/jianpan.png" mode=""
@click="changeBtn"></image>
<image class="talk-btn-icon" v-show="keyboardIsShow && !inputText" src="@/static/images/course/record.png"
mode="" @click="changeBtn"></image>
<image
class="talk-btn-icon"
v-show="!keyboardIsShow"
src="@/static/images/course/jianpan.png"
mode=""
@click="changeBtn"
></image>
<image
class="talk-btn-icon"
v-show="keyboardIsShow && !inputText"
src="@/static/images/course/record.png"
mode=""
@click="changeBtn"
></image>
<image class="talk-btn-icon" v-show="keyboardIsShow && !!inputText" src="@/static/images/course/send.png"
mode="" @click.stop="showKeyboard"></image>
<image
class="talk-btn-icon"
v-show="keyboardIsShow && !!inputText"
src="@/static/images/course/send.png"
mode=""
@click.stop="showKeyboard"
></image>
</view>
<uni-popup ref="popupRef" class="popup">
@@ -27,39 +55,27 @@
</view>
<view class="tips-box">松开发送</view>
<view class="btns-box">
<view :class="['close-btn',isOut?'is-out':'']" id="circleBox">取消
<view :class="['close-btn', isOut ? 'is-out' : '']" id="circleBox">
取消
<image class="btn-box" v-if="!isOut" src="@/static/images/course/close.png" mode=""></image>
<image class="btn-box" v-else src="@/static/images/course/close-active.png" mode=""></image>
</view>
</view>
<view :class="['talk-dialog',isOut?'is-out':'']">
<view :class="['talk-dialog', isOut ? 'is-out' : '']">
<image src="@/static/images/course/voice-white.gif" mode="" class="gif-box"></image>
</view>
</view>
</uni-popup>
</view>
</template>
<script setup>
import {
toRefs,
ref,
computed,
unref,
onMounted,
onUnmounted,
nextTick,
watch,
reactive
} from 'vue';
import { toRefs, ref, computed, unref, onMounted, onUnmounted, nextTick, watch, reactive } from 'vue';
import common from '@/common/common';
import permission from '@/common/permission.js'
import {
getPhoneEnvBool
} from '@/common/common.js'
import permission from '@/common/permission.js';
import { getPhoneEnvBool } from '@/common/common.js';
const emit = defineEmits(['submit'])
const emit = defineEmits(['submit']);
const props = defineProps({
isDisabled: {
default: true,
@@ -85,140 +101,116 @@
type: Number,
default: 500
},
minRecordDuration: { // 最小录音间隔
minRecordDuration: {
// 最小录音间隔
type: Number,
default: 1000
},
})
const {
isDisabled,
} = toRefs(props)
}
});
const { isDisabled } = toRefs(props);
// 键盘还是语音
const keyboardIsShow = ref(false)
const popupRef = ref(null)
watch(() => props.isLoading, () => {}, {
deep: true,
immediate: true
})
watch(() => props.canAnswer, () => {}, {
deep: true,
immediate: true
})
watch(() => props.isDisabled, (val) => {
if (val) {
keyboardIsShow.value = false
}
}, {
deep: true,
immediate: true
})
const inputText = ref('')
const keyboardIsShow = ref(false);
const popupRef = ref(null);
const inputText = ref('');
let startTime = 0;
// not_started 未开始, preparing 准备中, in_recording 录音中,ending 结束中
const recordingStatus = ref('not_started')
const recordingStatus = ref('not_started');
// 获取全局唯一的录音管理器 recorderManager
const recorderManager = uni.getRecorderManager();
// const innerAudioContext = uni.createInnerAudioContext();
const startTimer = ref(null); // 延迟启动的定时器ID
const startFlag = ref(1)
const startRecord = (obj) => { // 开始录音
const startFlag = ref(1);
const startRecord = (obj) => {
// 开始录音
console.log('开始录音', recordingStatus.value);
if (recordingStatus.value !== 'not_started') return;
touchY.value = obj.changedTouches[0].pageY
touchY.value = obj.changedTouches[0].pageY;
startTimer.value = setTimeout(() => {
console.log('延迟开始');
recordingStatus.value = 'preparing'
isMoving.value = true
recordingStatus.value = 'preparing';
popupRef.value.open();
recorderManager.start();
}, 80);
}
}, 100);
};
// 结束录音
const stopRecord = (obj) => {
console.log('结束录音', obj);
const stopRecord = () => {
console.log('结束录音');
if (startTimer.value) {
clearTimeout(startTimer.value);
startTimer.value = null;
}
recorderManager.stop();
popupRef.value.close()
nextTick(() => {
setTimeout(() => {
recordingStatus.value = 'not_started'
}, 300)
})
}
const endTime = Date.now();
const times = Math.max(500 - endTime + startTime, 0);
setTimeout(() => {
console.log('延迟数据', times);
nextTick(() => {
popupRef.value.close();
recorderManager.stop();
});
}, times);
nextTick(() => recordingStatus.value = 'not_started');
};
onMounted(async () => {
recorderManager.onStop(function(res) {
recorderManager.onStop(function (res) {
console.log('recorder stop' + JSON.stringify(res));
console.log('录音文件临时位置', res.tempFilePath);
if (isOut) return; // 被划掉的语音
console.log('录音文件临时位置', res.tempFilePath, isOut.value);
if (isOut.value) return; // 被划掉的语音
const endTime = Date.now();
const recordDuration = (endTime - startTime);
const recordDuration = endTime - startTime;
console.log('说话时长', recordDuration);
if (props.minRecordDuration > recordDuration) {
return common.msg('说话时间太短,没有听清!')
nextTick(()=>common.msg('说话时间太短,没有听清!'))
return ;
}
console.log('录音结束,时长:', recordDuration, '秒');
emit('submit', 'voice', res.tempFilePath)
emit('submit', 'voice', res.tempFilePath);
});
recorderManager.onStart(function(res) {
recorderManager.onStart(function (res) {
// 检测是否已经抬手结束了
console.log('检测是否已经抬手结束了', recordingStatus.value);
if (recordingStatus.value !== 'preparing') {
stopRecord()
stopRecord();
}
startTime = Date.now();
popupRef.value.open()
recordingStatus.value = 'in_recording'
recordingStatus.value = 'in_recording';
});
})
const touchY = ref(0)
const windowInfo = uni.getWindowInfo()
});
const touchY = ref(0);
const windowInfo = uni.getWindowInfo();
// 安全区域信息
const safeArea = windowInfo.safeArea;
// 计算是否超出按下盒子位置
const isOut = computed(() => {
const btnHeight = windowInfo.screenWidth / 750 * 234;
const btnHeight = (windowInfo.screenWidth / 750) * 234;
return touchY.value < safeArea.bottom - btnHeight;
});
const activeNum = ref(1)
const isMoving = ref(false)
const activeNum = ref(1);
const handleMove = (obj) => {
touchY.value = obj.changedTouches[0].pageY
}
touchY.value = obj.changedTouches[0].pageY;
};
// 发送文本
const showKeyboard = () => {
if (keyboardIsShow.value) {
const inputTextTram = inputText.value.trim()
const inputTextTram = inputText.value.trim();
if (inputTextTram) {
emit('submit', 'text', inputTextTram)
emit('submit', 'text', inputTextTram);
} else {
common.msg("不能发送空白消息!")
common.msg('不能发送空白消息!');
}
} else {
keyboardIsShow.value = !keyboardIsShow.value
keyboardIsShow.value = !keyboardIsShow.value;
}
}
};
// 切换键盘语音
const changeBtn = () => {
if (props.isDisabled) return
keyboardIsShow.value = !keyboardIsShow.value
inputText.value = ''
}
if (props.isDisabled) return;
keyboardIsShow.value = !keyboardIsShow.value;
inputText.value = '';
};
</script>
<style lang="scss" scoped>
@@ -230,7 +222,7 @@
.touch-btn {
height: 92rpx;
box-shadow: 0 8rpx 20rpx 0 rgba(0, 0, 0, .06);
box-shadow: 0 8rpx 20rpx 0 rgba(0, 0, 0, 0.06);
text-align: center;
line-height: 92rpx;
color: #000;
@@ -409,4 +401,4 @@
::v-deep .uv-input__content__field-wrapper__field {
padding-right: 60rpx;
}
</style>
</style>
+6 -6
View File
@@ -1,12 +1,12 @@
<template>
<view class="nav-bar-div" >
<view class="nav-bar" v-if="is_fixed" :style="{ backgroundColor: backgroundColor }"></view>
<view class="nav-bar-seat" v-if="is_seat" :style="{ backgroundColor: backgroundColor }"></view>
</view>
<!-- <view class="nav-bar-div" >
<view class="nav-bar" v-if="props.is_fixed" :style="{ backgroundColor: props.backgroundColor }"></view>
<view class="nav-bar-seat" :style="{ backgroundColor: props.backgroundColor }"></view>
</view> -->
</template>
<script setup>
const windowInfo = uni.getWindowInfo()
// const windowInfo = uni.getWindowInfo()
const props = defineProps({
is_fixed: {
@@ -37,7 +37,7 @@
}
.nav-bar-div {
z-index: 1900;
z-index: 2001;
width: 100%;
position: relative;
}
@@ -0,0 +1,64 @@
<template>
<uv-input
v-model="inputValue"
:customStyle="fixedCustomStyles"
placeholderStyle="color:#999999;font-size:26rpx"
:placeholder="placeholder"
:adjustPosition="false"
:confirmType="confirmType"
:maxlength="20"
@confirm="search"
>
<template #suffix><uv-icon name="search" color="#2c8ef2" size="24" @click="search(inputValue)"></uv-icon></template>
</uv-input>
</template>
<script setup>
import { ref, reactive, onMounted, computed, watch } from 'vue';
const fixedCustomStyles = {
backgroundColor: '#F1F5FA',
paddingLeft: '40rpx',
paddingTop: '5px',
paddingBottom: '5px',
border: 'none'
};
// 定义props
const props = defineProps({
modelValue: {
type: String, // 输入框通常是字符串类型,这里修改为String更合理
default: ''
},
placeholder: {
type: String,
default: ''
},
confirmType: {
type: String,
default: 'search'
},
});
// 定义emits
const emits = defineEmits(['update:modelValue', 'search']);
// 定义组件内部的inputValue,并与props.modelValue关联
const inputValue = ref(props.modelValue);
// 监听inputValue变化,同步到父组件
watch(inputValue, (newVal) => {
emits('update:modelValue', newVal);
});
// 监听父组件传来的modelValue变化,同步到组件内部
watch(
() => props.modelValue,
(newVal) => {
inputValue.value = newVal;
}
);
const search = () => {
emits('search', inputValue.value);
};
</script>
<style scoped lang="scss"></style>
+1 -1
View File
@@ -30,5 +30,5 @@ export const SUBJECT_TYPE = [{
{
value: "ES",
label: "问答题",
},
}
]
+9 -9
View File
@@ -145,15 +145,6 @@
}
}
},
{
"path": "pages/charts/index",
"style": {
"navigationBarTitleText": "",
"app-plus": {
"titleNView": false
}
}
},
{
"path": "pages/favorites/index",
"style": {
@@ -244,6 +235,15 @@
}
}
},
{
"path": "pages/examRanking/index",
"style": {
"navigationBarTitleText": "考试排行榜页",
"app-plus": {
"titleNView": false
}
}
},
{
"path": "pages/course/index",
"style": {
+16 -2
View File
@@ -19,10 +19,11 @@
<text class="talking-text" v-if="[3, 5, 6].indexOf(type) >= 0 && !dataInfo.isLoading">
{{ showContent }}
</text>
<text class="talking-text" v-if="[4].indexOf(type) >= 0">
<text class="talking-text" v-if="[4].indexOf(type) >= 0 && dataInfo.qnsTyp === 'ES'">
<!-- 请您思考并作答:<br> -->
{{ showContent }}
</text>
<RadioSubject v-if="[4].indexOf(type) >= 0 && dataInfo.qnsTyp !== 'ES'" :item="dataInfo" :mode="mode" @subject_click="subject_click" />
<view v-if="type === 3" style="overflow: hidden;">
<ImagePreview class="cont-img-box" v-if="(dataInfo.imageAddrs||[]).length>0" :imgId="dataInfo.imageAddrs[0]" :previewDetail="true"></ImagePreview>
<VideoPreview class="cont-img-box" v-if="(dataInfo.vidoAddrs||[]).length>0" :fileId="dataInfo.vidoAddrs[0]"></VideoPreview>
@@ -199,6 +200,8 @@ import { getUserInfo } from '@/common/common';
import { useStorageStore } from "@/store/storage.js"
import { onUnload } from '@dcloudio/uni-app'
import RadioSubject from '@/components/examination/radio-subject.vue'
const storageStore = useStorageStore()
const audioCacheObj = computed(() => storageStore.audioObj)
const props = defineProps({
@@ -249,13 +252,15 @@ const audioCacheObj = computed(() => storageStore.audioObj)
})
const { type, dataInfo, activeVoiceId, isPlaying, isLast, lastQuestionInfo, teacherInfo} = toRefs(props)
const emit = defineEmits(['changePlay', 'nextQuestion', 'withdraw', 'finishQuestion'])
const emit = defineEmits(['changePlay', 'nextQuestion', 'withdraw', 'finishQuestion', 'answerQuestion'])
// 声音播放初始化
const talkVoiceObj = ref(uni.createInnerAudioContext())
talkVoiceObj.value.playbackRate = Number(props.voiceRate)
const userInfo = computed(() => getUserInfo())
const itemVoice = ref('')
const mode = ref('study') // 考试 examination 练习practice 学习study
const showWithdraw = computed(()=>{
let _isMe = unref(lastQuestionInfo).qstLogId === unref(dataInfo).qstLogId
let _isQuestion = unref(lastQuestionInfo).isQuestion
@@ -316,6 +321,7 @@ const audioCacheObj = computed(() => storageStore.audioObj)
return str.replace(/\/n/g,"\n")
}
const voiceTime = ref('')
const itemInfo = ref({})
onMounted(()=>{
console.log()
initVoice()
@@ -504,6 +510,13 @@ const audioCacheObj = computed(() => storageStore.audioObj)
const finishQuestion = (data) => {
emit('finishQuestion',data)
}
// 答题 选择
const subject_click = (type,data) => {
if(type === 'answer'){
emit('answerQuestion', data)
}
}
</script>
<style lang="scss">
@@ -546,6 +559,7 @@ const audioCacheObj = computed(() => storageStore.audioObj)
background-color: #fff;
overflow: hidden;
padding-bottom: 30rpx;
width: 100%;
&.talking-info-less{
float: left;
min-width: 400rpx;
+9 -1
View File
@@ -73,6 +73,7 @@
@changePlay="changePlayItemId"
@nextQuestion="nextQuestionSuccess"
@withdraw="withdrawNow"
@answerQuestion="answerQuestionNow"
@finishQuestion="finishQuestionNow"
:id="'item' + item.id"
:isLast="talkingList.length === (index+1)"
@@ -440,6 +441,7 @@ const getQuestionInfoUnStudy = (pgrphId) => {
}).finally(() => {})
return
}
console.log(_body.chatBody)
if(_body.chatBody && _body.chatBody?.stdyStat !== 'N'){
let _id = new Date().getTime() + 'id'
lastTalkingInfo.value = {
@@ -454,8 +456,11 @@ const getQuestionInfoUnStudy = (pgrphId) => {
type: 4,
userInfo: {...choiceTeacherInfo.value},
id: _id,
isQuestion: true
isQuestion: true,
my_answer:[],
backend_answer: []
}
console.log(lastTalkingInfo.value)
talkingList.value.push(JSON.parse(JSON.stringify(lastTalkingInfo.value)))
qstLogId.value = _body.chatBody?.qstLogId
scrollToBottomNow()
@@ -827,6 +832,9 @@ const withdrawNow = (data) => {
})
}
const loadingQstLogId = ref('')
const answerQuestionNow = (data) => {
console.log(data,1111111111)
}
// 完成
const finishQuestionNow = (data) => {
textChartApi({
@@ -128,7 +128,6 @@
const props = defineProps({
crsId: String,
crsNum: String,
imgId: String
})
const click_reply = (item, parentBbsId, index) => {
+70 -21
View File
@@ -15,24 +15,46 @@
</view>
<view class="title-num">
<view class="num-item">
<image class="title-icon" src="/src/static/images/courseDetail/zhishidian.png" mode="heightFix"></image>
<image
class="title-icon"
src="/src/static/images/courseDetail/zhishidian.png"
mode="heightFix"
></image>
<view class="mr-10">知识点</view>
<view class="c-000">{{ form.pgrphNum || 0 }}</view>
</view>
<view class="num-item">
<image class="title-icon" src="/src/static/images/courseDetail/yixue.png" mode="heightFix"></image>
<image
class="title-icon"
src="/src/static/images/courseDetail/yixue.png"
mode="heightFix"
></image>
<view class="mr-10">已学</view>
<view class="c-000">{{ form.styParaGraphNum || 0 }}</view>
</view>
<view class="num-item examination">
<image class="title-icon" src="/src/static/images/courseDetail/charts.png" mode="heightFix"></image>
<image
class="title-icon"
src="/src/static/images/courseDetail/charts.png"
mode="heightFix"
></image>
<view>考试排行榜</view>
<view class="back-icon"></view>
</view>
<view class="fl1"></view>
<view class="num-item" @click="collect_click(form.collectId)">
<image v-if="form.collectId" class="collect-icon" src="/src/static/images/courseDetail/out_collect.png" mode="widthFix"></image>
<image v-else class="collect-icon" src="/src/static/images/courseDetail/in_collect.png" mode="widthFix"></image>
<image
v-if="form.collectId"
class="collect-icon"
src="/src/static/images/courseDetail/out_collect.png"
mode="widthFix"
></image>
<image
v-else
class="collect-icon"
src="/src/static/images/courseDetail/in_collect.png"
mode="widthFix"
></image>
</view>
</view>
</view>
@@ -61,7 +83,7 @@
</view>
<!--</swiper-item><swiper-item>-->
<view class="evaluate" v-if="tabAct == 2 && form">
<comment ref="commentRef" :crsNum="form.crsNum" :crsId="form.crsId" :imgId="form.imgId"></comment>
<comment ref="commentRef" :crsId="crsId" :imgId="form.imgId"></comment>
</view>
<!--</swiper-item></swiper>-->
</view>
@@ -69,12 +91,21 @@
</scroll-view>
<view class="btn-box btn-box-height font_pf">
<template v-if="[0, 1].includes(tabAct)">
<uv-button type="primary" @click="common.navigateTo('/pages/course/study?crsNum=' + form.crsNum + '&crsId=' + crsId + '&imgId=' + form.imgId)">去学习</uv-button>
<uv-button
type="primary"
@click="common.navigateTo('/pages/course/study?crsNum=' + form.crsNum + '&crsId=' + crsId + '&imgId=' + form.imgId)"
>
去学习
</uv-button>
<uv-button type="primary">去练习</uv-button>
<uv-button type="primary" @click="goto_examination()">去考试</uv-button>
</template>
<template v-if="tabAct == 2">
<uv-button type="primary" class="send_evaluate" @click="common.navigateTo('/pages/courseDetail/submit?crsNum=' + form.crsNum + '&imgId=' + form.imgId)">
<uv-button
type="primary"
class="send_evaluate"
@click="common.navigateTo('/pages/courseDetail/submit?crsNum=' + form.crsNum + '&imgId=' + form.imgId)"
>
发布评价
</uv-button>
</template>
@@ -120,7 +151,16 @@
form.value = body;
};
const toStudyPrgh = (info) => {
common.navigateTo('/pages/course/study?crsNum=' + form.value.crsNum + '&crsId=' + crsId.value + '&pgrphId=' + info.pgrphId + '&imgId=' + form.imgId);
common.navigateTo(
'/pages/course/study?crsNum=' +
form.value.crsNum +
'&crsId=' +
crsId.value +
'&pgrphId=' +
info.pgrphId +
'&imgId=' +
form.imgId
);
};
const bgOpacity = computed(() => {
@@ -141,8 +181,8 @@
const goto_examination = async () => {
common.loading();
startExamByCrs({
// crsId : crsId.value
crsId: 'CRS0250181220722025070408313900000018729'
crsId : crsId.value
// crsId: 'CRS0250181220722025070408313900000018729'
})
.then((res) => {
setPageCache('examination', {
@@ -157,16 +197,25 @@
};
const collect_click = async (collectId) => {
console.log(collectId);
if (!collectId) {
await insertTraPersonalCollectionTask({
collectTyp: '01',
collectBusId: crsId.value
});
} else {
await deleteTraPersonalCollectionById({
collectId: collectId
});
try {
if (!collectId) {
common.loading('收藏中');
form.value.collectId = await insertTraPersonalCollectionTask({
collectTyp: '01',
collectBusId: crsId.value
});
common.msg('收藏成功');
} else {
common.loading('取消收藏中');
await deleteTraPersonalCollectionById({
collectId: collectId
});
form.value.collectId = null;
common.msg('取消成功');
}
} catch (e) {
common.hideLoading();
}
};
onMounted(async () => {
+22
View File
@@ -0,0 +1,22 @@
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>
+1 -1
View File
@@ -89,7 +89,7 @@
<view class="title">AI问答</view>
</view>
<view class="item">
<view class="item" @click="common.navigateTo('/pages/learningTasks/details')">
<image class="icon" src="@/static/images/index/navigation_ai.png"></image>
<view class="title">AI陪练</view>
</view>
@@ -1,16 +1,16 @@
<template>
<view class="scroll_div">
<scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="scrolltolower" :show-scrollbar='false'>
<view class="item" :class="getStatusClass(index)" v-for="(item,index) in data_list">
<view class="item" :class="getStatusClass(item.isFinish)" v-for="(item,index) in data_list">
<view class="img_div">
<image class="img" src="@/static/images/test/4.png" mode="scaleToFill"></image>
<view class="subscript" v-if="index % 3==0">
<image-preview class="img" :src="item.ossAddr" mode="scaleToFill"></image-preview>
<view class="subscript" v-if="item.isFinish==='00'">
进行中
</view>
<view class="subscript" v-if="index % 3==1">
<view class="subscript" v-if="item.isFinish==='01'">
已完成
</view>
<view class="subscript" v-if="index % 3==2">
<view class="subscript" v-if="item.isFinish==='02'">
已超时
</view>
</view>
@@ -26,11 +26,12 @@
完成人数<text class="">{{item.taskFinishSums ?? 0}}/{{item.taskSums ?? 0}}</text>
</view>
<view>
进度<text class="">2/4门课程</text>
进度<text class="">{{item.sumCrs ?? 0}}/{{item.sumCrs ?? 0}}门课程</text>
</view>
</view>
</view>
</view>
<list-no-data v-if="total == 0 && status=='nomore'"></list-no-data>
<uv-load-more v-if="total != 0" :status="status" loadmore-text="轻轻上拉加载" :height="30"></uv-load-more>
</scroll-view>
</view>
@@ -47,11 +48,18 @@
onMounted,
nextTick
} from 'vue'
import {
queryAllTraTaskInfoByUserId,
} from '@/api/learningTasks.js';
const getData = (from = '') => {
const props = defineProps({
state: {
type: String,
required: true,
},
});
const getData = (from = '', searchText='') => {
if (from == 'first') {
if (total.value !== -1) {
return
@@ -67,9 +75,10 @@
}
setTimeout(() => {
queryAllTraTaskInfoByUserId({
state: '01',
state: props.state,
page: page.value,
limit: limit
limit: limit,
taskName:searchText
}).then(res => {
total.value = res.total
data_list.push(...res.body)
@@ -83,17 +92,23 @@
})
}, 200)
}
const getStatusClass = (index) => {
const remainder = index % 3;
if (remainder === 0) return 'in_progress';
if (remainder === 1) return 'completed';
const getStatusClass = (isFinish) => {
// 000102
if (isFinish === '00') return 'in_progress';
if (isFinish === '01') return 'completed';
return 'expired';
};
const scrolltolower = (item) => {
getData()
};
const search = (value) => {
total.value = -1
console.log('value', value);
getData('first', value)
}
defineExpose({
getData
getData, search
})
</script>
+267 -3
View File
@@ -1,8 +1,272 @@
<template>
<view class="main_div max_page">
<nav-bar :is_seat="true"></nav-bar>
<view class="body-title">
<view class="back_div" @click="common.navigateBack()">
<view class="back-icon"></view>
</view>
<view>任务详情</view>
</view>
<view class="detail_div" :class="'completed'">
<view class="subscript" v-if="detailData.examStatText === 'N'">未完成</view>
<view class="subscript" v-if="detailData.examStatText === 'Y'">已完成</view>
<view class="left">
<image src="/src/static/images/test/2.png" mode="aspectFill" class="img"></image>
</view>
<view class="right">
<view class="title_div">
<view class="title">
JBank银行服诉旦撒大银行服诉旦撒大银行服诉旦撒大银行服诉旦撒大银行服诉旦撒大银行服诉旦撒大
</view>
</view>
<view class="time">
<text class="color_3">起止时间</text>
<text class="color_class">2025-05-13至2025-05-13</text>
</view>
<view class="num_div">
<view class="num_div_item">
<text class="color_3">完成人数</text>
<text class="color_2">34/125</text>
</view>
<view class="num_div_item">
<text class="color_3">进度</text>
<text class="color_2">2/4门课程</text>
</view>
</view>
</view>
</view>
<scroll-view
ref="scrollRef"
:scroll-y="true"
class="scroll-Y"
:show-scrollbar="false"
@scrolltolower="scrolltolower"
></scroll-view>
</view>
</template>
<script>
<script setup>
import { onLoad } from '@dcloudio/uni-app';
import { reactive, computed } from 'vue';
import { startTraExamPapersInfo } from '@/api/examination.js';
import common from '@/common/common';
import { setPageCache, getPageCache } from '@/common/common';
const detailData = reactive({
papersId: '',
papersName: '',
examStartTm: '',
examEndTm: '',
execPersionNumer: '',
planPersionNumber: '',
judgeNumber: 0,
singleNumber: 0,
multiNumber: 0,
essayNumber: 0,
judgeGrade: 0,
singleGrade: 0,
multiGrade: 0,
essayGrade: 0
});
const scrolltolower = () => {};
onLoad((e) => {
const testing_hall_details = getPageCache('testing_hall_details');
Object.assign(detailData, {
...testing_hall_details
});
console.log('detailData', detailData);
});
</script>
<style>
</style>
<style scoped lang="scss">
.scroll-Y {
position: relative;
overflow: hidden;
height: calc(100vh - var(--status-bar-height) - 120rpx - 250rpx + 20rpx + 20rpx - 20rpx);
width: calc(100% - 52rpx);
margin: 0 auto;
background: linear-gradient(180deg, #ebf2fe 0%, #f3f7fe 6%, #fafbfc 12%, #fafbfc 100%);
border-radius: 16rpx;
margin-top: -20rpx;
z-index: 2;
box-shadow: 0 0 6rpx #fafbfc;
border: 4rpx solid #FFFFFF;
}
.main_div {
background-image: url('@/static/images/learningTasks/learningTasksBg.png');
background-repeat: no-repeat;
background-size: 100% calc(420rpx + var(--status-bar-height)); /* 宽度充满,高度自适应比例 */
background-position: top;
background-color: #fff;
}
.body-title {
width: 100%;
position: relative;
text-align: center;
height: 120rpx;
line-height: 60rpx;
font-family: PingFangSC;
font-weight: 600;
font-size: 32rpx;
color: #000000;
font-style: normal;
}
.detail_div {
margin-top: -20rpx;
height: 250rpx;
z-index: 2;
width: 100%;
padding: 36rpx 40rpx 20rpx 40rpx;
background-color: #ffffff;
border-radius: 16rpx 16rpx 0 0;
position: relative;
overflow: hidden;
display: flex;
.subscript {
position: absolute;
top: 0;
right: 0;
width: 102rpx;
height: 42rpx;
font-family: PingFangSC;
font-weight: 400;
font-size: 24rpx;
line-height: 42rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 0 0 0 28rpx;
}
.left > .img {
width: 225rpx;
height: 169rpx;
border-radius: 16rpx;
}
.right {
margin-left: 24rpx;
.title_div {
display: flex;
justify-content: space-between;
flex: 1;
.title {
font-family: PingFangSC;
font-weight: 600;
color: #000000;
text-align: left;
font-style: normal;
font-size: 28rpx; /* 字体大小30rpx */
display: -webkit-box; /* 启用弹性盒模型 */
-webkit-box-orient: vertical; /* 设置盒子内子元素的排列方向为垂直 */
-webkit-line-clamp: 2; /* 限制最多显示2行 */
overflow: hidden; /* 超出部分隐藏 */
text-overflow: ellipsis; /* 超出部分显示省略号(多行时可能不显示,但建议保留) */
line-height: 1.5; /* 可选:设置行高,优化多行显示效果 */
}
}
.time {
font-size: 24rpx;
color: #999999;
line-height: 30rpx;
font-family: Arial;
font-weight: 400;
color: #666666;
margin-top: 12rpx;
margin-bottom: 12rpx;
}
.num_div {
font-family: PingFangSC;
font-weight: 400;
font-size: 24rpx;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: nowrap;
overflow: hidden;
height: 28rpx;
.num_div_item {
display: flex;
flex-wrap: nowrap;
line-height: 28rpx;
height: 28rpx;
}
}
.color_1 {
color: #d70c18;
}
.color_2 {
color: #111111;
}
.color_3 {
color: #666666;
}
}
}
.incomplete {
//
.subscript {
color: #ffffff;
background-color: #ef5705;
}
.color_class {
color: #d70c18;
}
}
.completed {
//
.subscript {
color: #ffffff;
background-color: #33c583;
}
.color_class {
color: #0066ff;
}
}
.back_div {
position: absolute;
left: 26rpx;
height: 100%;
top: -30rpx;
display: flex;
align-items: center;
.back-icon {
position: relative;
width: 50rpx;
height: 50rpx;
cursor: pointer;
display: flex;
align-items: center;
}
.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 #000000;
border-left: 4rpx solid #000000;
transform: rotate(-45deg);
}
}
</style>
+61 -58
View File
@@ -8,29 +8,32 @@
<view class="title font_pf">学习任务</view>
</view>
<view class="fixed_search_input_div">
<uv-input v-model="inputValue" shape="" :customStyle="fixedCustomStyles"
placeholderStyle='color:#999999;font-size:26rpx' placeholder="请输入任务名" suffixIcon="search"
:suffixIconStyle="suffixIconStyle">
</uv-input>
<search-input placeholder="请输入任务名" @search="search"></search-input>
</view>
<view class="detail-body">
<view class="body-tab">
<uv-tabs class="font_pf my_tabs" :current="tabAct" :list="tabList" @change="tabChange"
:scrollable="false" line-color="#0066FF"
:inactive-style="{ color: '#333333', fontSize: '30rpx', fontWeight:'600'}"
:activeStyle="{color:'#0066FF',fontSize:'30rpx', fontWeight:'600'}"
:lineColor="`url(${LineBg}) 10% 10%`"></uv-tabs>
<uv-tabs
class="font_pf my_tabs"
:current="tabAct"
:list="tabList"
@change="tabChange"
:scrollable="false"
line-color="#0066FF"
:inactive-style="{ color: '#333333', fontSize: '30rpx', fontWeight: '600' }"
:activeStyle="{ color: '#0066FF', fontSize: '30rpx', fontWeight: '600' }"
:lineColor="`url(${LineBg}) 10% 10%`"
></uv-tabs>
</view>
<view class="uni-margin-wrap no-overflow">
<swiper class="swiper" :current="tabAct" :indicator-dots="false" @change="swiperChange">
<swiper-item>
<listItem :ref="el => listItemRefs[0] = el" status="01"></listItem>
<listItem :ref="(el) => (listItemRefs[0] = el)" state="01"></listItem>
</swiper-item>
<swiper-item>
<listItem :ref="el => listItemRefs[1] = el" status="01"></listItem>
<listItem :ref="(el) => (listItemRefs[1] = el)" state="02"></listItem>
</swiper-item>
<swiper-item>
<listItem :ref="el => listItemRefs[2] = el" status="01"></listItem>
<listItem :ref="(el) => (listItemRefs[2] = el)" state="03"></listItem>
</swiper-item>
</swiper>
</view>
@@ -39,44 +42,38 @@
</template>
<script setup>
import {
LineBg
} from '@/enum.js'
import listItem from './components/list-item.vue'
import { LineBg } from '@/enum.js';
import listItem from './components/list-item.vue';
//
import {
reactive,
ref,
computed,
nextTick,
onMounted,
watch
} from 'vue';
import common from '@/common/common';
import { reactive, ref, computed, nextTick, onMounted, watch } from 'vue';
import common from '@/common/common.js';
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
//
const fixedCustomStyles = {
backgroundColor: "#F1F5FA",
paddingLeft: "40rpx",
paddingTop: "5px",
paddingBottom: "5px",
border: "none"
}
backgroundColor: '#F1F5FA',
paddingLeft: '40rpx',
paddingTop: '5px',
paddingBottom: '5px',
border: 'none'
};
const suffixIconStyle = {
color: "#2c8ef2",
fontSize: "28px"
}
color: '#2c8ef2',
fontSize: '28px'
};
const listItemRefs = ref([]);
const taskRef = ref(null);
const tabAct = ref(0);
const inputValue = ref('');
const tabList = ref([{
name: '全 部'
}, {
name: '已完成'
}, {
name: '未完成'
}]);
const tabList = ref([
{
name: '全 部'
},
{
name: '已完成'
},
{
name: '未完成'
}
]);
const tabChange = (item) => {
tabAct.value = item.index;
@@ -84,21 +81,28 @@
const swiperChange = (item) => {
tabAct.value = item.detail.current;
};
const search = (value) => {
listItemRefs.value[tabAct.value]?.search(value);
};
onMounted(() => {
watch(tabAct, (newValue, oldValue) => {
typeof listItemRefs.value[newValue]?.getData === 'function' && listItemRefs.value[newValue]
?.getData('first')
}, {
immediate: true
}) // immediateonMounted
})
watch(
tabAct,
(newValue, oldValue) => {
typeof listItemRefs.value[newValue]?.getData === 'function' &&
listItemRefs.value[newValue]?.getData('first');
},
{
immediate: true
}
); // immediateonMounted
});
</script>
<style lang="scss" scoped>
$bg-margin-left: 50rpx;
.my_tabs {
// 穿
:deep(.uv-tabs__wrapper__nav__line) {
height: 26rpx !important;
@@ -116,7 +120,7 @@
tab切换栏高度88rpx
下方滑动区域上下边距各10共20rpx
**/
height: calc(100vh - var(--status-bar-height) - 88rpx - 80rpx - 88rpx - 20rpx);
}
@@ -139,7 +143,7 @@
}
.detail-main {
background-color: #F6F8FF;
background-color: #f6f8ff;
overflow: hidden;
}
@@ -150,15 +154,14 @@
font-weight: 600;
line-height: 34rpx;
}
.fixed_search_input_div{
.fixed_search_input_div {
width: 100%;
height: 80rpx;
padding: 0 22rpx;
// background-color: red;
background-color: #fff;
:deep(.uv-input.uv-input--radius) {
border-radius:16rpx !important;
border-radius: 16rpx !important;
}
}
.fixed_search_div {
@@ -171,11 +174,11 @@
// background-color: red;
// height: 180rpx;
position: relative;
.back_div {
position: absolute;
left: 20rpx;
top: var(--status-bar-height);
top: var(--status-bar-height);
padding: 10rpx;
.back-icon {
@@ -205,4 +208,4 @@
}
}
}
</style>
</style>
-4
View File
@@ -365,10 +365,6 @@
<style scoped lang="scss">
$bg-margin-left: 50rpx;
//
.cell_div {
margin: 30rpx $bg-margin-left 0 $bg-margin-left;
@@ -0,0 +1,355 @@
<template>
<view class="main_div max_page">
<scroll-view
ref="scrollRef"
:scroll-y="true"
class="scroll-Y"
:refresher-enabled="false"
:show-scrollbar="false"
@scrolltolower="scrolltolower"
@refresherrefresh="onRefresh"
@refresherrestore="triggered = 'restore'"
:refresher-triggered="triggered"
refresher-default-style="none"
>
<view class="content">
<view
style="
position: absolute;
top: -90rpx;
width: 100%;
height: 90rpx;
display: flex;
align-items: center;
justify-content: center;
"
></view>
<view class="item" v-for="(item, index) in data_list" @click="read">
<view class="icon">
<image
v-if="item.noticeTyp == '01'"
class="img_100"
src="@/static/images/messageNotification/type_01.png"
mode="widthFix"
></image>
<image
v-if="item.noticeTyp == '02'"
class="img_100"
src="@/static/images/messageNotification/type_02.png"
mode="widthFix"
></image>
<image
v-if="item.noticeTyp == '03'"
class="img_100"
src="@/static/images/messageNotification/type_03.png"
mode="widthFix"
></image>
</view>
<view class="right">
<view class="top">
<view class="title">
{{ item.noticeTitle }}
</view>
<view class="time">
{{ item.ctTime?.substr(0, 16) }}
</view>
</view>
<view class="bottom">
<view class="note ellipsis-text">
{{ item.noticeContent }}
</view>
<!-- <view class="num_div"></view> -->
<view class="read_div" v-if="item.isRead"></view>
</view>
</view>
</view>
<uv-load-more v-if="total != 0" :status="status" loadmore-text="轻轻上拉加载" :height="30"></uv-load-more>
</view>
</scroll-view>
</view>
</template>
<script setup>
import { ref, reactive, nextTick, onMounted } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { queryTraPersonalMessageNoticePaging } from '@/api/messageNotification.js';
const customStyle = {
backgroundColor: '#ffffff',
paddingLeft: '40rpx',
height: '78rpx',
paddingTop: '5px',
paddingBottom: '5px',
border: 'none'
};
const suffixIconStyle = {
color: '#2c8ef2',
fontSize: '50rpx'
};
const options = [
{
text: '删除',
style: {
backgroundColor: '#f56c6c'
}
}
];
const status = ref('loadmore'); // loadmore - loading - nomore -
const limit = 15;
const total = ref(-1);
const page = ref(0);
const data_list = reactive([]);
const triggered = ref(false);
const _freshing = ref(false);
const offset = ref(0);
const scrollRef = ref(null);
//
const onPulling = (e) => {
page.value = 1;
total.value = -1;
page.data_list.length = 0;
getData();
};
//
const onRefresh = () => {
if (_freshing.value) return;
_freshing.value = true;
setTimeout(() => {
triggered.value = false;
_freshing.value = false;
}, 1000);
};
const getData = (from = '') => {
if (from == 'first') {
if (total.value !== -1) {
return;
}
status.value = 'loading';
total.value = -1;
page.value = 1;
data_list.length = 0;
} else {
if (status.value !== 'loadmore' && status.value !== '') return;
status.value = 'loading';
page.value++;
}
console.log(status.value, '阿斯顿撒');
setTimeout(() => {
queryTraPersonalMessageNoticePaging({
page: page.value,
limit: limit
})
.then((res) => {
total.value = res.total;
data_list.push(...res.body);
})
.finally(() => {
if (data_list.length >= total.value) {
status.value = 'nomore';
} else {
status.value = 'loadmore';
}
});
}, 200);
};
const scrolltolower = (item) => {
getData();
};
onMounted(() => {
// triggered.value = true;
getData();
// setTimeout(() => {
// triggered.value = true
// message_list.value.push(...[1, 2, 3, 4, 5])
// }, 1000)
console.log(scrollRef.value);
});
</script>
<style scoped lang="scss">
.pulldown-loading-box {
position: fixed;
left: 0;
right: 0;
z-index: 3;
transform: translateY(-100%);
transition: transform 0.3s;
z-index: 1;
}
.scroll-Y {
height: calc(100vh - 70rpx - var(--status-bar-height) - 78rpx - 40rpx);
position: relative;
overflow: hidden;
border-radius: 20rpx 20rpx 0 0;
.content {
width: 100%;
background-color: #fff;
box-shadow: 0 0 6rpx #b3d6ff;
position: relative;
.item {
height: 154rpx;
padding: 38rpx 0 38rpx 0;
margin: 0 38rpx;
display: flex;
justify-content: space-between;
align-items: center;
border-top: 2rpx solid #efefef;
.icon {
width: 78rpx;
height: 78rpx;
}
.right {
margin-left: 16rpx;
flex: 1;
.top {
display: flex;
justify-content: space-between;
.title {
font-family: PingFangSC;
font-weight: 600;
font-size: 30rpx;
color: #000000;
line-height: 46rpx;
text-align: left;
font-style: normal;
}
.time {
font-size: 23rpx;
color: #999999;
line-height: 30rpx;
text-align: right;
font-style: normal;
}
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
overflow: hidden;
width: 100%;
.note {
font-family: PingFangSC;
font-weight: 400;
font-size: 26rpx;
color: #666666;
line-height: 35rpx;
text-align: left;
font-style: normal;
flex: 1;
}
.num_div {
padding: 0 8rpx;
height: 31rpx;
background: #ff6c75;
border-radius: 15rpx;
display: flex;
align-items: center;
justify-content: center;
font-family: ArialMT;
font-size: 22rpx;
color: #ffffff;
line-height: 26px;
min-width: 40rpx;
}
.read_div {
width: 16rpx;
height: 16rpx;
background-color: #d70c18;
border-radius: 100%;
}
}
}
}
}
}
.main_div {
display: flex;
flex-direction: column;
align-items: center;
background: linear-gradient(0deg, rgba(234, 246, 255, 0) 0%, #c3e6ff 100%);
// background-size: 100% 300px;
// background-repeat: no-repeat; /* */
padding-top: var(--status-bar-height);
overflow: hidden;
}
.body-title {
width: 100%;
height: 70rpx;
font-size: 33rpx;
padding-top: 10rpx;
font-weight: 500;
color: #000;
position: relative;
text-align: center;
.delete_div {
position: absolute;
right: 20rpx;
top: 17rpx;
width: 50rpx;
height: 50rpx;
.img {
width: 34rpx;
height: 34rpx;
}
}
.back_div {
position: absolute;
left: 26rpx;
height: 34rpx;
top: 17rpx;
.back-icon {
position: relative;
width: 50rpx;
height: 50rpx;
cursor: pointer;
display: flex;
align-items: center;
}
.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 #2b2c2e;
border-left: 4rpx solid #2b2c2e;
transform: rotate(-45deg);
}
}
}
.input-view {
width: 90%;
margin: 20rpx auto;
height: 78rpx;
}
</style>
+291 -204
View File
@@ -1,256 +1,343 @@
<template>
<view class="main_div max_page">
<view class="body-title">
<view class="back_div" @click="common.navigateBack()">
<view class="back_div">
<view class="back-icon"></view>
</view>
<view>消息</view>
<view class="delete_div" @click="common.navigateBack()">
<image class="img" src="@/static/images/messageNotification/delete_icon.png" mode="aspectFit">
</image>
<view class="delete_div">
<image class="img" src="@/static/images/messageNotification/delete_icon.png" mode="aspectFit"></image>
</view>
</view>
<view class="input-view">
<uv-input shape="circle" placeholderStyle='color:#999999;font-size:28rpx' placeholder="请输入关键词"
suffixIcon="search" :customStyle="customStyle" :suffixIconStyle="suffixIconStyle">
</uv-input>
<uv-input
shape="circle"
placeholderStyle="color:#999999;font-size:28rpx"
placeholder="请输入关键词"
suffixIcon="search"
:customStyle="customStyle"
:suffixIconStyle="suffixIconStyle"
></uv-input>
</view>
<scroll-view ref="scrollRef" scroll-y="true" class="scroll-Y" :refresher-enabled="true"
@refresherrefresh="onRefresh" @refresherrestore="triggered = 'restore'" :refresher-triggered="triggered"
refresher-default-style="none">
<!-- 主体 -->
<view class="content">
<view style="position: absolute;top: -90rpx;width: 100%;height: 90rpx;"> </view>
<uv-swipe-action>
<uv-swipe-action-item :options="options" :threshold="40" :index="index"
v-for="(item, index) in data_list">
<view class="item">
<view class="icon">
<image class="img_100" :src="`@/static/images/messageNotification/type_${item.noticeTyp}.png`" mode="widthFix"></image>
</view>
<view class="right">
<view class="top">
<view class="title">
{{item.noticeTitle}}
</view>
<view class="time">
{{item.ctTime.substr(0, 16)}}
</view>
</view>
<view class="bottom">
<view class="note ellipsis-text">
{{item.noticeContent}}
</view>
<view class="num_div">
</view>
</view>
</view>
<scroll-view
ref="scrollRef"
:scroll-y="true"
class="scroll-Y"
:refresher-enabled="false"
:show-scrollbar="false"
@scrolltolower="scrolltolower"
@refresherrefresh="onRefresh"
@refresherrestore="triggered = 'restore'"
:refresher-triggered="triggered"
refresher-default-style="none"
>
<view class="item" v-for="(item, index) in data_list" @click="readMessageOpen(item)">
<view class="icon">
<image
v-if="item.noticeTyp == '01'"
class="img_100"
src="@/static/images/messageNotification/type_01.png"
mode="widthFix"
></image>
<image
v-if="item.noticeTyp == '02'"
class="img_100"
src="@/static/images/messageNotification/type_02.png"
mode="widthFix"
></image>
<image
v-if="item.noticeTyp == '03'"
class="img_100"
src="@/static/images/messageNotification/type_03.png"
mode="widthFix"
></image>
</view>
<view class="right">
<view class="top">
<view class="title">
{{ item.noticeTitle }}
</view>
</uv-swipe-action-item>
</uv-swipe-action>
<uv-load-more v-if="total != 0" :status="status" loadmore-text="轻轻上拉加载" :height="30"></uv-load-more>
<view class="time">
{{ item.ctTime?.substr(0, 16) }}
</view>
</view>
<view class="bottom">
<view class="note ellipsis-text">
{{ item.noticeContent }}
</view>
<!-- <view class="num_div"></view> -->
<view class="read_div" v-if="item?.isRead === '01'"></view>
</view>
</view>
</view>
<list-no-data v-if="total == 0 && status == 'nomore'"></list-no-data>
<uv-load-more v-if="total != 0" :status="status" loadmore-text="轻轻上拉加载" :height="30"></uv-load-more>
</scroll-view>
<uni-popup ref="popup" type="bottom">
<view class="popup">
<view class="message_popup_div">
<view class="title">
{{ popup_info.title }}
</view>
<view class="text">消正息内容正文消息内容正文</view>
<view class="button_div" @click.stop="readMessage">
<uv-button class="button">我知道了</uv-button>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script setup>
import {
ref,
reactive,
nextTick,
onMounted
} from 'vue'
import {
onLoad
} from '@dcloudio/uni-app'
import {
queryTraPersonalMessageNoticePaging
} from '@/api/messageNotification.js';
import { ref, reactive, nextTick, onMounted } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { queryTraPersonalMessageNoticePaging, readNotice } from '@/api/messageNotification.js';
const customStyle = {
backgroundColor: "#ffffff",
paddingLeft: "40rpx",
backgroundColor: '#ffffff',
paddingLeft: '40rpx',
height: '78rpx',
paddingTop: "5px",
paddingBottom: "5px",
border: "none"
}
paddingTop: '5px',
paddingBottom: '5px',
border: 'none'
};
const suffixIconStyle = {
color: "#2c8ef2",
fontSize: "50rpx"
}
const options = [{
text: '删除',
style: {
backgroundColor: '#f56c6c'
}
}]
const status = ref('loadmore') // loadmore - loading - nomore -
const limit = 15
const total = ref(-1)
const page = ref(0)
const data_list = reactive([])
const triggered = ref(false)
const _freshing = ref(false)
const offset = ref(0)
const scrollRef = ref(null)
color: '#2c8ef2',
fontSize: '50rpx'
};
const status = ref('loadmore'); // loadmore - loading - nomore -
const limit = 15;
const total = ref(-1);
const page = ref(0);
const data_list = reactive([]);
const triggered = ref(false);
const _freshing = ref(false);
const offset = ref(0);
const scrollRef = ref(null);
const popup_info = reactive({
id: '',
title: '',
text: ''
});
const popup = ref(null);
//
const onPulling = (e) => {
console.log("onpulling", e)
}
page.value = 1;
total.value = -1;
page.data_list.length = 0;
getData();
};
//
const onRefresh = () => {
if (_freshing.value) return
_freshing.value = true
if (_freshing.value) return;
_freshing.value = true;
setTimeout(() => {
triggered.value = false
_freshing.value = false
}, 1000)
}
triggered.value = false;
_freshing.value = false;
}, 1000);
};
const getData = (from = '') => {
if (from == 'first') {
if (total.value !== -1) {
return
return;
}
status.value = 'loading'
total.value = -1
page.value = 1
data_list.length = 0
status.value = 'loading';
total.value = -1;
page.value = 1;
data_list.length = 0;
} else {
if (status.value !== 'loadmore' && status.value !== '') return
status.value = 'loading'
page.value++
if (status.value !== 'loadmore' && status.value !== '') return;
status.value = 'loading';
page.value++;
}
console.log(status.value, '阿斯顿撒');
setTimeout(() => {
queryTraPersonalMessageNoticePaging({
page: page.value,
limit: limit
}).then(res => {
total.value = res.total
data_list.push(...res.body)
}).finally(() => {
if (data_list.length >= total.value) {
status.value = 'nomore'
} else {
status.value = 'loadmore'
}
queryTraPersonalMessageNoticePaging({
page: page.value,
limit: limit
})
.then((res) => {
total.value = res.total;
data_list.push(...res.body);
})
}, 200)
}
.finally(() => {
if (data_list.length >= total.value) {
status.value = 'nomore';
} else {
status.value = 'loadmore';
}
});
};
const readMessage = () => {
readNotice({ noticeId: popup_info.id }).then((res) => {
popup.value.close();
data_list.forEach((item) => {
if (item.noticeId === popup_info.id) {
item.isRead = res.body.isRead;
return;
}
});
});
};
//
const readMessageOpen = (item) => {
popup_info.id = item.noticeId;
popup_info.title = item.noticeTitle;
popup_info.text = item.noticeContent;
popup.value.open();
};
const scrolltolower = (item) => {
getData();
};
onMounted(() => {
triggered.value = true
getData()
// setTimeout(() => {
// triggered.value = true
// message_list.value.push(...[1, 2, 3, 4, 5])
// }, 1000)
console.log(scrollRef.value);
})
getData();
});
</script>
<style scoped lang="scss">
.pulldown-loading-box {
position: fixed;
left: 0;
right: 0;
z-index: 3;
transform: translateY(-100%);
transition: transform .3s;
z-index: 1;
.popup {
width: 100vw;
height: 100vh;
position: relative;
}
.message_popup_div {
width: 580rpx;
border-radius: 38rpx;
background: #ffffff url('@/static/images/messageNotification/popup_bg.png') no-repeat center -4rpx;
background-size: auto 50%;
background-color: #ffffff;
margin: 0 auto;
overflow: hidden;
top: 30%;
position: absolute;
left: calc(50% - 290rpx);
.title {
padding: 0 40rpx;
width: 100%;
height: 90rpx;
line-height: 110rpx;
font-weight: 700;
text-align: center;
}
.text {
padding: 16rpx 40rpx;
font-family: PingFangSC;
font-size: 30rpx;
color: #333333;
line-height: 48rpx;
text-align: left;
font-style: normal;
min-height: 300rpx;
max-height: 650rpx;
overflow: auto;
}
.button_div {
overflow: hidden;
.button {
width: 100%;
height: 100%;
:deep(.uv-button) {
height: 100rpx;
font-family: PingFangSC;
font-weight: 500;
font-size: 36rpx;
color: #0066ff;
}
}
}
}
.scroll-Y {
height: calc(100vh - 70rpx - var(--status-bar-height) - 78rpx - 40rpx);
position: relative;
overflow: hidden;
border-radius: 20rpx 20rpx 0 0;
position: relative;
background-color: #fff;
box-shadow: 0 0 6rpx #b3d6ff;
.content {
width: 100%;
height: 100%;
border-radius: 20rpx 20rpx 0 0;
background-color: #fff;
box-shadow: 0 0 6rpx #B3D6FF;
position: relative;
.item {
width: 100%;
height: 154rpx;
padding: 38rpx 38rpx 38rpx 38rpx;
display: flex;
justify-content: space-between;
align-items: center;
.item {
height: 154rpx;
padding: 38rpx 0 38rpx 0;
margin: 0 38rpx;
display: flex;
justify-content: space-between;
align-items: center;
border-top: 2rpx solid #efefef;
.icon {
width: 78rpx;
height: 78rpx;
}
.icon {
width: 78rpx;
height: 78rpx;
}
.right {
margin-left: 16rpx;
flex: 1;
.right {
margin-left: 16rpx;
flex: 1;
.top {
display: flex;
justify-content: space-between;
.top {
display: flex;
justify-content: space-between;
.title {
font-family: PingFangSC;
font-weight: 600;
font-size: 30rpx;
color: #000000;
line-height: 46rpx;
text-align: left;
font-style: normal;
}
.time {
font-size: 23rpx;
color: #999999;
line-height: 30rpx;
text-align: right;
font-style: normal;
}
.title {
font-family: PingFangSC;
font-weight: 600;
font-size: 30rpx;
color: #000000;
line-height: 46rpx;
text-align: left;
font-style: normal;
}
.bottom {
.time {
font-size: 23rpx;
color: #999999;
line-height: 30rpx;
text-align: right;
font-style: normal;
}
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
overflow: hidden;
width: 100%;
.note {
font-family: PingFangSC;
font-weight: 400;
font-size: 26rpx;
color: #666666;
line-height: 35rpx;
text-align: left;
font-style: normal;
flex: 1;
}
.num_div {
padding: 0 8rpx;
height: 31rpx;
background: #ff6c75;
border-radius: 15rpx;
display: flex;
justify-content: space-between;
.note {
font-family: PingFangSC;
font-weight: 400;
font-size: 26rpx;
color: #999999;
line-height: 34rpx;
text-align: left;
font-style: normal;
}
.num_div {
padding: 0 8rpx;
height: 31rpx;
background: #FF6C75;
border-radius: 15rpx;
display: flex;
align-items: center;
justify-content: center;
font-family: ArialMT;
font-size: 22rpx;
color: #FFFFFF;
line-height: 26px;
min-width: 40rpx;
}
align-items: center;
justify-content: center;
font-family: ArialMT;
font-size: 22rpx;
color: #ffffff;
line-height: 26px;
min-width: 40rpx;
}
.read_div {
width: 16rpx;
height: 16rpx;
background-color: #d70c18;
border-radius: 100%;
}
}
}
@@ -261,10 +348,11 @@
display: flex;
flex-direction: column;
align-items: center;
background: linear-gradient(0deg, rgba(234, 246, 255, 0) 0%, #C3E6FF 100%);
// background-size: 100% 300px;
// background-repeat: no-repeat; /* */
background: linear-gradient(0deg, rgba(195, 219, 255, 0) 0%, #c3dbff 100%);
background-size: 100% 300px;
background-repeat: no-repeat; /* 防止渐变重复平铺 */
padding-top: var(--status-bar-height);
overflow: hidden;
}
.body-title {
@@ -328,6 +416,5 @@
width: 90%;
margin: 20rpx auto;
height: 78rpx;
}
</style>
</style>
+10 -10
View File
@@ -51,12 +51,8 @@
const _freshing = ref(false)
const offset = ref(0)
const scrollRef = ref(null)
const props = defineProps({
searchText: {
type: String,
default: ''
},
index: {
type: Number,
default: 0
@@ -75,8 +71,8 @@
}, 1000)
}
const getData = (from = '') => {
console.log('getDatagetDatagetDatagetDatagetDatagetDatagetData');
const getData = (from = '', searchText='') => {
if (from == 'first') {
if (total.value !== -1) return;
status.value = 'loading'
@@ -91,7 +87,7 @@
setTimeout(() => {
let params = {
papersName: props.searchText,
papersName: searchText,
page: page.value,
limit: limit,
}
@@ -119,9 +115,13 @@
const scrolltolower = () => {
getData()
};
const search = (value) => {
console.log('searchvalue', value);
total.value = -1
getData('first', value)
}
defineExpose({
getData
getData, search
})
</script>
+14 -11
View File
@@ -1,5 +1,6 @@
<template>
<view class="main_div max_page">
<view class="my-nav-bar"></view>
<view class="body-title">
<view class="back_div" @click="common.navigateBack()">
<view class="back-icon"></view>
@@ -25,7 +26,7 @@
<view class="paper">
<!-- 试卷信息 -->
<view class="paper_title_div">
<image src="@/static/images/testingHall/testing.png" mode="heightFix" class="img"></image>
<image src="@/static/images/testingHall/testing.png" class="img"></image>
<view class="title">
试卷信息
</view>
@@ -262,8 +263,6 @@
flex: 1;
.paper {
// width: 100%;
background-color: red;
height: 100%;
margin: 24rpx 30rpx 0 30rpx;
border-radius: 20rpx;
@@ -283,7 +282,8 @@
align-items: center;
.img {
height: 32rpx;
width: 32rpx;
height: 28rpx;
}
.title {
@@ -359,24 +359,27 @@
display: flex;
flex-direction: column;
align-items: center;
padding-top: var(--status-bar-height);
overflow: hidden;
}
.my-nav-bar{
width: 100%;
height: calc(var(--status-bar-height) - 40rpx);
background-color: #337FFF;
}
.body-title {
background-color: #337FFF;
width: 100%;
position: relative;
text-align: center;
height: 140rpx;
line-height: 140rpx;
height: 120rpx;
line-height: 100rpx;
font-family: PingFangSC;
font-weight: 500;
font-size: 38rpx;
color: #FFFFFF;
font-style: normal;
}
.detail_div {
@@ -485,7 +488,7 @@
position: absolute;
left: 26rpx;
height: 100%;
top: 0;
top: -10rpx;
display: flex;
align-items: center;
+9 -13
View File
@@ -7,11 +7,8 @@
<view>考试中心</view>
</view>
<view class="input-view">
<uv-input shape="circle" placeholderStyle='color:#999999;font-size:28rpx' placeholder="请输入关键词"
suffixIcon="search" :customStyle="customStyle" :suffixIconStyle="suffixIconStyle" confirmType="search"
v-model="searchText" @confirm="search">
</uv-input>
<view class="search_div" @click="search"></view>
<search-input placeholder="请输入考试名" @search="search"></search-input>
<!-- <view class="search_div" @click="search"></view> -->
</view>
<view class="body-tab">
<uv-tabs class="font_pf my_tabs" :current="tabAct" :list="tabList" @change="tabChange" :scrollable="false"
@@ -22,15 +19,15 @@
<swiper class="swiper" :current="tabAct" :indicator-dots="false" @change="swiperChange">
<swiper-item>
<Content :ref="el => contentRefs[0] = el" :index="tabAct" :searchText="searchText"
<Content :ref="el => contentRefs[0] = el" :index="tabAct"
@gotoDetails="gotoDetails"></Content>
</swiper-item>
<swiper-item>
<Content :ref="el => contentRefs[1] = el" :index="tabAct" :searchText="searchText"
<Content :ref="el => contentRefs[1] = el" :index="tabAct"
@gotoDetails="gotoDetails"></Content>
</swiper-item>
<swiper-item>
<Content :ref="el => contentRefs[2] = el" :index="tabAct" :searchText="searchText"
<Content :ref="el => contentRefs[2] = el" :index="tabAct"
@gotoDetails="gotoDetails"></Content>
</swiper-item>
</swiper>
@@ -72,7 +69,7 @@
} from '@/enum.js'
const contentRef = ref(null);
const tabAct = ref(0);
const searchText = ref('');
const tabList = ref([{
name: '全 部'
}, {
@@ -96,16 +93,15 @@
const swiperChange = (item) => {
tabAct.value = item.detail.current;
};
const search = () => {
if (searchText.value === '') return;
console.log('搜索', searchText.value);
const search = (value) => {
console.log('value', value);
contentRefs.value[tabAct.value]?.search(value);
}
const gotoDetails = (item) => {
setPageCache('testing_hall_details', item)
common.navigateTo('/pages/testingHall/details');
}
onMounted(() => {
triggered.value = true
watch(tabAct, (newValue, oldValue) => {
typeof contentRefs.value[newValue]?.getData === 'function' && contentRefs.value[newValue]
+9
View File
@@ -171,5 +171,14 @@
}
}
},
{
"path": "pages/examRanking/index",
"style": {
"navigationBarTitleText": "考试排行榜页",
"app-plus": {
"titleNView": false
}
}
}
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB