personal.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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. };
  47. },
  48. onLoad() {
  49. // this.uid = uni.getStorageSync('uid');
  50. // console.log(uni.getStorageSync('uid'),this.uid)
  51. // this.loadData();
  52. },
  53. methods: {
  54. upimg(img) {
  55. const that = this;
  56. upload().then((re) => {
  57. that[img] = re[0].url;
  58. }).catch((re) => {
  59. console.log(re,'err');
  60. })
  61. },
  62. //获取数据
  63. // loadData() {
  64. // real_check({
  65. // name: this.username,
  66. // id_card: this.idCard,
  67. // front_pic: this.front_pic,
  68. // back_pic: this.back_pic,
  69. // })
  70. // .then(data => {
  71. // let obj = this;
  72. // obj.list = data.data;
  73. // if (data.data.card == null) {
  74. // obj.number = "";
  75. // } else {
  76. // obj.number = data.data.card;
  77. // }
  78. // if (data.data.email == null) {
  79. // obj.mail = "";
  80. // } else {
  81. // obj.mail = data.data.email;
  82. // }
  83. // if (data.data.name == null) {
  84. // obj.username = '';
  85. // } else {
  86. // obj.username = data.data.name;
  87. // }
  88. // })
  89. // .catch(err => {
  90. // console.log(err);
  91. // });
  92. // },
  93. // 提交
  94. submission() {
  95. if (this.username == '') {
  96. this.$api.msg('请输入真实姓名');
  97. return;
  98. }
  99. if (this.idCard == '') {
  100. this.$api.msg('请输入身份证号');
  101. return;
  102. }
  103. if (this.front_pic == ''||this.back_pic == '') {
  104. this.$api.msg('请上传身份证正反面');
  105. return;
  106. }
  107. real_check({
  108. name: this.username,
  109. id_card: this.idCard,
  110. front_pic: this.front_pic,
  111. back_pic: this.back_pic,
  112. })
  113. .then(function(e) {
  114. uni.showToast({
  115. title: e.msg,
  116. duration: 1500,
  117. });
  118. })
  119. .catch(function(e) {
  120. console.log(e);
  121. });
  122. },
  123. //下拉刷新
  124. onPullDownRefresh() {
  125. let obj = this;
  126. //监听下拉刷新动作的执行方法,每次手动下拉刷新都会执行一次
  127. setTimeout(function() {
  128. obj.loadData();
  129. uni.stopPullDownRefresh(); //停止下拉刷新动画
  130. }, 1000);
  131. }
  132. }
  133. };
  134. </script>
  135. <style lang="scss">
  136. .login_text {
  137. width: 100%;
  138. // padding: 25rpx 0rpx;
  139. font-size: 28rpx !important;
  140. padding: 0rpx 25rpx;
  141. }
  142. .login_input {
  143. border-bottom: 1px solid #464755;
  144. padding: 35rpx;
  145. }
  146. .uploadText {
  147. padding: 47rpx 40rpx;
  148. color: #ffffff;
  149. }
  150. .imageBox {
  151. width: 100%;
  152. padding: 50rpx 15%;
  153. }
  154. .uni-input {
  155. width: 450rpx;
  156. text-align: left !important;
  157. font-size: 26rpx;
  158. }
  159. .width {
  160. width: 265rpx !important;
  161. }
  162. .code {
  163. color: #EEC680;
  164. font-size: 23rpx;
  165. border-left: 1px solid #85858E;
  166. padding-left: 25rpx;
  167. }
  168. .submission {
  169. padding: 80rpx 25rpx;
  170. .golden {
  171. background: #0C5AFA;
  172. color: #ffffff;
  173. }
  174. }
  175. .login_name {
  176. color: #ffffff;
  177. }
  178. </style>