Merge branch 'master' into selfStudy

This commit is contained in:
@fawn-nine
2024-10-14 09:38:32 +08:00
4 changed files with 2680 additions and 2268 deletions

View File

@@ -12,8 +12,8 @@
"src" : "图片路径" "src" : "图片路径"
} }
], ],
"versionName" : "1.0.23", "versionName" : "1.0.27",
"versionCode" : 1023, "versionCode" : 1027,
"app-plus" : { "app-plus" : {
"nvueCompiler" : "weex", "nvueCompiler" : "weex",
"compatible" : { "compatible" : {

View File

@@ -301,7 +301,7 @@
<view v-if="taskList.length > 0 "> <view v-if="taskList.length > 0 ">
<view class="submitRecode"> <view class="submitRecode">
<view class="newBox"> <view class="newBox">
<view class="item " v-for="(item, index) in taskList" @click="clickTask(item)"> <view class="item " v-for="(item, index) in taskList" @click="clickTask(item,index)">
<view class="leve1 flex_box flex_between"> <view class="leve1 flex_box flex_between">
<text style="flex: 1;">{{item.title}}</text> <text style="flex: 1;">{{item.title}}</text>
<view class="btn1" @click.stop="changeZheDie(item, index)"> <view class="btn1" @click.stop="changeZheDie(item, index)">
@@ -343,7 +343,8 @@
</template> </template>
<template <template
v-if="!item.reply && thisClass.state == '1'"> v-if="!item.reply && thisClass.state == '1'">
<text class="no">未提交答案 点击开始答题</text> <text class="no" v-if="index+1<=currentStudyNumber">未提交答案 点击开始答题</text>
<text class="no" v-else style="color: #a0a1a7;">暂未开始学习</text>
</template> </template>
<template <template
v-if="!item.reply && (thisClass.state == '2' || thisClass.state == '3')"> v-if="!item.reply && (thisClass.state == '2' || thisClass.state == '3')">
@@ -563,6 +564,7 @@
export default { export default {
data() { data() {
return { return {
currentStudyNumber:0,
courseActiveStyle:{ courseActiveStyle:{
background:'#fff', background:'#fff',
color:'#666', color:'#666',
@@ -1480,7 +1482,7 @@
}, },
// 点击作业或者医案,进入详细介绍 // 点击作业或者医案,进入详细介绍
clickTask(item) { clickTask(item,index) {
// var options = JSON.stringify(item) // var options = JSON.stringify(item)
if (this.tijiaoTitleId == 2) { if (this.tijiaoTitleId == 2) {
// 进入的是心得 // 进入的是心得
@@ -1489,9 +1491,12 @@
}) })
return return
} }
uni.navigateTo({ if(index+1<=this.currentStudyNumber){
uni.navigateTo({
url: `/pages/miniClass/taskDetail?id=${item.id}&classState=${this.thisClass.state}` url: `/pages/miniClass/taskDetail?id=${item.id}&classState=${this.thisClass.state}`
}) })
}
}, },
delClass() { delClass() {
var that = this var that = this
@@ -1939,6 +1944,17 @@
if (res.code == 0) { if (res.code == 0) {
this.isHave = res.result.isJoin this.isHave = res.result.isJoin
this.thisClass = res.result.class this.thisClass = res.result.class
const nowTime = new Date().getTime();
console.log("nowTime at line 107:", nowTime, this.thisClass.startTime);
var studyTime =
Number(nowTime - new Date(this.thisClass.startTime).getTime()) / (1000 * 60 * 60 * 24) / 7;
console.log("studyTime at line 108:", Math.ceil(studyTime));
this.currentStudyNumber = Math.ceil(studyTime);
// if (this.thisClass.state == '0') { // if (this.thisClass.state == '0') {
// this.tabId = '0' // this.tabId = '0'

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,20 @@
<template> <template>
<view style="min-height: calc(100vh - 120rpx); background-color: #ebf2f5;"> <view style="min-height: calc(100vh - 120rpx); background-color: #ebf2f5">
<z-nav-bar :title="pageName"> <z-nav-bar :title="pageName">
<uni-icons v-if="pageType == 1 && classState == '1' && (roleCode.includes('1') || roleCode.includes('2'))" type="plus" class="addBtn" color="#258feb" slot="right" @click="addTask()" size="14">添加医案</uni-icons> <uni-icons
v-if="
pageType == 1 &&
classState == '1' &&
(roleCode.includes('1') || roleCode.includes('2'))
"
type="plus"
class="addBtn"
color="#258feb"
slot="right"
@click="addTask()"
size="14"
>添加医案</uni-icons
>
</z-nav-bar> </z-nav-bar>
<view class="pad20"> <view class="pad20">
<view class="" v-if="pageType == 0 && classState == '0'"> <view class="" v-if="pageType == 0 && classState == '0'">
@@ -9,33 +22,67 @@
<!-- <text>根据教学时长,须至少发布 {{minNumber}} 条作业</text> --> <!-- <text>根据教学时长,须至少发布 {{minNumber}} 条作业</text> -->
</view> </view>
<view class="addTips border_radius_10"> <view class="addTips border_radius_10">
<view class="" > <view class="">
<view class="flex_box flex_center" > <view class="flex_box flex_center">
<text class="PM_font fangshi">生成方式</text><uni-icons type="help" size="18" @click="clickHelp"></uni-icons> <text class="PM_font fangshi">生成方式</text
><uni-icons type="help" size="18" @click="clickHelp"></uni-icons>
</view> </view>
<view class="btnBox flex_box flex_center"> <view class="btnBox flex_box flex_center">
<text class="zidong border_radius_10" @click="autoCreate()">自动生成</text> <text class="zidong border_radius_10" @click="autoCreate()"
<text class="shoudong border_radius_10" @click="addTask()">逐个添加</text> >自动生成</text
>
<text class="shoudong border_radius_10" @click="addTask()"
>在最上方添加</text
>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view v-if="taskList.length > 0 "> <view v-if="taskList.length > 0">
<uni-section class="mb-10 mt-10 nobg" :title="'共'+total+'条数据'" type="line"></uni-section> <uni-section
class="mb-10 mt-10 nobg"
:title="'共' + total + '条数据'"
type="line"
></uni-section>
<view class="submitRecode"> <view class="submitRecode">
<view class="newBox"> <view class="newBox">
<view class="item " v-for="(item, index) in taskList" @click="clickTask(item)"> <view
class="item"
v-for="(item, index) in taskList"
@click="clickTask(item)"
>
<view class="leve1 flex_box flex_between"> <view class="leve1 flex_box flex_between">
<text style="flex: 1;">{{item.title}}</text> <text style="flex: 1">{{ item.title }}</text>
<text class="edit border_radius_10 small_btn" @click.stop="goEdit(item)" v-if="pageType == 0 && classState == 0 || pageType == 1 && classState == 1 && item.otherInfo.setGiveHomeWorkNumber == 0">修改</text>
</view> <text
<view class="leve2 "> class="edit border_radius_10 small_btn"
<view class="jianjie" v-html="item.content"> @click.stop="goEdit(item)"
v-if="
(pageType == 0 && classState == 0) ||
(pageType == 1 &&
classState == 1 &&
item.otherInfo.setGiveHomeWorkNumber == 0) ||
(pageType == 0 &&
classState == 1 &&
index + 1 > currentStudyNumber)
"
>修改</text
>
</view> </view>
<view class="leve2">
<view class="jianjie" v-html="item.content"> </view>
</view> </view>
<view class="leve3" v-if="pageType == 0 && classState == 0"> <view class="leve3" v-if="pageType == 0 && classState == 0">
<text class="border_radius_10 small_btn add" @click.stop="addTask(item)">在本条后面添加一条</text> <text
<text class="border_radius_10 small_btn del" @click.stop="delTask(item)">删除</text> class="border_radius_10 small_btn add"
@click.stop="addTask(item)"
>在本条后面添加一条</text
>
<text
class="border_radius_10 small_btn del"
@click.stop="delTask(item)"
>删除</text
>
</view> </view>
</view> </view>
</view> </view>
@@ -50,191 +97,205 @@
</template> </template>
<script> <script>
import $http from '@/config/requestConfig.js'; import $http from "@/config/requestConfig.js";
// const taskLIst1 = require('@/data/taskList.json') // const taskLIst1 = require('@/data/taskList.json')
export default { export default {
data() { data() {
return { return {
options: {},
classId: undefined, classId: undefined,
pageType: undefined, pageType: undefined,
pPage: 0, pPage: 0,
status: 88, status: 88,
loadFlag: false, loadFlag: false,
pageName: '', pageName: "",
taskList: [], taskList: [],
roleCode:'', roleCode: "",
minNumber:undefined, minNumber: undefined,
classState:undefined, classState: undefined,
total:0 total: 0,
} currentStudyNumber: 0,
};
}, },
onLoad(e) { onLoad(e) {
console.log('e',e); this.options = e;
this.classState = e.classState console.log("e", e);
this.classId = e.classId this.classState = e.classState;
this.minNumber = e.minNumber this.classId = e.classId;
this.pageType = e.type this.minNumber = e.minNumber;
this.roleCode = e.roleCode this.pageType = e.type;
if (e.type == '0') { this.roleCode = e.roleCode;
this.pageName = '作业列表' if (e.type == "0") {
} else if (this.pageName = '医案列表') { this.pageName = "作业列表";
} else if ((this.pageName = "医案列表")) {
} else { } else {
this.pageName = '心得列表' this.pageName = "心得列表";
} }
// this.getList() // this.getList()
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.pPage = 0 this.pPage = 0;
this.taskList = [] this.taskList = [];
this.getList() this.getList();
uni.stopPullDownRefresh() uni.stopPullDownRefresh();
}, },
onReachBottom() { onReachBottom() {
if (this.status != 2 && this.status != 3) { if (this.status != 2 && this.status != 3) {
this.getList() this.getList();
} }
}, },
onShow() { onShow() {
this.pPage = 0 this.pPage = 0;
this.taskList = [] this.taskList = [];
this.getList() if (this.pageType == 0) {
const nowTime = new Date().getTime();
console.log("nowTime at line 107:", nowTime, this.options.startTime);
var studyTime =
Number(nowTime - this.options.startTime) / (1000 * 60 * 60 * 24) / 7;
console.log("studyTime at line 108:", Math.ceil(studyTime));
this.currentStudyNumber = Math.ceil(studyTime);
}
this.getList();
// this.getList() // this.getList()
}, },
methods: { methods: {
delTask(item){ delTask(item) {
console.log('删除'); console.log("删除");
$http.request({ $http
.request({
url: "common/class/delClassTask", url: "common/class/delClassTask",
method: "POST", method: "POST",
data: { data: {
"taskId": item.id taskId: item.id,
}, },
header: { //默认 无 说明:请求头 header: {
'Content-Type': 'application/json' //默认 无 说明:请求头
"Content-Type": "application/json",
}, },
}) })
.then(res => { .then((res) => {
if(res.code == 0){ if (res.code == 0) {
uni.showToast({ uni.showToast({
title:'删除成功', title: "删除成功",
icon:'success' icon: "success",
}) });
setTimeout(()=>{ setTimeout(() => {
this.pPage = 0 this.pPage = 0;
this.taskList = [] this.taskList = [];
this.getList() this.getList();
},2000) }, 2000);
}else{ } else {
uni.showToast({ uni.showToast({
title:'删除失败', title: "删除失败",
icon:'error' icon: "error",
}) });
} }
}) })
.catch(e => { .catch((e) => {
uni.showToast({ uni.showToast({
title:'删除失败', title: "删除失败",
icon:'error' icon: "error",
}) });
}) });
}, },
// 是否继续自动成操作 // 是否继续自动成操作
confirOption(){ confirOption() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.showModal({ uni.showModal({
title:'提示', title: "提示",
content:'当前作业列表中存在数据,确定要清空并重新生成新的作业列表吗?', content:
cancelText:'点错了', "当前作业列表中存在数据,确定要清空并重新生成新的作业列表吗?",
confirmText:'确定', cancelText: "点错了",
confirmText: "确定",
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
resolve(true) resolve(true);
} else if (res.cancel) { } else if (res.cancel) {
resolve(false) resolve(false);
} }
}
})
})
}, },
goAutoCreate(){ });
});
$http.request({ },
goAutoCreate() {
$http
.request({
url: "common/class/generateClassTask", url: "common/class/generateClassTask",
method: "POST", method: "POST",
data: { data: {
"classId": this.classId classId: this.classId,
}, },
header: { //默认 无 说明:请求头 header: {
'Content-Type': 'application/json' //默认 无 说明:请求头
"Content-Type": "application/json",
}, },
}) })
.then(res => { .then((res) => {
if(res.code == 0){ if (res.code == 0) {
uni.showToast({ uni.showToast({
title:'生成成功', title: "生成成功",
icon:'success' icon: "success",
}) });
setTimeout(()=>{ setTimeout(() => {
this.pPage = 0 this.pPage = 0;
this.taskList = [] this.taskList = [];
this.getList() this.getList();
},2000) }, 2000);
}else{ } else {
uni.showToast({ uni.showToast({
title:'生成失败', title: "生成失败",
icon:'error' icon: "error",
}) });
} }
}) })
.catch(e => { .catch((e) => {
uni.showToast({ uni.showToast({
title:'生成失败', title: "生成失败",
icon:'error' icon: "error",
}) });
}) });
}, },
async autoCreate(){ async autoCreate() {
console.log('自动创建'); console.log("自动创建");
if(this.taskList.length > 0){ if (this.taskList.length > 0) {
var isContinue = await this.confirOption() var isContinue = await this.confirOption();
if(isContinue){ if (isContinue) {
this.goAutoCreate() this.goAutoCreate();
} }
}else{ } else {
this.goAutoCreate() this.goAutoCreate();
} }
}, },
goEdit(item){ goEdit(item) {
uni.navigateTo({ uni.navigateTo({
url:`/pages/miniClass/addHomeWork?id=${item.id}&type=${item.type}` url: `/pages/miniClass/addHomeWork?id=${item.id}&type=${item.type}`,
}) });
}, },
addTask(item){ addTask(item) {
// console.log('type',this.pageType); // console.log('type',this.pageType);
var _sort = undefined var _sort = undefined;
item ? _sort = item.sort : undefined item ? (_sort = item.sort) : undefined;
uni.navigateTo({ uni.navigateTo({
url: `/pages/miniClass/addHomeWork?classId=${this.classId}&sort=${_sort}&type=${this.pageType}` url: `/pages/miniClass/addHomeWork?classId=${this.classId}&sort=${_sort}&type=${this.pageType}`,
}) });
}, },
clickHelp(){ clickHelp() {
uni.showModal({ uni.showModal({
title:'说明', title: "说明",
content:"班内作业您可选择自动生成作业列表,或者手动逐一添加的方式来创建作业,其中需要注意的是如选择自动生成作业列表,会覆盖掉之前已经存在的作业内容。", content:
showCancel:false, "班内作业您可选择自动生成作业列表,或者手动逐一添加的方式来创建作业,其中需要注意的是如选择自动生成作业列表,会覆盖掉之前已经存在的作业内容。",
confirmText:'好的' showCancel: false,
}) confirmText: "好的",
});
}, },
// 点击作业或者医案,进入作业提交情况 // 点击作业或者医案,进入作业提交情况
clickTask(item){ clickTask(item) {
// console.log('options',options); // console.log('options',options);
uni.navigateTo({ uni.navigateTo({
url:`/pages/miniClass/taskDetailForMan?id=${item.id}&roleCode=${this.roleCode}&type=${this.pageType}&classState=${this.classState}` url: `/pages/miniClass/taskDetailForMan?id=${item.id}&roleCode=${this.roleCode}&type=${this.pageType}&classState=${this.classState}`,
}) });
}, },
getList() { getList() {
this.status = 1; this.status = 1;
@@ -243,32 +304,34 @@
return; return;
} }
uni.showLoading({ uni.showLoading({
title: '加载中' title: "加载中",
}) });
this.loadFlag = true; this.loadFlag = true;
this.pPage++; this.pPage++;
$http.request({ $http
.request({
url: "common/class/getClassTaskList", url: "common/class/getClassTaskList",
method: "POST", method: "POST",
data: { data: {
"limit": 10, limit: 10,
"page": this.pPage, page: this.pPage,
"classId": this.classId, classId: this.classId,
"type": this.pageType + '', //类型 0班内任务1医案2心得 type: this.pageType + "", //类型 0班内任务1医案2心得
"title": "" title: "",
}, },
header: { //默认 无 说明:请求头 header: {
'Content-Type': 'application/json' //默认 无 说明:请求头
"Content-Type": "application/json",
}, },
}) })
.then(res => { .then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.total = 0 this.total = 0;
if (res.page.records.length > 0) { if (res.page.records.length > 0) {
console.log('数据获取成功', res.page.records); console.log("数据获取成功", res.page.records);
var lis = res.page.records var lis = res.page.records;
this.taskList = this.taskList.concat(lis) this.taskList = this.taskList.concat(lis);
this.total = res.page.total this.total = res.page.total;
// this.taskList = taskLIst1.page.records // 测试数据 // this.taskList = taskLIst1.page.records // 测试数据
if (res.page.pages > this.pPage) { if (res.page.pages > this.pPage) {
this.status = 0; this.status = 0;
@@ -279,54 +342,70 @@
this.status = 3; // 暂无数据 this.status = 3; // 暂无数据
} }
this.loadFlag = false; this.loadFlag = false;
console.log('res', res); console.log("res", res);
uni.hideLoading() uni.hideLoading();
} }
}).catch(e => { })
console.log(e, '数据报错') .catch((e) => {
uni.hideLoading() console.log(e, "数据报错");
uni.hideLoading();
this.loadFlag = false; this.loadFlag = false;
uni.showToast({ uni.showToast({
title: e.msg, title: e.msg,
icon: 'error' icon: "error",
}) });
}); });
}, },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/style/mixin.scss"; @import "@/style/mixin.scss";
.addTips{padding: 20rpx; background-color: #fff; } .addTips {
.btnBox{ padding: 20rpx;
text{padding: 16rpx 10rpx; margin: 20rpx; display: block; color: #fff;} background-color: #fff;
.zidong{ }
.btnBox {
text {
padding: 16rpx 10rpx;
margin: 20rpx;
display: block;
color: #fff;
}
.zidong {
background-color: #55aa00; background-color: #55aa00;
} }
.shoudong{background-color:$themeColor;} .shoudong {
background-color: $themeColor;
} }
.fangshi{font-size: 36rpx; color: #666;} }
.listTitle{ .fangshi {
font-size: 36rpx;
color: #666;
}
.listTitle {
margin: 20rpx 0; margin: 20rpx 0;
} }
.example-body { .example-body {
padding: 10px; padding: 10px;
} }
.pad20 { .pad20 {
padding: 20rpx; padding: 20rpx;
} }
.scroll-view { .scroll-view {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
width: 100%; width: 100%;
height: 100%; height: 100%;
/* #endif */ /* #endif */
flex: 1 flex: 1;
} }
.addBtn{padding-right:20rpx;} .addBtn {
.submitRecode { padding-right: 20rpx;
}
.submitRecode {
// padding: 20rpx; // padding: 20rpx;
.newBox { .newBox {
@@ -346,29 +425,60 @@
box-shadow: none !important; box-shadow: none !important;
// border-bottom: 1px solid #eee; // border-bottom: 1px solid #eee;
border-radius: 20rpx; border-radius: 20rpx;
padding: 20rpx ; padding: 20rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
.leve1 { .leve1 {
align-items: center; align-items: center;
// padding-bottom: 20rpx; // padding-bottom: 20rpx;
.edit{border:1px solid $themeColor; color: $themeColor;} .edit {
border: 1px solid $themeColor;
color: $themeColor;
}
// .userName{} // .userName{}
} }
.leve2 { justify-content: center; margin-top: 20rpx; .leve2 {
color: #999; font-size: 24rpx;border-top: 1px dashed #eee; justify-content: center;
.jianjie{@include bov(2); margin-top: 20rpx; font-size: 32rpx;} margin-top: 20rpx;
b{font-size: 34rpx; padding: 0 4rpx; font-weight: normal; color: #333; color: red;} color: #999;
.item{text-align: center; padding-top: 0; padding-bottom: 0; margin-bottom: 0;} font-size: 24rpx;
border-top: 1px dashed #eee;
.jianjie {
@include bov(2);
margin-top: 20rpx;
font-size: 32rpx;
}
b {
font-size: 34rpx;
padding: 0 4rpx;
font-weight: normal;
color: #333;
color: red;
}
.item {
text-align: center;
padding-top: 0;
padding-bottom: 0;
margin-bottom: 0;
}
} }
.leve3 { .leve3 {
color: $themeColor; color: $themeColor;
text-align: center; text-align: center;
padding-top: 10rpx; margin-top: 20rpx; margin-bottom: 10rpx; padding-top: 10rpx;
.add{color: #ffaa7f; border: 1px solid #ffaa7f;} margin-top: 20rpx;
.del{color: #ff557f; border: 1px solid #ff557f; margin-left: 20rpx;} margin-bottom: 10rpx;
.add {
color: #ffaa7f;
border: 1px solid #ffaa7f;
}
.del {
color: #ff557f;
border: 1px solid #ff557f;
margin-left: 20rpx;
}
.tips { .tips {
width: 100%; width: 100%;
justify-content: space-between; justify-content: space-between;
@@ -376,7 +486,8 @@
color: #999; color: #999;
} }
.date {} .date {
}
.btn { .btn {
border: 1px solid $themeColor; border: 1px solid $themeColor;
@@ -394,21 +505,19 @@
} }
} }
} }
} }
.info {
.info {
padding: 15px; padding: 15px;
color: #666; color: #666;
} }
.info-text { .info-text {
font-size: 14px; font-size: 14px;
color: #666; color: #666;
} }
.info-content { .info-content {
padding: 5px 15px; padding: 5px 15px;
} }
</style> </style>