学生、教师管理模块,实训黑暗模式

master
educoder_weapp 5 years ago
parent b42f4ca2e5
commit c9202a7602

1
.gitignore vendored

@ -1,5 +1,6 @@
api_docs/
.idea/
.wechatide/
res/
docs/
pandocs

@ -1,3 +1,8 @@
## v0.15.0
* A 实训关卡黑暗模式
* A 学生管理模块
* A 教师管理模块
## v0.14.5
* A 接入内容安全接口
* A 添加EduCoder云网推荐链接

@ -1,7 +1,7 @@
<view class="container">
<form bindsubmit="changePassword" bindreset="onFormReset">
<view class="input-wrap">
<input password name="old_password" placeholder="原密码"/>
<input password auto-focus name="old_password" placeholder="原密码"/>
</view>
<view class="input-wrap">
<input password name="password" placeholder="新密码"/>

@ -30,5 +30,5 @@
height: 1px;
}
.school-wrap{
margin-bottom: 1.2px;
margin-bottom: 1px;
}

@ -11,7 +11,7 @@ Component({
success:res=>{
if(!res.data||res.data==this.clipboardData) return;
this.clipboardData = res.data;
var match = res.data.match(/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Z]{5,6}$/);
var match = res.data.match(/(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Z]{5,6}/);
if(match)
this.setData({invite_code: match[0]});
}
@ -93,7 +93,7 @@ Component({
})
},
cancel() {
this.setData({ hidden: true });
this.setData({ hidden: true,invite_code:'', assistant_professor:0, student:0, assistant_professor:0 });
},
onTapButton({detail:{index}}){
if(index==0)

@ -7,7 +7,7 @@ Component({
nodes:{
type:String,
observer:function(nodes){
this.process(nodes);
this.process();
}
},
datakey:{
@ -26,7 +26,12 @@ Component({
},
theme:{
type:String,
value:"light"
value:"light",
observer:function(theme,old){
let {type} = this.data;
if(this.ready&&theme!=old&&(type=='html'||type=='markdown'))
this.process();
}
},
base:{
type:String,
@ -51,7 +56,7 @@ Component({
if(data&&data._e.tag=="code")
data={attr:{class:"h2w__pre"},child:[data],tag:"view",type:"tag",_e:{type:"tag",attr:{},tag:"pre", child:[data]}}
if(data&&data._e.tag=='pre'){
data = {theme:"light",child:[data],_e:{child:[data]}}
data = {theme:this.data.theme,child:[data],_e:{child:[data]}}
wx.setStorage({
key,data,success:res=>{
wx.navigateTo({
@ -69,8 +74,8 @@ Component({
* 该程序接收用户的`4`个输入$$x_1$$$$y_1$$$$x_2$$$$y_2$$分别表示地球上两个点的维度和经度单位是度
* 计算公式为$$r^{3}=\\frac{dp}{\\pi S}$$其中
*/
process(nodes){
let {type} = this.data;
process(){
let {type, nodes} = this.data;
//console.log(type);
if(!type){
if (nodes.match(/<img .*src=.*>/))
@ -98,6 +103,7 @@ Component({
}else{
this.setData({nodes, type})
}
this.ready = true;
}
}
})

@ -5,7 +5,7 @@ const developUrl = "https://test-newweb.educoder.net";
const trialUrl = "https://pre-newweb.educoder.net";
const releaseUrl = "https://www.educoder.net";
let _version = "0.14.5";
let _version = "0.15.0";
var eduUrl = releaseUrl;
/**
*/

@ -0,0 +1,153 @@
var throttle = function throttle(func, wait, options) {
var context = void 0;
var args = void 0;
var result = void 0;
var timeout = null;
var previous = 0;
if (!options) options = {};
var later = function later() {
previous = options.leading === false ? 0 : Date.now();
timeout = null;
result = func.apply(context, args);
if (!timeout) context = args = null;
};
return function () {
var now = Date.now();
if (!previous && options.leading === false) previous = now;
var remaining = wait - (now - previous);
context = this;
args = arguments;
if (remaining <= 0 || remaining > wait) {
clearTimeout(timeout);
timeout = null;
previous = now;
result = func.apply(context, args);
if (!timeout) context = args = null;
} else if (!timeout && options.trailing !== false) {
timeout = setTimeout(later, remaining);
}
return result;
};
};
Component({
options: {
addGlobalClass: true,
pureDataPattern: /^_/
},
properties: {
list: {
type: Array,
value: [],
observer: function observer(newVal) {
var _this = this;
if (newVal.length === 0) return;
var data = this.data;
var alphabet = data.list.map(function (item) {
return item.letter;
});
alphabet.unshift("↑");
this.setData({
alphabet: alphabet,
current: alphabet[0]
}, function () {
_this.computedSize();
});
}
},
ext:{
type:Object
},
vibrated: {
type: Boolean,
value: true
}
},
data: {
current: 'A',
intoView: '',
touching: false,
alphabet: [],
_tops: [],
_anchorItemH: 0,
_anchorTop: 0
},
lifetimes: {
created: function created() {},
attached: function attached() {
this.__scrollTo = throttle(this._scrollTo, 100, {});
this.__onScroll = throttle(this._onScroll, 100, {});
}
},
methods: {
choose: function choose(e) {
console.log("choose",e);
var item = e.target.dataset.item;
this.triggerEvent('choose', { item: item });
},
scrollTo: function scrollTo(e) {
this.__scrollTo(e);
},
_scrollTo: function _scrollTo(e) {
var data = this.data;
var clientY = e.changedTouches[0].clientY;
console.log(clientY);
var index = Math.floor((clientY - data._anchorTop) / data._anchorItemH);
if(index<0||index>=data.alphabet.length)
return;
var current = data.alphabet[index];
if(current=='↑')
this.setData({current, scrollTop:0, touching:true});
else
this.setData({ current: current, intoView: current=='#'?'hash':current, touching: true });
if (data.vibrated) wx.vibrateShort();
},
computedSize: function computedSize() {
var data = this.data;
var query = this.createSelectorQuery();
query.selectAll('.index_list_item').boundingClientRect();
query.select(".top-view").boundingClientRect();
query.select('.anchor-list').boundingClientRect(function (rect) {
data._anchorItemH = rect.height / data.alphabet.length;
data._anchorTop = rect.top;
//console.log("select anchor list");
});
query.exec(res=>{
data._tops = res[0].map(function (item) {
return item.top-res[1].top;
});
//console.log(res);
});
},
removeTouching: function removeTouching() {
var _this2 = this;
setTimeout(function () {
_this2.setData({ touching: false });
}, 150);
},
onScroll: function onScroll(e) {
this.__onScroll(e);
},
_onScroll: function _onScroll(e) {
var data = this.data;
var _tops = data._tops,
alphabet = data.alphabet;
//console.log("scroll", e.detail, this.data);
var pageTop = e.detail.scrollTop;
var current = '';
if (pageTop < _tops[0]) {
current = alphabet[0];
} else {
for (var i = 0, len = _tops.length; i < len - 1; i++) {
if (pageTop >= _tops[i] && pageTop < _tops[i + 1]) {
current = alphabet[i+1];
}
}
}
if (!current) current = alphabet[alphabet.length - 1];
this.setData({ current: current });
}
}
});

@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {},
"componentGenerics": {
"item": true
}
}

@ -0,0 +1,40 @@
<scroll-view
class="page page-select-index"
enable-back-to-top
scroll-into-view="{{intoView}}"
scroll-top="{{scrollTop}}"
scroll-y
bindscroll="onScroll"
>
<view class="top-view">
<slot></slot>
</view>
<view class="index_list_item" wx:for="{{list}}" wx:key="alpha" id="{{item.letter=='#'?'hash':item.letter}}">
<view class="index-group__title">{{item.letter}}</view>
<view class="index-group__list">
<view wx:for="{{item.items}}" wx:key="name"
class="index-group__item"
data-item="{{item}}"
bindtap="choose">
<item data="{{item}}" ext="{{ext}}"/>
</view>
</view>
</view>
</scroll-view>
<view
class="anchor-bar__wrp wx-flex"
catchtouchstart='scrollTo'
catchtouchmove='scrollTo'
catchtouchend='removeTouching'
>
<view class="anchor-bar wx-flex__item">
<view class="anchor-list">
<block wx:for="{{alphabet}}" wx:key="*this" wx:for-item="alpha">
<view class="anchor-item {{current == alpha ? ( touching ? 'selected tapped' : 'selected' ): ''}}" data-alpha="{{alpha}}">
<view class="anchor-item__inner">{{alpha}}</view>
<view class="anchor-item__pop">{{alpha}}</view>
</view>
</block>
</view>
</view>
</view>

@ -0,0 +1,81 @@
.page-select-index{
height: 100%;
}
.wx-flex {
display: flex;
align-items: center
}
.wx-flex__item {
flex: 1
}
.index-group__title {
padding: 12rpx 24rpx;
background: #f0f0f0;
}
.anchor-bar__wrp {
position: fixed;
right: 0;
width: 60rpx;
z-index: 999;
top:50%;
transform: translateY(-50%);
}
.anchor-item {
font-size: 0;
text-align: center;
position: relative
}
.anchor-item__inner {
line-height: 28rpx;
height: 28rpx;
width: 28rpx;
border-radius: 50%;
display: inline-block;
font-size: 20rpx;
margin: 2rpx 0;
font-weight: 500
}
.tapped .anchor-item__pop {
display: block
}
.anchor-item__pop {
position: absolute;
font-size: 64rpx;
width: 100rpx;
height: 100rpx;
line-height: 100rpx;
color: #fff;
background-color: #C9C9C9;
border-radius: 50%;
right: 80rpx;
top: 50%;
transform: translateY(-50%);
display: none
}
.anchor-item__pop:after {
content: "";
display: block;
position: absolute;
width: 0;
height: 0;
left: 80rpx;
border: 40rpx solid;
border-color: transparent transparent transparent #C9C9C9;
top: 50%;
transform: translateY(-50%)
}
.anchor-item.selected .anchor-item__inner {
color: #fff;
background-color: #00b0f0
}

@ -26,7 +26,7 @@ Component({
},
attached(){
this.setData({data:JSON.stringify(this.data)});
console.log(this.data);
//console.log(this.data);
},
methods: {

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1587973284366" class="icon" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3306" xmlns:xlink="http://www.w3.org/1999/xlink" width="48.046875" height="48"><defs><style type="text/css"></style></defs><path d="M344.626 600.536c8.607-3.256 19.065-6.233 31.491-14.042 18.109-11.379 32.062-34.843-1.603-63.595-111.384-160.502-70.843-267.145-53.924-307.317-14.133-5.496-30.208-8.747-48.608-8.747h-5.787c-106.593 0-134.923 96.947-137.085 151.323-1.43 128.215 76.955 179.192 76.955 179.192s4.883 6.742 4.883 26.297c0 4.458-2.906 17.813-7.921 21.847-43.752 35.43-189.787 72.341-199.992 148.665-5.395 22.053-2.168 44.959-1.106 66.186 23.896 18.349 100.454 33.905 100.454 33.905s6.356-19.31 12.808-51.222c9.536-47.171 73.357-123.507 229.435-182.492z m676.565 132.952c-10.484-76.229-160.407-113.09-205.271-148.474-5.151-4.033-8.11-17.367-8.11-21.813 0-19.539 4.972-26.27 4.972-26.27s80.384-50.909 78.882-178.961c-2.191-54.311-36.079-151.135-140.477-151.135h-5.937c-22.504 0-41.425 4.278-57.578 11.272 22.338 74.782 49.177 212.002-63.755 303.96-44.306 66.052 103.281 104.794 80.341 94.485C837.807 676.57 873.75 722.614 883.537 770.22c8.172 39.733 12.808 64.031 12.808 64.031s100.058-15.272 125.936-34.66c1.116-21.204 4.422-44.078-1.09-66.103zM585.685 587.176c-6.312-5.016-9.943-21.612-9.943-27.136 0-24.28 6.077-32.626 6.077-32.626-0.111 0.072 98.734-53.379 96.79-222.424-2.692-67.509-44.256-187.833-172.348-187.833h-7.285c-134.018 0-169.661 120.323-172.366 187.833-1.809 159.138 96.768 222.424 96.768 222.424s11.954 13.634 11.954 37.916c0 5.53-9.485 16.824-15.787 21.847-55.013 43.982-253.102 88.31-265.943 183.044-9.943 40.19-68.755 103.929 126.791 129.589 53.869 7.067 127.043 11.245 225.859 11.245 453.509 0 359.745-87.859 346.999-139.37-12.849-94.73-212.535-140.529-267.566-184.509z" p-id="3307" fill="#8a8a8a"></path></svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1587973284366" class="icon" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3306" xmlns:xlink="http://www.w3.org/1999/xlink" width="48.046875" height="48"><defs><style type="text/css"></style></defs><path d="M344.626 600.536c8.607-3.256 19.065-6.233 31.491-14.042 18.109-11.379 32.062-34.843-1.603-63.595-111.384-160.502-70.843-267.145-53.924-307.317-14.133-5.496-30.208-8.747-48.608-8.747h-5.787c-106.593 0-134.923 96.947-137.085 151.323-1.43 128.215 76.955 179.192 76.955 179.192s4.883 6.742 4.883 26.297c0 4.458-2.906 17.813-7.921 21.847-43.752 35.43-189.787 72.341-199.992 148.665-5.395 22.053-2.168 44.959-1.106 66.186 23.896 18.349 100.454 33.905 100.454 33.905s6.356-19.31 12.808-51.222c9.536-47.171 73.357-123.507 229.435-182.492z m676.565 132.952c-10.484-76.229-160.407-113.09-205.271-148.474-5.151-4.033-8.11-17.367-8.11-21.813 0-19.539 4.972-26.27 4.972-26.27s80.384-50.909 78.882-178.961c-2.191-54.311-36.079-151.135-140.477-151.135h-5.937c-22.504 0-41.425 4.278-57.578 11.272 22.338 74.782 49.177 212.002-63.755 303.96-44.306 66.052 103.281 104.794 80.341 94.485C837.807 676.57 873.75 722.614 883.537 770.22c8.172 39.733 12.808 64.031 12.808 64.031s100.058-15.272 125.936-34.66c1.116-21.204 4.422-44.078-1.09-66.103zM585.685 587.176c-6.312-5.016-9.943-21.612-9.943-27.136 0-24.28 6.077-32.626 6.077-32.626-0.111 0.072 98.734-53.379 96.79-222.424-2.692-67.509-44.256-187.833-172.348-187.833h-7.285c-134.018 0-169.661 120.323-172.366 187.833-1.809 159.138 96.768 222.424 96.768 222.424s11.954 13.634 11.954 37.916c0 5.53-9.485 16.824-15.787 21.847-55.013 43.982-253.102 88.31-265.943 183.044-9.943 40.19-68.755 103.929 126.791 129.589 53.869 7.067 127.043 11.245 225.859 11.245 453.509 0 359.745-87.859 346.999-139.37-12.849-94.73-212.535-140.529-267.566-184.509z" p-id="3307" fill="#00b0f0"></path></svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1587996654635" class="icon" viewBox="0 0 1216 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10267" xmlns:xlink="http://www.w3.org/1999/xlink" width="57" height="48"><defs><style type="text/css"></style></defs><path d="M737.0614 619.305093L590.240511 886.553725l-21.777951-63.603155 40.238731-80.333237-80.477462-80.333237-80.477462 80.189012 40.238731 80.333237-25.960472 65.189629-142.782594-268.835106S15.07184 780.115792 15.07184 939.340018c0 43.988577 18.17233 84.659982 62.593581 84.659982h902.991738c44.132802 0 62.737806-40.238731 62.737806-84.083083 0-149.416937-306.333565-320.611824-306.333565-320.611824m210.424045 160.810699z" p-id="10268" fill="#8a8a8a"></path><path d="M792.876414 290.039778l-0.144225-12.547561-10.528413-7.067018c-1.298024-0.865349-2.596047-1.730698-3.749846-2.451822-21.633726-185.328922-20.191478-294.651353-236.528741-262.344988-75.862267 11.249538-158.791551-12.114887-205.953075 22.210626-59.27641 55.382339-63.458931 138.600073-47.449973 236.240291-3.605621 1.874923-7.211242 4.038296-10.672639 6.490118l-10.528413 7.067017-0.144225 12.547562c-0.576899 32.45059 3.605621 59.997534 12.403337 80.910136 8.076591 19.181904 19.903028 33.315939 35.76776 41.825204 18.893454 63.74738 46.007725 111.485803 79.900563 145.955541 36.92156 37.498459 81.342811 58.843736 131.677281 67.208776l4.47097 0.721124 4.47097-0.865349c55.670789-11.682212 100.092041-33.892838 135.571352-71.102847 32.883264-34.469737 57.401487-80.910137 75.429592-142.926818 15.287833-8.797715 26.681596-23.075975 34.325513-42.113654 8.220816-20.912602 12.114887-47.882648 11.682212-79.756338z m-57.401487 61.584007c-4.326745 10.528413-10.239964 17.451206-17.595431 20.047254l-12.259111 4.326745-3.317172 12.403336c-16.153182 59.56486-37.642684 102.688088-66.631877 132.975305-27.258495 28.556519-61.872457 46.15195-105.42836 55.959239-38.363808-7.211242-72.112421-23.797099-100.09204-52.353618-30.142992-30.575667-54.084316-74.996918-70.814398-136.004026l-3.605621-12.980236-12.980235-4.038296c-7.643917-2.307597-13.557135-9.086165-18.028106-19.614578-4.326745-10.384189-7.067017-23.652874-8.220816-39.373382 11.970662-1.730698 25.239347-5.192094 31.87369-0.865349 0.721124-2.163373 1.442248-4.75942 2.163373-7.643917h0.28845l1.009574-5.192094c3.605621-14.134035 7.643917-102.832313 11.249537-117.110572 1.442248-4.18252 1.874923-8.94194 4.615195-12.259112 17.451206 23.652874 149.416937 26.393146 225.856103-26.537371l-14.278259 38.652258 14.566709 2.884497 16.297407-25.960472-2.019148 18.17233 15.432058 2.019148 9.663065-29.854542c19.037679 10.816863 39.950281 25.239347 58.699511 17.451206 6.201668 13.98981 11.105313 99.515141 14.134034 115.956773l4.038296 21.201052 7.067017-0.432675 3.317171 10.961088c8.365041-1.009574 15.576283-1.153799 22.643301-1.298023-0.865349 15.287833-3.461396 28.268069-7.643917 38.508032z" p-id="10269" fill="#8a8a8a"></path></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1587996654635" class="icon" viewBox="0 0 1216 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10267" xmlns:xlink="http://www.w3.org/1999/xlink" width="57" height="48"><defs><style type="text/css"></style></defs><path d="M737.0614 619.305093L590.240511 886.553725l-21.777951-63.603155 40.238731-80.333237-80.477462-80.333237-80.477462 80.189012 40.238731 80.333237-25.960472 65.189629-142.782594-268.835106S15.07184 780.115792 15.07184 939.340018c0 43.988577 18.17233 84.659982 62.593581 84.659982h902.991738c44.132802 0 62.737806-40.238731 62.737806-84.083083 0-149.416937-306.333565-320.611824-306.333565-320.611824m210.424045 160.810699z" p-id="10268" fill="#00b0f0"></path><path d="M792.876414 290.039778l-0.144225-12.547561-10.528413-7.067018c-1.298024-0.865349-2.596047-1.730698-3.749846-2.451822-21.633726-185.328922-20.191478-294.651353-236.528741-262.344988-75.862267 11.249538-158.791551-12.114887-205.953075 22.210626-59.27641 55.382339-63.458931 138.600073-47.449973 236.240291-3.605621 1.874923-7.211242 4.038296-10.672639 6.490118l-10.528413 7.067017-0.144225 12.547562c-0.576899 32.45059 3.605621 59.997534 12.403337 80.910136 8.076591 19.181904 19.903028 33.315939 35.76776 41.825204 18.893454 63.74738 46.007725 111.485803 79.900563 145.955541 36.92156 37.498459 81.342811 58.843736 131.677281 67.208776l4.47097 0.721124 4.47097-0.865349c55.670789-11.682212 100.092041-33.892838 135.571352-71.102847 32.883264-34.469737 57.401487-80.910137 75.429592-142.926818 15.287833-8.797715 26.681596-23.075975 34.325513-42.113654 8.220816-20.912602 12.114887-47.882648 11.682212-79.756338z m-57.401487 61.584007c-4.326745 10.528413-10.239964 17.451206-17.595431 20.047254l-12.259111 4.326745-3.317172 12.403336c-16.153182 59.56486-37.642684 102.688088-66.631877 132.975305-27.258495 28.556519-61.872457 46.15195-105.42836 55.959239-38.363808-7.211242-72.112421-23.797099-100.09204-52.353618-30.142992-30.575667-54.084316-74.996918-70.814398-136.004026l-3.605621-12.980236-12.980235-4.038296c-7.643917-2.307597-13.557135-9.086165-18.028106-19.614578-4.326745-10.384189-7.067017-23.652874-8.220816-39.373382 11.970662-1.730698 25.239347-5.192094 31.87369-0.865349 0.721124-2.163373 1.442248-4.75942 2.163373-7.643917h0.28845l1.009574-5.192094c3.605621-14.134035 7.643917-102.832313 11.249537-117.110572 1.442248-4.18252 1.874923-8.94194 4.615195-12.259112 17.451206 23.652874 149.416937 26.393146 225.856103-26.537371l-14.278259 38.652258 14.566709 2.884497 16.297407-25.960472-2.019148 18.17233 15.432058 2.019148 9.663065-29.854542c19.037679 10.816863 39.950281 25.239347 58.699511 17.451206 6.201668 13.98981 11.105313 99.515141 14.134034 115.956773l4.038296 21.201052 7.067017-0.432675 3.317171 10.961088c8.365041-1.009574 15.576283-1.153799 22.643301-1.298023-0.865349 15.287833-3.461396 28.268069-7.643917 38.508032z" p-id="10269" fill="#00b0f0"></path></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

@ -4,7 +4,7 @@
<button wx:if="{{course_identity==5}}" type="main" size="mini" plain="{{data.attendance_status=='NORMAL'}}" class="attendance-button" disabled="{{data.attendance_status=='NORMAL'}}" catchtap="onButtonTap">{{data.attendance_status=='NORMAL'?'已签到':'签到'}}</button>
</view>
<view wx:if="{{course_identity<5}}">
<progress percent="{{data.normal_count/data.all_count*100}}" activeColor="#00b0f0" border-radius="6" backgroundColor="lightgrey"><text class="percent-text">已签到:{{data.normal_count}}/{{data.all_count}}</text></progress>
<progress class="progress" percent="{{data.normal_count/data.all_count*100}}" activeColor="#00b0f0" border-radius="6" backgroundColor="lightgrey"><text class="percent-text">已签到:{{data.normal_count}}/{{data.all_count}}</text></progress>
</view>
<view class="footer">
<text>签到时间:{{data.start_time}}-{{data.end_time}}</text>

@ -14,7 +14,7 @@
.attendance-button{
margin: 0;
}
progress{
.progress{
margin: 4px 0;
}
.percent-text{

@ -3,9 +3,13 @@
<text class="title">{{data.exercise_name}}</text><text class="tip" style="{{item=='已截止'||item=='已结束'?'background:#FC2B6A':''}}" wx:for="{{data.exercise_tips}}">{{item}}</text>
</view>
<view class="status">
<text wx:if="{{data.exercise_left_time}}" class="left-time">还剩{{data.exercise_left_time}}截止</text>
<text class="author">发布人:{{data.author}}</text>
<text wx:if="{{data.exercise_left_time}}">剩余时间:{{data.exercise_left_time}}</text>
</view>
<view wx:if="{{data.exercise_status>1}}">
<progress border-radius="8" percent="{{data.exercise_answer/(data.exercise_answer+data.exercise_unanswer)*100}}" activeColor="#00b0f0" backgroundColor="lightgrey"><text class="commit-text">完成:{{data.exercise_answer}}/{{data.exercise_answer+data.exercise_unanswer}}</text></progress>
<progress border-radius="8" percent="{{data.exercise_answer/(data.exercise_answer+data.exercise_unanswer)*100}}" activeColor="#00b0f0" backgroundColor="lightgrey">
<text class="commit-text">提交:{{data.exercise_answer}}/{{data.exercise_answer+data.exercise_unanswer+data.exercise_answerings}}</text>
<text wx:if="{{data.exercise_status==2}}" class="commit-text"> 考试中:{{data.exercise_answerings}}</text>
</progress>
</view>
</view>

@ -7,10 +7,13 @@
.title{
font-weight: bold;
}
.left-time{
.status{
font-size: 12px;
color: gray;
}
.author{
margin-right: 12px;
}
.tip{
font-size: 12px;
border-radius: 36px;

@ -0,0 +1,43 @@
const app = getApp();
Component({
properties: {
data:Object,
ext:Object
},
data: {
eduImgDir: global.config.eduImgDir,
buttons:[{text:"删除", type:"warn"}]
},
methods: {
delete(){
let {course_id} = this.data.ext;
let {course_member_id} = this.data.data;
//console.log(course_id, course_member_id);
let students = [{course_member_id}];
app.api("courses.delete_from_course")({course_id,students})
.then(res=>{
this.triggerEvent("delete",{},{bubbles:true,composed:true});
//console.log(res);
//res.message='删除成功';
app.showMsg(res);
}).catch(e=>{
app.showError(e);
})
},
onButtonTap(e){
//console.log(e,this.data);
wx.showModal({
title:"提示",
content:"确认删除所选学生吗?",
success:res=>{
if(res.confirm){
this.delete();
}
}
})
}
}
})

@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"mp-slideview": "/weui-miniprogram/slideview/slideview"
}
}

@ -0,0 +1,9 @@
<mp-slideview disable="{{!ext.course_identity||ext.course_identity==5}}" buttons="{{buttons}}" bindbuttontap="onButtonTap">
<view class="student thin-border-bottom">
<image class="avatar" src="{{eduImgDir}}{{data.image_url}}"></image>
<view class="detail">
<view class="name">{{data.name}}</view>
<view class="student-id" wx:if="{{data.student_id}}">学号:{{data.student_id}}</view>
</view>
</view>
</mp-slideview>

@ -0,0 +1,40 @@
.student{
padding: 12px;
display: flex;
background: white;
}
.thin-border-bottom {
position: relative
}
.thin-border-bottom::after {
content: "";
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 1px;
border-bottom: 1px solid #EAEAEA;
color: #e5e5e5;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: scaleY(.5);
transform: scaleY(.5);
z-index: 2
}
.student.thin-border-bottom::after{
left: 60px;
}
.detail{
margin-left: 12px;
}
.avatar{
border-radius: 50%;
width: 45px;
height: 45px;
}
.student-id{
color: dimgray;
font-size: 14px;
}

@ -0,0 +1,42 @@
const app = getApp();
Component({
properties: {
course_id: Number,
id_: Number,
course_identity:Number,
refresh: {
type: Number,
observer: function (r) {
if (r) {
console.log("observer refresh")
this.refresh();
this.setData({ refresh: false });
}
}
}
},
data: {
},
attached(){
let {course_id, course_identity} = this.data;
let ext = {course_id, course_identity};
this.setData({ext});
this.refresh();
},
methods: {
onChoose(e){
console.log(e);
},
refresh(){
let {course_id} = this.data;
app.api("weapps.courses.students")({course_id,limit:1000}).then(res=>{
console.log(res);
let {students,students_count} = res;
this.setData({students,students_count});
})
}
}
})

@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"mp-index-list":"../../components/index-list/index-list",
"student-item":"./student-item/student-item"
}
}

@ -0,0 +1,12 @@
<mp-index-list binddelete="refresh" list="{{students}}" ext="{{ext}}" vibrated="{{false}}" generic:item="student-item" bindchoose="onChoose">
<view class="header">
<view class="student-count">
<text>学生人数:</text>
<text class="count">{{students_count}}</text>
</view>
<navigator wx:if="{{course_identity<5}}" class='invite' hover-class="none" url="/course/pages/course_invite/course_invite?course_id={{course_id}}"><button class="invite-button" size="mini" type="main">邀请学生</button></navigator>
</view>
</mp-index-list>

@ -0,0 +1,14 @@
.student-list-wrap{
flex:auto;
}
.header{
background: white;
padding: 12px;
display: flex;
justify-content: space-between;
align-items: center;
}
.invite-button{
margin: 0;
}

@ -0,0 +1,31 @@
const app = getApp();
Component({
properties: {
data:Object,
ext:Object
},
data: {
eduImgDir: global.config.eduImgDir,
buttons:[{text:"删除", type:"warn"}]
},
methods: {
delete(e){
console.log(e,this.data);
let {course_id} = this.data.ext;
let {course_member_id} = this.data.data;
console.log(course_id, course_member_id);
let students = [{course_member_id}];
app.api("courses.delete_from_course")({course_id,students})
.then(res=>{
this.triggerEvent("delete",{},{bubbles:true,composed:true});
//console.log(res);
//res.message='删除成功';
app.showMsg(res);
}).catch(e=>{
app.showError(e);
})
}
}
})

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

@ -0,0 +1,7 @@
<view class="teacher thin-border-bottom">
<image class="avatar" src="{{eduImgDir}}{{data.image_url}}"></image>
<view class="detail">
<view class="name">{{data.name}}</view>
<view class="school">{{data.school}}</view>
</view>
</view>

@ -0,0 +1,40 @@
.teacher{
padding: 12px;
display: flex;
background: white;
}
.thin-border-bottom {
position: relative
}
.thin-border-bottom::after {
content: "";
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 1px;
border-bottom: 1px solid #EAEAEA;
color: #e5e5e5;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: scaleY(.5);
transform: scaleY(.5);
z-index: 2
}
.teacher.thin-border-bottom::after{
left: 60px;
}
.detail{
margin-left: 12px;
}
.avatar{
border-radius: 50%;
width: 45px;
height: 45px;
}
.school{
color: dimgray;
font-size: 14px;
}

@ -0,0 +1,42 @@
const app = getApp();
Component({
properties: {
course_id: Number,
id_: Number,
course_identity:Number,
refresh: {
type: Number,
observer: function (r) {
if (r) {
console.log("observer refresh")
this.refresh();
this.setData({ refresh: false });
}
}
}
},
data: {
},
attached(){
let {course_id, course_identity} = this.data;
let ext = {course_id, course_identity};
this.setData({ext});
this.refresh();
},
methods: {
onChoose(e){
console.log(e);
},
refresh(){
let {course_id} = this.data;
app.api("weapps.courses.teachers")({course_id,limit:1000}).then(res=>{
console.log(res);
let {teacher_list:teachers,teacher_list_size:teachers_count} = res;
this.setData({teachers,teachers_count});
})
}
}
})

@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"mp-index-list":"../../components/index-list/index-list",
"teacher-item":"./teacher-item/teacher-item"
}
}

@ -0,0 +1,11 @@
<mp-index-list binddelete="refresh" list="{{teachers}}" ext="{{ext}}" vibrated="{{false}}" generic:item="teacher-item" bindchoose="onChoose">
<view class="header">
<view class="student-count">
<text>教师人数:</text>
<text class="count">{{teachers_count}}</text>
</view>
</view>
</mp-index-list>

@ -0,0 +1,11 @@
.teacher-list-wrap{
flex:auto;
}
.header{
background: white;
padding: 12px;
display: flex;
justify-content: space-between;
align-items: center;
}

@ -4,7 +4,11 @@ const defaultModules = [{
type: "activity",
name: "课堂动态"
}];
const supportModules = ["activity", "attachment", "exercise", "shixun_homework", "attendance"];
const defaultModulesEnd = [
{type:"students",name:"学生管理"},
{type:"teachers",name:"教师管理"}
]
const supportModules = ["activity", "attachment", "exercise", "shixun_homework", "attendance","students","teachers"];
const nosupportMsgs = {
video:"请使用网页版EduCoder"
};
@ -14,6 +18,7 @@ Component({
course_id: Number,
module_type: {
type: String,
value:'activity',
observer: function (module) {
//this.setModule(module,0);
}
@ -25,8 +30,6 @@ Component({
nav_type: "back",
current:0,
module: {
type: "activity",
name: "课堂动态"
},
tabbar_show:1,
course: {},
@ -78,6 +81,9 @@ Component({
});
},
setModule({type,showToast = 1}) {
if(type==this.data.module.type)
return false;
var flag = false;
for (var module of this.data.course_modules) {
if (module.type == type) {
if (supportModules.indexOf(type) == -1) {
@ -92,8 +98,11 @@ Component({
this.setData({
module
});
flag = true;
}
}
if(!flag)
return flag;
for (var i = 0; i < this.data.list.length; i++) {
if (this.data.list[i].type == type) {
this.setData({
@ -158,15 +167,9 @@ Component({
let {
course_id
} = this.data;
let course = await app.api("courses.top_banner")({
course_id
});
this.setData({
course
});
return {
course
};
let course = await app.api("courses.top_banner")({ course_id });
this.setData({ course });
return { course };
},
async pullModules() {
let {
@ -175,7 +178,7 @@ Component({
let data = await app.api("courses.left_banner")({
course_id
});
let course_modules = defaultModules.concat(data.course_modules);
let course_modules = defaultModules.concat(data.course_modules).concat(defaultModulesEnd);
course_modules = course_modules.filter(i=>supportModules.indexOf(i.type)>-1);
this.setData({
course_modules
@ -183,6 +186,11 @@ Component({
this.setTabbar({
course_modules
});
if(this.data.module_type){
if(!this.setModule({type:this.data.module_type,showModal:0}))
this.setModule({type:course_modules[0].type,showModal:0})
this.setData({module_type: ""});
}
return course_modules;
},
setTabbar({course_modules}) {
@ -198,7 +206,7 @@ Component({
})
} else {
var list = [];
for (var i = 0; i < 5; i++) {
for (var i = 0; i < 4; i++) {
if (i == 2)
list.push({
type: "more",
@ -206,15 +214,14 @@ Component({
selectedIconPath: base + "module_select.svg",
iconPath: base + "module.svg"
});
else {
var m = course_modules[i];
list.push({
type: m.type,
text: m.name,
selectedIconPath: base + m.type + "_select.svg",
iconPath: base + m.type + ".svg"
});
}
var m = course_modules[i];
list.push({
type: m.type,
text: m.name,
selectedIconPath: base + m.type + "_select.svg",
iconPath: base + m.type + ".svg"
});
}
}
this.setData({
@ -311,7 +318,10 @@ Component({
this.refresh();
},
onShareAppMessage: function () {
return app.shareApp({
title: this.data.name,
path: "/"+this.route+`?course_id=${this.data.course_id}&module_type=${this.data.module.type}`
})
}
}
})

@ -7,6 +7,8 @@
"shixun-homework": "/course/modules/shixun_homework/shixun_homework",
"activity":"/course/modules/activity/activity",
"attendance":"/course/modules/attendance/attendance",
"students":"/course/modules/students/students",
"teachers":"/course/modules/teachers/teachers",
"join-course":"/components/modal/join-course/join-course",
"error-page":"/components/error-page/error-page",
"mp-tabbar": "weui-miniprogram/tabbar/tabbar",

@ -55,6 +55,8 @@
<shixun-homework wx:elif="{{module.type=='shixun_homework'}}" id_="{{module.id}}" course_id="{{module.main_id}}" refresh="{{refresh}}" />
<activity wx:elif="{{module.type=='activity'}}" course_id="{{course_id}}" refresh="{{refresh}}" course_identity="{{course.course_identity}}" />
<attendance wx:elif="{{module.type=='attendance'}}" course_id="{{course_id}}" refresh="{{refresh}}" course_identity="{{course.course_identity}}" />
<students wx:elif="{{module.type=='students'}}" course_id="{{course_id}}" refresh="{{refresh}}" course_identity="{{course.course_identity}}" />
<teachers wx:elif="{{module.type=='teachers'}}" course_id="{{course_id}}" refresh="{{refresh}}" course_identity="{{course.course_identity}}"/>
</view>
<mp-tabbar ext-class="tabbar" bindchange="onModuleChange" current="{{current}}" list="{{list}}" />

@ -14,16 +14,19 @@ accounts:{
valid_email_and_phone: { query,form: {login: null, type: 1 } },
},
add_department_applies:{config, query, form:{school_id:null, name:null, remarks:void 0}},
add_department_applies:{config, query, form:{school_id:null, name:null, remarks:void 0},disp:"新增子单位"},
attachments:{url:{_:1,DELETE:'*/{attachment_id}',uploadFile:"*"},query,form:{_:1,uploadFile:{file:null},DELETE:{}},config:{method:"uploadFile", name:"file"}},
courses:{ url:{_:"*", DELETE:"*/{course_id}",PUT:"*/{course_id}"},query, form:{_:1,GET:{search:"",limit:20, page:1, order:"all"}, POST:{course_list_name:null,name:null,school: null,end_date: null,class_period:null,credit:null,course_module_types:["shixun_homework","common_homework","group_homework","exercise","attachment","course_group"],authentication:null,professional_certification:null},PUT:{course_list_name:null,name:null,school: null,end_date: null,class_period:null,credit:null,course_module_types:["shixun_homework","common_homework","group_homework","exercise","attachment","course_group"],authentication:null,professional_certification:null}},
act_score:{url:"{course_id}/*", query},
all_course_groups:{url:"{course_id}/*", query},
apply_teachers:{url:"{course_id}/*",query,disp:"获取正在申请教师的列表"},
apply_to_join_course:{query,form:{invite_code:null, professor:void 0,assistant_professor:void 0,student:void 0}, config},
attendances:{url:"{course_id}/*",query, form:{page:1, limit:10, history:void 0}},
calculate_all_shixun_scores:{url:"{course_id}/*", query},
delete_course_teacher:{url:"{course_id}/*",query,config,form:{course_member_id:null}},
delete_from_course:{url:"{course_id}/*", query, config, form:{students:null},data:{students:{course_member_id:121}}, disp:"删除学生"},
exercises:{url:"{course_id}/*", query, form:{_:1, GET:{page:1,limit:15},POST:{exercise_name:null, exercise_description:""}},
publish:{url:"../{course_id}/exercises/*",query,form:{check_ids: null, end_time:null},config},
},
@ -38,6 +41,7 @@ courses:{ url:{_:"*", DELETE:"*/{course_id}",PUT:"*/{course_id}"},query, form:{_
switch_to_assistant: { url: "{course_id}/*", query ,config},
switch_to_student:{url:"{course_id}/*",query, config},
switch_to_teacher:{url:"{course_id}/*",query, config},
teacher_application_review:{url:"{course_id}/*",config, query, form:{application_id:null, approval:null,user_id:null},data:{approval:{2:"拒绝",1:"同意"}},disp:"审批教师申请"},
work_score:{url:"{course_id}/*",query, form:{limit:20, page:1, sort:"desc"}},
},
@ -146,7 +150,7 @@ users:{
shixuns: { url: "{login}/*", query, form: {sort_by:"updated_at" ,page:1, sort_direction:"desc",per_page:16}},
system_update:{query:query},
/*{"system_update":true,"system_score":"为了给大家提供更优质的体验平台将于2020年3月24日13:20开始对系统进行升级。升级期间系统响应会有一定的延迟。系统拟于2020年3月24日13:30恢复正常。\r\n请大家知悉并提前做好教学安排。带来不便敬请谅解。","subject":" educoder升级服务通知","start_time":"2020-03-24T13:20:00.000+08:00","end_time":"2020-03-24T13:30:00.000+08:00"}*/
tidings: {query, form:{type:"",page:1,per_page:10}, data:"type:course,project,interaction,apply,notice"},
tidings: {query, form:{type:void 0,page:1,per_page:10}, data:"type:course,project,interaction,apply,notice"},
unread_message_info:{url:"{login}/*", query},
watch:{url:"{user_id}/*",query,config,disp:"关注用户,delete取消关注"}
},
@ -160,6 +164,9 @@ weapps:{
},
basic_info:{url:"{course_id}/*",query,disp:"课堂基本信息"},
course_activities:{url:"{course_id}/*",query,form:{page:1, limit:20}},
delete_course_teachers:{url:"{course_id}/*",query, form:{course_member_id:null},config:{method:"DELETE"}},
students: {url:"{course_id}/*", query, form:{page:1, limit: void 0}},
teachers: {url:"{course_id}/*", query, form:{page:1, limit: void 0}},
},
course_member_attendances:{query, form:{_:1, GET:{page:1, limit: 10},POST:{attendance_id:null, attendance_mode:null, code:void 0}}, config, disp:"课堂成员签到",
update_status:{query, config, form:{attendance_id:null, attendance_status:null, course_id:null, user_id:null}}

@ -1,11 +1,28 @@
const app = getApp();
Page({
data: {
theme: 'light',
current: 0,
content:"加载中...",
titles: ["任务描述", "代码文件", "测评结果"],
can_use_editor:wx.canIUse("editor")
},
initTheme(){
let {theme} = this.data;
if(theme=='dark'){
wx.setNavigationBarColor({backgroundColor:"#333333",frontColor:"#ffffff",animation:'linear'});
}else{
wx.setNavigationBarColor({backgroundColor:"#fbfbfb",frontColor:"#000000",animation:"linear"});
}
},
switchTheme({detail}){
console.log(detail);
let {value} = detail;
let theme = value?'dark':'light';
this.setData({theme});
this.initTheme();
wx.setStorageSync('config-task-theme', theme);
},
enterTask(e){
var {target:{dataset:{identifier}}} = e;
console.log(e);
@ -185,6 +202,9 @@ Page({
},
onLoad: function (options) {
//console.log("onload")
let theme = wx.getStorageSync('config-task-theme');
this.setData({theme});
this.initTheme();
let {identifier} = options;
this.setData({identifier});
this.pullTask();

@ -3,9 +3,12 @@
</page-meta>
<swiper class="body" circular="1" current="{{current}}" bindchange="onSwiperChange">
<swiper-item>
<scroll-view class="challenge-body" scroll-y="1">
<view wx:if="{{challenge}}" class="subject">第{{challenge.position}}关:{{challenge.subject}}</view>
<rich-md nodes="{{challenge.task_pass}}" type="markdown"/>
<scroll-view class="challenge-body {{theme}}" scroll-y="1">
<block wx:if="{{challenge}}">
<view class="subject {{theme}}">第{{challenge.position}}关:{{challenge.subject}}</view>
<view class="switch-wrap {{theme}}">黑暗模式(测试功能)<switch class="theme-switch" bindchange="switchTheme" color="dimgrey" checked="{{theme=='dark'}}"></switch></view>
</block>
<rich-md nodes="{{challenge.task_pass}}" type="markdown" theme="{{theme}}"/>
</scroll-view>
</swiper-item>
<swiper-item>

@ -1,6 +1,18 @@
.body{
height: 100vh;
}
.dark{
background: black!important;
color: white;
opacity: 0.8;
}
.switch-wrap{
text-align: right;
font-size: 12px;
}
.theme-switch{
transform: scale(0.6);
}
.challenge-body{
height: 100%;
background: white;

@ -109,7 +109,7 @@
"id": 6,
"name": "course/pages/course/course",
"pathName": "course/pages/course/course",
"query": "course_id=5876",
"query": "course_id=5141&module_type=teachers",
"scene": null
},
{

Loading…
Cancel
Save