respwd.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <view class="content">
  3. <view class="tip">{{ $t('mm.wlnd') }}</view>
  4. <view class="tit">{{ $t('mm.jmm') }}</view>
  5. <input type="password" class="shuru" :placeholder="$t('mm.qsrjmm')" v-model="oldpwd" />
  6. <view class="tit">{{ $t('mm.xmm') }}</view>
  7. <input type="password" class="shuru" :placeholder="$t('mm.qsrxmm')" v-model="newpwd" />
  8. <view class="tit">{{ $t('mm.qrmm') }}</view>
  9. <input type="password" class="shuru" :placeholder="$t('mm.qsrqrmm')" v-model="renewpwd" />
  10. <view class="loginout" @click="changepass()">{{ $t('mm.tj') }}</view>
  11. </view>
  12. </template>
  13. <script>
  14. import { changepass } from '@/api/login.js';
  15. export default {
  16. data() {
  17. return {
  18. //oldpwd newpwd
  19. oldpwd: '',
  20. newpwd: '',
  21. renewpwd: ''
  22. };
  23. },
  24. onLoad() {
  25. uni.setNavigationBarTitle({ title: this.$t('mm.mm') });
  26. },
  27. onShow() {},
  28. onReachBottom() {},
  29. onReady() {},
  30. methods: {
  31. changepass() {
  32. let obj = this;
  33. if (obj.oldpwd == '') {
  34. return obj.$api.msg(this.$t('mm.qsrjmm'));
  35. }
  36. if (obj.newpwd == '') {
  37. return obj.$api.msg(this.$t('mm.qsrxmm'));
  38. }
  39. if (obj.renewpwd == '') {
  40. return obj.$api.msg(this.$t('mm.qsrqrmm'));
  41. }
  42. if (obj.newpwd != obj.renewpwd) {
  43. return obj.$api.msg(this.$t('mm.lcmmbyz'));
  44. }
  45. changepass({
  46. oldpwd: obj.oldpwd,
  47. newpwd: obj.newpwd
  48. }).then(res => {
  49. uni.showToast({
  50. title: this.$t('xgcg'),
  51. duration: 2000,
  52. position: 'top'
  53. });
  54. setTimeout(() => {
  55. uni.switchTab({
  56. url: '/pages/index/index'
  57. });
  58. }, 1500);
  59. });
  60. }
  61. }
  62. };
  63. </script>
  64. <style lang="scss">
  65. page {
  66. height: 100%;
  67. background-color: #fff;
  68. }
  69. .tip {
  70. color: red;
  71. font-size: 26rpx;
  72. padding: 30rpx;
  73. }
  74. .shuru {
  75. display: block;
  76. background-color: #f5f5f5;
  77. width: 673rpx;
  78. height: 95rpx;
  79. margin: auto;
  80. padding-left: 30rpx;
  81. text-align: 95rpx;
  82. }
  83. .tit {
  84. padding: 60rpx 48rpx 20rpx;
  85. }
  86. .loginout {
  87. width: 675rpx;
  88. height: 70rpx;
  89. line-height: 70rpx;
  90. text-align: center;
  91. font-size: 26rpx;
  92. color: #000;
  93. background-color: #f4d03c;
  94. margin: 50rpx auto;
  95. border-radius: 20rpx;
  96. font-weight: bold;
  97. }
  98. </style>