hookehuyr

refactor(分享功能): 移除分享成功和失败的回调处理逻辑

<!--
* @Date: 2025-06-28 10:33:00
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-07-07 15:34:42
* @LastEditTime: 2025-07-07 16:02:49
* @FilePath: /jgdl/src/pages/index/index.vue
* @Description: 捡个电驴首页
-->
......@@ -397,34 +397,6 @@ useShareAppMessage(() => {
title: '捡个电驴-分享给好友', // 默认是小程序的名称(可以写slogan等)
path: `pages/index/index`, // 默认是当前页面,必须是以'/'开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function (res) {
// 转发成功之后的回调
if (res.errMsg == 'shareAppMessage:ok') {
Taro.showToast({
title: '分享成功',
icon: 'success'
})
}
},
fail: function () {
// 转发失败之后的回调
if (res.errMsg == 'shareAppMessage:fail cancel') {
// 用户取消转发
Taro.showToast({
title: '分享取消',
icon: 'none'
})
} else if (res.errMsg == 'shareAppMessage:fail') {
// 转发失败,其中 detail message 为详细失败信息
Taro.showToast({
title: '分享失败',
icon: 'none'
})
}
},
complete: function () {
// 转发结束之后的回调(转发成不成功都会执行)
}
}
// 来自页面内的按钮的转发
// if (options.from == 'button') {
......
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-07-07 15:51:00
* @LastEditTime: 2025-07-07 16:03:15
* @FilePath: /jgdl/src/pages/productDetail/index.vue
* @Description: 商品详情页
-->
......@@ -494,34 +494,6 @@ useShareAppMessage(() => {
title: product.value.name, // 默认是小程序的名称(可以写slogan等)
path: `pages/productDetail/index?id=${params.id}`, // 默认是当前页面,必须是以'/'开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function (res) {
// 转发成功之后的回调
if (res.errMsg == 'shareAppMessage:ok') {
Taro.showToast({
title: '分享成功',
icon: 'success'
})
}
},
fail: function () {
// 转发失败之后的回调
if (res.errMsg == 'shareAppMessage:fail cancel') {
// 用户取消转发
Taro.showToast({
title: '分享取消',
icon: 'none'
})
} else if (res.errMsg == 'shareAppMessage:fail') {
// 转发失败,其中 detail message 为详细失败信息
Taro.showToast({
title: '分享失败',
icon: 'none'
})
}
},
complete: function () {
// 转发结束之后的回调(转发成不成功都会执行)
}
}
// 来自页面内的按钮的转发
// if (options.from == 'button') {
......