U 优化分享

master
educoder_weapp 5 years ago
parent 0995346d72
commit 2b2bebf70a

@ -1,3 +1,6 @@
## v0.16.10
* U 登录界面优化
## v0.16.9
* A 管理界面浏览历史查看
* A 使用一些功能时登录校验

@ -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;
}
});

@ -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";

@ -61,6 +61,6 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

@ -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}`
})
}

@ -120,6 +120,9 @@ Page({
this.pull_course()
},
onShareAppMessage(){
let {course} = this.data;
return app.shareApp({
title: "「课堂邀请」" + course.name
})
}
})

@ -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`
})

@ -194,5 +194,6 @@ Page({
app.navigateTo({url:"{user_info}"});
},
onShareAppMessage: function () {
return app.shareApp()
}
})

@ -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}`
})
}

@ -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({
});
}
})

@ -27,6 +27,6 @@ Page({
},
onShareAppMessage: function () {
return app.shareApp()
}
})
Loading…
Cancel
Save