idcheck.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view class="page">
  3. <block v-if="myinfo.step < 9">
  4. <view class="list_info">
  5. <view class="name">姓名:</view>
  6. <view class="item">
  7. <input type="text" class="input" v-model="realname" placeholder="请输入真实姓名" maxlength="16" />
  8. </view>
  9. <view class="name">身份证号:</view>
  10. <view class="item">
  11. <input type="text" class="input" v-model="idcard" placeholder="请输入身份证号" maxlength="18" />
  12. </view>
  13. <view class="blankHeight"></view>
  14. </view>
  15. <view class="btn_submit" @click="setSFZ()">提交实名认证</view>
  16. </block>
  17. <block v-if="myinfo.step == 9">
  18. <view class="mainInfo">
  19. <image style="margin-top: 150rpx;height: 120rpx;" src="../../static/me/img_checkMark.png"
  20. mode="heightFix" />
  21. <text
  22. style="margin-top: 60rpx;margin-bottom: 30rpx;color:#333;font-size: 28rpx;">{{$t('txt.恭喜您已完成实名认证')}}</text>
  23. <view class="idList">
  24. <view class="left">
  25. <text style="font-size: 28rpx;color: #999999;">{{$t('txt.姓名')}}</text>
  26. </view>
  27. <view class="right">
  28. <text style="font-size: 28rpx;color: #333;">{{myinfo.realname}}</text>
  29. </view>
  30. </view>
  31. <view class="idList">
  32. <view class="left">
  33. <text style="font-size: 28rpx;color: #999999;">{{$t('txt.身份证号')}}</text>
  34. </view>
  35. <view class="right">
  36. <text style="font-size: 28rpx;color: #333;">{{myinfo.idcard}}</text>
  37. </view>
  38. </view>
  39. <view class="reCheckBtn" v-if="false">
  40. <text style="color:#FF2A95;font-size: 32rpx;">{{$t('txt.重新认证')}}</text>
  41. </view>
  42. </view>
  43. </block>
  44. <!-- 提示框 -->
  45. <DialogBox ref="DialogBox"></DialogBox>
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. components: {},
  51. data() {
  52. return {
  53. title: '',
  54. myinfo: {},
  55. realname: '',
  56. idcard: ''
  57. }
  58. },
  59. onLoad() {
  60. this.loadInfo();
  61. },
  62. onShow() {},
  63. methods: {
  64. onBack() {},
  65. loadInfo() {
  66. uni.request({
  67. url: this.$apiHost + '/My/idcheck',
  68. data: {
  69. uuid: getApp().globalData.uuid
  70. },
  71. header: {
  72. "content-type": "application/json",
  73. 'sign': getApp().globalData.headerSign
  74. },
  75. success: (res) => {
  76. console.log("----:", res.data);
  77. this.myinfo = res.data;
  78. },
  79. complete: (com) => {
  80. // uni.hideLoading();
  81. },
  82. fail: (e) => {
  83. console.log("----e:", e);
  84. }
  85. });
  86. },
  87. setSFZ() {
  88. if (this.realname == '') {
  89. uni.showToast({
  90. title: "请填写姓名",
  91. icon: 'none'
  92. });
  93. return;
  94. }
  95. if (this.idcard.length < 15) {
  96. uni.showToast({
  97. title: "请填写身份证号",
  98. icon: 'none'
  99. });
  100. return;
  101. }
  102. uni.request({
  103. url: this.$apiHost + '/My/setsfz',
  104. data: {
  105. uuid: getApp().globalData.uuid,
  106. realname: this.realname,
  107. idcard: this.idcard
  108. },
  109. header: {
  110. "content-type": "application/json",
  111. 'sign': getApp().globalData.headerSign
  112. },
  113. success: (res) => {
  114. console.log("----:", res.data);
  115. uni.showToast({
  116. title: res.data.str,
  117. icon: 'none'
  118. })
  119. if (res.data.success == 'yes') {
  120. this.loadInfo();
  121. }
  122. },
  123. complete: (com) => {
  124. // uni.hideLoading();
  125. },
  126. fail: (e) => {
  127. console.log("----e:", e);
  128. }
  129. });
  130. },
  131. }
  132. }
  133. </script>
  134. <style scoped lang="scss">
  135. @import 'normal.scss';
  136. @import 'idcheck.scss';
  137. </style>