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-19 15:29:11 +08:00
66 changed files with 4218 additions and 984 deletions
+15 -1
View File
@@ -16,5 +16,19 @@ 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 = '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.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_TRASTUDY = 'http://25.64.16.130:9602'
>>>>>>> 05085e8e3e537d6cc35d677431086afd747b4eee
+10
View File
@@ -9,4 +9,14 @@ export const queryHotQuestionApi = (data) => {
method: 'post',
data
});
};
// 获取问答历史
// 问答反馈
export const insertTraAskFeedback = (data) => {
return request({
url: '/traask/traAskFeedback/insertTraAskFeedback',
method: 'post',
data
});
};
+29
View File
@@ -12,5 +12,34 @@ export const startTraExamPapersInfo = (data) => {
data
});
};
// 提交试卷
export const commitPaperExam = (data) => {
return request({
url: base_url + '/traExamPapers/commitPaperExam',
method: 'post',
toastErrors: true,
data
});
};
// 试卷考试查分
export const queryPaperExamScore = (data) => {
return request({
url: base_url + '/traExamPapers/queryPaperExamScore',
method: 'post',
toastErrors: true,
data
});
};
// ↓↓↓↓↓↓↓↓↓课程考试↓↓↓↓↓↓↓↓
export const startExamByCrs = (data) => {
return request({
url: base_url + '/traCrsPapers/startExamByCrs',
method: 'post',
toastErrors: true,
data
});
};
+49
View File
@@ -0,0 +1,49 @@
import request from '@/api/request'
const base_url = '/trastudy'
// 课程收藏分页查询
export const queryTraPersonalCollectionCrsPaging = (data) => {
return request({
url: base_url + '/traPersonalCollection/queryTraPersonalCollectionCrsPaging',
method: 'post',
toastErrors: true,
data
});
};
// 任务收藏分页查询
export const queryTraPersonalCollectionTaskPaging = (data) => {
return request({
url: base_url + '/traPersonalCollection/queryTraPersonalCollectionTaskPaging',
method: 'post',
toastErrors: true,
data
});
};
// 根据收藏ID删除收藏
export const deleteTraPersonalCollectionById = (data) => {
return request({
url: base_url + '/traPersonalCollection/deleteTraPersonalCollectionById',
method: 'post',
toastErrors: true,
data
});
};
/*
新增任务收藏
入参:
collectTyp 收藏类型 必须 String 01--课程,02--任务
collectBusId 收藏业务ID 必须 String
**/
export const insertTraPersonalCollectionTask = (data) => {
return request({
url: base_url + '/traPersonalCollection/insertTraPersonalCollectionTask',
method: 'post',
toastErrors: true,
data
});
};
+13
View File
@@ -0,0 +1,13 @@
import request from '@/api/request'
const base_url = '/trastudy'
// 查询所有、未完成、已完成的任务(分页)
export const queryAllTraTaskInfoByUserId = (data) => {
return request({
url: base_url + '/traTaskInfo/queryAllTraTaskInfoByUserId',
method: 'post',
toastErrors: true,
data
});
};
+34
View File
@@ -0,0 +1,34 @@
import request from '@/api/request'
const base_url = '/trastudy'
// 查询当前用户的所有消息通知 (分页)
export const queryTraPersonalMessageNoticePaging = (data) => {
return request({
url: base_url + '/traPersonalMessageNotice/queryTraPersonalMessageNoticePaging',
method: 'post',
toastErrors: true,
data
});
};
// 读取单一消息
export const readNotice = (data) => {
return request({
url: base_url + '/traPersonalMessageNotice/readNotice',
method: 'post',
toastErrors: true,
data
});
};
// 一键读取所有消息(不展示)
export const oneTimeRead = (data) => {
return request({
url: base_url + '/traPersonalMessageNotice/oneTimeRead',
method: 'post',
toastErrors: true,
data
});
};
+9 -7
View File
@@ -5,16 +5,16 @@ import common from '@/common/common.js'
const ENV = import.meta.env
export const get_base_url = url => {
export const get_base_url = (url = '') => {
if (ENV.MODE === 'development') { // 开发环境
// H5必须用非https,手机端必须用https
// #ifdef H5
return ENV.VITE_APP_BASE_H5_API_Url || ENV.VITE_APP_BASE_API_Url
const baseUrl = ENV.VITE_APP_BASE_API_Url
if (baseUrl.startsWith('https')) {
return baseUrl.replace('https', 'http')
if (url) {
let _str = (url.split('/')[0] || url.split('/')[1])?.toUpperCase()
return ENV[`VITE_APP_BASE_H5_API_Url_${_str}`] || ENV.VITE_APP_BASE_H5_API_Url || ENV.VITE_APP_BASE_API_Url
} else {
return ENV.VITE_APP_BASE_H5_API_Url || ENV.VITE_APP_BASE_API_Url
}
return baseUrl
// #endif
// #ifdef APP-PLUS
return ENV.VITE_APP_BASE_API_Url
@@ -50,7 +50,7 @@ export const goto_login_fun = (from = 'http') => {
} else {
common.navigateTo('/pages/login/login')
}
}).finally(() => {
no_login_show_modal_state = false
})
@@ -80,6 +80,8 @@ export default function request({
headers_base['summary'] = token // 让每个请求携带令牌
}
let that = this
return new Promise((resolve, reject) => {
uni.request({
url: `${baseUrl || base_url}${url}`,
+2 -1
View File
@@ -9,4 +9,5 @@ export const queryTraExamPapersPage = (data) => {
method: 'post',
data
});
};
};
+22
View File
@@ -0,0 +1,22 @@
import request from '@/api/request'
const base_url = '/traexam'
// 错题本列表页
export const queryTraMistakesCollectionPaging = (data) => {
return request({
url: base_url + '/traMistakesCollection/queryTraMistakesCollectionPaging',
method: 'post',
toastErrors: true,
data
});
};
// 错题订正
export const mistakesCorrect = (data) => {
return request({
url: base_url + '/traMistakesCollection/mistakesCorrect',
method: 'post',
toastErrors: true,
data
});
};
+17 -3
View File
@@ -5,9 +5,9 @@ export const optionSuccessIcon = (color : string) : string => {
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgXml)}`;
};
export const optionErrorIcon = () : string => {
export const optionErrorIcon = (color: string='#F5212D') : string => {
const svgXml = `
<svg t="1754619171929" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6505" width="64" height="64"><path d="M910.336 186.368l-72.704-72.704L512 439.808 186.368 113.664 113.664 186.368 439.808 512l-326.144 325.632 72.704 72.704L512 584.192l325.632 326.144 72.704-72.704L584.192 512l326.144-325.632z" fill="#F5212D" p-id="6506"></path></svg>
<svg t="1754619171929" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6505" width="64" height="64"><path d="M910.336 186.368l-72.704-72.704L512 439.808 186.368 113.664 113.664 186.368 439.808 512l-326.144 325.632 72.704 72.704L512 584.192l325.632 326.144 72.704-72.704L584.192 512l326.144-325.632z" fill="${color}" p-id="6506"></path></svg>
`.trim();
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgXml)}`;
};
@@ -17,4 +17,18 @@ export const examinationSheetIcon = () : string => {
<svg t="1754630871725" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6324" width="64" height="64"><path d="M802.107077 51.2a145.289846 145.289846 0 0 1 145.092923 145.526154v630.547692a145.289846 145.289846 0 0 1-145.092923 145.526154H221.892923a145.329231 145.329231 0 0 1-145.092923-145.526154V196.726154A145.289846 145.289846 0 0 1 221.892923 51.2h580.214154z m-3.387077 76.8H225.28a71.837538 71.837538 0 0 0-71.561846 67.741538l-0.118154 4.253539v624.009846a71.837538 71.837538 0 0 0 67.465846 71.876923l4.214154 0.118154h573.44c38.203077 0 69.356308-29.932308 71.561846-67.741538l0.118154-4.253539V200.034462a71.876923 71.876923 0 0 0-67.465846-71.876924l-4.214154-0.157538zM729.6 512a38.4 38.4 0 1 1 0 76.8h-230.4a38.4 38.4 0 1 1 0-76.8h230.4z m-384 0a38.4 38.4 0 1 1 0 76.8h-51.2a38.4 38.4 0 1 1 0-76.8h51.2z m384-204.8a38.4 38.4 0 1 1 0 76.8h-230.4a38.4 38.4 0 1 1 0-76.8h230.4z m-384 0a38.4 38.4 0 1 1 0 76.8h-51.2a38.4 38.4 0 0 1 0-76.8h51.2z" p-id="6325"></path></svg>
`.trim();
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgXml)}`;
};
};
export const markIcon = (color: string='#ABABAB') : string => {
const svgXml = `
<svg t="1754987745092" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13983" width="64" height="64"><path d="M693.01933598 59.45166004c-24.99339629-24.99339629-65.5162717-24.99339629-90.50966799 0-24.99339629 24.99339629-24.99339629 65.5162717 0 90.50966799l22.627417 22.627417-181.19328425 181.19328425c-78.50370195-71.13564929-199.8637317-68.83684515-275.5976964 6.89711955l-33.94112549 33.94112549a8 8 0 0 0 0 11.3137085l208.59650045 208.59650045-175.36248174 175.36248174a8 8 0 0 0 0 11.3137085l56.5685425 56.56854249a8 8 0 0 0 11.3137085 0L410.88373029 682.41273427l208.59650045 208.59650045a8 8 0 0 0 11.3137085 0l33.9411255-33.9411255c76.21055466-76.21055466 78.05893179-198.62346641 5.54583848-277.07484246L851.41125497 398.86291501l22.627417 22.627417c24.99339629 24.99339629 65.5162717 24.99339629 90.50966799 0 24.99339629-24.99339629 24.99339629-65.5162717 0-90.50966799L693.01933598 59.45166004z" fill="${color}" p-id="13984"></path></svg>
`.trim();
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgXml)}`;
};
export const feedbackIcon = () : string => {
const svgXml = `
<svg t="1754962550365" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6478" width="64" height="64"><path d="M512 853.333333C323.4816 853.333333 170.666667 700.5184 170.666667 512S323.4816 170.666667 512 170.666667s341.333333 152.814933 341.333333 341.333333-152.814933 341.333333-341.333333 341.333333z m0-51.2a290.133333 290.133333 0 1 0 0-580.266666 290.133333 290.133333 0 0 0 0 580.266666z m-25.6-429.738666a25.6 25.6 0 1 1 51.2 0v248.2176a25.6 25.6 0 0 1-51.2 0v-248.251734zM512 729.1904a31.061333 31.061333 0 1 1 0-62.088533 31.061333 31.061333 0 0 1 0 62.088533z" fill="#999999" p-id="6479"></path></svg>
`.trim();
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgXml)}`;
};
@@ -11,6 +11,10 @@
</view>
<view class="right">
<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>
</view>
<!-- <view class="right_text">展开</view>
<uv-icon class="arrow-icon" name="arrow-right"></uv-icon> -->
</view>
@@ -21,7 +25,6 @@
<view class="option_div">
<questionVue @changePlay="changePlay" :dataInfo="talkingInfo" :activeVoiceId="questionValue"></questionVue>
</view>
</view>
</template>
<script setup>
@@ -36,6 +39,9 @@
} from 'vue'
import questionVue from './question.vue';
import radioSubjectItem from './radio-subject-item.vue'
import {
markIcon,feedbackIcon
} from '@/common/imgSvg'
import {
SUBJECT_TYPE
} from '@/enum.js'
@@ -59,10 +65,10 @@
},
});
const emit = defineEmits(['subject_click'])
const talkingInfo = ref({
id: '3',
intrctWay: "",
intrctWay: "02",
intrctContent: "中的i id一二三。",
talkingText: '中的i id一二三。',
talkingVoice: ''
@@ -79,11 +85,12 @@
}
}
})
// "chatId": "CHAT025018122068202508081709060000000000000000000000000000000098",
// "fileId": "S3F0250181220722025080817090600000476885",
// "ossFileAddr": "http://25.18.122.66::9786/traoss/show//S3F0250181220722025080817090600000476885",
// "transContent": "一二三四。"
// const activeVoiceId = ref()
const feedback_click = () =>{
emit('subject_click', 'feedback', props.item)
}
const mark_click = () =>{
emit('subject_click', 'mark', props.item)
}
const customStyle = {
borderRadius: '16rpx',
@@ -91,9 +98,7 @@
backgroundColor: '#0066FF',
border: '1rpx solid rgb(12, 123, 245)',
}
const emit = defineEmits(['click_option'])
const subject_data = reactive({
qnsId: '',
qnsContent: '',
@@ -114,6 +119,18 @@
</script>
<style scoped lang="scss">
.mark_and_feedback_div{
display: flex;
height: 100%;
justify-content: end;
align-items: center;
.img{
width: 38rpx;
height: 38rpx;
margin-left: 4rpx;
padding: 4rpx;
}
}
.option_div {
padding-top: 46rpx;
+99 -73
View File
@@ -1,7 +1,7 @@
<template>
<view class="talking-info" v-if="dataInfo.intrctWay === '02'">
<view :class="['talking-gif', !voiceLoading&&(props.activeVoiceId === dataInfo.id) ? 'is-play' : '']">
<CommonLoading color="#fff" v-show="voiceLoading"/>
<view class="talking-info" v-if="intrctWay === '02'">
<view :class="['talking-gif', (props.activeVoiceId === dataInfo.id) ? 'is-play' : '']">
<CommonLoading color="#fff" v-show="voiceLoading" />
</view>
<view class="right-time">{{voiceTime}}</view>
<view class="talking-cont">
@@ -9,141 +9,151 @@
{{ showContent }}
</text>
<view class="talking-text translate-text" v-if="translateLoading">
<CommonLoading color="#fff"/>
<CommonLoading color="#fff" />
</view>
</view>
<view class="btns-cont">
<view class="play-btn">
<image class="icon"
v-show="!(!voiceLoading&&(props.activeVoiceId === dataInfo.id))"
@click="playVoice"
src="@/static/images/course/play-blue.png"
style="width: 100%;height: 100%;"
></image>
<image class="icon"
v-show="!voiceLoading&&(props.activeVoiceId === dataInfo.id)"
@click.stop="pauseVoice"
src="@/static/images/course/stop-blue.png"
style="width: 100%;height: 100%;"
></image>
<!-- <view class="icon text-btn" v-if="type === 1" @click.stop="translateVoice(dataInfo)"></view> -->
<image class="icon" v-show="!(props.activeVoiceId === dataInfo.id)" @click="playVoice"
src="@/static/images/course/play-blue.png" style="width: 100%;height: 100%;"></image>
<image class="icon" v-show="props.activeVoiceId === dataInfo.id"
@click.stop="pauseVoice" src="@/static/images/course/stop-blue.png"
style="width: 100%;height: 100%;"></image>
<!-- <view class="icon text-btn" v-if="type === 1" @click.stop="translateVoice(dataInfo)"></view> -->
</view>
</view>
</view>
<view class="talking-info talking-info-text" v-else-if="dataInfo.intrctWay === '01'">
<!-- 01纯文字 -->
<view class="talking-info talking-info-text" v-else-if="intrctWay === '01'">
<view class="talking-cont">
<text :class="['talking-text translate-text loading']">
{{ showContent }}
</text>
</view>
</view>
<view class="talking-info talking-info-loading" v-else>
<view class="talking-info talking-info-loading" v-else>
<view :class="['talking-gif']">
<CommonLoading color="#fff"/>
<CommonLoading color="#fff" />
</view>
</view>
</template>
<script setup>
import { computed, unref, ref, toRefs, watch, onMounted } from "vue"
import { onUnload } from '@dcloudio/uni-app';
const props = defineProps({
import {
computed,
unref,
ref,
toRefs,
watch,
onMounted
} from "vue"
import {
onUnload
} from '@dcloudio/uni-app';
const props = defineProps({
dataInfo: {
default: () => ({}),
type: Object
},
activeVoiceId:{
default:'',
activeVoiceId: {
default: '',
type: String
},
})
const { activeVoiceId, dataInfo } = toRefs(props)
const {
activeVoiceId,
dataInfo
} = toRefs(props)
const intrctWay = ref('02')
const emit = defineEmits(['changePlay'])
watch(() => props.dataInfo, () => {},{deep: true,immediate: true})
watch(() => props.dataInfo, () => {}, {
deep: true,
immediate: true
})
// 声音播放初始化
const talkVoiceObj = ref(null)
const isPlaying = ref(false)
const voiceLoading = ref(false)
const translateLoading = ref(false)
const voiceTime = ref('')
const itemVoice = ref('')
const showContent = computed(()=>{
const showContent = computed(() => {
return dataInfo.value.talkingText || ''
})
onMounted(()=>{
onMounted(() => {
initVoice()
})
onUnload(()=>{
onUnload(() => {
pauseVoice()
})
watch(() => props.dataInfo.talkingVoice,(val)=>{
if(val){
watch(() => props.dataInfo.talkingVoice, (val) => {
if (val) {
initVoice()
}
},{
}, {
deep: true,
immediate: true
})
const pauseVoice = () => {
if(!talkVoiceObj.value) return
if (!talkVoiceObj.value) return
talkVoiceObj.value.pause()
isPlaying.value = false
emit('changePlay', '')
}
const playVoice = () =>{
const playVoice = () => {
emit('changePlay', unref(dataInfo)?.id)
if(talkVoiceObj.value && talkVoiceObj.value.src) {
talkVoiceObj.value.play()
if (talkVoiceObj.value && talkVoiceObj.value.src) {
talkVoiceObj.value.play()
return
}else{
} else {
talkVoiceObj.value.src = ''
if(unref(dataInfo).talkingVoice){
setTimeout(()=>{
if (unref(dataInfo).talkingVoice) {
setTimeout(() => {
talkVoiceObj.value.src = unref(dataInfo).talkingVoice
talkVoiceObj.value.play()
isPlaying.value = true
},100)
}, 100)
}
}
}
const initVoice = () => {
talkVoiceObj.value = uni.createInnerAudioContext()
talkVoiceObj.value.onEnded(()=>{
talkVoiceObj.value.onEnded(() => {
emit('changePlay', '')
talkVoiceObj.value.src = ''
})
talkVoiceObj.value.onError(()=>{
talkVoiceObj.value.onError(() => {
talkVoiceObj.value.src = ''
})
if(unref(dataInfo).intrctWay === '02'){
if (unref(dataInfo).intrctWay === '02') {
itemVoice.value = unref(dataInfo).talkingVoice
talkVoiceObj.value.src = itemVoice.value
console.log(talkVoiceObj.value.src,1111)
setTimeout(()=>{
setTimeout(() => {
setVoiceTime(0)
},100)
}, 100)
}
}
const setVoiceTime = (sum) => {
sum += 1
if(Math.ceil(talkVoiceObj.value.duration)>0){
voiceTime.value = (Math.ceil(talkVoiceObj.value.duration) || 1 ) + 's'
}else{
if(sum === 20) {
if (Math.ceil(talkVoiceObj.value.duration) > 0) {
voiceTime.value = (Math.ceil(talkVoiceObj.value.duration) || 1) + 's'
} else {
if (sum === 20) {
voiceTime.value = 0 + 's'
return
}
setTimeout(()=>{
setTimeout(() => {
setVoiceTime(sum)
},200)
}, 200)
}
}
</script>
<style scoped lang="scss">
.talking-info{
.talking-info {
padding: 20rpx;
border-radius: 15rpx;
background-color: #06f;
@@ -152,18 +162,21 @@ import { onUnload } from '@dcloudio/uni-app';
color: #fff;
width: 100%;
float: right;
.talking-gif{
.talking-gif {
width: 200rpx;
height: 38rpx;
background: url(@/static/images/course/voice-gray.png) no-repeat;
background-size: contain;
padding-left: 168rpx;
&.is-play{
&.is-play {
background: url(@/static/images/course/voice-white.gif) no-repeat;
background-size: contain;
}
}
.right-time{
.right-time {
position: absolute;
right: 20rpx;
top: 20rpx;
@@ -171,37 +184,45 @@ import { onUnload } from '@dcloudio/uni-app';
height: 38rpx;
line-height: 38rpx;
}
&.talking-info-loading{
&.talking-info-loading {
padding-bottom: 20rpx;
}
&.talking-info-text{
&.talking-info-text {
padding-bottom: 20rpx;
width: auto;
float: right;
.talking-cont{
.talking-cont {
margin-top: 0rpx;
}
}
.talking-cont{
.talking-cont {
margin-top: 16rpx;
overflow: hidden;
.talking-text{
.talking-text {
font-size: 28rpx;
line-height: 48rpx;
margin-bottom: 20rpx;
word-break: break-all;
white-space: pre-line;
overflow: hidden;
&.translate-text{
&.translate-text {
min-height: 48rpx;
}
}
}
.btns-cont{
.btns-cont {
overflow: hidden;
border-top: 3rpx solid #eee;
.replay-btn{
.replay-btn {
float: left;
width: 46rpx;
height: 46rpx;
@@ -209,7 +230,8 @@ import { onUnload } from '@dcloudio/uni-app';
margin-right: 16rpx;
margin-top: 25rpx;
}
.play-btn{
.play-btn {
float: left;
width: 46rpx;
height: 46rpx;
@@ -217,7 +239,8 @@ import { onUnload } from '@dcloudio/uni-app';
margin-right: 16rpx;
margin-top: 25rpx;
}
.text-btn{
.text-btn {
float: left;
width: 46rpx;
height: 46rpx;
@@ -232,7 +255,8 @@ import { onUnload } from '@dcloudio/uni-app';
font-weight: bold;
border-radius: 20rpx;
}
.text-right-btn{
.text-right-btn {
float: right;
padding: 0 10rpx;
height: 46rpx;
@@ -242,7 +266,8 @@ import { onUnload } from '@dcloudio/uni-app';
margin-left: 16rpx;
margin-top: 25rpx;
}
.next-btn{
.next-btn {
float: right;
padding: 0 60rpx 0 20rpx;
height: 62rpx;
@@ -253,7 +278,8 @@ import { onUnload } from '@dcloudio/uni-app';
border-radius: 8rpx;
margin-top: 16rpx;
position: relative;
.icon-iamge{
.icon-iamge {
width: 25rpx;
height: 25rpx;
position: absolute;
@@ -64,7 +64,6 @@
})
const click_option = () => {
console.log('props.analysisVo.itemId', props.analysisVo.itemId);
emit('click_option', props.analysisVo)
}
+32 -11
View File
@@ -11,6 +11,10 @@
</view>
<view class="right">
<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>
</view>
<!-- <view class="right_text">展开</view>
<uv-icon class="arrow-icon" name="arrow-right"></uv-icon> -->
</view>
@@ -39,6 +43,9 @@
toRaw
} from 'vue'
import radioSubjectItem from './radio-subject-item.vue'
import {
markIcon,feedbackIcon
} from '@/common/imgSvg'
import {
SUBJECT_TYPE
} from '@/enum.js'
@@ -48,7 +55,7 @@
backgroundColor: '#0066FF',
border: '1rpx solid rgb(12, 123, 245)',
}
const emit = defineEmits(['click_option'])
const emit = defineEmits(['subject_click'])
const props = defineProps({
item: {
type: Object,
@@ -59,7 +66,14 @@
required: true,
}
});
const feedback_click = () =>{
emit('subject_click', 'feedback', props.item)
}
const mark_click = () =>{
emit('subject_click', 'mark', props.item)
}
const subject_data = reactive({
qnsId: '',
qnsContent: '',
@@ -80,11 +94,8 @@
const subject_type_text = computed(() => SUBJECT_TYPE.find(res => subject_data.qnsTyp === res.value)?.label || '')
// 点击答题
const click_option = (analysisVo) => {
// emit('click_option', props.item.qnsId, analysisVo)
// // 无论什么类型如果表里已经有了,再次点击就是弹出
if (props.item.my_answer.includes(analysisVo.itemId)) {
// console.log('无论什么类型如果表里已经有了,再次点击就是弹出', analysisVo.itemId);
props.item.my_answer = props.item.my_answer.filter(id => id !== analysisVo.itemId);
}
else if (props.item.qnsTyp === 'SN') { // 单选
@@ -102,6 +113,18 @@
</script>
<style scoped lang="scss">
.mark_and_feedback_div{
display: flex;
height: 100%;
justify-content: end;
align-items: center;
.img{
width: 38rpx;
height: 38rpx;
margin-left: 4rpx;
padding: 4rpx;
}
}
.option_div_button{
width: 100%;
height: 84rpx;
@@ -117,11 +140,10 @@
display: flex;
flex-direction: column;
padding-bottom: 40rpx;
.top {
display: flex;
align-items: center;
.type {
width: 108rpx;
height: 46rpx;
@@ -146,20 +168,19 @@
.right {
display: flex;
align-items: center;
.right_text {
font-family: PingFangSC;
font-weight: 600;
font-size: 28rpx;
color: #333;
line-height: 40rpx;
text-align: left;
font-style: normal;
}
}
}
.question_text {
font-family: PingFangSC;
font-weight: 500;
+412
View File
@@ -0,0 +1,412 @@
<template>
<view class="talk-btns">
<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>
</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 && !!inputText" src="@/static/images/course/send.png"
mode="" @click.stop="showKeyboard"></image>
</view>
<uni-popup ref="popupRef" class="popup">
<view class="overlay-box">
<view class="circle-bg-box">
<view class="icon-box">
<image src="@/static/images/course/talk-icon.png"></image>
</view>
</view>
<view class="tips-box">松开发送</view>
<view class="btns-box">
<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':'']">
<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 common from '@/common/common';
import permission from '@/common/permission.js'
import {
getPhoneEnvBool
} from '@/common/common.js'
const emit = defineEmits(['submit'])
const props = defineProps({
isDisabled: {
default: true,
type: Boolean
},
isLoading: {
default: false,
type: Boolean
},
loadingText: {
default: '发送回答中,请稍后再试!',
type: String
},
canAnswer: {
default: true,
type: Boolean
},
canAnswerText: {
default: '当前状态不能发送内容!',
type: String
},
textValueLength: {
type: Number,
default: 500
},
minRecordDuration: { // 最小录音间隔
type: Number,
default: 1000
},
})
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('')
let startTime = 0;
// not_started 未开始, preparing 准备中, in_recording 录音中,ending 结束中
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) => { // 开始录音
console.log('开始录音', recordingStatus.value);
if (recordingStatus.value !== 'not_started') return;
touchY.value = obj.changedTouches[0].pageY
startTimer.value = setTimeout(() => {
console.log('延迟开始');
recordingStatus.value = 'preparing'
isMoving.value = true
recorderManager.start();
}, 80);
}
// 结束录音
const stopRecord = (obj) => {
console.log('结束录音', obj);
if (startTimer.value) {
clearTimeout(startTimer.value);
startTimer.value = null;
}
recorderManager.stop();
popupRef.value.close()
nextTick(() => {
setTimeout(() => {
recordingStatus.value = 'not_started'
}, 300)
})
}
onMounted(async () => {
recorderManager.onStop(function(res) {
console.log('recorder stop' + JSON.stringify(res));
console.log('录音文件临时位置', res.tempFilePath);
if (isOut) return; // 被划掉的语音
const endTime = Date.now();
const recordDuration = (endTime - startTime);
if (props.minRecordDuration > recordDuration) {
return common.msg('说话时间太短,没有听清!')
}
console.log('录音结束,时长:', recordDuration, '秒');
emit('submit', 'voice', res.tempFilePath)
});
recorderManager.onStart(function(res) {
// 检测是否已经抬手结束了
console.log('检测是否已经抬手结束了', recordingStatus.value);
if (recordingStatus.value !== 'preparing') {
stopRecord()
}
startTime = Date.now();
popupRef.value.open()
recordingStatus.value = 'in_recording'
});
})
const touchY = ref(0)
const windowInfo = uni.getWindowInfo()
// 安全区域信息
const safeArea = windowInfo.safeArea;
// 计算是否超出按下盒子位置
const isOut = computed(() => {
const btnHeight = windowInfo.screenWidth / 750 * 234;
return touchY.value < safeArea.bottom - btnHeight;
});
const activeNum = ref(1)
const isMoving = ref(false)
const handleMove = (obj) => {
touchY.value = obj.changedTouches[0].pageY
}
// 发送文本
const showKeyboard = () => {
if (keyboardIsShow.value) {
const inputTextTram = inputText.value.trim()
if (inputTextTram) {
emit('submit', 'text', inputTextTram)
} else {
common.msg("不能发送空白消息!")
}
} else {
keyboardIsShow.value = !keyboardIsShow.value
}
}
// 切换键盘语音
const changeBtn = () => {
if (props.isDisabled) return
keyboardIsShow.value = !keyboardIsShow.value
inputText.value = ''
}
</script>
<style lang="scss" scoped>
.talk-btns {
height: 150rpx;
background-color: #fff;
padding: 25rpx 30rpx 0;
position: relative;
.touch-btn {
height: 92rpx;
box-shadow: 0 8rpx 20rpx 0 rgba(0, 0, 0, .06);
text-align: center;
line-height: 92rpx;
color: #000;
font-weight: 400;
position: relative;
.input-box {
width: 100%;
height: 92rpx;
line-height: 92rpx;
text-align: left;
box-sizing: border-box;
padding: 0 40rpx 0 40rpx;
}
}
.talk-btn-box {
position: absolute;
height: 100%;
width: 120rpx;
right: 0;
top: 0;
.talk-btn-icon {
width: 40rpx;
height: 40rpx;
position: absolute;
right: 60rpx;
top: 50%;
margin-top: -20rpx;
}
}
}
.overlay-box {
display: flex;
flex-direction: column-reverse;
// justify-content: flex-end;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.9);
.circle-bg-box {
height: 234rpx;
background: url(@/static/images/course/talking.png) no-repeat;
background-size: cover;
position: relative;
.icon-box {
position: absolute;
left: 50%;
top: 50%;
margin-left: -17rpx;
margin-top: -24rpx;
width: 34rpx;
height: 48rpx;
image {
width: 100%;
height: 100%;
}
}
}
.tips-box {
height: 40rpx;
line-height: 40rpx;
color: #c0c0c0;
text-align: center;
margin: 12rpx 0 24rpx;
}
.btns-box {
height: 270rpx;
// padding: 0 120rpx;
width: 154rpx;
margin: 0 auto 100rpx;
overflow: hidden;
font-size: 28rpx;
text-align: center;
line-height: 116rpx;
.close-btn {
float: left;
height: 100%;
width: 154rpx;
overflow: hidden;
color: #999;
&.is-out {
color: #fff;
}
}
.translate-btn {
float: right;
height: 100%;
width: 154rpx;
overflow: hidden;
color: #999;
}
.btn-box {
width: 100%;
height: 154rpx;
}
}
.talk-dialog {
width: 506rpx;
height: 234rpx;
margin: 0 auto;
background-color: #06f;
border-radius: 32rpx;
position: relative;
&.is-out {
background-color: #ff3e49;
&::after {
background-color: #ff3e49;
}
}
.gif-box {
position: absolute;
width: 200rpx;
height: 80rpx;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
&::after {
content: '';
width: 44rpx;
height: 44rpx;
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
background-color: #06f;
overflow: hidden;
position: absolute;
bottom: -22rpx;
left: 50%;
margin-left: -22rpx;
}
}
.white-bg-box {
height: 365rpx;
background-color: #fff;
overflow: hidden;
border-radius: 32rpx 32rpx 0 0;
padding: 58rpx 36rpx;
.box-title {
font-size: 32rpx;
font-weight: bold;
line-height: 46rpx;
margin-bottom: 46rpx;
}
.box-btns {
height: 46rpx;
line-height: 46rpx;
display: flex;
justify-content: space-between;
color: #999;
.is-active {
color: #06f;
}
}
}
}
::v-deep .uv-input__content__field-wrapper__field {
padding-right: 60rpx;
}
</style>
+27
View File
@@ -199,6 +199,15 @@
}
}
},
{
"path": "pages/examination/result",
"style": {
"navigationBarTitleText": "考试结果",
"app-plus": {
"titleNView": false
}
}
},
{
"path": "pages/practice/index",
"style": {
@@ -208,6 +217,24 @@
}
}
},
{
"path": "pages/learningTasks/index",
"style": {
"navigationBarTitleText": "学习任务",
"app-plus": {
"titleNView": false
}
}
},
{
"path": "pages/learningTasks/details",
"style": {
"navigationBarTitleText": "学习详情",
"app-plus": {
"titleNView": false
}
}
},
{
"path": "pages/course/index",
"style": {
@@ -32,6 +32,9 @@
<ChartThree v-if="dataInfo.evalDimens.length === 3" :dataList="dataInfo.evalDimens" :score="dataInfo.intrctGrade"/>
<ChartFive v-if="dataInfo.evalDimens.length === 5" :dataList="dataInfo.evalDimens" :score="dataInfo.intrctGrade"/>
</view>
<view v-if="type === 3 && dataInfo.knoExampie " style="overflow: hidden;">
举例{{ dataInfo.knoExampie }}
</view>
</view>
<view class="btns-cont" v-show="!dataInfo.isLoading">
<view class="replay-btn" @click.stop="restartPlay" v-if="!([5].indexOf(type) >= 0)">
+384 -334
View File
@@ -1,24 +1,20 @@
<template>
<view class="talk-btns" ref="talkBtnRef">
<view
class="touch-btn"
@touchstart="getRecordPermission"
@touchend="hideOverlayTalking"
@touchmove="handleMove"
v-if="!keyboardIsShow"
>按住说话
<view class="touch-btn" @touchstart="getRecordPermission" @touchend="hideOverlayTalking" @touchmove="handleMove"
v-if="!keyboardIsShow">按住说话
</view>
<view class="touch-btn" v-if="keyboardIsShow">
<uv-input class="input-box" ref="inputRef" v-model="answerValue" :maxlength="props.textValueLength" :adjustPosition="false"
placeholderStyle='color:#999999;font-size:26rpx' placeholder="请输入文字">
<uv-input class="input-box" ref="inputRef" v-model="answerValue" :maxlength="props.textValueLength"
:adjustPosition="false" placeholderStyle='color:#999999;font-size:26rpx' placeholder="请输入文字">
</uv-input>
</view>
<view class="talk-btn-box" v-show="!onlyVoice">
<image class="talk-btn-icon" v-show="!keyboardIsShow" src="/src/static/images/course/jianpan.png" mode="" @click="changeBtn"></image>
<image class="talk-btn-icon" v-show="keyboardIsShow && !answerValue" src="/src/static/images/course/record.png" mode="" @click="changeBtn"></image>
<image class="talk-btn-icon" v-show="keyboardIsShow && !!answerValue" src="/src/static/images/course/send.png" mode=""
@click.stop="showKeyboard"
></image>
<image class="talk-btn-icon" v-show="!keyboardIsShow" src="/src/static/images/course/jianpan.png" mode=""
@click="changeBtn"></image>
<image class="talk-btn-icon" v-show="keyboardIsShow && !answerValue" src="/src/static/images/course/record.png"
mode="" @click="changeBtn"></image>
<image class="talk-btn-icon" v-show="keyboardIsShow && !!answerValue" src="/src/static/images/course/send.png"
mode="" @click.stop="showKeyboard"></image>
</view>
<uv-overlay :show="showTalkingModel" opacity=".9" @click="showTalkingModel = false">
<view class="overlay-box">
@@ -29,7 +25,7 @@
</view>
<view class="tips-box">松开发送</view>
<view class="btns-box">
<view :class="['close-btn',isOut?'is-out':'']" >取消
<view :class="['close-btn',isOut?'is-out':'']">取消
<image class="btn-box" v-if="!isOut" src="/src/static/images/course/close.png" mode=""></image>
<image class="btn-box" v-else src="/src/static/images/course/close-active.png" mode=""></image>
</view>
@@ -40,348 +36,383 @@
</view>
</uv-overlay>
</view>
</template>
<script setup>
import { toRefs, ref, computed, unref, onMounted, onUnmounted, nextTick, watch, getCurrentInstance } from 'vue';
import common from '../../../common/common';
import permission from '@/common/permission.js'
import { getPhoneEnvBool } from '@/common/common.js'
const proxy = getCurrentInstance()
const emit = defineEmits(['uploadVoice', 'submitAnswer','startRecord'])
const props = defineProps({
isDisabled:{
default: true,
type: Boolean
},
isLoading:{
default: false,
type: Boolean
},
loadingText:{
default: '发送回答中,请稍后再试!',
type: String
},
onlyVoice:{
default: false,
type: Boolean
},
canAnswer:{
default: true,
type: Boolean
},
canAnswerText:{
default: '当前状态不能发送内容',
type: String
},
textValueLength:{
type: Number,
default: 500
}
})
const { isDisabled, onlyVoice } = toRefs(props)
const isLoadingState = computed(() => props.isLoading)
const showTalkingModel = ref(false)
const keyboardIsShow = ref(false)
watch(()=>props.isLoading,()=>{},{
deep:true,immediate:true
})
watch(()=>props.canAnswer,()=>{},{
deep:true,immediate:true
})
watch(()=>props.onlyVoice,()=>{},{
deep:true,immediate:true
})
watch(()=>props.isDisabled,(val)=>{
if(val){
keyboardIsShow.value = false
}
},{
deep:true,immediate:true
})
const answerValue = ref('')
const talkBtnRef = ref()
// 录音
const audioPath = ref('')
const audioObj = uni.createInnerAudioContext()
//#ifdef APP-PLUS
// app端
const recordObjCom = ref({})
const IsAndEnv = getPhoneEnvBool('AND')
const isStartNum = ref(0)
const isStopNum = ref(0)
const initRecord = () => {
recordObjCom.value = uni.getRecorderManager()
unref(recordObjCom)?.onStop((res, duration)=>{
audioPath.value = res.tempFilePath
if(!isOut.value){
if(startFlag.value !== 2){
// setTimeout(() => {
// showTalkingModel.value = false
// nextTick(() => {
// // showTalkingModel.value = false
// common.msg('说话时间太短,没有听清!')
// })
// },100)
closeModel(()=>{
nextTick(() => {
// showTalkingModel.value = false
common.msg('说话时间太短,没有听清!')
})
})
}else{
closeModel()
emit('uploadVoice', audioPath.value)
}
}else{
closeModel()
import {
toRefs,
ref,
computed,
unref,
onMounted,
onUnmounted,
nextTick,
watch,
getCurrentInstance
} from 'vue';
import common from '../../../common/common';
import permission from '@/common/permission.js'
import {
getPhoneEnvBool
} from '@/common/common.js'
const proxy = getCurrentInstance()
const emit = defineEmits(['uploadVoice', 'submitAnswer', 'startRecord'])
const props = defineProps({
isDisabled: {
default: true,
type: Boolean
},
isLoading: {
default: false,
type: Boolean
},
loadingText: {
default: '发送回答中,请稍后再试',
type: String
},
onlyVoice: {
default: false,
type: Boolean
},
canAnswer: {
default: true,
type: Boolean
},
canAnswerText: {
default: '当前状态不能发送内容!',
type: String
},
textValueLength: {
type: Number,
default: 500
}
})
unref(recordObjCom).onStart(() => {
startFlag.value = 1
setTimeout(()=>{
startFlag.value = 2
},1000)
let _recordPerm = uni.getAppAuthorizeSetting()
let _state = _recordPerm.microphoneAuthorized
if(_state === 'authorized'){
if(isStopNum.value === isStartNum.value){
stopRecord()
}else{
showTalkingModel.value = true
}
}
})
}
const startFlag = ref(1)
// const canStart = ref(true)
const startRecord = () => {
isStartNum.value += 1
unref(recordObjCom).start({format:'mp3'})
}
const {
isDisabled,
onlyVoice
} = toRefs(props)
const isLoadingState = computed(() => props.isLoading)
const stopRecord = () => {
isStopNum.value = isStartNum.value
try{
if(unref(recordObjCom).stop){
unref(recordObjCom).stop()
}else{
closeModel()
const showTalkingModel = ref(false)
const keyboardIsShow = ref(false)
watch(() => props.isLoading, () => {}, {
deep: true,
immediate: true
})
watch(() => props.canAnswer, () => {}, {
deep: true,
immediate: true
})
watch(() => props.onlyVoice, () => {}, {
deep: true,
immediate: true
})
watch(() => props.isDisabled, (val) => {
if (val) {
keyboardIsShow.value = false
}
}catch{
closeModel()
}
// setTimeout(() => {
// canStart.value = true
// }, 1000)
}
const closeModel = (cb = () => {}) => {
isStopNum.value = isStartNum.value
setTimeout(() => {
showTalkingModel.value = false
cb && cb()
}, 350)
}
// #endif
//#ifndef APP-PLUS
const recordObjCom = ref({})
const initRecord = () => {}
// #endif
onMounted(async ()=>{
initRecord?.()
}, {
deep: true,
immediate: true
})
const answerValue = ref('')
const talkBtnRef = ref()
// 录音
const audioPath = ref('')
const audioObj = uni.createInnerAudioContext()
//#ifdef APP-PLUS
// 安卓
if(IsAndEnv){
let _recordPerm = await permission.requestAndroidPermission('android.permission.RECORD_AUDIO')
if(_recordPerm !== 1){
common.show('提示信息', '当前页面需要使用的录音权限,是否前往开启?',true, '取消','确定').then((res) => {
if(res) {
// 去开启权限
permission.gotoAppPermissionSetting()
}else{
// 取消
common.navigateBack()
}
})
// app
const recordObjCom = ref({})
const IsAndEnv = getPhoneEnvBool('AND')
const isStartNum = ref(0)
const isStopNum = ref(0)
const initRecord = () => {
recordObjCom.value = uni.getRecorderManager()
unref(recordObjCom)?.onStop((res, duration) => {
audioPath.value = res.tempFilePath
if (!isOut.value) {
if (startFlag.value !== 2) {
// setTimeout(() => {
// showTalkingModel.value = false
// nextTick(() => {
// // showTalkingModel.value = false
// common.msg('说话时间太短,没有听清!')
// })
// },100)
closeModel(() => {
nextTick(() => {
// showTalkingModel.value = false
common.msg('说话时间太短,没有听清!')
})
})
} else {
closeModel()
emit('uploadVoice', audioPath.value)
}
} else {
closeModel()
}
}else{
})
unref(recordObjCom).onStart(() => {
startFlag.value = 1
setTimeout(() => {
startFlag.value = 2
}, 1000)
let _recordPerm = uni.getAppAuthorizeSetting()
let _state = _recordPerm.microphoneAuthorized
if(_state === 'denied'){
common.show('提示信息', '当前页面需要使用的录音权限,是否前往开启?',true, '取消','确定').then((res) => {
if(res) {
console.log(isStopNum.value === isStartNum.value, _state)
if (_state === 'authorized') {
if (isStopNum.value === isStartNum.value) {
stopRecord()
} else {
showTalkingModel.value = true
}
}
})
}
const startFlag = ref(1)
// const canStart = ref(true)
const startRecord = () => {
isStartNum.value += 1
unref(recordObjCom).start({
format: 'mp3'
})
}
const stopRecord = () => {
isStopNum.value = isStartNum.value
try {
if (unref(recordObjCom).stop) {
unref(recordObjCom).stop()
} else {
closeModel()
}
} catch {
closeModel()
}
// setTimeout(() => {
// canStart.value = true
// }, 1000)
}
const closeModel = (cb = () => {}) => {
isStopNum.value = isStartNum.value
setTimeout(() => {
showTalkingModel.value = false
cb && cb()
}, 350)
setTimeout(() => {
isTalking.value = false
}, 800)
}
// #endif
//#ifndef APP-PLUS
const recordObjCom = ref({})
const initRecord = () => {}
// #endif
onMounted(async () => {
initRecord?.()
//#ifdef APP-PLUS
// 安卓端
if (IsAndEnv) {
let _recordPerm = await permission.requestAndroidPermission('android.permission.RECORD_AUDIO')
if (_recordPerm !== 1) {
common.show('提示信息', '当前页面需要使用的录音权限,是否前往开启?', true, '取消', '确定').then((res) => {
if (res) {
// 去开启权限
uni.openAppAuthorizeSetting()
}else{
permission.gotoAppPermissionSetting()
} else {
// 取消
common.navigateBack()
}
})
}else if(_state === 'not determined'){
}
} else {
let _recordPerm = uni.getAppAuthorizeSetting()
let _state = _recordPerm.microphoneAuthorized
if (_state === 'denied') {
common.show('提示信息', '当前页面需要使用的录音权限,是否前往开启?', true, '取消', '确定').then((res) => {
if (res) {
// 去开启权限
uni.openAppAuthorizeSetting()
} else {
// 取消
common.navigateBack()
}
})
} else if (_state === 'not determined') {
// startRecord()
}
}
// #endif
})
// 录音结束
// 记录 按下移动位置
const touchX = ref(0)
const touchY = ref(0)
const baseY = ref(0)
const windowInfo = uni.getWindowInfo()
// 计算是否超出按下盒子位置
const isOut = computed(() => {
let _btnHeight = windowInfo.screenWidth/750 * 234
let moveVal = (windowInfo.screenHeight - touchY.value) > _btnHeight
return moveVal
})
const outScreen = computed(()=>{
(windowInfo.screenHeight - touchY.value) <= 0
})
const recNum = ref(1)
const activeNum = ref(1)
const getRecordPermission = (obj) => {
showOverlayTalking(obj)
}
const isMoving = ref(false)
const showOverlayTalking = (obj) => {
if(showTalkingModel.value) return
if(isLoadingState.value){
uni.showToast({
title: props.loadingText,
icon: "none",
duration:1000
})
return
}
if(!props.canAnswer){
uni.showToast({
title: props.canAnswerText,
icon: "none",
duration:1000
})
return
}
// if(!canStart.value){
// return
// }
isMoving.value = true
emit('startRecord')
recNum.value += 1
if(!isDisabled.value){
touchX.value = obj.changedTouches[0].pageX
touchY.value = obj.changedTouches[0].pageY
baseY.value = obj.currentTarget.offsetTop
//#ifdef APP-PLUS
// canStart.value = false
startRecord()
// #endif
setTimeout(() => {
hideOverlayTalking()
},59 * 1010)
}else{
showTalkingModel.value = false
uni.showToast({
title: '暂无问题需要回答!',
icon: "none",
duration:1000
})
})
// 录音结束
// 记录 按下移动位置
const touchX = ref(0)
const touchY = ref(0)
const baseY = ref(0)
const windowInfo = uni.getWindowInfo()
// 计算是否超出按下盒子位置
const isOut = computed(() => {
let _btnHeight = windowInfo.screenWidth / 750 * 234
let moveVal = (windowInfo.screenHeight - touchY.value) > _btnHeight
return moveVal
})
const outScreen = computed(() => {
(windowInfo.screenHeight - touchY.value) <= 0
})
const recNum = ref(1)
const activeNum = ref(1)
const getRecordPermission = (obj) => {
if (isTalking.value) {
common.msg('操作频繁,请稍后重试!')
return
}
showOverlayTalking(obj)
}
}
const hideOverlayTalking = (obj) => {
isMoving.value = false
if(!showTalkingModel.value) return
//#ifdef APP-PLUS
stopRecord()
// #endif
}
const handleMove = (obj) => {
if(isMoving.value){
touchX.value = obj.changedTouches[0].pageX
touchY.value = obj.changedTouches[0].pageY
if(outScreen.value){
hideOverlayTalking(obj)
const isMoving = ref(false)
const isTalking = ref(false)
const showOverlayTalking = (obj) => {
if (showTalkingModel.value) return
if (isLoadingState.value) {
uni.showToast({
title: props.loadingText,
icon: "none",
duration: 1000
})
return
}
if (!props.canAnswer) {
uni.showToast({
title: props.canAnswerText,
icon: "none",
duration: 1000
})
return
}
// if(!canStart.value){
// return
// }
isMoving.value = true
isTalking.value = true
emit('startRecord')
recNum.value += 1
if (!isDisabled.value) {
touchX.value = obj.changedTouches[0].pageX
touchY.value = obj.changedTouches[0].pageY
baseY.value = obj.currentTarget.offsetTop
//#ifdef APP-PLUS
// canStart.value = false
startRecord()
// #endif
setTimeout(() => {
hideOverlayTalking()
}, 59 * 1010)
} else {
showTalkingModel.value = false
uni.showToast({
title: '暂无问题需要回答!',
icon: "none",
duration: 1000
})
}
}
}
// 发送文本
const showKeyboard = () => {
if(isLoadingState.value){
uni.showToast({
title: props.loadingText,
icon: "none",
duration:1000
})
return
const hideOverlayTalking = (obj) => {
isMoving.value = false
if (!showTalkingModel.value) return
//#ifdef APP-PLUS
stopRecord()
// #endif
}
if(!isDisabled.value){
if(keyboardIsShow.value){
if(answerValue.value.trim()){
emit(
'submitAnswer',
answerValue.value,
changeBtn
)
}else{
// keyboardIsShow.value = !keyboardIsShow.value
common.msg("不能发送空白消息!")
const handleMove = (obj) => {
if (isMoving.value) {
touchX.value = obj.changedTouches[0].pageX
touchY.value = obj.changedTouches[0].pageY
if (outScreen.value) {
hideOverlayTalking(obj)
}
}else{
keyboardIsShow.value = !keyboardIsShow.value
}
}else{
uni.showToast({
title: '暂无问题需要回答!',
icon: "none",
duration:1000
})
}
}
const changeBtn = () => {
if(props.isDisabled) return
keyboardIsShow.value = !keyboardIsShow.value
answerValue.value = ''
}
// 发送文本
const showKeyboard = () => {
if (isLoadingState.value) {
uni.showToast({
title: props.loadingText,
icon: "none",
duration: 1000
})
return
}
if (!isDisabled.value) {
if (keyboardIsShow.value) {
if (answerValue.value.trim()) {
emit(
'submitAnswer',
answerValue.value,
changeBtn
)
} else {
// keyboardIsShow.value = !keyboardIsShow.value
common.msg("不能发送空白消息!")
}
} else {
keyboardIsShow.value = !keyboardIsShow.value
}
} else {
uni.showToast({
title: '暂无问题需要回答!',
icon: "none",
duration: 1000
})
}
}
const changeBtn = () => {
if (props.isDisabled) return
keyboardIsShow.value = !keyboardIsShow.value
answerValue.value = ''
}
</script>
<style lang="scss" scoped>
.talk-btns{
.talk-btns {
height: 150rpx;
background-color: #fff;
padding: 25rpx 30rpx 0;
position: relative;
.touch-btn{
.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, .06);
text-align: center;
line-height: 92rpx;
color: #000;
font-weight: 400;
position: relative;
.input-box{
.input-box {
width: 100%;
height: 92rpx;
line-height: 92rpx;
text-align: left;
box-sizing: border-box;
padding:0 40rpx 0 40rpx;
padding: 0 40rpx 0 40rpx;
}
}
.talk-btn-box{
.talk-btn-box {
position: absolute;
height: 100%;
width: 120rpx;
right: 0;
top:0;
.talk-btn-icon{
top: 0;
.talk-btn-icon {
width: 40rpx;
height: 40rpx;
position: absolute;
@@ -391,40 +422,45 @@ const changeBtn = () => {
}
}
}
.overlay-box{
.overlay-box {
display: flex;
flex-direction: column-reverse;
// justify-content: flex-end;
width: 100%;
height: 100%;
.circle-bg-box{
.circle-bg-box {
height: 234rpx;
background: url(@/static/images/course/talking.png) no-repeat;
background-size: cover;
position: relative;
.icon-box{
.icon-box {
position: absolute;
left:50%;
left: 50%;
top: 50%;
margin-left: -17rpx;
margin-top: -24rpx;
width: 34rpx;
height: 48rpx;
image{
image {
width: 100%;
height: 100%;
}
}
}
.tips-box{
.tips-box {
height: 40rpx;
line-height: 40rpx;
color:#c0c0c0;
color: #c0c0c0;
text-align: center;
margin: 12rpx 0 24rpx;
}
.btns-box{
.btns-box {
height: 270rpx;
// padding: 0 120rpx;
width: 154rpx;
@@ -433,42 +469,50 @@ const changeBtn = () => {
font-size: 28rpx;
text-align: center;
line-height: 116rpx;
.close-btn{
.close-btn {
float: left;
height: 100%;
width: 154rpx;
overflow: hidden;
color:#999;
&.is-out{
color:#fff;
color: #999;
&.is-out {
color: #fff;
}
}
.translate-btn{
.translate-btn {
float: right;
height: 100%;
width: 154rpx;
overflow: hidden;
color:#999;
color: #999;
}
.btn-box{
.btn-box {
width: 100%;
height: 154rpx;
}
}
.talk-dialog{
.talk-dialog {
width: 506rpx;
height: 234rpx;
margin: 0 auto;
background-color: #06f;
border-radius: 32rpx;
position: relative;
&.is-out{
&.is-out {
background-color: #ff3e49;
&::after{
&::after {
background-color: #ff3e49;
}
}
.gif-box{
.gif-box {
position: absolute;
width: 200rpx;
height: 80rpx;
@@ -476,7 +520,8 @@ const changeBtn = () => {
top: 50%;
transform: translate(-50%, -50%);
}
&::after{
&::after {
content: '';
width: 44rpx;
height: 44rpx;
@@ -485,35 +530,40 @@ const changeBtn = () => {
overflow: hidden;
position: absolute;
bottom: -22rpx;
left:50%;
left: 50%;
margin-left: -22rpx;
}
}
.white-bg-box{
.white-bg-box {
height: 365rpx;
background-color: #fff;
overflow: hidden;
border-radius: 32rpx 32rpx 0 0;
padding: 58rpx 36rpx;
.box-title{
.box-title {
font-size: 32rpx;
font-weight: bold;
line-height: 46rpx;
margin-bottom: 46rpx;
}
.box-btns{
.box-btns {
height: 46rpx;
line-height: 46rpx;
display: flex;
justify-content: space-between;
color: #999;
.is-active{
.is-active {
color: #06f;
}
}
}
}
::v-deep .uv-input__content__field-wrapper__field{
::v-deep .uv-input__content__field-wrapper__field {
padding-right: 60rpx;
}
</style>
</style>
+1 -1
View File
@@ -279,7 +279,7 @@ import { onShow } from "@dcloudio/uni-app"
}
// 跳转 课程详情
const toCourseDetail = (item) => {
common.navigateTo('/pages/courseDetail/index?crsNum=' + item.crsNum)
common.navigateTo('/pages/courseDetail/index?crsNum=' + item.crsNum + '&crsId=' + item.crsId)
// common.navigateTo('/pages/course/study?crsNum=' + item.crsNum)
}
onMounted(()=>{
@@ -148,7 +148,6 @@
keyboardHeight = Math.max(0, keyboardHeight - safeAreaBottomHeight); // 避免负数
}
popup_input_bottom.value = `${keyboardHeight}px`;
console.log(res);
});
})
}
+84 -101
View File
@@ -15,40 +15,40 @@
</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="test=!test">
<image v-show="test" class="collect-icon"
src="/src/static/images/courseDetail/in_collect.png" mode="widthFix"></image>
<image v-show="!test" class="collect-icon"
src="/src/static/images/courseDetail/out_collect.png" mode="widthFix"></image>
<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>
</view>
</view>
</view>
<view class="body-box">
<uv-sticky :customNavHeight="statusBarHeight" id='tabsDiv' class="sticky">
<uv-sticky :customNavHeight="statusBarHeight" id="tabsDiv" class="sticky">
<view class="body-tab">
<uv-tabs class="font_pf" :current="tabAct" :list="tabList" @change="tabSwitch"
:scrollable="false" line-color="#0066FF"
<uv-tabs
class="font_pf"
:current="tabAct"
:list="tabList"
@change="tabSwitch"
:scrollable="false"
line-color="#0066FF"
:active-style="{ color: '#323E57', 'font-weight': 600, 'font-size': '30rpx' }"
:inactive-style="{ color: '#666666', 'font-size': '30rpx' }"></uv-tabs>
:inactive-style="{ color: '#666666', 'font-size': '30rpx' }"
></uv-tabs>
</view>
</uv-sticky>
<!-- <swiper class="body-swiper" @change="swiper_change" :current="tabAct"><swiper-item> -->
@@ -61,69 +61,52 @@
</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" :crsNum="form.crsNum" :crsId="form.crsId" :imgId="form.imgId"></comment>
</view>
<!--</swiper-item></swiper>-->
</view>
</view>
</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='+crsNum+'&crsId='+form.crsId + '&imgId=' + form.imgId)">去学习</uv-button>
<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">去练习</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='+crsNum+'&imgId='+form.imgId)">发布评价</uv-button>
<uv-button type="primary" class="send_evaluate" @click="common.navigateTo('/pages/courseDetail/submit?crsNum=' + form.crsNum + '&imgId=' + form.imgId)">
发布评价
</uv-button>
</template>
</view>
</view>
</template>
<script setup>
import {
reactive,
ref,
computed,
onMounted
} from 'vue';
import {
onShow,
onLoad,
onUnload
} from '@dcloudio/uni-app'
import {
getCourseDetailApi
} from '@/api/courseDetail.js';
import { reactive, ref, computed, onMounted } from 'vue';
import { onShow, onLoad, onUnload } from '@dcloudio/uni-app';
import { getCourseDetailApi } from '@/api/courseDetail.js';
import { startExamByCrs } from '@/api/examination.js';
import { insertTraPersonalCollectionTask, deleteTraPersonalCollectionById } from '@/api/favorites.js';
import common from '@/common/common';
import introduceVue from './components/introduce.vue';
import knowledge from './components/knowledge.vue';
import comment from './components/comment.vue';
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
// tab栏
const tabList = ref([{
name: '课程介绍'
}, {
name: '知识点'
}, {
name: '评价'
}]);
const tabList = ref([{ name: '课程介绍' }, { name: '知识点' }, { name: '评价' }]);
const test = ref(false);
const commentRef = ref(null);
const tabsDiv = ref(null);
const form = ref({});
const crsNum = ref('');
const crsId = ref('');
const tabAct = ref(0);
const scrollTop = ref(0);
const tabSwitch = (item) => {
tabAct.value = item.index;
};
// 上拉加载
const scrolltolower = (item) => {
if (tabAct.value == 2) {
commentRef.value?.getData();
@@ -131,17 +114,14 @@
};
const getData = async () => {
const {
body
} = await getCourseDetailApi({
crsNum: crsNum.value
const { body } = await getCourseDetailApi({
crsId: crsId.value
});
form.value = body;
};
const toStudyPrgh = (info) => {
common.navigateTo('/pages/course/study?crsNum=' + crsNum.value + '&crsId=' + form.value.crsId + '&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(() => {
if (scrollTop.value <= 20) return `rgba(255,255,255,0)`;
@@ -149,54 +129,62 @@
return `rgba(255,255,255,${opacity})`;
});
// 子组件滑动开启状态
const childScrollStatus = ref(false)
const childScrollStatus = ref(false);
const scroll_fun = (e) => {
scrollTop.value = e.detail.scrollTop
// getElementPosition().then(res => {
// childScrollStatus.value = statusBarHeight === res.top
// })
}
scrollTop.value = e.detail.scrollTop;
};
const swiper_change = (res) => {
tabAct.value = res.detail.current
}
tabAct.value = res.detail.current;
};
// 去考试
const goto_examination = () => {
// papersId.value = e.papersId
// paperData.value = setPageCache('examination_'+papersId.value)
// if (!papersId.value || !paperData.value) {
// common.navigateBack()
// return
// }
}
// const getElementPosition = () => {
// return new Promise((resolve) => {
// uni.createSelectorQuery()
// .select('#tabsDiv')
// .boundingClientRect(rect => {
// if (rect) {
// resolve(rect) // 距离视口顶部的距离
// }
// }).exec()
// })
// }
const goto_examination = async () => {
common.loading();
startExamByCrs({
// crsId : crsId.value
crsId: 'CRS0250181220722025070408313900000018729'
})
.then((res) => {
setPageCache('examination', {
...res.body,
examId: detailData.examId
});
common.navigateTo('/pages/examination/index');
})
.finally(() => {
common.hideLoading();
});
};
const collect_click = async (collectId) => {
console.log(collectId);
if (!collectId) {
await insertTraPersonalCollectionTask({
collectTyp: '01',
collectBusId: crsId.value
});
} else {
await deleteTraPersonalCollectionById({
collectId: collectId
});
}
};
onMounted(async () => {
uni.$on('refresh_comment_data', () => {
console.log('发评论了刷新');
commentRef.value?.getData('submit');
tabAct.value = 2
})
})
tabAct.value = 2;
});
});
onLoad((params) => {
crsNum.value = params.crsNum;
crsId.value = params.crsId;
});
onShow(() => {
getData();
})
});
onUnload(() => {
uni.$off('refresh_comment_data')
uni.$off('refresh_comment_data');
});
</script>
@@ -230,8 +218,8 @@
left: 25%;
width: 40%;
height: 40%;
border-top: 4rpx solid #FFFFFF;
border-left: 4rpx solid #FFFFFF;
border-top: 4rpx solid #ffffff;
border-left: 4rpx solid #ffffff;
transform: rotate(-45deg);
}
}
@@ -257,7 +245,6 @@
height: 100%;
display: flex;
flex-direction: column;
}
.body-head {
@@ -276,7 +263,6 @@
}
}
.head-title {
border-radius: 24rpx 24rpx 0rpx 0rpx;
// height: 162rpx;
@@ -310,7 +296,7 @@
display: flex;
.examination {
color: #0066FF;
color: #0066ff;
.back-icon {
position: relative;
@@ -331,8 +317,8 @@
left: 25%;
width: 40%;
height: 40%;
border-top: 4rpx solid #0066FF;
border-left: 4rpx solid #0066FF;
border-top: 4rpx solid #0066ff;
border-left: 4rpx solid #0066ff;
transform: rotate(135deg);
}
}
@@ -345,7 +331,6 @@
padding-right: 16rpx;
padding-top: 20rpx;
padding-bottom: 245rpx;
}
.body-tab {
@@ -374,7 +359,7 @@
padding-top: 37rpx;
justify-content: space-around;
background-color: #ffffff;
border: 2rpx solid #E5E5E5;
border: 2rpx solid #e5e5e5;
z-index: 1000;
:deep(.uv-button-wrapper) {
@@ -405,8 +390,6 @@
height: 30rpx;
}
.learn {
color: #1dd17a;
}
@@ -419,4 +402,4 @@
font-weight: 600;
color: #000000;
}
</style>
</style>
+4 -6
View File
@@ -36,8 +36,7 @@
提问</view>
</view>
<view class="input-textarea">
<uv-textarea v-model="formData.bbsContent" height="124" count
:maxlength="100"
<uv-textarea v-model="formData.bbsContent" height="124" count :maxlength="100"
:placeholder="formData.bbsTag == 'SUG'?'请输入你的建议...':'请输入你的问题...'"></uv-textarea>
</view>
</view>
@@ -74,7 +73,7 @@
const sliderChange = (event) => {
formData.bbsGrade = event.detail.value
}
const submit = () => {
if (formData.bbsContent === '') {
if (formData.bbsTag == 'SUG') {
@@ -87,9 +86,7 @@
common.msg('发表成功')
setTimeout(() => {
uni.$emit('refresh_comment_data')
if(from.value === 'study'){
} else {
}
if (from.value === 'study') {} else {}
common.navigateBack()
}, 500)
})
@@ -253,6 +250,7 @@
.back_div {
// margin-right: 10rpx;
padding: 15rpx;
// background-color: red;
.back-icon {
position: relative;
+116
View File
@@ -0,0 +1,116 @@
<template>
<uni-popup ref="PopupRef" class="popup">
<view class="popup_div">
<view class="title_div">
<!-- 1. 插槽优先 -->
<slot name="title" v-if="$slots.title"></slot>
<!-- 2. 有HTML内容且不为空时使用v-html -->
<!-- <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 || ''}}
</view>
</view>
</view>
</uni-popup>
</template>
<script setup>
import {
ref,
reactive,
computed,
onMounted,
nextTick,
} from 'vue';
const props = defineProps({
dialogConfiguration: {
type: Object,
required: true,
}
});
const emit = defineEmits(['button_click'])
const title = ref('')
const html = ref('')
const buttonList = ref([])
const PopupRef = ref(null)
//
const click_button = (value) => {
emit('button_click', value)
}
const close = () => PopupRef.value?.close()
const open = () => {
//
const {
title: t,
html: h,
buttonList: bl = []
} = props.dialogConfiguration || {};
title.value = t || '';
html.value = h || '';
buttonList.value = Array.isArray(bl) ? bl : [];
// PopupRefopen
if (PopupRef.value) {
PopupRef.value.open('bottom');
}
}
defineExpose({
open,
close
})
</script>
<style scoped lang="scss">
.popup {
z-index: 1810;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .9);
}
.popup_div {
width: 80%;
background-color: #FFFFFF;
padding: 20rpx 34rpx 50rpx 34rpx;
display: flex;
flex-direction: column;
align-items: center;
border-radius: 16rpx;
position: relative;
margin: 0 auto 76% auto;
.title_div {
width: 100%;
text-align: center;
padding: 30rpx 0;
font-family: PingFangSC;
text-align: center;
font-style: normal;
font-weight: 400;
font-size: 30rpx;
color: #333333;
}
.button_div {
display: flex;
flex-direction: column;
.button_item {
margin-top: 30rpx;
width: 356rpx;
height: 80rpx;
text-align: center;
line-height: 80rpx;
}
}
}
</style>
@@ -0,0 +1,176 @@
<template>
<uni-popup ref="feedbackPopupRef" class="popup">
<view class="feedback_popup_div" :style="{marginBottom:feedback_popup_bottom}">
<view class="title_div">
<view class="text">
反馈
</view>
<view class="popup_back_div" @click="openFeedback(false)">
<image :src="optionErrorIcon('#000000')" class="img"></image>
</view>
</view>
<view class="feedback_item_div">
<view class="feedback_item"
:class="{'feedback_item_clidked':feedbackInfo.type.includes(feedback_type_item.value)}"
@click="feedback_item_click(feedback_type_item.value)"
v-for="feedback_type_item in feedbackTypeList">场景问题</view>
</view>
<view class="feedback_text_area_div">
<uv-textarea height="124" count :maxlength="100" placeholder="请输入反馈内容..." :adjustPosition="false"
v-model="feedbackInfo.text"></uv-textarea>
</view>
<view class="feedback_button">
<uv-button class="button" type="primary" :throttleTime="100" text="提交" color="#0066FF"
custom-style="color:#FFFFFF;borderRadius:16rpx;height:92rpx;"
@click="submit_feedback_fun()"></uv-button>
</view>
</view>
</uni-popup>
</template>
<script setup>
import {
ref,
reactive,
computed,
onMounted,
nextTick
} from 'vue';
import {
optionErrorIcon
} from '@/common/imgSvg'
const feedback_popup_bottom = ref('0px') //
const feedbackPopupRef = ref(null)
const feedbackTypeList = reactive([{
value: "SN",
label: "场景问题",
}, {
value: "GN",
label: "功能问题",
}, {
value: "PN",
label: "陪练内容",
}])
const feedbackInfo = reactive({
type: [], //
text: '', //
examId: '', // ID
qnsId: '', // IDID
})
const feedback_item_click = (value) => {
if (feedbackInfo.type.includes(value)) {
feedbackInfo.type = feedbackInfo.type.filter(item => item !== value); //
} else {
feedbackInfo.type.push(value); //
}
}
//
const submit_feedback_fun = (value) => {
// todo
console.log('反馈提交');
}
const openFeedback = (status) => {
if (status) {
feedbackPopupRef.value.open('bottom')
// feedbackInfo.examId
const systemInfo = uni.getSystemInfoSync();
//
const safeAreaBottomHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom;
nextTick(() => {
uni.onKeyboardHeightChange(res => {
let keyboardHeight = res.height;
// iOS
if (systemInfo.platform === 'ios') {
keyboardHeight = Math.max(0, keyboardHeight - safeAreaBottomHeight); //
}
feedback_popup_bottom.value = `${keyboardHeight}px`;
});
})
} else {
feedbackPopupRef.value.close()
}
}
const open = () => openFeedback(true)
defineExpose({
open
})
</script>
<style scoped lang="scss">
.feedback_popup_div {
width: 100%;
height: 100%;
background-color: #FFFFFF;
padding: 10rpx 34rpx;
display: flex;
flex-direction: column;
align-items: center;
border-radius: 16rpx 16rpx 0px 0px;
position: relative;
.title_div {
width: 100%;
text-align: center;
padding: 30rpx 0;
font-family: PingFangSC;
font-weight: 600;
font-size: 34rpx;
color: #000000;
text-align: center;
font-style: normal;
border-bottom: 2rpx solid #EFEFEF;
}
.popup_back_div {
width: 60rpx;
height: 60rpx;
position: absolute;
top: 30rpx;
right: 30rpx;
display: flex;
align-items: center;
justify-content: center;
.img {
width: 30rpx;
height: 30rpx;
}
}
.feedback_item.feedback_item_clidked {
border: 2rpx solid #0066FF !important;
background-color: #fff !important;
}
.feedback_item_div {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
margin: 30rpx 0;
.feedback_item {
border: 2rpx solid #F0F0F0;
background-color: #F0F0F0;
border-radius: 16rpx;
padding: 26rpx 36rpx;
font-family: PingFangSC;
font-weight: 500;
font-size: 30rpx;
color: #000000;
text-align: center;
}
}
.feedback_text_area_div {
width: 100%;
margin-bottom: 40rpx;
}
.feedback_button {
width: 100%;
margin-bottom: 20rpx;
}
}
</style>
-201
View File
@@ -1,201 +0,0 @@
<template>
<view class="main_div max_page">
<nav-bar :is_seat="true"></nav-bar>
<view class="nav-div">
<view class="title ellipsis-text">
这里是练习名称
</view>
<view class="back_div"></view>
</view>
<view class="countdown-and-question-number-div">
<view class="top">
<view class="countdown">
<text class="grey">答题进度</text> <text class="bold">2</text><text class="grey">/10</text>
</view>
<view class="question">
<view class="grey">剩余时间</view>
<uv-count-down :time="30 * 60 * 60 * 1000" format="HH:mm:ss"></uv-count-down>
</view>
</view>
<view class="progress">
<uv-line-progress :percentage="30" :showText="false" activeColor="#FFFFFF" inactiveColor="#89B8FF"
:height="8"></uv-line-progress>
</view>
</view>
<view class="scroll_div">
<swiper class="swiper" :current="tabAct" :indicator-dots="false" :disable-touch="true">
<swiper-item>
<view class="content">
<view class="expose_shadow"></view>
<scroll-view :scroll-y="true" class="scroll-Y" :show-scrollbar="false" :refresher-threshold="0">
<RadioSubject></RadioSubject>
</scroll-view>
</view>
</swiper-item>
</swiper>
</view>
</view>
</template>
<script setup>
import RadioSubject from '@/components/examination/radio-subject.vue'
import {
ref,
computed,
onMounted,
nextTick,
getCurrentInstance
} from 'vue';
const {
proxy
} = getCurrentInstance() //
//
const dimensions = ref({
containerHeight: 0,
contentHeight: 0
});
//
const checkDimensions = async () => {
await nextTick(); // DOM
//
const query = uni.createSelectorQuery().in(proxy);
//
query.select('.content').boundingClientRect(data => {
dimensions.value.contentHeight = data?.height || 0;
});
// .exec()
query.select('.scroll_div').boundingClientRect(data => {
dimensions.value.containerHeight = data?.height || 0;
});
// exec()
query.exec();
};
//
const isScrollable = computed(() => {
return dimensions.value.contentHeight > dimensions.value.containerHeight - 20;
});
//
onMounted(() => {
checkDimensions();
//
uni.onWindowResize(() => {
checkDimensions();
});
});
</script>
<style scoped lang="scss">
$bg-margin-left: 30rpx;
.scroll-Y {
max-height: calc(100vh - var(--status-bar-height) - 70rpx - 70rpx - 40rpx - 64rpx - 68rpx - 60rpx);
min-height: calc(100vh - var(--status-bar-height) - 70rpx - 70rpx - 40rpx - 64rpx - 68rpx - 60rpx - 380rpx);
}
.content {
position: relative;
margin: 32rpx $bg-margin-left;
border-radius: 16rpx;
padding: 34rpx 30rpx 34rpx 36rpx;
background-color: #fff;
.expose_shadow {
margin-left: 36rpx;
position: absolute;
bottom: -26rpx;
left: 0%;
width: calc(100% - 66rpx);
height: 28rpx;
background-color: #FFFFFF;
border-radius: 0 0 14rpx 14rpx;
opacity: 0.4;
z-index: 0;
}
}
.countdown-and-question-number-div {
margin: 20rpx $bg-margin-left;
height: 70rpx;
// background-color: red;
display: flex;
flex-direction: column;
justify-content: space-between;
z-index: 10;
.top {
display: flex;
align-items: center;
justify-content: space-between;
font-family: PingFangSC;
font-size: 26rpx;
color: #FFFFFF;
text-align: left;
font-style: normal;
}
.question {
display: flex;
align-items: center;
// background-color: red;
width: 242rpx;
color: red;
.grey {
margin-right: 8rpx;
}
:deep(.uv-count-down__text) {
color: #FFFFFF !important;
font-weight: 600;
font-size: 26rpx !important;
}
}
.grey {
color: #B6E2FF;
}
.bold {
font-weight: 600;
}
}
.nav-div {
position: relative;
.title {
// padding-top:var(--status-bar-height);
// padding: 0 30rpx;
margin: 0 calc($bg-margin-left + 70rpx);
height: 70rpx;
font-family: PingFangSC;
font-weight: 500;
font-size: 34rpx;
color: #FFFFFF;
text-align: center;
font-style: normal;
line-height: 70rpx;
}
.back_div {
position: absolute;
right: $bg-margin-left;
top: 0;
width: 70rpx;
height: 70rpx;
// background-color: red;
}
}
.main_div {
display: flex;
flex-direction: column;
background: linear-gradient(to top, #3480FF, #0066FF);
/* 确保背景占满整个视口高度 */
min-height: 100vh;
margin: 0;
}
</style>
+276 -79
View File
@@ -2,7 +2,7 @@
<view class="main_div max_page">
<nav-bar :is_seat="true"></nav-bar>
<view class="nav-div">
<view class="title ellipsis-text" @click="hand_in_paper()">
<view class="title ellipsis-text" @click="hand_in_paper_button_click()">
{{paperData.papersName}}
</view>
<view class="back_div"></view>
@@ -23,7 +23,6 @@
:height="8"></uv-line-progress>
</view>
</view>
<view class="scroll_div">
<swiper class="swiper" :indicator-dots="false" @change="swiperChange" :current="questionNumber"
easing-function="linear">
@@ -31,12 +30,12 @@
<view class="content">
<view class="expose_shadow"></view>
<scroll-view :scroll-y="true" class="scroll-Y" :show-scrollbar="false" :refresher-threshold="0">
<RadioSubject :item="item" v-if="item.qnsTyp !== 'ES'" :mode="mode">
<RadioSubject :item="item" v-if="item.qnsTyp !== 'ES'" :mode="mode"
@subject_click="subject_click">
</RadioSubject>
<CharactersSubject :item="item" v-if="item.qnsTyp === 'ES'" :mode="mode"
:activeVoiceId="activeVoiceId"
:voicePathValue="voicePathValue"
>
:activeVoiceId="activeVoiceId" :voicePathValue="voicePathValue"
@subject_click="subject_click">
</CharactersSubject>
</scroll-view>
</view>
@@ -44,9 +43,9 @@
</swiper>
</view>
<view class="fixed-box font_pf">
<view class="fixed-box font_pf" :style="{marginBottom:popup_input_bottom}">
<view class="fixed-btn-box">
<view class="sheet_button" @click="openSheet()">
<view class="sheet_button" @click="openSheet(true)">
<image :src="examinationSheetIcon()" class="img"></image>
<view class="sheet_text">答题卡</view>
</view>
@@ -55,29 +54,33 @@
custom-style="color:#0066FF;borderRadius:16rpx;height:92rpx;"
@click="button_tab(-1)"></uv-button>
<view style="width:46rpx"></view>
<uv-button class="button" type="primary" :throttleTime="100" text="下一题" color="#0066FF"
<uv-button class="button" type="primary" :throttleTime="100" :text="next_question" color="#0066FF"
custom-style="color:#FFFFFF;borderRadius:16rpx;height:92rpx;"
@click="button_tab(1)"></uv-button>
</view>
</view>
<view class="touch-btn-div" :class="{'show':showTouchBtn}">
<TouchBtn class="talk-btns" @uploadVoice="uploadRecordNow" @submitAnswer="submitAnswerNow"
:loadingText="sendLoadingText" :isLoading="!answerIsOver" :isDisabled="false" />
<TouchBtn class="talk-btns" @submit="touchBtnSubmit"
loadingText="问题回答中,请在问题回答结束后重试!" :isLoading="!answerIsOver" :isDisabled="false" />
</view>
</view>
<uni-popup ref="popup" class="popup">
<view class="sheet_popup_div">
<uni-popup ref="popupRef" class="popup">
<view class="sheet_popup_div" >
<view class="title_div">
<view class="text">
答题卡
</view>
<view class="popup_back_div">
<view class="popup_back_div" @click="openSheet(false)">
<image :src="optionErrorIcon('#000000')" class="img"></image>
</view>
</view>
<view class="sheet_table">
<view class="sheet_table_item" v-for="(item,index) in [1,2,3,4,5,67,8,9,10,11,12,13,14,15]">
<view class="sheet_table_item" v-for="(item,index) in topicList" :class="{
'current':index === questionNumber,
'mark':markList.includes(item.qnsId),
'completed':completedList.includes(item.qnsId),
}" @click="clikc_sheet_item(index)">
<view class="circle">
{{index + 1}}
</view>
@@ -86,28 +89,32 @@
<view class="sheet_button">
<uv-button class="button" type="primary" :throttleTime="100" text="交卷" color="#0066FF"
custom-style="color:#FFFFFF;borderRadius:16rpx;height:92rpx;"
></uv-button>
@click="hand_in_paper_button_click()"></uv-button>
</view>
</view>
</uni-popup>
<!-- 反馈组件 -->
<Feedback ref="feedbackRef"></Feedback>
<!-- 结尾弹出层 -->
<Dialog ref="dialogRef" :dialogConfiguration="dialogConfiguration" @button_click="result_click">
</Dialog>
</view>
</template>
<script setup>
import Feedback from './components/feedback.vue'
import Dialog from './components/dialog.vue'
import RadioSubject from '@/components/examination/radio-subject.vue'
import CharactersSubject from '@/components/examination/characters-subject.vue'
import TouchBtn from '@/pages/course/components/touchBtn.vue'
import TouchBtn from '@/components/examination/touchBtn.vue'
import {
ref,
reactive,
computed,
onMounted,
nextTick,
getCurrentInstance
nextTick
} from 'vue';
import {
examinationSheetIcon
} from '@/common/imgSvg'
import {
onLoad
} from '@dcloudio/uni-app'
@@ -118,22 +125,43 @@
import {
commonUploadVoiceFile
} from "@/api/common.js"
const sendLoadingText = ref('问题回答中,请在问题回答结束后重试!')
import {
optionErrorIcon,
examinationSheetIcon
} from '@/common/imgSvg'
import {
commitPaperExam,
queryPaperExamScore
} from '@/api/examination.js'
const answerIsOver = ref(true)
const examId = ref('')
const popup = ref(null)
const feedbackRef = ref(null)
const dialogRef = ref(null)
const popupRef = ref(null)
const mode = ref('examination') // examination practice
const paperData = reactive({
papersId: '',
limitTm: 0,
papersName: '',
execId: '', // ID
examId: '', // ID
papersId: '', // ID
limitTm: 0, //
papersName: '', //
}) //
const topicList = reactive([]) //
const popup_input_bottom = ref('0px')
const questionNumber = ref(0) //
const systemInfo = uni.getSystemInfoSync();
const showTouchBtn = computed(() => {
return topicList[questionNumber.value]['qnsTyp'] === 'ES'
})
const completedList = computed(() => {
return []
})
const markList = computed(() => topicList.filter(res => !!res.mark).map(res => res.qnsId)) //
//
const next_question = computed(() => (topicList.length === questionNumber.value + 1) ? '交卷' : '下一题')
const progress = computed(() => { //
const total = topicList.length;
@@ -141,7 +169,11 @@
const completed = questionNumber.value + 1;
return Math.min(Math.round((completed / total) * 10000) / 100, 100);
})
//
const dialogConfiguration = reactive({})
const activeVoiceId = ref('')
const swiperChange = (item) => {
questionNumber.value = item.detail.current
}
@@ -153,70 +185,54 @@
newNumber = 0;
} else if (newNumber >= topicList.length) {
newNumber = topicList.length - 1;
hand_in_paper_button_click() //
}
questionNumber.value = newNumber;
}
//
const openSheet = () => {
popup.value.open('bottom');
//
const openSheet = (status) => status ? popupRef.value.open('bottom') : popupRef.value.close();
//
const clikc_sheet_item = (index) => {
questionNumber.value = index
}
const subject_click = (type, params) => {
if (type === 'mark') {
topicList[questionNumber.value]['mark'] = !topicList[questionNumber.value]['mark']
} else if (type === 'feedback') {
console.log('feedbackRef.value', feedbackRef.value);
feedbackRef.value.open()
}
}
const voicePathValue = ref('')
//
const touchBtnSubmit = (type, submitObj) => {
if (type === 'voice') {
uploadRecordNow(submitObj)
}else if (type === 'text') {
}
}
//
const uploadRecordNow = (voicePath) => {
console.log('voicePath',voicePath);
//#ifdef APP-PLUS
// talkingList.value.push({
// type: 'question',
// talkingText: '',
// isLoading: true
// })
// scrollToBottomNow()
commonUploadVoiceFile(voicePath, '/traask/traAskchat/voiceTrans', {}).then(res => {
let _res = JSON.parse(res.data)
voicePathValue.value = voicePath
console.log('_res', _res, voicePath);
if (_res.rtnCode === '0000') {
// "chatId": "CHAT025018122068202508081537410000000000000000000000000000000088",
// "fileId": "S3F0250181220722025080815374100000456565",
// "ossFileAddr": "http://25.18.122.66::9786/traoss/show//S3F0250181220722025080815374100000456565",
// "transContent": ""
// activeVoiceId.value =
// if (!!(_res.body.transContent || '').trim()) {
// askData.value = {
// reqBatch: reqBatch.value,
// intrctWay: '02', //01-02-03-
// intrctContent: _res.body.transContent,
// bucketKey: _res.body.fileId,
// ossFileAddr: _res.body.ossFileAddr,
// talkingVoice: voicePath
// }
// sendMessage({
// "commond": 'ASK',
// "body": askData.value
// })
// } else {
// // talkingList.value.pop()
// uni.showToast({
// title: '',
// icon: "none",
// duration: 1000
// });
// }
} else {}
}
}).catch(err => {
// talkingList.value.pop()
uni.showToast({
title: '系统异常,请联系管理员',
icon: "none",
duration: 1000
});
})
// #endif
}
//
const submitAnswerNow = (val, cb = null) => {
@@ -229,30 +245,166 @@
common.navigateBack()
return
}
paperData.execId = examination.execId
paperData.examId = examination.examId
paperData.papersId = examination.papersId
paperData.limitTm = examination.limitTm
paperData.papersName = examination.papersName
topicList.push(...examination.qnsInfoVos.map(res => ({
...res,
mark: false,
my_answer: [],
backend_answer: [],
})))
//
const safeAreaBottomHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom;
uni.onKeyboardHeightChange(res => {
let keyboardHeight = res.height;
// iOS
if (systemInfo.platform === 'ios') {
keyboardHeight = Math.max(0, keyboardHeight - safeAreaBottomHeight); //
}
popup_input_bottom.value = `${keyboardHeight}px`;
console.log('端补偿安全区域高度', popup_input_bottom.value);
});
});
const result_click = ({
key
}) => {
console.log('res', key);
if (key === 'hand_in_paper') { //
hand_in_paper()
} else if (key === 'continue') { //
dialogRef.value.close()
}
}
//
const hand_in_paper_button_click = () => {
console.log('点击交卷', paperData);
//
const completeList = topicList.filter(res => !!(Array.isArray(res.my_answer) ? res.my_answer.length : res
.my_answer)).map(res => ({
a: res.qnsId,
b: res.my_answer,
c: !!res.my_answer
}))
dialogConfiguration.title = '确认现在交卷吗?'
const style_button_1 = {
color: '#FFFFFF',
fontSize: '30rpx',
backgroundColor: '#0066FF',
borderRadius: '8rpx'
}
const style_button_2 = {
color: '#0066FF',
fontSize: '30rpx',
backgroundColor: '#E2EDFF',
borderRadius: '8rpx'
}
const incompleteNumber = topicList.length - completeList.length
if (incompleteNumber === 0) { //
dialogConfiguration.type = 'complete'
dialogConfiguration.title = '确认现在交卷吗?'
dialogConfiguration.buttonList = [{
key: 'hand_in_paper',
name: '现在交卷',
style: style_button_1
}, {
key: 'continue',
name: '继续考试',
style: style_button_2
}]
} else {
dialogConfiguration.type = 'incomplete' //
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 = [{
key: 'continue',
name: '继续考试',
style: style_button_1
}, {
key: 'hand_in_paper',
name: '现在交卷',
style: style_button_2
}]
}
dialogRef.value.open()
}
//
const hand_in_paper = () => {
console.log('点击交卷', showTouchBtn.value);
showTouchBtn.value = !showTouchBtn.value
const answerDtoList = topicList.map(res => {
let answerItem = {
examId: paperData.examId,
papersId: paperData.papersId,
qnsId: res.qnsId,
ossKey: '',
anserResult: '',
}
if (res.qnsTyp === 'ES') { //
return {
...answerItem,
anserResult: ''
}
} else { //
return {
...answerItem,
anserResult: res.my_answer.join(',')
}
}
})
console.log('answerDtoList', answerDtoList);
dialogRef.value.close()
common.loading('正在提交')
commitPaperExam({
examId: paperData.examId,
execId: paperData.execId || '1',
examLenTm: 1200,
answerDtoStr: JSON.stringify(answerDtoList)
}).then(res => {
console.log('提交成功', res);
if (res.body.flagQuery === 'Y') { //
common.redirectTo('/pages/examination/result?execId=' + res.body.execId)
} else { //
common.navigateBack()
}
// const execId = res.body.execId
// let timer = setInterval(() => {
// queryPaperExamScore({
// execId
// }).then(res => {
// console.log('', res);
// clearInterval(timer)
// })
// }, 1000)
}).catch((res) => {
console.log('error', res);
}).finally(() => {
common.hideLoading().body
})
}
</script>
<style scoped lang="scss">
$bg-margin-left: 30rpx;
.popup_title_text {
color: red;
}
.popup {
//
z-index: 1800;
padding: 0 38rpx;
.sheet_popup_div {
width: 100%;
height: 100%;
background-color: #FFFFFF;
@@ -261,6 +413,8 @@
flex-direction: column;
align-items: center;
border-radius: 16rpx 16rpx 0px 0px;
position: relative;
.title_div {
width: 100%;
text-align: center;
@@ -274,16 +428,31 @@
border-bottom: 2rpx solid #EFEFEF;
}
.popup_back_div {
width: 60rpx;
height: 60rpx;
position: absolute;
top: 30rpx;
right: 30rpx;
display: flex;
align-items: center;
justify-content: center;
.img {
width: 30rpx;
height: 30rpx;
}
}
.sheet_table {
margin-top: 48rpx;
margin-bottom: 48rpx;
display: flex;
/* 启用 Flex 布局 */
flex-wrap: wrap;
/* 超出宽度时自动换行 */
width: calc(100vw - 108rpx);
align-content: space-between;
.sheet_table_item {
width: calc((100vw - 108rpx) / 5 - 16rpx);
height: calc((100vw - 108rpx) / 5 - 16rpx);
@@ -294,10 +463,38 @@
align-items: center;
justify-content: center;
font-size: 32rpx;
color: #999999;
}
.current {
background-color: rgba(0, 102, 255, 0.6);
border-color: #0066FF;
color: #FFFFFF;
}
.completed {
//
background-color: rgba(0, 102, 255, 0.1);
border-color: #0066FF;
color: #0066FF;
}
.mark,
.completed.mark {
background-color: rgba(232, 181, 49, 0.1);
color: #E8B531;
border-color: #E8B531;
}
.current.mark {
//
background-color: rgba(0, 102, 255, 0.6);
color: #FFFFFF;
border-color: #E8B531;
}
}
.sheet_button{
.sheet_button {
width: 100%;
}
}
@@ -330,7 +527,7 @@
justify-content: space-between;
align-items: center;
padding: 0 20rpx 20rpx 20rpx;
.sheet_button {
display: flex;
flex-direction: column;
+632
View File
@@ -0,0 +1,632 @@
<template>
<view class="main_div max_page">
<nav-bar :is_seat="true"></nav-bar>
<view class="nav-div">
<view class="title ellipsis-text">
考试结算
</view>
<view class="back_div">
<view class="back-icon"></view>
</view>
</view>
<!-- <view class="sheet_table_div_fixed" v-if="sheet_table_status">
<swiper :indicator-dots="false" class="sheet_swiper" :current="sheet_swiper_index" @change="sheet_swiper_change">
<swiper-item v-for="(group, groupIndex) in groupedTopicList" :key="groupIndex">
<uv-grid :col="5" class="sheet_table" @click="sheet_click">
<uv-grid-item v-for="(item,index) in group" :key="index">
<view class="circle">
{{ groupIndex * 10 + index + 1 }}
</view>
</uv-grid-item>
</uv-grid>
</swiper-item>
</swiper>
<view class="swiper-dots">
</view>
</view> -->
<scroll-view :scroll-y="true" @scroll="scroll" :scroll-top="scrollTop" class="scroll scroll-Y"
:scroll-with-animation="true" :show-scrollbar="false">
<view class="information-details-div">
<view class="top">
<view class="left">
<view class="top">得分</view>
<view class="mid">
<text v-if="pass_status===0" class="loading-pass">--</text>
<text v-if="pass_status===-1" class="no-pass">40</text>
<text v-if="pass_status===1" class="pass">50</text>
</view>
<view class="bottom">
<text v-if="pass_status===-1">失败乃成功之母继续努力</text>
<text v-if="pass_status===1">考的不错啊继续加油</text>
<text v-if="pass_status===0">考试结果计算中...</text>
<image v-if="pass_status===1" src="@/static/images/login/clap.png" mode="widthFix"
style="width: 32rpx;"></image>
</view>
</view>
<view class="right">
<view class="img">
<image v-if="pass_status===1" src="@/static/images/examination/qualified.png"
mode="widthFix" style="width: 270rpx;"></image>
<image v-if="pass_status===-1" src="@/static/images/examination/unqualified.png"
mode="widthFix" style="width: 270rpx;"></image>
<image v-if="pass_status===0" src="@/static/images/examination/getting_in.gif"
mode="widthFix" style="width: 270rpx;"></image>
</view>
</view>
</view>
<view class="bottom">
<!-- 考试标题 -->
<view class="title-div">
<view class="title-icon">
<image src="@/static/images/examination/examination-icon.png" mode="widthFix" class="img">
</image>
</view>
<view class="title ellipsis-text">
考试这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称这里是考试名称
</view>
</view>
<!-- 时间和考试按钮 -->
<view class="time-and-exam-button">
<view class="time-icon">
<image src="@/static/images/examination/duration-icon.png" mode="widthFix" class="img">
</image>
</view>
<view class="time">
时长12 15
</view>
<view class="fl1">
</view>
<view class="examination">
<view>考试排行榜</view>
<view class="back-icon"></view>
</view>
</view>
</view>
</view>
<view class="main-div">
<!-- <uv-sticky id='tabsDiv' class="sticky"> -->
<view class="sheet_table_div">
<swiper :indicator-dots="false" class="sheet_swiper" :current="sheet_swiper_index" @change="sheet_swiper_change">
<!-- 循环渲染分组后的数组 -->
<swiper-item v-for="(group, groupIndex) in groupedTopicList" :key="groupIndex">
<uv-grid :col="5" class="sheet_table" @click="sheet_click">
<uv-grid-item v-for="(item,index) in group" :key="index">
<view class="circle">
{{ groupIndex * 10 + index + 1 }}
</view>
</uv-grid-item>
</uv-grid>
</swiper-item>
</swiper>
<view class="swiper-dots">
</view>
</view>
<!-- </uv-sticky> -->
<!-- 获取答题结果时候的图片 -->
<view class="loading-pass-image-div" v-if="pass_status===0">
<image src="@/static/images/examination/getting_robot.png" mode="widthFix" class="img"></image>
<view class="tip">
你的等待会有更精确的结果要耐心哦~
</view>
</view>
<view class="item" :id="'id_'+index" :class="getStatusClass(index)" v-for="(item,index) in dataList">
<view class="top">
<view class="type">
单选题
</view>
<view class="score">
5
</view>
<view class="fl1">
</view>
<!-- <view class="right">
<view class="right_text">
展开
</view>
<uv-icon class="arrow-icon" name="arrow-right"></uv-icon>
</view> -->
</view>
<view class="text">
属于商业银行风险管理三道防线的哪些风险管理部门为什么
</view>
<view class="additional_div">
<RadioSubject></RadioSubject>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script setup>
import {
ref,
reactive,
computed,
onMounted,
nextTick,
getCurrentInstance
} from 'vue';
import RadioSubject from '../wrong_question_record/components/radio-subject.vue'
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
const pass_status = ref(1)
const sheet_swiper_index = ref(0)
const sheet_swiper_change = (event) => {
sheet_swiper_index.value = event.detail.current
}
const topicList = reactive([1, 2, 3, 4, 5, 6, 3, 4, 5, 6, 3, 4, 5, 6, 3, 4, 5, 6, 3, 4, 5, 6])
const dataList = reactive([1, 2, 3, 4, 5, 6])
//
const groupedTopicList = computed(() => {
if (!topicList || topicList.length === 0) {
return [];
}
const groups = [];
for (let i = 0; i < topicList.length; i += 10) {
// i10
const group = topicList.slice(i, i + 10);
groups.push(group);
}
return groups;
});
const sheet_table_status = ref(false)
const scrollTop = ref(0)
//
const sheet_click = (index) => {
scrollTop.value = index * 200
console.log('index', index);
// sheet_table_status.value = false
// nextTick(() => {
// sss.value = 'id_' + index
// nextTick(() => {
// sheet_table_status.value = true
// })
// })
}
const scroll = (event) => {
const top = event.detail.scrollTop
console.log('top', top);
if (top > 257) {
sheet_table_status.value = true
} else {
sheet_table_status.value = false
}
}
const getStatusClass = (index) => {
const remainder = index % 3;
if (remainder === 0) return 'in_progress';
if (remainder === 1) return 'completed';
return 'expired';
};
const animationfinish = (event) => {
console.log('event', event);
};
//
onMounted(() => {
});
</script>
<style scoped lang="scss">
$bg-margin-left: 30rpx;
.scroll-Y {
// max-height: calc(100vh - var(--status-bar-height) - 70rpx - 70rpx - 40rpx - 64rpx - 68rpx - 60rpx);
height: calc(100vh - var(--status-bar-height) - 70rpx - 10rpx);
// background-color: red;
}
.item {
border-radius: 16rpx;
margin: 18rpx 0;
padding: 22rpx 30rpx 34rpx 36rpx;
background-color: #fff;
display: flex;
flex-direction: column;
.top {
display: flex;
align-items: center;
.type {
width: 108rpx;
height: 46rpx;
background: #267EFF;
border-radius: 8rpx;
font-family: PingFangSC;
font-weight: 500;
font-size: 25rpx;
color: #FFFFFF;
text-align: center;
line-height: 46rpx;
}
.score {
margin-left: 24rpx;
font-family: ArialMT;
font-size: 30rpx;
color: #333333;
text-align: left;
}
.right {
display: flex;
align-items: center;
.right_text {
font-family: PingFangSC;
font-weight: 600;
font-size: 28rpx;
color: #333;
line-height: 40rpx;
text-align: left;
font-style: normal;
}
}
}
.text {
font-family: PingFangSC;
font-weight: 500;
font-size: 30rpx;
color: #333333;
line-height: 48rpx;
text-align: left;
font-style: normal;
margin-top: 20rpx;
}
}
.sticky {}
.sheet_table_div_fixed {
position: absolute;
top: calc(var(--status-bar-height) + 70rpx);
left: 0;
z-index: 600;
height: 230rpx;
width: calc(100% - 56rpx);
margin: 0 28rpx 0 28rpx;
background-color: #fff;
// opacity: .5;
}
.sheet_table_div {
position: sticky;
left: 0;
top: 0;
width: 100%;
z-index: 600;
background-color: #fff;
}
.sheet_swiper {
height: 230rpx;
}
.swiper-dots {
height: 20rpx;
}
.sheet_table {
padding: 0 12rpx;
width: 100%;
display: flex;
.circle {
width: 78rpx;
height: 78rpx;
border-radius: 100%;
display: flex;
align-items: center;
justify-content: center;
border: 2rpx solid #E5E5E5;
margin: 20rpx;
}
.current {
background-color: rgba(0, 102, 255, 0.6);
border-color: #0066FF;
color: #FFFFFF;
}
.completed {
//
background-color: rgba(0, 102, 255, 0.1);
border-color: #0066FF;
color: #0066FF;
}
.mark,
.completed.mark {
background-color: rgba(232, 181, 49, 0.1);
color: #E8B531;
border-color: #E8B531;
}
.current.mark {
//
background-color: rgba(0, 102, 255, 0.6);
color: #FFFFFF;
border-color: #E8B531;
}
}
//
.main-div {
display: flex;
flex-direction: column;
padding: 34rpx 0 30rpx 0;
margin: 30rpx 28rpx 20rpx 28rpx;
border-radius: 16rpx;
position: relative;
background-color: #fff;
// min-height: calc(100vh - var(--status-bar-height) - 70rpx - 380rpx - 100rpx);
.main-div-title {
width: 100%;
height: 44rpx;
font-family: PingFangSC;
font-weight: 700;
font-size: 33rpx;
color: #000000;
line-height: 44rpx;
text-align: left;
font-style: normal;
margin-left: 48rpx;
}
.loading-pass-image-div {
display: flex;
flex-direction: column;
align-items: center;
padding-top: 80rpx;
padding-bottom: 100rpx;
.img {
// background-color: red;
width: 52vw;
margin-left: -100rpx;
}
.tip {
font-family: PingFangSC;
font-weight: 400;
font-size: 30rpx;
color: #666666;
line-height: 40rpx;
text-align: center;
font-style: normal;
}
}
}
//
.information-details-div {
display: flex;
flex-direction: column;
padding: 34rpx 20rpx 30rpx 48rpx;
margin: 44rpx 28rpx 0 28rpx;
border-radius: 16rpx;
position: relative;
background-color: #fff;
opacity: .8;
box-shadow: 2rpx -2rpx 2rpx #fff;
&>.top {
display: flex;
justify-content: space-between;
&>.left {
&>.top {
font-family: PingFangSC;
font-weight: 700;
font-size: 34rpx;
color: #000000;
line-height: 34rpx;
text-align: left;
font-style: normal;
}
&>.mid {
font-weight: 700;
font-size: 66rpx;
line-height: 66rpx;
text-align: left;
font-style: normal;
margin-top: 34rpx;
margin-bottom: 30rpx;
}
&>.bottom {
display: flex;
align-items: center;
font-family: PingFangSC;
font-weight: 400;
font-size: 24rpx;
color: #999999;
line-height: 24rpx;
text-align: left;
font-style: normal;
}
}
&>.right {
margin-left: 20rpx;
}
}
&>.bottom {
font-family: PingFangSC;
font-weight: 400;
font-size: 26rpx;
color: #666666;
line-height: 26rpx;
text-align: left;
font-style: normal;
margin-top: 26rpx;
.title-icon,
.time-icon {
display: flex;
align-items: center;
padding-right: 12rpx;
.img {
width: 26rpx;
}
}
.title-div {
display: flex;
align-items: center;
padding-bottom: 24rpx;
}
.time-and-exam-button {
display: flex;
align-items: center;
padding-right: 12rpx;
.examination {
display: flex;
align-items: center;
color: #0066FF;
.back-icon {
position: relative;
width: 40rpx;
height: 40rpx;
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 #0066FF;
border-left: 4rpx solid #0066FF;
transform: rotate(135deg);
}
}
}
}
.loading-pass {
color: #0066FF;
font-family: DINAlternate, DINAlternate;
font-weight: bold;
font-size: 65rpx;
color: #0066FF;
letter-spacing: 12rpx
}
.no-pass {
color: #D70C18;
}
.pass {
color: #0066FF;
}
}
.nav-div {
position: relative;
.title {
height: 70rpx;
font-family: PingFangSC;
font-weight: 500;
font-size: 34rpx;
color: #000000;
line-height: 70rpx;
text-align: center;
font-style: normal;
}
.back_div {
margin-right: 10rpx;
position: absolute;
left: 25rpx;
top: 0;
padding: 15rpx;
.back-icon {
position: relative;
width: 40rpx;
height: 40rpx;
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 #000;
border-left: 4rpx solid #000;
transform: rotate(-45deg);
}
}
}
.main_div {
display: flex;
flex-direction: column;
background-color: #F0F5F9;
/* 添加30度角的斜向上渐变,高度限制为400px */
background-image: linear-gradient(30deg, #F0F5F9, #EBF1FF);
/* 渐变背景高度400px,宽度充满容器 */
background-size: 100% 600rpx;
/* 防止渐变背景重复 */
background-repeat: no-repeat;
min-height: 100vh;
margin: 0;
overflow: hidden;
position: relative;
}
</style>
@@ -1,47 +1,38 @@
<template>
<view class="scroll_div">
<scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="scrolltolower">
<view class="item" v-for="item in data_list">
<view class="img_div">
<image class="img" src="@/static/images/test/4.png" mode="scaleToFill"></image>
<view class="subscript">
7.9
</view>
</view>
<view class="right_div">
<view class="title ellipsis-text">
对公小程序开户操作流对公小程序开户操作流程
</view>
<view class="tag_div">
<view class="tag">
公金业务
<scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="scrolltolower" :show-scrollbar="false">
<uv-swipe-action :autoClose="true">
<uv-swipe-action-item class="item-swipe-action" :options="options" :threshold="40" :index="index"
:name="index" v-for="(item,index) in data_list" @click="swipeActionClick">
<view class="item" @touchmove.stop>
<view class="img_div">
<image-preview class="img" :src="item?.ossAddr" mode="scaleToFill"></image-preview>
<view class="subscript">
{{item.evalGrade ?? 0}}
</view>
</view>
<view class="tag">
中级
</view>
<view class="tag">
中级
</view>
<view class="tag">
中级
</view>
<view class="tag">
中级
</view>
<view class="tag">
中级
<view class="right_div">
<view class="title ellipsis-text">
{{item.crsName}}
</view>
<view class="tag_div">
<view class="tag" v-for="tagItem in item?.tagCataList ?? []">
{{tagItem?.tagName}}
</view>
</view>
<view class="time_and_num">
<view class="mr-10">
发布{{item.issuTm?.substr(0, 10)}}
</view>
<view>
已学{{item.accmStdyCnt}}
</view>
</view>
</view>
</view>
<view class="time_and_num">
<view class="mr-10">
发布2025-05-13
</view>
<view>
已学22345
</view>
</view>
</view>
</view>
</uv-swipe-action-item>
</uv-swipe-action>
<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>
@@ -59,8 +50,16 @@
nextTick
} from 'vue'
import {
queryTraCrsBbsInfoByCrsId
} from '@/api/courseDetail.js';
queryTraPersonalCollectionCrsPaging,
deleteTraPersonalCollectionById
} from '@/api/favorites.js';
import common from '@/common/common';
const options = [{
text: '删除',
style: {
backgroundColor: '#f56c6c'
}
}]
const getData = (from = '') => {
if (from == 'first') {
if (total.value !== -1) {
@@ -70,17 +69,14 @@
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(() => {
queryTraCrsBbsInfoByCrsId({
crsId: 'CRS0250181220722025070408313900000018729',
queryTraPersonalCollectionCrsPaging({
page: page.value,
limit: limit
}).then(res => {
@@ -95,6 +91,21 @@
})
}, 200)
}
const swipeActionClick = (click_item) => {
const index = click_item['name']
const item = data_list[index]
common.show('提示', '确认删除吗?').then(res => {
if (!res) return;
common.loading()
const collectId = '11'
deleteTraPersonalCollectionById({collectId:item.collectId}).then(()=>{
data_list.splice(index, 1); //
total.value -= 1 //
}).finally(() => {
common.hideLoading()
})
})
}
const scrolltolower = (item) => {
getData()
};
@@ -104,6 +115,8 @@
</script>
<style scoped lang="scss">
.scroll_div {
background-color: #F1F5FA;
padding: 22rpx;
@@ -114,21 +127,33 @@
background-color: #fff;
border-radius: 16rpx;
}
.item-swipe-action {
margin: 32rpx 22rpx;
overflow: hidden;
:deep(.uv-swipe-action-item__right__button__wrapper) {
border-radius: 20rpx !important;
}
}
.scroll-Y .item {
height: 170rpx;
margin: 32rpx 22rpx;
display: flex;
// background-color: red;
.img_div {
position: relative;
width: 224rpx;
height: 168rpx;
overflow: hidden;
border-radius: 22rpx;
.img {
width: 224rpx;
height: 168rpx;
}
.subscript {
position: absolute;
right: 0;
@@ -143,7 +168,7 @@
align-items: center;
justify-content: center;
background-color: #EF5705;
color: #FFFFFF ;
color: #FFFFFF;
}
}
@@ -154,7 +179,7 @@
display: flex;
flex-direction: column;
justify-content: space-between;
.title {
font-family: PingFangSC;
font-weight: 500;
@@ -168,6 +193,7 @@
flex-wrap: wrap;
height: 38rpx;
overflow: hidden;
.tag {
height: 38rpx;
padding: 0 10rpx;
@@ -3,7 +3,7 @@
<scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="scrolltolower">
<view class="item" :class="getStatusClass(index)" v-for="(item,index) in data_list">
<view class="img_div">
<image class="img" src="@/static/images/test/4.png" mode="scaleToFill"></image>
<image-preview class="img" :src="item?.ossAddr" mode="scaleToFill"></image-preview>
<view class="subscript" v-if="index % 3==0">
进行中
</view>
@@ -16,21 +16,22 @@
</view>
<view class="right_div">
<view class="title ellipsis-text">
对公小程序开户操作流对公小程序开户操作流程
{{item.taskName}}
</view>
<view class="time_div">
起止时间<text class="blod_color">2025-05-13至2025-08-13</text>
起止时间<text class="blod_color">{{item.startTm?.substr(0, 10)}}{{item.endTm?.substr(0, 10)}}</text>
</view>
<view class="people_progress_div">
<view class="mr-10">
完成人数<text class="blod_color">34/125</text>
完成人数<text class="blod_color">{{item.taskFinishSums ?? 0}}/{{item.taskSums ?? 0}}</text>
</view>
<view>
我的进度<text class="blod_color">25%</text>
我的进度<text class="blod_color">{{item.myProcess ?? 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>
@@ -48,8 +49,8 @@
nextTick
} from 'vue'
import {
queryTraCrsBbsInfoByCrsId
} from '@/api/courseDetail.js';
queryTraPersonalCollectionTaskPaging
} from '@/api/favorites.js';
const getData = (from = '') => {
if (from == 'first') {
if (total.value !== -1) {
@@ -67,8 +68,7 @@
console.log(status.value, '阿斯顿撒');
setTimeout(() => {
queryTraCrsBbsInfoByCrsId({
crsId: 'CRS0250181220722025070408313900000018729',
queryTraPersonalCollectionTaskPaging({
page: page.value,
limit: limit
}).then(res => {
@@ -148,7 +148,7 @@
color: #D70C18;
}
}
.scroll-Y .item {
height: 170rpx;
margin: 32rpx 22rpx;
+18 -18
View File
@@ -13,10 +13,10 @@
: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>
: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 class="swiper" :current="tabAct" :indicator-dots="false" :disable-touch="true" @change="swiperChange">
<swiper-item>
<FavoritesCourse ref="courseRef"></FavoritesCourse>
</swiper-item>
@@ -39,17 +39,13 @@
computed,
nextTick,
onMounted,
watch
watch
} from 'vue';
import {
queryTraCrsBbsInfoByCrsId,
replyTraCrsBbsInfo,
qryChildTraCrsBbsInfo
} from '@/api/courseDetail.js';
LineBg
} from '@/enum.js'
import common from '@/common/common';
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
const lineBg =
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAOCAYAAAAvxDzwAAABL0lEQVQ4T6XSv0uCURTG8e9jgpRNDS1BU1sELUFLQVM1tgQFtcR7A8m1LQqaLGhOkQKH/o5aKiiHlgiE0K1oCYLAMk9ov/RF8e313u2ew4dzzzmi2+NsA9gH3hCr6srzbAJxDkS/nbvwYNJilMkDow1FXYUHneWAlV/MqN3ZcKCzHWDb164MGa3/H/Qshdj0YbdUmORIL8HBNRsgShZjoQkznvioY/e19wCgCccSsAcM+bBnjHmyuvx5bw8mrJ93FoEkYrzFej0g5kjrpjH2BTrro8oIYhgYQ0xhTCPibfb0ggjLHKrojwvPEogDIBZgycsYKQrscqpKq3zh7BXo7YBVgRMibLWqqvnLzh6BwTZgESNHD8edoL+hOJupT9CII0oYJcQ14oy0CgHa0JTyCeBLVNeWygE5AAAAAElFTkSuQmCC";
const courseRef = ref(null);
const taskRef = ref(null);
const tabAct = ref(0);
@@ -58,7 +54,7 @@
}, {
name: '任务收藏'
}]);
const tabChange = (item) => {
tabAct.value = item.index;
};
@@ -66,13 +62,15 @@
tabAct.value = item.detail.current;
};
onMounted(() => {
watch(tabAct, (newValue, oldValue) => {
if(newValue === 0) {
courseRef.value?.getData('first')
} else if(newValue === 1) {
taskRef.value?.getData('first')
}
}, { immediate: true }) // immediateonMounted
watch(tabAct, (newValue, oldValue) => {
if (newValue === 0) {
courseRef.value?.getData('first')
} else if (newValue === 1) {
taskRef.value?.getData('first')
}
}, {
immediate: true
}) // immediateonMounted
})
</script>
@@ -80,6 +78,7 @@
$bg-margin-left: 50rpx;
.my_tabs {
// 穿
:deep(.uv-tabs__wrapper__nav__line) {
height: 26rpx !important;
@@ -88,7 +87,7 @@
background-repeat: no-repeat !important;
}
}
.swiper {
height: calc(100vh - var(--status-bar-height) - 54rpx - 88rpx - 20rpx - 10rpx);
}
@@ -132,6 +131,7 @@
align-items: center;
justify-content: center;
background-color: #fff;
.back_div {
position: absolute;
left: 20rpx;
+7 -4
View File
@@ -31,18 +31,18 @@
<view class="talking-cont">
<MarkdownPreview :mdString="mdText" />
</view>
<view class="btns-cont" v-if="!props.isAnswering">
<view class="btns-cont" v-if="!props.isLoading">
<view class="replay-btn" @click="reAnswer">
<image class="icon" src="@/static/images/dialog/answer-restart1.png" style="width: 100%;height: 100%;"></image>
</view>
<!-- <view class="replay-btn" @click="stopAnswer">
<view class="replay-btn" @click="stopAnswer" v-if="props.isAnswering">
<image class="icon" src="@/static/images/dialog/answer-stop1.png" style="width: 100%;height: 100%;"></image>
</view> -->
</view>
<view class="replay-btn" @click="zanAnswer">
<image class="icon" src="@/static/images/dialog/answer-zan1.png" style="width: 100%;height: 100%;"></image>
<image class="icon" src="@/static/images/dialog/answer-yizan1.png" style="width: 100%;height: 100%;"></image>
</view>
<view class="play-btn">
<view class="play-btn" @click="feedbackAnswer">
<image class="icon" src="@/static/images/dialog/answer-fankui1.png" style="width: 100%;height: 100%;"></image>
<image class="icon" src="@/static/images/dialog/answer-yifankui1.png" style="width: 100%;height: 100%;"></image>
</view>
@@ -102,6 +102,9 @@
const zanAnswer = () => {
emit('handleEvents', 'great')
}
const feedbackAnswer = ()=>{
emit('handleEvents', 'feedback')
}
</script>
<style scoped lang="scss">
+222
View File
@@ -0,0 +1,222 @@
<template>
<uni-popup ref="feedbackPopupRef" class="popup">
<view class="feedback_popup_div" :style="{marginBottom:feedback_popup_bottom}">
<view class="title_div">
<view class="text">
反馈
</view>
<view class="popup_back_div" @click="openFeedback(false)">
<image :src="optionErrorIcon('#000000')" class="img"></image>
</view>
</view>
<view class="feedback_item_div">
<view class="feedback_item"
:class="{'feedback_item_clidked':feedbackInfo.type.includes(feedback_type_item.value)}"
@click="feedback_item_click(feedback_type_item.value)"
v-for="feedback_type_item in feedbackTypeList">{{feedback_type_item.label}}</view>
</view>
<view class="feedback_text_area_div">
<uv-textarea height="124" count :maxlength="100" placeholder="请输入反馈内容..." :adjustPosition="false"
v-model="feedbackInfo.text"></uv-textarea>
</view>
<view class="feedback_button">
<uv-button class="button" type="primary" :throttleTime="100" text="提交" color="#0066FF"
custom-style="color:#FFFFFF;borderRadius:16rpx;height:92rpx;"
@click="submit_feedback_fun()"></uv-button>
</view>
</view>
</uni-popup>
</template>
<script setup>
import {
ref,
reactive,
computed,
onMounted,
nextTick
} from 'vue';
import {
insertTraAskFeedback
} from "@/api/dialog.js"
import {
optionErrorIcon
} from '@/common/imgSvg'
import common from '../../../common/common';
const feedback_popup_bottom = ref('0px') //
const feedbackPopupRef = ref(null)
// FM("01", ""),
// AE("02", ""),
// NH("03", ""),
// OTHER("04", ""),
const feedbackTypeList = reactive([{
value: "01",
label: "虚假信息",
}, {
value: "02",
label: "回答不准确",
}, {
value: "03",
label: "没有帮助",
}, {
value: "04",
label: "其他",
}])
const feedbackInfo = reactive({
type: [], //
text: '', //
examId: '', // ID
qnsId: '', // IDID
})
const feedback_item_click = (value) => {
//
feedbackInfo.type = [value]
//
// if (feedbackInfo.type.includes(value)) {
// feedbackInfo.type = feedbackInfo.type.filter(item => item !== value); //
// } else {
// feedbackInfo.type.push(value); //
// }
}
const answerData = ref({})
//
const submit_feedback_fun = () => {
// todo
console.log('反馈提交');
const params = JSON.parse(JSON.stringify({
askId: answerData.value.seqNo,
fbkTyp: feedbackInfo.type[0],
fbkContent: feedbackInfo.text
}))
insertTraAskFeedback(params).then(res=>{
common.msg('反馈提交成功!')
feedbackInfo = {
type: [], //
text: '', //
examId: '', // ID
qnsId: '', // IDID
}
emit('feedbackAnswer', params)
close()
})
}
const openFeedback = (status) => {
if (status) {
feedbackPopupRef.value.open('bottom')
// feedbackInfo.examId
const systemInfo = uni.getSystemInfoSync();
//
const safeAreaBottomHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom;
//#ifdef APP-PLUS
nextTick(() => {
uni.onKeyboardHeightChange(res => {
let keyboardHeight = res.height;
// iOS
if (systemInfo.platform === 'ios') {
keyboardHeight = Math.max(0, keyboardHeight - safeAreaBottomHeight); //
}
feedback_popup_bottom.value = `${keyboardHeight}px`;
});
})
// #endif
} else {
feedbackPopupRef.value.close()
}
}
const open = (data) => {
answerData.value = JSON.parse(JSON.stringify(data))
openFeedback(true)
}
const close = () => {
openFeedback()
}
defineExpose({
open,
close
})
</script>
<style scoped lang="scss">
.feedback_popup_div {
width: 100%;
height: 100%;
background-color: #FFFFFF;
padding: 10rpx 34rpx;
display: flex;
flex-direction: column;
align-items: center;
border-radius: 16rpx 16rpx 0px 0px;
position: relative;
.title_div {
width: 100%;
text-align: center;
padding: 30rpx 0;
font-family: PingFangSC;
font-weight: 600;
font-size: 34rpx;
color: #000000;
text-align: center;
font-style: normal;
border-bottom: 2rpx solid #EFEFEF;
}
.popup_back_div {
width: 60rpx;
height: 60rpx;
position: absolute;
top: 30rpx;
right: 30rpx;
display: flex;
align-items: center;
justify-content: center;
.img {
width: 30rpx;
height: 30rpx;
}
}
.feedback_item.feedback_item_clidked {
border: 2rpx solid #0066FF !important;
background-color: #fff !important;
}
.feedback_item_div {
// display: flex;
// align-items: center;
// justify-content: space-between;
width: 100%;
margin: 30rpx 0;
.feedback_item {
float: left;
width: calc(50% - 20rpx);
border: 2rpx solid #F0F0F0;
background-color: #F0F0F0;
border-radius: 16rpx;
padding: 26rpx 36rpx;
font-family: PingFangSC;
font-weight: 500;
font-size: 30rpx;
color: #000000;
text-align: center;
margin-bottom: 20rpx;
&:nth-child(2n){
margin-left: 40rpx;
}
}
}
.feedback_text_area_div {
width: 100%;
margin-bottom: 40rpx;
}
.feedback_button {
width: 100%;
margin-bottom: 20rpx;
}
}
</style>
+82
View File
@@ -0,0 +1,82 @@
<template>
<uni-popup ref="historyPopupRef" class="popup">
<view class="history-popup-view">
<view class="history-title">
<image class="icon-image" src="@/static/images/dialog/history-icon.png" mode=""></image>
对话记录
</view>
<view class="history-list">
<view class="history-item" v-for="item in 8" @click="chooseHistory(item)">
{{'信息补录操作时,需录入什么信息?信息补录操作时,需录入什么信息?'}}
</view>
</view>
</view>
</uni-popup>
</template>
<script setup>
import {
ref,
reactive,
computed,
onMounted,
nextTick
} from 'vue';
const historyPopupRef = ref()
const open = () => {
openFeedback(true)
}
const close = () => {
openFeedback()
}
const openFeedback = (status) => {
if (status) {
historyPopupRef.value.open('left')
} else {
historyPopupRef.value.close()
}
}
const chooseHistory = (item) => {
console.log(item)
}
defineExpose({
open,close
})
</script>
<style scoped lang="scss">
.history-popup-view{
width: 582rpx;
height: 100%;
background-color: #fff;
padding: 40rpx;
padding-top: calc(20rpx + var(--status-bar-height));
.history-title{
height: 40rpx;
line-height: 40rpx;
padding-left: 40rpx;
position: relative;
font-size: 29rpx;
color: #000;
margin-bottom: 20rpx;
.icon-image{
position: absolute;
left:0;
height: 32rpx;
width: 32rpx;
top: 4rpx;
}
}
.history-list{
.history-item{
height: 78rpx;
line-height: 78rpx;
font-size: 28rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}
}
</style>
+93
View File
@@ -0,0 +1,93 @@
<template>
<uni-popup ref="previewPopupRef" class="popup">
<view>
<Table :columns="columns" :data="tableData" >
<template #cell="{ row, column }">
<!-- 自定义 age -->
<template v-if="column.key === 'age'">
<view @click="test" :style="{ color: '#f00' }">
{{ row.age }}
</view>
</template>
<!-- 默认渲染 -->
<template v-else>
{{ row[column.key] }}
</template>
</template>
<!-- 操作列插槽 -->
<!-- <template #actions="{ row, index }">
<button type="primary" size="mini" @click="handleDelete(row, index)">删除</button>
</template> -->
</Table>
</view>
</uni-popup>
</template>
<script setup>
import {
ref,
onMounted,
computed,
} from 'vue'
import Table from './table.vue'
//
const columns = ref([{
title: '姓名',
key: 'name',
width: '120rpx'
},
{
title: '年龄',
key: 'age',
width: '120rpx',
slot: 'age'
},
{
title: '地址',
width: '180rpx',
key: 'address'
}
])
//
const tableData = ref([{
name: '张三',
age: 25,
address: '北京市'
},
{
name: '李四',
age: 30,
address: '上海市'
},
{
name: '王五',
age: 28,
address: '广州市'
}
])
const previewPopupRef =ref()
const openFeedback = (status) => {
if (status) {
previewPopupRef.value.open('bottom')
} else {
previewPopupRef.value.close()
}
}
const open = (data) => {
openFeedback(true)
}
const close = () => {
openFeedback()
}
defineExpose({
open,
close
})
</script>
<style scoped lang="scss">
</style>
+172
View File
@@ -0,0 +1,172 @@
<template>
<view class="table-container">
<!-- 表格 -->
<view class="table">
<!-- 表头 -->
<view class="table-header">
<view v-if="canCheck" class="header-cell checkbox-cell">
<checkbox-group @change="handleSelectAll">
<checkbox :checked="isAllSelected" />
</checkbox-group>
</view>
<view v-for="(column, index) in columns" :key="index" class="header-cell"
:style="{ width: column.width || 'auto' }">
{{ column.title }}
</view>
<view v-if="hasActions" class="header-cell actions-cell">操作</view>
</view>
<!-- 表格行 -->
<view class="table-body">
<view v-for="(row, rowIndex) in data" :key="rowIndex" class="table-row"
:class="{ selected: selectedRows.includes(row) }">
<!-- 复选框 -->
<view v-if="canCheck" class="body-cell checkbox-cell">
<checkbox-group @change="(e) => handleSelectRow(row, e)">
<checkbox :checked="selectedRows.includes(row)" />
</checkbox-group>
</view>
<!-- 数据列 -->
<view v-for="(column, colIndex) in columns" :key="colIndex" class="body-cell"
:style="{ width: column.width || 'auto' }">
<slot name="cell" :row="row" :column="column" :index="rowIndex">
<!-- 默认渲染 -->
{{ row[column.key] }}
</slot>
</view>
<!-- 操作列 -->
<view v-if="hasActions" class="body-cell actions-cell">
<slot name="actions" :row="row" :index="rowIndex"></slot>
</view>
</view>
</view>
</view>
<!-- 加载更多 -->
<view v-if="hasMore" class="load-more" @click="loadMore">
<text>点击加载更多</text>
</view>
</view>
</template>
<script setup>
import {
ref,
computed,
useSlots
} from 'vue'
// props
const props = defineProps({
columns: { //
default: () => ([]),
type: Array
},
data: { //
default: () => ([]),
type: Array
},
canCheck: { //
default: false,
type: Boolean
},
hasMore: { //
default: false,
type: Boolean
},
})
//
const emit = defineEmits(['select-all', 'select-row', 'load-more'])
//
const slots = useSlots()
//
const selectedRows = ref([])
//
const isAllSelected = computed(() => {
return selectedRows.value.length === props.data.length
})
//
const hasActions = computed(() => {
return !!slots.actions // actions
})
//
const handleSelectAll = (e) => {
if (e.detail.value.length > 0) {
selectedRows.value = [...props.data]
} else {
selectedRows.value = []
}
emit('select-all', selectedRows.value)
}
//
const handleSelectRow = (row, e) => {
if (e.detail.value.length > 0) {
selectedRows.value.push(row)
} else {
selectedRows.value = selectedRows.value.filter((r) => r !== row)
}
emit('select-row', selectedRows.value)
}
//
const loadMore = () => {
emit('load-more')
}
</script>
<style scoped>
.table-container {
width: 100%;
background-color: #fff;
}
.table {
width: 100%;
border-collapse: collapse;
}
.table-header,
.table-row {
display: flex;
align-items: center;
border-bottom: 2rpx solid #eee;
}
.header-cell,
.body-cell {
padding: 10rpx;
text-align: left;
border-right: 2rpx solid #eee;
box-sizing: border-box;
height: 100%;
}
.checkbox-cell {
width: 100rpx;
text-align: center;
}
.actions-cell {
display: flex;
justify-content: flex-end;
}
.selected {
background-color: #f0f0f0;
}
.load-more {
text-align: center;
padding: 10rpx;
color: #007aff;
cursor: pointer;
}
</style>
+2 -2
View File
@@ -45,10 +45,10 @@
watch(() => props.talkingInfo, () => {},{deep: true,immediate: true})
const { talkingType } = toRefs(props)
const handleEvents = (type) => {
emit('handleEvents', type, props.talkingInfo)
emit('handleEvents',{ type, data: props.talkingInfo, id:""})
}
const changePlay = (id) => {
emit('handleEvents', 'changePlay', props.talkingInfo, id)
emit('handleEvents', {type: 'changePlay', data: props.talkingInfo, id})
}
</script>
+33 -12
View File
@@ -11,7 +11,7 @@
AI问答
<view class="seek-setting">
<image src="@/static/images/dialog/new-dialog.png" alt="" class="image-icon-new" @click="createNewDialog"></image>
<image src="@/static/images/dialog/history.png" alt="" class="image-icon"></image>
<image src="@/static/images/dialog/history.png" alt="" class="image-icon" @click="showHistory"></image>
</view>
</view>
@@ -84,6 +84,10 @@
<TouchBtn class="talk-btns" @uploadVoice="uploadRecordNow" @submitAnswer="submitAnswerNow"
@startRecord="startRecordCallback" :loadingText="sendLoadingText" :isLoading="!answerIsOver"
:isDisabled="false" />
<!-- 反馈组件 -->
<Feedback ref="feedbackRef"></Feedback>
<History ref="historyRef"></History>
<PreviewVue ref="previewRef"/>
</scroll-view>
</view>
</template>
@@ -101,6 +105,7 @@
import common from '@/common/common';
import TouchBtn from '@/pages/course/components/touchBtn.vue'
import TalkingItem from './components/talking-item.vue';
import PreviewVue from './components/preview.vue';
import {
useSocketStore
} from "@/store/socket.js"
@@ -128,8 +133,12 @@
commonUploadVoiceFile
} from "@/api/common.js"
import {
queryHotQuestionApi
queryHotQuestionApi,
insertTraAskFeedback
} from "@/api/dialog.js"
import Feedback from './components/feedback.vue'
import History from './components/history.vue'
const {
statusBarHeight
} = uni.getWindowInfo()
@@ -141,6 +150,7 @@
SocketObj
} = storeToRefs(socketStore)
const feedbackRef = ref()
const userInfo = ref(getUserInfo())
const questionList = ref([
// '',
@@ -275,7 +285,7 @@
return
}
if (commond === 'ASK-STOP') {
// console.log('!')
console.log('停止回答标记!')
stopAnswerCallBack.value && stopAnswerCallBack.value(askData.value)
setTimeout(() => {
stopAnswerCallBack.value = null
@@ -354,10 +364,18 @@
}
const stopAnswerCallBack = ref(null)
const talkItemEvents = (type, data, id = '') => {
const talkItemEvents = ({type, data, id}) => {
switch (type) {
case 'reAnswer':
console.log('重新提问回答')
//
sendMessage({
"commond": 'ASK-STOP',
"body": {
reqBatch: reqBatch.value,
seqNo: seqNo.value,
}
})
sendMessage({
"commond": 'ASK',
"body": data.askData
@@ -369,14 +387,6 @@
// "body": $data
// })
// }
// //
// sendMessage({
// "commond": 'ASK-STOP',
// "body": {
// reqBatch: reqBatch.value,
// seqNo: seqNo.value,
// }
// })
break;
case 'stop':
console.log('停止获取数据')
@@ -394,10 +404,17 @@
console.log('播放/暂停')
activeVoiceTalkingItemId.value = id
break;
case 'feedback':
feedbackRef.value.open(data)
break;
default:
break;
}
}
const historyRef = ref(null)
const showHistory = () => {
historyRef.value.open()
}
const routerTo = (type) => {
switch (type) {
case 'AI学':
@@ -546,8 +563,10 @@
return
}
})
const previewRef = ref()
onMounted(() => {
loadData()
// previewRef.value.open()
})
const refreshData = () => {
@@ -558,12 +577,14 @@
const setHeight = (res) => {
keyboardHeight.value = res.height +'px'
}
//#ifdef APP-PLUS
onHide(() => {
uni.offKeyboardHeightChange(setHeight)
})
onShow(() => {
uni.onKeyboardHeightChange(setHeight)
})
// #endif
onUnload(() => {
watchFlag.value = 1
socketStore?.closeSocket()
+7 -7
View File
@@ -89,11 +89,11 @@
<view class="title">AI问答</view>
</view>
<view class="item" @click="common.navigateTo('/pages/examination/index')">
<view class="item">
<image class="icon" src="@/static/images/index/navigation_ai.png"></image>
<view class="title">AI陪练</view>
</view>
<view class="item">
<view class="item" @click="common.navigateTo('/pages/learningTasks/index')">
<image class="icon" src="@/static/images/index/navigation_learning_tasks.png"></image>
<view class="title">学习任务</view>
</view>
@@ -130,7 +130,7 @@
<view class="scroll-view-item" v-for="(item,index) in hot_class_list" :key="index">
<view class="item_div">
<uv-skeleton :loading="!item.crsNum" :rows="3" avatar avatar-shape="square" :title="false">
<view class="item" @click="goto_course_detail(item.crsNum)">
<view class="item" @click="goto_course_detail(item.crsId)">
<view class="left">
<image-preview class="img-box img" :imgId="item.imgId" mode="aspectFill"
:isCache="true" :width="240" :height="240"></image-preview>
@@ -164,7 +164,7 @@
<view class="scroll-view-item" v-for="(item,index) in recommend_class_list" :key="index">
<view class="item_div">
<uv-skeleton :loading="!item.crsNum" :rows="3" avatar avatar-shape="square" :title="false">
<view class="item" @click="goto_course_detail(item.crsNum)">
<view class="item" @click="goto_course_detail(item.crsId)">
<view class="left">
<image-preview class="img-box img" :imgId="item.imgId" mode="aspectFill"
:isCache="true" :width="240" :height="240"></image-preview>
@@ -197,7 +197,7 @@
<view class="scroll-view-item" v-for="(item,index) in new_class_list" :key="index">
<view class="item_div">
<uv-skeleton :loading="!item.crsNum" :rows="3" avatar avatar-shape="square" :title="false">
<view class="item" @click="goto_course_detail(item.crsNum)">
<view class="item" @click="goto_course_detail(item.crsId)">
<view class="left">
<image-preview class="img-box img" :imgId="item.imgId" mode="aspectFill"
:isCache="true" :width="240" :height="240"></image-preview>
@@ -389,8 +389,8 @@
common.navigateTo('/pages/search/search')
}
//
const goto_course_detail = (crsNum) => {
common.navigateTo('/pages/courseDetail/index?crsNum=' + crsNum)
const goto_course_detail = (crsId) => {
common.navigateTo('/pages/courseDetail/index?crsId=' + crsId)
}
const scrolltolower = () => {
common.navigateTo('/pages/index/dialog', {
@@ -0,0 +1,232 @@
<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="img_div">
<image class="img" src="@/static/images/test/4.png" mode="scaleToFill"></image>
<view class="subscript" v-if="index % 3==0">
进行中
</view>
<view class="subscript" v-if="index % 3==1">
已完成
</view>
<view class="subscript" v-if="index % 3==2">
已超时
</view>
</view>
<view class="right_div">
<view class="title ellipsis-text">
{{item.taskName}}
</view>
<view class="time_div" v-if="item.limitTyp==='02'">
起止时间<text class="blod_color">{{item.startTm?.substr(0, 10)}}{{item.endTm?.substr(0, 10)}}</text>
</view>
<view class="people_progress_div">
<view class="mr-10">
完成人数<text class="">{{item.taskFinishSums ?? 0}}/{{item.taskSums ?? 0}}</text>
</view>
<view>
进度<text class="">2/4门课程</text>
</view>
</view>
</view>
</view>
<uv-load-more v-if="total != 0" :status="status" loadmore-text="轻轻上拉加载" :height="30"></uv-load-more>
</scroll-view>
</view>
</template>
<script setup>
const status = ref('loading') // loadmore - loading - nomore -
const limit = 15
const total = ref(-1)
const page = ref(0)
const data_list = reactive([])
import {
ref,
reactive,
onMounted,
nextTick
} from 'vue'
import {
queryAllTraTaskInfoByUserId,
} from '@/api/learningTasks.js';
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++
}
setTimeout(() => {
queryAllTraTaskInfoByUserId({
state: '01',
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'
}
console.log(status.value, '阿斯顿撒');
})
}, 200)
}
const getStatusClass = (index) => {
const remainder = index % 3;
if (remainder === 0) return 'in_progress';
if (remainder === 1) return 'completed';
return 'expired';
};
const scrolltolower = (item) => {
getData()
};
defineExpose({
getData
})
</script>
<style scoped lang="scss">
.scroll_div {
background-color: #F1F5FA;
padding: 22rpx;
}
.scroll-Y {
height: calc(100vh - var(--status-bar-height) - 88rpx - 80rpx - 88rpx - 20rpx - 30rpx);
// height: calc(100vh - var(--status-bar-height) - 54rpx - 88rpx - 20rpx - 44rpx);
background-color: #fff;
border-radius: 16rpx;
}
.scroll-Y {
.item.in_progress {
//
.subscript {
color: #0066FF;
background-color: #DAF0FF;
}
.blod_color {
color: #0066FF;
}
}
.item.completed {
//
.subscript {
color: #FFFFFF;
background-color: #33C583 !important;
}
.blod_color {
color: #0066FF;
}
}
.item.expired {
//
.subscript {
color: #FFFFFF;
background-color: #EF5705;
}
.blod_color {
color: #D70C18;
}
}
}
.scroll-Y .item {
height: 170rpx;
margin: 32rpx 22rpx;
display: flex;
.img_div {
position: relative;
width: 224rpx;
height: 168rpx;
overflow: hidden;
border-radius: 22rpx;
.img {
width: 226rpx;
height: 168rpx;
}
.subscript {
position: absolute;
right: 0;
top: 0;
width: 92rpx;
height: 46rpx;
border-radius: 0px 0px 0px 22rpx;
font-family: PingFangSC;
font-weight: 400;
font-size: 22rpx;
line-height: 32px;
display: flex;
align-items: center;
justify-content: center;
}
}
.right_div {
flex: 1;
overflow: hidden;
margin-left: 24rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
.title {
font-family: PingFangSC;
font-size: 30rpx;
font-weight: 600;
color: #333333;
line-height: 44rpx;
}
.time_div {
font-family: PingFangSC;
font-weight: 400;
font-size: 23rpx;
color: #666;
line-height: 23rpx;
flex-wrap: nowrap;
height: 23rpx;
overflow: hidden;
}
.people_progress_div {
display: flex;
font-family: PingFangSC;
font-weight: 400;
font-size: 23rpx;
color: #666;
margin-bottom: 23rpx;
line-height: 23rpx;
flex-wrap: nowrap;
height: 23rpx;
overflow: hidden;
}
}
}
</style>
+8
View File
@@ -0,0 +1,8 @@
<template>
</template>
<script>
</script>
<style>
</style>
+208
View File
@@ -0,0 +1,208 @@
<template>
<view class="max_page detail-main">
<nav-bar :is_seat="false"></nav-bar>
<view class="fixed_search_div">
<view class="back_div" @click="common.navigateBack()">
<view class="back-icon"></view>
</view>
<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>
</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>
</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>
</swiper-item>
<swiper-item>
<listItem :ref="el => listItemRefs[1] = el" status="01"></listItem>
</swiper-item>
<swiper-item>
<listItem :ref="el => listItemRefs[2] = el" status="01"></listItem>
</swiper-item>
</swiper>
</view>
</view>
</view>
</template>
<script setup>
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';
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
//
const fixedCustomStyles = {
backgroundColor: "#F1F5FA",
paddingLeft: "40rpx",
paddingTop: "5px",
paddingBottom: "5px",
border: "none"
}
const suffixIconStyle = {
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 tabChange = (item) => {
tabAct.value = item.index;
};
const swiperChange = (item) => {
tabAct.value = item.detail.current;
};
onMounted(() => {
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;
left: 60rpx;
background-size: 28rpx !important;
background-repeat: no-repeat !important;
}
}
.swiper {
/*
状态栏 var(--status-bar-height)
标题高度88rpx
搜索栏高度80rpx
tab切换栏高度88rpx
下方滑动区域上下边距各10共20rpx
**/
height: calc(100vh - var(--status-bar-height) - 88rpx - 80rpx - 88rpx - 20rpx);
}
.swiper-item {
display: block;
height: 100%;
line-height: 300rpx;
text-align: center;
}
.detail-body {
background: #ffffff;
border-radius: 15rpx;
z-index: 101;
overflow: hidden;
.body-tab {
height: 88rpx;
}
}
.detail-main {
background-color: #F6F8FF;
overflow: hidden;
}
.title {
color: #000000;
font-size: 34rpx;
height: 34rpx;
font-weight: 600;
line-height: 34rpx;
}
.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;
}
}
.fixed_search_div {
padding: calc(20rpx + var(--status-bar-height)) 15rpx 34rpx 30rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
background-color: #fff;
// background-color: red;
// height: 180rpx;
position: relative;
.back_div {
position: absolute;
left: 20rpx;
top: var(--status-bar-height);
padding: 10rpx;
.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>
+12 -14
View File
@@ -15,36 +15,34 @@
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;background-color: red;"> 下拉显示</view>
<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="(index,item) in data_list">
v-for="(item, index) in data_list">
<view class="item">
<view class="icon">
<image class="img_100" :src="'/static/images/message_notification/type_1.png'"
mode="widthFix"></image>
<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">
2025-05-05
{{item.ctTime.substr(0, 16)}}
</view>
</view>
<view class="bottom">
<view class="note">
您的学习任务
<view class="note ellipsis-text">
{{item.noticeContent}}
</view>
<view class="num_div">
{{item}}
</view>
</view>
</view>
@@ -70,8 +68,9 @@
onLoad
} from '@dcloudio/uni-app'
import {
queryTraCrsBbsInfoByCrsId
} from '@/api/courseDetail.js';
queryTraPersonalMessageNoticePaging
} from '@/api/messageNotification.js';
const customStyle = {
backgroundColor: "#ffffff",
paddingLeft: "40rpx",
@@ -135,8 +134,7 @@
console.log(status.value, '阿斯顿撒');
setTimeout(() => {
queryTraCrsBbsInfoByCrsId({
crsId: 'CRS0250181220722025070408313900000018729',
queryTraPersonalMessageNoticePaging({
page: page.value,
limit: limit
}).then(res => {
+4 -3
View File
@@ -13,7 +13,7 @@
: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>
:lineColor="`url(${LineBg}) 10% 10%`"></uv-tabs>
</view>
<view class="uni-margin-wrap">
<swiper class="swiper" :current="tabAct" :indicator-dots="false" @change="swiperChange">
@@ -48,8 +48,9 @@
} from '@/api/courseDetail.js';
import common from '@/common/common';
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
const lineBg =
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAOCAYAAAAvxDzwAAABL0lEQVQ4T6XSv0uCURTG8e9jgpRNDS1BU1sELUFLQVM1tgQFtcR7A8m1LQqaLGhOkQKH/o5aKiiHlgiE0K1oCYLAMk9ov/RF8e313u2ew4dzzzmi2+NsA9gH3hCr6srzbAJxDkS/nbvwYNJilMkDow1FXYUHneWAlV/MqN3ZcKCzHWDb164MGa3/H/Qshdj0YbdUmORIL8HBNRsgShZjoQkznvioY/e19wCgCccSsAcM+bBnjHmyuvx5bw8mrJ93FoEkYrzFej0g5kjrpjH2BTrro8oIYhgYQ0xhTCPibfb0ggjLHKrojwvPEogDIBZgycsYKQrscqpKq3zh7BXo7YBVgRMibLWqqvnLzh6BwTZgESNHD8edoL+hOJupT9CII0oYJcQ14oy0CgHa0JTyCeBLVNeWygE5AAAAAElFTkSuQmCC";
import {
LineBg
} from '@/enum.js'
const courseRef = ref(null);
const aiSparringRef = ref(null);
const tabAct = ref(0);
+17 -12
View File
@@ -11,7 +11,6 @@
<view class="subscript" v-if="detailData.examStatText==='Y'">已完成</view>
<view class="title_div">
<view class="title ellipsis-text">{{detailData.papersName}}</view>
</view>
<view class="time">
<text class="color_3">起止时间</text><text
@@ -138,10 +137,10 @@
</view>
<view class="fl1"></view>
<view class="table_td">
20
{{allNumber}}
</view>
<view class="table_td">
100
{{allGrade}}
</view>
</view>
</view>
@@ -162,7 +161,8 @@
onLoad
} from '@dcloudio/uni-app';
import {
reactive
reactive,
computed
} from 'vue'
import {
startTraExamPapersInfo
@@ -177,33 +177,38 @@
examEndTm: '',
execPersionNumer: '',
planPersionNumber: '',
judgeNumber: 0,
singleNumber: 0,
multiNumber: 0,
essayNumber: 0,
judgeGrade: 0,
singleGrade: 0,
multiGrade: 0,
essayGrade: 0,
})
const customStyle = {
backgroundColor: '#0066FF',
border: '1px solid rgb(12, 123, 245)',
}
const allNumber = computed(() => detailData.judgeNumber + detailData.singleNumber + detailData.multiNumber + detailData.essayNumber)
const allGrade = computed(() => detailData.judgeGrade + detailData.singleGrade + detailData.multiGrade + detailData.essayGrade)
const goto_examination = async () => {
common.loading()
startTraExamPapersInfo({
examId : "1"
examId : detailData.examId
}).then(res => {
setPageCache('examination', res.body)
setPageCache('examination', {...res.body, examId:detailData.examId})
common.navigateTo('/pages/examination/index')
}).finally(() => {
common.hideLoading()
})
// papersId.value = e.papersId
// paperData.value = setPageCache('examination_'+papersId.value)
// if (!papersId.value || !paperData.value) {
// common.navigateBack()
// return
// }
}
onLoad((e) => {
const testing_hall_details = getPageCache('testing_hall_details')
Object.assign(detailData, {
...testing_hall_details
})
console.log('detailData', detailData);
})
</script>
+18 -17
View File
@@ -9,8 +9,7 @@
<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">
v-model="searchText" @confirm="search">
</uv-input>
<view class="search_div" @click="search"></view>
</view>
@@ -18,18 +17,21 @@
<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>
: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" :searchText="searchText" @gotoDetails="gotoDetails"></Content>
<Content :ref="el => contentRefs[0] = el" :index="tabAct" :searchText="searchText"
@gotoDetails="gotoDetails"></Content>
</swiper-item>
<swiper-item>
<Content :ref="el => contentRefs[1] = el" :index="tabAct" :searchText="searchText" @gotoDetails="gotoDetails"></Content>
<Content :ref="el => contentRefs[1] = el" :index="tabAct" :searchText="searchText"
@gotoDetails="gotoDetails"></Content>
</swiper-item>
<swiper-item>
<Content :ref="el => contentRefs[2] = el" :index="tabAct" :searchText="searchText" @gotoDetails="gotoDetails"></Content>
<Content :ref="el => contentRefs[2] = el" :index="tabAct" :searchText="searchText"
@gotoDetails="gotoDetails"></Content>
</swiper-item>
</swiper>
</view>
@@ -47,7 +49,9 @@
import {
onLoad
} from '@dcloudio/uni-app'
import {setPageCache} from '@/common/common';
import {
setPageCache
} from '@/common/common';
import common from '@/common/common';
const customStyle = {
backgroundColor: "#F1F5FA",
@@ -63,9 +67,9 @@
}
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
const lineBg =
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAOCAYAAAAvxDzwAAABL0lEQVQ4T6XSv0uCURTG8e9jgpRNDS1BU1sELUFLQVM1tgQFtcR7A8m1LQqaLGhOkQKH/o5aKiiHlgiE0K1oCYLAMk9ov/RF8e313u2ew4dzzzmi2+NsA9gH3hCr6srzbAJxDkS/nbvwYNJilMkDow1FXYUHneWAlV/MqN3ZcKCzHWDb164MGa3/H/Qshdj0YbdUmORIL8HBNRsgShZjoQkznvioY/e19wCgCccSsAcM+bBnjHmyuvx5bw8mrJ93FoEkYrzFej0g5kjrpjH2BTrro8oIYhgYQ0xhTCPibfb0ggjLHKrojwvPEogDIBZgycsYKQrscqpKq3zh7BXo7YBVgRMibLWqqvnLzh6BwTZgESNHD8edoL+hOJupT9CII0oYJcQ14oy0CgHa0JTyCeBLVNeWygE5AAAAAElFTkSuQmCC";
import {
LineBg
} from '@/enum.js'
const contentRef = ref(null);
const tabAct = ref(0);
const searchText = ref('');
@@ -76,7 +80,7 @@
}, {
name: '未完成'
}]);
const contentRefs = ref([])
const status = ref('loadmore') // loadmore - loading - nomore -
const limit = 15
@@ -101,12 +105,9 @@
common.navigateTo('/pages/testingHall/details');
}
onMounted(() => {
triggered.value = true
watch(tabAct, (newValue, oldValue) => {
console.log('resresresresresxxxxxxxxxx', contentRefs.value);
console.log('resresresresresxxxxxxxxxx', newValue);
console.log('resresresresresxxxxxxxxxx', contentRefs.value[newValue]);
typeof contentRefs.value[newValue]?.getData === 'function' && contentRefs.value[newValue]
?.getData('first')
}, {
@@ -209,7 +210,7 @@
width: 90%;
margin: 20rpx auto;
height: 78rpx;
position: relative;
.search_div {
@@ -47,6 +47,9 @@
import {
queryTraCrsBbsInfoByCrsId
} from '@/api/courseDetail.js';
import {
queryTraMistakesCollectionPaging,
} from '@/api/wrong_question_record.js';
const getData = (from = '') => {
if (from == 'first') {
if (total.value !== -1) {
@@ -64,8 +67,8 @@
console.log(status.value, '阿斯顿撒');
setTimeout(() => {
queryTraCrsBbsInfoByCrsId({
crsId: 'CRS0250181220722025070408313900000018729',
queryTraMistakesCollectionPaging({
isCorrect: 'N',
page: page.value,
limit: limit
}).then(res => {
+4 -1
View File
@@ -43,12 +43,15 @@
} from 'vue';
import {
LineBg
} from '@/enum.js';
} from '@/enum.js'
import {
queryTraCrsBbsInfoByCrsId,
replyTraCrsBbsInfo,
qryChildTraCrsBbsInfo
} from '@/api/courseDetail.js';
import common from '@/common/common';
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
+28 -2
View File
@@ -135,6 +135,15 @@
}
}
},
{
"path": "pages/examination/result",
"style": {
"navigationBarTitleText": "考试结果",
"app-plus": {
"titleNView": false
}
}
},
{
"path": "pages/practice/index",
"style": {
@@ -143,7 +152,24 @@
"titleNView": false
}
}
}
},
{
"path": "pages/learningTasks/index",
"style": {
"navigationBarTitleText": "学习任务",
"app-plus": {
"titleNView": false
}
}
},
{
"path": "pages/learningTasks/details",
"style": {
"navigationBarTitleText": "学习详情",
"app-plus": {
"titleNView": false
}
}
},
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 845 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

+21
View File
@@ -0,0 +1,21 @@
## 1.0.92023-12-06
1. 优化
## 1.0.82023-12-06
1. 阻止事件冒泡问题
## 1.0.72023-10-13
1. unmounted兼容vue3
## 1.0.62023-08-14
1. 修复初始的时候闪动的BUG
## 1.0.52023-06-22
1. 优化修改
## 1.0.42023-06-21
1. 修复BUG
## 1.0.32023-06-01
1. 修复点击触发两次事件的BUG
## 1.0.22023-05-23
1. 优化
## 1.0.12023-05-16
1. 优化组件依赖,修改后无需全局引入,组件导入即可使用
2. 优化部分功能
## 1.0.02023-05-10
uv-grid 宫格布局
@@ -0,0 +1,15 @@
export default {
props: {
// 宫格的name
name: {
type: [String, Number, null],
default: null
},
// 背景颜色
bgColor: {
type: String,
default: 'transparent'
},
...uni.$uv?.props?.gridItem
}
}
@@ -0,0 +1,226 @@
<template>
<!-- #ifndef APP-NVUE -->
<view
class="uv-grid-item"
hover-class="uv-grid-item--hover-class"
:hover-stay-time="200"
@tap="clickHandler"
:class="classes"
:style="[itemStyle]"
>
<slot />
</view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<view
class="uv-grid-item"
:hover-stay-time="200"
@tap="clickHandler"
:class="classes"
:style="[itemStyle]"
>
<slot />
</view>
<!-- #endif -->
</template>
<script>
import mpMixin from '@/uni_modules/uv-ui-tools/libs/mixin/mpMixin.js'
import mixin from '@/uni_modules/uv-ui-tools/libs/mixin/mixin.js'
import props from './props.js';
/**
* gridItem 提示
* @description 宫格组件一般用于同时展示多个同类项目的场景可以给宫格的项目设置徽标组件(badge)或者图标等也可以扩展为左右滑动的轮播形式搭配uv-grid使用
* @tutorial https://www.uvui.cn/components/grid.html
* @property {String | Number} name 宫格的name ( 默认 null )
* @property {String} bgColor 宫格的背景颜色 默认 'transparent'
* @property {Object} customStyle 自定义样式对象形式
* @event {Function} click 点击宫格触发
* @example <uv-grid-item></uv-grid-item>
*/
export default {
name: "uv-grid-item",
mixins: [mpMixin, mixin, props],
emits: ['$uvGridItem','click'],
data() {
return {
parentData: {
col: 3, //
border: true, //
},
// #ifdef APP-NVUE
width: 0, // nvuevuecomputed
// #endif
classes: [], //
};
},
created() {
//
this.updateParentData()
},
mounted() {
this.init()
},
computed: {
// #ifndef APP-NVUE
// vuecomputed
width() {
return 100 / Number(this.parentData.col) + '%'
},
// #endif
itemStyle() {
const style = {
background: this.bgColor,
width: this.width
}
return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle))
}
},
methods: {
init() {
// uv-gridchildren
// item
uni.$on('$uvGridItem', () => {
this.gridItemClasses()
})
// #ifdef APP-NVUE
// nvue
this.$nextTick(function(){
this.getItemWidth()
})
// #endif
// grid-item
uni.$emit('$uvGridItem')
this.gridItemClasses()
},
//
updateParentData() {
// mixin
this.getParentData('uv-grid');
},
clickHandler() {
let name = this.name
// namechildrenthis
const children = this.parent?.children
if(children && this.name === null) {
name = children.findIndex(child => child === this)
}
//
this.parent && this.parent.childClick(name)
this.$emit('click', name)
},
async getItemWidth() {
// nvue使使
let width = 0
if(this.parent) {
// item
const parentWidth = await this.getParentWidth()
width = parentWidth / Number(this.parentData.col) + 'px'
}
this.width = width
},
//
getParentWidth() {
// #ifdef APP-NVUE
// promiseawait
const dom = uni.requireNativePlugin('dom')
return new Promise(resolve => {
// ref
dom.getComponentRect(this.parent.$refs['uv-grid'], res => {
resolve(res.size.width)
})
})
// #endif
},
gridItemClasses() {
if(this.parentData.border) {
let classes = []
this.parent.children.map((child, index) =>{
if(this === child) {
const len = this.parent.children.length
// 沿child2
if((index + 1) % this.parentData.col !== 0 && index + 1 !== len) {
classes.push('uv-border-right')
}
//
// 0
const lessNum = len % this.parentData.col === 0 ? this.parentData.col : len % this.parentData.col
// child
if(index < len - lessNum) {
classes.push('uv-border-bottom')
}
}
})
// ","
// #ifdef MP-ALIPAY || MP-TOUTIAO
classes = classes.join(' ')
// #endif
this.classes = classes
}
}
},
// #ifdef VUE2
beforeDestroy() {
//
uni.$off('$uvGridItem')
},
// #endif
// #ifdef VUE3
unmounted() {
//
uni.$off('$uvGridItem')
}
// #endif
};
</script>
<style lang="scss" scoped>
$show-border: 1;
$show-border-right: 1;
$show-border-bottom: 1;
@import '@/uni_modules/uv-ui-tools/libs/css/variable.scss';
@import '@/uni_modules/uv-ui-tools/libs/css/components.scss';
@import '@/uni_modules/uv-ui-tools/libs/css/color.scss';
$uv-grid-item-hover-class-opcatiy:.5 !default;
$uv-grid-item-margin-top:1rpx !default;
$uv-grid-item-border-right-width:0.5px !default;
$uv-grid-item-border-bottom-width:0.5px !default;
$uv-grid-item-border-right-color:$uv-border-color !default;
$uv-grid-item-border-bottom-color:$uv-border-color !default;
.uv-grid-item {
align-items: center;
justify-content: center;
position: relative;
flex-direction: column;
/* #ifndef APP-NVUE */
box-sizing: border-box;
display: flex;
/* #endif */
/* #ifdef MP */
position: relative;
float: left;
/* #endif */
/* #ifdef MP-WEIXIN */
margin-top:$uv-grid-item-margin-top;
/* #endif */
&--hover-class {
opacity:$uv-grid-item-hover-class-opcatiy;
}
}
/* #ifdef APP-NVUE */
// nvueapp.vue
.uv-border-right {
border-right-width:$uv-grid-item-border-right-width;
border-color: $uv-grid-item-border-right-color;
}
.uv-border-bottom {
border-bottom-width:$uv-grid-item-border-bottom-width;
border-color:$uv-grid-item-border-bottom-color;
}
/* #endif */
</style>
@@ -0,0 +1,20 @@
export default {
props: {
// 分成几列
col: {
type: [String, Number],
default: 3
},
// 是否显示边框
border: {
type: Boolean,
default: false
},
// 宫格对齐方式,表现为数量少的时候,靠左,居中,还是靠右
align: {
type: String,
default: 'left'
},
...uni.$uv?.props?.grid
}
}
@@ -0,0 +1,100 @@
<template>
<view
class="uv-grid"
ref='uv-grid'
:style="[gridStyle]"
>
<slot />
</view>
</template>
<script>
import mpMixin from '@/uni_modules/uv-ui-tools/libs/mixin/mpMixin.js'
import mixin from '@/uni_modules/uv-ui-tools/libs/mixin/mixin.js'
import props from './props.js';
/**
* grid 宫格布局
* @description 宫格组件一般用于同时展示多个同类项目的场景可以给宫格的项目设置徽标组件(badge)或者图标等也可以扩展为左右滑动的轮播形式
* @tutorial https://www.uvui.cn/components/grid.html
* @property {String | Number} col 宫格的列数默认 3
* @property {Boolean} border 是否显示宫格的边框默认 false
* @property {String} align 宫格对齐方式表现为数量少的时候靠左居中还是靠右 默认 'left'
* @property {Object} customStyle 定义需要用到的外部样式
* @event {Function} click 点击宫格触发
* @example <uv-grid :col="3" @click="click"></uv-grid>
*/
export default {
name: 'uv-grid',
mixins: [mpMixin, mixin, props],
emits: ['click'],
data() {
return {
index: 0,
width: 0
}
},
watch: {
//
parentData() {
if (this.children.length) {
this.children.map(child => {
// (uv-radio)updateParentData()
typeof(child.updateParentData) == 'function' && child.updateParentData();
})
}
},
},
created() {
// childrendata
this.children = []
},
computed: {
//
parentData() {
return [this.hoverClass, this.col, this.size, this.border];
},
//
gridStyle() {
let style = {};
switch (this.align) {
case 'left':
style.justifyContent = 'flex-start';
break;
case 'center':
style.justifyContent = 'center';
break;
case 'right':
style.justifyContent = 'flex-end';
break;
default:
style.justifyContent = 'flex-start';
};
return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
}
},
methods: {
// uv-grid-itemuv-grid
childClick(name) {
this.$emit('click', name)
}
}
};
</script>
<style lang="scss" scoped>
@import '@/uni_modules/uv-ui-tools/libs/css/components.scss';
$uv-grid-width:100% !default;
.uv-grid {
/* #ifdef MP */
width: $uv-grid-width;
position: relative;
box-sizing: border-box;
overflow: hidden;
display: block;
/* #endif */
justify-content: center;
@include flex;
flex-wrap: wrap;
align-items: center;
}
</style>
+88
View File
@@ -0,0 +1,88 @@
{
"id": "uv-grid",
"displayName": "uv-grid 宫格布局 全面兼容vue3+2、app、h5、小程序等多端",
"version": "1.0.9",
"description": "uv-grid 宫格组件一般用于同时展示多个同类项目的场景,可以给宫格的项目设置徽标组件(badge),或者图标等,也可以扩展为左右滑动的轮播形式。",
"keywords": [
"uv-grid",
"uvui",
"uv-ui",
"宫格布局",
"grid"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"type": "component-vue",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "插件不采集任何数据",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [
"uv-ui-tools",
"uv-icon"
],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"Vue": {
"vue2": "y",
"vue3": "y"
},
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}
+17
View File
@@ -0,0 +1,17 @@
## Grid 宫格布局
> **组件名:uv-grid**
宫格组件一般用于同时展示多个同类项目的场景,可以给宫格的项目设置徽标组件(badge),或者图标等,也可以扩展为左右滑动的轮播形式。
# <a href="https://www.uvui.cn/components/grid.html" target="_blank">查看文档</a>
### [更多插件,请关注uv-ui组件库](https://ext.dcloud.net.cn/plugin?name=uv-ui)
<a href="https://ext.dcloud.net.cn/plugin?name=uv-ui" target="_blank">
![image](https://mp-a667b617-c5f1-4a2d-9a54-683a67cff588.cdn.bspapp.com/uv-ui/banner.png)
</a>
#### 如使用过程中有任何问题反馈,或者您对uv-ui有一些好的建议,欢迎加入uv-ui官方交流群:<a href="https://www.uvui.cn/components/addQQGroup.html" target="_blank">官方QQ群</a>