123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <template>
- <view class="content">
- <view class="tip">{{ $t('mm.wlnd') }}</view>
- <view class="tit">{{ $t('mm.jmm') }}</view>
- <input type="password" class="shuru" :placeholder="$t('mm.qsrjmm')" v-model="oldpwd" />
- <view class="tit">{{ $t('mm.xmm') }}</view>
- <input type="password" class="shuru" :placeholder="$t('mm.qsrxmm')" v-model="newpwd" />
- <view class="tit">{{ $t('mm.qrmm') }}</view>
- <input type="password" class="shuru" :placeholder="$t('mm.qsrqrmm')" v-model="renewpwd" />
- <view class="loginout" @click="changepass()">{{ $t('mm.tj') }}</view>
- </view>
- </template>
- <script>
- import { changepass } from '@/api/login.js';
- export default {
- data() {
- return {
- //oldpwd newpwd
- oldpwd: '',
- newpwd: '',
- renewpwd: ''
- };
- },
- onLoad() {
- uni.setNavigationBarTitle({ title: this.$t('mm.mm') });
- },
- onShow() {},
- onReachBottom() {},
- onReady() {},
- methods: {
- changepass() {
- let obj = this;
- if (obj.oldpwd == '') {
- return obj.$api.msg(this.$t('mm.qsrjmm'));
- }
- if (obj.newpwd == '') {
- return obj.$api.msg(this.$t('mm.qsrxmm'));
- }
- if (obj.renewpwd == '') {
- return obj.$api.msg(this.$t('mm.qsrqrmm'));
- }
- if (obj.newpwd != obj.renewpwd) {
- return obj.$api.msg(this.$t('mm.lcmmbyz'));
- }
- changepass({
- oldpwd: obj.oldpwd,
- newpwd: obj.newpwd
- }).then(res => {
- uni.showToast({
- title: this.$t('mm.xgcg'),
- duration: 2000,
- position: 'top'
- });
- uni.setStorageSync('gwpsw',obj.newpwd)
- setTimeout(() => {
- uni.switchTab({
- url: '/pages/index/index'
- });
- }, 1500);
- });
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- height: 100%;
- background-color: #fff;
- }
- .tip {
- color: red;
- font-size: 26rpx;
- padding: 30rpx;
- }
- .shuru {
- display: block;
- background-color: #f5f5f5;
- width: 673rpx;
- height: 95rpx;
- margin: auto;
- padding-left: 30rpx;
- text-align: 95rpx;
- }
- .tit {
- padding: 60rpx 48rpx 20rpx;
- }
- .loginout {
- width: 675rpx;
- height: 70rpx;
- line-height: 70rpx;
- text-align: center;
- font-size: 26rpx;
- color: #000;
- background-color: #f4d03c;
- margin: 50rpx auto;
- border-radius: 20rpx;
- font-weight: bold;
- }
- </style>
|