* A 课堂-普通作业模块 * A 页面不存在时进入主页 * A referrerInfo 分析 * A 主页课堂菜单操作 * A error-page组件错误处理界面 * U 加入课堂对话框功能升级 * U 课堂页面错误处理 * U 课程邀请界面改进,增加已停用时的图标 * U 改变小程序码生成接口为getWXACodeUnlimited * F 试卷题目富文本显示异常 * D 隐藏发现页入口master
parent
0b47aa0777
commit
62e5403be7
@ -1,5 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"towxml": "/towxml/towxml"
|
||||
"rich-md": "/components/rich-md/rich-md"
|
||||
}
|
||||
}
|
@ -1 +1 @@
|
||||
<towxml nodes="{{article}}"></towxml>
|
||||
<rich-md my-class="body" nodes="{{md}}"/>
|
@ -0,0 +1,4 @@
|
||||
.body{
|
||||
padding-bottom: 12px;
|
||||
background: white;
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"rich-md": "/components/rich-md/rich-md"
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
<rich-md my-class="body" nodes="{{md}}"/>
|
@ -0,0 +1,4 @@
|
||||
.body{
|
||||
padding-bottom: 12px;
|
||||
background: white;
|
||||
}
|
@ -1 +0,0 @@
|
||||
we-cropper/
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,17 @@
|
||||
<template name="we-cropper">
|
||||
<canvas
|
||||
class="cropper"
|
||||
disable-scroll="true"
|
||||
bindtouchstart="touchStart"
|
||||
bindtouchmove="touchMove"
|
||||
bindtouchend="touchEnd"
|
||||
style="width:{{width}}px;height:{{height}}px;background-color: rgba(0, 0, 0, 0.8)"
|
||||
canvas-id="{{id}}">
|
||||
</canvas>
|
||||
<canvas
|
||||
class="cropper"
|
||||
disable-scroll="true"
|
||||
style="position: fixed; top: -{{width * pixelRatio}}px; left: -{{height * pixelRatio}}px; width:{{width * pixelRatio}}px;height:{{height * pixelRatio}}px;"
|
||||
canvas-id="{{targetId}}">
|
||||
</canvas>
|
||||
</template>
|
@ -0,0 +1,66 @@
|
||||
// miniprogram/challenge/pages/challenge/challenge.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<!--miniprogram/challenge/pages/challenge/challenge.wxml-->
|
||||
<text>miniprogram/challenge/pages/challenge/challenge.wxml</text>
|
@ -0,0 +1 @@
|
||||
/* miniprogram/challenge/pages/challenge/challenge.wxss */
|
@ -0,0 +1,183 @@
|
||||
const app = getApp();
|
||||
Component({
|
||||
properties:{
|
||||
work_id:Number,
|
||||
homework_id:Number,
|
||||
homework_name:String,
|
||||
},
|
||||
data: {
|
||||
attachments:[],
|
||||
description:""
|
||||
},
|
||||
methods:{
|
||||
updateInput({detail:{value}}){
|
||||
this.setData({description: value});
|
||||
},
|
||||
submit(){
|
||||
let {description} =this.data;
|
||||
let attachment_ids = this.data.attachments.map(i=>i.id);
|
||||
if(this.data.uploading)
|
||||
return wx.showToast({
|
||||
title: '请等待文件上传完毕',icon:"none"
|
||||
})
|
||||
if(this.data.un_commit_work){
|
||||
let { homework_id } = this.data;
|
||||
app.api("homework_commons.student_works", { method: "POST" })({ description, attachment_ids, homework_id })
|
||||
.then(res => {
|
||||
console.log(res);
|
||||
app.showMsg(res);
|
||||
this.setData({})
|
||||
})
|
||||
.catch(e => {
|
||||
app.showError(e);
|
||||
})
|
||||
}else{
|
||||
let { work_id } = this.data;
|
||||
app.api("student_works")({ description, attachment_ids, work_id })
|
||||
.then(res => {
|
||||
app.showMsg(res);
|
||||
})
|
||||
.catch(e => {
|
||||
app.showError(e);
|
||||
})
|
||||
}
|
||||
},
|
||||
uploadAttachment(){
|
||||
var cbList = ["uploadFile", "uploadImage", "uploadVideo"];
|
||||
wx.showActionSheet({
|
||||
itemList: ["微信文件","上传照片","上传视频"],
|
||||
success:res=>{
|
||||
this[cbList[res.tapIndex]]();
|
||||
}
|
||||
})
|
||||
},
|
||||
uploadFile(){
|
||||
wx.chooseMessageFile({
|
||||
count:1,
|
||||
success:res=>{
|
||||
console.log("getfilepath");
|
||||
this.upload(res.tempFiles[0])
|
||||
}
|
||||
})
|
||||
},
|
||||
uploadImage(){
|
||||
wx.chooseImage({
|
||||
count:1,
|
||||
success:res=>{
|
||||
this.upload(res.tempFiles[0])
|
||||
}
|
||||
})
|
||||
},
|
||||
uploadVideo(){
|
||||
wx.chooseVideo({
|
||||
success:res=>{
|
||||
this.upload({path: res.tempFilePath, size:res.size});
|
||||
}
|
||||
})
|
||||
},
|
||||
upload({path, size, name}){
|
||||
console.log("upload", path, name)
|
||||
if(this.size>157286400)
|
||||
return wx.showModal({
|
||||
title: '错误',
|
||||
content: '文件不能大于150M',
|
||||
showCancel: false
|
||||
})
|
||||
this.setData({uploading:true});
|
||||
console.log("uploading")
|
||||
app.api("attachments")({
|
||||
file:path,
|
||||
complete: ()=>{this.setData({uploading:false})}
|
||||
})
|
||||
.then(res=>{
|
||||
let match = path.match(/\/([^\/]+$)/);
|
||||
let title = match?match[1]:path;
|
||||
let attachment = {id:res.id,title,path, url:"/api/attachments/"+res.id}
|
||||
this.setData({attachments: this.data.attachments.concat(attachment)});
|
||||
})
|
||||
.catch(app.showError)
|
||||
},
|
||||
onTapFile({target:{dataset:{id}}}){
|
||||
if(!id) return;
|
||||
wx.showActionSheet({
|
||||
itemList: ["预览","删除"],
|
||||
success:res=>{
|
||||
if(res.tapIndex==0){
|
||||
let attachment = this.data.attachments.filter(i=>i.id==id)[0];
|
||||
let url = global.config.eduUrl + attachment.url;
|
||||
let path = attachment.path;
|
||||
let match = attachment.title.match(/.([^.\/]+$)/)
|
||||
if(match&&["jpg","png","bmp","gif","jpeg"].indexOf(match[1].toLowerCase())!=-1){
|
||||
if(path)
|
||||
var urls = [path];
|
||||
else
|
||||
var urls = [url];
|
||||
wx.previewImage({
|
||||
urls,
|
||||
fail:e=>{wx.showToast({icon:"none",title:"预览失败"})}
|
||||
})
|
||||
}else{
|
||||
if(path){
|
||||
wx.openDocument({
|
||||
filePath: path,
|
||||
fail:res=>{wx.showToast({icon:"none",title:"不支持该文件类型"})}
|
||||
})
|
||||
}else{
|
||||
wx.showLoading({
|
||||
title: '加载中',
|
||||
})
|
||||
wx.downloadFile({
|
||||
url,
|
||||
success:res=>{
|
||||
wx.openDocument({
|
||||
filePath: res.tempFilePath,
|
||||
fail:e=>{wx.showToast({icon:"none",title:"不支持该文件类型"})}
|
||||
})
|
||||
},
|
||||
complete:wx.hideLoading,
|
||||
fail:e=>{
|
||||
wx.showToast({
|
||||
title: '预览失败',icon:"none"
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}else if(res.tapIndex==1){
|
||||
app.api("attachments",{method:"DELETE"})({attachment_id: id})
|
||||
.then(res=>{
|
||||
var attachments = this.data.attachments.filter(i => i.id != id);
|
||||
this.setData({ attachments });
|
||||
app.showMsg(res);
|
||||
})
|
||||
.catch(e=>{
|
||||
if(e.code==404){
|
||||
e.message = "该资源已经被删除了";
|
||||
var attachments = this.data.attachments.filter(i => i.id != id);
|
||||
this.setData({ attachments });
|
||||
}
|
||||
app.showError(e);
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
pullEdit(){
|
||||
let {work_id} = this.data;
|
||||
app.api("student_works.edit")({work_id})
|
||||
.then(res=>{
|
||||
this.setData(res);
|
||||
});
|
||||
},
|
||||
onLoad: function (options) {
|
||||
console.log(this.data, options);
|
||||
if(options.un_commit_work=="true")
|
||||
this.setData({un_commit_work:true});
|
||||
if(!this.data.un_commit_work)
|
||||
this.pullEdit();
|
||||
},
|
||||
onShow: function () {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "普通作业"
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<page-meta>
|
||||
<navigation-bar title="{{homework_name||'普通作业'}}"/>
|
||||
</page-meta>
|
||||
<view class="homework">
|
||||
<textarea
|
||||
class="desp"
|
||||
placeholder="输入作品描述"
|
||||
bindinput="updateInput"
|
||||
value="{{description}}"/>
|
||||
<view class="operations">
|
||||
<button class="upload" bindtap="uploadAttachment" loading="{{uploading}}" disabled="{{uploading}}" size="mini" plain="1">{{uploading?'上传中':'添加附件'}}</button>
|
||||
<button class="submit" bindtap="submit" size="mini">提交</button>
|
||||
</view>
|
||||
<view class="tip">暂不支持保持附件原文件名</view>
|
||||
<view class="attachments" bindtap="onTapFile">
|
||||
<view class="attachment" wx:for="{{attachments}}" wx:key="id" data-id="{{item.id}}">
|
||||
{{item.title}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,40 @@
|
||||
.desp{
|
||||
background: white;
|
||||
border: 1px solid grey;
|
||||
border-radius: 5px;
|
||||
margin: 10px;
|
||||
padding: 10px;
|
||||
width: auto;
|
||||
}
|
||||
.operations{
|
||||
display: flex;
|
||||
}
|
||||
.operations>button{
|
||||
width: 96px;
|
||||
}
|
||||
.upload{
|
||||
border-color: #0080f0;
|
||||
color: #0080f0;
|
||||
}
|
||||
.submit{
|
||||
background: #0080f0;
|
||||
color: white;
|
||||
}
|
||||
.tip{
|
||||
color: #0080f0;
|
||||
font-size: 12px;
|
||||
padding-left: 12px;
|
||||
|
||||
}
|
||||
.attachments{
|
||||
margin-top: 16px;
|
||||
}
|
||||
.attachment{
|
||||
padding: 8px 10px;
|
||||
margin: 6px 6px;
|
||||
border-radius: 6px;
|
||||
background: white;
|
||||
overflow: hidden;
|
||||
word-wrap: break-word;
|
||||
|
||||
}
|
@ -1,10 +1,11 @@
|
||||
<navigator class="bg{{course_id%7}} course" url="/course/pages/course/course?course_id={{course_id}}">
|
||||
<view class="header"><image class="action" mode="aspectFit" catchtap="showAction" src="{{imgDir}}more-dots-white.png"/></view>
|
||||
<navigator class="bg{{data.id%7}} course" url="/course/pages/course/course?course_id={{data.id}}" bindlongpress="showAction">
|
||||
<view wx:if="{{data.sticky}}" class="sticky"></view>
|
||||
<view class="header"><image class="action" mode="aspectFit" catchtap="showAction" src="./more.png"/></view>
|
||||
<view class="body">
|
||||
<image class="avatar" src="{{eduImgDir}}{{teacher.avatar_url}}"/>
|
||||
<image class="avatar" src="{{eduImgDir}}{{data.avatar_url}}"/>
|
||||
<view class="course-info">
|
||||
<view class="course-name">{{name}}</view>
|
||||
<view><text class="school">{{school}}</text> <text>{{teacher.real_name}}</text> </view>
|
||||
<view class="course-name">{{data.name}}</view>
|
||||
<view><text class="school">{{data.school}}</text> <text>{{data.creator}}</text> </view>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
After Width: | Height: | Size: 457 B |
@ -1,12 +1,49 @@
|
||||
const app = getApp();
|
||||
const config = global.config;
|
||||
const imgUrl = config.imgDir+"blank_info_bg.png";
|
||||
const scenes = {
|
||||
imgUrl,
|
||||
401:{
|
||||
message:"请先登陆哦",
|
||||
btnText:"点击登陆"
|
||||
}
|
||||
}
|
||||
Component({
|
||||
properties: {
|
||||
status:Number
|
||||
status:{
|
||||
type:Number,
|
||||
observer:function(res){
|
||||
this.refresh()
|
||||
}
|
||||
},
|
||||
config:Object,
|
||||
bg:{
|
||||
type:String,
|
||||
value:"#00b0f0"
|
||||
}
|
||||
},
|
||||
data: {
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
refresh(){
|
||||
let {config, status} = this.data;
|
||||
var {message="", btnText="", imgUrl=""} = scenes;
|
||||
if(scenes[status])
|
||||
var {message=message, btnText=btnText, imgUrl=imgUrl} = scenes[status];
|
||||
if(config[status])
|
||||
var {message=message, btnText=btnText, imgUrl=imgUrl} = config[status];
|
||||
this.setData({message, btnText, imgUrl});
|
||||
},
|
||||
onTapBody(){
|
||||
console.log("tapbody")
|
||||
let {status} = this.data;
|
||||
this.triggerEvent("refresh",{target:"body", status})
|
||||
},
|
||||
onTapButton(){
|
||||
console.log("tapButton")
|
||||
let {status } =this.data;
|
||||
this.triggerEvent("refresh",{target:"button", status})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -1,5 +1,7 @@
|
||||
<view class="body" bindtap="onTapBody">
|
||||
<image class="img" mode="aspectFit" src="{{imgUrl}}"/>
|
||||
<view class="msg">{{msg}}</view>
|
||||
<button class="btn" catchtap="onTapButton">{{btnText}}</button>
|
||||
<view wx:if="{{message}}" class="body" style="background:{{bg}}" bindtap="onTapBody">
|
||||
<view class="info">
|
||||
<image class="image" mode="aspectFit" src="{{imgUrl}}"/>
|
||||
<view class="message">{{message||'请先登陆哦'}}</view>
|
||||
<button wx:if="{{btnText}}" class="button" catchtap="onTapButton" size="mini">{{btnText}}</button>
|
||||
</view>
|
||||
</view>
|
@ -1,9 +1,9 @@
|
||||
<modal class="join_course" hidden="{{hidden}}" title="加入课堂" confirm-text="提交" cancel-text="取消" bindcancel="cancel" bindconfirm="join_course">
|
||||
<input type='text' bindinput="update_invite_code" class="code-input" placeholder="邀请码" auto-focus/>
|
||||
<checkbox-group bindchange="update_identities">
|
||||
<modal class="join_course" wx:if="{{!hidden}}" title="加入课堂" confirm-text="提交" cancel-text="取消" bindcancel="cancel" bindconfirm="join_course">
|
||||
<input type='text' bindinput="update_invite_code" value="{{invite_code}}" class="code-input {{show_code?'':'hidden'}}" placeholder="邀请码" auto-focus/>
|
||||
<checkbox-group class="identities" bindchange="update_identities">
|
||||
<text>身份:</text>
|
||||
<lable class="identity"><checkbox value="professor"/>教师</lable>
|
||||
<lable class="identity"><checkbox value="assistant_professor"/>助教</lable>
|
||||
<lable class="identity"><checkbox value="student"/>学生</lable>
|
||||
<checkbox class="identity" color="#00b0f0" disabled="{{assistant_professor}}" checked="{{professor}}" value="professor">教师</checkbox>
|
||||
<checkbox class="identity" color="#00b0f0" disabled="{{professor}}" checked="{{assistant_professor}}" value="assistant_professor">助教</checkbox>
|
||||
<checkbox class="identity" color="#00b0f0" checked="{{student}}" value="student">学生</checkbox>
|
||||
</checkbox-group>
|
||||
</modal>
|
@ -1,15 +1,17 @@
|
||||
.code-input{
|
||||
border-radius: 10rpx;
|
||||
border-radius: 5px;
|
||||
border: 1rpx solid;
|
||||
height: 36px;
|
||||
margin-bottom: 24rpx;
|
||||
padding-left: 16rpx;
|
||||
padding: 6px 10px;
|
||||
}
|
||||
lable.identity{
|
||||
margin-right: 16rpx;
|
||||
.identities{
|
||||
padding-top: 8px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.loading{
|
||||
text-align:center;
|
||||
padding: 14rpx 0;
|
||||
.identity{
|
||||
flex:auto;
|
||||
}
|
||||
|
||||
.hidden{
|
||||
display: none;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<scroll-view wx:if="{{list.length>1}}" scroll-x="1" class="c-container" scroll-left="{{scrollLeft}}rpx" scroll-with-animation="1" style="width:{{width}}rpx;background:{{bg}}">
|
||||
<view wx:for="{{list}}" wx:key="index" class="common c-{{type}} {{current == index ?'active':''}}" data-current="{{index}}" bindtap="switchNav" style="margin:0 {{mg}}rpx;{{_itemWidth>0?'width:'+_itemWidth+'rpx':''}} ">
|
||||
<text class="common c-{{type}} {{current == index ?'active':''}}">{{item.text}}</text>
|
||||
<view wx:for="{{list}}" wx:key="index" class="view common c-{{type}} {{current == index ?'active':''}}" data-current="{{index}}" bindtap="switchNav" style="margin:0 {{mg}}rpx;{{_itemWidth>0?'width:'+_itemWidth+'rpx':''}} ">
|
||||
<text class="text common c-{{type}} {{current == index ?'active':''}}">{{item.text}}</text>
|
||||
</view>
|
||||
</scroll-view>
|
@ -1,2 +1,5 @@
|
||||
<rich-text wx:if="{{isRich}}" nodes="{{nodes}}"/>
|
||||
<toxwml wx:else modes="{{nodes}}"/>
|
||||
<view class="my-class">
|
||||
<rich-text wx:if="{{type=='rich-text'}}" space="nbsp" nodes="{{nodes}}"/>
|
||||
<towxml wx:elif="{{type=='markdown'||type=='html'}}" nodes="{{_nodes}}"/>
|
||||
<text wx:elif="{{type=='plain'}}">{{nodes}}</text>
|
||||
</view>
|
@ -0,0 +1,16 @@
|
||||
Component({
|
||||
|
||||
properties: {
|
||||
data:Object
|
||||
},
|
||||
|
||||
data: {
|
||||
eduImgDir:global.config.eduImgDir
|
||||
},
|
||||
attached(){
|
||||
console.log(this.data);
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
@ -0,0 +1,7 @@
|
||||
<view class="tiding">
|
||||
<image class="avatar" mode="scaleToFill" src="{{eduImgDir}}{{data.trigger_user.image_url}}"></image>
|
||||
<view class="tiding-info">
|
||||
<view class="name">{{data.trigger_user.name}} {{data.time}}</view>
|
||||
<view class="content">{{data.content}}</view>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,22 @@
|
||||
.tiding{
|
||||
display: flex;
|
||||
padding: 12px;
|
||||
background: white;
|
||||
}
|
||||
.avatar{
|
||||
border-radius: 50px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
.tiding-info{
|
||||
margin-left: 12px;
|
||||
flex: 1 1 1px;
|
||||
width: 1px;
|
||||
}
|
||||
.name{
|
||||
color: dimgray;
|
||||
font-size: 14px;
|
||||
}
|
||||
.content{
|
||||
margin: 8px 0;
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<view class="container">
|
||||
<text>课堂资源</text>
|
||||
<view class="no-file-view">
|
||||
<image hidden="{{files.length!=0 || loading}}" src="{{imgDir}}/blank2.png" class="no-file"></image>
|
||||
</view>
|
||||
<view class="file-list form-wrap">
|
||||
<block wx:for="{{files}}" wx:for-item="file" wx:key="objectId">
|
||||
<view class="file-item flex-wrap" bindtap="previewFile" data-url="{{file.url}}">
|
||||
<text>{{file.title}}</text>
|
||||
<text class="hint file-uploader">上传者:{{file.author.name}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{false}}" class="upload-file foot">
|
||||
<button type="primary" size="mini" bindtap="upload">上传文件资源</button>
|
||||
</view>
|
@ -1,5 +1,3 @@
|
||||
<nav-bar list="{{navList}}" bindchange="switchNav"></nav-bar>
|
||||
<scroll-view refresher-enabled="1" bindrefresherrefresh="onPullDownRefresh">
|
||||
|
||||
|
||||
</scroll-view>
|
||||
<view class="homework" bindtap="enterDetail">
|
||||
<text>{{data.name}}</text>
|
||||
</view>
|
@ -1 +1,5 @@
|
||||
/* course/components/common-homework-item/common-homework-item.wxss */
|
||||
.homework{
|
||||
background: white;
|
||||
padding: 12px;
|
||||
border-radius: 4px;
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
const app = getApp();
|
||||
Component({
|
||||
properties: {
|
||||
course_id:Number,
|
||||
refresh:{
|
||||
type:Number,
|
||||
observer:function(r){
|
||||
if (r) {
|
||||
this.onPullDownRefresh();
|
||||
this.setData({ refresh: false });
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
@ -1,2 +0,0 @@
|
||||
<!--course/components/common-homework/common-homework.wxml-->
|
||||
<text>course/components/common-homework/common-homework.wxml</text>
|
@ -1 +0,0 @@
|
||||
/* course/components/common-homework/common-homework.wxss */
|
@ -0,0 +1,34 @@
|
||||
const app = getApp();
|
||||
Component({
|
||||
properties: {
|
||||
data:Object
|
||||
},
|
||||
data: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
preview(){
|
||||
let url = global.config.eduUrl + this.data.data.url;
|
||||
if (this.data.data.content_type.startsWith("image")) {
|
||||
wx.previewImage({
|
||||
urls: [url]
|
||||
});
|
||||
return;
|
||||
}
|
||||
wx.showLoading({
|
||||
title: '下载中',
|
||||
})
|
||||
wx.downloadFile({
|
||||
url,
|
||||
success: (res) => {
|
||||
wx.openDocument({
|
||||
filePath: res.tempFilePath,
|
||||
fail: app.showError
|
||||
});
|
||||
},
|
||||
fail: app.showError,
|
||||
complete: wx.hideLoading
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
@ -0,0 +1,4 @@
|
||||
<view class="file" bindtap="preview">
|
||||
<text>{{data.title}}</text>
|
||||
<text class="hint file-uploader">上传者:{{data.author.name}}</text>
|
||||
</view>
|
@ -0,0 +1,11 @@
|
||||
.file{
|
||||
background: white;
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.file-item text{
|
||||
vertical-align: middle;
|
||||
}
|
After Width: | Height: | Size: 1.7 KiB |
@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"file-item":"/course/components/file-item/file-item"
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
<view class="module">
|
||||
<text>课堂资源</text>
|
||||
<view class="no-file-view">
|
||||
<image hidden="{{files.length!=0 || loading}}" src="{{imgDir}}/blank2.png" class="no-file"></image>
|
||||
</view>
|
||||
<view class="files">
|
||||
<view class="file-wrap" wx:for="{{files}}" wx:key="id">
|
||||
<file-item data="{{item}}"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{false}}" class="upload-file foot">
|
||||
<button type="primary" size="mini" bindtap="upload">上传文件资源</button>
|
||||
</view>
|
@ -1,19 +1,10 @@
|
||||
/* pages/classdetail/classdetail.wxss */
|
||||
.file-list{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 0 -12px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.file-item{
|
||||
background: white;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding: 16rpx 16px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.file-item text{
|
||||
vertical-align: middle;
|
||||
.module{
|
||||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.file-wrap{
|
||||
margin: 7px 6px;
|
||||
}
|
||||
|
||||
.file-uploader{
|
@ -0,0 +1,45 @@
|
||||
const app = getApp();
|
||||
Component({
|
||||
properties: {
|
||||
course_id:Number,
|
||||
id_:Number,
|
||||
refresh:{
|
||||
type:Number,
|
||||
observer:function(r){
|
||||
if (r) {
|
||||
console.log("observer refresh")
|
||||
this.refresh();
|
||||
this.setData({ refresh: false });
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
data: {
|
||||
list:[{text:"全部",order:""},{text:"未发布",order:0},{text:"提交中",order:1},{text:"补交中",order:2},{text:"匿评中",order:3},{text:"申诉中",order:4},{text:"已截止",order:5}]
|
||||
},
|
||||
attached(){
|
||||
this.refresh();
|
||||
},
|
||||
methods: {
|
||||
onSwitchNav({detail:{current, value}}){
|
||||
console.log("switchNav")
|
||||
if(!this.options)
|
||||
this.options={};
|
||||
this.options.order=value.order;
|
||||
this.refresh();
|
||||
},
|
||||
refresh(){
|
||||
let {course_id} = this.data;
|
||||
console.log(this.options);
|
||||
app.api("courses.homework_commons")({...this.options, course_id, type:1})
|
||||
.then(res=>{
|
||||
console.log(res);
|
||||
this.setData({homeworks: res.homeworks});
|
||||
}).catch(e=>{
|
||||
app.showError(e);
|
||||
console.error(e);
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
})
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"nav-bar": "/components/nav-bar/nav-bar",
|
||||
"common-homework-item":"/course/components/common-homework-item/common-homework-item"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
<view class="module">
|
||||
<nav-bar list="{{list}}" itemWidth="107" bindchange="onSwitchNav"/>
|
||||
<scroll-view class="homeworks" scroll-y="1">
|
||||
<view class="homework-wrap" wx:for="{{homeworks}}">
|
||||
<common-homework-item data="{{item}}"/>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
@ -0,0 +1,3 @@
|
||||
.homework-wrap{
|
||||
margin: 6px 10px;
|
||||
}
|
@ -1,9 +1,8 @@
|
||||
.container{
|
||||
.exercise-module{
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.tab-box{
|
||||
box-sizing: border-box;
|
||||
flex: 1 1 10px;
|
@ -1,28 +1,24 @@
|
||||
<view class="question">
|
||||
<text class="hint">第{{question.q_position}}题</text>
|
||||
<rich-text class="question-title" nodes="{{question.question_title}}" space="nbsp"></rich-text>
|
||||
<view wx:if="{{question.question_type==0 || question.question_type==2}}">
|
||||
<radio-group class="choices" bindchange="answer_choice_question" data-question_id="{{question.question_id}}">
|
||||
<block wx:for="{{question.question_choices}}" wx:for-item="choice" wx:key="choice_id">
|
||||
<radio disabled="{{exercise.user_exercise_status==1 || exercise.user_exercise_status==4}}" class="choice" checked="{{choice.user_answer_boolean}}" value="{{choice.choice_id}}">
|
||||
<view class="choice">
|
||||
<text class="choice-text">{{choice.choice_text}}</text>
|
||||
<text wx:if="{{choice.standard_boolean}}" class="error standard-choice">正确答案</text>
|
||||
</view>
|
||||
</radio>
|
||||
</block>
|
||||
</radio-group>
|
||||
</view>
|
||||
<view wx:elif="{{question.question_type==1}}">
|
||||
<checkbox-group class="choices" bindchange="answer_choice_question" data-question_id="{{question.question_id}}">
|
||||
<block wx:for="{{question.question_choices}}" wx:for-item="choice" wx:key="choice_id">
|
||||
<checkbox class="choice" disabled="{{exercise.user_exercise_status==1 || exercise.user_exercise_status==4}}" checked="{{choice.user_answer_boolean}}" value="{{choice.choice_id}}">
|
||||
<view class="choice">
|
||||
<text class="choice-text">{{choice.choice_text}}</text>
|
||||
<text wx:if="{{choice.standard_boolean}}" class="error standard-choice">正确答案</text>
|
||||
</view>
|
||||
</checkbox>
|
||||
</block>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
<view class="hint">第{{data.q_position}}题</view>
|
||||
<rich-md my-class="title" nodes="{{data.question_title}}"/>
|
||||
<radio-group class="choices" wx:if="{{data.question_type==0 || data.question_type==2}}" bindchange="answer_choice_question" data-question_id="{{data.question_id}}">
|
||||
<block wx:for="{{data.question_choices}}" wx:for-item="choice" wx:key="choice_id">
|
||||
<radio class="choice" color="#00b0f0" disabled="{{exercise.user_exercise_status==1 || exercise.user_exercise_status==4}}" checked="{{choice.user_answer_boolean}}" value="{{choice.choice_id}}">
|
||||
<view class="choice-content">
|
||||
<rich-md class="choice-text" nodes="{{choice.choice_text}}"/>
|
||||
<text wx:if="{{choice.standard_boolean}}" class="error standard-choice">正确答案</text>
|
||||
</view>
|
||||
</radio>
|
||||
</block>
|
||||
</radio-group>
|
||||
<checkbox-group class="choices" wx:elif="{{data.question_type==1}}" bindchange="answer_choice_question" data-question_id="{{data.question_id}}">
|
||||
<block wx:for="{{data.question_choices}}" wx:for-item="choice" wx:key="choice_id">
|
||||
<checkbox color="#00b0f0" class="choice" disabled="{{exercise.user_exercise_status==1 || exercise.user_exercise_status==4}}" checked="{{choice.user_answer_boolean}}" value="{{choice.choice_id}}">
|
||||
<view class="choice-content">
|
||||
<rich-md class="choice-text" nodes="{{choice.choice_text}}"/>
|
||||
<text wx:if="{{choice.standard_boolean}}" class="error standard-choice">正确答案</text>
|
||||
</view>
|
||||
</checkbox>
|
||||
</block>
|
||||
</checkbox-group>
|
||||
</view>
|
@ -1,4 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
"usingComponents": {
|
||||
"rich-md": "/components/rich-md/rich-md"
|
||||
}
|
||||
}
|
@ -1,11 +1,13 @@
|
||||
<view>
|
||||
<view class="question">
|
||||
<view class="hint">第{{data.q_position}}题</view>
|
||||
<rich-md my-class="title" nodes="{{data.question_title}}"/>
|
||||
<textarea disabled="{{exercise.user_exercise_status==1 || exercise.user_exercise_status==4}}" class="main-input"
|
||||
placeholder="输入答案"
|
||||
bindblur="answer_main_question"
|
||||
value="{{question.user_answer[0]||''}}"
|
||||
data-question_id="{{question.question_id}}">
|
||||
value="{{data.user_answer[0]||''}}"
|
||||
data-question_id="{{data.question_id}}">
|
||||
</textarea>
|
||||
<view wx:if="{{question.standard_answer}}" class="standard-main-input">
|
||||
<view wx:if="{{data.standard_answer}}" class="standard-main-input">
|
||||
<text class="hint">参考答案:</text>
|
||||
<text class="error">{{question.standard_answer[0]||'暂无'}}</text>
|
||||
</view>
|
||||
|
@ -1 +1,10 @@
|
||||
/* exercise/components/main-question/main-question.wxss */
|
||||
@import "../question-common.wxss";
|
||||
|
||||
.main-input{
|
||||
height: 120rpx;
|
||||
margin: 18rpx 0 4rpx 18rpx;
|
||||
border: 1rpx solid lightgray;
|
||||
border-radius: 12rpx;
|
||||
padding: 12rpx 10rpx;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
"usingComponents": {
|
||||
"rich-md": "/components/rich-md/rich-md"
|
||||
}
|
||||
}
|
@ -1 +1,19 @@
|
||||
/* exercise/components/null-question/null-question.wxss */
|
||||
@import "../question-common.wxss";
|
||||
|
||||
.input-wrap{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.null-input{
|
||||
flex: auto;
|
||||
border: 1rpx solid lightgray;
|
||||
padding: 10rpx 12rpx;
|
||||
margin: 6rpx 10rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
standard-null-input{
|
||||
align-items: center;
|
||||
display: flex;
|
||||
}
|
||||
|
@ -0,0 +1,14 @@
|
||||
.question{
|
||||
background: white;
|
||||
padding: 4rpx 20rpx 22rpx 22rpx;
|
||||
border-radius: 18rpx;
|
||||
}
|
||||
.hint{
|
||||
padding: 6px;
|
||||
font-size: 15px;
|
||||
color: #0080f0;
|
||||
}
|
||||
.title>text,.title>rich-text{
|
||||
margin: 5rpx 6rpx 12rpx 6rpx;
|
||||
display: block;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
|
||||
Component({
|
||||
|
||||
properties: {
|
||||
data:Object
|
||||
},
|
||||
|
||||
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"rich-md": "/components/rich-md/rich-md"
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<view class="question">
|
||||
<view class="hint">第{{data.q_position}}题</view>
|
||||
<rich-md c-class="title" nodes="{{data.question_title}}"/>
|
||||
<text class="hint">对不起,暂时不支持实训题 ╥﹏╥ </text>
|
||||
</view>
|
@ -0,0 +1 @@
|
||||
@import "../question-common.wxss";
|
@ -1,14 +1,15 @@
|
||||
<view class="container">
|
||||
<view class="question-list">
|
||||
<view class="question-wrap" wx:for="{{exercise_questions}}" wx:key="question_id">
|
||||
<question-item data="{{item}}"/>
|
||||
<view wx:if="{{question.question_type==5}}">
|
||||
<text class="hint">暂不支持实训题...</text>
|
||||
</view>
|
||||
</view>
|
||||
<page-meta>
|
||||
<navigation-bar title="{{exercise.exercise_name}}"/>
|
||||
</page-meta>
|
||||
<scroll-view scroll-y="1" class="questions">
|
||||
<view class="question-wrap" wx:for="{{exercise_questions}}" wx:key="question_id">
|
||||
<choice-question id="q-{{item.question_id}}" wx:if="{{item.question_type<3}}" data="{{item}}"/>
|
||||
<null-question id="q-{{item.question_id}}" wx:elif="{{item.question_type==3}}" data="{{item}}"/>
|
||||
<main-question id="q-{{item.question_id}}" wx:elif="{{item.question_type==4}}" data="{{item}}"/>
|
||||
<shixun-question id="q-{{item.question_id}}" wx:elif="{{item.question_type==5}}" data="{{item}}"/>
|
||||
</view>
|
||||
</view>
|
||||
<cover-view wx:if="{{exercise.user_exercise_status!=1 && exercise.user_exercise_status!=4}}" hidden="{{loading}}" class="foot flex-wrap" >
|
||||
</scroll-view>
|
||||
<view wx:if="{{exercise.user_exercise_status!=1 && exercise.user_exercise_status!=4}}" hidden="{{loading}}" class="foot flex-wrap" >
|
||||
<button class="save operation" catchtap="save_exercise">保存</button>
|
||||
<button class="commit operation" catchtap="commit_exercise">交卷</button>
|
||||
</cover-view>
|
||||
</view>
|
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 908 B |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue