personal.vue 4.2 KB

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