微信小程序<button class="fudongShare" open-type="share" size="mini" type="warn"></button>
onShareAppMessage() {
let that = this;
console.log('onShareAppMessage', 'onShareAppMessage');
const promise = new Promise((resolve) => {
setTimeout(() => {
resolve({
title: '今日' + getApp().globalData.projectName,
});
}, 2000);
});
that.content.dayTime = that.inDate;
that.content.id = that.id;
that.content.title = that.title;
that.content.user_id = that.user_id;
let content = encodeURIComponent(JSON.stringify(that.content));
let param = {
reType: 'comm',
id: this.id,
// content: content
};
// console.log('/pages/index/builderDiary/update', JSON.stringify(param));
return {
// imageUrl: '/static/logo.png',
title: '今日' + getApp().globalData.projectName,
type: 2,
path: '/pages/index/builderDiary/update?param=' + JSON.stringify(param),
};
},
onUnload(options) {
// console.log(options)
var _this = this;
let res = await db.collection('bookRecord').where('_id=="' + id + '"').get()
console.log('res.result.data', res.result.data[0]);
let currentDiary = res.result.data[0];
this.content.detail.html = currentDiary.contentHtml;
this.content.detail.text = currentDiary.content;
this.inDate = currentDiary.inDate;
this.user_id = currentDiary.user_id;
},
1 个回复
DCloud_uniCloud_WYQ
有语法错误,await必须写在async方法内,注意看开发工具控制台应该给你报出来错误了。至于你说的手机上能执行的情况,确定下是不是手机上没有更新成新版