From 5ffaf9ec412b7871d3ce4362adf11f43f23ca27b Mon Sep 17 00:00:00 2001 From: educoder_weapp Date: Fri, 17 Apr 2020 12:46:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E7=95=8C=E9=9D=A2=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E4=BD=BF=E7=94=A8we-ui?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.txt => changelog.md | 4 +- miniprogram/app.js | 3 - miniprogram/app.json | 9 + .../components/course-item/course-item.json | 3 +- .../components/course-item/course-item.wxml | 4 +- miniprogram/components/course-item/more.png | Bin 457 -> 0 bytes .../modal/join-course/join-course.js | 16 +- .../modal/join-course/join-course.json | 4 +- .../modal/join-course/join-course.wxml | 26 +- .../course/components/file-item/file-item.js | 1 + miniprogram/course/images/more.png | Bin 733 -> 0 bytes miniprogram/course/images/navigateback.png | Bin 1378 -> 0 bytes miniprogram/course/images/relaunch.png | Bin 1456 -> 0 bytes miniprogram/course/images/svg/activity.svg | 1 + .../course/images/svg/activity_select.svg | 1 + .../course/images/svg/announcement.svg | 1 + .../course/images/svg/announcement_select.svg | 1 + miniprogram/course/images/svg/attachment.svg | 1 + .../course/images/svg/attachment_select.svg | 1 + miniprogram/course/images/svg/attendance.svg | 1 + .../course/images/svg/attendance_select.svg | 1 + miniprogram/course/images/svg/board.svg | 1 + .../course/images/svg/board_select.svg | 1 + .../course/images/svg/common_homework.svg | 1 + .../images/svg/common_homework_select.svg | 1 + .../course/images/svg/course_group.svg | 1 + .../course/images/svg/course_group_select.svg | 1 + miniprogram/course/images/svg/exercise.svg | 1 + .../course/images/svg/exercise_select.svg | 1 + miniprogram/course/images/svg/graduation.svg | 1 + .../course/images/svg/graduation_select.svg | 1 + .../course/images/svg/group_homework.svg | 1 + .../images/svg/group_homework_select.svg | 1 + miniprogram/course/images/svg/module.svg | 1 + .../course/images/svg/module_select.svg | 1 + miniprogram/course/images/svg/poll.svg | 1 + miniprogram/course/images/svg/poll_select.svg | 1 + .../course/images/svg/shixun_homework.svg | 1 + .../images/svg/shixun_homework_select.svg | 1 + miniprogram/course/images/svg/statistics.svg | 1 + .../course/images/svg/statistics_select.svg | 1 + miniprogram/course/images/svg/video.svg | 1 + .../course/images/svg/video_select.svg | 1 + .../course/modules/activity/activity.wxml | 4 +- .../course/modules/activity/activity.wxss | 3 + .../activity_group/activity_group.wxml | 2 +- miniprogram/course/pages/course/course.js | 439 ++++++++++++------ miniprogram/course/pages/course/course.json | 7 +- miniprogram/course/pages/course/course.wxml | 134 +++--- miniprogram/course/pages/course/course.wxs | 81 +--- miniprogram/course/pages/course/course.wxss | 85 ++-- .../pages/course_invite/course_invite.js | 32 +- miniprogram/dev/pages/dev/dev.wxml | 2 + miniprogram/js/apiConfig.js | 6 +- miniprogram/js/edu.js | 12 + miniprogram/pages/feedback/feedback.js | 5 + miniprogram/pages/feedback/feedback.json | 3 + miniprogram/pages/feedback/feedback.wxml | 0 miniprogram/pages/feedback/feedback.wxss | 1 + miniprogram/pages/home/home.wxml | 5 +- .../pages/shixun_homework/shixun_homework.js | 2 +- miniprogram/task/pages/task/task.wxml | 8 +- project.config.json | 16 +- 63 files changed, 554 insertions(+), 393 deletions(-) rename changelog.txt => changelog.md (98%) delete mode 100644 miniprogram/components/course-item/more.png delete mode 100644 miniprogram/course/images/more.png delete mode 100644 miniprogram/course/images/navigateback.png delete mode 100644 miniprogram/course/images/relaunch.png create mode 100644 miniprogram/course/images/svg/activity.svg create mode 100644 miniprogram/course/images/svg/activity_select.svg create mode 100644 miniprogram/course/images/svg/announcement.svg create mode 100644 miniprogram/course/images/svg/announcement_select.svg create mode 100644 miniprogram/course/images/svg/attachment.svg create mode 100644 miniprogram/course/images/svg/attachment_select.svg create mode 100644 miniprogram/course/images/svg/attendance.svg create mode 100644 miniprogram/course/images/svg/attendance_select.svg create mode 100644 miniprogram/course/images/svg/board.svg create mode 100644 miniprogram/course/images/svg/board_select.svg create mode 100644 miniprogram/course/images/svg/common_homework.svg create mode 100644 miniprogram/course/images/svg/common_homework_select.svg create mode 100644 miniprogram/course/images/svg/course_group.svg create mode 100644 miniprogram/course/images/svg/course_group_select.svg create mode 100644 miniprogram/course/images/svg/exercise.svg create mode 100644 miniprogram/course/images/svg/exercise_select.svg create mode 100644 miniprogram/course/images/svg/graduation.svg create mode 100644 miniprogram/course/images/svg/graduation_select.svg create mode 100644 miniprogram/course/images/svg/group_homework.svg create mode 100644 miniprogram/course/images/svg/group_homework_select.svg create mode 100644 miniprogram/course/images/svg/module.svg create mode 100644 miniprogram/course/images/svg/module_select.svg create mode 100644 miniprogram/course/images/svg/poll.svg create mode 100644 miniprogram/course/images/svg/poll_select.svg create mode 100644 miniprogram/course/images/svg/shixun_homework.svg create mode 100644 miniprogram/course/images/svg/shixun_homework_select.svg create mode 100644 miniprogram/course/images/svg/statistics.svg create mode 100644 miniprogram/course/images/svg/statistics_select.svg create mode 100644 miniprogram/course/images/svg/video.svg create mode 100644 miniprogram/course/images/svg/video_select.svg create mode 100644 miniprogram/pages/feedback/feedback.js create mode 100644 miniprogram/pages/feedback/feedback.json create mode 100644 miniprogram/pages/feedback/feedback.wxml create mode 100644 miniprogram/pages/feedback/feedback.wxss 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 892de1593118d467469bb791c81a4094280f134d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 457 zcmV;)0XF`LP)`5X}4xU^tK23Sh0hB%=9@E-sW(i_N+*W?Bewlhf_2QtG<- zjG3ARq?B7>7#=wRx-wk@FGMuZ4hHb1wT>MF zYeI;|ulluw5F1ex9XnyWGF<~_09G;r9B8d~oUXiRP)hj}MbUkh zl_W{}f*@GvI)-^O{NHtd6?+5TfH&X`^xVJ~`@+Z}8gS8z00000NkvXXu0mjfwLrwV 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 127fd7a1ea754b73f2dce0e58791455a7429dd86..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 733 zcmV<30wVp1P)3CQk-DSl3NO@{J|a0AA*2?onS~HBv8?T zu!SlbSQ$Ps0j1O_L|g%Y+k?TN({8tardR9rddpE1ov+LyrvWo>Nhw#e$}$Bgr7j@i zg9P9P5nW3*&{|&wfc3h`C;C4nqBH6BG6iU@UjV@AMDaHw5-9;)0BFrozz-tY<0Zft zbDf!!k-Z_J<4LeF<`pxaoTGpa5gqjsptU}Ri0jOJ003Sx^K&WXMjEV?x`T+9<{+YD ztzBz2n;kC!+eL94FJ^(}K-hbUa1MA|Ra0R|peAFz+lBFr(3EYtrX@(kO8Y0IvLAuG7a>xmmYMHL zDKF<9WZiCeccanx3IMydi<$Ypl=5O~7J3T+i&aP!!7}q_DdoOd3V06yhl`M?Qj3Tm zg%AgG1-JsOb?z4G_xp#ewJwE)D#U!T%)FNMPf+P4c8j~0-Iqk!x@q%RI0wqQIxAdA zU{+3+?Gq9x>)fnxQxkBrju7I@w8j3*&!|#r6%pNqRSOXx0l-Zm#HXYXW6TL=zBjL{ zl|l!Z*7}bzAq#AbdC1I#C(*K72NB;1A&%sZ5^mctv%9oPKAS|eluAG`GnFM&0{5MW z_T~z31!;E?aY+cVnVLq=0>G0JL`p%jCSunp^CdRM>~~j-&S7iqvq`f^9LEb$6#X@$ zmtr^tG#-yTg??yeO`y(x;UKHiU7y||0Uwv@tO*I!>8?-jkbsX%b=Ld>-h~f9&h-BJ P00000NkvXXu0mjfese<$ diff --git a/miniprogram/course/images/navigateback.png b/miniprogram/course/images/navigateback.png deleted file mode 100644 index 8ae910b9099e2670b9e8652503f9bd63eb1595e6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1378 zcmV-o1)chdP)W?!hEj5OCpkpC;`CSpL5Q?O(QfW0Z~eAC!%{0@j(FS zi->iNh$a#7E6(|s5q%rxkp+~?TP~M7RTJWd@e3uuah&_L)^BD-yp^aC!Wi3c+xBOjM06A&rQD5( zCp!UU@tlbE2qE5Yhuv0yl=68*d_4w>-iC;yL^K@6 zx7mg<_M&B3hwI-p1eg`JQmIU5kn24n+AD-uk&301n-TGHQ~_p<$mjDL>nnCcfa|)? zXszFl3fRH^4*=N9IX~ZOH$OjbS1J`1Cmv&L%(ATG#ketHFC-yPM1Oa6b!{sai$D3{WVIn=jNOe&DUA3hE{0p0FW0C1X!HpRpa<2Hd($_t1%6vn#6Wb#7k@h~G=WQyLO5X*Lf0i+JEHsN`hBHRM0s!0? z0p}ae`C!0g9Y@5+B48yo{U?rqX#m*5Isdmcx~UBz;v^B-NtuQ8UltJg6*4Icc00|E=}is5y8+m1Q8FU z1Z+wl`#9$_0k71%=7^az77-m4LL97*z;*yIOMhC|pIYmEy}i9>14N7vQPQH>y{0Um z<&n~G58N*)rA&%7sW#5F@CW zRw|Wd>jWLgIY2~5!Vqq@2`sDBMj^Ap76AMO0Ovf_GR?bqKLSXwmRrW->L{Q#u?Mu)6KmD@FpUhx*sj)YjNcpz zC7_;SuiHj#L8 k!x)>gENiM0W|-&y1D>XIe$`C(jQ{`u07*qoM6N<$g4n5qv;Y7A diff --git a/miniprogram/course/images/relaunch.png b/miniprogram/course/images/relaunch.png deleted file mode 100644 index a2943a0d270a39f0f3887b25022f10b45f066deb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1456 zcmV;h1yA~kP);&hsau$N zIRM;-h!?wPGV>n*Z~_sJ6VaD0zV&P~0~L$KE<}735!bpxG)mgQG4mm2-XDhHKUv_M zfd&Q!=FOi!-+(;A%udy?O%M?c*lWYX!~6UC`bKU2D&5+}IEtb*h`0>^u5j^d!S-in zepX8Pv8{$RkW%V#0C>q(I8Qsz^BxF-;2j%HE1)QfUPi=CHi9!~vxSIWOw&&VilXRL zUJrd*G8Wg55Yg&pc1?klQVIZsMWER<`HYCnE23^|2&A<>&dj&ZW~L6Y-XfxhtlvXg z>!+A`r$c~QH$}wlLWt*U15c|^6h$i#@z@Mx_zeKukf$y)uar{uPu83Uq?Gys0G8$% z7!mIlLLAmw-^I*_bJRXbM7K5s8h>$qkYhk#=6j@+A67NGL`}JIesjnU;jb^$kR1UFn>lMn*%-f}u z)8W^9oKYscbgs18E;zaZOr_f zO(4(n9y6odZbaN=<515A5qAqA_GI<1=ckn7EP9Bz+EmC?XWER|R&XY|U{)XixE_ne z;u7EYzqbXbwX*>#7K;-r)i4ar%C%|B3REZ*78{^0-}ld^1!;6W4M-{Vb?wrdh|+eO zGIhB^p>S?RSZn<|GxueIvH+TvTpY(YHmg*Y3L)Zv5aN<5&@N`qG!(ZBP&JPVP`O-Q zk|ar{=crwPJkPs22!bCb`f}E8*A76{?q-TJc?oX5ESN70POTk)0AL>xRi|!20#ahXhSvUDenWNlyjBZ0BE8* z(<+p)N+%IpahU*Rq#PsZL#>QmJ&g=XvJy`URGvb7IEKQIaIf z!Z7@GasqXyAX@8n%xrs?<^%`;?j)j5YJ)eNQz@m)#>bYq$~GnL#MZAhkTHy+=olid zXeTIUenLvwaKV@Q(O4;E_70wG2Pn_;)&xQDQL|i9fyOI!GXR)soij&ZgTC*t?CI(G zB`v-ckP#Ug8oDr!<5vJ+S(<2`*O|G0baZrmZ*Q;pn2_46fvQSc>#fYZ6##lt)mt+d zLd3m7h`lZ{&Ok \ 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}} - - - - + + + + + + + + {{course.name}}{{module_name}} + + + + + + + {{course.teacher_name}} + {{course.teacher_school}} + + + 教师{{course.teacher_count}} + | + 学生{{course.student_count}} + + | + 学分{{course.credit}} + + + + + + + + + + + + + 邀请成员 + + + | + + + 邀请码: + {{course.code_halt?'已停用':course.invite_code}} + + + + + + + + + + + + - - - - - - - - {{course.name}}{{module_name}} - - - - - - - {{course.teacher_name}} - {{course.teacher_school}} - - - 教师{{course.teacher_count}} - | - 学生{{course.student_count}} - - | - 学分{{course.credit}} - - - - - - - - - - - - - 邀请成员 - - | - - - 邀请码: - {{course.code_halt?'已停用':course.invite_code}} - - - - - - - - - - - - - + - - -