diff --git a/changelog.txt b/changelog.md
similarity index 98%
rename from changelog.txt
rename to changelog.md
index 33aefa6..eeabb0b 100644
--- a/changelog.txt
+++ b/changelog.md
@@ -1,9 +1,9 @@
-##v0.14.3
+## v0.14.3
* F 实训文件内容获取失败(文件path错误)
* F 个人信息性别设置bug
* D 删除实名认证界面
-##v0.14.2
+## v0.14.2
* F 签到界面无权限访问提示
* F 更改头像界面图片初次加载失败
* F 电脑端用户界面图标及文字位置不正确
diff --git a/miniprogram/app.js b/miniprogram/app.js
index 048ae02..f4523d9 100644
--- a/miniprogram/app.js
+++ b/miniprogram/app.js
@@ -30,9 +30,6 @@ App({
}
})
}
- wx.reportAnalytics('version', {
- app_version: global.config.version
- });
this.api("users.system_update")().then(res => {
if (res.system_update) {
let { subject = "升级服务通知", system_score} = res;
diff --git a/miniprogram/app.json b/miniprogram/app.json
index b5f56c0..96282d5 100644
--- a/miniprogram/app.json
+++ b/miniprogram/app.json
@@ -82,6 +82,12 @@
"pages": [
"search"
]
+ },{
+ "name":"feedback",
+ "root":"pages/feedback",
+ "pages":[
+ "feedback"
+ ]
}
],
"preloadRule": {
@@ -139,6 +145,9 @@
}
]
},
+ "useExtendedLib": {
+ "weui": true
+ },
"navigateToMiniProgramAppIdList": [
"wx2402d86a6b534f77"
],
diff --git a/miniprogram/components/course-item/course-item.json b/miniprogram/components/course-item/course-item.json
index cfe174d..2ea3b8c 100644
--- a/miniprogram/components/course-item/course-item.json
+++ b/miniprogram/components/course-item/course-item.json
@@ -1,7 +1,8 @@
{
"component": true,
"usingComponents": {
- "iconfont":"../iconfont/iconfont"
+ "iconfont":"../iconfont/iconfont",
+ "mp-icon": "/weui-miniprogram/icon/icon"
},
"navigationBarBackgroundColor": "#00b0f0",
"navigationBarTextStyle": "white"
diff --git a/miniprogram/components/course-item/course-item.wxml b/miniprogram/components/course-item/course-item.wxml
index 1149a41..bd49c54 100644
--- a/miniprogram/components/course-item/course-item.wxml
+++ b/miniprogram/components/course-item/course-item.wxml
@@ -1,7 +1,7 @@
@@ -11,7 +11,7 @@
{{data.school}}
{{data.creator}}
-
+
{{data.course_members_count}}
{{data.visits}}
diff --git a/miniprogram/components/course-item/more.png b/miniprogram/components/course-item/more.png
deleted file mode 100644
index 892de15..0000000
Binary files a/miniprogram/components/course-item/more.png and /dev/null differ
diff --git a/miniprogram/components/modal/join-course/join-course.js b/miniprogram/components/modal/join-course/join-course.js
index 5d2cac8..5ecce11 100644
--- a/miniprogram/components/modal/join-course/join-course.js
+++ b/miniprogram/components/modal/join-course/join-course.js
@@ -36,7 +36,11 @@ Component({
data: {
identities:[],
- hidden:true
+ hidden:true,
+ buttons:[
+ {text:"取消"},
+ {text:"提交"}
+ ]
},
methods: {
scan(){
@@ -88,9 +92,15 @@ Component({
}
})
},
- cancel: function (event) {
+ cancel() {
this.setData({ hidden: true });
},
+ onTapButton({detail:{index}}){
+ if(index==0)
+ this.cancel();
+ else if(index==1)
+ this.join_course();
+ },
update_invite_code: function ({ detail: { value } }) {
console.log(value);
this.setData({ invite_code: value });
@@ -103,7 +113,7 @@ Component({
console.log(data);
this.setData(data)
},
- join_course: function (event) {
+ join_course () {
if(this.disabled) return;
let { invite_code="", assistant_professor="", professor,student=""} = this.data;
this.disabled = true;
diff --git a/miniprogram/components/modal/join-course/join-course.json b/miniprogram/components/modal/join-course/join-course.json
index e8cfaaf..90720fd 100644
--- a/miniprogram/components/modal/join-course/join-course.json
+++ b/miniprogram/components/modal/join-course/join-course.json
@@ -1,4 +1,6 @@
{
"component": true,
- "usingComponents": {}
+ "usingComponents": {
+ "mp-dialog": "/weui-miniprogram/dialog/dialog"
+ }
}
\ No newline at end of file
diff --git a/miniprogram/components/modal/join-course/join-course.wxml b/miniprogram/components/modal/join-course/join-course.wxml
index 98d32f2..3109f8c 100644
--- a/miniprogram/components/modal/join-course/join-course.wxml
+++ b/miniprogram/components/modal/join-course/join-course.wxml
@@ -1,12 +1,14 @@
-
-
-
-
-
-
- 身份:
- 教师
- 助教
- 学生
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+ 身份:
+ 教师
+ 助教
+ 学生
+
+
+
\ No newline at end of file
diff --git a/miniprogram/course/components/file-item/file-item.js b/miniprogram/course/components/file-item/file-item.js
index 3c47b35..bbbed66 100644
--- a/miniprogram/course/components/file-item/file-item.js
+++ b/miniprogram/course/components/file-item/file-item.js
@@ -23,6 +23,7 @@ Component({
success: (res) => {
wx.openDocument({
filePath: res.tempFilePath,
+ showMenu:true,
fail: app.showError
});
},
diff --git a/miniprogram/course/images/more.png b/miniprogram/course/images/more.png
deleted file mode 100644
index 127fd7a..0000000
Binary files a/miniprogram/course/images/more.png and /dev/null differ
diff --git a/miniprogram/course/images/navigateback.png b/miniprogram/course/images/navigateback.png
deleted file mode 100644
index 8ae910b..0000000
Binary files a/miniprogram/course/images/navigateback.png and /dev/null differ
diff --git a/miniprogram/course/images/relaunch.png b/miniprogram/course/images/relaunch.png
deleted file mode 100644
index a2943a0..0000000
Binary files a/miniprogram/course/images/relaunch.png and /dev/null differ
diff --git a/miniprogram/course/images/svg/activity.svg b/miniprogram/course/images/svg/activity.svg
new file mode 100644
index 0000000..dd6d97d
--- /dev/null
+++ b/miniprogram/course/images/svg/activity.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/activity_select.svg b/miniprogram/course/images/svg/activity_select.svg
new file mode 100644
index 0000000..89080ba
--- /dev/null
+++ b/miniprogram/course/images/svg/activity_select.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/announcement.svg b/miniprogram/course/images/svg/announcement.svg
new file mode 100644
index 0000000..14e2eea
--- /dev/null
+++ b/miniprogram/course/images/svg/announcement.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/announcement_select.svg b/miniprogram/course/images/svg/announcement_select.svg
new file mode 100644
index 0000000..f10c265
--- /dev/null
+++ b/miniprogram/course/images/svg/announcement_select.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/attachment.svg b/miniprogram/course/images/svg/attachment.svg
new file mode 100644
index 0000000..686b6b1
--- /dev/null
+++ b/miniprogram/course/images/svg/attachment.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/attachment_select.svg b/miniprogram/course/images/svg/attachment_select.svg
new file mode 100644
index 0000000..e25a29d
--- /dev/null
+++ b/miniprogram/course/images/svg/attachment_select.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/attendance.svg b/miniprogram/course/images/svg/attendance.svg
new file mode 100644
index 0000000..2dfc626
--- /dev/null
+++ b/miniprogram/course/images/svg/attendance.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/attendance_select.svg b/miniprogram/course/images/svg/attendance_select.svg
new file mode 100644
index 0000000..15859b5
--- /dev/null
+++ b/miniprogram/course/images/svg/attendance_select.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/board.svg b/miniprogram/course/images/svg/board.svg
new file mode 100644
index 0000000..704d2c7
--- /dev/null
+++ b/miniprogram/course/images/svg/board.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/board_select.svg b/miniprogram/course/images/svg/board_select.svg
new file mode 100644
index 0000000..f763336
--- /dev/null
+++ b/miniprogram/course/images/svg/board_select.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/common_homework.svg b/miniprogram/course/images/svg/common_homework.svg
new file mode 100644
index 0000000..31e8674
--- /dev/null
+++ b/miniprogram/course/images/svg/common_homework.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/common_homework_select.svg b/miniprogram/course/images/svg/common_homework_select.svg
new file mode 100644
index 0000000..146da95
--- /dev/null
+++ b/miniprogram/course/images/svg/common_homework_select.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/course_group.svg b/miniprogram/course/images/svg/course_group.svg
new file mode 100644
index 0000000..58c81b6
--- /dev/null
+++ b/miniprogram/course/images/svg/course_group.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/course_group_select.svg b/miniprogram/course/images/svg/course_group_select.svg
new file mode 100644
index 0000000..78e36b3
--- /dev/null
+++ b/miniprogram/course/images/svg/course_group_select.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/exercise.svg b/miniprogram/course/images/svg/exercise.svg
new file mode 100644
index 0000000..07db5ae
--- /dev/null
+++ b/miniprogram/course/images/svg/exercise.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/exercise_select.svg b/miniprogram/course/images/svg/exercise_select.svg
new file mode 100644
index 0000000..d314e89
--- /dev/null
+++ b/miniprogram/course/images/svg/exercise_select.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/graduation.svg b/miniprogram/course/images/svg/graduation.svg
new file mode 100644
index 0000000..670e1de
--- /dev/null
+++ b/miniprogram/course/images/svg/graduation.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/graduation_select.svg b/miniprogram/course/images/svg/graduation_select.svg
new file mode 100644
index 0000000..de829d0
--- /dev/null
+++ b/miniprogram/course/images/svg/graduation_select.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/group_homework.svg b/miniprogram/course/images/svg/group_homework.svg
new file mode 100644
index 0000000..eb714e2
--- /dev/null
+++ b/miniprogram/course/images/svg/group_homework.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/group_homework_select.svg b/miniprogram/course/images/svg/group_homework_select.svg
new file mode 100644
index 0000000..537df55
--- /dev/null
+++ b/miniprogram/course/images/svg/group_homework_select.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/module.svg b/miniprogram/course/images/svg/module.svg
new file mode 100644
index 0000000..af520e1
--- /dev/null
+++ b/miniprogram/course/images/svg/module.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/module_select.svg b/miniprogram/course/images/svg/module_select.svg
new file mode 100644
index 0000000..09a6e6b
--- /dev/null
+++ b/miniprogram/course/images/svg/module_select.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/poll.svg b/miniprogram/course/images/svg/poll.svg
new file mode 100644
index 0000000..a22c836
--- /dev/null
+++ b/miniprogram/course/images/svg/poll.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/poll_select.svg b/miniprogram/course/images/svg/poll_select.svg
new file mode 100644
index 0000000..7ea9b73
--- /dev/null
+++ b/miniprogram/course/images/svg/poll_select.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/shixun_homework.svg b/miniprogram/course/images/svg/shixun_homework.svg
new file mode 100644
index 0000000..eab3ffb
--- /dev/null
+++ b/miniprogram/course/images/svg/shixun_homework.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/shixun_homework_select.svg b/miniprogram/course/images/svg/shixun_homework_select.svg
new file mode 100644
index 0000000..2303ee9
--- /dev/null
+++ b/miniprogram/course/images/svg/shixun_homework_select.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/statistics.svg b/miniprogram/course/images/svg/statistics.svg
new file mode 100644
index 0000000..d7fb741
--- /dev/null
+++ b/miniprogram/course/images/svg/statistics.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/statistics_select.svg b/miniprogram/course/images/svg/statistics_select.svg
new file mode 100644
index 0000000..d57e32b
--- /dev/null
+++ b/miniprogram/course/images/svg/statistics_select.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/video.svg b/miniprogram/course/images/svg/video.svg
new file mode 100644
index 0000000..3732d13
--- /dev/null
+++ b/miniprogram/course/images/svg/video.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/images/svg/video_select.svg b/miniprogram/course/images/svg/video_select.svg
new file mode 100644
index 0000000..20b7a57
--- /dev/null
+++ b/miniprogram/course/images/svg/video_select.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/course/modules/activity/activity.wxml b/miniprogram/course/modules/activity/activity.wxml
index 9397824..540324c 100644
--- a/miniprogram/course/modules/activity/activity.wxml
+++ b/miniprogram/course/modules/activity/activity.wxml
@@ -1,5 +1,7 @@
+
-
+
+
diff --git a/miniprogram/course/modules/activity/activity.wxss b/miniprogram/course/modules/activity/activity.wxss
index 350fd40..4c0e6b5 100644
--- a/miniprogram/course/modules/activity/activity.wxss
+++ b/miniprogram/course/modules/activity/activity.wxss
@@ -1,3 +1,6 @@
+.module{
+ height: 100%;
+}
.activities{
background: white;
height: 100%;
diff --git a/miniprogram/course/modules/activity/activity_group/activity_group.wxml b/miniprogram/course/modules/activity/activity_group/activity_group.wxml
index 790bacc..625b42c 100644
--- a/miniprogram/course/modules/activity/activity_group/activity_group.wxml
+++ b/miniprogram/course/modules/activity/activity_group/activity_group.wxml
@@ -1,6 +1,6 @@
{{_date}}
-
+
\ No newline at end of file
diff --git a/miniprogram/course/pages/course/course.js b/miniprogram/course/pages/course/course.js
index 7423845..c8a93ea 100644
--- a/miniprogram/course/pages/course/course.js
+++ b/miniprogram/course/pages/course/course.js
@@ -1,178 +1,317 @@
const app = getApp();
//status:[0,401,409]
-const defaultModules=[{type:"activity", name:"课堂动态"}];
-const supportModules = ["activity", "attachment", "exercise","shixun_homework", "attendance"];
+const defaultModules = [{
+ type: "activity",
+ name: "课堂动态"
+}];
+const supportModules = ["activity", "attachment", "exercise", "shixun_homework", "attendance"];
+const nosupportMsgs = {
+ video:"请使用网页版EduCoder"
+};
+
Component({
- properties:{
- course_id:Number,
- module_type:{
- type:String,
- observer:function(module){
- this.setModule(module,0);
+ properties: {
+ course_id: Number,
+ module_type: {
+ type: String,
+ observer: function (module) {
+ //this.setModule(module,0);
}
},
},
data: {
- status:0,
- refresh:0,
- nav_type:"navigateback",
- module:{
- type:"activity",
- name:"课堂动态"
+ status: 0,
+ refresh: 0,
+ nav_type: "back",
+ current:0,
+ module: {
+ type: "activity",
+ name: "课堂动态"
},
+ tabbar_show:1,
course: {},
- is_teacher: true,
- course_modules: [],
- hidden_modules: [] ,
- statusBarHeight:20,
- windowWidth:375,
+ is_teacher: true,
+ course_modules: [],
+ hidden_modules: [],
+ statusBarHeight: 20,
+ windowWidth: 375,
eduImgDir: global.config.eduImgDir,
- scenes:{
- 401:{
- buttons:["点击登录","返回"]
+ scenes: {
+ 401: {
+ buttons: ["点击登录", "返回"]
},
- 409:{
- message:"你不是该课堂的成员",
- buttons:["加入课堂","返回"]
+ 409: {
+ message: "你不是该课堂的成员",
+ buttons: ["加入课堂", "返回"]
},
- 404:{
- message:"该课堂已经被删除了",
- buttons:["返回"]
+ 404: {
+ message: "该课堂已经被删除了",
+ buttons: ["返回"]
}
}
},
- methods:{
- switchRole({target:{dataset:{role}}}){
- if(!role) return;
- app.api("courses.switch_to_"+role)({course_id: this.data.course_id})
- .then(res=>{
- this.onPullDownRefresh();
- app.showMsg(res);
- }).catch(app.showError)
- },
- setModule({type,showToast=1}){
- for(var module of this.data.course_modules){
- if(module.type==type){
- if(supportModules.indexOf(type)==-1){
- if(showToast)
- wx.showToast({
- title: `暂不支持${module.name}模块`,icon:"none"
- });
- return false;
+ methods: {
+ switchRole({target: { dataset: {role}}}) {
+ if (!role) return;
+ app.api("courses.switch_to_" + role)({
+ course_id: this.data.course_id
+ })
+ .then(res => {
+ this.onPullDownRefresh();
+ app.showMsg(res);
+ }).catch(app.showError)
+ },
+ onModuleTap({currentTarget:{dataset:{type}}}){
+ if(this.setModule({type: type})){
+ this.setData({showModules:0})
+ }
+ },
+ onModuleChange({detail: {index,item}}) {
+ if (item.type == "more"){
+ this.setData({
+ showModules: 1,
+ current: this.data.current
+ });
+ }else
+ this.setModule({
+ type: item.type
+ });
+ },
+ setModule({type,showToast = 1}) {
+ for (var module of this.data.course_modules) {
+ if (module.type == type) {
+ if (supportModules.indexOf(type) == -1) {
+ if (showToast)
+ wx.showToast({
+ title: nosupportMsgs[type]||`暂不支持${module.name},请使用网页版`,
+ icon: "none"
+ });
+ this.setData({current: this.data.current});
+ return false;
+ }
+ this.setData({
+ module
+ });
}
- this.setData({module});
- return true;
}
- }
- return false;
- },
- enterShare(){
- let {course_id, course} = this.data;
- let url = `{course_invite}?course_id=${course_id}&invite_code=${course.invite_code}`;
- app.navigateTo({url});
- },
- onTapCode() {
- let { name, invite_code, code_halt} = this.data.course;
- if(!code_halt)
- wx.setClipboardData({data: `输入邀请码${invite_code}加入“${name}”吧`})
- else
- wx.showActionSheet({
- itemList: ["启用邀请码"],
- success:res=>{
- app.api("courses.set_invite_code_halt")({course_id: this.data.course_id})
- .then(res=>{
- app.showMsg(res);
- this.refresh({refresh:0});
- })
+ for (var i = 0; i < this.data.list.length; i++) {
+ if (this.data.list[i].type == type) {
+ this.setData({
+ current: i
+ });
+ return true;
}
- })
- },
- switchModule({currentTarget:{dataset:{type}}}){
- let list = this.data.course_modules.filter(item=>item.type==type);
- if(list[0]&&list[0].type)
- this.setModule({type:list[0].type});
- },
- navigateBack(){
- if(this.data.nav_type=="navigateback")
- wx.navigateBack({
- delta:1
+ }
+ this.setData({
+ current: -1
});
- else
- app.reLaunch({
- url: '{main}',
+ return true;
+ },
+ enterShare() {
+ let {
+ course_id,
+ course
+ } = this.data;
+ let url = `{course_invite}?course_id=${course_id}&invite_code=${course.invite_code}`;
+ app.navigateTo({
+ url
});
- },
- async pullCourse(){
- let {course_id} = this.data;
- let course = await app.api("courses.top_banner")({course_id});
- this.setData({course});
- return {course};
- },
- async pullModules(){
- let { course_id } = this.data;
- let data = await app.api("courses.left_banner")({ course_id });
- data.course_modules = defaultModules.concat(data.course_modules);
- this.setData(data);
- return data;
- },
- onTapError({detail:{status, target, current}}){
- console.log(target);
- switch(status){
- case 401:
- if(current==0)
- return app.navigateTo({url:"{account}"});
- else if(current==1)
- return this.navigateBack();
- case 409:
- if(current==0)
- return this.setData({show_join_course: 1});
- else if(current==1)
+ },
+ onTapCode() {
+ let {
+ name,
+ invite_code,
+ code_halt
+ } = this.data.course;
+ if (!code_halt)
+ wx.setClipboardData({
+ data: `输入邀请码${invite_code}加入“${name}”吧`
+ })
+ else
+ wx.showActionSheet({
+ itemList: ["启用邀请码"],
+ success: res => {
+ app.api("courses.set_invite_code_halt")({
+ course_id: this.data.course_id
+ })
+ .then(res => {
+ app.showMsg(res);
+ this.refresh({
+ refresh: 0
+ });
+ })
+ }
+ })
+ },
+
+ navigateBack() {
+ if (this.data.nav_type == "back")
+ wx.navigateBack({
+ delta: 1
+ });
+ else
+ app.reLaunch({
+ url: '{main}',
+ });
+ },
+ async pullCourse() {
+ let {
+ course_id
+ } = this.data;
+ let course = await app.api("courses.top_banner")({
+ course_id
+ });
+ this.setData({
+ course
+ });
+ return {
+ course
+ };
+ },
+ async pullModules() {
+ let {
+ course_id
+ } = this.data;
+ let data = await app.api("courses.left_banner")({
+ course_id
+ });
+ let course_modules = defaultModules.concat(data.course_modules);
+ course_modules = course_modules.filter(i=>supportModules.indexOf(i.type)>-1);
+ this.setData({
+ course_modules
+ });
+ this.setTabbar({
+ course_modules
+ });
+ return course_modules;
+ },
+ setTabbar({course_modules}) {
+ var base = "/course/images/svg/"
+ if (course_modules.length <= 5) {
+ var list = course_modules.map(m => {
+ return {
+ type: m.type,
+ text: m.name,
+ selectedIconPath: base + m.type + "_select.svg",
+ iconPath: base + m.type + ".svg"
+ };
+ })
+ } else {
+ var list = [];
+ for (var i = 0; i < 5; i++) {
+ if (i == 2)
+ list.push({
+ type: "more",
+ text: "更多",
+ 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"
+ });
+ }
+ }
+ }
+ this.setData({
+ list
+ });
+ return list;
+ },
+ onTapError({
+ detail: {
+ status,
+ target,
+ current
+ }
+ }) {
+ console.log(target);
+ switch (status) {
+ case 401:
+ if (current == 0)
+ return app.navigateTo({
+ url: "{account}"
+ });
+ else if (current == 1)
+ return this.navigateBack();
+ case 409:
+ if (current == 0)
+ return this.setData({
+ show_join_course: 1
+ });
+ else if (current == 1)
+ return this.navigateBack();
+ case 404:
return this.navigateBack();
- case 404:
- return this.navigateBack();
- }
- },
- refresh({ refresh = 1 } = {}) {
- app.syncUser().then(res => {
- this.pullCourse().then(res=>{
- this.setData({ status: 200, refresh});
+ }
+ },
+ refresh({
+ refresh = 1
+ } = {}) {
+ app.syncUser().then(res => {
+ this.pullCourse().then(res => {
+ this.setData({
+ status: 200,
+ refresh
+ });
+ })
+ .catch(e => {
+ this.setData({
+ status: e.code
+ });
+ });
+ this.pullModules()
+ .then(res => {
+ console.log(res);
+ });
})
- .catch(e=>{
- this.setData({status:e.code});
+ },
+ changeTabbar({show}){
+ this.setData({tabbar_show:show});
+ },
+ onLoad: function () {
+ wx.getSystemInfo({
+ success: res => {
+ let {
+ statusBarHeight,
+ windowWidth
+ } = res;
+ this.setData({
+ statusBarHeight,
+ windowWidth
+ })
+ },
});
- this.pullModules()
- .then(res => {
- console.log(res);
+ let pages = getCurrentPages();
+ if (pages.length <= 1)
+ this.setData({
+ nav_type: "home"
});
- })
- },
- onLoad: function () {
- wx.getSystemInfo({
- success:res=>{
- let { statusBarHeight, windowWidth} = res;
- this.setData({ statusBarHeight, windowWidth})
- },
- });
- let pages = getCurrentPages();
- if(pages.length<=1)
- this.setData({nav_type:"relaunch"});
- else
- this.setData({nav_type:"navigateback"})
- this.refresh({refresh:0});
- },
- onShow: function () {
- if(this.data.status!=200&&this.data.status!=0||this.data.status!=0){
- this.refresh();
- }
- },
- onReady:function(){
+ else
+ this.setData({
+ nav_type: "back"
+ })
+ this.refresh({
+ refresh: 0
+ });
+ },
+ onShow: function () {
+ if (this.data.status != 200 && this.data.status != 0 || this.data.status != 0) {
+ this.refresh();
+ }
+ },
+ onReady: function () {
- },
- onPullDownRefresh(){
- this.refresh();
- },
- onShareAppMessage: function () {
+ },
+ onPullDownRefresh() {
+ this.refresh();
+ },
+ onShareAppMessage: function () {
- }
+ }
}
})
\ No newline at end of file
diff --git a/miniprogram/course/pages/course/course.json b/miniprogram/course/pages/course/course.json
index 18ccaef..0d02d0b 100644
--- a/miniprogram/course/pages/course/course.json
+++ b/miniprogram/course/pages/course/course.json
@@ -8,11 +8,14 @@
"activity":"/course/modules/activity/activity",
"attendance":"/course/modules/attendance/attendance",
"join-course":"/components/modal/join-course/join-course",
- "error-page":"/components/error-page/error-page"
+ "error-page":"/components/error-page/error-page",
+ "mp-tabbar": "weui-miniprogram/tabbar/tabbar",
+ "mp-halfScreenDialog": "weui-miniprogram/half-screen-dialog/half-screen-dialog",
+ "mp-icon": "/weui-miniprogram/icon/icon"
},
"navigationStyle": "custom",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"backgroundTextStyle": "light",
- "backgroundColor": "#000541"
+ "backgroundColor": "#0080f0"
}
\ No newline at end of file
diff --git a/miniprogram/course/pages/course/course.wxml b/miniprogram/course/pages/course/course.wxml
index 21baf0c..2a12a93 100644
--- a/miniprogram/course/pages/course/course.wxml
+++ b/miniprogram/course/pages/course/course.wxml
@@ -1,71 +1,71 @@
-
-
-
-
- {{item.name}}
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
-
-
\ No newline at end of file
+
+
+
+
+
+
+ {{item.name}}
+
+
+
\ No newline at end of file
diff --git a/miniprogram/course/pages/course/course.wxs b/miniprogram/course/pages/course/course.wxs
index 2e6fc21..664c2ba 100644
--- a/miniprogram/course/pages/course/course.wxs
+++ b/miniprogram/course/pages/course/course.wxs
@@ -1,74 +1,8 @@
-var newmark = startmark = 0
-var status = 1
-var percent = 0.36;
-function touchstart(e, ins) {
- var pageX = (e.touches[0] || e.changedTouches[0]).pageX
- startmark = newmark = pageX
-}
-function touchmove(e, ins) {
- var pageX = (e.touches[0] || e.changedTouches[0]).pageX
- newmark = pageX
- // var data = ins.getData()
- var data = {
- windowWidth: e.currentTarget.dataset.width
- }
- if (startmark < pageX) {
- if (data.windowWidth * percent > Math.abs(newmark - startmark)) {
- ins.selectComponent('.page-top').setStyle({
- transform: 'translateX(' + Math.min(data.windowWidth * percent, ((status == 1 ? data.windowWidth * percent : 0) + newmark - startmark)) + 'px)'
- })
- }
- }
- if (startmark > pageX) {
- ins.selectComponent('.page-top').setStyle({
- transform: 'translateX(' + Math.max(0, ((status == 1 ? data.windowWidth * percent : 0) + newmark - startmark)) + 'px)'
- })
- }
-}
-function touchend(e, ins) {
- var pageX = (e.touches[0] || e.changedTouches[0]).pageX
- newmark = pageX
- // var data = ins.getData()
- var data = {
- windowWidth: e.currentTarget.dataset.width
- }
- if (startmark < pageX) {
- if (data.windowWidth * 0.24 < Math.abs(newmark - startmark)) {
- ins.selectComponent('.page-top').setStyle({
- transform: 'translateX(' + (data.windowWidth * percent) + 'px)'
- })
- status = 1 // 展开状态
- } else {
- ins.selectComponent('.page-top').setStyle({
- transform: 'translateX(0px)'
- })
- status = 0 // 收起状态
- }
- }
- if (startmark > newmark) {
- ins.selectComponent('.page-top').setStyle({
- transform: 'translateX(0px)'
- })
- status = 0 // 收起状态
- }
-}
-function changeSideBar(e,ins){
- var width=e.currentTarget.dataset.width
- status = 1-status;
- ins.selectComponent('.page-top').setStyle({
- transform: 'translateX('+width*percent*status+'px)'
- });
-}
-function hideSideBar(e, ins){
- var width= e.currentTarget.dataset.width
- status = 0;
- ins.selectComponent('.page-top').setStyle({
- transform: 'translateX(0px)'
- });
-}
var startY = 0;
var show = 1;
+var tabbar_show = 1;
+
function touchsHeader(e, ins){
var pageY = (e.touches[0] || e.changedTouches[0]).pageY
startY = pageY;
@@ -113,9 +47,11 @@ function touchmBody(e, ins){
opacity: Math.abs(changeY-45) / 100
})
}*/
+ //if
}
function toucheBody(e, ins) {
var changeY = (e.touches[0] || e.changedTouches[0]).pageY - startY;
+ //console.log(startY, changeY);
//if (changeY > 100)
// show = 1;
//else
@@ -127,14 +63,13 @@ function toucheBody(e, ins) {
opacity: show,
visibility: show?"visiable":"hidden"
})
+ if(tabbar_show==changeY<0){
+ tabbar_show = changeY>=0;
+ ins.callMethod("changeTabbar", {show:tabbar_show});
+ }
}
module.exports = {
- touchstart: touchstart,
- touchmove: touchmove,
- touchend: touchend,
- changeSideBar: changeSideBar,
- hideSideBar:hideSideBar,
touchmHeader: touchmHeader,
touchsHeader: touchsHeader,
touchmBody:touchmBody,
diff --git a/miniprogram/course/pages/course/course.wxss b/miniprogram/course/pages/course/course.wxss
index 4a92c17..034597f 100644
--- a/miniprogram/course/pages/course/course.wxss
+++ b/miniprogram/course/pages/course/course.wxss
@@ -1,33 +1,9 @@
-.page-bottom{
+.body{
height: 100%;
- width: 750rpx;
- position: fixed;
- background: linear-gradient(0deg, rgb(0, 68, 97),rgb(1,1,78));
- z-index: 0;
}
-.wc{
- color: white;
- padding: 30rpx 0 30rpx 40rpx;
-}
-.page-content{
- padding-top: 100rpx;
- overflow-y: scroll;
- height: 100vh;
-}
-.page-top{
- height: 100%;
- position: fixed;
- width: 750rpx;
- background-color: #efefef;
- z-index: 0;
- transition: All 0.4s ease;
- -webkit-transition: All 0.4s ease;
-}
-
-
.header{
- background-color: rgb(1,1,78);
+ background-image: linear-gradient(to bottom right,#1670e0, #0092f0,#0981f8);
color: white;
flex: none;
}
@@ -44,21 +20,13 @@
width:100%;
z-index: 999;
}
-.nav-buttons{
- width: 86px;
- display: flex;
- justify-content: space-evenly;
+.nav-button{
flex:none;
- padding:0 7px;
-}
-.nav-button,.more-img{
- width: 24px;
- height: 24px;
- padding: 4px 8px;
+ padding:0 12px;
}
+
.course-name{
padding-right: 100px;
- text-align: center;
overflow: hidden;
flex: auto;
font-size:14px;
@@ -110,7 +78,7 @@
margin: 0 3px;
}
text.sep{
- color: grey;
+ color: lightgrey;
margin: 0 5px;
}
@@ -120,8 +88,8 @@ text.sep{
justify-content: space-evenly;
}
.course-buttons>button{
- color: #0080f0;
- border: solid 1px #0080f0;
+ color: white;
+ border: solid 1px white;
border-radius: 5px;
background: transparent;
font-size: 10px!important;
@@ -141,7 +109,7 @@ text.sep{
}
.code{
font-size: 12px;
- color: chocolate;
+ color: #d40f0f;
text-decoration: underline;
}
@@ -149,3 +117,38 @@ text.sep{
flex: 1 1 1px;
height: 1px;
}
+.tabbar{
+ flex: none;
+ transition: 2s ease all;
+}
+
+.modules{
+ display: flex;
+ flex-wrap: wrap;
+}
+
+.module-item{
+ flex:none;
+ width: 110rpx;
+ padding: 8rpx;
+ height: 110rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+}
+.module-img{
+ width: 100rpx;
+ height: 100rpx;
+}
+.module-name{
+ font-size: 12px;
+ color: dimgray;
+}
+
+.weui-tabbar .weui-tabbar__item.weui-bar__item_on .tabbar--weui-tabbar__label{
+ color: #00b0f0!important;
+}
+.weui-half-screen-dialog__hd__side .weui-icon-btn.weui-icon-btn_more{
+ display: none;
+}
\ No newline at end of file
diff --git a/miniprogram/course/pages/course_invite/course_invite.js b/miniprogram/course/pages/course_invite/course_invite.js
index 857b30c..15d77a6 100644
--- a/miniprogram/course/pages/course_invite/course_invite.js
+++ b/miniprogram/course/pages/course_invite/course_invite.js
@@ -75,22 +75,22 @@ Page({
this.setData({ status: -1 })
});
})
- },
- onLoad: function (options) {
- console.log("onLoad", options);
- var course_id;
- if(options.course_id)
- course_id= options.course_id;
- else if(options.scene){
- var scene = {};
- for (var item of decodeURIComponent(options.scene).split("&")){
- var [k,v] = item.split("=")
- scene[k]=v;
- }
- course_id = scene.course_id;
- }else{
- this.setData({status: 404});
- return;
+ },
+ onLoad: function (options) {
+ console.log("onLoad", options);
+ var course_id;
+ if(options.course_id)
+ course_id= options.course_id;
+ else if(options.scene){
+ var scene = {};
+ for (var item of decodeURIComponent(options.scene).split("&")){
+ var [k,v] = item.split("=")
+ scene[k]=v;
+ }
+ course_id = scene.course_id;
+ }else{
+ this.setData({status: 404});
+ return;
}
this.setData({ course_id, status: 1});
let invite_code_url = getWXACodeUrl({url: this.getPageUrl(), scene:this.getScene()});
diff --git a/miniprogram/dev/pages/dev/dev.wxml b/miniprogram/dev/pages/dev/dev.wxml
index e69de29..f01a0d2 100644
--- a/miniprogram/dev/pages/dev/dev.wxml
+++ b/miniprogram/dev/pages/dev/dev.wxml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/miniprogram/js/apiConfig.js b/miniprogram/js/apiConfig.js
index 5860b98..69fb5c3 100644
--- a/miniprogram/js/apiConfig.js
+++ b/miniprogram/js/apiConfig.js
@@ -17,13 +17,16 @@ accounts:{
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_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},
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},
},
exit_course:{url:"{course_id}/*",query,config},
+ export_member_scores_excel:{url:"{course_id}/*", query, config:{method:"downloadFile"}},
homework_commons:{url:"{course_id}/*",query, form:{type:null, page:1, order:""}, disp:"普通作业|实训作业", data:{order:"无:全部,0:未发布,1:提交中,2:补交中, 3:匿评,4:申诉,5:已截止"}},
left_banner:{url:"{course_id}/*",query},
top_banner:{url:"{course_id}/*", query},
@@ -32,7 +35,8 @@ courses:{ url:{_:"*", DELETE:"*/{course_id}",PUT:"*/{course_id}"},query, form:{_
search_slim:{},
switch_to_assistant: { url: "{course_id}/*", query ,config},
switch_to_student:{url:"{course_id}/*",query, config},
- switch_to_teacher:{url:"{course_id}/*",query, config}
+ switch_to_teacher:{url:"{course_id}/*",query, config},
+ work_score:{url:"{course_id}/*",query, form:{limit:20, page:1, sort:"desc"}},
},
course_modules:{
diff --git a/miniprogram/js/edu.js b/miniprogram/js/edu.js
index dfe41fe..c3d64a1 100644
--- a/miniprogram/js/edu.js
+++ b/miniprogram/js/edu.js
@@ -96,6 +96,18 @@ export default function ({ name, data:_data = {}, session, success, fail, comple
url, filePath, name:_name, header, timeout, formData,complete, ...handler({success, fail, resolve, reject})
})
});
+ }else if(method=="downloadFile"){
+ return new Promise((resolve,reject)=>{
+ session.downloadFile({
+ url, header, success:res=>{
+ resolve(res);
+ success&&success(res);
+ }, fail:e=>{
+ reject(e);
+ fail&&fail(e)
+ },complete
+ })
+ })
}else
return new Promise((resolve, reject) => {
session.request({
diff --git a/miniprogram/pages/feedback/feedback.js b/miniprogram/pages/feedback/feedback.js
new file mode 100644
index 0000000..deefddc
--- /dev/null
+++ b/miniprogram/pages/feedback/feedback.js
@@ -0,0 +1,5 @@
+const app = getApp();
+
+Page({
+
+})
\ No newline at end of file
diff --git a/miniprogram/pages/feedback/feedback.json b/miniprogram/pages/feedback/feedback.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/miniprogram/pages/feedback/feedback.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/miniprogram/pages/feedback/feedback.wxml b/miniprogram/pages/feedback/feedback.wxml
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram/pages/feedback/feedback.wxss b/miniprogram/pages/feedback/feedback.wxss
new file mode 100644
index 0000000..284c540
--- /dev/null
+++ b/miniprogram/pages/feedback/feedback.wxss
@@ -0,0 +1 @@
+/* miniprogram/pages/feedback/feedback.wxss */
\ No newline at end of file
diff --git a/miniprogram/pages/home/home.wxml b/miniprogram/pages/home/home.wxml
index 64463bc..33705ab 100644
--- a/miniprogram/pages/home/home.wxml
+++ b/miniprogram/pages/home/home.wxml
@@ -3,14 +3,13 @@
点击登陆,获取更多内容
-
{{user.name}}
-
-
+
+
完善个人信息
diff --git a/miniprogram/shixun_homework/pages/shixun_homework/shixun_homework.js b/miniprogram/shixun_homework/pages/shixun_homework/shixun_homework.js
index 9faaecf..b93f6cb 100644
--- a/miniprogram/shixun_homework/pages/shixun_homework/shixun_homework.js
+++ b/miniprogram/shixun_homework/pages/shixun_homework/shixun_homework.js
@@ -16,7 +16,7 @@ Page({
this.setData(res);
})
.catch(e=>{
- app.showEror(e);
+ app.showError(e);
})
},
enterShixun(){
diff --git a/miniprogram/task/pages/task/task.wxml b/miniprogram/task/pages/task/task.wxml
index e21da7c..30a36ef 100644
--- a/miniprogram/task/pages/task/task.wxml
+++ b/miniprogram/task/pages/task/task.wxml
@@ -11,11 +11,15 @@
diff --git a/project.config.json b/project.config.json
index 7dfed1f..21a17e3 100644
--- a/project.config.json
+++ b/project.config.json
@@ -26,10 +26,11 @@
"disablePlugins": [],
"outputPath": ""
},
- "bundle": false
+ "bundle": false,
+ "skeletonGenerateFilesWithoutConfirm": true
},
"compileType": "miniprogram",
- "libVersion": "2.10.3",
+ "libVersion": "2.2.1",
"appid": "wxc5c2b711f23f3a1d",
"projectname": "educoder_weapp",
"debugOptions": {
@@ -105,17 +106,10 @@
"scene": null
},
{
- "id": -1,
- "name": "course/pages/course_invite/course_invite",
- "pathName": "course/pages/course_invite/course_invite",
- "query": "",
- "scene": null
- },
- {
- "id": -1,
+ "id": 7,
"name": "course/pages/course/course",
"pathName": "course/pages/course/course",
- "query": "course_id=5141",
+ "query": "course_id=6708",
"scene": null
},
{