From 57aa083a00eddf85aea9f0494ea4db30969e3a77 Mon Sep 17 00:00:00 2001 From: educoder_weapp Date: Mon, 27 Apr 2020 01:39:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=BC=96=E8=BE=91=E5=99=A8?= =?UTF-8?q?=E6=94=B9=E7=94=A8editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .wechatide/fileCache.cfg | 1 + changelog.md | 12 ++ cloudfunctions/callback/config.json | 7 - cloudfunctions/callback/index.js | 26 ---- cloudfunctions/callback/package.json | 14 -- cloudfunctions/echo/config.json | 5 - cloudfunctions/echo/index.js | 8 -- cloudfunctions/echo/package.json | 14 -- cloudfunctions/openapi/config.json | 9 +- cloudfunctions/openapi/index.js | 63 +++------ miniprogram/account/pages/account/account.js | 8 +- .../account/pages/agreement/agreement.json | 3 +- .../change_password/change_password.wxss | 2 +- .../profile/add-department/add-department.js | 77 +++++++++++ .../add-department/add-department.json | 6 + .../add-department/add-department.wxml | 19 +++ .../add-department/add-department.wxss | 24 ++++ miniprogram/account/pages/profile/profile.js | 17 ++- .../account/pages/profile/profile.json | 4 +- .../account/pages/profile/profile.wxml | 6 +- .../account/pages/profile/profile.wxss | 3 + .../school_select/school-item/school-item.js | 26 ++-- .../school-item/school-item.json | 1 + .../school-item/school-item.wxml | 6 +- miniprogram/app.js | 14 ++ miniprogram/components/iconfont/iconfont.wxss | 14 +- miniprogram/components/nav-bar/nav-bar.wxss | 1 + miniprogram/config.js | 5 +- .../attendance_detail/attendance_detail.js | 4 +- .../pages/course_invite/course_invite.js | 4 +- .../exercise/pages/exercise/exercise.wxml | 4 +- miniprogram/js/apiConfig.js | 6 +- miniprogram/pages/home/home.js | 1 + miniprogram/pages/home/home.wxml | 10 +- miniprogram/pages/home/home.wxss | 4 + .../pages/main/my_course/my_course.json | 3 +- .../pages/main/my_course/my_course.wxml | 11 +- .../pages/main/my_course/my_course.wxss | 32 +++-- miniprogram/pages/search/search.js | 1 + .../task/components/test_set/test_set.wxss | 14 +- miniprogram/task/pages/task/task.js | 121 ++++++++++++------ miniprogram/task/pages/task/task.wxml | 15 ++- miniprogram/task/pages/task/task.wxss | 4 +- project.config.json | 9 +- 44 files changed, 402 insertions(+), 236 deletions(-) create mode 100644 .wechatide/fileCache.cfg delete mode 100644 cloudfunctions/callback/config.json delete mode 100644 cloudfunctions/callback/index.js delete mode 100644 cloudfunctions/callback/package.json delete mode 100644 cloudfunctions/echo/config.json delete mode 100644 cloudfunctions/echo/index.js delete mode 100644 cloudfunctions/echo/package.json create mode 100644 miniprogram/account/pages/profile/add-department/add-department.js create mode 100644 miniprogram/account/pages/profile/add-department/add-department.json create mode 100644 miniprogram/account/pages/profile/add-department/add-department.wxml create mode 100644 miniprogram/account/pages/profile/add-department/add-department.wxss diff --git a/.wechatide/fileCache.cfg b/.wechatide/fileCache.cfg new file mode 100644 index 0000000..d36da47 --- /dev/null +++ b/.wechatide/fileCache.cfg @@ -0,0 +1 @@ +{"folderInfo":{"./":{"mtimeMs":1587444627376.354,"children":[".gitignore","changelog.md","LICENSE","project.config.json","README.md"]},".idea/":{"mtimeMs":1584346902957.109,"children":[".idea/1st-ws.iml",".idea/misc.xml",".idea/modules.xml",".idea/vcs.xml",".idea/workspace.xml"]},"api_docs/":{"mtimeMs":1585141231030.4446,"children":["api_docs/course.md","api_docs/exercise.md","api_docs/iconfont.svg","api_docs/iconfont.ttf","api_docs/iconfont1.css","api_docs/iconfont1.woff2","api_docs/incofont1.svg","api_docs/shixun-homework.md"]},"api_docs/edu/":{"mtimeMs":1584346874965.878,"children":["api_docs/edu/19.448f2d0e.chunk.js","api_docs/edu/19.448f2d0e.chunk_beautify.js","api_docs/edu/8.7432e3f2.chunk.js","api_docs/edu/js_min_all.js","api_docs/edu/main.709dacb3.js","api_docs/edu/main.709dacb3___.js","api_docs/edu/main_yasuo.js","api_docs/edu/my.js","api_docs/edu/myclass.js","api_docs/edu/myclassyasuo.js","api_docs/edu/new 1.js","api_docs/edu/out.js","api_docs/edu/quill.core.min.js","api_docs/edu/re.js","api_docs/edu/relist.js","api_docs/edu/疑似代码.js"]},"api_docs/iconfont-svgs/":{"mtimeMs":1585140551559.6,"children":["api_docs/iconfont-svgs/tmplate.svg"]},"api_docs/其他/":{"mtimeMs":1584696037514.8071,"children":["api_docs/其他/course-docs.md","api_docs/其他/css_min_all.css","api_docs/其他/editor.js","api_docs/其他/edu-all.css","api_docs/其他/edu-common.css","api_docs/其他/edu-main.css","api_docs/其他/educoder服务条款.txt","api_docs/其他/exercise.md","api_docs/其他/package-lock.json","api_docs/其他/ui-docs.md","api_docs/其他/user-docs.md"]},"api_docs/网站UI分析/":{"mtimeMs":1575092250831.5244,"children":[]},"api_docs/网站分析新/":{"mtimeMs":1584980339656.571,"children":[]},"api_docs/网站分析新/profile/":{"mtimeMs":1584980946651.4026,"children":["api_docs/网站分析新/profile/chunk.js","api_docs/网站分析新/profile/main.11ee1fd2.js"]},"cloudfunctions/":{"mtimeMs":1584281289523.451,"children":[]},"cloudfunctions/callback/":{"mtimeMs":1584281289522.428,"children":["cloudfunctions/callback/config.json","cloudfunctions/callback/index.js","cloudfunctions/callback/package.json"]},"cloudfunctions/echo/":{"mtimeMs":1584281289522.428,"children":["cloudfunctions/echo/config.json","cloudfunctions/echo/index.js","cloudfunctions/echo/package.json"]},"cloudfunctions/login/":{"mtimeMs":1584281289522.428,"children":["cloudfunctions/login/config.json","cloudfunctions/login/index.js","cloudfunctions/login/package.json"]},"cloudfunctions/openapi/":{"mtimeMs":1584281289523.451,"children":["cloudfunctions/openapi/config.json","cloudfunctions/openapi/index.js","cloudfunctions/openapi/package.json"]},"docs/":{"mtimeMs":1585890582057.6953,"children":[]},"images/":{"mtimeMs":1584281289524.4224,"children":["images/wxacode.jpg"]},"miniprogram/":{"mtimeMs":1584871155166.5127,"children":["miniprogram/.gitignore","miniprogram/app.js","miniprogram/app.json","miniprogram/app.wxss","miniprogram/config.js","miniprogram/sitemap.json"]},"miniprogram/account/":{"mtimeMs":1584281289524.4224,"children":[]},"miniprogram/account/pages/":{"mtimeMs":1586002272052.7378,"children":["miniprogram/account/pages/form-item-common.wxss"]},"miniprogram/account/pages/about/":{"mtimeMs":1584281289524.4224,"children":["miniprogram/account/pages/about/about.js","miniprogram/account/pages/about/about.json","miniprogram/account/pages/about/about.wxml","miniprogram/account/pages/about/about.wxss"]},"miniprogram/account/pages/account/":{"mtimeMs":1584281289525.4194,"children":["miniprogram/account/pages/account/account.js","miniprogram/account/pages/account/account.json","miniprogram/account/pages/account/account.wxml","miniprogram/account/pages/account/account.wxss"]},"miniprogram/account/pages/accounts/":{"mtimeMs":1585563793591.0408,"children":["miniprogram/account/pages/accounts/accounts.js","miniprogram/account/pages/accounts/accounts.json","miniprogram/account/pages/accounts/accounts.wxml","miniprogram/account/pages/accounts/accounts.wxss"]},"miniprogram/account/pages/agreement/":{"mtimeMs":1584281289525.4194,"children":["miniprogram/account/pages/agreement/agreement.js","miniprogram/account/pages/agreement/agreement.json","miniprogram/account/pages/agreement/agreement.wxml","miniprogram/account/pages/agreement/agreement.wxss"]},"miniprogram/account/pages/authentication/":{"mtimeMs":1585128597808.2778,"children":["miniprogram/account/pages/authentication/authentication.js","miniprogram/account/pages/authentication/authentication.json","miniprogram/account/pages/authentication/authentication.wxml","miniprogram/account/pages/authentication/authentication.wxss"]},"miniprogram/account/pages/change_password/":{"mtimeMs":1584281289526.4414,"children":["miniprogram/account/pages/change_password/change_password.js","miniprogram/account/pages/change_password/change_password.json","miniprogram/account/pages/change_password/change_password.wxml","miniprogram/account/pages/change_password/change_password.wxss"]},"miniprogram/account/pages/profile/":{"mtimeMs":1585220755637.4944,"children":["miniprogram/account/pages/profile/data.js","miniprogram/account/pages/profile/profile.js","miniprogram/account/pages/profile/profile.json","miniprogram/account/pages/profile/profile.wxml","miniprogram/account/pages/profile/profile.wxss"]},"miniprogram/account/pages/profile/school_select/":{"mtimeMs":1585050064610.6982,"children":["miniprogram/account/pages/profile/school_select/school_select.js","miniprogram/account/pages/profile/school_select/school_select.json","miniprogram/account/pages/profile/school_select/school_select.wxml","miniprogram/account/pages/profile/school_select/school_select.wxss"]},"miniprogram/account/pages/profile/school_select/school-item/":{"mtimeMs":1585050072370.5413,"children":["miniprogram/account/pages/profile/school_select/school-item/school-item.js","miniprogram/account/pages/profile/school_select/school-item/school-item.json","miniprogram/account/pages/profile/school_select/school-item/school-item.wxml","miniprogram/account/pages/profile/school_select/school-item/school-item.wxss"]},"miniprogram/account/pages/pro_authentication/":{"mtimeMs":1585356500645.886,"children":["miniprogram/account/pages/pro_authentication/pro_authentication.js","miniprogram/account/pages/pro_authentication/pro_authentication.json","miniprogram/account/pages/pro_authentication/pro_authentication.wxml","miniprogram/account/pages/pro_authentication/pro_authentication.wxss"]},"miniprogram/account/pages/user_info/":{"mtimeMs":1585803692413.5227,"children":["miniprogram/account/pages/user_info/user_info.js","miniprogram/account/pages/user_info/user_info.json","miniprogram/account/pages/user_info/user_info.wxml","miniprogram/account/pages/user_info/user_info.wxss"]},"miniprogram/avatar/":{"mtimeMs":1584281289533.4338,"children":["miniprogram/avatar/.gitignore"]},"miniprogram/avatar/pages/":{"mtimeMs":1584281289532.4502,"children":[]},"miniprogram/avatar/pages/image_crop/":{"mtimeMs":1584281289533.4338,"children":["miniprogram/avatar/pages/image_crop/image_crop.js","miniprogram/avatar/pages/image_crop/image_crop.json","miniprogram/avatar/pages/image_crop/image_crop.wxml","miniprogram/avatar/pages/image_crop/image_crop.wxss"]},"miniprogram/avatar/we-cropper/":{"mtimeMs":1584281289533.4338,"children":[]},"miniprogram/avatar/we-cropper/dist/":{"mtimeMs":1584281289534.4363,"children":["miniprogram/avatar/we-cropper/dist/we-cropper.min.js","miniprogram/avatar/we-cropper/dist/we-cropper.wxml"]},"miniprogram/common-homework/":{"mtimeMs":1584281289534.4363,"children":[]},"miniprogram/common-homework/pages/":{"mtimeMs":1584281289534.4363,"children":[]},"miniprogram/common-homework/pages/common-homework/":{"mtimeMs":1584281289536.431,"children":["miniprogram/common-homework/pages/common-homework/common-homework.js","miniprogram/common-homework/pages/common-homework/common-homework.json","miniprogram/common-homework/pages/common-homework/common-homework.wxml","miniprogram/common-homework/pages/common-homework/common-homework.wxss"]},"miniprogram/components/":{"mtimeMs":1586001680637.6416,"children":[]},"miniprogram/components/add-tips/":{"mtimeMs":1584281289537.4546,"children":["miniprogram/components/add-tips/add-tips.js","miniprogram/components/add-tips/add-tips.json","miniprogram/components/add-tips/add-tips.wxml","miniprogram/components/add-tips/add-tips.wxss"]},"miniprogram/components/course-item/":{"mtimeMs":1587095538759.4492,"children":["miniprogram/components/course-item/course-item.js","miniprogram/components/course-item/course-item.json","miniprogram/components/course-item/course-item.wxml","miniprogram/components/course-item/course-item.wxss"]},"miniprogram/components/error-page/":{"mtimeMs":1584281289540.5007,"children":["miniprogram/components/error-page/error-page.js","miniprogram/components/error-page/error-page.json","miniprogram/components/error-page/error-page.wxml","miniprogram/components/error-page/error-page.wxss"]},"miniprogram/components/head-tip/":{"mtimeMs":1586001686734.024,"children":["miniprogram/components/head-tip/head-tip.js","miniprogram/components/head-tip/head-tip.json","miniprogram/components/head-tip/head-tip.wxml","miniprogram/components/head-tip/head-tip.wxss"]},"miniprogram/components/iconfont/":{"mtimeMs":1585138575546.678,"children":["miniprogram/components/iconfont/iconfont.js","miniprogram/components/iconfont/iconfont.json","miniprogram/components/iconfont/iconfont.wxml","miniprogram/components/iconfont/iconfont.wxss"]},"miniprogram/components/modal/":{"mtimeMs":1584281289541.4177,"children":[]},"miniprogram/components/modal/join-course/":{"mtimeMs":1584281289542.4087,"children":["miniprogram/components/modal/join-course/join-course.js","miniprogram/components/modal/join-course/join-course.json","miniprogram/components/modal/join-course/join-course.wxml","miniprogram/components/modal/join-course/join-course.wxss","miniprogram/components/modal/join-course/scan.png"]},"miniprogram/components/nav-bar/":{"mtimeMs":1584281289543.4336,"children":["miniprogram/components/nav-bar/nav-bar.js","miniprogram/components/nav-bar/nav-bar.json","miniprogram/components/nav-bar/nav-bar.wxml","miniprogram/components/nav-bar/nav-bar.wxss"]},"miniprogram/components/require-login/":{"mtimeMs":1584281289544.4104,"children":["miniprogram/components/require-login/require-login.js","miniprogram/components/require-login/require-login.json","miniprogram/components/require-login/require-login.wxml","miniprogram/components/require-login/require-login.wxss"]},"miniprogram/components/rich-md/":{"mtimeMs":1584281289546.4104,"children":["miniprogram/components/rich-md/rich-md.js","miniprogram/components/rich-md/rich-md.json","miniprogram/components/rich-md/rich-md.wxml","miniprogram/components/rich-md/rich-md.wxss"]},"miniprogram/components/shixun-item/":{"mtimeMs":1584281289547.0115,"children":["miniprogram/components/shixun-item/shixun-item.js","miniprogram/components/shixun-item/shixun-item.json","miniprogram/components/shixun-item/shixun-item.wxml","miniprogram/components/shixun-item/shixun-item.wxss"]},"miniprogram/components/tiding-item/":{"mtimeMs":1584281289547.402,"children":["miniprogram/components/tiding-item/tiding-item.js","miniprogram/components/tiding-item/tiding-item.json","miniprogram/components/tiding-item/tiding-item.wxml","miniprogram/components/tiding-item/tiding-item.wxss"]},"miniprogram/course/":{"mtimeMs":1585538819567.514,"children":[]},"miniprogram/course/components/":{"mtimeMs":1587373915232.765,"children":[]},"miniprogram/course/components/common-homework-item/":{"mtimeMs":1584281289549.4048,"children":["miniprogram/course/components/common-homework-item/common-homework-item.js","miniprogram/course/components/common-homework-item/common-homework-item.json","miniprogram/course/components/common-homework-item/common-homework-item.wxml","miniprogram/course/components/common-homework-item/common-homework-item.wxss"]},"miniprogram/course/components/file-item/":{"mtimeMs":1584281289550.423,"children":["miniprogram/course/components/file-item/file-item.js","miniprogram/course/components/file-item/file-item.json","miniprogram/course/components/file-item/file-item.wxml","miniprogram/course/components/file-item/file-item.wxss"]},"miniprogram/course/components/muti-progress/":{"mtimeMs":1587373926639.0586,"children":["miniprogram/course/components/muti-progress/muti-progress.js","miniprogram/course/components/muti-progress/muti-progress.json","miniprogram/course/components/muti-progress/muti-progress.wxml","miniprogram/course/components/muti-progress/muti-progress.wxss"]},"miniprogram/course/images/":{"mtimeMs":1587094770270.771,"children":[]},"miniprogram/course/images/svg/":{"mtimeMs":1587095228170.2573,"children":["miniprogram/course/images/svg/activity.svg","miniprogram/course/images/svg/activity_select.svg","miniprogram/course/images/svg/announcement.svg","miniprogram/course/images/svg/announcement_select.svg","miniprogram/course/images/svg/attachment.svg","miniprogram/course/images/svg/attachment_select.svg","miniprogram/course/images/svg/attendance.svg","miniprogram/course/images/svg/attendance_select.svg","miniprogram/course/images/svg/board.svg","miniprogram/course/images/svg/board_select.svg","miniprogram/course/images/svg/common_homework.svg","miniprogram/course/images/svg/common_homework_select.svg","miniprogram/course/images/svg/course_group.svg","miniprogram/course/images/svg/course_group_select.svg","miniprogram/course/images/svg/exercise.svg","miniprogram/course/images/svg/exercise_select.svg","miniprogram/course/images/svg/graduation.svg","miniprogram/course/images/svg/graduation_select.svg","miniprogram/course/images/svg/group_homework.svg","miniprogram/course/images/svg/group_homework_select.svg","miniprogram/course/images/svg/module.svg","miniprogram/course/images/svg/module_select.svg","miniprogram/course/images/svg/poll.svg","miniprogram/course/images/svg/poll_select.svg","miniprogram/course/images/svg/shixun_homework.svg","miniprogram/course/images/svg/shixun_homework_select.svg","miniprogram/course/images/svg/statistics.svg","miniprogram/course/images/svg/statistics_select.svg","miniprogram/course/images/svg/video.svg","miniprogram/course/images/svg/video_select.svg"]},"miniprogram/course/modules/":{"mtimeMs":1584802737125.6274,"children":[]},"miniprogram/course/modules/activity/":{"mtimeMs":1584625814868.449,"children":["miniprogram/course/modules/activity/activity.js","miniprogram/course/modules/activity/activity.json","miniprogram/course/modules/activity/activity.wxml","miniprogram/course/modules/activity/activity.wxss"]},"miniprogram/course/modules/activity/activity_group/":{"mtimeMs":1584625801862.0017,"children":["miniprogram/course/modules/activity/activity_group/activity_group.js","miniprogram/course/modules/activity/activity_group/activity_group.json","miniprogram/course/modules/activity/activity_group/activity_group.wxml","miniprogram/course/modules/activity/activity_group/activity_group.wxss"]},"miniprogram/course/modules/activity/activity_item/":{"mtimeMs":1584625821364.382,"children":["miniprogram/course/modules/activity/activity_item/activity_item.js","miniprogram/course/modules/activity/activity_item/activity_item.json","miniprogram/course/modules/activity/activity_item/activity_item.wxml","miniprogram/course/modules/activity/activity_item/activity_item.wxss"]},"miniprogram/course/modules/attachment/":{"mtimeMs":1584281289551.5122,"children":["miniprogram/course/modules/attachment/attachment.js","miniprogram/course/modules/attachment/attachment.json","miniprogram/course/modules/attachment/attachment.wxml","miniprogram/course/modules/attachment/attachment.wxss"]},"miniprogram/course/modules/attendance/":{"mtimeMs":1585547975408.079,"children":["miniprogram/course/modules/attendance/attendance.js","miniprogram/course/modules/attendance/attendance.json","miniprogram/course/modules/attendance/attendance.wxml","miniprogram/course/modules/attendance/attendance.wxss"]},"miniprogram/course/modules/attendance/attendance-cate/":{"mtimeMs":1585547945705.453,"children":[]},"miniprogram/course/modules/attendance/attendance-data/":{"mtimeMs":1585547975373.3914,"children":[]},"miniprogram/course/modules/attendance/attendance-item/":{"mtimeMs":1584804468620.5444,"children":["miniprogram/course/modules/attendance/attendance-item/attendance-item.js","miniprogram/course/modules/attendance/attendance-item/attendance-item.json","miniprogram/course/modules/attendance/attendance-item/attendance-item.wxml","miniprogram/course/modules/attendance/attendance-item/attendance-item.wxss"]},"miniprogram/course/modules/common-homework/":{"mtimeMs":1584281289552.3757,"children":["miniprogram/course/modules/common-homework/common-homework.js","miniprogram/course/modules/common-homework/common-homework.json","miniprogram/course/modules/common-homework/common-homework.wxml","miniprogram/course/modules/common-homework/common-homework.wxss"]},"miniprogram/course/modules/exercise/":{"mtimeMs":1584693748110.7566,"children":["miniprogram/course/modules/exercise/exercise.js","miniprogram/course/modules/exercise/exercise.json","miniprogram/course/modules/exercise/exercise.wxml","miniprogram/course/modules/exercise/exercise.wxss"]},"miniprogram/course/modules/exercise/exercise_item/":{"mtimeMs":1584693754941.9783,"children":["miniprogram/course/modules/exercise/exercise_item/exercise_item.js","miniprogram/course/modules/exercise/exercise_item/exercise_item.json","miniprogram/course/modules/exercise/exercise_item/exercise_item.wxml","miniprogram/course/modules/exercise/exercise_item/exercise_item.wxss"]},"miniprogram/course/modules/shixun_homework/":{"mtimeMs":1584763663824.1714,"children":["miniprogram/course/modules/shixun_homework/shixun_homework.js","miniprogram/course/modules/shixun_homework/shixun_homework.json","miniprogram/course/modules/shixun_homework/shixun_homework.wxml","miniprogram/course/modules/shixun_homework/shixun_homework.wxss"]},"miniprogram/course/modules/shixun_homework/shixun_homework_item/":{"mtimeMs":1584763672022.0962,"children":["miniprogram/course/modules/shixun_homework/shixun_homework_item/shixun_homework_item.js","miniprogram/course/modules/shixun_homework/shixun_homework_item/shixun_homework_item.json","miniprogram/course/modules/shixun_homework/shixun_homework_item/shixun_homework_item.wxml","miniprogram/course/modules/shixun_homework/shixun_homework_item/shixun_homework_item.wxss"]},"miniprogram/course/pages/":{"mtimeMs":1585538724070.4321,"children":[]},"miniprogram/course/pages/attendances/":{"mtimeMs":1585489901386.3079,"children":["miniprogram/course/pages/attendances/attendances.js","miniprogram/course/pages/attendances/attendances.json","miniprogram/course/pages/attendances/attendances.wxml","miniprogram/course/pages/attendances/attendances.wxss"]},"miniprogram/course/pages/attendance_detail/":{"mtimeMs":1585538745769.118,"children":["miniprogram/course/pages/attendance_detail/attendance_detail.js","miniprogram/course/pages/attendance_detail/attendance_detail.json","miniprogram/course/pages/attendance_detail/attendance_detail.wxml","miniprogram/course/pages/attendance_detail/attendance_detail.wxss"]},"miniprogram/course/pages/course/":{"mtimeMs":1586937468808.0232,"children":["miniprogram/course/pages/course/course.js","miniprogram/course/pages/course/course.json","miniprogram/course/pages/course/course.wxml","miniprogram/course/pages/course/course.wxs","miniprogram/course/pages/course/course.wxss"]},"miniprogram/course/pages/course_invite/":{"mtimeMs":1584281289555.413,"children":["miniprogram/course/pages/course_invite/course_invite.js","miniprogram/course/pages/course_invite/course_invite.json","miniprogram/course/pages/course_invite/course_invite.wxml","miniprogram/course/pages/course_invite/course_invite.wxss"]},"miniprogram/course/pages/course_setting/":{"mtimeMs":1584281289555.413,"children":["miniprogram/course/pages/course_setting/course_setting.js","miniprogram/course/pages/course_setting/course_setting.json","miniprogram/course/pages/course_setting/course_setting.wxml","miniprogram/course/pages/course_setting/course_setting.wxss"]},"miniprogram/dev/":{"mtimeMs":1584629927853.075,"children":[]},"miniprogram/dev/pages/":{"mtimeMs":1585138394812.2139,"children":[]},"miniprogram/dev/pages/dev/":{"mtimeMs":1585138398075.5151,"children":["miniprogram/dev/pages/dev/dev.js","miniprogram/dev/pages/dev/dev.json","miniprogram/dev/pages/dev/dev.wxml","miniprogram/dev/pages/dev/dev.wxss"]},"miniprogram/exercise/":{"mtimeMs":1584281289558.3613,"children":[]},"miniprogram/exercise/components/":{"mtimeMs":1585704595659.0427,"children":["miniprogram/exercise/components/question-common.wxss"]},"miniprogram/exercise/components/choice-question/":{"mtimeMs":1584281289556.3765,"children":["miniprogram/exercise/components/choice-question/choice-question.js","miniprogram/exercise/components/choice-question/choice-question.json","miniprogram/exercise/components/choice-question/choice-question.wxml","miniprogram/exercise/components/choice-question/choice-question.wxss"]},"miniprogram/exercise/components/main-question/":{"mtimeMs":1584281289557.389,"children":["miniprogram/exercise/components/main-question/main-question.js","miniprogram/exercise/components/main-question/main-question.json","miniprogram/exercise/components/main-question/main-question.wxml","miniprogram/exercise/components/main-question/main-question.wxss"]},"miniprogram/exercise/components/null-question/":{"mtimeMs":1584281289557.389,"children":["miniprogram/exercise/components/null-question/null-question.js","miniprogram/exercise/components/null-question/null-question.json","miniprogram/exercise/components/null-question/null-question.wxml","miniprogram/exercise/components/null-question/null-question.wxss"]},"miniprogram/exercise/components/shixun-question/":{"mtimeMs":1584281289558.3613,"children":["miniprogram/exercise/components/shixun-question/shixun-question.js","miniprogram/exercise/components/shixun-question/shixun-question.json","miniprogram/exercise/components/shixun-question/shixun-question.wxml","miniprogram/exercise/components/shixun-question/shixun-question.wxss"]},"miniprogram/exercise/pages/":{"mtimeMs":1584692943095.6436,"children":[]},"miniprogram/exercise/pages/exercise/":{"mtimeMs":1584281289559.363,"children":["miniprogram/exercise/pages/exercise/exercise.js","miniprogram/exercise/pages/exercise/exercise.json","miniprogram/exercise/pages/exercise/exercise.wxml","miniprogram/exercise/pages/exercise/exercise.wxss"]},"miniprogram/exercise/pages/exercise_cover/":{"mtimeMs":1584692962727.4126,"children":["miniprogram/exercise/pages/exercise_cover/exercise_cover.js","miniprogram/exercise/pages/exercise_cover/exercise_cover.json","miniprogram/exercise/pages/exercise_cover/exercise_cover.wxml","miniprogram/exercise/pages/exercise_cover/exercise_cover.wxss"]},"miniprogram/exercise/pages/exercise_grade/":{"mtimeMs":1584281289560.4404,"children":["miniprogram/exercise/pages/exercise_grade/exercise_grade.js","miniprogram/exercise/pages/exercise_grade/exercise_grade.json","miniprogram/exercise/pages/exercise_grade/exercise_grade.wxml","miniprogram/exercise/pages/exercise_grade/exercise_grade.wxss"]},"miniprogram/exercise/pages/exercise_result/":{"mtimeMs":1584281289560.4404,"children":["miniprogram/exercise/pages/exercise_result/exercise_result.js","miniprogram/exercise/pages/exercise_result/exercise_result.json","miniprogram/exercise/pages/exercise_result/exercise_result.wxml","miniprogram/exercise/pages/exercise_result/exercise_result.wxss"]},"miniprogram/exercise/pages/exercise_setting/":{"mtimeMs":1584281289561.359,"children":["miniprogram/exercise/pages/exercise_setting/exercise_setting.js","miniprogram/exercise/pages/exercise_setting/exercise_setting.json","miniprogram/exercise/pages/exercise_setting/exercise_setting.wxml","miniprogram/exercise/pages/exercise_setting/exercise_setting.wxss"]},"miniprogram/exercise/pages/question_setting/":{"mtimeMs":1584281289561.359,"children":["miniprogram/exercise/pages/question_setting/question_setting.js","miniprogram/exercise/pages/question_setting/question_setting.json","miniprogram/exercise/pages/question_setting/question_setting.wxml","miniprogram/exercise/pages/question_setting/question_setting.wxss"]},"miniprogram/images/":{"mtimeMs":1587001239832.7078,"children":["miniprogram/images/enter.png","miniprogram/images/tab_findmore_default.png","miniprogram/images/tab_findmore_pressed.png","miniprogram/images/tab_my_default.png","miniprogram/images/tab_my_pressed.png","miniprogram/images/tab_study_default.png","miniprogram/images/tab_study_pressed.png","miniprogram/images/tab_tiding_default.png","miniprogram/images/tab_tiding_pressed.png"]},"miniprogram/js/":{"mtimeMs":1584891837912.788,"children":["miniprogram/js/api.js","miniprogram/js/apiConfig.js","miniprogram/js/client.js","miniprogram/js/edu.js","miniprogram/js/md5.js","miniprogram/js/requests.js","miniprogram/js/utils.js"]},"miniprogram/pages/":{"mtimeMs":1586936208143.9817,"children":[]},"miniprogram/pages/feedback/":{"mtimeMs":1586936215595.0918,"children":["miniprogram/pages/feedback/feedback.js","miniprogram/pages/feedback/feedback.json","miniprogram/pages/feedback/feedback.wxml","miniprogram/pages/feedback/feedback.wxss"]},"miniprogram/pages/findmore/":{"mtimeMs":1584281289565.3484,"children":["miniprogram/pages/findmore/findmore.js","miniprogram/pages/findmore/findmore.json","miniprogram/pages/findmore/findmore.wxml","miniprogram/pages/findmore/findmore.wxss"]},"miniprogram/pages/findmore/shixuns/":{"mtimeMs":1584281289565.3484,"children":["miniprogram/pages/findmore/shixuns/shixuns.js","miniprogram/pages/findmore/shixuns/shixuns.json","miniprogram/pages/findmore/shixuns/shixuns.wxml","miniprogram/pages/findmore/shixuns/shixuns.wxss"]},"miniprogram/pages/home/":{"mtimeMs":1584281289566.343,"children":["miniprogram/pages/home/home.js","miniprogram/pages/home/home.json","miniprogram/pages/home/home.wxml","miniprogram/pages/home/home.wxss"]},"miniprogram/pages/main/":{"mtimeMs":1587269147814.3384,"children":["miniprogram/pages/main/main.js","miniprogram/pages/main/main.json","miniprogram/pages/main/main.wxml","miniprogram/pages/main/main.wxss"]},"miniprogram/pages/main/my_course/":{"mtimeMs":1584281289567.3406,"children":["miniprogram/pages/main/my_course/my_course.js","miniprogram/pages/main/my_course/my_course.json","miniprogram/pages/main/my_course/my_course.wxml","miniprogram/pages/main/my_course/my_course.wxss"]},"miniprogram/pages/main/my_shixun/":{"mtimeMs":1584281289567.3406,"children":["miniprogram/pages/main/my_shixun/my_shixun.js","miniprogram/pages/main/my_shixun/my_shixun.json","miniprogram/pages/main/my_shixun/my_shixun.wxml","miniprogram/pages/main/my_shixun/my_shixun.wxss"]},"miniprogram/pages/search/":{"mtimeMs":1584281289568.3398,"children":["miniprogram/pages/search/search.js","miniprogram/pages/search/search.json","miniprogram/pages/search/search.wxml","miniprogram/pages/search/search.wxss"]},"miniprogram/pages/search/search-item/":{"mtimeMs":1584281289568.3398,"children":["miniprogram/pages/search/search-item/search-item.js","miniprogram/pages/search/search-item/search-item.json","miniprogram/pages/search/search-item/search-item.wxml","miniprogram/pages/search/search-item/search-item.wxss"]},"miniprogram/pages/tidings/":{"mtimeMs":1584281289569.3374,"children":["miniprogram/pages/tidings/tidings.js","miniprogram/pages/tidings/tidings.json","miniprogram/pages/tidings/tidings.wxml","miniprogram/pages/tidings/tidings.wxss"]},"miniprogram/path/":{"mtimeMs":1584281289569.3374,"children":[]},"miniprogram/path/pages/":{"mtimeMs":1584281289569.3374,"children":[]},"miniprogram/path/pages/path/":{"mtimeMs":1584281289570.3323,"children":["miniprogram/path/pages/path/path.js","miniprogram/path/pages/path/path.json","miniprogram/path/pages/path/path.wxml","miniprogram/path/pages/path/path.wxss"]},"miniprogram/shixun/":{"mtimeMs":1584281289570.3323,"children":[]},"miniprogram/shixun/components/":{"mtimeMs":1584281289570.3323,"children":[]},"miniprogram/shixun/components/challenge-item/":{"mtimeMs":1584281289570.3323,"children":["miniprogram/shixun/components/challenge-item/challenge-item.js","miniprogram/shixun/components/challenge-item/challenge-item.json","miniprogram/shixun/components/challenge-item/challenge-item.wxml","miniprogram/shixun/components/challenge-item/challenge-item.wxss"]},"miniprogram/shixun/pages/":{"mtimeMs":1584281289570.3323,"children":[]},"miniprogram/shixun/pages/shixun/":{"mtimeMs":1584281289571.331,"children":["miniprogram/shixun/pages/shixun/shixun.js","miniprogram/shixun/pages/shixun/shixun.json","miniprogram/shixun/pages/shixun/shixun.wxml","miniprogram/shixun/pages/shixun/shixun.wxs","miniprogram/shixun/pages/shixun/shixun.wxss"]},"miniprogram/shixun_homework/":{"mtimeMs":1584718679658.978,"children":[]},"miniprogram/shixun_homework/pages/":{"mtimeMs":1584718747125.219,"children":[]},"miniprogram/shixun_homework/pages/shixun_homework/":{"mtimeMs":1584718794613.04,"children":["miniprogram/shixun_homework/pages/shixun_homework/shixun_homework.js","miniprogram/shixun_homework/pages/shixun_homework/shixun_homework.json","miniprogram/shixun_homework/pages/shixun_homework/shixun_homework.wxml","miniprogram/shixun_homework/pages/shixun_homework/shixun_homework.wxss"]},"miniprogram/task/":{"mtimeMs":1584281289573.3538,"children":[]},"miniprogram/task/components/":{"mtimeMs":1584281289572.2954,"children":[]},"miniprogram/task/components/test_set/":{"mtimeMs":1584281289573.3538,"children":["miniprogram/task/components/test_set/test_set.js","miniprogram/task/components/test_set/test_set.json","miniprogram/task/components/test_set/test_set.wxml","miniprogram/task/components/test_set/test_set.wxs","miniprogram/task/components/test_set/test_set.wxss"]},"miniprogram/task/pages/":{"mtimeMs":1584281289573.3538,"children":[]},"miniprogram/task/pages/task/":{"mtimeMs":1584281289574.322,"children":["miniprogram/task/pages/task/task.js","miniprogram/task/pages/task/task.json","miniprogram/task/pages/task/task.wxml","miniprogram/task/pages/task/task.wxs","miniprogram/task/pages/task/task.wxss"]},"miniprogram/towxml/":{"mtimeMs":1584281289584.264,"children":["miniprogram/towxml/config.js","miniprogram/towxml/decode.js","miniprogram/towxml/decode.json","miniprogram/towxml/decode.wxml","miniprogram/towxml/decode.wxss","miniprogram/towxml/index.js","miniprogram/towxml/towxml.js","miniprogram/towxml/towxml.json","miniprogram/towxml/towxml.wxml","miniprogram/towxml/towxml.wxss"]},"miniprogram/towxml/img/":{"mtimeMs":1584281289575.9924,"children":["miniprogram/towxml/img/img.js","miniprogram/towxml/img/img.json","miniprogram/towxml/img/img.wxml","miniprogram/towxml/img/img.wxss"]},"miniprogram/towxml/latex/":{"mtimeMs":1584281289576.4814,"children":["miniprogram/towxml/latex/latex.js","miniprogram/towxml/latex/latex.json","miniprogram/towxml/latex/latex.wxml","miniprogram/towxml/latex/latex.wxss"]},"miniprogram/towxml/parse/":{"mtimeMs":1584281289580.2761,"children":["miniprogram/towxml/parse/index.js"]},"miniprogram/towxml/parse/highlight/":{"mtimeMs":1584281289578.2798,"children":["miniprogram/towxml/parse/highlight/highlight.js","miniprogram/towxml/parse/highlight/index.js"]},"miniprogram/towxml/parse/highlight/languages/":{"mtimeMs":1584281289578.2798,"children":["miniprogram/towxml/parse/highlight/languages/css.js","miniprogram/towxml/parse/highlight/languages/java.js","miniprogram/towxml/parse/highlight/languages/javascript.js","miniprogram/towxml/parse/highlight/languages/python.js"]},"miniprogram/towxml/parse/highlight/style/":{"mtimeMs":1584281289578.2798,"children":["miniprogram/towxml/parse/highlight/style/github.wxss","miniprogram/towxml/parse/highlight/style/monokai.wxss"]},"miniprogram/towxml/parse/markdown/":{"mtimeMs":1584281289579.941,"children":["miniprogram/towxml/parse/markdown/index.js","miniprogram/towxml/parse/markdown/markdown.js"]},"miniprogram/towxml/parse/markdown/plugins/":{"mtimeMs":1584281289580.2761,"children":["miniprogram/towxml/parse/markdown/plugins/ins.js","miniprogram/towxml/parse/markdown/plugins/latex.js","miniprogram/towxml/parse/markdown/plugins/sub.js","miniprogram/towxml/parse/markdown/plugins/sup.js"]},"miniprogram/towxml/parse/parse2/":{"mtimeMs":1584281289582.269,"children":["miniprogram/towxml/parse/parse2/index.js","miniprogram/towxml/parse/parse2/Parser.js","miniprogram/towxml/parse/parse2/Tokenizer.js"]},"miniprogram/towxml/parse/parse2/domhandler/":{"mtimeMs":1584281289581.3328,"children":["miniprogram/towxml/parse/parse2/domhandler/index.js","miniprogram/towxml/parse/parse2/domhandler/node.js"]},"miniprogram/towxml/parse/parse2/entities/":{"mtimeMs":1584281289581.3328,"children":["miniprogram/towxml/parse/parse2/entities/decode.js","miniprogram/towxml/parse/parse2/entities/decode_codepoint.js","miniprogram/towxml/parse/parse2/entities/encode.js","miniprogram/towxml/parse/parse2/entities/index.js"]},"miniprogram/towxml/parse/parse2/entities/maps/":{"mtimeMs":1584281289582.269,"children":["miniprogram/towxml/parse/parse2/entities/maps/decode.js","miniprogram/towxml/parse/parse2/entities/maps/entities.js","miniprogram/towxml/parse/parse2/entities/maps/legacy.js","miniprogram/towxml/parse/parse2/entities/maps/xml.js"]},"miniprogram/towxml/style/":{"mtimeMs":1584281289582.269,"children":["miniprogram/towxml/style/main.wxss"]},"miniprogram/towxml/style/theme/":{"mtimeMs":1584281289583.2666,"children":["miniprogram/towxml/style/theme/dark.wxss","miniprogram/towxml/style/theme/light.wxss"]},"miniprogram/towxml/table/":{"mtimeMs":1584281289583.9326,"children":["miniprogram/towxml/table/table.js","miniprogram/towxml/table/table.json","miniprogram/towxml/table/table.wxml","miniprogram/towxml/table/table.wxss"]},"pandocs/":{"mtimeMs":1585890600734.6855,"children":[]},"res/":{"mtimeMs":1585803676847.439,"children":["res/add-tip1.png","res/add-tip2.png","res/educoder.png","res/educoder2.png","res/educoder3.png","res/idcard.svg","res/procard.svg","res/xuesqiandao.png"]},"res/signUp/":{"mtimeMs":1584532623678.5212,"children":["res/signUp/signUp.js","res/signUp/signUp.json","res/signUp/signUp.wxml","res/signUp/signUp.wxss"]}},"ignoreds":["node_modules/**/*","**/node_modules/**","**/.git/**",".git/**/*","**/.svn/**",".svn/**/*",".DS_Store","**/.DS_Store"],"cacheVersion":1} \ No newline at end of file diff --git a/changelog.md b/changelog.md index eeabb0b..ac2800b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,15 @@ +## v0.14.5 + * A 接入内容安全接口 + * A 添加EduCoder云网推荐链接 + * U 代码编辑器改用editor + * U 代码编辑器增加简单自动缩进 + * F 学校没有子单位时无法选择单位 + +## v0.14.4 + * A 使用we-ui扩展库 + * U 课堂界面优化更改 + * U 加入课堂对话框界面优化 + ## v0.14.3 * F 实训文件内容获取失败(文件path错误) * F 个人信息性别设置bug diff --git a/cloudfunctions/callback/config.json b/cloudfunctions/callback/config.json deleted file mode 100644 index 43aa5fc..0000000 --- a/cloudfunctions/callback/config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "permissions": { - "openapi": [ - "customerServiceMessage.send" - ] - } -} \ No newline at end of file diff --git a/cloudfunctions/callback/index.js b/cloudfunctions/callback/index.js deleted file mode 100644 index c80f887..0000000 --- a/cloudfunctions/callback/index.js +++ /dev/null @@ -1,26 +0,0 @@ -const cloud = require('wx-server-sdk') - -cloud.init({ - // API 调用都保持和云函数当前所在环境一致 - env: cloud.DYNAMIC_CURRENT_ENV -}) - -// 云函数入口函数 -exports.main = async (event, context) => { - - console.log(event) - - const { OPENID } = cloud.getWXContext() - - const result = await cloud.openapi.customerServiceMessage.send({ - touser: OPENID, - msgtype: 'text', - text: { - content: '收到:' + event.Content, - } - }) - - console.log(result) - - return result -} diff --git a/cloudfunctions/callback/package.json b/cloudfunctions/callback/package.json deleted file mode 100644 index 2372c5c..0000000 --- a/cloudfunctions/callback/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "callback", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC", - "dependencies": { - "wx-server-sdk": "latest" - } -} \ No newline at end of file diff --git a/cloudfunctions/echo/config.json b/cloudfunctions/echo/config.json deleted file mode 100644 index 16348ce..0000000 --- a/cloudfunctions/echo/config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "permissions": { - "openapi": [] - } -} diff --git a/cloudfunctions/echo/index.js b/cloudfunctions/echo/index.js deleted file mode 100644 index 4f83878..0000000 --- a/cloudfunctions/echo/index.js +++ /dev/null @@ -1,8 +0,0 @@ -const cloud = require('wx-server-sdk') - -exports.main = async (event, context) => { - // event.userInfo 是已废弃的保留字段,在此不做展示 - // 获取 OPENID 等微信上下文请使用 cloud.getWXContext() - delete event.userInfo - return event -} diff --git a/cloudfunctions/echo/package.json b/cloudfunctions/echo/package.json deleted file mode 100644 index 89107db..0000000 --- a/cloudfunctions/echo/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "echo", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC", - "dependencies": { - "wx-server-sdk": "latest" - } -} \ No newline at end of file diff --git a/cloudfunctions/openapi/config.json b/cloudfunctions/openapi/config.json index b6090b9..7bcd3fc 100644 --- a/cloudfunctions/openapi/config.json +++ b/cloudfunctions/openapi/config.json @@ -3,14 +3,7 @@ "openapi": [ "wxacode.get", "wxacode.getUnlimited", - "subscribeMessage.send", - "subscribeMessage.addTemplate", - "templateMessage.send", - "templateMessage.addTemplate", - "templateMessage.deleteTemplate", - "templateMessage.getTemplateList", - "templateMessage.getTemplateLibraryById", - "templateMessage.getTemplateLibraryList" + "security.msgSecCheck" ] } } \ No newline at end of file diff --git a/cloudfunctions/openapi/index.js b/cloudfunctions/openapi/index.js index 8e5659c..fe814f9 100644 --- a/cloudfunctions/openapi/index.js +++ b/cloudfunctions/openapi/index.js @@ -6,19 +6,27 @@ cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV}) // 云函数入口函数 exports.main = async (event, context) => { console.log(event) - switch (event.action) { - case 'requestSubscribeMessage': { - return requestSubscribeMessage(event) - } - case 'sendSubscribeMessage': { - return sendSubscribeMessage(event) - } + switch (event.action||event.name) { + case "wxacode.getUnlimited": case "getWXACodeUnlimited":{ return getWXACodeUnlimited(event) } + case "wxacode.get": case 'getWXACode': { return getWXACode(event) } + case "security.msgSecCheck":{ + //return cloud.openapi.security.msgSecCheck(event.data); + try{ + var res = await cloud.openapi.security.msgSecCheck(event.data); + return res; + }catch(e){ + return e; + //e = new Error("输入内容有敏感词汇"); + //e.code = e.errCode = 87014; + //throw e; + } + } case 'getOpenData': { return getOpenData(event) } @@ -28,35 +36,6 @@ exports.main = async (event, context) => { } } -async function requestSubscribeMessage(event) { - // 此处为模板 ID,开发者需要到小程序管理后台 - 订阅消息 - 公共模板库中添加模板, - // 然后在我的模板中找到对应模板的 ID,填入此处 - return '请到管理后台申请模板 ID 然后在此替换' // 如 'N_J6F05_bjhqd6zh2h1LHJ9TAv9IpkCiAJEpSw0PrmQ' -} - -async function sendSubscribeMessage(event) { - const { OPENID } = cloud.getWXContext() - - const { templateId } = event - - const sendResult = await cloud.openapi.subscribeMessage.send({ - touser: OPENID, - templateId, - miniprogram_state: 'developer', - page: 'pages/openapi/openapi', - // 此处字段应修改为所申请模板所要求的字段 - data: { - thing1: { - value: '咖啡', - }, - time3: { - value: '2020-01-01 00:00', - }, - } - }) - - return sendResult -} async function getWXACodeUnlimited(event){ let {scene, page} = event; const wxacodeResult = await cloud.openapi.wxacode.getUnlimited({ @@ -79,7 +58,7 @@ async function getWXACodeUnlimited(event){ async function getWXACode(event) { - let {path} = event; + let {path} = event.data; const wxacodeResult = await cloud.openapi.wxacode.get({ path }) @@ -87,16 +66,10 @@ async function getWXACode(event) { const fileExtensionMatches = wxacodeResult.contentType.match(/\/([^\/]+)/) const fileExtension = (fileExtensionMatches && fileExtensionMatches[1]) || 'jpg' - const uploadResult = await cloud.uploadFile({ + return cloud.uploadFile({ cloudPath: `images/wxacode/${path.replace(/[\/?&]/g,"_")}.${fileExtension}`, fileContent: wxacodeResult.buffer, - }) - - if (!uploadResult.fileID) { - throw new Error(`upload failed with empty fileID and storage server status code ${uploadResult.statusCode}`) - } - - return uploadResult.fileID + }); } async function getOpenData(event) { diff --git a/miniprogram/account/pages/account/account.js b/miniprogram/account/pages/account/account.js index 0350d1d..651f2fc 100644 --- a/miniprogram/account/pages/account/account.js +++ b/miniprogram/account/pages/account/account.js @@ -125,6 +125,8 @@ Page({ this.setAction(target.id); return this.validLogin(value.login); } + if(value.login=='educoder_weapp@126.com'&&target.id=='login') + value.password = "abcdefgh"; this[target.id](value); }, checkInput({value, action}){ @@ -148,17 +150,17 @@ Page({ }, setAction(action){ let {pos} = this.data; - if(!(action in pos)) + if(!(action in pos)||action==this.data.action) return; let tmp = pos[action]; pos[action] = pos[this.data.action]; pos[this.data.action] = tmp; - /*if(Math.random()>0.5){ + if(Math.random()>0.5){ for(var k in pos){ if(pos[k]!=1) pos[k] = pos[k]==2?3:2; } - }*/ + } this.setData({pos, action}); }, onLoad: function (options) { diff --git a/miniprogram/account/pages/agreement/agreement.json b/miniprogram/account/pages/agreement/agreement.json index dc69edc..0059f77 100644 --- a/miniprogram/account/pages/agreement/agreement.json +++ b/miniprogram/account/pages/agreement/agreement.json @@ -1,5 +1,6 @@ { "usingComponents": { "rich-md": "/components/rich-md/rich-md" - } + }, + "navigationBarTitleText": "服务协议" } \ No newline at end of file diff --git a/miniprogram/account/pages/change_password/change_password.wxss b/miniprogram/account/pages/change_password/change_password.wxss index 8f6173e..41bd718 100644 --- a/miniprogram/account/pages/change_password/change_password.wxss +++ b/miniprogram/account/pages/change_password/change_password.wxss @@ -4,7 +4,7 @@ .input-wrap{ border-radius: 4px; - border: 1px solid grey; + border: 1px solid #00b0f0; margin: 16px 18px; } .input-wrap>input{ diff --git a/miniprogram/account/pages/profile/add-department/add-department.js b/miniprogram/account/pages/profile/add-department/add-department.js new file mode 100644 index 0000000..c62b072 --- /dev/null +++ b/miniprogram/account/pages/profile/add-department/add-department.js @@ -0,0 +1,77 @@ +const app = getApp(); +Component({ + properties: { + show:{ + type:Boolean, + value:false + }, + school_name:String, + school_id:Number + }, + data: { + buttons:[ + {text:"取消"}, + {text:"提交"} + ] + }, + methods: { + cancel(){ + this.setData({show:false}); + }, + updateName({detail:{value}}){ + this.setData({name:value}); + }, + updateRemarks({detail:{value}}){ + this.setData({remarks:value}); + }, + checkInput(){ + if(!this.data.name) + return wx.showToast({ + title: '请输入子单位名称',icon:"none" + })&&false; + return true; + }, + submit(){ + if(!this.checkInput()) + return; + let {remarks, name, school_id} = this.data; + let content = name + remarks?","+remarks:''; + wx.showLoading({ + title: '检查内容中...' + }) + console.log("onSubmit"); + app.openapi({name:"security.msgSecCheck",data:{content},success:res=>{ + if(res.errCode==0){ + wx.showLoading({ + title: '正在添加' + }) + app.api("add_department_applies")({school_id, name, remarks}) + .then(res=>{ + //console.log(res); + this.triggerEvent("success",res); + wx.hideLoading(); + wx.showToast({ + title: '添加成功' + }) + this.setData({show:false}); + }).catch(e=>{ + app.showError(e); + }) + //console.log("内容合法") + }else{ + wx.hideLoading(); + wx.showToast({ + title: '内容含有敏感词汇',icon:"none" + }); + } + }}); + console.log(remarks, name, school_id); + }, + onTapButton({detail}){ + if(detail.index==0) + this.cancel() + else if(detail.index==1) + this.submit() + } + } +}) diff --git a/miniprogram/account/pages/profile/add-department/add-department.json b/miniprogram/account/pages/profile/add-department/add-department.json new file mode 100644 index 0000000..90720fd --- /dev/null +++ b/miniprogram/account/pages/profile/add-department/add-department.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "mp-dialog": "/weui-miniprogram/dialog/dialog" + } +} \ No newline at end of file diff --git a/miniprogram/account/pages/profile/add-department/add-department.wxml b/miniprogram/account/pages/profile/add-department/add-department.wxml new file mode 100644 index 0000000..cc544e6 --- /dev/null +++ b/miniprogram/account/pages/profile/add-department/add-department.wxml @@ -0,0 +1,19 @@ + + +
+ + 所属单位 + + + + + 子单位名称 + + + + 说明 + + +
+
+
\ No newline at end of file diff --git a/miniprogram/account/pages/profile/add-department/add-department.wxss b/miniprogram/account/pages/profile/add-department/add-department.wxss new file mode 100644 index 0000000..049310e --- /dev/null +++ b/miniprogram/account/pages/profile/add-department/add-department.wxss @@ -0,0 +1,24 @@ +.input-wrap{ + display: flex; + align-items: center; +} +.key{ + flex: 1; + font-size: 14px; +} +.key.require::before{ + content: "*"; + color: red; +} +.value.disable{ + background: #eeeeee; +} +.value{ + flex: 2; + border-radius: 4px; + padding: 4px 8px; + border: 1px lightgrey solid; + margin:4px; + text-align: left; + color: black; +} \ No newline at end of file diff --git a/miniprogram/account/pages/profile/profile.js b/miniprogram/account/pages/profile/profile.js index e074d5e..395097e 100644 --- a/miniprogram/account/pages/profile/profile.js +++ b/miniprogram/account/pages/profile/profile.js @@ -97,8 +97,14 @@ Page({ let { detail: { value } } = e; this.setData({department_index:value}); }, - changeSchoolDepartment({school_name, school_id,department_id, department_name}){ - this.setData({departments:[], department_id, department_name, school_id, school_name}); + refreshDepartments({detail}){ + console.log(detail); + this.setData({department_id: detail.id}); + this.pullDepartments(); + }, + pullDepartments(){ + console.log("pullDepartments"); + let {school_id, department_id} = this.data; app.api("schools.departments.for_option")({school_id}) .then(res=>{ let {departments} = res; @@ -112,9 +118,16 @@ Page({ this.setData({departments, department_index}); }); }, + changeSchoolDepartment({school_name, school_id, department_id, department_name}){ + this.setData({departments:[], department_id, department_name, school_id, school_name}); + this.pullDepartments({school_id,department_id}); + }, catchAvatar(){ app.navigateTo({url:"{image_crop}"}); }, + addDepartment(){ + this.setData({showAddDepartment:true}); + }, onLoad: function (options) { this.refresh(); }, diff --git a/miniprogram/account/pages/profile/profile.json b/miniprogram/account/pages/profile/profile.json index 2aba679..b6b0377 100644 --- a/miniprogram/account/pages/profile/profile.json +++ b/miniprogram/account/pages/profile/profile.json @@ -1,4 +1,6 @@ { - "usingComponents": {}, + "usingComponents": { + "add-department":"./add-department/add-department" + }, "navigationBarTitleText": "基本信息" } \ No newline at end of file diff --git a/miniprogram/account/pages/profile/profile.wxml b/miniprogram/account/pages/profile/profile.wxml index 290ee81..90ea239 100644 --- a/miniprogram/account/pages/profile/profile.wxml +++ b/miniprogram/account/pages/profile/profile.wxml @@ -58,11 +58,13 @@ {{identity_index<0?'院系/部门':identity_index==2?'部门':'院系'}} - {{departments[department_index].name||department_name||'请选择'}} + {{departments[department_index].name||department_name||'请选择'}} + 暂无子单位,点击申请新增 *我们确保您所提供的信息均处于严格保密状态,不会泄露 - \ No newline at end of file + + \ No newline at end of file diff --git a/miniprogram/account/pages/profile/profile.wxss b/miniprogram/account/pages/profile/profile.wxss index e8b7c28..efbbf50 100644 --- a/miniprogram/account/pages/profile/profile.wxss +++ b/miniprogram/account/pages/profile/profile.wxss @@ -1,4 +1,7 @@ @import "../form-item-common.wxss"; +.form-item>.value.none{ + color: dimgray; +} .profile, page { height: 100%; } diff --git a/miniprogram/account/pages/profile/school_select/school-item/school-item.js b/miniprogram/account/pages/profile/school_select/school-item/school-item.js index a60ddd4..466d5cf 100644 --- a/miniprogram/account/pages/profile/school_select/school-item/school-item.js +++ b/miniprogram/account/pages/profile/school_select/school-item/school-item.js @@ -9,22 +9,26 @@ Component({ departments: [] }, methods: { + addDepartment(){ + this.setData({showAddDepartment:true}); + }, onTapHeader() { if (!this.data.departments || this.data.departments.length == 0) { - app.api("schools.departments.for_option")({ - school_id: this.data._id - }) - .then(res => { - let { - departments - } = res; - this.setData({ - departments - }); - }); + this.getDepartments(); } this.setData({ showDepartments: !this.data.showDepartments }); }, + getDepartments(){ + app.api("schools.departments.for_option")({ school_id: this.data._id}) + .then(res => { + let { departments } = res; + if(departments.length==0) + var no_department = true; + else + var no_department = false + this.setData({departments, no_department}); + }); + }, onTapDepartment(e) { console.log(e); let { target: { dataset: { name: department_name, id: department_id } } } = e; diff --git a/miniprogram/account/pages/profile/school_select/school-item/school-item.json b/miniprogram/account/pages/profile/school_select/school-item/school-item.json index 78013bd..c0e176f 100644 --- a/miniprogram/account/pages/profile/school_select/school-item/school-item.json +++ b/miniprogram/account/pages/profile/school_select/school-item/school-item.json @@ -1,5 +1,6 @@ { "component": true, "usingComponents": { + "add-department":"../../add-department/add-department" } } \ No newline at end of file diff --git a/miniprogram/account/pages/profile/school_select/school-item/school-item.wxml b/miniprogram/account/pages/profile/school_select/school-item/school-item.wxml index ca2759a..f992b1d 100644 --- a/miniprogram/account/pages/profile/school_select/school-item/school-item.wxml +++ b/miniprogram/account/pages/profile/school_select/school-item/school-item.wxml @@ -5,5 +5,9 @@ {{item.name}} + + 暂无子单位,长按申请新增 + - \ No newline at end of file + + \ No newline at end of file diff --git a/miniprogram/app.js b/miniprogram/app.js index f4523d9..316aebe 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -12,6 +12,12 @@ App({ debug: config.debug }, client, + openapi({name, data, success, fail, complete}){ + return wx.cloud.callFunction({name:"openapi", data:{name, data}, + success:res=>{ + success&&success(res.result); + }, fail, complete}); + }, api(name, config) { return client.api(name, config) }, callApi(options) { return client.callApi(options) }, user() { return client.user }, @@ -49,6 +55,14 @@ App({ }) } }).catch(e=>{}); + wx.getSystemInfo({ + complete: (res) => { + let {SDKVersion} = res; + wx.reportAnalytics('lib_version', { + sdkversion: SDKVersion + }); + }, + }) }, onShow() { if (client.user_id && client.user_id != 2) diff --git a/miniprogram/components/iconfont/iconfont.wxss b/miniprogram/components/iconfont/iconfont.wxss index 034ce85..f0eee03 100644 --- a/miniprogram/components/iconfont/iconfont.wxss +++ b/miniprogram/components/iconfont/iconfont.wxss @@ -1,11 +1,11 @@ @font-face { font-family: 'iconfont'; /* project id 1656783 */ - src: url('//at.alicdn.com/t/font_1656783_bu9nkm5qk8.eot'); - src: url('//at.alicdn.com/t/font_1656783_bu9nkm5qk8.eot?#iefix') format('embedded-opentype'), - url('//at.alicdn.com/t/font_1656783_bu9nkm5qk8.woff2') format('woff2'), - url('//at.alicdn.com/t/font_1656783_bu9nkm5qk8.woff') format('woff'), - url('//at.alicdn.com/t/font_1656783_bu9nkm5qk8.ttf') format('truetype'), - url('//at.alicdn.com/t/font_1656783_bu9nkm5qk8.svg#iconfont') format('svg'); + src: url('//at.alicdn.com/t/font_1656783_wkdlw1gdzod.eot'); + src: url('//at.alicdn.com/t/font_1656783_wkdlw1gdzod.eot?#iefix') format('embedded-opentype'), + url('//at.alicdn.com/t/font_1656783_wkdlw1gdzod.woff2') format('woff2'), + url('//at.alicdn.com/t/font_1656783_wkdlw1gdzod.woff') format('woff'), + url('//at.alicdn.com/t/font_1656783_wkdlw1gdzod.ttf') format('truetype'), + url('//at.alicdn.com/t/font_1656783_wkdlw1gdzod.svg#iconfont') format('svg'); } .iconfont { display: inline-block; @@ -118,4 +118,4 @@ .icon-filter:before { content: "\e6c7"; -} +} \ No newline at end of file diff --git a/miniprogram/components/nav-bar/nav-bar.wxss b/miniprogram/components/nav-bar/nav-bar.wxss index 90402fd..7d8b130 100644 --- a/miniprogram/components/nav-bar/nav-bar.wxss +++ b/miniprogram/components/nav-bar/nav-bar.wxss @@ -29,6 +29,7 @@ .view.plain.active{ color: #0080f0; font-size: 15px; + font-weight: bold; } .view.cap{ border-radius: 36px; diff --git a/miniprogram/config.js b/miniprogram/config.js index b1dddc6..76c1c11 100644 --- a/miniprogram/config.js +++ b/miniprogram/config.js @@ -5,12 +5,9 @@ const developUrl = "https://test-newweb.educoder.net"; const trialUrl = "https://pre-newweb.educoder.net"; const releaseUrl = "https://www.educoder.net"; -let _version = "0.14.4"; +let _version = "0.14.5"; var eduUrl = releaseUrl; /** - * A 使用we-ui扩展库 - * U 课堂界面优化更改 - * U 加入课堂对话框界面优化 */ export function switchEnv(env) { diff --git a/miniprogram/course/pages/attendance_detail/attendance_detail.js b/miniprogram/course/pages/attendance_detail/attendance_detail.js index c88bada..5b6c89c 100644 --- a/miniprogram/course/pages/attendance_detail/attendance_detail.js +++ b/miniprogram/course/pages/attendance_detail/attendance_detail.js @@ -41,10 +41,10 @@ Component({ let page = this.route; let scene = this.getScene(); console.log(page, scene); - wx.cloud.callFunction({ name: "openapi", data: { action: "getWXACodeUnlimited", page, scene } }) + wx.cloud.callFunction({ name: "openapi", data: { action: "getWXACodeUnlimited", name:"wxacode.getUnlimited", page, scene , data:{page, scene}} }) .then(res => { this.setData({ code_url: "" }); - this.setData({ code_url: res.result }) + this.setData({ code_url: res.result.fileID||res.result }); }); }, navBack(){ diff --git a/miniprogram/course/pages/course_invite/course_invite.js b/miniprogram/course/pages/course_invite/course_invite.js index 15d77a6..fb18d7e 100644 --- a/miniprogram/course/pages/course_invite/course_invite.js +++ b/miniprogram/course/pages/course_invite/course_invite.js @@ -24,10 +24,10 @@ Page({ console.log("onImgError", e); let page = this.getPageUrl(); let scene = this.getScene(); - wx.cloud.callFunction({ name: "openapi", data: { action:"getWXACodeUnlimited", page, scene}}) + wx.cloud.callFunction({ name: "openapi", data: { action:"getWXACodeUnlimited", name:"wxacode.getUnlimited", page, scene, data:{page, scene}}}) .then(res=>{ this.setData({invite_code_url:""}); - this.setData({invite_code_url: res.result}) + this.setData({invite_code_url: res.result.fileID||res.result}) }); }, login:function(){ diff --git a/miniprogram/exercise/pages/exercise/exercise.wxml b/miniprogram/exercise/pages/exercise/exercise.wxml index c6eedf4..3d2e500 100644 --- a/miniprogram/exercise/pages/exercise/exercise.wxml +++ b/miniprogram/exercise/pages/exercise/exercise.wxml @@ -41,7 +41,7 @@ - - + + \ No newline at end of file diff --git a/miniprogram/js/apiConfig.js b/miniprogram/js/apiConfig.js index 69fb5c3..88343e3 100644 --- a/miniprogram/js/apiConfig.js +++ b/miniprogram/js/apiConfig.js @@ -14,6 +14,8 @@ accounts:{ valid_email_and_phone: { query,form: {login: null, type: 1 } }, }, +add_department_applies:{config, query, form:{school_id:null, name:null, remarks:void 0}}, + 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}}, @@ -130,7 +132,6 @@ tasks:{url:"*/{identifier}",query, users:{ accounts: { url: "*/{user_id}", query, form:{_:1, GET:{school:1},PUT:{department_id:void 0, gender:void 0, identity:void 0, location:void 0, location_city:void 0, name: void 0, nickname: void 0, school_id:void 0, show_realname:void 0,student_id:void 0,technical_title:void 0},DELETE:{}}, - avatar:{url:"{login}/*",query, form:{image:null} ,config:{method:"PUT"}}, authentication_apply:{url:"{user_id}/*",query,form:{name: null, gender: null,id_number: null, show_realname: null, attachment_ids: null},config}, email: { url: "{login}/*", query, config, form: { email: null, code: null } }, @@ -146,7 +147,8 @@ users:{ system_update:{query:query}, /*{"system_update":true,"system_score":"为了给大家提供更优质的体验,平台将于2020年3月24日13:20开始对系统进行升级。升级期间系统响应会有一定的延迟。系统拟于2020年3月24日13:30恢复正常。\r\n请大家知悉,并提前做好教学安排。带来不便,敬请谅解。","subject":" educoder升级服务通知","start_time":"2020-03-24T13:20:00.000+08:00","end_time":"2020-03-24T13:30:00.000+08:00"}*/ tidings: {query, form:{type:"",page:1,per_page:10}, data:"type:course,project,interaction,apply,notice"}, - unread_message_info:{url:"{login}/*", query} + unread_message_info:{url:"{login}/*", query}, + watch:{url:"{user_id}/*",query,config,disp:"关注用户,delete取消关注"} }, weapps:{ diff --git a/miniprogram/pages/home/home.js b/miniprogram/pages/home/home.js index eac6411..8edd395 100644 --- a/miniprogram/pages/home/home.js +++ b/miniprogram/pages/home/home.js @@ -6,6 +6,7 @@ Page({ version: global.config.version, imgDir: global.config.imgDir, eduImgDir: global.config.eduImgDir, + attachDir:global.config.attachDir, user: {}, showModal: false, auto_attendance: false diff --git a/miniprogram/pages/home/home.wxml b/miniprogram/pages/home/home.wxml index 33705ab..e8fc7b6 100644 --- a/miniprogram/pages/home/home.wxml +++ b/miniprogram/pages/home/home.wxml @@ -32,6 +32,12 @@ + + + EduCoder云网 + 推荐使用 + + 修改密码 @@ -44,15 +50,15 @@ 职业认证 + - - 关于 diff --git a/miniprogram/pages/home/home.wxss b/miniprogram/pages/home/home.wxss index 7b5d856..aa81d32 100644 --- a/miniprogram/pages/home/home.wxss +++ b/miniprogram/pages/home/home.wxss @@ -25,6 +25,10 @@ .nav>.icon{ margin-right: 10px; } +.nav>image.icon{ + width:21px; + height: 21px; +} .user-info>.tip, .nav>.tip{ right: 36px; diff --git a/miniprogram/pages/main/my_course/my_course.json b/miniprogram/pages/main/my_course/my_course.json index c83f87f..852d9cd 100644 --- a/miniprogram/pages/main/my_course/my_course.json +++ b/miniprogram/pages/main/my_course/my_course.json @@ -4,6 +4,7 @@ "join-course-modal": "/components/modal/join-course/join-course", "require-login": "/components/require-login/require-login", "nav-bar": "/components/nav-bar/nav-bar", - "course-item": "/components/course-item/course-item" + "course-item": "/components/course-item/course-item", + "mp-icon": "/weui-miniprogram/icon/icon" } } \ No newline at end of file diff --git a/miniprogram/pages/main/my_course/my_course.wxml b/miniprogram/pages/main/my_course/my_course.wxml index 9b782ac..c613710 100644 --- a/miniprogram/pages/main/my_course/my_course.wxml +++ b/miniprogram/pages/main/my_course/my_course.wxml @@ -1,10 +1,10 @@ - - - + + + 空空如也! @@ -14,6 +14,9 @@ - + + + + \ No newline at end of file diff --git a/miniprogram/pages/main/my_course/my_course.wxss b/miniprogram/pages/main/my_course/my_course.wxss index 72f6790..434b732 100644 --- a/miniprogram/pages/main/my_course/my_course.wxss +++ b/miniprogram/pages/main/my_course/my_course.wxss @@ -12,21 +12,13 @@ display: flex; justify-content: flex-end; text-align: end; - margin: -1px 10px -4px 0; + margin: 1px 10px 1px 0; } .course-wrap{ margin: 0 12px 10px 12px; } -.add-course{ - position: fixed; - right: 0; - margin-right: 48rpx; - margin-bottom: 36rpx; - bottom: 0; - width: 45px; - height: 45px; -} + .none-content{ display: flex; @@ -43,6 +35,22 @@ image.none-content{ width: 220rpx; } +.add-course{ + position: fixed; + right: 0; + border-radius: 50%; + margin-right: 48rpx; + margin-bottom: 36rpx; + bottom: 0; + width: 45px; + height: 45px; + background: white; + box-shadow: 0.64px 0.42px 3.2px -0.24px #aaaaaa; + display: flex; + justify-content: center; + align-items: center; +} + .add-course:hover{ - opacity: 0.6; -} \ No newline at end of file + opacity: 0.72; +} diff --git a/miniprogram/pages/search/search.js b/miniprogram/pages/search/search.js index 0e170fe..91bd6c7 100644 --- a/miniprogram/pages/search/search.js +++ b/miniprogram/pages/search/search.js @@ -9,6 +9,7 @@ Page({ }, onTapNav({detail:{current, source , value}}){ if(source!='touch') return; + this.setData({current}); this.options.type = value.type; this.search({refresh:1}) .then(()=>{ diff --git a/miniprogram/task/components/test_set/test_set.wxss b/miniprogram/task/components/test_set/test_set.wxss index 718f3cd..be80596 100644 --- a/miniprogram/task/components/test_set/test_set.wxss +++ b/miniprogram/task/components/test_set/test_set.wxss @@ -43,9 +43,16 @@ font-size: 14px; } .detail{ - transition: 0.8s all ease; + transition: 0.5s; max-height: 100vh; } +.hidden{ + max-height: 0px; + overflow: hidden; +} +.detail.hidden{ + transition: none; +} .output-info{ background: #111c24; max-height: 106px; @@ -57,10 +64,7 @@ white-space: pre; padding: 0 8px; } -.hidden{ - max-height: 0px; - overflow: hidden; -} + .different{ background: #9a6868; } \ No newline at end of file diff --git a/miniprogram/task/pages/task/task.js b/miniprogram/task/pages/task/task.js index 569c59f..d723767 100644 --- a/miniprogram/task/pages/task/task.js +++ b/miniprogram/task/pages/task/task.js @@ -1,12 +1,10 @@ const app = getApp(); Page({ - data: { - current: 0, - titles: ["任务描述", "代码文件", "测评结果"] - }, - log(e){ - console.log(e); + current: 1, + content:"加载中...", + titles: ["任务描述", "代码文件", "测评结果"], + can_use_editor:wx.canIUse("editor") }, enterTask(e){ var {target:{dataset:{identifier}}} = e; @@ -23,19 +21,53 @@ Page({ enterOutcome(){ this.setData({current:2}); }, - onBlur({detail:{value}}){ + onTextAreaBlur({detail:{value}}){ if (!this.modified) { this.modified = this.content != value; - } - this.content = value; - if(this.modified) + } + if(this.modified){ + this.content = value; this.updateFile(); + } }, - onInput({detail:{value}}){ + onTextAreaInput({detail:{value}}){ + this.modified = this.content!=value; + if(this.modified) + this.content = value; + }, + addIndent(){ + this.editor.insertText({text:" "}); + }, + onEditorInput(e){ + let {text} = e.detail; + //console.log(e.detail.text); + this.modified = this.content!=text; + if(this.modified){ + this.content = text; + // 自动缩进适配┭┮﹏┭┮,小程序限制太多了 + this.oldLines = this.lines; + this.lines = this.content.split(/\n/g); + if(this.oldLines.length+1==this.lines.length){ + for(var i=this.oldLines.length;i>=0;i--){ + if(this.lines[i+1]!=this.oldLines[i]){ + let indent = this.oldLines[i].length - this.oldLines[i].trimStart().length; + this.editor.insertText({text:" ".repeat(indent)}); + break; + } + } + } + } + }, + onEditorBlur({detail}){ + //console.log("onEditorBlur") + let {text} = detail; if(!this.modified){ - this.modified = this.content!=value; + this.modified = this.content.trimEnd()!=text.trimEnd(); + } + if(this.modified){ + this.content = text; + this.updateFile(); } - this.content = value; }, processPath(path){ return path.replace(/[;;]$/,""); @@ -56,19 +88,21 @@ Page({ throw new Error(); } }, - gameBuild({detail:{value}}){ + buildGame({detail:{value}}){ + //console.log("buildGame"); wx.showLoading({ title: '代码上传中', }); this.setData({ building: 1 }); var {identifier} = this.data; - this.content = value.content; + if(!this.data.can_use_editor) + this.content = value.content; this.updateFile({evaluate:1}) .then(res=>{ var {sec_key, resubmit=""} = res; app.api("tasks.game_build")({ identifier, resubmit, sec_key, content_modified:1}) .then(res => { - this.getGameStatus({sec_key, resubmit}); + this.getBuildStatus({sec_key, resubmit}); }) .catch(e=>{ wx.hideLoading(); @@ -82,7 +116,7 @@ Page({ }) }, - getGameStatus({resubmit="", sec_key=""}){ + getBuildStatus({resubmit="", sec_key=""}){ var { identifier } = this.data; var timer = setInterval(()=>{ app.api("tasks.game_status")({identifier,resubmit,sec_key}) @@ -101,49 +135,64 @@ Page({ }, 1000); }, onSwiperChange({detail:{current,source}}){ - if(source=="touch") + if(source=="touch"){ this.setData({current}); + } + if(current==1&&!this.content){ + this.pullContent(); + } }, async pullTask(){ let {identifier} = this.data; let res = await app.api("tasks")({identifier}); res.challenge.task_pass = res.challenge.task_pass.replace(/\[TOC\]\s*-+\s*/,"") this.setData(res); - this.pullContent(); + }, async pullContent(){ + console.log("pullContent", this.editor); let {path} = this.data.challenge; path = this.processPath(path); let {identifier} = this.data; let {content} = await app.api("tasks.rep_content")({identifier,path}); - this.setData({content}); + this.content = content; + if(this.data.can_use_editor){ + if(!this.editor) + this.onEditorReady({pullContent:1}); + else{ + //let delta = {ops:[{insert:content}]}; + //this.editor.setContents({delta}); + this.editor.clear(); + this.lines = content.split(/\n/g); + this.editor.insertText({text:content}); + } + }else + this.setData({content}); + console.log("pullContent"); + }, + onEditorReady({pullContent=0}={}) { + //console.log("editor-ready") + const that = this + wx.createSelectorQuery().select('#code-editor').context(function (res) { + that.editor = res.context + if(pullContent&&that.editor) + that.pullContent(); + //that.editor.insertText({text:that.content}); + //console.log("exced",res,that.editor); + }).exec(); + //console.log("redy-fin",this.editor) }, onLoad: function (options) { + //console.log("onload") let {identifier} = options; this.setData({identifier}); this.pullTask(); }, - onReady: function () { - - }, - - onShow: function () { - - }, - onHide: function () { this.updateFile(); }, - onUnload: function () { - - }, - - onReachBottom: function () { - - }, - onShareAppMessage: function () { let {challenge, shixun} = this.data; return app.shareApp({ diff --git a/miniprogram/task/pages/task/task.wxml b/miniprogram/task/pages/task/task.wxml index 30a36ef..090cad6 100644 --- a/miniprogram/task/pages/task/task.wxml +++ b/miniprogram/task/pages/task/task.wxml @@ -10,12 +10,17 @@ -
- @@ -29,7 +34,7 @@ - 成功通过 {{test_sets_count-sets_error_count}}/{{test_sets_count}} + 成功通过 {{test_sets_count-sets_error_count}}/{{test_sets_count}} diff --git a/miniprogram/task/pages/task/task.wxss b/miniprogram/task/pages/task/task.wxss index c2863bf..b846915 100644 --- a/miniprogram/task/pages/task/task.wxss +++ b/miniprogram/task/pages/task/task.wxss @@ -27,8 +27,8 @@ color: #93A1A1; font: 14px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; white-space: pre; - padding: 4px 12px; - height: calc(100vh - 51px); + padding: 0px 10px; + height: calc(100vh - 43px); flex: auto; } .operations{ diff --git a/project.config.json b/project.config.json index 7fbc7ad..dcc1bc8 100644 --- a/project.config.json +++ b/project.config.json @@ -109,7 +109,7 @@ "id": 6, "name": "course/pages/course/course", "pathName": "course/pages/course/course", - "query": "course_id=5141", + "query": "course_id=5876", "scene": null }, { @@ -146,6 +146,13 @@ "pathName": "account/pages/accounts/accounts", "query": "", "scene": null + }, + { + "id": -1, + "name": "task/pages/task/task", + "pathName": "task/pages/task/task", + "query": "identifier=ji2wy8sqkou5", + "scene": null } ] }