feat: 新增拼团

This commit is contained in:
2026-09-29 09:47:31 +08:00
parent f7b9e66172
commit f24a5a126f
35 changed files with 7681 additions and 872 deletions
+65 -11
View File
@@ -167,7 +167,24 @@ export default {
});
// #endif
},
onLoad() {
onLoad(options) {
let redirect = (options && options.redirect) || "";
// #ifdef H5
if (!redirect && this.$route && this.$route.query && this.$route.query.redirect) {
redirect = this.$route.query.redirect;
}
// #endif
if (!redirect) {
redirect = uni.getStorageSync("login_redirect_url") || "";
}
if (redirect) {
try {
this.redirect = decodeURIComponent(redirect);
} catch (e) {
this.redirect = redirect;
}
console.log("登录后重定向目标页面:", this.redirect);
}
// #ifdef APP-PLUS
// 判断微信是否安装 (iOS 的 scheme 为 weixin://)
this.isWechatInstalled = plus.runtime.isApplicationExist({
@@ -201,18 +218,57 @@ export default {
loading: false,
showPolicyModal: false,
isWechatInstalled: false,
redirect: "",
};
},
methods: {
onBack() {
console.log('onBack',)
uni.switchTab({
url: '/pages/home/home'
})
console.log('onBack')
const pages = getCurrentPages();
if (pages && pages.length > 1) {
uni.navigateBack();
} else {
uni.switchTab({
url: '/pages/home/home'
});
}
},
jumpAfterLogin() {
let target = this.redirect || uni.getStorageSync("login_redirect_url") || "";
uni.removeStorageSync("login_redirect_url");
if (target) {
try {
if (target.includes("%")) {
target = decodeURIComponent(target);
}
} catch (e) {}
console.log("登录成功,重定向回页面:", target);
uni.redirectTo({
url: target,
fail: (err) => {
console.warn("redirectTo 失败,尝试 switchTab:", err);
uni.switchTab({
url: target,
fail: () => {
uni.switchTab({ url: "/pages/home/home" });
},
});
},
});
} else {
const pages = getCurrentPages();
if (pages && pages.length > 1) {
uni.navigateBack();
} else {
uni.switchTab({
url: "/pages/home/home",
});
}
}
},
jumpHome() {
uni.switchTab({
url: "/pages/home/home",
});
@@ -271,8 +327,8 @@ export default {
});
setTimeout(() => {
then.jumpHome();
}, 2000);
then.jumpAfterLogin();
}, 1500);
},
checkNameParam(val) {
// console.log("val",val);
@@ -647,9 +703,7 @@ export default {
message: response.msg,
});
setTimeout(() => {
uni.switchTab({
url: "/pages/home/home",
});
this.jumpAfterLogin();
}, 1200);
} else if (response && response.msg) {
this.$refs.uToastRef.show({