2bddf946c2d65ce451c9de02bd627c366771cdc4.svn-base 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <div>
  3. <yd-popup v-model="rgShow" position="center" width="90%margin:0;">
  4. <div class="reg-box">
  5. <div class="reg-top row allAlignment item-center">
  6. <span>修改登录密码</span>
  7. <img :src="url1" alt @click="closeRg()">
  8. </div>
  9. <div class="reg-mian">
  10. <div>
  11. <span>原密码</span>
  12. <br>
  13. <input
  14. type="password"
  15. maxlength="15"
  16. v-model="password"
  17. onkeyup="this.value=this.value.replace(/^ +| +$/g,'')"
  18. @blur="pwd()"
  19. placeholder="请输入你的原密码"
  20. >
  21. <br>
  22. <i :class="pwdInfo?'infoRed':''">*使用6-15位数字或字母,不能使用特殊字符</i>
  23. </div>
  24. <div>
  25. <span>新密码</span>
  26. <br>
  27. <input
  28. type="password"
  29. v-model="again_password"
  30. maxlength="15"
  31. onkeyup="this.value=this.value.replace(/^ +| +$/g,'')"
  32. placeholder="请输入你的新密码"
  33. >
  34. <br>
  35. <i :class="suerPwdInfo?'infoRed':''">*使用6-15位数字或字母,不能使用特殊字符</i>
  36. </div>
  37. </div>
  38. <div class="row vertical-center">
  39. <yd-button @click.native="reg()">修改密码</yd-button>
  40. </div>
  41. </div>
  42. </yd-popup>
  43. </div>
  44. </template>
  45. <script>
  46. import "@/css/index.css";
  47. export default {
  48. name: "register",
  49. data() {
  50. return {
  51. pwdInfo: false, //密码提醒
  52. suerPwdInfo: false, //确认密码
  53. userInfo: false, //用户信息提醒
  54. password: "",
  55. again_password: "",
  56. rgShow:true,//this.$store.state.rgShow,
  57. url1: require("@/assets/st-imges/guanbi.png"),
  58. docmHeight: '0', //默认屏幕高度
  59. showHeight: '0', //实时屏幕高度
  60. hidshow:true, //显示或者隐藏footer,
  61. isResize:false, //默认屏幕高度是否已获取
  62. };
  63. },
  64. methods: {
  65. closeRg(){
  66. this.$store.dispatch('GETRGSHOW', false);
  67. },
  68. reg() {
  69. if (
  70. this.password != "" &&
  71. this.again_password != ""
  72. ) {
  73. this.$http.post(this.$ports.login.resetPassword,{oldPassword:this.password,newPassword:this.again_password,token:localStorage.getItem('token')}).then(res =>{
  74. if(res.data){
  75. this.$dialog.alert({mes:res.data.msg});
  76. (res.data)
  77. if(res.data.status!=1){
  78. this.password='';
  79. this.again_password='';
  80. }else{
  81. this.password='';
  82. this.again_password='';
  83. this.$router.push('/')
  84. }
  85. }
  86. })
  87. }else{
  88. this.$dialog.alert({mes: '请完善您的信息!' });
  89. }
  90. },
  91. pwd() {
  92. if (/^[a-zA-Z0-9]{6,15}$/.test(this.password)) {
  93. this.pwdInfo = false;
  94. }
  95. else {
  96. this.password = "";
  97. this.pwdInfo = true;
  98. }
  99. },
  100. },
  101. computed:{
  102. Isshow:function(){
  103. this.$store.dispatch('GETRGSHOW',this.rgShow)
  104. return {
  105. isshow_code:this.$store.state.rgShow
  106. }
  107. },
  108. },
  109. watch:{
  110. Isshow(obj){
  111. this.rgShow=obj.isshow_code
  112. },
  113. isshow:{
  114. istrue(val){
  115. }
  116. }
  117. },
  118. mounted(){
  119. }
  120. };
  121. </script>
  122. <style scoped>
  123. .reg-box {
  124. width: 6.75rem;
  125. /* height: 8.26rem; */
  126. background: #f8f8f8;
  127. border-radius: 0.52rem;
  128. padding: 0 0.54rem;
  129. }
  130. .reg-top {
  131. font-size: 0.32rem;
  132. padding-top: 0.58rem;
  133. padding-bottom: 0.6rem;
  134. color: #f76649;
  135. }
  136. .reg-top img {
  137. width: 0.26rem;
  138. height: 0.26rem;
  139. }
  140. .reg-mian {
  141. /* height: 5.46rem; */
  142. }
  143. .reg-mian div {
  144. padding-bottom: 0.27rem;
  145. }
  146. .reg-mian span {
  147. font-size: 0.28rem;
  148. }
  149. .reg-mian i {
  150. font-size: 0.22rem;
  151. color: #aaaaaa;
  152. }
  153. .reg-mian input {
  154. width: 90%;
  155. height: 0.46rem;
  156. border: none;
  157. outline: none;
  158. border-bottom: 1px solid #aaaaaa;
  159. margin: 0.14rem auto 0.1rem;
  160. font-size: 0.24rem;
  161. }
  162. button {
  163. width: 1.9rem;
  164. height: 0.7rem;
  165. border-radius: 0.35rem;
  166. border: none;
  167. background: #aaaaaa;
  168. color: #f8f8f8;
  169. margin-bottom: 0.5rem;
  170. }
  171. input {
  172. font-size: 0.2rem;
  173. }
  174. .reg-mian .infoRed {
  175. color: #f76649;
  176. }
  177. div.row .btnCor {
  178. background: #f76649;
  179. }
  180. .yd-btn-primary:not(.yd-btn-loading) {
  181. background: #aaaaaa;
  182. }
  183. div /deep/ .yd-popup-center {
  184. margin: 0;
  185. overflow-y: scroll;
  186. -webkit-overflow-scrolling: touch;
  187. position: absolute;
  188. }
  189. </style>