<view>
test
</view>
</template>
<script>
var app = getApp();
export default {
data() {
return {
fromTimeline: false
};
},
components: {
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that = this;
//#ifdef MP-WEIXIN
that.fromTimeline = app.globalData.fromTimeline;
if (!that.fromTimeline) {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
});
}
//#endif
},
//#ifdef MP-WEIXIN
onShareTimeline: function() {
return {
title: 'test',
query: ''
};
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
var that = this;
return {
title: 'test',
path: '/pages/index/index'
};
},
//#endif
methods: {
}
};
</script>
<style>
</style>
![3***@qq.com](https://img-cdn-tc.dcloud.net.cn/account/identicon/fa0e613fdc14c6b4e9b261fc5a18ba16.png)
- 发布:2020-07-15 14:59
- 更新:2020-12-14 11:17
- 阅读:3164
产品分类: HbuilderX
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: windows 10
HBuilderX版本号: 2.7.14
示例代码:
操作步骤:
复制上述示例代码新建页面后可测试
复制上述示例代码新建页面后可测试
预期结果:
分享到朋友圈并打开后,能正常显示页面内容
分享到朋友圈并打开后,能正常显示页面内容
实际结果:
从朋友圈分享的小程序打开页面后,页面空白,在调试模式下显示错误
从朋友圈分享的小程序打开页面后,页面空白,在调试模式下显示错误
bug描述:
开发微信小程序,配置分享朋友圈功能后,能正常在微信小程序页面上显示分享朋友圈按钮,但分享到朋友圈后,页面打开空白,页面上已按微信文档说明,去除了所有禁用的能力代码。
代码示例中 app.globalData.fromTimeline 值来自于 App.vue 的onLaunch的回调,res.scene == 1154时为true
微信端调试模式下,错误显示如下:
MiniProgramError
Error
line:2,column:654719,Error: APP-SERVICE-SDK:shareImageMessage:fail rejected due to no permission currently Stack:construct@[native code]
r@https://lib/WASubContext.js:2:654719
n@https://lib/WASubContext.js:2:796016
construct@[native code]
https://lib/WASubContext.js:2:462350
r@https://lib/WASubContext.js:2:466265
https://lib/WASubContext.js:2:1643757
https://usr/app-service.js:10316:27431
forEach@[native code]
https://usr/app-service.js:10316:27411
https://usr/app-service.js:10308:4802
f5e2@https://usr/app-service.js:10308:6936
i@https://usr/app-service.js:10312:1142
31ee@https://usr/app-service.js:10308:1301
i@https://usr/app-service.js:10312:1142
https://usr/app-service.js:10308:1495
i@https://usr/app-service.js:10312:1142
https://usr/app-service.js:10308:544
015b@https://usr/app-service.js:10308:1236
i@https://usr/app-service.js:10312:1142
o@https://usr/app-service.js:10312:994
https://usr/app-service.js:10308:64
require@https://lib/WASubContext.js:2:1959115
https://lib/WASubContext.js:2:1958494
https://usr/app-service.js:10320:82
require@https://lib/WASubContext.js:2:1959115
global code@https://usr/app-service.js:10321:17
[native code]
value@https://lib/WAServiceMainContext.js:2:149710
https://lib/WAServiceMainContext.js:2:152284
forEach@[native code]
https://lib/WAServiceMainContext.js:2:152251
h@https://lib/WAServiceMainContext.js:2:81695
g@https://lib/WAServiceMainContext.js:2:81945
a@https://lib/WAServiceMainContext.js:2:151376
https://lib/WAServiceMainContext.js:2:152825
https://lib/WAServiceMainContext.js:2:143226
https://lib/WAServiceMainContext.js:2:252375
https://lib/WAServiceMainContext.js:2:251343
forEach@[native code]
https://lib/WAServiceMainContext.js:2:251307
https://lib/WAServiceMainContext.js:2:252375
_@https://lib/WAServiceMainContext.js:2:78182
global code
4 个回复
alexlinlin
我们也出现
让世界变得安静 - 让世界变得安静
解决了么。
aliang888
可以分享到朋友圈,但是自定义参数无效,坐等uniapp官方发布新版本,已好久没有更新版本了
3w - 码农一枚
问题解决了吗