Skip to content

Commit

Permalink
update cloud functions
Browse files Browse the repository at this point in the history
  • Loading branch information
myvin committed Sep 30, 2021
1 parent 2ab34c9 commit 00e7734
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 51 deletions.
4 changes: 1 addition & 3 deletions cloudfunction/getBroadcast/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const cloud = require('wx-server-sdk')
cloud.init()
const db = cloud.database({
env: 'envid',
})
const db = cloud.database()
exports.main = async (event, context) => {
return db.collection('broadcast')
.where({
Expand Down
4 changes: 1 addition & 3 deletions cloudfunction/getHotCities/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const cloud = require('wx-server-sdk')
cloud.init()
const db = cloud.database({
env: 'envid',
})
const db = cloud.database()
exports.main = async (event, context) => {
return db.collection('hotCities')
.get()
Expand Down
9 changes: 0 additions & 9 deletions cloudfunction/getShareInfo/index.js

This file was deleted.

14 changes: 0 additions & 14 deletions cloudfunction/getShareInfo/package.json

This file was deleted.

Binary file added img/share/img1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 9 additions & 22 deletions pages/index/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,23 +378,6 @@ Page({
},
onShow() {
this.showInterstitialAd()
// onShareAppMessage 要求同步返回
if (!utils.isEmptyObject(this.data.shareInfo)) {
return
}
wx.cloud.callFunction({
name: 'getShareInfo',
})
.then(res => {
let shareInfo = res.result
if (shareInfo) {
if (!utils.isEmptyObject(shareInfo)) {
this.setData({
shareInfo,
})
}
}
})
},
onLoad () {
this.reloadPage()
Expand Down Expand Up @@ -474,12 +457,16 @@ Page({
this.checkUpdate(setting)
})
},
onShareAppMessage (res) {
let shareInfo = this.data.shareInfo
onShareAppMessage () {
return {
title: '出行天气早知道',
path: '/pages/index/index',
imageUrl: '/img/share/img1.png',
}
},
onShareTimeline () {
return {
title: shareInfo.title || 'Quiet Weather',
path: shareInfo.path || '/pages/index/index',
imageUrl: shareInfo.imageUrl,
title: '出现天气早知道',
}
},
menuHide () {
Expand Down

0 comments on commit 00e7734

Please sign in to comment.