mobileFind.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <view class="app">
  3. <view class="check-user fx-r fx-ac fx-bc">
  4. <view class="user-icon fx-h fx-bc fx-ac">
  5. <image src="/static/img/wall-idcard.png" mode="widthFix"></image>
  6. <view class="text">身份验证</view>
  7. </view>
  8. <view class="check-hr"></view>
  9. <view class="user-icon fx-h fx-bc fx-ac">
  10. <image src="/static/img/wall-message-btn.png" mode="widthFix"></image>
  11. <view class="text">短信验证</view>
  12. </view>
  13. </view>
  14. <view class="info-line">
  15. <view class="il-top">
  16. <text>验证码</text>
  17. </view>
  18. <view class="il-code">
  19. <input placeholder="原手机验证码" type="number" v-model="verify_code" />
  20. <view class="ilc-btn" v-if="verifyCount == 0" @click="getverifyPhone">获取验证码</view>
  21. <view class="ilc-no-show" v-else>{{verifyCount}} s</view>
  22. </view>
  23. </view>
  24. <view class="sub-info" @tap="formSubmit">完成</view>
  25. </view>
  26. </template>
  27. <script>
  28. import {mapState,mapMutations} from 'vuex'
  29. export default {
  30. computed: mapState(['user']),
  31. data() {
  32. return {
  33. verifyCount: 0,
  34. verify_code: ""
  35. }
  36. },
  37. onLoad(options) {
  38. },
  39. methods: {
  40. getverifyPhone: function() {
  41. if (this.verifyCount > 0) return;
  42. uni.showLoading({
  43. title: "获取中..."
  44. });
  45. this
  46. .request
  47. .post("userYzm", { type: "payment"})
  48. .then(res => {
  49. console.log(res);
  50. uni.hideLoading();
  51. if (res.code == 200) {
  52. if (res.data.status == 2) {
  53. this.utils.CountDowm(res.data.time, (e, s) => {
  54. this.verifyCount = e;
  55. });
  56. }
  57. if (res.data.status == 1) {
  58. this.utils.CountDowm(120, (e, s) => {
  59. this.verifyCount = e;
  60. });
  61. }
  62. } else {
  63. this.utils.showAlert({
  64. title: res.msg,
  65. mask: true,
  66. icon: 'none'
  67. });
  68. }
  69. })
  70. .catch(err => {
  71. this.utils.showAlert({
  72. title: '获取失败',
  73. mask: true,
  74. icon: 'none'
  75. });
  76. uni.hideLoading();
  77. });
  78. },
  79. formSubmit:function(){
  80. if(!this.utils.isDefine(this.verify_code)){
  81. this.utils.Tip("请输入验证码");
  82. return;
  83. }
  84. this.utils.loadIng("提交中..")
  85. this
  86. .request
  87. .post("paymentCkYzm",{verify_code:this.verify_code})
  88. .then(res=>{
  89. uni.hideLoading();
  90. console.log(res);
  91. if(res.code == 200) {
  92. uni.redirectTo({ url:"./newPass?token=" +res.data.token});
  93. }else{
  94. this.utils.Tip(res.msg);
  95. }
  96. }).catch(()=>{
  97. this.utils.Tip("网络错误,请稍后尝试");
  98. });
  99. }
  100. },
  101. }
  102. </script>
  103. <style>
  104. .check-user{padding: 20px;}
  105. .check-user .user-icon{width: 50%;}
  106. .check-user image{width: 40px;}
  107. .check-user .text{font-size: 12px;margin-top: 10px;}
  108. .idcar-info{padding:20px 15px;background: #fff;}
  109. .idcar-info .label{width: 100px;}
  110. .idcar-info input{width: calc(100% - 100px);font-size: 14px;}
  111. .sub-info{width:calc(100% - 40px);margin-left: 20px;text-align: center;height:40px;line-height: 40px; background:#db292b;border-radius:20px;font-size:15px;font-weight:500;color:#ffffff;margin-top: 50px;}
  112. .check-hr{width: 20%;border-top: 1px dashed #ccc;height: 1px;position: absolute;}
  113. .info-line {height: 80px;padding: 0 15px;background-color: #fff;border-top: 1px #f5f5f5 solid;}
  114. .il-top { color: #db292b;font-size: 14px;margin-top: 10px;}
  115. .il-code {display: flex;align-items: center;margin-top: 10px;}
  116. .il-code input {width: 50%;height: 100%;font-size: 13px;}
  117. .ilc-btn {width: 90px;height: 30px;text-align: center;line-height: 30px;margin-left: auto;font-size: 12px;background: #db292b;color: #fff;border-radius: 100px;}
  118. .ilc-no-show {width: 90px;height: 30px;text-align: center;line-height: 30px;margin-left: auto;font-size: 12px;background: #eee;color: #999;border-radius: 100px;}
  119. </style>