Ngiler SH3LL 360
Home
Information
Create File
Create Folder
:
/
home
/
tbf
/
tbf.ro
/
resources
/
js
/
components
/
pages
/
Information Server
MySQL :
OFF
Perl :
OFF
CURL :
ON
WGET :
OFF
PKEXEC :
OFF
Directive
Local Value
IP Address
89.40.16.97
System
Linux server.atelieruldeit.ro 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
User
tbf
PHP Version
7.3.33
Software
Apache
Doc root
Writable
close
Edit File :
MyAccount.vue
| Size :
8.33
KB
Copy
<template> <div class="page-content-custom container"> <div class="content-text" v-if="loaded"> <div class="d-flex title-section align-items-center"> <h3>Contul Meu</h3> <!-- <button class="ml-auto save-btn" @click="saveInputs" v-if="editabled">Finalizeaza</button> <button class="ml-auto edit-btn" @click="showInputs" v-else>Editeaza</button> --> </div> <div> <div class="info-content mt-26px"> <div v-if="hasErrorProfile" class="alert_errors"> <div v-for="(err, index) in profile_errors">{{ err[0] }}</div> Datele introduse nu sunt valide. Verifica formularul pentru a putea actualiza profilul! </div> <div class="d-flex direction-box"> <div class="info-box w-50 box-left"> <label for="user_last_name">Prenume:</label> <input id="user_last_name" type="text" placeholder="Prenume" class="input-tbf-text" v-model="user.last_name"> </div> <div class="info-box w-50 box-right"> <label for="user_name">Nume:</label> <input id="user_name" type="text" placeholder="Nume" class="input-tbf-text" v-model="user.name" v-bind:class="[profile_errors['name'] ? 'error' : '']" @focus="removeClassError"> </div> </div> <div class="d-flex direction-box"> <div class="info-box box-left w-50"> <label for="user_email">Email:</label> <input id="user_email" type="email" placeholder="Email" class="input-tbf-text" v-model="user.email" v-bind:class="[profile_errors['email'] ? 'error' : '']" @focus="removeClassError"> </div> <div class="info-box box-right w-50"> <label for="user_phone">Telefon:</label> <input id="user_phone" type="text" placeholder="Telefon" class="input-tbf-text" v-model="user.phone"> </div> </div> <div class="d-flex direction-box"> <div class="info-box change-password-main w-100"> <label>Parola:</label> <p class="placeholder_password">*******</p> <div class="d-flex ml-auto"> <p class="link-text" v-if="!inputsPass" @click="changePassword">schimba parola</p> <p class="link-text cancel-text" v-if="inputsPass" @click="cancelChange">anuleaza</p> <!-- <p class="link-text" v-if="inputsPass" @click="savePassword">Salveaza noua parola</p> --> </div> </div> </div> <div v-if="hasErrorPassword" class="alert_errors"> <div v-for="(err, index) in password_erros">{{ err[0] }}</div> Parola trebuie sa contina minim 6 caractere si sa coincida. </div> <div class="d-flex direction-box" v-if="inputsPass"> <div class="info-box w-50 box-left"> <label for="user_password">Parola noua:</label> <input id="user_password" type="password" class="input-tbf-text" v-if="inputsPass" v-model="user.password" v-bind:class="[password_erros['password'] ? 'error' : '']" @focus="removeClassError"> </div> <div class="info-box w-50 box-right"> <label for="user_confirm_password">Confirma parola:</label> <input id="user_confirm_password" type="password" class="input-tbf-text" v-if="inputsPass" v-model="user.password_confirmation" v-bind:class="[password_erros['password'] ? 'error' : '']" @focus="removeClassError"> </div> </div> <div class="d-flex direction-box"> <button class="btn-tbf" @click="saveInputs">Modifica Date Cont</button> </div> </div> </div> </div> </div> </template> <script> export default { data(){ return { loaded: false, editabled: false, inputsPass: false, profile_errors: [], hasErrorProfile: false, hasErrorPassword: false, password_erros: [], user: { name: this.$auth.user().name, last_name: this.$auth.user().last_name, phone: this.$auth.user().phone, email: this.$auth.user().email, password: '', password_confirmation: '', }, myAccountData: {} } }, components: { }, watch: {}, created() {}, mounted() { axios.get("getMyAccountData") .then(response => { this.myAccountData = response.data.myAccountData; this.loaded = true; }); }, methods: { showInputs() { this.editabled = true; }, saveInputs() { axios.post("/saveProfile", { name: this.user.name, last_name: this.user.last_name, phone: this.user.phone, email: this.user.email }) .then(response => { this.$auth.fetch(); this.profile_errors = []; this.editabled = false; this.hasErrorProfile = false; }) .catch(error => { this.profile_errors = []; this.hasErrorProfile = false; setTimeout(() => { var errors = []; $.each(error.response.data.errors, (key, value) => { errors[key] = value; }); this.profile_errors = errors; setTimeout(() => { this.hasErrorProfile = true; }, 0); }, 0); }) .finally(() => { }); }, changePassword() { $('.placeholder_password').html('') this.inputsPass = true; }, cancelChange() { $('.placeholder_password').html('*******') this.inputsPass = false; }, savePassword() { axios.post("/changePassword", { password: this.user.password, password_confirmation: this.user.password_confirmation }) .then(response => { this.$auth.fetch(); this.password_erros = false; this.inputsPass = false; this.user.password = ''; this.user.password_confirmation = ''; this.hasErrorPassword = false; }) .catch(error => { this.password_erros = []; this.hasErrorPassword = false; this.user.password = ''; this.user.password_confirmation = ''; setTimeout(() => { var errors = []; $.each(error.response.data.errors, (key, value) => { errors[key] = value; }); this.password_erros = errors; setTimeout(() => { this.hasErrorPassword = true; }, 0); }, 0); }) .finally(() => { }); }, removeClassError(e) { $(e.target).removeClass('error'); }, selectCourse: function(slug){ this.$router.push("/cursuri/" + slug); }, } } </script>
Back