respwd.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view class="content">
  3. <view class="tip">
  4. *為了您的資金安全,登錄密碼修改後24小時以內不允許提現。
  5. </view>
  6. <view class="tit">
  7. 舊密碼
  8. </view>
  9. <input type="password" class="shuru" placeholder="請翰入舊密碼" v-model="oldpwd">
  10. <view class="tit">
  11. 新密碼
  12. </view>
  13. <input type="password" class="shuru" placeholder="請翰入新密碼" v-model="newpwd">
  14. <view class="tit">
  15. 確認密碼
  16. </view>
  17. <input type="password" class="shuru" placeholder="請翰入確認密碼" v-model="renewpwd">
  18. <view class="loginout" @click="changepass()">
  19. 提交
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import {
  25. changepass
  26. } from '@/api/login.js'
  27. export default {
  28. data() {
  29. return {
  30. //oldpwd newpwd
  31. oldpwd: '',
  32. newpwd: '',
  33. renewpwd: ''
  34. }
  35. },
  36. onLoad() {
  37. },
  38. onShow() {
  39. },
  40. onReachBottom() {
  41. },
  42. onReady() {
  43. },
  44. methods: {
  45. changepass() {
  46. let obj = this
  47. if(obj.oldpwd == '') {
  48. return obj.$api.msg('請翰入舊密碼')
  49. }
  50. if(obj.newpwd == '') {
  51. return obj.$api.msg('請翰入新密碼')
  52. }
  53. if(obj.renewpwd == '') {
  54. return obj.$api.msg('請翰入確認密碼')
  55. }
  56. if(obj.newpwd != obj.renewpwd) {
  57. return obj.$api.msg('兩次密碼不一致')
  58. }
  59. changepass({
  60. oldpwd: obj.oldpwd,
  61. newpwd: obj.newpwd
  62. }).then(res => {
  63. uni.showToast({
  64. title: '修改成功',
  65. duration: 2000,
  66. position: 'top'
  67. });
  68. setTimeout(()=> {
  69. uni.switchTab({
  70. url: '/pages/index/index'
  71. })
  72. },1500)
  73. })
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="scss">
  79. page {
  80. height: 100%;
  81. background-color: #fff;
  82. }
  83. .tip {
  84. color: red;
  85. font-size: 26rpx;
  86. padding: 30rpx;
  87. }
  88. .shuru {
  89. display: block;
  90. background-color: #f5f5f5;
  91. width: 673rpx;
  92. height: 95rpx;
  93. margin: auto;
  94. padding-left: 30rpx;
  95. text-align: 95rpx;
  96. }
  97. .tit {
  98. padding: 60rpx 48rpx 20rpx;
  99. }
  100. .loginout {
  101. width: 675rpx;
  102. height: 70rpx;
  103. line-height: 70rpx;
  104. text-align: center;
  105. font-size: 26rpx;
  106. color: #000;
  107. background-color: #f4d03c;
  108. margin: 50rpx auto;
  109. border-radius: 20rpx;
  110. font-weight: bold;
  111. }
  112. </style>