personal.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <view class="body_content">
  3. <view class="login_text">
  4. <view class="login_input flex" style="padding-top: 45rpx;">
  5. <view class="login_name">姓名</view>
  6. <view class="login_name"><input class="uni-input" type="text" v-model="username" placeholder="请输入真实姓名" /></view>
  7. </view>
  8. <view class="login_input flex">
  9. <view class="login_name"><text>身份证号</text></view>
  10. <view class="login_name"><input class="uni-input" type="idcard" v-model="idCard" placeholder="请输入身份证号" /></view>
  11. </view>
  12. <view class="login_input flex">
  13. <view class="login_name"><text>手机号</text></view>
  14. <view class="login_name"><input class="uni-input" type="number" v-model="phone" placeholder="请输入手机号" /></view>
  15. </view>
  16. <view class="login_input flex">
  17. <view class="login_name"><text>验证码</text></view>
  18. <view class="login_name flex_item">
  19. <input style="width: 310rpx;" class="uni-input" type="number" v-model="vcode" placeholder="请输入验证码" />
  20. <view class="" style="font-size: 26rpx;color: #0C5AFA;">获取验证码</view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="uploadText">身份证照片(正反两面)</view>
  25. <view class="flex upLoadBox">
  26. <view class="imageBox flex">
  27. <image src="../../static/img/add.png" style="width: 180rpx;" mode="widthFix"></image>
  28. <image src="../../static/img/add.png" style="width: 180rpx;" mode="widthFix"></image>
  29. </view>
  30. </view>
  31. <view class="submission">
  32. <button class="golden" type="golden" hover-class="none" @click="submission">提交认证</button>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script type="text/javascript">
  38. // import { show_us,attestation } from '@/api/user.js';
  39. export default {
  40. data() {
  41. return {
  42. username:'',
  43. idCard:'',
  44. phone:'',
  45. vcode:''
  46. };
  47. },
  48. onLoad() {
  49. // this.uid = uni.getStorageSync('uid');
  50. // console.log(uni.getStorageSync('uid'),this.uid)
  51. // this.loadData();
  52. },
  53. methods: {
  54. //获取数据
  55. loadData() {
  56. show_us({
  57. uid:this.uid
  58. })
  59. .then(data => {
  60. let obj = this;
  61. obj.list = data.data;
  62. if(data.data.card == null){
  63. obj.number = "";
  64. }else{
  65. obj.number = data.data.card;
  66. }
  67. if(data.data.email == null){
  68. obj.mail = "";
  69. }else{
  70. obj.mail = data.data.email;
  71. }
  72. if( data.data.name == null){
  73. obj.username = '';
  74. }else{
  75. obj.username = data.data.name;
  76. }
  77. })
  78. .catch(err => {
  79. console.log(err);
  80. });
  81. },
  82. // 提交
  83. submission() {
  84. if (this.mail == '') {
  85. this.$api.msg('请输入电子邮箱');
  86. return;
  87. }
  88. if (this.username == '') {
  89. this.$api.msg('请输入真实姓名');
  90. return;
  91. }
  92. if (this.number == '') {
  93. this.$api.msg('请输入身份证号');
  94. return;
  95. }
  96. attestation({
  97. uid:this.uid,
  98. email: this.mail,
  99. name: this.username,
  100. card: this.number,
  101. })
  102. .then(function(e) {
  103. uni.showToast({
  104. title: e.message,
  105. duration: 1500,
  106. mask: false,
  107. icon: 'none'
  108. });
  109. })
  110. .catch(function(e) {
  111. console.log(e);
  112. });
  113. },
  114. //下拉刷新
  115. onPullDownRefresh() {
  116. let obj = this;
  117. //监听下拉刷新动作的执行方法,每次手动下拉刷新都会执行一次
  118. setTimeout(function() {
  119. obj.loadData();
  120. uni.stopPullDownRefresh(); //停止下拉刷新动画
  121. }, 1000);
  122. }
  123. }
  124. };
  125. </script>
  126. <style lang="scss">
  127. .login_text {
  128. width: 100%;
  129. // padding: 25rpx 0rpx;
  130. font-size: 28rpx !important;
  131. padding: 0rpx 25rpx;
  132. }
  133. .login_input {
  134. border-bottom: 1px solid #464755;
  135. padding: 35rpx;
  136. }
  137. .uploadText{
  138. padding: 47rpx 40rpx;
  139. color: #ffffff;
  140. }
  141. .imageBox{
  142. width: 100%;
  143. padding: 50rpx 15%;
  144. }
  145. .uni-input{
  146. width:450rpx;
  147. text-align: left !important;
  148. font-size: 26rpx;
  149. }
  150. .width {
  151. width: 265rpx !important;
  152. }
  153. .code {
  154. color: #EEC680;
  155. font-size: 23rpx;
  156. border-left: 1px solid #85858E;
  157. padding-left: 25rpx;
  158. }
  159. .submission{
  160. padding: 80rpx 25rpx;
  161. .golden{
  162. background: #0C5AFA;
  163. color: #ffffff;
  164. }
  165. }
  166. .login_name {
  167. color: #ffffff;
  168. }
  169. </style>