respwd.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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('mm.xgcg'),
  51. duration: 2000,
  52. position: 'top'
  53. });
  54. uni.setStorageSync('gwpsw',obj.newpwd)
  55. setTimeout(() => {
  56. uni.switchTab({
  57. url: '/pages/index/index'
  58. });
  59. }, 1500);
  60. });
  61. }
  62. }
  63. };
  64. </script>
  65. <style lang="scss">
  66. page {
  67. height: 100%;
  68. background-color: #fff;
  69. }
  70. .tip {
  71. color: red;
  72. font-size: 26rpx;
  73. padding: 30rpx;
  74. }
  75. .shuru {
  76. display: block;
  77. background-color: #f5f5f5;
  78. width: 673rpx;
  79. height: 95rpx;
  80. margin: auto;
  81. padding-left: 30rpx;
  82. text-align: 95rpx;
  83. }
  84. .tit {
  85. padding: 60rpx 48rpx 20rpx;
  86. }
  87. .loginout {
  88. width: 675rpx;
  89. height: 70rpx;
  90. line-height: 70rpx;
  91. text-align: center;
  92. font-size: 26rpx;
  93. color: #000;
  94. background-color: #f4d03c;
  95. margin: 50rpx auto;
  96. border-radius: 20rpx;
  97. font-weight: bold;
  98. }
  99. </style>