AI销管
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

158 regels
3.5 KiB

  1. <template>
  2. <view style="background: #F8F8F8;width: 100%;height: 100vh;">
  3. <view class="inpText" style="margin-top: 20rpx;">
  4. <view class="inpTextBox">
  5. <view class="inpTextLable">
  6. <view class="inpTextName">原密码</view>
  7. </view>
  8. <input placeholder="请输入原密码" placeholder-class="placeInpTextBox" class="inpTextBox1" maxlength="12"
  9. v-model="password" type="text"></input>
  10. </view>
  11. </view>
  12. <view class="inpText">
  13. <view class="inpTextBox">
  14. <view class="inpTextLable">
  15. <view class="inpTextName">新密码</view>
  16. </view>
  17. <input placeholder="请输入6-12位新密码" placeholder-class="placeInpTextBox" class="inpTextBox1" maxlength="12"
  18. v-model="newPassword" type="password"></input>
  19. </view>
  20. </view>
  21. <view class="inpText" style="padding-bottom: 8rpx;" >
  22. <view class="inpTextBox" style="border: none;">
  23. <view class="inpTextLable">
  24. <view class="inpTextName">确认密码</view>
  25. </view>
  26. <input placeholder="请确认密码" placeholder-class="placeInpTextBox" class="inpTextBox1" maxlength="12"
  27. v-model="queryPassword" type="password"></input>
  28. </view>
  29. </view>
  30. <button class="save" @tap="savePassword">确定</button>
  31. </view>
  32. </template>
  33. <script>
  34. var app = getApp();
  35. var util = require("../../utils/util.js");
  36. var config = require("../../config");
  37. export default {
  38. data() {
  39. return {
  40. password: "",
  41. newPassword: "",
  42. queryPassword: ""
  43. };
  44. },
  45. methods: {
  46. // 修改密码
  47. savePassword() {
  48. if (this.newPassword == "" || this.queryPassword == "" || this.password == "") {
  49. uni.showModal({
  50. cancelColor: "#999999",
  51. title: '提示',
  52. content: '输入框不能为空',
  53. showCancel: false
  54. });
  55. } else if (this.newPassword.length < 6) {
  56. uni.showModal({
  57. cancelColor: "#999999",
  58. title: '提示',
  59. content: '新密码不能小于6位',
  60. showCancel: false
  61. });
  62. } else if (this.newPassword == this.queryPassword) {
  63. var params = {
  64. password: this.password,
  65. newpassword: this.newPassword,
  66. newpassword1: this.queryPassword
  67. };
  68. util.getRequestPromise(config.service.updatePassword, params).then(data => {
  69. uni.clearStorage();
  70. uni.navigateTo({
  71. url: '/pages/login/index'
  72. });
  73. });
  74. } else {
  75. uni.showModal({
  76. title: '提示',
  77. cancelColor: "#999999",
  78. content: '两次密码不一致',
  79. showCancel: false
  80. });
  81. }
  82. }
  83. }
  84. };
  85. </script>
  86. <style lang="scss">
  87. .inpText {
  88. padding: 0 30rpx;
  89. width: 100%;
  90. box-sizing: border-box;
  91. background-color: #FFFFFF;
  92. }
  93. .inpTextBox {
  94. padding: 36rpx 0 28rpx;
  95. color: #BBBFC8;
  96. text-align: left;
  97. border-bottom: 1px solid #EEEEEE;
  98. display: -webkit-box;
  99. display: -webkit-flex;
  100. display: flex;
  101. -webkit-box-align: center;
  102. -webkit-align-items: center;
  103. align-items: center;
  104. }
  105. .placeInpTextBox {
  106. color: #999;
  107. font-size: 30rpx;
  108. }
  109. .inpTextLable {
  110. position: relative;
  111. width: 155rpx;
  112. display: flex;
  113. align-items: center;
  114. &::before {
  115. content: '';
  116. display: block;
  117. position: absolute;
  118. right: 0;
  119. width: 2rpx;
  120. height: 30rpx;
  121. background: #999999;
  122. }
  123. }
  124. .inpTextName {
  125. color: #020F28;
  126. font-size: 32rpx;
  127. }
  128. .inpTextBox1 {
  129. width: 410rpx;
  130. font-size: 32rpx;
  131. padding: 0 20rpx;
  132. box-sizing: border-box;
  133. color: #333;
  134. }
  135. .save {
  136. width: 640rpx;
  137. height: 87rpx;
  138. text-align: center;
  139. line-height: 87rpx;
  140. color: #fff;
  141. font-size: 32rpx;
  142. background: #0A6EE9;
  143. margin: 0 auto;
  144. margin-top: 120rpx;
  145. }
  146. </style>