fix: pengyouquan yulan

This commit is contained in:
zzc
2026-02-09 20:30:15 +08:00
parent 06ded41769
commit 87a2383d0f
2 changed files with 49 additions and 3 deletions

View File

@@ -36,6 +36,10 @@
</view>
<view class="form-section">
<view v-if="isSinglePage" class="single-page-tip">
<uni-icons type="info" size="16" color="#ff4d4f"></uni-icons>
<text class="tip-text">当前处于预览模式请前往小程序登录</text>
</view>
<view class="input-group">
<text class="label">昵称</text>
<input
@@ -51,7 +55,7 @@
<view class="action-section">
<button class="confirm-btn custom-button" @tap="confirmLogin">
一键登录
{{ isSinglePage ? "前往小程序登录" : "一键登录" }}
</button>
<!-- <view class="agreement-row" @tap="toggleAgreement">
@@ -84,9 +88,9 @@
</template>
<script setup>
import { ref } from "vue";
import { ref, computed } from "vue";
import { useUserStore } from "@/stores/user";
import { getPlatformProvider } from "@/utils/system";
import { getPlatformProvider, isSinglePageMode } from "@/utils/system";
import { uploadImage } from "@/utils/common";
import { apiLogin } from "@/api/auth.js";
import { wxLogin } from "@/utils/login.js";
@@ -101,6 +105,9 @@ const userStore = useUserStore();
const emit = defineEmits(["logind"]);
// 是否处于单页模式(朋友圈打开)
const isSinglePage = computed(() => isSinglePageMode());
const festivalNames = [
"春意",
"福星",
@@ -175,6 +182,17 @@ const confirmLogin = async () => {
// uni.showToast({ title: "请先同意用户协议和隐私政策", icon: "none" });
// return;
// }
if (isSinglePage.value) {
uni.showModal({
title: "提示",
content: "请点击屏幕下方的“前往小程序”按钮,进入完整版体验登录功能",
showCancel: false,
confirmText: "我知道了",
});
return;
}
try {
const platform = getPlatformProvider();
if (platform === "mp-weixin") {
@@ -318,6 +336,23 @@ defineExpose({ open, close });
.form-section {
margin-bottom: 80rpx;
.single-page-tip {
display: flex;
align-items: center;
justify-content: center;
background: #fff1f0;
border: 1rpx solid #ffccc7;
border-radius: 12rpx;
padding: 16rpx;
margin-bottom: 30rpx;
.tip-text {
font-size: 24rpx;
color: #ff4d4f;
margin-left: 8rpx;
}
}
.input-group {
display: flex;
align-items: center;