* A 菜单的删除课堂 * A 课堂动态模块 * A 实训作业模块 * A 试卷封面,通知栏进入试卷 * A 体验版开发版可以切换切换开发环境与发布环境 * F 课堂邀请界面登录按钮bug * F 微信灰度API promise化产生的bug * F 使用style:v2后样式问题 * F 登录界面bugmaster
parent
5119e4f865
commit
da974380fb
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
<page-meta>
|
||||
<navigation-bar title="{{action_text[action]}}" />
|
||||
</page-meta>
|
||||
|
||||
<view class="container" wx:if="{{!signUp && logIn}}">
|
||||
<view class="block_blueBig">
|
||||
<view class="white_big" bindtap="log_In">注册</view>
|
||||
<form class="account-form" bindsubmit="onSubmit">
|
||||
<view class="inputs">
|
||||
<view class="input-wrap">
|
||||
<image src="../../../images/denglu.png" class="mini_button"></image>
|
||||
<input class="input" name="login" value="{{login}}" placeholder="邮箱或手机号"></input>
|
||||
</view>
|
||||
<view class="input-wrap">
|
||||
<image src="../../../images/yanzhengma.png" class="mini_button"></image>
|
||||
<input class="input" name="code" placeholder="验证码"></input>
|
||||
<button plain id="code" form-type="submit" loading="{{code_status==2}}" disabled="{{code_status}}" style="width: 100rpx;">
|
||||
{{code_button_text}}
|
||||
</button>
|
||||
</view>
|
||||
<view class="input-wrap">
|
||||
<image src="../../../images/suo.png" class="mini_button"></image>
|
||||
<input password name="password" value="{{password}}" placeholder="请输入密码"></input>
|
||||
</view>
|
||||
<view class="input-wrap {{action=='reset'?'':'hidden'}}">
|
||||
<image src="../../../images/suo.png" class="mini_button"></image>
|
||||
<input password name="password_confirmation" placeholder="请再次输入密码"></input>
|
||||
</view>
|
||||
<view class="checkbox-wrap">
|
||||
<switch type="checkbox" name="save_password" color="#00b0f0" checked="{{save_password}}">保存密码</switch>
|
||||
</view>
|
||||
</view>
|
||||
<button class="register" id="register" form-type="submit" style="width:100%">注 册</button>
|
||||
</form>
|
||||
</view>
|
||||
<view class="white_little block_red" bindtap="change" bindtap="sign_Up">登录</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="container" wx:else>
|
||||
<view class="block_blue">
|
||||
<view class="white_little" bindtap="log_In">注册</view>
|
||||
</view>
|
||||
<view class="white_big">登录</view>
|
||||
<form class="account-form" bindsubmit="onSubmit">
|
||||
<view class="inputs">
|
||||
<view class="input-wrap">
|
||||
<image src="../../../images/denglu.png" class="mini_button"></image>
|
||||
<input class="input" name="login" value="{{login}}" placeholder="邮箱或手机号"></input>
|
||||
</view>
|
||||
<view class="input-wrap">
|
||||
<image src="../../../images/suo.png" class="mini_button"></image>
|
||||
<input class="input" password name="password" value="{{password}}" placeholder="请输入密码"></input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="check_row">
|
||||
<view class="save_password">
|
||||
<switch type="checkbox" name="save_password" color="#00b0f0" checked="{{save_password}}">保存密码</switch>
|
||||
</view>
|
||||
<navigator class="reset" >忘记密码</navigator>
|
||||
</view>
|
||||
<button id="login" form-type="submit" class="login" style="width:100%">登 录</button>
|
||||
</form>
|
||||
</view>
|
||||
|
||||
<view class="foot">
|
||||
<navigator class="agreement" hover-class="none" url="/account/pages/agreement/agreement">
|
||||
登录即代表您同意 <text class="color-main agreement">用户协议</text>
|
||||
</navigator>
|
||||
</view>
|
@ -0,0 +1,141 @@
|
||||
page{
|
||||
height: 100%;
|
||||
background-image: linear-gradient(to bottom left,#7BCBFA, #EF7FAE);
|
||||
color: white;
|
||||
}
|
||||
.container{
|
||||
transition: 1s all ease;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.block_blueBig{
|
||||
transition: 1s all ease;
|
||||
width: 100%;
|
||||
background: #67AFF3;
|
||||
border-radius: 0px 0px 70rpx 70rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.white_big{
|
||||
transition: 1s all ease;
|
||||
font-size: 80rpx;
|
||||
font-weight: bold;
|
||||
padding: 40rpx 0rpx;
|
||||
}
|
||||
.block_blue{
|
||||
transition: 1s all ease;
|
||||
width: 100%;
|
||||
height: 250rpx;
|
||||
background: #67AFF3;
|
||||
border-radius: 0px 0px 100% 100%;
|
||||
font-size: 50rpx;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.account-form{
|
||||
transition: 1s all ease;
|
||||
width: 85%;
|
||||
}
|
||||
.inputs{
|
||||
transition: 1s all ease;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
.input-wrap{
|
||||
transition: 1s all ease;
|
||||
padding: 10px;
|
||||
margin-bottom: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border: 1px white solid;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.input{
|
||||
transition: 1s all ease;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
.mini_button{
|
||||
transition: 1s all ease;
|
||||
width: 48rpx;
|
||||
height: 45rpx;
|
||||
padding-right: 20rpx;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
button[plain] {
|
||||
transition: 1s all ease;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
color: white;
|
||||
}
|
||||
.white_little{
|
||||
transition: 1s all ease;
|
||||
font-size: 50rpx;
|
||||
font-weight: bold;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
|
||||
.check_row{
|
||||
transition: 1s all ease;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 60rpx;
|
||||
}
|
||||
|
||||
.login{
|
||||
transition: 1s all ease;
|
||||
width: 100%;
|
||||
padding: 8px;
|
||||
color: #F54171;
|
||||
font-weight: 400;
|
||||
border-radius: 20px;
|
||||
box-shadow: #F54171 -1px 1px 1rpx;
|
||||
}
|
||||
.register{
|
||||
transition: 1s all ease;
|
||||
width: 100%;
|
||||
padding: 8px;
|
||||
font-weight: 400;
|
||||
border-radius: 20px;
|
||||
box-shadow: #2190F3 -1px 1px 1rpx;
|
||||
color: #2190F3;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
.foot{
|
||||
transition: 1s all ease;
|
||||
position: fixed;
|
||||
bottom:0px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
}
|
||||
navigator.agreement{
|
||||
transition: 1s all ease;
|
||||
margin: 10px auto;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
}
|
||||
text.agreement{
|
||||
transition: 1s all ease;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.block_red{
|
||||
transition: 1s all ease;
|
||||
width: 100%;
|
||||
height: 220rpx;
|
||||
}
|
@ -1,4 +1,6 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"usingComponents": {
|
||||
"error-page":"/components/error-page/error-page"
|
||||
},
|
||||
"navigationBarTitleText": "普通作业"
|
||||
}
|
@ -1,17 +1,46 @@
|
||||
const cloudDir = "cloud://educoder.6564-educoder-1300855313/";
|
||||
const eduUrl = "https://www.educoder.net";
|
||||
|
||||
let { miniProgram:{ envVersion, version}} = wx.getAccountInfoSync();
|
||||
const developUrl = "https://test-newweb.educoder.net";
|
||||
const trialUrl = "https://pre-newweb.educoder.net";
|
||||
const releaseUrl = "https://www.educoder.net";
|
||||
|
||||
let _version = "0.13.0";
|
||||
var eduUrl = releaseUrl;
|
||||
/**
|
||||
* A 剪切板邀请码自动读取
|
||||
* A 首页点击搜索自动进入所在模块相应类目
|
||||
* F 进入搜索页面nav标题错误
|
||||
* F 登录后我的实训不自动刷新
|
||||
*
|
||||
*/
|
||||
module.exports = global.config = {
|
||||
version:"0.12.2",
|
||||
apiRoot:eduUrl+"/api/",
|
||||
cloudDir,
|
||||
eduUrl,
|
||||
imgDir:cloudDir+"images/",
|
||||
eduImgDir:eduUrl+"/images/",
|
||||
|
||||
export function switchEnv(env) {
|
||||
config.env = env;
|
||||
if (env == "develop") {
|
||||
eduUrl = developUrl;
|
||||
config.version = "开发环境 " + _version +"(点击切换)";
|
||||
}
|
||||
else if (env == "trial") {
|
||||
eduUrl = trialUrl;
|
||||
config.version = "体验版 " + _version;
|
||||
}
|
||||
else {
|
||||
eduUrl = releaseUrl;
|
||||
config.version = version||_version;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
const config = global.config = {
|
||||
version:version||_version,
|
||||
envVersion,
|
||||
env:envVersion,
|
||||
get apiRoot(){return eduUrl + "/api/"},
|
||||
cloudDir,
|
||||
get eduUrl(){return eduUrl},
|
||||
imgDir: cloudDir + "images/",
|
||||
get eduImgDir(){return eduUrl + "/images/"},
|
||||
switchEnv
|
||||
};
|
||||
|
||||
switchEnv(envVersion=="develop"?"trial":"release");
|
||||
|
||||
module.exports = config;
|
Before Width: | Height: | Size: 1.7 KiB |
@ -0,0 +1,60 @@
|
||||
const app = getApp();
|
||||
Component({
|
||||
properties: {
|
||||
course_id:Number,
|
||||
refresh: {
|
||||
type: Boolean,
|
||||
observer: function (v) {
|
||||
if (v) {
|
||||
this.refresh({refresh:1});
|
||||
this.setData({ refresh: false });
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
data: {
|
||||
|
||||
},
|
||||
attached(){
|
||||
this.options = {page:1, limit:20};
|
||||
this.refresh({refresh:1});
|
||||
},
|
||||
methods: {
|
||||
async refresh({refresh=0}={}){
|
||||
if (refresh) {
|
||||
if (refresh == 1) {
|
||||
this.options.page = 1;
|
||||
var { options } = this;
|
||||
} else if (refresh == 2) {
|
||||
var { page, limit } = this.options;
|
||||
var options = { page: 1, per_page: page * limit };
|
||||
}
|
||||
} else {
|
||||
this.options.page++;
|
||||
var { options } = this;
|
||||
}
|
||||
let {course_id} = this.data;
|
||||
let { activities } = await app.api("weapps.courses.course_activities")({ course_id, ...this.options});
|
||||
if (!refresh)
|
||||
var activityGroups = this.getActivityGroups(activities, this.data.activityGroups);
|
||||
else
|
||||
var activityGroups = this.getActivityGroups(activities);
|
||||
this.setData({ activityGroups });
|
||||
return activityGroups;
|
||||
},
|
||||
getActivityGroups(activities, groups={}){
|
||||
for(var item of activities){
|
||||
var date = item.created_at.split(" ")[0];
|
||||
if(date in groups)
|
||||
groups[date].push(item);
|
||||
else
|
||||
groups[date] = [item];
|
||||
}
|
||||
console.log(groups);
|
||||
return groups;
|
||||
},
|
||||
onReachBottom(){
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
})
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"activity-group":"./activity_group/activity_group"
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<scroll-view class="activities" scroll-y="1" lower-threshold="120" bindscrolltolower="onReachBottom">
|
||||
<view wx:for="{{activityGroups}}">
|
||||
<activity-group date="{{index}}" activities="{{item}}"/>
|
||||
</view>
|
||||
</scroll-view>
|
@ -0,0 +1,4 @@
|
||||
.activities{
|
||||
background: white;
|
||||
height: 100%;
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
|
||||
Component({
|
||||
properties: {
|
||||
date:{
|
||||
type:String,
|
||||
observer:function(date){
|
||||
var _date = date.replace(/0?(.+)-0?(.+)/,"$1月$2日");
|
||||
this.setData({_date});
|
||||
}
|
||||
},
|
||||
activities:Array
|
||||
},
|
||||
attached:function(){
|
||||
console.log(this.data);
|
||||
},
|
||||
data: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"activity-item":"../activity_item/activity_item"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
<view class="activity-group">
|
||||
<view class="date">{{_date}}</view>
|
||||
<view class="activity-wrap" wx:for="{{activities}}" wx:key="">
|
||||
<activity-item data="{{item}}"/>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,6 @@
|
||||
.activity-group{
|
||||
padding: 6px 12px;
|
||||
}
|
||||
.date{
|
||||
font-weight: bold;
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
function processObj(obj) {
|
||||
for (var key in obj) {
|
||||
if (!obj.hasOwnProperty(key) || typeof obj[key] != "object")
|
||||
continue
|
||||
processObj(obj[key]);
|
||||
obj[key].__proto__ = obj;
|
||||
}
|
||||
}
|
||||
const app = getApp();
|
||||
const configMap={
|
||||
text: "${course_act_type}",
|
||||
type: "${course_act_type}",
|
||||
color: "black",
|
||||
CourseAttendance:{
|
||||
text:"课堂签到开始了",
|
||||
type:"签到",
|
||||
color:"#09ad42"
|
||||
},
|
||||
HomeworkCommon:{
|
||||
practice:{
|
||||
type: "实训作业",
|
||||
color: "#ce223e",
|
||||
url:"{shixun_homework}?homework_id=${course_act_id}"
|
||||
},
|
||||
normal: {
|
||||
type:"普通作业",
|
||||
color:"#CC6633"
|
||||
},
|
||||
text: "${container_name}",
|
||||
type:"作业",
|
||||
color:"#ac3f8a"
|
||||
},
|
||||
CourseMessage: {
|
||||
type:"课堂申请",
|
||||
text:"申请加入课堂",
|
||||
color:"#3333FF"
|
||||
},
|
||||
Course: {
|
||||
type:"创建课堂",
|
||||
text:"大家快来加入课堂学习吧",
|
||||
color:"#33DDAA"
|
||||
}
|
||||
|
||||
}
|
||||
processObj(configMap);
|
||||
|
||||
|
||||
function get(obj, key) {
|
||||
if (typeof obj == "object" && key in obj)
|
||||
return obj[key];
|
||||
else
|
||||
return {__proto__:obj};
|
||||
}
|
||||
|
||||
|
||||
function format(str, values){
|
||||
return str.replace(/\$\{(.*?)\}/, function (match, key) {
|
||||
return values[key] || "";
|
||||
});
|
||||
}
|
||||
|
||||
Component({
|
||||
properties: {
|
||||
data:{
|
||||
type:Object,
|
||||
observer:function(data){
|
||||
let config = get(configMap, data.course_act_type);
|
||||
config = get(config, data.container_type);
|
||||
this.config = config;
|
||||
data.text = format(config.text, data);
|
||||
data.type = format(config.type, data);
|
||||
data.color = config.color;
|
||||
data.time = data.created_at.replace(/^.+ /,"");
|
||||
this.setData(data);
|
||||
//console.log(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
data: {
|
||||
eduImgDir:global.config.eduImgDir
|
||||
},
|
||||
methods: {
|
||||
onTap(){
|
||||
let {url} = this.config;
|
||||
if(!url) return;
|
||||
url = format(url, this.data);
|
||||
app.navigateTo({url});
|
||||
}
|
||||
}
|
||||
})
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<view class="activity" bindtap="onTap">
|
||||
<view class="left">
|
||||
<view class="line" style="background:{{color}}">
|
||||
</view>
|
||||
<view class="dot" style="background:{{color}};box-shadow: 1px 1px 3px {{color}}">
|
||||
</view>
|
||||
</view>
|
||||
<view class="display">
|
||||
<view class="header">
|
||||
<text class="author">{{author.name}}</text>
|
||||
<text class="time">{{time}}</text>
|
||||
<text class="type" style="color:{{color}};border-color:{{color}}">{{type}}</text>
|
||||
</view>
|
||||
<view class="body">
|
||||
<image class="avatar" src="{{eduImgDir}}{{author.img}}" mode="aspectFill" />
|
||||
<view class="content">{{text}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,59 @@
|
||||
.activity{
|
||||
display: flex;
|
||||
}
|
||||
.left{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.line{
|
||||
height: 100%;
|
||||
width: 2px;
|
||||
background: #00b0f0;
|
||||
}
|
||||
.dot{
|
||||
border-radius:50%;
|
||||
height: 5px;
|
||||
width: 5px;
|
||||
background: #0080f0;
|
||||
z-index: 100;
|
||||
box-shadow: 1px 1px 3px #0090f0;
|
||||
}
|
||||
.display{
|
||||
flex: auto;
|
||||
}
|
||||
.header{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 12px;
|
||||
height: 26px;
|
||||
}
|
||||
.author{
|
||||
padding: 0 8px;
|
||||
}
|
||||
.time{
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.type{
|
||||
color: white;
|
||||
padding: 2px 8px;
|
||||
border-radius: 2px;
|
||||
border: 1px solid;
|
||||
}
|
||||
.body{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.content{
|
||||
background: #eeeeee;
|
||||
padding: 8px;
|
||||
border-radius: 2px;
|
||||
flex: 1;
|
||||
}
|
||||
.avatar{
|
||||
border-radius: 50%;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin: 0 12px;
|
||||
}
|
@ -1,3 +1,12 @@
|
||||
.module{
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.homework-wrap{
|
||||
margin: 6px 10px;
|
||||
}
|
||||
.homeworks{
|
||||
flex: 1 1 1px;
|
||||
height: 1px;
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"nav-bar":"/components/nav-bar/nav-bar"
|
||||
"nav-bar":"/components/nav-bar/nav-bar",
|
||||
"exercise-item":"./exercise_item/exercise_item"
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
const app = getApp();
|
||||
Component({
|
||||
properties: {
|
||||
data:Object
|
||||
},
|
||||
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
onTap(){
|
||||
// 让用户选择是否答题,故添加封面;
|
||||
app.navigateTo({url:`{exercise_cover}?exercise_id=${this.data.data.id}`});
|
||||
}
|
||||
}
|
||||
})
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
<view class="exercise-item" bindtap="onTap">
|
||||
<view class="title">
|
||||
<text>{{data.exercise_name}}</text>
|
||||
</view>
|
||||
<view class="status">
|
||||
<text wx:if="{{data.exercise_left_time}}" class="left-time">还剩{{data.exercise_left_time}}截止</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="tip" wx:for="{{data.exercise_tips}}">{{item}}</text>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,20 @@
|
||||
.exercise-item{
|
||||
background: #eeeeee;
|
||||
border-radius: 4px;
|
||||
padding: 10px 12px;
|
||||
}
|
||||
.title{
|
||||
font-weight: 550;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.left-time{
|
||||
font-size: 14px;
|
||||
}
|
||||
.tip{
|
||||
font-size: 12px;
|
||||
border-radius: 36px;
|
||||
background: #00b0f0;
|
||||
color: white;
|
||||
padding: 2px 6px;
|
||||
margin-right: 6px;
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
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: 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: 4 })
|
||||
.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": {
|
||||
"shixun-homework-item":"./shixun_homework_item/shixun_homework_item",
|
||||
"nav-bar": "/components/nav-bar/nav-bar"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
<view class="module">
|
||||
<nav-bar list="{{list}}" itemWidth="-1" bindchange="onSwitchNav"/>
|
||||
<scroll-view class="homeworks" scroll-y="1">
|
||||
<view class="homework-wrap" wx:for="{{homeworks}}">
|
||||
<shixun-homework-item data="{{item}}"/>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
@ -0,0 +1,13 @@
|
||||
.module{
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: white;
|
||||
}
|
||||
.homework-wrap{
|
||||
margin: 8px 10px;
|
||||
}
|
||||
.homeworks{
|
||||
flex: 1 1 1px;
|
||||
height: 1px;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
const app = getApp();
|
||||
Component({
|
||||
properties: {
|
||||
data:Object
|
||||
},
|
||||
data:{
|
||||
eduImgDir:global.config.eduImgDir
|
||||
},
|
||||
methods:{
|
||||
enterShixun(){
|
||||
let { shixun_identifier} = this.data.data;
|
||||
app.navigateTo({url:`{shixun}?identifier=${shixun_identifier}`});
|
||||
}
|
||||
}
|
||||
})
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
<view class="homework" bindtap="enterShixun">
|
||||
<view class="content">
|
||||
<text class="title">{{data.name}}</text>
|
||||
<text class="tip" wx:for="{{data.status}}">{{item}}</text>
|
||||
</view>
|
||||
<view class="author">
|
||||
<image class="avatar" src="{{eduImgDir}}{{data.author_img}}" mode="aspectFill"></image>
|
||||
<text class="author-name">{{data.author}}</text>
|
||||
<text class="time">{{data.status_time}}</text>
|
||||
</view>
|
||||
<view class="commit-info" wx:if="{{data.time_status}}">
|
||||
<progress percent="{{data.commit_count/data.all_count*100}}" activeColor="#00b0f0" border-radius="6" backgroundColor="lightgrey"><text class="commit-text">提交:{{data.commit_count}}/{{data.all_count}}</text></progress>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,45 @@
|
||||
.homework{
|
||||
background: #f9f9f9;
|
||||
padding: 12px;
|
||||
box-shadow: 2px 1px 8px #aaaaaa;
|
||||
border-radius: 6px;
|
||||
}
|
||||
.content{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.title{
|
||||
font-weight: bold;
|
||||
}
|
||||
.tip{
|
||||
background: #00b0f0;
|
||||
color: white;
|
||||
margin: 0 6px;
|
||||
font-size: 11px;
|
||||
padding: 3px 6px;
|
||||
border-radius: 50px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.avatar{
|
||||
border-radius: 50%;
|
||||
height: 26px;
|
||||
width: 26px;
|
||||
}
|
||||
.author{
|
||||
font-size: 12px;
|
||||
color: #999999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.author-name{
|
||||
margin: 0 8px;
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
}
|
||||
commit-info{
|
||||
margin-top: 5px;
|
||||
}
|
||||
.commit-text{
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
margin: 0 8px;
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "创建课程"
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
import {getFormatDatetime} from "../../../js/utils";
|
||||
|
||||
const app = getApp();
|
||||
Component({
|
||||
properties: {
|
||||
exercise_id:Number
|
||||
},
|
||||
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
onLoad:function(){
|
||||
this.refresh();
|
||||
},
|
||||
async refresh(){
|
||||
let {exercise_id} = this.data;
|
||||
let data = await app.api("exercises.exercise_setting")({exercise_id});
|
||||
let date = new Date(data.exercise.end_time);
|
||||
data.exercise.end_time_str = getFormatDatetime(date);
|
||||
this.setData(data);
|
||||
},
|
||||
onTap(){
|
||||
let {time} = this.data.exercise;
|
||||
if(time&&time>0){
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: `答题时间为${time}分钟\n开始答题后即开始计时`,
|
||||
success:res=>{
|
||||
if(res.confirm)
|
||||
app.navigateTo({ url: `{exercise}?exercise_id=${this.data.exercise_id}` });
|
||||
}
|
||||
})
|
||||
}else
|
||||
app.navigateTo({url:`{exercise}?exercise_id=${this.data.exercise_id}`});
|
||||
}
|
||||
}
|
||||
})
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "试卷"
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
<view class="exercise">
|
||||
<view class="title">
|
||||
{{exercise.exercise_name}}
|
||||
</view>
|
||||
<view class="end">
|
||||
截止时间:{{exercise.end_time_str}}
|
||||
</view>
|
||||
<view class="time" wx:if="{{exercise.time&&exercise.time>0}}">
|
||||
答题时间:{{exercise.time}} 分钟
|
||||
</view>
|
||||
<button class="enter" type="main" bindtap="onTap">
|
||||
开始答题
|
||||
</button>
|
||||
</view>
|
@ -0,0 +1,22 @@
|
||||
page{
|
||||
height: 100%;
|
||||
}
|
||||
.exercise{
|
||||
height: 100%;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.title{
|
||||
font-weight: 600;
|
||||
font-size: 17px;
|
||||
padding: 60px 0 18px 0;
|
||||
}
|
||||
.time{
|
||||
margin: 14px 0;
|
||||
}
|
||||
.enter{
|
||||
position: absolute;
|
||||
bottom: 36px;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
onLoad: function (options) {
|
||||
let {homework_id} = options;
|
||||
this.setData({homework_id});
|
||||
this.refresh();
|
||||
},
|
||||
async refresh(){
|
||||
let {homework_id} = this.data;
|
||||
let data = await app.api("homework_commons.works_list")({homework_id});
|
||||
this.setData(data);
|
||||
},
|
||||
enterShixun(){
|
||||
app.navigateTo({url:`{shixun}?identifier=${this.data.shixun_identifier}`});
|
||||
},
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "实训作业"
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
<view class="homework">
|
||||
<view class="header">
|
||||
<text class="title">{{homework_name}}</text>
|
||||
<text class="tip" wx:for="{{homework_status}}">{{item}}</text>
|
||||
</view>
|
||||
|
||||
<view class="footer">
|
||||
<button type="main" bindtap="enterShixun">进入实训</button>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,25 @@
|
||||
page,.homework{
|
||||
height: 100%;
|
||||
}
|
||||
.header{
|
||||
text-align: center;
|
||||
}
|
||||
.title{
|
||||
font-weight: 560;
|
||||
font-size: 17px;
|
||||
}
|
||||
.tip{
|
||||
margin: 0 4px;
|
||||
background: #00b0f0;
|
||||
color: white;
|
||||
border-radius: 50px;
|
||||
padding: 2px 6px;
|
||||
font-size: 13px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.footer{
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
Loading…
Reference in new issue