优化界面

master
educoder_weapp 5 years ago
parent 5ffaf9ec41
commit 3f45de366c

@ -5,10 +5,12 @@ const developUrl = "https://test-newweb.educoder.net";
const trialUrl = "https://pre-newweb.educoder.net"; const trialUrl = "https://pre-newweb.educoder.net";
const releaseUrl = "https://www.educoder.net"; const releaseUrl = "https://www.educoder.net";
let _version = "0.14.3"; let _version = "0.14.4";
var eduUrl = releaseUrl; var eduUrl = releaseUrl;
/** /**
* * A 使用we-ui扩展库
* U 课堂界面优化更改
* U 加入课堂对话框界面优化
*/ */
export function switchEnv(env) { export function switchEnv(env) {

@ -0,0 +1,34 @@
Component({
properties: {
"show_info":{
type:Boolean,
value: false
},
"border_radius":Number,
"font_size":{
type:Number,
value:16
},
"stroke_width":{
type:Number,
value:6
},
backgroundColor:{
type:String,
value:"#EBEBEB"
},
value:Array
},
data: {
},
attached(){
this.setData({data:JSON.stringify(this.data)});
console.log(this.data);
},
methods: {
}
})

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

@ -0,0 +1,6 @@
<view class="progress-wrap">
<view class="progress-container" style="border-radius:{{border_radius}}px;font-size:{{font_size}}px;background:{{backgroundColor}};height:{{stroke_width}}px">
<view wx:for="{{value}}" style="background:{{item.color}};z-index:{{item.z-index||index}};width:{{item.percent}}%" class="progress-item"></view>
</view>
<slot />
</view>

@ -0,0 +1,14 @@
.progress-wrap{
display: flex;
flex-direction: column;
}
.progress-container{
flex: auto;
position: relative;
overflow: hidden;
}
.progress-item{
position: absolute;
height: 100%;
}

@ -22,5 +22,5 @@ image.no-content{
} }
.exercise-item{ .exercise-item{
margin: 4px 10px; margin: 10px;
} }

@ -1,11 +1,11 @@
<view class="exercise-item" bindtap="onTap"> <view class="exercise-item" bindtap="onTap">
<view class="title"> <view>
<text>{{data.exercise_name}}</text> <text class="title">{{data.exercise_name}}</text><text class="tip" style="{{item=='已截止'||item=='已结束'?'background:#FC2B6A':''}}" wx:for="{{data.exercise_tips}}">{{item}}</text>
</view> </view>
<view class="status"> <view class="status">
<text wx:if="{{data.exercise_left_time}}" class="left-time">还剩{{data.exercise_left_time}}截止</text> <text wx:if="{{data.exercise_left_time}}" class="left-time">还剩{{data.exercise_left_time}}截止</text>
</view> </view>
<view> <view wx:if="{{data.exercise_status>1}}">
<text class="tip" wx:for="{{data.exercise_tips}}">{{item}}</text> <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>
</view> </view>
</view> </view>

@ -1,14 +1,15 @@
.exercise-item{ .exercise-item{
background: #eeeeee; background: #f9f9f9;
border-radius: 4px;
padding: 10px 12px; padding: 10px 12px;
box-shadow: 2px 1px 5px #aaaaaa;
border-radius: 6px;
} }
.title{ .title{
font-weight: 550; font-weight: bold;
margin-bottom: 4px;
} }
.left-time{ .left-time{
font-size: 14px; font-size: 12px;
color: gray;
} }
.tip{ .tip{
font-size: 12px; font-size: 12px;
@ -17,4 +18,10 @@
color: white; color: white;
padding: 2px 6px; padding: 2px 6px;
margin-right: 6px; margin-right: 6px;
white-space: nowrap;
}
.commit-text{
font-size: 12px;
font-weight: bold;
margin-left: 4px;
} }

@ -1,7 +1,16 @@
const app = getApp(); const app = getApp();
Component({ Component({
properties: { properties: {
data:Object data:{
type:Object,
observer:function(data){
let commit_value = [
{percent:data.commit_count/data.all_count*100, color:"#00b0f0"},
{percent:data.compelete_count/data.all_count*100, color:"#0080f0"}
];
this.setData({commit_value})
}
}
}, },
data:{ data:{
eduImgDir:global.config.eduImgDir eduImgDir:global.config.eduImgDir

@ -1,4 +1,6 @@
{ {
"component": true, "component": true,
"usingComponents": {} "usingComponents": {
"muti-progress":"../../../components/muti-progress/muti-progress"
}
} }

@ -1,7 +1,7 @@
<view class="homework" bindtap="enterShixun"> <view class="homework" bindtap="enterShixun">
<view class="content"> <view class="content">
<text class="title">{{data.name}}</text> <text class="title">{{data.name}}</text>
<text class="tip" wx:for="{{data.status}}">{{item}}</text> <text class="tip" style="{{data.time_status>=5?'background:#FC2B6A':''}}" wx:for="{{data.status}}">{{item}}</text>
</view> </view>
<view class="author"> <view class="author">
<image class="avatar" src="{{eduImgDir}}{{data.author_img}}" mode="aspectFill"></image> <image class="avatar" src="{{eduImgDir}}{{data.author_img}}" mode="aspectFill"></image>
@ -9,6 +9,8 @@
<text class="time">{{data.status_time}}</text> <text class="time">{{data.status_time}}</text>
</view> </view>
<view class="commit-info" wx:if="{{data.time_status}}"> <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> <!--time_status==0:未发布-->
<muti-progress value="{{commit_value}}" border_radius="8" backgroundColor="lightgrey"/>
<text class="commit-text">完成:{{data.compelete_count}} 开始答题:{{data.commit_count}} 总人数:{{data.all_count}}</text>
</view> </view>
</view> </view>

@ -35,11 +35,11 @@
color: black; color: black;
font-weight: bold; font-weight: bold;
} }
commit-info{ .commit-info{
margin-top: 5px; margin-top: 5px;
} }
.commit-text{ .commit-text{
font-size: 12px; font-size: 12px;
font-weight: bold; font-weight: bold;
margin: 0 8px; white-space: pre;
} }

@ -59,7 +59,7 @@ Page({
break; break;
} }
} }
var content = answered?'交卷后不可更改,确定交卷吗':'您还有题目未作答,交卷后无法更改,确认吗'; var content = answered?'交卷后不能更改答案,确认交卷吗':'您还有题目未作答,交卷后无法更改,确认吗';
wx.showModal({ wx.showModal({
title: '确认', title: '确认',
content, content,

@ -73,6 +73,7 @@ page{
.operations{ .operations{
display: flex; display: flex;
padding: 2px;
} }
.operations>button{ .operations>button{
flex: 1; flex: 1;

@ -30,7 +30,7 @@
"skeletonGenerateFilesWithoutConfirm": true "skeletonGenerateFilesWithoutConfirm": true
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.2.1", "libVersion": "2.10.4",
"appid": "wxc5c2b711f23f3a1d", "appid": "wxc5c2b711f23f3a1d",
"projectname": "educoder_weapp", "projectname": "educoder_weapp",
"debugOptions": { "debugOptions": {
@ -106,10 +106,10 @@
"scene": null "scene": null
}, },
{ {
"id": 7, "id": 6,
"name": "course/pages/course/course", "name": "course/pages/course/course",
"pathName": "course/pages/course/course", "pathName": "course/pages/course/course",
"query": "course_id=6708", "query": "course_id=5141",
"scene": null "scene": null
}, },
{ {

Loading…
Cancel
Save