<template>
  <v-page class="pos-login">
    <v-header :title="$t('common.c13')"></v-header>
    <main class="bg-panel-3 p-x-lg p-y-lg rounded-md box-shadow">
      <view class="form-item border-b p-y-md color-light">
        <view class="label m-b-xs">{{$t('safe.b3')}}</view>
        <view class="input">
          <v-input type="password" v-model="form.password" :placeholder="$t('safe.b4')"></v-input>
        </view>
      </view>
      <view class="form-item border-b p-y-md color-light">
        <view class="label m-b-xs">{{$t('safe.b5')}}</view>
        <view class="input">
          <v-input type="password" v-model="form.password_confirmation" :placeholder="$t('safe.b6')"></v-input>
        </view>
      </view>
	  <view class="p-md ">
	    <v-button block type="white" class="w-max rounded-md" ref="btn"  @click="setPassword">{{$t('safe.b7')}}</v-button>
	  </view>
    </main>
      
    <van-toast id="van-toast" />
  </v-page>
</template>
<script>
import Member from "@/api/member";
import { mapState } from "vuex";
import Setting from "@/api/setting";
export default {
  data() {
    return {
      form: {
        password: "",
        password_confirmation: ""
      }
    };
  },
  computed: {
    ...mapState({
      user: "user",
    }),
  },
  methods: {
    setPassword() {
      let data = this.form;
      Setting.withdrawalPassword(data, { btn: this.$refs.btn })
        .then((res) => {
          if(res.code==200){
				this.$back();
				this.$toast.success(this.$t('safe.d3'));
			}
        }).catch(() => {});
    },
  },
};
</script>
<style lang="scss" scoped>
	.layout-page{
		background-color: #121212 !important;
		background: none;
	}
	.bg-panel-3{
		background-color: #121212;
	}
</style>