forget-删除.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <view class="page">
  3. <view class="p-header flex-col justify-center">
  4. <view class="mtitle">忘记密码</view>
  5. <view class="stitle">请按照要求重新设置密码</view>
  6. </view>
  7. <view class="p-form">
  8. <view class="c-item align-center">
  9. <image src="/static/log_tel.png" mode="widthFix" class="i-ic"></image>
  10. <view class="i-inpt">
  11. <input type="number" class="inpt" placeholder="请输入手机号" v-model="mobile"/>
  12. </view>
  13. </view>
  14. <view class="c-item align-center">
  15. <image src="/static/log_yan.png" mode="widthFix" class="i-ic"></image>
  16. <view class="i-inpt">
  17. <input type="text" class="inpt" placeholder="请输入验证码" v-model="captcha"/>
  18. </view>
  19. <view class="code-wrap" @tap="chgeCode">
  20. <phoneCode ref="codeRef" :mobile="mobile" event="resetpwd" />
  21. </view>
  22. </view>
  23. <view class="c-item align-center">
  24. <image src="/static/log_mima.png" mode="widthFix" class="i-ic"></image>
  25. <view class="i-inpt">
  26. <input type="password" class="inpt" placeholder="请设置新密码" v-model="newpassword"/>
  27. </view>
  28. </view>
  29. <view class="c-item align-center">
  30. <image src="/static/log_mima.png" mode="widthFix" class="i-ic"></image>
  31. <view class="i-inpt">
  32. <input type="password" class="inpt" placeholder="请再次确认新密码" v-model="repassword"/>
  33. </view>
  34. </view>
  35. </view>
  36. <submit-btn @submit="submit" ref="submitRef">
  37. <template v-slot:btns="{isSubmitted}">
  38. <view class="p-btn" :class="{'disabled':isSubmitted}">
  39. 完成
  40. </view>
  41. </template>
  42. </submit-btn>
  43. </view>
  44. </template>
  45. <script>
  46. import phoneCode from './components/phoneCode.vue'
  47. export default {
  48. components:{
  49. phoneCode
  50. },
  51. data() {
  52. return {
  53. mobile:'',
  54. captcha:'',
  55. newpassword:'',
  56. repassword:'',
  57. // phone:'',
  58. // password:'',
  59. // code:'',
  60. };
  61. },
  62. onLoad(opt) {
  63. // this.openid = this.$Route.query.openid;
  64. // this.accessToken = this.$Route.query.accessToken;
  65. },
  66. methods:{
  67. chgeCode(){
  68. this.$refs.codeRef.getCode();
  69. },
  70. async submit(){
  71. if(! this.$tools.match(this.mobile,'mobile')){
  72. return;
  73. }else if(!this.$tools.match(this.captcha,'code') ){
  74. return;
  75. }else if(!this.$tools.match(this.newpassword,'pwd') ){
  76. return;
  77. }else if(!this.repassword){
  78. this.$tools.msg('请输入确认密码')
  79. return;
  80. }else if( this.repassword !== this.newpassword){
  81. this.$tools.msg('两次密码不一致')
  82. return;
  83. }
  84. let sendData={
  85. mobile:this.mobile,
  86. captcha:this.captcha,
  87. newpassword: this.newpassword,
  88. repassword: this.repassword,
  89. }
  90. let res=await this.$request('user.resetpwd',sendData);
  91. this.$tools.msg(res.msg);
  92. this.$refs.submitRef.chgeStatus();
  93. setTimeout(()=>{
  94. this.goBack();
  95. },800)
  96. },
  97. },
  98. }
  99. </script>
  100. <style lang="scss">
  101. page{
  102. background-color: #fff;
  103. }
  104. .page{
  105. min-height: 100vh;
  106. width: 100%;
  107. padding-bottom: 100rpx;
  108. }
  109. .p-header{
  110. width: 750rpx;
  111. height: 240rpx;
  112. position: relative;
  113. width: 630rpx;
  114. margin: 0 auto;
  115. .mtitle{
  116. font-size: 48rpx;
  117. font-family: PingFang SC;
  118. font-weight: bold;
  119. color: #333333;
  120. }
  121. .stitle{
  122. margin-top: 22rpx;
  123. font-size: 24rpx;
  124. font-family: PingFang SC;
  125. font-weight: 500;
  126. color: #999999;
  127. }
  128. }
  129. .p-form{
  130. width: 630rpx;
  131. margin: 0 auto;
  132. .c-pwd{
  133. height: 63rpx;
  134. line-height: 63rpx;
  135. width: 100%;
  136. text-align: right;
  137. font-size: 24rpx;
  138. font-family: PingFang SC;
  139. font-weight: 500;
  140. color: #333333;
  141. }
  142. .c-item{
  143. width: 100%;
  144. height: 84rpx;
  145. background-color: #F1F1F1;
  146. padding: 0 26rpx;
  147. margin-bottom: 30rpx;
  148. border-radius: 40rpx;
  149. }
  150. .i-ic{
  151. width: 30rpx;
  152. height: 30rpx;
  153. margin-right: 17rpx;
  154. }
  155. .i-inpt{
  156. flex:1;
  157. .inpt{
  158. width: 100%;
  159. height: 84rpx;
  160. line-height: 84rpx;
  161. color:#333;
  162. font-size: 30rpx;
  163. }
  164. .code-inpt{
  165. flex:1;
  166. margin-right: 20rpx;
  167. height: 103rpx;
  168. line-height: 103rpx;
  169. color:#333;
  170. font-size: 26rpx;
  171. }
  172. .phone-code{
  173. width: 200rpx;
  174. height: 60rpx;
  175. background: #0D91FF;
  176. box-shadow: 0rpx 6rpx 10rpx 0rpx rgba(13, 145, 255, 0.28);
  177. border-radius: 30rpx;
  178. line-height: 60rpx;
  179. text-align: center;
  180. font-size: 26rpx;
  181. color: #FFFFFF;
  182. }
  183. }
  184. // .i-code{
  185. // width: 180rpx;
  186. // height: 70rpx;
  187. // }
  188. }
  189. .p-btn{
  190. margin: 180rpx auto 0;
  191. width: 630rpx;
  192. height: 84rpx;
  193. border-radius: 40rpx;
  194. line-height: 84rpx;
  195. text-align: center;
  196. font-size: 34rpx;
  197. font-family: PingFang SC;
  198. font-weight: 500;
  199. background-color: $base-color;
  200. color:#fff;
  201. &.disabled{
  202. background-color: #eee;
  203. box-shadow: none;
  204. border: none;
  205. }
  206. }
  207. .p-reg{
  208. margin-top: 30rpx;
  209. font-size: 28rpx;
  210. font-family: PingFang SC;
  211. font-weight: 500;
  212. text-align: center;
  213. width: 100%;
  214. .stxt{
  215. color: #999999;
  216. }
  217. .mtxt{
  218. color: #333;
  219. }
  220. }
  221. .p-tips{
  222. position: absolute;
  223. z-index: 2;
  224. bottom: 30rpx;
  225. left: 0;
  226. width: 100%;
  227. .ic{
  228. width: 30rpx;
  229. height: 30rpx;
  230. margin-right: 22rpx;
  231. }
  232. .txt{
  233. color:#999999;
  234. font-size: 24rpx;
  235. font-family: PingFang SC;
  236. font-weight: 500;
  237. }
  238. .link{
  239. color:#333333;
  240. font-size: 24rpx;
  241. font-family: PingFang SC;
  242. font-weight: 500;
  243. }
  244. }
  245. </style>