分享功能
This commit is contained in:
@@ -17,7 +17,9 @@
|
||||
"delay": 0
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules": {},
|
||||
"modules": {
|
||||
"Share": {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"distribute": {
|
||||
/* android打包配置 */
|
||||
@@ -43,7 +45,14 @@
|
||||
/* ios打包配置 */
|
||||
"ios": {},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs": {}
|
||||
"sdkConfigs": {
|
||||
"share": {
|
||||
"weixin": {
|
||||
"appid": "wx8da30ba464a770ba",
|
||||
"UniversalLinks": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
|
||||
@@ -80,8 +80,41 @@
|
||||
this.getBanner()
|
||||
this.getImgUrl()
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
wx.showShareMenu({
|
||||
withShareTicket: true,
|
||||
//设置下方的Menus菜单,才能够让发送给朋友与分享到朋友圈两个按钮可以点击
|
||||
menus: ["shareAppMessage", "shareTimeline"]
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
//分享到微信好友
|
||||
onShareAppMessage(res) {
|
||||
// 此处的distSource为分享者的部分信息,需要传递给其他人
|
||||
let distSource = uni.getStorageSync('distSource');
|
||||
if (distSource) {
|
||||
return {
|
||||
title: '食瞳',
|
||||
type: 0,
|
||||
path: '/pages/index/index?id=' + distSource,
|
||||
summary: "",
|
||||
imageUrl: "https://pupil.hchyun.com/uploads/product/zhanwei02.png"
|
||||
}
|
||||
}
|
||||
},
|
||||
//分享到朋友圈
|
||||
onShareTimeline(res) {
|
||||
let distSource = uni.getStorageSync('distSource');
|
||||
if (distSource) {
|
||||
return {
|
||||
title: '食瞳',
|
||||
type: 0,
|
||||
query: 'id=' + distSource,
|
||||
summary: "",
|
||||
imageUrl: "https://pupil.hchyun.com/uploads/product/zhanwei02.png"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//获取按上架时间排列的产品列表length
|
||||
getTimeLength(e) {
|
||||
this.reachBottomLength = e
|
||||
|
||||
Reference in New Issue
Block a user