|
|
@ -176,6 +176,42 @@ App({
|
|
|
|
}else
|
|
|
|
}else
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
addToFavorites({title, query, imageUrl}={}){
|
|
|
|
|
|
|
|
let db = wx.cloud.database();
|
|
|
|
|
|
|
|
let data = {
|
|
|
|
|
|
|
|
title,
|
|
|
|
|
|
|
|
imageUrl,
|
|
|
|
|
|
|
|
query,
|
|
|
|
|
|
|
|
scene: this.globalData.scene,
|
|
|
|
|
|
|
|
version: config.version,
|
|
|
|
|
|
|
|
time: db.serverDate()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
db.collection("shareInfo").add({
|
|
|
|
|
|
|
|
type:"addToFavorites",
|
|
|
|
|
|
|
|
data
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
title, query, imageUrl
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
shareTimeline({title, query, imageUrl}={}){
|
|
|
|
|
|
|
|
let db = wx.cloud.database();
|
|
|
|
|
|
|
|
let data = {
|
|
|
|
|
|
|
|
title,
|
|
|
|
|
|
|
|
imageUrl,
|
|
|
|
|
|
|
|
query,
|
|
|
|
|
|
|
|
scene: this.globalData.scene,
|
|
|
|
|
|
|
|
version: config.version,
|
|
|
|
|
|
|
|
time: db.serverDate()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
db.collection("shareInfo").add({
|
|
|
|
|
|
|
|
type:"shareTimeline",
|
|
|
|
|
|
|
|
data
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
title, query, imageUrl
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
shareApp({ imageUrl, path, title="EduCoder教学"}={}) {
|
|
|
|
shareApp({ imageUrl, path, title="EduCoder教学"}={}) {
|
|
|
|
let db = wx.cloud.database();
|
|
|
|
let db = wx.cloud.database();
|
|
|
|
let shareInfo = {
|
|
|
|
let shareInfo = {
|
|
|
@ -183,7 +219,7 @@ App({
|
|
|
|
imageUrl,
|
|
|
|
imageUrl,
|
|
|
|
path
|
|
|
|
path
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (config.envVersion == 'release') {
|
|
|
|
if (config.envVersion == 'release'&&!this.globalData.isCrawl) {
|
|
|
|
if (!path) {
|
|
|
|
if (!path) {
|
|
|
|
let pages = getCurrentPages();
|
|
|
|
let pages = getCurrentPages();
|
|
|
|
let page = pages[pages.length - 1];
|
|
|
|
let page = pages[pages.length - 1];
|
|
|
@ -201,7 +237,8 @@ App({
|
|
|
|
time: db.serverDate()
|
|
|
|
time: db.serverDate()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log("upload", data);
|
|
|
|
console.log("upload", data);
|
|
|
|
db.collection("shareAppInfo").add({
|
|
|
|
db.collection("shareInfo").add({
|
|
|
|
|
|
|
|
type:"shareAppMessage",
|
|
|
|
data
|
|
|
|
data
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -210,7 +247,7 @@ App({
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 兼容finally
|
|
|
|
// 兼容Promise.finally
|
|
|
|
if(!Promise.prototype.finally){
|
|
|
|
if(!Promise.prototype.finally){
|
|
|
|
Promise.prototype.finally = function (callback) {
|
|
|
|
Promise.prototype.finally = function (callback) {
|
|
|
|
let P =this.constructor;
|
|
|
|
let P =this.constructor;
|
|
|
|