wangzhibo
4 天以前 10595d8632f959d0954d1939243196f4eed02372
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<template>
    <cl-checkbox :size="34" v-model="agree" round>
        <view class="agree-btn">
            {{ $t("已阅读并同意") }}
            <text @tap.stop="toDoc('用户协议', 'userAgreement')">{{ $t("用户协议") }}</text>
            {{ $t("和") }}
            <text @tap.stop="toDoc('隐私政策', 'privacyPolicy')">{{ $t("隐私政策") }}</text>
        </view>
    </cl-checkbox>
</template>
 
<script setup lang="ts">
import { ref } from "vue";
import { useCool } from "/@/cool";
import { useUi } from "/$/cool-ui";
import { useI18n } from "vue-i18n";
 
const { router } = useCool();
const ui = useUi();
const { t } = useI18n();
 
const agree = ref(false);
 
function toDoc(title: string, key: string) {
    router.push({
        path: "/pages/user/doc",
        query: {
            title,
            key,
        },
    });
}
 
function check() {
    if (!agree.value) {
        ui.showToast(t("请先勾选同意后再进行登录"));
    }
 
    return agree.value;
}
 
defineExpose({
    check,
});
</script>
 
<style lang="scss" scoped>
.agree-btn {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    color: #999999;
    letter-spacing: 1rpx;
 
    text {
        color: $cl-color-primary;
        padding: 0 10rpx;
    }
}
</style>