|
|
@@ -24,12 +24,23 @@
|
|
|
<password :form="formData" />
|
|
|
</view>
|
|
|
<view class="flex flex-row items-center justify-center mb-5">
|
|
|
- <cl-button :pt="{ className: '!h-[45px] !rounded-full w-[200px] mx-auto' }" :loading="loading"
|
|
|
+ <cl-button :disabled="!agree"
|
|
|
+ :pt="{ className: '!h-[45px] !rounded-full w-[200px] mx-auto' }" :loading="loading"
|
|
|
@tap="toLogin">
|
|
|
登录
|
|
|
</cl-button>
|
|
|
</view>
|
|
|
-
|
|
|
+ <cl-checkbox v-model="agree">
|
|
|
+ <view class="flex flex-row items-center w-full text-[12px]">
|
|
|
+ 同意并阅读
|
|
|
+ <cl-text :size="12" color="primary" @tap.stop="toAgreement">
|
|
|
+ 《用户服务协议》
|
|
|
+ </cl-text>和
|
|
|
+ <cl-text :size="12" color="primary" @tap.stop="toPrivacy">
|
|
|
+ 《隐私政策》
|
|
|
+ </cl-text>
|
|
|
+ </view>
|
|
|
+ </cl-checkbox>
|
|
|
</cl-form>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -47,10 +58,10 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-if="val === 'password'">
|
|
|
- <cl-button type="info" :pt="{ className: '!h-[40px] !rounded-full w-[40px] mx-auto !p-1' }" :loading="loading"
|
|
|
- @tap="tabsChange('quickly_login')">
|
|
|
- <cl-image src="https://oss.xiaoxiongcode.com/static/home/phone.svg" mode="heightFix" height="20px"
|
|
|
- width="auto"></cl-image>
|
|
|
+ <cl-button type="info" :pt="{ className: '!h-[40px] !rounded-full w-[40px] mx-auto !p-1' }"
|
|
|
+ :loading="loading" @tap="tabsChange('quickly_login')">
|
|
|
+ <cl-image src="https://oss.xiaoxiongcode.com/static/home/phone.svg" mode="heightFix"
|
|
|
+ height="20px" width="auto"></cl-image>
|
|
|
</cl-button>
|
|
|
<view class="mt-1">
|
|
|
<cl-text :size="14" color="#666">
|
|
|
@@ -59,10 +70,10 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-else>
|
|
|
- <cl-button type="info" :pt="{ className: '!h-[40px] !rounded-full w-[40px] mx-auto !p-1' }" :loading="loading"
|
|
|
- @tap="tabsChange('password')">
|
|
|
- <cl-image src="https://oss.xiaoxiongcode.com/static/home/password.svg" mode="heightFix" height="20px"
|
|
|
- width="auto"></cl-image>
|
|
|
+ <cl-button type="info" :pt="{ className: '!h-[40px] !rounded-full w-[40px] mx-auto !p-1' }"
|
|
|
+ :loading="loading" @tap="tabsChange('password')">
|
|
|
+ <cl-image src="https://oss.xiaoxiongcode.com/static/home/password.svg" mode="heightFix"
|
|
|
+ height="20px" width="auto"></cl-image>
|
|
|
</cl-button>
|
|
|
<view class="mt-1">
|
|
|
<cl-text :size="14" color="#666">
|
|
|
@@ -92,12 +103,13 @@ import password from './components/password.uvue';
|
|
|
import { ref } from 'vue'
|
|
|
import type { ClTabsItem } from "@/uni_modules/cool-ui";
|
|
|
import { encryptPassword, user, router } from '@/.cool';
|
|
|
-import { loginApi, wechatLogin,quicklyRegister } from "@/services/user";
|
|
|
+import { loginApi, wechatLogin, quicklyRegister } from "@/services/user";
|
|
|
import type { ClActionSheetOptions } from "@/uni_modules/cool-ui";
|
|
|
|
|
|
const actionSheetRef = ref<ClActionSheetComponentPublicInstance | null>(null);
|
|
|
|
|
|
const val = ref('quickly_login')
|
|
|
+const agree = ref(false)
|
|
|
const list: ClTabsItem[] = [
|
|
|
{
|
|
|
label: '验证码登录',
|
|
|
@@ -146,14 +158,14 @@ function toLogin() {
|
|
|
})
|
|
|
router.home();
|
|
|
}).catch(err => {
|
|
|
- if(err.message=='手机号不存在'&&val.value==='quickly_login'){
|
|
|
+ if (err.message == '手机号不存在' && val.value === 'quickly_login') {
|
|
|
quicklyRegister({
|
|
|
username: formData.value.username,
|
|
|
password: 'ba3253876aed6bc22d4a6ff53d8406c6ad864195ed144ab5c87621b6c233b548baeae6956df346ec8c17f5ea10f35ee3cbc514797ed7ddd3145464e2a0bab413',
|
|
|
}).then(res => {
|
|
|
- handleSelect(formData.value.username)
|
|
|
+ handleSelect(formData.value.username)
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
uni.showToast({
|
|
|
title: err.message,
|
|
|
icon: 'none'
|
|
|
@@ -210,6 +222,16 @@ function handleSelect(item: string) {
|
|
|
})
|
|
|
|
|
|
}
|
|
|
+function toAgreement() {
|
|
|
+ router.push({
|
|
|
+ path: '/pages/user/agreement'
|
|
|
+ })
|
|
|
+}
|
|
|
+function toPrivacy() {
|
|
|
+ router.push({
|
|
|
+ path: '/pages/user/privacy'
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|