fix: pengyouquan yulan
This commit is contained in:
@@ -36,6 +36,10 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-section">
|
<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">
|
<view class="input-group">
|
||||||
<text class="label">昵称</text>
|
<text class="label">昵称</text>
|
||||||
<input
|
<input
|
||||||
@@ -51,7 +55,7 @@
|
|||||||
|
|
||||||
<view class="action-section">
|
<view class="action-section">
|
||||||
<button class="confirm-btn custom-button" @tap="confirmLogin">
|
<button class="confirm-btn custom-button" @tap="confirmLogin">
|
||||||
一键登录
|
{{ isSinglePage ? "前往小程序登录" : "一键登录" }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<!-- <view class="agreement-row" @tap="toggleAgreement">
|
<!-- <view class="agreement-row" @tap="toggleAgreement">
|
||||||
@@ -84,9 +88,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from "vue";
|
import { ref, computed } from "vue";
|
||||||
import { useUserStore } from "@/stores/user";
|
import { useUserStore } from "@/stores/user";
|
||||||
import { getPlatformProvider } from "@/utils/system";
|
import { getPlatformProvider, isSinglePageMode } from "@/utils/system";
|
||||||
import { uploadImage } from "@/utils/common";
|
import { uploadImage } from "@/utils/common";
|
||||||
import { apiLogin } from "@/api/auth.js";
|
import { apiLogin } from "@/api/auth.js";
|
||||||
import { wxLogin } from "@/utils/login.js";
|
import { wxLogin } from "@/utils/login.js";
|
||||||
@@ -101,6 +105,9 @@ const userStore = useUserStore();
|
|||||||
|
|
||||||
const emit = defineEmits(["logind"]);
|
const emit = defineEmits(["logind"]);
|
||||||
|
|
||||||
|
// 是否处于单页模式(朋友圈打开)
|
||||||
|
const isSinglePage = computed(() => isSinglePageMode());
|
||||||
|
|
||||||
const festivalNames = [
|
const festivalNames = [
|
||||||
"春意",
|
"春意",
|
||||||
"福星",
|
"福星",
|
||||||
@@ -175,6 +182,17 @@ const confirmLogin = async () => {
|
|||||||
// uni.showToast({ title: "请先同意用户协议和隐私政策", icon: "none" });
|
// uni.showToast({ title: "请先同意用户协议和隐私政策", icon: "none" });
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
if (isSinglePage.value) {
|
||||||
|
uni.showModal({
|
||||||
|
title: "提示",
|
||||||
|
content: "请点击屏幕下方的“前往小程序”按钮,进入完整版体验登录功能",
|
||||||
|
showCancel: false,
|
||||||
|
confirmText: "我知道了",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const platform = getPlatformProvider();
|
const platform = getPlatformProvider();
|
||||||
if (platform === "mp-weixin") {
|
if (platform === "mp-weixin") {
|
||||||
@@ -318,6 +336,23 @@ defineExpose({ open, close });
|
|||||||
.form-section {
|
.form-section {
|
||||||
margin-bottom: 80rpx;
|
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 {
|
.input-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -62,3 +62,14 @@ export function getDeviceInfo() {
|
|||||||
appId: "69665538a49b8ae3be50fe5d",
|
appId: "69665538a49b8ae3be50fe5d",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否处于朋友圈单页模式
|
||||||
|
*/
|
||||||
|
export function isSinglePageMode() {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
const launchOptions = uni.getLaunchOptionsSync();
|
||||||
|
return launchOptions.scene === 1154;
|
||||||
|
// #endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user