passwordValidation.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="page">
  3. <view class="info">
  4. <u--form labelPosition="left" :model="info" ref="ownerForm" labelWidth="80" errorType="message"
  5. :labelStyle="{fontWeight:'bold',color:'#333'}">
  6. <u-form-item label="登录密码" borderBottom>
  7. <u--input v-model="info.password" border="none" clearable placeholder="请输入登录密码"
  8. placeholderStyle="color:#999" :password="isHidePassword"></u--input>
  9. <image class="icon-img"
  10. :src="isHidePassword?'/static/image/login/icon-hide.png':'/static/image/login/icon-show.png'"
  11. mode="" @tap="isHidePassword=!isHidePassword"></image>
  12. </u-form-item>
  13. </u--form>
  14. </view>
  15. <view class="btn dis a-c j-c " @click="validateMethod">
  16. 确定
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import {
  22. mapState,
  23. mapMutations
  24. } from "vuex"
  25. export default {
  26. data() {
  27. return {
  28. isHidePassword: true, //是否隐藏密码
  29. info: {
  30. mobile: "",
  31. password: "",
  32. },
  33. userId: "",
  34. }
  35. },
  36. onShow() {
  37. },
  38. onLoad(options) {
  39. if (options.userId) {
  40. this.info.mobile = options.mobile;
  41. this.userId = options.userId;
  42. }
  43. },
  44. computed: {},
  45. methods: {
  46. async validateMethod() {
  47. if (!this.info.mobile) {
  48. uni.showToast({
  49. title: '手机号为空',
  50. icon: 'none'
  51. });
  52. return;
  53. }
  54. if (!this.info.password) {
  55. uni.showToast({
  56. title: '密码为空',
  57. icon: 'none'
  58. });
  59. return;
  60. }
  61. let res = await this.$http.post('/appUser/validateCode', this.info);
  62. if (res.code == '200' && res.data) {
  63. setTimeout(() => {
  64. uni.navigateTo({
  65. url: '/pages/my/changePhoneNumber?userId=' + this.userId,
  66. })
  67. }, 1000)
  68. } else {
  69. uni.showToast({
  70. title: "密码校验错误",
  71. icon: 'none'
  72. });
  73. }
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. page {
  80. background-color: #fff;
  81. padding: 30rpx 60rpx;
  82. box-sizing: border-box;
  83. }
  84. .icon-img {
  85. width: 30rpx;
  86. height: 30rpx;
  87. }
  88. .btn {
  89. padding: 20rpx;
  90. box-sizing: border-box;
  91. background: #FDE935;
  92. border-radius: 45rpx 45rpx 45rpx 45rpx;
  93. margin-top: 100rpx;
  94. font-size: 36rpx;
  95. color: #1F1F1F;
  96. font-weight: bold;
  97. }
  98. ::v-deep {
  99. .u-form-item__body {
  100. padding: 34rpx 0;
  101. }
  102. }
  103. .u-page__code-text {
  104. padding: 4rpx 18rpx;
  105. background: rgba(253, 233, 53, 0.2);
  106. border-radius: 6rpx 6rpx 6rpx 6rpx;
  107. border: 1rpx solid #FDE935;
  108. color: #333333;
  109. font-size: 26rpx;
  110. }
  111. </style>