resetPWD.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view class="df jcc fdc">
  3. <view class="login-righttitle">重置密码</view>
  4. <view class="fdc df jcc resetPWD-listbox">
  5. <!-- 手机号 -->
  6. <view class="df resetPWD-inputbox aic">
  7. <view class="resetPWD-inputbox-icon">
  8. <img class="df" src="../../assets/login/loginIcon4.png" />
  9. </view>
  10. <input @input="onPhoneNumInput" class="resetPWD-inputbox-input" type="text" placeholder="手机号" />
  11. </view>
  12. <!-- 横线 -->
  13. <view class="resetPWD-line"></view>
  14. <!-- 验证码 -->
  15. <view class="df resetPWD-inputbox aic">
  16. <view class="resetPWD-inputbox-icon">
  17. <img class="df" src="../../assets/login/loginIcon6.png" />
  18. </view>
  19. <input @input="onCodeInput" class="resetPWD-inputbox-input" type="text" placeholder="验证码" />
  20. <view class="resetPWD-sendcodebtn df jcc aic">获取验证码</view>
  21. </view>
  22. <!-- 横线 -->
  23. <view class="resetPWD-line"></view>
  24. <!-- 新密码 -->
  25. <view class="df resetPWD-inputbox aic">
  26. <view class="resetPWD-inputbox-icon">
  27. <img class="df" src="../../assets/login/loginIcon1.png" />
  28. </view>
  29. <input @input="onNewPWDInput" class="resetPWD-inputbox-input" type="password" placeholder="新密码:6-16位字符,包含字母和数字" />
  30. </view>
  31. <!-- 横线 -->
  32. <view class="resetPWD-line"></view>
  33. <!-- 登录按钮 -->
  34. <view class="resetPWD-loginbtn df jcc aic btn-hover" @click="onLogin">登录</view>
  35. <!-- 注册账号 -->
  36. <view class="df fdr resetPWD-registerOrForgetBox jcc aic">
  37. <a :href="regURL" class="loginByPWD-register">注册实验空间账号</a>
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. export default {
  44. data() {
  45. return {
  46. phoneNum: '',
  47. code:'',
  48. newPassword: '',
  49. regURL: 'http://www.ilab-x.com/register',
  50. }
  51. },
  52. methods: {
  53. onPhoneNumInput: function(event) {
  54. this.phoneNum = event.target.value
  55. },
  56. onCodeInput: function(event) {
  57. this.code = event.target.value
  58. },
  59. onNewPWDInput: function(event) {
  60. this.newPassword = event.target.value
  61. },
  62. onLogin: function(type) {
  63. // this.$emit("onLogin", "onLogin")
  64. this.findUser();
  65. // let url = "http://39.105.166.141:8085/user/addusers";
  66. // uni.request({
  67. // header: {
  68. // 'Content-Type': 'application/json;charset=UTF-8'
  69. // },
  70. // url: url,
  71. // method: 'POST',
  72. // data: {
  73. // "IlabAccount": this.account,
  74. // "Password": this.password
  75. // },
  76. // dataType: 'json',
  77. // success: (res) => {
  78. // // let data = res.data;
  79. // // //登录成功
  80. // // if (data.Code == 100) {
  81. // // this.$emit("onLogin")
  82. // // }
  83. // // //密码错误
  84. // // else {
  85. // // this.isShowTip=1;
  86. // // }
  87. // console.log("success+++**+*", res)
  88. // },
  89. // fail: (res) => {
  90. // console.log("fail+**+*", res)
  91. // }
  92. // });
  93. },
  94. findUser(){
  95. console.log(this.phoneNum);
  96. let url = "http://39.105.166.141:8085/user/finduser";
  97. uni.request({
  98. header: {
  99. 'Content-Type': 'application/json;charset=UTF-8'
  100. },
  101. url: url,
  102. method: 'POST',
  103. data: {
  104. "IlabAccount": this.phoneNum,
  105. },
  106. dataType: 'json',
  107. success: (res) => {
  108. let data = res.data;
  109. if (data.Code == 100) {
  110. // this.$emit("onLogin")
  111. console.log("userinfo",data);
  112. }
  113. else {
  114. // this.isShowTip=1;
  115. console.log("用户未注册");
  116. }
  117. console.log("success+++**+*", res)
  118. },
  119. fail: (res) => {
  120. console.log("fail+**+*", res)
  121. }
  122. });
  123. }
  124. }
  125. }
  126. </script>
  127. <style>
  128. .resetPWD-listbox {
  129. margin-top: 2.19vw;
  130. }
  131. .resetPWD-inputbox {
  132. margin-top: 2.5vw;
  133. }
  134. .resetPWD-inputbox-icon {
  135. margin-left: 0.47vw;
  136. }
  137. .resetPWD-inputbox-input {
  138. font-size: 1.04vw;
  139. border: none;
  140. margin-left: 1.25vw;
  141. flex-grow: 1;
  142. }
  143. .resetPWD-line {
  144. margin-top: 0.73vw;
  145. width: 23.54vw;
  146. height: 0.104vw;
  147. background-color: #E6E6E6;
  148. }
  149. .resetPWD-sendcodebtn {
  150. width: 5.26vw;
  151. height: 1.979vw;
  152. background: #F4F4F4;
  153. border-radius: 7px;
  154. font-size: 0.729vw;
  155. font-family: MicrosoftYaHei;
  156. color: #999999;
  157. line-height: 0.989vw;
  158. }
  159. .resetPWD-loginbtn {
  160. height: 3.125vw;
  161. font-size: 0.989vw;
  162. font-family: MicrosoftYaHei;
  163. line-height: 1.302vw;
  164. margin-top: 2.083vw;
  165. border-radius: 8px;
  166. }
  167. .resetPWD-registerOrForgetBox {
  168. margin-top: 1.56vw;
  169. font-size: 0.78vw;
  170. font-family: MicrosoftYaHei;
  171. color: #EA252C;
  172. line-height: 1.04vw;
  173. }
  174. .resetPWD-register {
  175. margin-left: 2px;
  176. }
  177. </style>