123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <template>
- <view class="changePassword-page">
- <ZxInput
- v-model="form.old_passwd"
- :placeholder="$t('请输入旧密码')"
- isPassword
- />
- <ZxInput
- v-model="form.new_passwd"
- :placeholder="$t('请输入新密码')"
- isPassword
- />
- <ZxInput
- v-model="form.second_passwd"
- :placeholder="$t('请再次输入新密码')"
- isPassword
- />
-
- <view :class="['zx-form-btn', isSubmit && 'is-submit']" style="margin-top: 64rpx;" @tap="changePassword">
- {{ $t('确认修改') }}
- </view>
- </view>
- </template>
- <script>
- import common from '../../common/common';
- import ZxInput from './components/ZxInput.vue'
- var config = require('../../common/config_gyq.js');
- var http = require('../../common/request.js');
- export default {
- data() {
- return {
- form: {
- }
- }
- },
- components: {
- ZxInput
- },
- computed: {
- isSubmit({ form }) {
- return form.old_passwd && form.new_passwd && form.second_passwd
- }
- },
- methods: {
- async changePassword() {
- if(!this.isSubmit) return
- let res = await uni.showModal({
- confirmText:this.$t('确定'),
- cancelText:this.$t('取消'),
- title:this.$t('是否确认修改密码?')
- })
- if(res[1].confirm){
- let {data} = await http.postApi(config.API_FLK_CABINET_RESET_PASSWORD,this.form)
- if(data.code == 200){
- common.simpleToast(this.$t('修改成功'))
- setTimeout(()=>{
- uni.navigateBack({
- delta:1
- })
- },800)
- }else{
- common.simpleToast(data.msg)
- }
- }
-
-
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- @import "@/libs/css/layout.scss";
- .changePassword-page {
- padding: 58rpx 32rpx;
- min-height: 100vh;
- width: 100%;
- background: #F1F3F4;
- }
- </style>
|