selfpart.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <div class="self">
  3. <div class="enter-both">
  4. <div class="enter-title">
  5. <h4>
  6. <router-link to="/myself"><i class="iconfont icon-fanhui"></i></router-link>
  7. <span>个人认证</span>
  8. </h4>
  9. </div>
  10. <div class="both">
  11. <div class="content">
  12. <div class="part" v-show="seen">
  13. <span>姓名</span>
  14. <input type="text" placeholder="请输入真实姓名" @blur="canonicalfirst()" v-model="name">
  15. <span>{{cerfirst}}</span>
  16. </div>
  17. <div class="part" v-show="seen">
  18. <span>身份证号</span>
  19. <input type="text" placeholder="请输入身份证号码" @blur="canonicalsecond()" v-model="IDcard">
  20. <span>{{cersecond}}</span>
  21. </div>
  22. <div class="part" v-show="seen">
  23. <span>银行卡号</span>
  24. <input type="text" placeholder="请输入银行卡号码" @blur="canonicalthree()" v-model="bankcard">
  25. <span>{{certhree}}</span>
  26. </div>
  27. <div class="part" v-show="seen">
  28. <span>预留手机</span>
  29. <input type="text" placeholder="请输入银行预留手机号码" @blur="canonicalfourth()" v-model="phone">
  30. <span>{{cerfourth}}</span>
  31. </div>
  32. <div class="validation" v-show="seen">
  33. <span>验证码</span>
  34. <input type="text" placeholder="请输入验证码">
  35. <span @click="getnumber()">获取验证码</span>
  36. </div>
  37. <div class="success" v-show="!seen">
  38. <div class="picture">
  39. <div></div>
  40. </div>
  41. <p>{{name}}<br>{{phone}}</p>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="button" v-show="seen" @click="verify()">提交</div>
  46. </div>
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. export default{
  52. data(){
  53. return{
  54. objectT:{},
  55. seen:true,
  56. phone:'',
  57. name:'',
  58. IDcard:'',
  59. bankcard:'',
  60. first:'',
  61. last:'',
  62. place:"1********",
  63. regular:'',
  64. cerfirst:'',
  65. cersecond:'',
  66. certhree:'',
  67. cerfourth:'',
  68. }
  69. },
  70. methods:{
  71. verify(){
  72. this.seen=false;
  73. this.center=document.getElementsByTagName("input")[3].value;
  74. this.last=this.center.split("")[10];
  75. this.phone=this.phone.concat(this.place,this.last);
  76. },
  77. canonicalfirst(){
  78. this.regular=/^[\u4e00-\u9fa5]+(·[\u4e00-\u9fa5]+)*$/;
  79. if(this.regular.test(this.name)){
  80. this.cerfirst=" ";
  81. }else{
  82. this.cerfirst="格式错误";
  83. }
  84. },
  85. canonicalsecond(){
  86. this.regular=/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;
  87. if(this.regular.test(this.IDcard)){
  88. this.cersecond=" ";
  89. }else{
  90. this.cersecond="格式错误";
  91. }
  92. },
  93. canonicalthree(){
  94. this.regular=/([\d]{4})([\d]{4})([\d]{4})([\d]{4})([\d]{0,})?/;
  95. if(this.regular.test(this.bankcard)){
  96. this.certhree=" ";
  97. }else{
  98. this.certhree="格式错误";
  99. }
  100. },
  101. canonicalfourth(){
  102. this.regular=/^1[3|4|5|8][0-9]\d{4,8}$/;
  103. if(this.regular.test(this.phone)){
  104. this.cerfourth=" ";
  105. }else{
  106. this.cerfourth="格式错误";
  107. }
  108. },
  109. }
  110. }
  111. </script>
  112. <style scoped>
  113. .self{
  114. .enter-both{
  115. width: 100%;
  116. .enter-title{
  117. height: 3.041667rem;
  118. background: #60c0ff;
  119. width: 100%;
  120. h4{
  121. text-align: center;
  122. color: #fff;
  123. font-size: 0.472222rem;
  124. padding: 0.541667rem 0;
  125. position: relative;
  126. .icon-fanhui{
  127. float: left;
  128. margin-left: 0.513889rem;
  129. color: #fff !important;
  130. }
  131. span{
  132. margin-left: -0.513889rem;
  133. }
  134. }
  135. }
  136. .both{
  137. width: 100%;
  138. padding: 0 0.3rem;
  139. .content{
  140. float: left;
  141. margin-top: -1.1111rem;
  142. width: 100%;
  143. background-color: #fff;
  144. border-radius: 10px;
  145. margin-bottom: 1.388889rem;
  146. box-shadow: 0px 3px 21px 5px rgba(96, 192, 255, 0.35);
  147. padding: 0 0.291667rem;
  148. .part{
  149. width: 100%;
  150. height: 1.111111rem;
  151. line-height: 1.111111rem;
  152. padding-left: 0.305556rem;
  153. border-bottom: 1px solid #e8eff5;
  154. span{
  155. display: inline-block;
  156. font-size: 0.388889rem;
  157. color: #333333;
  158. margin-right: 0.5rem;
  159. width: 1.6rem;
  160. text-align: left;
  161. }
  162. input{
  163. border: 0;
  164. width: 3.6rem;
  165. }
  166. span:nth-of-type(2){
  167. font-size: 0.2rem;
  168. width: 2rem;
  169. color: #f00;
  170. }
  171. }
  172. .part:nth-of-type(4){
  173. border: 0;
  174. }
  175. .validation{
  176. width: 100%;
  177. padding-left: 0.305556rem;
  178. span{
  179. display: inline-block;
  180. font-size: 0.388889rem;
  181. color: #333333;
  182. padding: 0.430556rem 0;
  183. margin-right: 0.5rem;
  184. width: 1.6rem;
  185. text-align: left;
  186. }
  187. input{
  188. border: 0;
  189. width: 3.5rem;
  190. }
  191. span:nth-of-type(2){
  192. padding: 0;
  193. margin: 0;
  194. width: 2.377778rem;
  195. height: 0.944444rem;
  196. line-height: 0.944444rem;
  197. text-align:center;
  198. font-size: 0.316667rem;
  199. border: 1px solid #60c0ff;
  200. border-radius: 34px;
  201. color: #60c0ff;
  202. }
  203. }
  204. .success{
  205. width: 100%;
  206. height: 14.722222rem;
  207. position: relative;
  208. padding-top: 3.916667rem;
  209. .picture{
  210. width: 2.777778rem;
  211. height: 2.777778rem;
  212. border-radius: 50%;
  213. background:url("../assets/img/drawable-mdpi/userimg.png");
  214. background-size: cover;
  215. margin: 0 auto;
  216. text-align: center;
  217. div{
  218. width: 1.152778rem;
  219. height: 1.402778rem;
  220. border-radius: 24% 24% 24% 100%;
  221. background-image: url("../assets/img/drawable-mdpi/self.png");
  222. background-position: -1.35rem -1.35rem;
  223. background: cover;
  224. float: left;
  225. margin-left: 2rem;
  226. margin-top: 2rem;
  227. }
  228. }
  229. p{
  230. clear: both;
  231. font-size: 0.5rem;
  232. line-height: 0.8rem;
  233. color: #1491e2;
  234. text-align: center;
  235. }
  236. }
  237. }
  238. }
  239. .button{
  240. clear: both;
  241. width: 9.166667rem;
  242. height: 1.111111rem;
  243. margin-left: 0.4rem;
  244. background-color: #60c0ff;
  245. box-shadow: 0px 3px 21px 5px rgba(96, 192, 255, 0.35);
  246. border-radius: 40px;
  247. line-height: 1.111111rem;
  248. color: #ffffff;
  249. text-align: center;
  250. }
  251. }
  252. }
  253. </style>