添加小程序分享功能

This commit is contained in:
xuwenbo
2020-09-12 11:03:10 +08:00
parent dea2c42701
commit 6beae9bfb2
5 changed files with 81 additions and 2 deletions

View File

@ -58,7 +58,7 @@
">
<span class="iconfont icon-xiaolian"></span>恭喜您砍价成功,快去支付吧~
</view>
<view v-if="userBargainStatus == 0 && bargainPartake === userInfo.uid" class="bargainBnt" @click="goParticipate">
立即参与砍价</view>
<view class="bargainBnt" @click="goPoster" v-if="
@ -244,6 +244,24 @@
}, 500);
},
methods: {
onShareAppMessage: function() {
return {
title: this.storeInfo.title,
imageUrl: this.storeInfo.image,
path: "pages/activity/DargainDetails/index?id="+this.storeInfo.id+"&spread=" + uni.getStorageSync("uid"),
success(res) {
uni.showToast({
title: '分享成功'
})
},
fail(res) {
uni.showToast({
title: '分享失败',
icon: 'none'
})
}
}
},
//参与砍价
goParticipate() {
if (this.bargainPartake === this.userInfo.uid) this.getBargainStart();

View File

@ -247,6 +247,24 @@
this.mountedStart();
},
methods: {
onShareAppMessage: function() {
return {
title: this.storeInfo.title,
imageUrl: this.storeInfo.image,
path: "pages/activity/GroupDetails/index?id="+this.storeInfo.id+"&spread=" + uni.getStorageSync("uid"),
success(res) {
uni.showToast({
title: '分享成功'
})
},
fail(res) {
uni.showToast({
title: '分享失败',
icon: 'none'
})
}
}
},
openAlone: function () {
this.$yrouter.push({
path: "/pages/shop/GoodsCon/index",
@ -434,7 +452,7 @@
this.$set(this, "attrTxt", "请选择");
}
},
openTeam: function () {
var that = this;
if (that.attr.cartAttr == false) {

View File

@ -150,6 +150,24 @@
this.mountedStart();
},
methods: {
onShareAppMessage: function() {
return {
title: this.storeInfo.title,
imageUrl: this.storeInfo.image,
path: "pages/activity/GoodsSeckill/index?id="+this.storeInfo.id+"&spread=" + uni.getStorageSync("uid"),
success(res) {
uni.showToast({
title: '分享成功'
})
},
fail(res) {
uni.showToast({
title: '分享失败',
icon: 'none'
})
}
}
},
openAlone: function () {
this.$yrouter.push({
path: "/pages/shop/GoodsCon/index",

View File

@ -232,6 +232,13 @@
},
methods: {
...mapActions(["getLocation"]),
onShareAppMessage: function() {
return {
title: this.miniHomeRemark,
imageUrl: this.miniHomeImg,
path: "pages/home/index?spread=" + uni.getStorageSync("uid")
}
},
goRoll(item) {
if (item.uniapp_url) {
this.$yrouter.push(item.uniapp_url)

View File

@ -319,6 +319,24 @@
},
},
methods: {
onShareAppMessage: function() {
return {
title: this.storeInfo.storeName,
imageUrl: this.storeInfo.image,
path: "pages/shop/GoodsCon/index?id="+this.storeInfo.id+"&spread=" + uni.getStorageSync("uid"),
success(res) {
uni.showToast({
title: '分享成功'
})
},
fail(res) {
uni.showToast({
title: '分享失败',
icon: 'none'
})
}
}
},
goShoppingCart() {
this.$yrouter.switchTab("/pages/shop/ShoppingCart/index");
},