小程序商品信息界面分享到朋友圈加上以下代码,适合大部分用uniapp打包的,原生小程序一般也是没问题的
在\view\uni-app\pages\goods_details加上以下代码 在用户点击右上角分享的后面,
/**
* 用户点击右上角分享
*/
// #ifdef MP
onShareAppMessage: function() {
let that = this;
that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
userShare();
return {
title: that.storeInfo.store_name || '',
imageUrl: that.storeInfo.image || '',
path: '/pages/goods_details/index?id=' + that.id + '&spid=' + that.uid
};
},
就是上面这一句的后面,不懂看下面的图
//分享到朋友圈
onShareTimeline: function() {
let that = this;
that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
userShare();
return {
title: that.storeInfo.store_name || '',
imageUrl: that.storeInfo.image || '',
path: '/pages/goods_details/index?id=' + that.id + '&spid=' + that.uid
};
},
如要显示销售价的话 用下面的代码 ps:¥你可以改为销售价啊,秒杀价啊,什么什么的,看你心情,你要咋改就咋改
//分享到朋友圈
onShareTimeline: function() {
let that = this;
that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
userShare();
return {
title: '¥' + '【' + that.storeInfo.price + '】' + that.storeInfo.store_name || '',
imageUrl: that.storeInfo.image || '',
path: '/pages/goods_details/index?id=' + that.id + '&spid=' + that.uid
};
},
下面为显示销售价的
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。