diff --git a/changelog.md b/changelog.md index 87b4b9e..2a68080 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +## v0.16.10 + * U 登录界面优化 + ## v0.16.9 * A 管理界面浏览历史查看 * A 使用一些功能时登录校验 diff --git a/miniprogram/app.js b/miniprogram/app.js index 71da813..56e4b67 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -178,12 +178,37 @@ App({ }else return true; }, - shareApp({ imageUrl, path, title }) { - return { - title: title || "EduCoder教学", + shareApp({ imageUrl, path, title="EduCoder教学"}={}) { + let db = wx.cloud.database(); + let shareInfo = { + title, imageUrl, path } + console.log(shareInfo); + if(!path){ + let pages = getCurrentPages(); + let page = pages[pages.length-1]; + //console.log(page); + let options = page.options; + let route = page.route; + let query = Object.keys(options).map(i=>`${i}=${options[i]}`).join("&"); + console.log(query, "/" + route + (query?('?'+query):'')); + path = "/" + route + (query?('?'+query):''); + } + let data = { + title, + imageUrl, + path, + scene:this.globalData.scene, + time: db.serverDate() + } + console.log("upload", data); + db.collection("shareAppInfo").add({ + data + }); + console.log(shareInfo); + return shareInfo; } }); diff --git a/miniprogram/config.js b/miniprogram/config.js index a7a45b6..646a814 100644 --- a/miniprogram/config.js +++ b/miniprogram/config.js @@ -1,8 +1,7 @@ const cloudDir = "cloud://educoder.6564-educoder-1300855313/"; -let _version = "0.16.9"; -/** - */ +let _version = "0.16.10"; + let { miniProgram:{ envVersion="release", version=_version}={}} = wx.getAccountInfoSync(); version = version||_version; const developUrl = "https://test-newweb.educoder.net"; diff --git a/miniprogram/course/pages/attendances/attendances.js b/miniprogram/course/pages/attendances/attendances.js index 5a04f35..746b470 100644 --- a/miniprogram/course/pages/attendances/attendances.js +++ b/miniprogram/course/pages/attendances/attendances.js @@ -61,6 +61,6 @@ Page({ * 用户点击右上角分享 */ onShareAppMessage: function () { - + } }) \ No newline at end of file diff --git a/miniprogram/course/pages/course/course.js b/miniprogram/course/pages/course/course.js index 05d93a3..ced2d89 100644 --- a/miniprogram/course/pages/course/course.js +++ b/miniprogram/course/pages/course/course.js @@ -321,8 +321,9 @@ Component({ this.refresh(); }, onShareAppMessage: function () { + let {course} = this.data; return app.shareApp({ - title: this.data.name, + title: "「教学课堂」"+ course.name, path: "/"+this.route+`?course_id=${this.data.course_id}&module_type=${this.data.module.type}` }) } diff --git a/miniprogram/course/pages/course_invite/course_invite.js b/miniprogram/course/pages/course_invite/course_invite.js index 8fca1dc..e902207 100644 --- a/miniprogram/course/pages/course_invite/course_invite.js +++ b/miniprogram/course/pages/course_invite/course_invite.js @@ -120,6 +120,9 @@ Page({ this.pull_course() }, onShareAppMessage(){ - + let {course} = this.data; + return app.shareApp({ + title: "「课堂邀请」" + course.name + }) } }) \ No newline at end of file diff --git a/miniprogram/markdown/task/task/task.js b/miniprogram/markdown/task/task/task.js index b3cc541..2109b02 100644 --- a/miniprogram/markdown/task/task/task.js +++ b/miniprogram/markdown/task/task/task.js @@ -262,7 +262,7 @@ Page({ onShareAppMessage: function () { let {challenge, shixun} = this.data; return app.shareApp({ - title:`第${challenge.position}关:${challenge.subject}`, + title:`「实训项目」第${challenge.position}关:${challenge.subject}`, imageUrl: global.config.eduImgDir + "avatars/Shixun/" + shixun.id, path:`/shixun/pages/shixun/shixun?identifier=${shixun.identifier}&cate_type=task` }) diff --git a/miniprogram/pages/home/home.js b/miniprogram/pages/home/home.js index 1fbd54a..0282c7d 100644 --- a/miniprogram/pages/home/home.js +++ b/miniprogram/pages/home/home.js @@ -194,5 +194,6 @@ Page({ app.navigateTo({url:"{user_info}"}); }, onShareAppMessage: function () { + return app.shareApp() } }) \ No newline at end of file diff --git a/miniprogram/pages/search/search.js b/miniprogram/pages/search/search.js index 1bab758..0c406e5 100644 --- a/miniprogram/pages/search/search.js +++ b/miniprogram/pages/search/search.js @@ -79,6 +79,7 @@ Page({ onShareAppMessage: function () { let {type="shixun",keyword=""} = this.options; return app.shareApp({ + title:"搜索", path: `/pages/search/search?type=${type}&keyword=${keyword}` }) } diff --git a/miniprogram/pages/tidings/tidings.js b/miniprogram/pages/tidings/tidings.js index 1242e0a..dbfca30 100644 --- a/miniprogram/pages/tidings/tidings.js +++ b/miniprogram/pages/tidings/tidings.js @@ -32,7 +32,7 @@ Page({ this.setData({current: 2}); }, changeType({detail:{current, value}}){ - this.options.type=value.type; + this.options_.type=value.type; this.refresh({refresh:1}) .then(res=>{ this.setData({scrollTop:0}); @@ -42,17 +42,17 @@ Page({ if(refresh){ this.setData({ loading: 1 }); if(refresh==1){ - this.options.page=1; - var { options } = this; + this.options_.page=1; + var { options_ } = this; }else if(refresh==2){ - var { per_page, page, type} = this.options; - var options = {per_page:per_page*page, page:1, type}; + var { per_page, page, type} = this.options_; + var options_ = {per_page:per_page*page, page:1, type}; } }else{ - this.options.page++; - var {options} = this; + this.options_.page++; + var {options_} = this; } - return app.api("users.tidings")(options).then(res => { + return app.api("users.tidings")(options_).then(res => { let {tidings, course_apply_count} = res; if(!refresh) tidings = this.data.tidings.concat(tidings); @@ -67,12 +67,12 @@ Page({ return e; }) }, - onLoad: function (options) { + onLoad: function () { let key = `cache-users.tidings-${app.user().user_id}`; let cache_tidings = wx.getStorageSync(key); if(cache_tidings) this.setData({tidings: cache_tidings}); - this.options = { page: 1, per_page: 10 }; + this.options_ = { page: 1, per_page: 10 }; this.refresh({refresh:1}).then(res=>{ console.log("pull", res); this.loaded = 1; @@ -96,6 +96,7 @@ Page({ }, onShareAppMessage: function () { - + return app.shareApp({ + }); } }) \ No newline at end of file diff --git a/miniprogram/shixun_homework/pages/shixun_homework/shixun_homework.js b/miniprogram/shixun_homework/pages/shixun_homework/shixun_homework.js index b93f6cb..4647b33 100644 --- a/miniprogram/shixun_homework/pages/shixun_homework/shixun_homework.js +++ b/miniprogram/shixun_homework/pages/shixun_homework/shixun_homework.js @@ -27,6 +27,6 @@ Page({ }, onShareAppMessage: function () { - + return app.shareApp() } }) \ No newline at end of file