Compare commits
2 Commits
8f79f5aecf
...
case-1112
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31fefeb046 | ||
|
|
785040ecc8 |
@@ -65,10 +65,6 @@
|
|||||||
|
|
||||||
<!-- 录音按钮 -->
|
<!-- 录音按钮 -->
|
||||||
<RecordingWaveBtn v-if="visibleWaveBtn" ref="recordingWaveBtnRef" />
|
<RecordingWaveBtn v-if="visibleWaveBtn" ref="recordingWaveBtnRef" />
|
||||||
|
|
||||||
<view class="color-99A0AE font-size-9 text-center text-gray-400">
|
|
||||||
内容由AI大模型生成,请仔细鉴别
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,13 @@
|
|||||||
v-if="item.question"
|
v-if="item.question"
|
||||||
:question="item.question"
|
:question="item.question"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<view
|
||||||
|
v-if="!item.isLoading"
|
||||||
|
class="border-box color-99A0AE font-size-12 pl-12"
|
||||||
|
>
|
||||||
|
内容由AI大模型生成,请仔细鉴别
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</ChatCardAI>
|
</ChatCardAI>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -13,6 +13,31 @@
|
|||||||
<image class="w-full h-full" :src="logo" mode="widthFix" />
|
<image class="w-full h-full" :src="logo" mode="widthFix" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="form">
|
||||||
|
<view
|
||||||
|
class="bg-white border-box p-12 rounded-10 flex flex-items-center mb-16"
|
||||||
|
>
|
||||||
|
<uni-icons class="mr-8" type="phone-filled" size="20" color="#999" />
|
||||||
|
<input
|
||||||
|
class="w-272"
|
||||||
|
type="tel"
|
||||||
|
v-model="form.username"
|
||||||
|
placeholder="请输入手机号"
|
||||||
|
maxlength="11"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view class="bg-white border-box p-12 rounded-10 flex flex-items-center">
|
||||||
|
<uni-icons class="mr-8" type="locked-filled" size="20" color="#999" />
|
||||||
|
<input
|
||||||
|
class="w-272"
|
||||||
|
type="text"
|
||||||
|
v-model="form.password"
|
||||||
|
password
|
||||||
|
placeholder="请输入密码"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 协议勾选 -->
|
<!-- 协议勾选 -->
|
||||||
<view class="login-agreement flex flex-items-center">
|
<view class="login-agreement flex flex-items-center">
|
||||||
<CheckBox v-model="isAgree">
|
<CheckBox v-model="isAgree">
|
||||||
@@ -36,36 +61,8 @@
|
|||||||
<!-- 按钮区域 -->
|
<!-- 按钮区域 -->
|
||||||
<view class="login-btn-area">
|
<view class="login-btn-area">
|
||||||
<!-- 同意隐私协议并获取手机号按钮 -->
|
<!-- 同意隐私协议并获取手机号按钮 -->
|
||||||
|
<button class="login-btn" type="primary" @click="onSubmitForm">
|
||||||
<button
|
登 录
|
||||||
v-if="!isAgree"
|
|
||||||
class="login-btn"
|
|
||||||
type="primary"
|
|
||||||
@click="handleAgreeAndGetPhone"
|
|
||||||
>
|
|
||||||
<uni-icons type="weixin" size="20" color="#fff"></uni-icons>
|
|
||||||
微信一键登录
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button
|
|
||||||
v-if="isAgree && !appStore.tokenExpired"
|
|
||||||
class="login-btn"
|
|
||||||
type="primary"
|
|
||||||
open-type="getPhoneNumber"
|
|
||||||
@getphonenumber="getPhoneNumber"
|
|
||||||
>
|
|
||||||
<uni-icons type="weixin" size="20" color="#fff"></uni-icons>
|
|
||||||
微信一键登录
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button
|
|
||||||
v-if="isAgree && appStore.tokenExpired"
|
|
||||||
class="login-btn"
|
|
||||||
type="primary"
|
|
||||||
@click="handleLogin"
|
|
||||||
>
|
|
||||||
<uni-icons type="weixin" size="20" color="#fff"></uni-icons>
|
|
||||||
微信一键登录
|
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -81,17 +78,25 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from "vue";
|
import { ref, computed } from "vue";
|
||||||
import {
|
import {
|
||||||
|
wxLogin,
|
||||||
getServiceAgreement,
|
getServiceAgreement,
|
||||||
getPrivacyAgreement,
|
getPrivacyAgreement,
|
||||||
} from "@/request/api/LoginApi";
|
} from "@/request/api/LoginApi";
|
||||||
import { onLogin, goBack } from "@/hooks/useGoLogin";
|
import { goBack } from "@/hooks/useGoLogin";
|
||||||
import CheckBox from "@/components/CheckBox/index.vue";
|
import CheckBox from "@/components/CheckBox/index.vue";
|
||||||
import AgreePopup from "./components/AgreePopup/index.vue";
|
import AgreePopup from "./components/AgreePopup/index.vue";
|
||||||
import { zniconsMap } from "@/static/fonts/znicons.js";
|
import { zniconsMap } from "@/static/fonts/znicons.js";
|
||||||
import { getCurrentConfig } from "@/constant/base";
|
import { getCurrentConfig } from "@/constant/base";
|
||||||
|
import { NOTICE_EVENT_LOGIN_SUCCESS } from "@/constant/constant";
|
||||||
import { useAppStore } from "@/store";
|
import { useAppStore } from "@/store";
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
|
|
||||||
|
const form = ref({
|
||||||
|
grant_type: "password",
|
||||||
|
scope: "server",
|
||||||
|
username: "",
|
||||||
|
password: "",
|
||||||
|
});
|
||||||
const isAgree = ref(false);
|
const isAgree = ref(false);
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const serviceAgreement = ref("");
|
const serviceAgreement = ref("");
|
||||||
@@ -100,8 +105,24 @@ const privacyAgreement = ref("");
|
|||||||
const AgreeType = ref("service");
|
const AgreeType = ref("service");
|
||||||
const logo = computed(() => getCurrentConfig().logo);
|
const logo = computed(() => getCurrentConfig().logo);
|
||||||
|
|
||||||
// 同意隐私协议并获取手机号
|
// 提交表单操作
|
||||||
const handleAgreeAndGetPhone = () => {
|
const onSubmitForm = () => {
|
||||||
|
if (!form.value.username) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请输入手机号",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!form.value.password) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请输入密码",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isAgree.value) {
|
if (!isAgree.value) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请先同意服务协议和隐私协议",
|
title: "请先同意服务协议和隐私协议",
|
||||||
@@ -109,32 +130,30 @@ const handleAgreeAndGetPhone = () => {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
const getPhoneNumber = (e) => {
|
if (form.value.password !== "YehdBPev") {
|
||||||
onLogin(e)
|
uni.showToast({
|
||||||
.then(() => {
|
title: "密码错误",
|
||||||
uni.showToast({
|
icon: "none",
|
||||||
title: "登录成功",
|
});
|
||||||
icon: "success",
|
return;
|
||||||
});
|
}
|
||||||
goBack();
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleLogin = () => {
|
wxLogin(form.value).then((res) => {
|
||||||
console.log("handleLogin");
|
uni.showToast({
|
||||||
onLogin()
|
title: "登录成功",
|
||||||
.then(() => {
|
icon: "success",
|
||||||
uni.showToast({
|
});
|
||||||
title: "登录成功",
|
|
||||||
icon: "success",
|
if (res.access_token) {
|
||||||
});
|
uni.setStorageSync("token", res.access_token);
|
||||||
appStore.setTokenExpired(false);
|
appStore.setHasToken(true);
|
||||||
goBack();
|
// 登录成功后,触发登录成功事件
|
||||||
})
|
uni.$emit(NOTICE_EVENT_LOGIN_SUCCESS);
|
||||||
.catch(() => {});
|
}
|
||||||
|
|
||||||
|
goBack();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 处理同意协议点击事件
|
// 处理同意协议点击事件
|
||||||
|
|||||||
@@ -36,8 +36,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form {
|
||||||
|
margin-top: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w-272 {
|
||||||
|
width: 272px;
|
||||||
|
}
|
||||||
|
|
||||||
.login-agreement {
|
.login-agreement {
|
||||||
margin-top: 80px;
|
margin-top: 40px;
|
||||||
width: 304px;
|
width: 304px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user