lxf
2025-07-15 691b86ca853959f5beb3db9b25d0a4a9929dd40f
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<template>
    <div class="setFond">
        <div class="header">
            <div class="status_bar fixed w-full top-0 left-0 h-50 flex items-center justify-between">
                <div class="w-20 h-20 ml-13">
                    <img class="l_icon" src="../../assets/img/back.svg" @click="$router.go(-1)" />
                </div>
            </div>
        </div>
        <!-- <div class="content">
            <div class="title textColor">{{ $t('setFundPassword') }}</div>
            <ExInput :label="$t('password')" :placeholderText="$t('funpasswordTips')" v-model="password"
                typeText="password" />
            <ExInput :label="$t('repassword')" :placeholderText="$t('surePassword')" v-model="repassword"
                typeText="password" />
            <van-button class="w-full" style="margin-top:10px;" type="primary" @click="submitBind">{{ $t('sure') }}
            </van-button>
        </div> -->
 
        <div class="px-26 text-white"
            style="background: url(&quot;/static/img/bg-login.png&quot;) 0% 0% / cover fixed;">
            <span class="text-40 font-bold mt-80 block">{{ $t('setFundPassword') }}</span>
            <div class="mt-40">
                <div class="mt-15 bg-white p-14 rounded-10 flex items-center">
                    <div class="w-22 h-22">
                        <img src="../../assets/img/icon-password.png" draggable="false">
                    </div>
                    <div class="ml-9 text-black flex-1">
                        <div class="uni-input-wrapper">
                            <input type="password" v-model="password" maxlength="140" step="" enterkeyhint="done"
                                class="uni-input-input" autocomplete="off" :placeholder="$t('funpasswordTips')">
                        </div>
                    </div>
                </div>
                <div class="mt-15 bg-white p-14 rounded-10 flex items-center">
                    <div class="w-22 h-22">
                        <img src="../../assets/img/icon-password.png" draggable="false">
                    </div>
                    <div class="ml-9 text-black flex-1">
                        <div class="uni-input-wrapper">
                            <input type="password" v-model="repassword" maxlength="140" step="" enterkeyhint="done"
                                class="uni-input-input" autocomplete="off" :placeholder="$t('surePassword')">
                        </div>
                    </div>
                </div>
            </div>
            <div class="py-17 text-center bg-black mt-80 rounded-10 text-19 font-700" @click="submitBind">{{
                $t('sure') }}</div>
        </div>
    </div>
</template>
 
<script setup>
import { _setSafewordReg } from "@/service/user.api.js";
import ExInput from "@/components/ex-input/index.vue";
import { ref } from "vue";
import { showToast } from 'vant'
import { useI18n } from 'vue-i18n'
import { useRouter } from "vue-router";
 
const { t } = useI18n()
const router = useRouter()
 
 
const password = ref('')
const repassword = ref('')
 
 
const setSafewordReg = () => {
    _setSafewordReg({
        safeword: repassword.value
    }).then((res) => {
        // showToast(t('bindSuccess'));
        console.log('sss')
        router.push('/news')
    }).catch((error) => {
        showToast(t(error.msg));
    });
}
const submitBind = () => {
    if (password.value.length < 6 || repassword.value.length < 6) {
        showToast(t('funpasswordTips'))
        return false
    }
    if (password.value !== repassword.value) {
        showToast(t('noSamePassword'))
        return false
    }
    setSafewordReg()
}
 
</script>
 
<style lang="scss" scoped>
@import '@/assets/css/deepseek_css_20250625_30ff932.css';
.uni-input-input{
    background-color: #fff;
}
.setFond {
    width: 100%;
    height: 100vh;
    box-sizing: border-box;
    font-size: 13px;
    padding: 0 16px;
    background: url('../../assets/img/bg-login.png') 0% 0% / cover fixed;
}
 
.header {
    display: flex;
    justify-content: space-between;
    padding: 0 13px;
    font-size: 14px;
    height: 50px;
    line-height: 50px;
}
 
.title {
    font-weight: 700;
    font-size: 26px;
    margin-top: 25px;
    margin-bottom: 30px;
}
</style>