From 37b6d4edc30984e06b01c89ed94e88bd81b4a6e4 Mon Sep 17 00:00:00 2001 From: educoder_weapp Date: Tue, 31 Mar 2020 17:05:49 +0800 Subject: [PATCH] =?UTF-8?q?A=20=E5=88=87=E6=8D=A2=E8=B4=A6=E5=8F=B7=20?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E8=AF=BE=E5=A0=82=E7=AD=BE=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.txt | 13 ++ miniprogram/account/pages/account/account.js | 58 +++----- .../account/pages/account/account.json | 4 +- .../account/pages/account/account.wxml | 10 +- .../account/pages/account/account.wxss | 5 +- .../account/pages/accounts/accounts.js | 106 ++++++++++++++ .../account/pages/accounts/accounts.json | 4 + .../account/pages/accounts/accounts.wxml | 22 +++ .../account/pages/accounts/accounts.wxss | 41 ++++++ .../account/pages/agreement/agreement.js | 2 +- .../pages/authentication/authentication.js | 70 ++++++++++ .../pages/authentication/authentication.json | 7 + .../pages/authentication/authentication.wxml | 49 +++++++ .../pages/authentication/authentication.wxss | 60 ++++++++ .../account/pages/form-item-common.wxss | 27 ++++ .../pro_authentication/pro_authentication.js | 132 ++++++++++++++++++ .../pro_authentication.json | 7 + .../pro_authentication.wxml | 53 +++++++ .../pro_authentication.wxss | 60 ++++++++ miniprogram/account/pages/profile/data.js | 1 + miniprogram/account/pages/profile/data.png | 1 - miniprogram/account/pages/profile/profile.js | 26 ++-- .../account/pages/profile/profile.json | 2 +- .../account/pages/profile/profile.wxml | 10 +- .../account/pages/profile/profile.wxss | 53 +++---- miniprogram/app.js | 2 +- miniprogram/app.json | 14 +- miniprogram/app.wxss | 2 +- miniprogram/components/add-tips/add-tips.js | 5 +- miniprogram/components/add-tips/add-tips.wxml | 6 +- .../components/course-item/course-item.js | 4 +- .../components/course-item/course-item.json | 4 +- .../components/course-item/course-item.wxml | 16 ++- .../components/course-item/course-item.wxss | 14 +- miniprogram/components/iconfont/iconfont.js | 57 ++++++++ miniprogram/components/iconfont/iconfont.json | 4 + miniprogram/components/iconfont/iconfont.wxml | 6 + miniprogram/components/iconfont/iconfont.wxss | 109 +++++++++++++++ .../components/require-login/require-login.js | 4 + .../require-login/require-login.wxml | 4 +- miniprogram/components/rich-md/rich-md.js | 2 +- miniprogram/components/rich-md/rich-md.wxml | 2 +- .../components/tiding-item/tiding-item.js | 35 +++-- miniprogram/config.js | 12 +- .../course/modules/activity/activity.js | 2 + .../course/modules/activity/activity.wxml | 2 +- .../activity/activity_group/activity_group.js | 6 +- .../activity_group/activity_group.wxml | 4 +- .../activity/activity_item/activity_item.js | 34 ++--- .../attendance-item/attendance-item.js | 36 ++++- .../attendance-item/attendance-item.wxml | 7 +- .../attendance-item/attendance-item.wxss | 16 ++- .../course/modules/attendance/attendance.js | 35 ++++- .../course/modules/attendance/attendance.json | 3 +- .../course/modules/attendance/attendance.wxml | 39 +++++- .../course/modules/attendance/attendance.wxss | 35 ++++- .../attendance_detail/attendance_detail.js | 114 +++++++++++++++ .../attendance_detail/attendance_detail.json | 6 + .../attendance_detail/attendance_detail.wxml | 26 ++++ .../attendance_detail/attendance_detail.wxss | 19 +++ .../course/pages/attendances/attendances.js | 66 +++++++++ .../course/pages/attendances/attendances.json | 3 + .../course/pages/attendances/attendances.wxml | 2 + .../course/pages/attendances/attendances.wxss | 1 + miniprogram/course/pages/course/course.js | 8 +- miniprogram/course/pages/course/course.wxml | 4 +- miniprogram/course/pages/course/course.wxss | 5 +- .../pages/course_invite/course_invite.js | 4 + .../pages/course_invite/course_invite.wxml | 7 +- .../pages/course_invite/course_invite.wxss | 16 ++- .../pages/course_setting/course_setting.js | 48 +------ miniprogram/dev/pages/dev/dev.js | 66 +++++++++ miniprogram/dev/pages/dev/dev.json | 3 + miniprogram/dev/pages/dev/dev.wxml | 3 + miniprogram/dev/pages/dev/dev.wxss | 52 +++++++ .../pages/exercise_cover/exercise_cover.js | 4 +- .../pages/exercise_cover/exercise_cover.wxss | 1 + miniprogram/images/enter.png | Bin 0 -> 236 bytes miniprogram/js/apiConfig.js | 17 ++- miniprogram/js/client.js | 32 ++--- miniprogram/js/requests.js | 32 +++-- miniprogram/js/utils.js | 130 ++++++++++++++++- miniprogram/pages/home/home.js | 6 +- miniprogram/pages/home/home.json | 2 +- miniprogram/pages/home/home.wxml | 43 +++++- miniprogram/pages/home/home.wxss | 32 ++++- miniprogram/pages/main/my_course/my_course.js | 21 ++- .../pages/main/my_course/my_course.wxml | 4 +- miniprogram/shixun/pages/shixun/shixun.wxml | 2 +- .../pages/shixun_homework/shixun_homework.js | 13 +- miniprogram/sitemap.json | 18 ++- .../task/components/test_set/test_set.js | 9 +- project.config.json | 36 +++++ 93 files changed, 1875 insertions(+), 324 deletions(-) create mode 100644 miniprogram/account/pages/accounts/accounts.js create mode 100644 miniprogram/account/pages/accounts/accounts.json create mode 100644 miniprogram/account/pages/accounts/accounts.wxml create mode 100644 miniprogram/account/pages/accounts/accounts.wxss create mode 100644 miniprogram/account/pages/authentication/authentication.js create mode 100644 miniprogram/account/pages/authentication/authentication.json create mode 100644 miniprogram/account/pages/authentication/authentication.wxml create mode 100644 miniprogram/account/pages/authentication/authentication.wxss create mode 100644 miniprogram/account/pages/form-item-common.wxss create mode 100644 miniprogram/account/pages/pro_authentication/pro_authentication.js create mode 100644 miniprogram/account/pages/pro_authentication/pro_authentication.json create mode 100644 miniprogram/account/pages/pro_authentication/pro_authentication.wxml create mode 100644 miniprogram/account/pages/pro_authentication/pro_authentication.wxss create mode 100644 miniprogram/account/pages/profile/data.js delete mode 100644 miniprogram/account/pages/profile/data.png create mode 100644 miniprogram/components/iconfont/iconfont.js create mode 100644 miniprogram/components/iconfont/iconfont.json create mode 100644 miniprogram/components/iconfont/iconfont.wxml create mode 100644 miniprogram/components/iconfont/iconfont.wxss create mode 100644 miniprogram/course/pages/attendance_detail/attendance_detail.js create mode 100644 miniprogram/course/pages/attendance_detail/attendance_detail.json create mode 100644 miniprogram/course/pages/attendance_detail/attendance_detail.wxml create mode 100644 miniprogram/course/pages/attendance_detail/attendance_detail.wxss create mode 100644 miniprogram/course/pages/attendances/attendances.js create mode 100644 miniprogram/course/pages/attendances/attendances.json create mode 100644 miniprogram/course/pages/attendances/attendances.wxml create mode 100644 miniprogram/course/pages/attendances/attendances.wxss create mode 100644 miniprogram/dev/pages/dev/dev.js create mode 100644 miniprogram/dev/pages/dev/dev.json create mode 100644 miniprogram/dev/pages/dev/dev.wxml create mode 100644 miniprogram/dev/pages/dev/dev.wxss create mode 100644 miniprogram/images/enter.png diff --git a/changelog.txt b/changelog.txt index 4b0d7ac..3aba882 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,16 @@ +## v0.13.3 + * A 增加实名认证界面 + * A 增加数据异常监测上报 + * U iconfont组件优化 + * F 登录Cookies解析失败 + +## v0.13.2 + * A iconfont + * A 首页根据身份提供创建课程选项 + * A 显示身份认证的状态 + * F cookies失效登录失败时用户界面显示错误 + * F 实训测试集解析错误 + ## v0.13.1 * A 修改个人信息界面 * F 头像更改界面高度异常 diff --git a/miniprogram/account/pages/account/account.js b/miniprogram/account/pages/account/account.js index 25fee50..0350d1d 100644 --- a/miniprogram/account/pages/account/account.js +++ b/miniprogram/account/pages/account/account.js @@ -1,17 +1,9 @@ +import {accountManager} from "../../../js/utils"; const app = getApp(); -const {key:_key} = require("../../../js/client"); - -const key = { - save_password: "we,nd;ke;hcy", - login: "login", - password: "Fie[R‘xu[Eu?ua;c", - _password:_key.password -} - Page({ data: { - imgDir: global.config.imgDir, + attachDir: global.config.attachDir, action:"login", code_button_text:"获取验证码", action_text:{login:"登录",register:"注册", reset:"找回密码"}, @@ -40,7 +32,7 @@ Page({ } }) .then(res=>{ - this.setData({hasError:0}); + this.setData({hasError:0,error:""}); }) .catch(e=>{ var hasError = e.message.indexOf("网络")!=-1?2:1; @@ -48,22 +40,27 @@ Page({ }) }, login_test(){ - var data = {login:"educoder_weapp@126.com", password:"abcdefgh"}; + var data = {login:"educoder_weapp@126.com",save_password:1, password:"abcdefgh"}; this.setData(data); this.login(data); // this.setStorage({...data,save_password:1}); }, - login({login, password, showToast=1}){ + login({ login, password, save_password, showToast=1}){ app.api("accounts.login")({login,password}) .then(res=>{ res.message="登录成功"; if (showToast) app.showMsg(res); + let account = { ...res, login, password, save_password }; + if(this.data.addaccount) + accountManager.addAccount(account,0); + accountManager.setCurrentAccount(account); this.navBack(); }) .catch(e=>{ if (showToast) app.showError(e); + console.error(e); }) }, register({login, password, code}){ @@ -75,13 +72,13 @@ Page({ app.showError(e); }) }, - reset({ login, password: new_password,password_confirmation: new_password_confirmation, code, no_login}){ + reset({ login, password: new_password, password_confirmation: new_password_confirmation, save_password ,code, no_login}){ app.api("accounts.reset_password")({login, new_password, new_password_confirmation, code}) .then(res=>{ res.message = "重置成功"; app.showMsg(res); if(!no_login) - this.login({login, password:new_password, showToast:0}); + this.login({ login, password: new_password, save_password, showToast:0}); }) .catch(e=>{ app.showError(e); @@ -128,7 +125,6 @@ Page({ this.setAction(target.id); return this.validLogin(value.login); } - this.setStorage(value); this[target.id](value); }, checkInput({value, action}){ @@ -168,27 +164,17 @@ Page({ onLoad: function (options) { let {action="login"} = options; this.setAction(action); - this.getStorage(); - }, - setStorage({login, password, save_password}){ - wx.setStorageSync(key.login, login); - wx.setStorageSync(key._password, password); - wx.setStorageSync(key.save_password, save_password); - if(save_password) - wx.setStorageSync(key.password, password); - else - wx.clearStorageSync(key.password); - }, + this.setData(options); + if(!options.nostorage) + this.getStorage(); + }, getStorage(){ - let save_password = wx.getStorageSync(key.save_password); - if(save_password!==0) - save_password = 1; - let login = wx.getStorageSync(key.login); - if(save_password) - var password = wx.getStorageSync(key.password); - else - var password = ""; - this.setData({save_password, login, password}); + let account = accountManager.getCurrentAccount(); + if(account){ + let {login, password, save_password=0} = account; + password = save_password?password:''; + this.setData({login, password, save_password}); + } }, navBack(){ setTimeout(()=>{ diff --git a/miniprogram/account/pages/account/account.json b/miniprogram/account/pages/account/account.json index f5d7ecd..7f866c4 100644 --- a/miniprogram/account/pages/account/account.json +++ b/miniprogram/account/pages/account/account.json @@ -1,4 +1,6 @@ { - "usingComponents": {}, + "usingComponents": { + "iconfont":"/components/iconfont/iconfont" + }, "navigationBarTitleText": "账号" } \ No newline at end of file diff --git a/miniprogram/account/pages/account/account.wxml b/miniprogram/account/pages/account/account.wxml index 7208c6f..a935672 100644 --- a/miniprogram/account/pages/account/account.wxml +++ b/miniprogram/account/pages/account/account.wxml @@ -1,15 +1,15 @@ - - {{error}} + + {{error}} - + \ No newline at end of file diff --git a/miniprogram/account/pages/authentication/authentication.wxss b/miniprogram/account/pages/authentication/authentication.wxss new file mode 100644 index 0000000..afbfc5c --- /dev/null +++ b/miniprogram/account/pages/authentication/authentication.wxss @@ -0,0 +1,60 @@ +@import "../form-item-common.wxss"; + + +.idcard-wrap{ + margin-top: 12px; + margin-bottom: 4px; + background: white; + padding: 12px; +} +.idcard-wrap>.key{ + margin: 2px; + font-size: 14px; +} +.idcards{ + margin: 12px 0; + display: flex; + justify-content: space-evenly; + width: 100%; +} + +.idcard{ + width: 40vw; + height: 30vw; +} +.idcard.upload{ + display: flex; + justify-content: center; + align-items: center; + background: #f4fcff; + border-radius: 2px; +} +.idcard>.photo{ + background: #00b0f0; + border-radius: 50%; + width: 36px; + height: 36px; + display: flex; + justify-content: center; + align-items: center; +} +.tips{ + display: flex; + font-size: 22rpx; + text-align: center; + color: #555555; +} +.tips>view{ + flex: 1; +} + +.submit{ + margin-top: 12px; + margin-bottom: 8px; +} +.footer-tip{ + font-size: 12px; + color: dimgray; + text-align: center; + margin-bottom: 12px; +} \ No newline at end of file diff --git a/miniprogram/account/pages/form-item-common.wxss b/miniprogram/account/pages/form-item-common.wxss new file mode 100644 index 0000000..aa9da68 --- /dev/null +++ b/miniprogram/account/pages/form-item-common.wxss @@ -0,0 +1,27 @@ +.form-item { + background: #fefefe; + display: flex; + justify-content: space-between; + align-items: center; + padding: 14px 12px; + margin-bottom: 1px; +} + +.form-item>.value { + text-align: right; + flex: auto; +} + +.form-item>.key { + display: inline-block; + flex: none; +} + +.form-item .tip { + font-size: 12px; + color: dimgray; +} + +.form-item>switch { + transform: scale(0.8); +} diff --git a/miniprogram/account/pages/pro_authentication/pro_authentication.js b/miniprogram/account/pages/pro_authentication/pro_authentication.js new file mode 100644 index 0000000..2a2679c --- /dev/null +++ b/miniprogram/account/pages/pro_authentication/pro_authentication.js @@ -0,0 +1,132 @@ +const app = getApp(); +Page({ + + data: { + information: "## **认证须知**\n1. 根据职业上传相应的证件照:教师(教师证),专业人士(员工证)、学生(学生证),请确保证件照内容完整并且清晰可见,**严禁PS**;\n\n2. 我们将在你提交职业证信息后的24小时(不包含节假日)内完成审核,审核结果将会以系统消息的形式发送给你;\n\n3. 职业认证审核完成后,**无法删除**,请谨慎填写;职业变更请选择重新认证;\n\n4. 职业认证审核完成后,系统将自动发放500个金币作为奖励;\n\n5. 我们会确保你所提供的信息均处于严格的保密状态,不会泄露;\n\n6. 如存在恶意乱填写姓名,学号,及上传与职业证件无关图片者,一经发现将**冻结EduCoder账号**。\n\n7. 非老师身份提交职业认证后系统会自动将状态改为已认证,你将可以体验平台需要职业认证的功能;如果在认证后的使用过程中未通过审核,你将不能继续体验需要认证的功能。\n\n", + imgDir: global.config.imgDir, + identities: [{ value: "teacher", text: "教师" }, { value: "student", text: "学生" }, { value: "professional", text: "专业人士" }], + technicalTitles: { + 0: ["教授", "副教授", "讲师", "助教"], + 2: ["企业管理者", "部门管理者", "高级工程师", "工程师", "助理工程师"] + } + }, + onShow(){ + let data = wx.getStorageSync("SET-SCHOOL-DEPARTMENT-KEY"); + if (data) { + this.changeSchoolDepartment(data); + wx.setStorageSync("SET-SCHOOL-DEPARTMENT-KEY", ''); + } + }, + onLoad() { + this.refresh(); + }, + refresh() { + app.api("users.accounts")() + .then(res => { + let { identity, school_id, school_name, department_id,department_name,id:user_id,student_id} = res; + let identity_index = -1; + let { identities } = this.data; + for (var i = 0; i < identities.length; i++) { + if (identities[i].value == res.identity) { + identity_index = i; + break; + } + } + + var technical_index = -1; + if (identity_index == 0 || identity_index == 2) { + let technicals = this.data.technicalTitles[identity_index]; + for (var i = 0; i < technicals.length; i++) { + if (technicals[i] == res.technical_title) { + technical_index = i; + break; + } + } + } + this.setData({ identity_index, technical_index, school_id, school_name, department_id, department_name, user_id, student_id}); + if(res.school_id) + this.changeSchoolDepartment(res); + }) + }, + changeSchoolDepartment({ school_name, school_id, department_id, department_name }) { + this.setData({ departments: [], department_id, department_name, school_id, school_name }); + app.api("schools.departments.for_option")({ school_id }) + .then(res => { + let { departments } = res; + let department_index = -1; + for (var i = 0; i < departments.length; i++) { + if (departments[i].id == department_id) { + department_index = i; + break; + } + } + this.setData({ departments, department_index }); + }); + }, + onIdentityChange(e) { + console.log(e); + let { detail: { value } } = e; + this.setData({ identity_index: value, technical_index: -1 }); + }, + onTechnicalChange(e) { + console.log(e); + let { detail: { value } } = e; + this.setData({ technical_index: value }); + }, + onDepartmentChange(e) { + console.log(e); + let { detail: { value } } = e; + this.setData({ department_index: value }); + }, + onSubmit(e) { + console.log(e); + let { detail: { value } } = e; + if (!this.checkInput(value)) return; + value.attachment_ids[0] = parseInt(value.attachment_ids[0]); + app.api("users.accounts.professional_auth_apply")(value) + .then(res => { + res.message = "职业认证提交成功"; + app.showMsg(res); + let db = wx.cloud.database(); + db.collection("data").add({ + data: { + name: "users.accounts.professional_auth_apply", + res, + createdAt: db.serverDate() + } + }); + }).catch(e => { + app.showError(e); + }) + }, + checkInput(value) { + if (!value.identity) + return wx.showToast({ title: '请选择职业', icon: "none" }) && false; + if (!value.extra) + return wx.showToast({ title:value.identity=='student'?'请输入学号':'请选择职称', icon: "none" }) && false; + if (!value.school_id) + return wx.showToast({ title: value.identity == 'professional' ? '请选择单位' : '请选择学校', icon: "none" }) && false; + if(!value.department_id) + return wx.showToast({ title: value.identity == 'professional' ? '请选择部门' : '请选择院系', icon: "none" }) && false; + if (value.attachment_ids.length == 0) + return wx.showToast({ title: '请上传职业证照片', icon: "none" }) && false; + return true; + }, + upload() { + wx.chooseImage({ + count: 1, + success: res => { + let file = res.tempFilePaths[0]; + wx.showLoading({ + title: '上传中', + }) + app.api("attachments")({ file, success: wx.hideLoading }) + .then(res => { + this.setData({ image_path: file, attachment_id: res.id }); + }).catch(e => { + app.showError(e); + }) + } + }); + } +}) \ No newline at end of file diff --git a/miniprogram/account/pages/pro_authentication/pro_authentication.json b/miniprogram/account/pages/pro_authentication/pro_authentication.json new file mode 100644 index 0000000..42f3d07 --- /dev/null +++ b/miniprogram/account/pages/pro_authentication/pro_authentication.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "rich-md": "/components/rich-md/rich-md", + "iconfont": "/components/iconfont/iconfont" + }, + "navigationBarTitleText": "职业认证" +} \ No newline at end of file diff --git a/miniprogram/account/pages/pro_authentication/pro_authentication.wxml b/miniprogram/account/pages/pro_authentication/pro_authentication.wxml new file mode 100644 index 0000000..32c6079 --- /dev/null +++ b/miniprogram/account/pages/pro_authentication/pro_authentication.wxml @@ -0,0 +1,53 @@ + +
+ + 职业 + {{identities[identity_index].text||'请选择'}} + + + + 学号 + + + + 职称 + {{technicalTitles[identity_index][technical_index]||'请选择'}} + + + + {{identity_index<0?'学校/单位':identity_index==2?'单位':'学校'}} + + {{school_name||'请选择'}} + + + {{identity_index<0?'院系/部门':identity_index==2?'部门':'院系'}} + {{departments[department_index].name||department_name||'请选择'}} + + + + 职业证上传 + + + + + + + + + + + png/jpg/bmp格式,不超过2MB + 上传职业证正面 + + + + + + + *提交前请检查信息并阅读认证须知 + +
+ +
\ No newline at end of file diff --git a/miniprogram/account/pages/pro_authentication/pro_authentication.wxss b/miniprogram/account/pages/pro_authentication/pro_authentication.wxss new file mode 100644 index 0000000..afbfc5c --- /dev/null +++ b/miniprogram/account/pages/pro_authentication/pro_authentication.wxss @@ -0,0 +1,60 @@ +@import "../form-item-common.wxss"; + + +.idcard-wrap{ + margin-top: 12px; + margin-bottom: 4px; + background: white; + padding: 12px; +} +.idcard-wrap>.key{ + margin: 2px; + font-size: 14px; +} +.idcards{ + margin: 12px 0; + display: flex; + justify-content: space-evenly; + width: 100%; +} + +.idcard{ + width: 40vw; + height: 30vw; +} +.idcard.upload{ + display: flex; + justify-content: center; + align-items: center; + background: #f4fcff; + border-radius: 2px; +} +.idcard>.photo{ + background: #00b0f0; + border-radius: 50%; + width: 36px; + height: 36px; + display: flex; + justify-content: center; + align-items: center; +} +.tips{ + display: flex; + font-size: 22rpx; + text-align: center; + color: #555555; +} +.tips>view{ + flex: 1; +} + +.submit{ + margin-top: 12px; + margin-bottom: 8px; +} +.footer-tip{ + font-size: 12px; + color: dimgray; + text-align: center; + margin-bottom: 12px; +} \ No newline at end of file diff --git a/miniprogram/account/pages/profile/data.js b/miniprogram/account/pages/profile/data.js new file mode 100644 index 0000000..409a4d0 --- /dev/null +++ b/miniprogram/account/pages/profile/data.js @@ -0,0 +1 @@ +module.exports={"北京":["东城","西城","朝阳","丰台","石景山","海淀","门头沟","房山","通州","顺义","昌平","大兴","平谷","怀柔","密云","延庆"],"上海":["崇明","黄浦","卢湾","徐汇","长宁","静安","普陀","闸北","虹口","杨浦","闵行","宝山","嘉定","浦东","金山","松江","青浦","南汇","奉贤"],"广东":["广州","深圳","珠海","东莞","中山","佛山","惠州","河源","潮州","江门","揭阳","茂名","梅州","清远","汕头","汕尾","韶关","顺德","阳江","云浮","湛江","肇庆"],"江苏":["南京","常熟","常州","海门","淮安","江都","江阴","昆山","连云港","南通","启东","沭阳","宿迁","苏州","太仓","泰州","同里","无锡","徐州","盐城","扬州","宜兴","仪征","张家港","镇江","周庄"],"重庆":["万州","涪陵","渝中","大渡口","江北","沙坪坝","九龙坡","南岸","北碚","万盛","双挢","渝北","巴南","黔江","长寿","綦江","潼南","铜梁","大足","荣昌","壁山","梁平","城口","丰都","垫江","武隆","忠县","开县","云阳","奉节","巫山","巫溪","石柱","秀山","酉阳","彭水","江津","合川","永川","南川"],"安徽":["合肥","安庆","蚌埠","亳州","巢湖","滁州","阜阳","贵池","淮北","淮化","淮南","黄山","九华山","六安","马鞍山","宿州","铜陵","屯溪","芜湖","宣城"],"福建":["福州","厦门","泉州","漳州","龙岩","南平","宁德","莆田","三明"],"甘肃":["兰州","嘉峪关","白银","定西","敦煌","甘南","金昌","酒泉","临夏","平凉","天水","陇南","武威","西峰","张掖"],"广西":["南宁","来宾","百色","北海","桂林","防城港","贵港","河池","贺州","柳州","钦州","梧州","玉林"],"贵州":["贵阳","安顺","毕节","都匀","凯里","六盘水","铜仁","兴义","玉屏","遵义"],"海南":["海口","儋县","陵水","琼海","三亚","通什","万宁"],"河北":["石家庄","保定","北戴河","沧州","承德","丰润","邯郸","衡水","廊坊","南戴河","秦皇岛","唐山","新城","邢台","张家口"],"黑龙江":["哈尔滨","北安","大庆","大兴安岭","鹤岗","黑河","佳木斯","鸡西","牡丹江","齐齐哈尔","七台河","双鸭山","绥化","伊春"],"河南":["郑州","安阳","鹤壁","潢川","焦作","济源","开封","漯河","洛阳","南阳","平顶山","濮阳","三门峡","商丘","新乡","信阳","许昌","周口","驻马店"],"香港":["香港","九龙","新界"],"湖北":["武汉","天门","恩施","鄂州","黄冈","黄石","荆门","荆州","潜江","十堰","随州","武穴","仙桃","咸宁","襄阳","襄樊","孝感","宜昌"],"湖南":["长沙","常德","郴州","衡阳","怀化","吉首","娄底","邵阳","湘潭","益阳","岳阳","永州","张家界","株洲"],"江西":["南昌","抚州","赣州","吉安","景德镇","井冈山","九江","庐山","萍乡","上饶","新余","宜春","鹰潭"],"吉林":["长春","吉林","白城","白山","珲春","辽源","梅河","四平","松原","通化","延吉"],"辽宁":["沈阳","鞍山","本溪","朝阳","大连","丹东","抚顺","阜新","葫芦岛","锦州","辽阳","盘锦","铁岭","营口"],"澳门":["澳门"],"内蒙古":["呼和浩特","阿拉善盟","包头","赤峰","东胜","海拉尔","集宁","临河","通辽","乌海","乌兰浩特","锡林浩特"],"宁夏":["银川","固源","石嘴山","吴忠"],"青海":["西宁","德令哈","格尔木","共和","海东","海晏","玛沁","同仁","玉树"],"山东":["济南","滨州","兖州","德州","东营","菏泽","济宁","莱芜","聊城","临沂","蓬莱","青岛","曲阜","日照","泰安","潍坊","威海","烟台","枣庄","淄博"],"山西":["太原","吕梁","长治","大同","候马","晋城","离石","临汾","宁武","朔州","忻州","阳泉","榆次","运城"],"陕西":["西安","安康","宝鸡","汉中","渭南","商州","绥德","铜川","咸阳","延安","榆林"],"四川":["成都","巴中","达川","德阳","都江堰","峨眉山","涪陵","广安","广元","九寨沟","康定","乐山","泸州","马尔康","绵阳","眉山","南充","内江","攀枝花","遂宁","汶川","西昌","雅安","宜宾","自贡","资阳"],"台湾":["台北","基隆","台南","台中","高雄","屏东","南投","云林","新竹","彰化","苗栗","嘉义","桃园","宜兰","台东","金门","马祖","澎湖"],"天津":["天津","和平","东丽","河东","西青","河西","津南","南开","北辰","河北","武清","红挢","塘沽","汉沽","大港","宁河","静海","宝坻","蓟县"],"新疆":["乌鲁木齐","阿克苏","阿勒泰","阿图什","博乐","昌吉","东山","哈密","和田","喀什","克拉玛依","库车","库尔勒","奎屯","石河子","塔城","吐鲁番","伊宁"],"西藏":["拉萨","阿里","昌都","林芝","那曲","日喀则","山南"],"云南":["昆明","大理","保山","楚雄","大理","东川","个旧","景洪","开远","临沧","丽江","六库","潞西","曲靖","思茅","文山","西双版纳","玉溪","中甸","昭通"],"浙江":["杭州","温州","安吉","慈溪","定海","奉化","海盐","黄岩","湖州","嘉兴","金华","临安","临海","丽水","宁波","瓯海","平湖","千岛湖","衢州","江山","瑞安","绍兴","嵊州","台州","温岭","余姚","舟山"],"海外":["美国","日本","英国","法国","德国","其他"]} \ No newline at end of file diff --git a/miniprogram/account/pages/profile/data.png b/miniprogram/account/pages/profile/data.png deleted file mode 100644 index 9608cb1..0000000 --- a/miniprogram/account/pages/profile/data.png +++ /dev/null @@ -1 +0,0 @@ -{"北京":["东城","西城","朝阳","丰台","石景山","海淀","门头沟","房山","通州","顺义","昌平","大兴","平谷","怀柔","密云","延庆"],"上海":["崇明","黄浦","卢湾","徐汇","长宁","静安","普陀","闸北","虹口","杨浦","闵行","宝山","嘉定","浦东","金山","松江","青浦","南汇","奉贤"],"广东":["广州","深圳","珠海","东莞","中山","佛山","惠州","河源","潮州","江门","揭阳","茂名","梅州","清远","汕头","汕尾","韶关","顺德","阳江","云浮","湛江","肇庆"],"江苏":["南京","常熟","常州","海门","淮安","江都","江阴","昆山","连云港","南通","启东","沭阳","宿迁","苏州","太仓","泰州","同里","无锡","徐州","盐城","扬州","宜兴","仪征","张家港","镇江","周庄"],"重庆":["万州","涪陵","渝中","大渡口","江北","沙坪坝","九龙坡","南岸","北碚","万盛","双挢","渝北","巴南","黔江","长寿","綦江","潼南","铜梁","大足","荣昌","壁山","梁平","城口","丰都","垫江","武隆","忠县","开县","云阳","奉节","巫山","巫溪","石柱","秀山","酉阳","彭水","江津","合川","永川","南川"],"安徽":["合肥","安庆","蚌埠","亳州","巢湖","滁州","阜阳","贵池","淮北","淮化","淮南","黄山","九华山","六安","马鞍山","宿州","铜陵","屯溪","芜湖","宣城"],"福建":["福州","厦门","泉州","漳州","龙岩","南平","宁德","莆田","三明"],"甘肃":["兰州","嘉峪关","白银","定西","敦煌","甘南","金昌","酒泉","临夏","平凉","天水","陇南","武威","西峰","张掖"],"广西":["南宁","来宾","百色","北海","桂林","防城港","贵港","河池","贺州","柳州","钦州","梧州","玉林"],"贵州":["贵阳","安顺","毕节","都匀","凯里","六盘水","铜仁","兴义","玉屏","遵义"],"海南":["海口","儋县","陵水","琼海","三亚","通什","万宁"],"河北":["石家庄","保定","北戴河","沧州","承德","丰润","邯郸","衡水","廊坊","南戴河","秦皇岛","唐山","新城","邢台","张家口"],"黑龙江":["哈尔滨","北安","大庆","大兴安岭","鹤岗","黑河","佳木斯","鸡西","牡丹江","齐齐哈尔","七台河","双鸭山","绥化","伊春"],"河南":["郑州","安阳","鹤壁","潢川","焦作","济源","开封","漯河","洛阳","南阳","平顶山","濮阳","三门峡","商丘","新乡","信阳","许昌","周口","驻马店"],"香港":["香港","九龙","新界"],"湖北":["武汉","天门","恩施","鄂州","黄冈","黄石","荆门","荆州","潜江","十堰","随州","武穴","仙桃","咸宁","襄阳","襄樊","孝感","宜昌"],"湖南":["长沙","常德","郴州","衡阳","怀化","吉首","娄底","邵阳","湘潭","益阳","岳阳","永州","张家界","株洲"],"江西":["南昌","抚州","赣州","吉安","景德镇","井冈山","九江","庐山","萍乡","上饶","新余","宜春","鹰潭"],"吉林":["长春","吉林","白城","白山","珲春","辽源","梅河","四平","松原","通化","延吉"],"辽宁":["沈阳","鞍山","本溪","朝阳","大连","丹东","抚顺","阜新","葫芦岛","锦州","辽阳","盘锦","铁岭","营口"],"澳门":["澳门"],"内蒙古":["呼和浩特","阿拉善盟","包头","赤峰","东胜","海拉尔","集宁","临河","通辽","乌海","乌兰浩特","锡林浩特"],"宁夏":["银川","固源","石嘴山","吴忠"],"青海":["西宁","德令哈","格尔木","共和","海东","海晏","玛沁","同仁","玉树"],"山东":["济南","滨州","兖州","德州","东营","菏泽","济宁","莱芜","聊城","临沂","蓬莱","青岛","曲阜","日照","泰安","潍坊","威海","烟台","枣庄","淄博"],"山西":["太原","吕梁","长治","大同","候马","晋城","离石","临汾","宁武","朔州","忻州","阳泉","榆次","运城"],"陕西":["西安","安康","宝鸡","汉中","渭南","商州","绥德","铜川","咸阳","延安","榆林"],"四川":["成都","巴中","达川","德阳","都江堰","峨眉山","涪陵","广安","广元","九寨沟","康定","乐山","泸州","马尔康","绵阳","眉山","南充","内江","攀枝花","遂宁","汶川","西昌","雅安","宜宾","自贡","资阳"],"台湾":["台北","基隆","台南","台中","高雄","屏东","南投","云林","新竹","彰化","苗栗","嘉义","桃园","宜兰","台东","金门","马祖","澎湖"],"天津":["天津","和平","东丽","河东","西青","河西","津南","南开","北辰","河北","武清","红挢","塘沽","汉沽","大港","宁河","静海","宝坻","蓟县"],"新疆":["乌鲁木齐","阿克苏","阿勒泰","阿图什","博乐","昌吉","东山","哈密","和田","喀什","克拉玛依","库车","库尔勒","奎屯","石河子","塔城","吐鲁番","伊宁"],"西藏":["拉萨","阿里","昌都","林芝","那曲","日喀则","山南"],"云南":["昆明","大理","保山","楚雄","大理","东川","个旧","景洪","开远","临沧","丽江","六库","潞西","曲靖","思茅","文山","西双版纳","玉溪","中甸","昭通"],"浙江":["杭州","温州","安吉","慈溪","定海","奉化","海盐","黄岩","湖州","嘉兴","金华","临安","临海","丽水","宁波","瓯海","平湖","千岛湖","衢州","江山","瑞安","绍兴","嵊州","台州","温岭","余姚","舟山"],"海外":["美国","日本","英国","法国","德国","其他"]} \ No newline at end of file diff --git a/miniprogram/account/pages/profile/profile.js b/miniprogram/account/pages/profile/profile.js index 1c44f65..a991f3f 100644 --- a/miniprogram/account/pages/profile/profile.js +++ b/miniprogram/account/pages/profile/profile.js @@ -1,5 +1,5 @@ const app = getApp(); -var locationData; +var locationData = require("./data.js"); Page({ data: { @@ -19,15 +19,15 @@ Page({ res.authen = res.authentication == "certified"; res.pro_authen = res.professional_certification == "certified"; this.setData(res); - if(!locationData) - this.readData(); this.setInfo(res); + }).catch(e=>{ + this.showError(e); }); }, setInfo(res){ let locations = Object.keys(locationData); let location_index = locations.indexOf(res.location); - let cities = locationData[res.location] || []; + let cities = locationData[res.location] || locationData['北京']; let city_index = cities.indexOf(res.location_city); let identity_index = -1; let { identities } = this.data; @@ -73,12 +73,13 @@ Page({ console.log(e) let {detail:{value:[location_index, city_index]}} = e; this.setData({location_index, city_index}); + this.setData({cities:locationData[this.data.locations[location_index]]}); }, onCitiesChange(e){ console.log(e); let {detail:{value,column}} = e; if(column==0) - this.setData({cities:locationData[this.data.locations[value]],location_index:value ,city_index:0}); + this.setData({cities:locationData[this.data.locations[value]],location_index:value ,city_index:-1}); }, onIdentityChange(e){ console.log(e); @@ -113,12 +114,6 @@ Page({ catchAvatar(){ app.navigateTo({url:"{image_crop}"}); }, - readData(){ - let fileManager = wx.getFileSystemManager(); - let data = fileManager.readFileSync("/account/pages/profile/data.png", "utf-8"); - locationData = JSON.parse(data); - console.log("readData", locationData); - }, onLoad: function (options) { this.refresh(); }, @@ -139,13 +134,14 @@ Page({ }, checkProInfo(value){ let info = this.originInfo; + console.log("info, value",info, value); if (info.identity != value.identity) return true; if(info.identity=='student'){ - if(info.student_id!=info.student_id) + if(info.student_id!=value.student_id) return true; }else{ - if (info.technical_title!=info.technical_title) + if (info.technical_title!=value.technical_title) return true; } if(info.school_id!=value.school_id||info.department_id!=value.department_id) @@ -154,11 +150,12 @@ Page({ }, onSubmit(e){ let {detail:{value}} = e; + console.log("onSubmit", value); if(!this.checkInput(value)) return; if(this.data.pro_authen&&this.checkProInfo(value)){ wx.showModal({ title: '确认修改', - content: '您修改了职业信息,保存后认证信息会清空,\n需要重新进行职业认证', + content: '您修改了职业信息,保存后认证信息会清空,需重新进行职业认证,\n是否保存?', confirmText:"保存", success:res=>{ if(res.confirm) @@ -226,6 +223,7 @@ Page({ showError(e){ let {message:error, during=2000} = e; if(error){ + error = error.replace(/\n/g, ""); this.setData({showError:1, error}); setTimeout(()=>{ this.setData({showError:0}); diff --git a/miniprogram/account/pages/profile/profile.json b/miniprogram/account/pages/profile/profile.json index d8bbc60..2aba679 100644 --- a/miniprogram/account/pages/profile/profile.json +++ b/miniprogram/account/pages/profile/profile.json @@ -1,4 +1,4 @@ { "usingComponents": {}, - "navigationBarTitleText": "" + "navigationBarTitleText": "基本信息" } \ No newline at end of file diff --git a/miniprogram/account/pages/profile/profile.wxml b/miniprogram/account/pages/profile/profile.wxml index 1723543..290ee81 100644 --- a/miniprogram/account/pages/profile/profile.wxml +++ b/miniprogram/account/pages/profile/profile.wxml @@ -32,7 +32,7 @@
所在地 - {{locations[location_index]}}-{{cities[city_index]}} + {{locations[location_index]}} {{cities[city_index]||'请选择'}} @@ -52,15 +52,17 @@
- 学校/单位 + {{identity_index<0?'学校/单位':identity_index==2?'单位':'学校'}} {{school_name||'请选择'}} - 院系/部门 + {{identity_index<0?'院系/部门':identity_index==2?'部门':'院系'}} {{departments[department_index].name||department_name||'请选择'}} - + + *我们确保您所提供的信息均处于严格保密状态,不会泄露 + \ No newline at end of file diff --git a/miniprogram/account/pages/profile/profile.wxss b/miniprogram/account/pages/profile/profile.wxss index e0b1fb8..e8b7c28 100644 --- a/miniprogram/account/pages/profile/profile.wxss +++ b/miniprogram/account/pages/profile/profile.wxss @@ -1,8 +1,9 @@ -.profile,page{ - background: #eeeeee; +@import "../form-item-common.wxss"; +.profile, page { height: 100%; } -.header{ + +.header { display: flex; align-items: center; justify-content: space-between; @@ -11,7 +12,8 @@ padding: 0 8px 0 16px; position: relative; } -.header>.error{ + +.header>.error { position: absolute; top: 0; left: 0; @@ -27,45 +29,32 @@ z-index: -1; opacity: 0; } -.error.show{ + +.error.show { opacity: 1; z-index: 100; } -.header>button{ +.header>button { margin: 2px 0; display: flex; align-items: center; } -.form-item{ - background: #fefefe; - display: flex; - justify-content: space-between; - align-items: center; - padding: 10px 12px; - margin-bottom: 1px; -} -.form-item>.value{ - text-align: right; - flex: auto; -} -.form-item>.key{ - display: inline-block; - flex: none; -} -.form-item .tip{ - font-size: 12px; - color: dimgray; -} -.form-item>switch{ - transform: scale(0.8) -} -.gap{ + +.gap { height: 3px; } -.avatar{ + +.avatar { border-radius: 50%; height: 30px; width: 30px; margin: 0 14px; -} \ No newline at end of file +} + +.footer { + font-size: 24rpx; + text-align: center; + margin-top: 12px; + color: grey; +} diff --git a/miniprogram/app.js b/miniprogram/app.js index 32c31d3..e784941 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -95,7 +95,7 @@ App({ shareApp({ imageUrl, path, title }) { return { title: title || "EduCoder教学", - imageUrl: imageUrl || "", + imageUrl, path } } diff --git a/miniprogram/app.json b/miniprogram/app.json index c27d61e..a4ac82b 100644 --- a/miniprogram/app.json +++ b/miniprogram/app.json @@ -11,7 +11,8 @@ "pages/findmore/findmore", "pages/home/home", "pages/tidings/tidings", - "components/rich-md/rich-md" + "components/rich-md/rich-md", + "dev/pages/dev/dev" ], "subpackages": [ { @@ -23,7 +24,10 @@ "pages/profile/profile", "pages/account/account", "pages/signUp/signUp", - "pages/profile/school_select/school_select" + "pages/profile/school_select/school_select", + "pages/authentication/authentication", + "pages/pro_authentication/pro_authentication", + "pages/accounts/accounts" ] }, { @@ -36,7 +40,11 @@ "root": "course", "pages": [ "pages/course/course", - "pages/course_invite/course_invite" + "pages/course_invite/course_invite", + "pages/course_setting/course_setting", + "pages/attendance_detail/attendance_detail", + "modules/attendance/attendance", + "pages/attendances/attendances" ] }, { diff --git a/miniprogram/app.wxss b/miniprogram/app.wxss index 5e76a17..67a633c 100644 --- a/miniprogram/app.wxss +++ b/miniprogram/app.wxss @@ -1,5 +1,5 @@ page { - background-color: #f1f1f1; + background-color: #f2f2f2; } .flex-wrap{ display: flex; diff --git a/miniprogram/components/add-tips/add-tips.js b/miniprogram/components/add-tips/add-tips.js index 37b4fc0..660318b 100644 --- a/miniprogram/components/add-tips/add-tips.js +++ b/miniprogram/components/add-tips/add-tips.js @@ -8,14 +8,15 @@ Component({ }, duration: { type: Number, - value: 3000 + value: 3 } }, data: { SHOW:false, SHOW_TOP: true, SHOW_MODAL: false, - statusBarHeight:20 + statusBarHeight:20, + attachDir:global.config.attachDir }, ready: function () { diff --git a/miniprogram/components/add-tips/add-tips.wxml b/miniprogram/components/add-tips/add-tips.wxml index 4655cae..ecfe553 100644 --- a/miniprogram/components/add-tips/add-tips.wxml +++ b/miniprogram/components/add-tips/add-tips.wxml @@ -3,18 +3,18 @@ {{text}} - + + diff --git a/miniprogram/shixun_homework/pages/shixun_homework/shixun_homework.js b/miniprogram/shixun_homework/pages/shixun_homework/shixun_homework.js index db6c5b0..9faaecf 100644 --- a/miniprogram/shixun_homework/pages/shixun_homework/shixun_homework.js +++ b/miniprogram/shixun_homework/pages/shixun_homework/shixun_homework.js @@ -9,13 +9,18 @@ Page({ this.setData({homework_id}); this.refresh(); }, - async refresh(){ + refresh(){ let {homework_id} = this.data; - let data = await app.api("homework_commons.works_list")({homework_id}); - this.setData(data); + app.api("homework_commons.works_list")({homework_id}) + .then(res=>{ + this.setData(res); + }) + .catch(e=>{ + app.showEror(e); + }) }, enterShixun(){ - app.navigateTo({url:`{shixun}?identifier=${this.data.shixun_identifier}`}); + app.redirectTo({url:`{shixun}?identifier=${this.data.shixun_identifier}`}); }, onPullDownRefresh: function () { diff --git a/miniprogram/sitemap.json b/miniprogram/sitemap.json index ca02add..58eb8d7 100644 --- a/miniprogram/sitemap.json +++ b/miniprogram/sitemap.json @@ -1,7 +1,17 @@ { "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", - "rules": [{ - "action": "allow", - "page": "*" - }] + "rules": [ + { + "action": "allow", + "page": "shixun/pages/shixun/shixun", + "params": [ + "identifier" + ], + "matching": "inclusive" + }, + { + "action": "allow", + "page": "*" + } + ] } \ No newline at end of file diff --git a/miniprogram/task/components/test_set/test_set.js b/miniprogram/task/components/test_set/test_set.js index 0a9ef67..4ba5d25 100644 --- a/miniprogram/task/components/test_set/test_set.js +++ b/miniprogram/task/components/test_set/test_set.js @@ -17,8 +17,13 @@ Component({ methods: { analyse(){ //console.log(this.data); - var outputs = this.data.data.output.split(/\n/).map(i=>({text:i})); - var actual_outputs = this.data.data.actual_output.split(/\n/).map(i=>({text:i})); + let {output="",actual_output=""} = this.data.data; + //console.log(this.data,actual_output,output); + output = output||""; + actual_output = actual_output||""; + console.log(this.data, actual_output, output); + var outputs = output.split(/\n/).map(i=>({text:i})); + var actual_outputs = actual_output.split(/\n/).map(i=>({text:i})); var lines = Math.min(outputs.length, actual_outputs.length); for(var i=0;i