Browse Source

添加小程序分享功能

zyh
xuwenbo 4 years ago
parent
commit
6beae9bfb2
  1. 20
      pages/activity/DargainDetails/index.vue
  2. 20
      pages/activity/GroupDetails/index.vue
  3. 18
      pages/activity/SeckillDetails/index.vue
  4. 7
      pages/home/index.vue
  5. 18
      pages/shop/GoodsCon/index.vue

20
pages/activity/DargainDetails/index.vue

@ -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();

20
pages/activity/GroupDetails/index.vue

@ -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) {

18
pages/activity/SeckillDetails/index.vue

@ -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",

7
pages/home/index.vue

@ -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)

18
pages/shop/GoodsCon/index.vue

@ -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");
},

Loading…
Cancel
Save