feat:小程序

This commit is contained in:
2026-07-23 14:02:58 +08:00
committed by charles
parent 0d2c0d2bde
commit 21225998e5
5 changed files with 52 additions and 86 deletions
+27 -40
View File
@@ -495,6 +495,20 @@ export default {
timer && clearTimeout(timer);
timer = null;
},
onShareAppMessage(res) {
return {
title: this.orderInfo.name || "商品分享",
path: `/pages/other_package/productInfo/productInfo?id=${this.id}`,
imageUrl: this.swiperList.length > 0 ? this.swiperList[0] : "",
};
},
onShareTimeline(res) {
return {
title: this.orderInfo.name || "商品分享",
query: `id=${this.id}`,
imageUrl: this.swiperList.length > 0 ? this.swiperList[0] : "",
};
},
methods: {
assembleAddress,
limit999(n) {
@@ -554,45 +568,18 @@ export default {
// 微信小程序环境分享
onWxShare(index) {
console.log("分享", index);
// const shareParams = {
// title: this.orderInfo.name || "商品分享",
// path: `/pages/other_package/productInfo/productInfo?id=${this.id}${this.orderInfo.name}`,
// imageUrl: this.swiperList.length > 0 ? this.swiperList[0] : "",
// };
// if (index == 0) {
// uni.share({
// provider: "weixin",
// scene: "WXSceneSession", // 好友场景
// title: shareParams.title,
// path: shareParams.path,
// imageUrl: shareParams.imageUrl,
// success: (res) => {
// console.log("分享好友成功", res);
// uni.showToast({ title: "分享成功", icon: "success" });
// },
// fail: (err) => {
// console.log("分享好友失败", err);
// uni.showToast({ title: "分享取消", icon: "none" });
// },
// });
// } else {
// // 分享到微信朋友圈
// uni.share({
// provider: "weixin",
// scene: "WXSceneTimeline", // 朋友圈场景
// title: shareParams.title,
// path: shareParams.path,
// imageUrl: shareParams.imageUrl,
// success: (res) => {
// console.log("分享朋友圈成功", res);
// uni.showToast({ title: "分享成功", icon: "success" });
// },
// fail: (err) => {
// console.log("分享朋友圈失败", err);
// uni.showToast({ title: "分享取消", icon: "none" });
// },
// });
// }
if (index == 0) {
// 微信好友,通过button open-type="share"触发,这里只需要关闭弹窗
this.onClose();
} else {
// 分享到微信朋友圈
// 小程序不支持API直接唤起朋友圈分享,提示用户点击右上角
uni.showModal({
title: "提示",
content: "请点击右上角...分享到朋友圈",
showCancel: false,
});
}
},
onShare(index) {
let tmp = `【信任桥】消费共享数字化权益 ${SHARE_URL}/#/pages/other_package/productInfo/productInfo?id=${this.id} ${this.orderInfo.name}`;
@@ -1372,7 +1359,7 @@ export default {
.img_comm {
position: absolute;
top: 140rpx;
top: 170rpx;
}
.left_warp {