移动端
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.
 
 

184 line
4.7 KiB

  1. <template>
  2. <div class="home_wrapper">
  3. <div class="header_main">
  4. 修改密码
  5. <div class="return_btn" @click="onClickLeft"></div>
  6. <div class="add_btn" @click="send">保存</div>
  7. </div>
  8. <van-form @submit="onSubmit" ref="formData">
  9. <div class="list_main">
  10. <van-field required label="旧密码" :rules="[{ required: true , message:'请输入旧密码' }]" v-model="user.oldPassword" placeholder="请输入旧密码" input-align="right" :border="false" />
  11. <van-field required label="新密码" :rules="[{ required: true , message:'请输入新密码'}]" v-model="user.newPassword" placeholder="请输入新密码" input-align="right" :border="false" />
  12. <van-field required label="确认密码" :rules="[{ required: true, message: '请确认密码' }]" prop="email" v-model="user.confirmPassword" placeholder="请确认密码" input-align="right" :border="false" />
  13. </div>
  14. <!-- <div style="margin: 16px;">-->
  15. <!-- <van-button round block type="primary" native-type="submit">-->
  16. <!-- 保存-->
  17. <!-- </van-button>-->
  18. <!-- </div>-->
  19. </van-form>
  20. </div>
  21. </template>
  22. <script>
  23. import { updateUserPwd } from "@/api/sunVillage_info/fixedAssets";
  24. export default {
  25. name: "certificateList",
  26. data() {
  27. return {
  28. user:{},
  29. };
  30. },
  31. created() {
  32. },
  33. methods: {
  34. send(){
  35. this.$refs.formData.submit();
  36. },
  37. onSubmit(){
  38. var that = this;
  39. if (this.user.newPassword != this.user.confirmPassword){
  40. that.$notify({ type: 'warning', message: '两次输入的密码不一致!' });
  41. return;
  42. }
  43. updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
  44. that.$notify({ type: 'success', message: '修改成功!' });
  45. setTimeout(function(){
  46. history.back(-1);
  47. },2000)
  48. });
  49. },
  50. },
  51. }
  52. </script>
  53. <style scoped lang="scss">
  54. .home_wrapper{
  55. background: #e9e9e9;
  56. min-height: 100vh;
  57. width: 100vw;
  58. .header_main {
  59. height: 116px;
  60. background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
  61. background-size: 100% 100%;
  62. position: fixed;
  63. top: 0;
  64. left: 0;
  65. width: 100%;
  66. font-size: 36px;
  67. line-height: 116px;
  68. text-align: center;
  69. color: #fff;
  70. position: relative;
  71. .return_btn {
  72. width: 24px;
  73. height: 43.2px;
  74. background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  75. background-size: 20px 36px;
  76. position: absolute;
  77. left: 38px;
  78. top: 36px;
  79. }
  80. .add_btn{
  81. width: 56.4px;
  82. height: 40.8px;
  83. font-size: 14PX;
  84. position: absolute;
  85. right: 38px;
  86. top: 36px;
  87. line-height: 40.8px;
  88. }
  89. }
  90. .release_head{
  91. height: 90px;
  92. padding:0 23px;
  93. display: flex;
  94. align-items: center;
  95. font-size: 26px;
  96. color: #929292;
  97. .people{
  98. flex: 1;
  99. display: flex;
  100. align-items: center;
  101. .icon{
  102. width: 24px;
  103. height: 21px;
  104. background: url('../../assets/images/sunVillage_info/details_icon_1.png') no-repeat;
  105. background-size: 100% 100%;
  106. display: block;
  107. margin-right: 8px;
  108. }
  109. }
  110. .time{
  111. flex: 1;
  112. display: flex;
  113. align-items: center;
  114. justify-content:flex-end;
  115. .icon{
  116. width: 25px;
  117. height: 25px;
  118. background: url('../../assets/images/sunVillage_info/details_icon_2.png') no-repeat;
  119. background-size: 100% 100%;
  120. display: block;
  121. margin-right: 8px;
  122. }
  123. }
  124. }
  125. .release_conetnt{
  126. padding:0 22px;
  127. font-size: 32px;
  128. color: #252525;
  129. line-height: 44px;
  130. img{
  131. max-width: 100%;
  132. margin-bottom: 16px;
  133. }
  134. p{
  135. margin-bottom: 16px;
  136. }
  137. }
  138. .list_main{
  139. padding:25px;
  140. background: #ffffff;
  141. width: 94%;
  142. margin: 25px auto 0;
  143. border-radius: 15PX;
  144. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  145. }
  146. .titBox{
  147. display: flex;
  148. align-items: center;
  149. }
  150. .tit{
  151. font-size: 36px;
  152. font-weight: bold;
  153. }
  154. /deep/ .van-cell{
  155. padding-left: 0!important;
  156. padding-right: 0!important;
  157. padding-bottom: 0!important;
  158. &:first-child{
  159. padding-top: 0;
  160. }
  161. }
  162. /deep/ .van-field__label{
  163. padding-left: 10PX;
  164. width: auto;
  165. display: flex;
  166. align-items: center;
  167. }
  168. /deep/ .van-cell--required::before{
  169. left: 0PX;
  170. }
  171. /deep/ .van-field__error-message{
  172. display: none;
  173. }
  174. }
  175. </style>