代码提交

feature/v-xuexi
wangdong 8 months ago
parent c0845cab72
commit 028ff69d0d
  1. 4
      api/learning.js
  2. 6
      pages/learning/index.vue
  3. 12
      pages/learningCenter/clockRecord.vue
  4. 34
      pages/learningCenter/components/calendar.vue
  5. 2
      pages/learningCenter/recite.vue
  6. 2
      pages/topic/problem_result.vue
  7. 11
      pages/topic/question_detail.vue
  8. 9
      pages/topic/question_result.vue
  9. 7
      pages/topic/question_sheet.vue

@ -27,3 +27,7 @@ export function reciteClock(params){
export function changeCategory(params){
return http.get("/clearance/study", params)
}
export function getMonthRecord(params){
return http.get("/clearance/getMonthRecord", params)
}

@ -1,7 +1,7 @@
<template>
<BaseContainer class="learning" :fixedNav="false">
<NavBar v-if="scrollTop > 20" title="学习中心" :showBack="false" />
<view class="learning-box">
<view v-if="Object.keys(learningData).length > 0" class="learning-box">
<view class="swiper-box">
<swiper class="custom-banner" indicator-dots autoplay @click="handleBannerClick" >
<swiper-item v-for="(item, index) in learningData.banner" :key="index" :data-url="item.url" class="swiper-item">
@ -54,7 +54,7 @@
</view>
<view>进度 <view class="progress-bg"><text class="progress" :style="{width: `${learningData.user_clock_in.progress}%` }"></text></view> <text class="progress-percent">{{ learningData.user_clock_in.progress }}%</text> </view>
</view>
<view v-if="learningData.user_clock_in.list.length > 0" class="content-right">已打卡</view>
<view class="content-right" :style="{ background: learningData.user_clock_in.list === 0 ? '#0F74BB' : '' }">{{ learningData.user_clock_in.list.length > 0 ? '已打卡' : '待打卡'}}</view>
</view>
</view>
<view v-for="(item, index) in learningData.exam_list" class="practice flex">
@ -170,7 +170,7 @@ import store from "@/store";
},
checkRecord() {
uni.navigateTo({
url: '/pages/learningCenter/clockRecord',
url: `/pages/learningCenter/clockRecord?clockDays=${this.learningData.user_study.days}&todayClock=${this.learningData.user_clock_in.list.length > 0}`,
})
},
changeCate() {

@ -6,7 +6,7 @@
<view class="record-info flex">
<view class="total">
<view>累计打卡</view>
<view><text>{{ totalClock }}</text><text></text></view>
<view><text>{{ clockDays }}</text><text></text></view>
</view>
<view class="line"></view>
<view class="today">
@ -34,7 +34,7 @@
<view v-if="recordList.length && !loading" class="finished">{{ loadTitle }}</view>
<view v-if="finished && !recordList.length" class="empty">
<image mode="aspectFill" :src="getImgPath('/wap/first/zsff/images/empty.png')" alt="暂无记录" />
<view>暂无消息</view>
<view>暂无记录</view>
</view>
</view>
</view>
@ -50,17 +50,19 @@
},
data() {
return {
totalClock: 50,
todayClock: false,
recordList: [],
page: 1,
limit: 10,
loading: false,
finished: false,
loadTitle: '',
todayClock: false,
clockDays: 0,
};
},
onLoad() {
onLoad({clockDays, todayClock}) {
this.clockDays = clockDays;
this.todayClock = todayClock;
this.$nextTick(() => {
this.getRecordList();
});

@ -29,7 +29,7 @@
<view
:class="['date', {
'nowDay': item.month === 'current' && nowYear === currentYear && nowMonth === currentMonth && nowDate === item.date,
'hasPlan': item.month === 'current' && dateList.includes(`${currentYear}-${formatterNum(currentMonth)}-${formatterNum(item.date)}`),
'hasPlan': item.month === 'current' && dateList.filter(v => v.date === `${currentYear}-${formatterNum(currentMonth)}-${formatterNum(item.date)}`).length > 0,
'isClock': item.month === 'current' && dateList.includes(`${currentYear}-${formatterNum(currentMonth)}-${formatterNum(item.date)}`)
}]"
>{{ item.month === 'current' ? item.date : '' }}</view>
@ -39,7 +39,7 @@
</template>
<script>
// import { queryMemorandumMonth } from '../api';
import { getMonthRecord } from '@/api/learning';
export default {
props: {
calendarData: {
@ -68,24 +68,18 @@ export default {
},
mounted() {
this.getAllArr();
// this.getDateList();
this.getDateList();
},
methods: {
// async getDateList() {
// const res = await queryMemorandumMonth({ datetime: this.monthYear });
// if (Number(res.status === 200) && res.data.success) {
// if (res.data.result.length > 0) {
// // eslint-disable-next-line arrow-parens
// res.data.result.forEach(v => {
// if (!this.dateList.includes(v)) {
// this.dateList.push(v);
// }
// });
// }
// } else {
// this.$util.showMsg(res.data.message || res.data.msg);
// }
// },
async getDateList() {
const { data } = await getMonthRecord(
{
month: `${this.currentYear}-${this.currentMonth < 10 ? '0' + this.currentMonth : this.currentMonth}`,
}
);
this.dateList = data;
console.log(data);
},
//
getDateLen(year, month) {
let actualMonth = month - 1;
@ -197,7 +191,7 @@ export default {
this.currentMonth = month;
this.monthYear = year + '年' + (month < 10 ? '0' + month : month) + '月';
this.getAllArr();
// this.getDateList();
this.getDateList();
},
//
gotoNextMonth() {
@ -206,7 +200,7 @@ export default {
this.currentMonth = month;
this.monthYear = year + '年' + (month < 10 ? '0' + month : month) + '月';
this.getAllArr();
// this.getDateList();
this.getDateList();
},
clockPreTask(id) {
this.$emit('clock', id);

@ -11,7 +11,7 @@
</view>
<view class="content">
<view :style="{ borderColor: item.todayRecite ? '' : '#FFC067', color: item.todayRecite ? '': '#FFBF66' }">今日{{ item.todayRecite ? '已' : '未' }}背诵</view>
<view>词汇量{{ item.count }}</view>
<view>词汇量{{ item.count || 0 }}</view>
</view>
</view>
<view class="item-right">

@ -4,7 +4,7 @@
<view class="question-result-page">
<view class="head">
<view class="header">
<view class="avatar"><img :src="userInfo.avatar"></view>
<view class="avatar"><img :src="getImgPath(userInfo.avatar)"></view>
<view class="nickname">{{ userInfo.nickname }}</view>
<view class="circle-container">
<canvas canvas-id="circle" class="my-canvas"></canvas>

@ -8,7 +8,7 @@
<view class="header-bd">
<navigator
open-type="redirect"
:url="`/pages/topic/question_sheet?test_id=${test_id}&special_id=${special_id}&record_id=${e_id}&index=${activeIndex}&is_analysis=${is_analysis}&txamination_time=${txamination_time}&exam_time=${duration}`"
:url="`/pages/topic/question_sheet?test_id=${test_id}&special_id=${Number(special_id)}&record_id=${e_id}&index=${activeIndex}&is_analysis=${is_analysis}&txamination_time=${txamination_time}&exam_time=${duration}`"
>答题卡</navigator
>
<view v-if="!is_analysis">{{ duration | formatTime }}</view>
@ -202,9 +202,8 @@ export default {
},
onLoad({ test_id, type, index = 0, e_id, is_analysis, special_id }) {
this.test_id = test_id;
this.special_id = special_id;
this.special_id = special_id ? Number(special_id) : '';
this.activeIndex = Number(index);
const task = this.getData();
const exam_time = this.$util.getStorage(`exam_time${this.test_id}`);
@ -217,8 +216,10 @@ export default {
} else {
this.exam_time = 0;
}
if (parseInt(is_analysis)) {
if (is_analysis && parseInt(is_analysis)) {
this.is_analysis = 1;
} else {
this.is_analysis = 0;
}
if (e_id) {
this.e_id = e_id || '';
@ -227,7 +228,7 @@ export default {
this.getSituation();
task.then(this.setTimer);
}
},
},
onHide(){
//
clearTimeout(this.timer);

@ -4,7 +4,7 @@
<view class="question-result-page" v-if="result.title">
<view class="head">
<view class="header">
<view class="avatar"><img :src="userInfo.avatar"></view>
<view class="avatar"><img :src="getImgPath(userInfo.avatar)"></view>
<view class="nickname">{{ userInfo.nickname }}</view>
<view class="circle-container">
<canvas canvas-id="circle" class="my-canvas"></canvas>
@ -98,12 +98,17 @@ export default {
imgSrc: "",
userInfo: {},
special_id: 0,
is_analysis: 0,
};
},
onLoad({ test_id, from, is_analysis, special_id }) {
this.test_id = test_id;
this.is_analysis = parseInt(is_analysis);
this.special_id = special_id;
if (is_analysis && parseInt(is_analysis)) {
this.is_analysis = parseInt(is_analysis);
} else {
this.is_analysis = 0;
}
this.footerHidden = from === "question_user";
this.$util.removeStorage("exam_time");

@ -6,7 +6,7 @@
<view class="header">
<navigator
open-type="redirect"
:url="`/pages/topic/question_detail?test_id=${test_id}&e_id=${record_id}&is_analysis=${is_analysis}&index=${index}&txamination_time=${txamination_time}&exam_time=${duration}`"
:url="`/pages/topic/question_detail?test_id=${test_id}&special_id=${special_id}&e_id=${record_id}&is_analysis=${is_analysis}&index=${index}&txamination_time=${txamination_time}&exam_time=${duration}`"
>{{ is_analysis ? "返回试题" : "返回答题" }}</navigator
>
<navigator v-if="!is_analysis" class="time">{{
@ -85,17 +85,18 @@ export default {
this.record_id = record_id;
this.special_id = special_id;
this.check_analysis = check_analysis;
this.is_analysis = parseInt(is_analysis);
if (index) {
this.index = parseInt(index);
}
if (is_analysis && parseInt(is_analysis)) {
this.is_analysis = parseInt(is_analysis);
} else {
this.is_analysis = 0;
this.setTimer();
this.txamination_time = parseInt(txamination_time);
}
this.getSheet();
},
},
onHide(){
//
clearTimeout(this.timer);

Loading…
Cancel
Save