杨航修改学习页
This commit is contained in:
+4
-1
@@ -85,4 +85,7 @@ export const queryCrsInfoByRecmd = (data) => {
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -31,4 +31,12 @@ export const oneTimeRead = (data) => {
|
||||
toastErrors: true,
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
export const noticeMessageCount = (data) => {
|
||||
return request({
|
||||
url: base_url + '/traPersonalMessageNotice/noticeMessageCount',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
};
|
||||
@@ -79,8 +79,8 @@
|
||||
@startRecord="changePlayItemId('')"
|
||||
:isLoading="isUploadingVoice"
|
||||
:onlyVoice="answerOnlyVoice"
|
||||
:adjustPosition="true"
|
||||
:canAnswer="testAnswer"
|
||||
:adjustPosition="true"
|
||||
:canAnswerText="'每个问题最多连续发送五次答案!'"
|
||||
:isDisabled="(lastTalkingInfo.type || 0) !== 4" />
|
||||
</view>
|
||||
@@ -667,6 +667,7 @@ const sendMessage = data => {
|
||||
const startPgrphId = ref('')
|
||||
const imageId = ref('')
|
||||
onLoad(params => {
|
||||
changeAppHeightBottom()
|
||||
watchFlag.value = 1
|
||||
isPreview.value = params.isPreview === 'preview'
|
||||
crsId.value = params.crsId || ''
|
||||
@@ -683,8 +684,24 @@ onMounted(() => {
|
||||
const keyboardHeight = ref('0px')
|
||||
const setHeight = res => {
|
||||
keyboardHeight.value = res.height + 'px'
|
||||
scrollToBottomNow()
|
||||
// scrollToBottomNow()
|
||||
}
|
||||
|
||||
const keyBoardIsHide = computed(() => {
|
||||
return parseInt(keyboardHeight.value) == 0
|
||||
})
|
||||
const bottomHeight = ref('0px')
|
||||
const totalBotHeight = computed(()=> {
|
||||
return keyBoardIsHide.value ? 0 + 'px': parseInt(keyboardHeight.value) - parseInt(bottomHeight.value) + 'px'
|
||||
})
|
||||
const changeAppHeightBottom = (height) => {
|
||||
//#ifdef APP-PLUS
|
||||
// 获取系统信息
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
// 计算安全区域底部高度
|
||||
bottomHeight.value = systemInfo.screenHeight - systemInfo.safeArea.bottom + 'px'
|
||||
// #endif
|
||||
}
|
||||
onHide(() => {
|
||||
//#ifdef APP-PLUS
|
||||
uni.offKeyboardHeightChange(setHeight)
|
||||
@@ -1040,11 +1057,14 @@ const chooseRateNow = item => {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
.course-study {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
bottom: 0;
|
||||
|
||||
.top-bg {
|
||||
background: linear-gradient(16deg, rgba(234, 246, 255, 0) 0%, #e6eafd 100%);
|
||||
@@ -1088,12 +1108,12 @@ const chooseRateNow = item => {
|
||||
}
|
||||
|
||||
.course-study-body {
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
overflow: hidden;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
// height: 100%;
|
||||
height: calc(100% - v-bind(keyboardHeight));
|
||||
height: 100%;
|
||||
// height: calc(100% - v-bind(totalBotHeight));
|
||||
width: 100%;
|
||||
padding: 0 0rpx;
|
||||
box-sizing: border-box;
|
||||
@@ -1110,7 +1130,8 @@ const chooseRateNow = item => {
|
||||
box-sizing: border-box;
|
||||
font-weight: 500;
|
||||
color: #000;
|
||||
position: relative;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
|
||||
// margin-bottom: 23rpx;
|
||||
.arrow-icon {
|
||||
|
||||
@@ -16,7 +16,13 @@
|
||||
</view>
|
||||
<view class="question">
|
||||
<view class="grey">剩余时间</view>
|
||||
<uv-count-down :time="paperData.limitTm * 1000" format="HH:mm:ss" @finish="finish"></uv-count-down>
|
||||
<uv-count-down
|
||||
ref="countDownRef"
|
||||
:time="paperData.limitTm * 1000"
|
||||
format="HH:mm:ss"
|
||||
@finish="finish"
|
||||
:autoStart="false"
|
||||
></uv-count-down>
|
||||
</view>
|
||||
</view>
|
||||
<view class="progress">
|
||||
@@ -144,7 +150,7 @@
|
||||
import Dialog from './components/dialog.vue';
|
||||
import Subject from '@/components/examination/subject.vue';
|
||||
import TouchBtn from '@/components/examination/touchBtn.vue';
|
||||
import { ref, reactive, computed} from 'vue';
|
||||
import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import common from '@/common/common';
|
||||
import { getPageCache, setupKeyboardHeightListener } from '@/common/common';
|
||||
@@ -156,6 +162,7 @@
|
||||
const dialogRef = ref(null);
|
||||
const popupRef = ref(null);
|
||||
const touchBtnRef = ref(null);
|
||||
const countDownRef = ref(null);
|
||||
let examinationStartTime = 0; // 考试开始时间
|
||||
|
||||
const mode = 'examination'; // 考试 examination 练习practice
|
||||
@@ -219,7 +226,7 @@
|
||||
|
||||
// 倒计时结束
|
||||
const finish = (item) => {
|
||||
hand_in_paper('倒计时结束自动交卷')
|
||||
hand_in_paper('倒计时结束自动交卷');
|
||||
};
|
||||
|
||||
// 按上一题下一题
|
||||
@@ -240,8 +247,7 @@
|
||||
// 点击答题卡按钮
|
||||
const click_sheet_item = (index) => {
|
||||
questionNumber.value = index;
|
||||
popupRef.value.close()
|
||||
|
||||
popupRef.value.close();
|
||||
};
|
||||
|
||||
const subject_click = (type, params) => {
|
||||
@@ -289,7 +295,7 @@
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 初始化时检查
|
||||
onLoad(() => {
|
||||
const examination = getPageCache('examination');
|
||||
@@ -312,9 +318,14 @@
|
||||
my_answer: []
|
||||
}))
|
||||
);
|
||||
setupKeyboardHeightListener((height) => {
|
||||
popup_input_bottom.value = `${height}px`;
|
||||
})
|
||||
setupKeyboardHeightListener((height) => {
|
||||
popup_input_bottom.value = `${height}px`;
|
||||
});
|
||||
});
|
||||
onMounted(() => {
|
||||
setTimeout(() => {
|
||||
countDownRef.value.start();
|
||||
}, 500);
|
||||
});
|
||||
|
||||
const result_click = ({ key }) => {
|
||||
@@ -333,13 +344,13 @@
|
||||
console.log('点击交卷', paperData);
|
||||
// 判断是否完成所有题目
|
||||
const completeList = topicList
|
||||
.filter((res) => !!(Array.isArray(res.my_answer) ? res.my_answer.length>0 : res.my_answer?.anserResult !==''))
|
||||
.filter((res) => !!(Array.isArray(res.my_answer) ? res.my_answer.length > 0 : res.my_answer?.anserResult !== ''))
|
||||
.map((res) => ({
|
||||
a: res.qnsId,
|
||||
b: res.my_answer,
|
||||
c: !!res.my_answer
|
||||
}));
|
||||
|
||||
|
||||
const style_button_1 = {
|
||||
color: '#FFFFFF',
|
||||
fontSize: '30rpx',
|
||||
@@ -390,7 +401,7 @@
|
||||
dialogRef.value.open();
|
||||
};
|
||||
// 执行交卷
|
||||
const hand_in_paper = (strs='') => {
|
||||
const hand_in_paper = (strs = '') => {
|
||||
console.log('交卷的原因', strs);
|
||||
const answerDtoList = topicList.map((res) => {
|
||||
let answerItem = {
|
||||
@@ -456,8 +467,8 @@
|
||||
})
|
||||
.finally(() => {
|
||||
common.hideLoading();
|
||||
if(strs === '倒计时结束自动交卷') {
|
||||
hand_in_paper(strs)
|
||||
if (strs === '倒计时结束自动交卷') {
|
||||
hand_in_paper(strs);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -732,7 +732,7 @@
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100vh - 0px);
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
@@ -278,10 +278,10 @@
|
||||
import { onShow, onPageScroll, onLoad, onHide } from '@dcloudio/uni-app';
|
||||
import { customStyles, fixedCustomStyles, placeholderStyle, suffixIconStyle } from './index.js';
|
||||
import { getUserInfo } from '@/common/common';
|
||||
|
||||
import common from '@/common/common';
|
||||
import { setMascot } from '@/common/mascot.js';
|
||||
import { getStatisticsData, queryCrsInfoByLastnew, queryCrsInfoByPopular, queryCrsInfoByRecmd } from '@/api/index.js';
|
||||
import { noticeMessageCount } from '@/api/messageNotification.js';
|
||||
|
||||
const scrollTop = ref(0);
|
||||
const mascotShow = ref(false);
|
||||
@@ -451,6 +451,9 @@
|
||||
queryCrsInfoByRecmd().then((res) => {
|
||||
recommend_class_list.value = res.body;
|
||||
});
|
||||
noticeMessageCount().then(res => {
|
||||
console.log('res', res);
|
||||
})
|
||||
});
|
||||
onHide(() => {});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user