详情页分享功能+首页分享

main
shuxiaoquan 8 months ago
parent 3ce7fa0ac6
commit 4cb75523ca
  1. 9
      pages/goods/detail.vue
  2. 19
      pages/index/index.vue

@ -395,7 +395,7 @@
</view> </view>
<view class="shareWechat" v-if="shareType=='share'"> <view class="shareWechat" v-if="shareType=='share'">
<view class="shareGoods"> <view class="shareGoods">
<image :src="goods.goods_image" mode="" class="shareImg"></image> <image :src="goods.goods_image" mode="heightFix" class="shareImg"></image>
</view> </view>
<view class="shareInfo"> <view class="shareInfo">
<view class="shareGoodsInfo"> <view class="shareGoodsInfo">
@ -1042,8 +1042,13 @@
toHaibao(index) { toHaibao(index) {
this.shareCancel(); this.shareCancel();
if (index == 2) { if (index == 2) {
let str = `${this.goods.goods_name}\n
前台价${this.goods.goods_price_max}\n
推广价${this.goods.goods_price_min}\n
SKU${this.goods.goods_no}
`
uni.setClipboardData({ uni.setClipboardData({
data: this.goods.goods_name, // value data: str, // value
success: function() { success: function() {
// //
uni.showToast({ uni.showToast({

@ -1077,6 +1077,25 @@
this.isTop = true this.isTop = true
} }
}, },
/**
* 分享当前页面
*/
onShareAppMessage() {
return {
}
},
/**
* 分享到朋友圈
* 本接口为 Beta 版本暂只在 Android 平台支持详见分享到朋友圈 (Beta)
* https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html
*/
onShareTimeline() {
return {
}
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

Loading…
Cancel
Save