小钻风 4 years ago
parent 2f150545e9
commit 5ff010cd85

@ -125,15 +125,15 @@
<u-popup v-model="isShow" mode="bottom" border-radius="15"> <u-popup v-model="isShow" mode="bottom" border-radius="15">
<view class="share-box flex justify-between"> <view class="share-box flex justify-between">
<view class="flex-sub flex justify-center"> <view class="flex-sub flex justify-center">
<button class="flex flex-direction justify-center align-center" open-type="share" @tap="hideModel"> <button class="flex flex-direction justify-center align-center" open-type="share" >
<image class="share-icon" src="/static/mine/wx.png" mode="widthFix"></image> <image class="share-icon" src="/static/mine/wx.png" mode="widthFix"></image>
<view class="txt">小程序海报</view> <view class="txt">微信好友</view>
</button> </button>
</view> </view>
<view class="flex-sub flex justify-center"> <view class="flex-sub flex justify-center">
<button class="flex flex-direction justify-center align-center" open-type="share" @tap="hideModel"> <button class="flex flex-direction justify-center align-center" @tap="copyLink">
<image class="share-icon" src="/static/mine/wx.png" mode="widthFix"></image> <image class="share-icon" src="/static/mine/wx.png" mode="widthFix"></image>
<view class="txt">微信好友</view> <view class="txt">复制链接</view>
</button> </button>
</view> </view>
<view class="flex-sub flex justify-center"> <view class="flex-sub flex justify-center">
@ -285,10 +285,23 @@
this.getActivity() this.getActivity()
}, },
methods: { methods: {
//
shareBtn(data){ shareBtn(data){
this.isShow = true this.isShow = true
this.onShareData = data this.onShareData = data
}, },
//
copyLink(){
// /pages/goodsDetail/goodsDetail?id=' + this.onShareData.id
// https://h5.reecook.cn/#/goods/detail/14337/R7M1V9
let url = `/pages/goodsDetail/goodsDetail?id=${this.onShareData.id}`
uni.setClipboardData({
data: url,
success: function () {
console.log('success');
}
});
},
// //
getCityName() { getCityName() {
uni.getLocation({ uni.getLocation({
@ -642,32 +655,38 @@
this.getGoodsList() this.getGoodsList()
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
console.log(this.onShareData)
let shareObj = {
title: '',
path: "/pages/index/index?invite=" + this.$store.state.invitationNo,
imageUrl: ''
}
if (res.from === 'button') { // if (res.from === 'button') { //
console.log(res) return {
if (res.target.dataset.title) { title: "我在买" + this.onShareData.name + ",快来看看吧!",
shareObj = { path: '/pages/goodsDetail/goodsDetail?id=' + this.onShareData.id + "&type=share&invite=" + this.$store.state.invitationNo,
title: "我在买" + res.target.dataset.title + ",快来看看吧!", imageUrl: this.IMAGE_URL + this.onShareData.url
path: '/pages/goodsDetail/goodsDetail?id=' + res.target.dataset.id + "&type=share&invite=" + this.$store.state.invitationNo,
imageUrl: this.IMAGE_URL + res.target.dataset.url
}
} else {
shareObj = {
title: uni.getStorageSync("userInfo").nickname + '正在邀请您加入瑞库客0成本带您玩转副业',
path: '/pages/login/login?type=share&invite=' + this.$store.state.invitationNo,
imageUrl: this.STATIC_URL + 'invite.jpg'
}
} }
} else { }
// let shareObj = {
// title: '',
// path: "/pages/index/index?invite=" + this.$store.state.invitationNo,
// imageUrl: ''
// }
// if (res.from === 'button') { //
// console.log(res)
// if (res.target.dataset.title) {
// shareObj = {
// title: "" + res.target.dataset.title + ",",
// path: '/pages/goodsDetail/goodsDetail?id=' + res.target.dataset.id + "&type=share&invite=" + this.$store.state.invitationNo,
// imageUrl: this.IMAGE_URL + res.target.dataset.url
// }
// } else {
// shareObj = {
// title: uni.getStorageSync("userInfo").nickname + '0',
// path: '/pages/login/login?type=share&invite=' + this.$store.state.invitationNo,
// imageUrl: this.STATIC_URL + 'invite.jpg'
// }
// }
// } else {
} // }
console.log(shareObj) // console.log(shareObj)
return shareObj // return shareObj
}, },
} }
</script> </script>

Loading…
Cancel
Save