feat: 新增拼团

This commit is contained in:
2026-09-29 10:55:30 +08:00
parent f7b9e66172
commit d9142b0ac7
36 changed files with 7689 additions and 878 deletions
+30 -12
View File
@@ -379,9 +379,9 @@ export default {
// #ifdef MP
const hasSeenGuide = uni.getStorageSync("has_seen_home_guide");
if (hasSeenGuide) {
uni.showTabBar({ animation: false, fail: () => {} });
uni.showTabBar({ animation: false, fail: () => { } });
} else {
uni.hideTabBar({ animation: false, fail: () => {} });
uni.hideTabBar({ animation: false, fail: () => { } });
}
// #endif
this.refreshKefuUnread();
@@ -720,21 +720,39 @@ export default {
let _this = this;
uni.getClipboardData({
success: function (res) {
// http://localhost:5173/#/pages/other_package/productInfo/productInfo?id=1038
console.log(res.data); // 剪贴板内容
if (
res.data.indexOf(
`${SHARE_URL}/#/pages/other_package/productInfo/productInfo?id=`,
) != -1
) {
const text = res.data || "";
console.log('剪贴板内容', text);
const isGroupDetail = text.indexOf("pages/active/group-detail/group-detail") !== -1;
const isProductInfo = text.indexOf("pages/other_package/productInfo/productInfo") !== -1;
const hasShareUrl = (SHARE_URL && text.indexOf(SHARE_URL) !== -1) ||
text.indexOf("https://h.tbmall.xin") !== -1 ||
text.indexOf("https://h.o.tbmall.xin") !== -1;
if (isGroupDetail || isProductInfo || hasShareUrl) {
uni.showModal({
title: "",
content: "当前APP想要粘贴商品详情,是否继续?",
success: (res1) => {
if (res1.confirm) {
let id = res.data.match(/=(.*?)\s/);
_this.curId = Number(id[1]);
_this.getShop();
const teamMatch = text.match(/[?&]teamId=([^& \s]+)/);
const teamId = teamMatch ? teamMatch[1] : "";
const match = text.match(/[?&]id=([^& \s]+)/);
const id = match ? match[1] : "";
console.log("获取id", id, "teamId", teamId);
// 识别到了有 teamId,跳转到拼团详情页(展示“参加这个团”场景)
if (teamId) {
uni.navigateTo({
url: `/pages/active/group-detail/group-detail?teamId=${teamId}&id=${id}`,
});
} else if (text.indexOf('activedType=groupBuy&activityId=1') !== -1) {
uni.navigateTo({
url: `/pages/other_package/productInfo/productInfo?id=${id}&activedType=groupBuy&activityId=1`,
});
} else {
_this.curId = Number(id);
_this.getShop();
}
uni.setClipboardData({
data: "",
});