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