index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view style="padding: 20rpx;font-size: 30rpx;">
  3. <view class="tit">姓名</view>
  4. <input class="srk" placeholder="请输入姓名" v-model="data.realname" />
  5. <view class="tit">身份证号</view>
  6. <input class="srk" placeholder="请输入身份证号" v-model="data.idcard" />
  7. <button type="warn" style="margin-top: 40rpx;background: #f3a511;font-size: 30rpx;" @click="onClick_1">提交认证</button>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. data() {
  13. return {
  14. constants: {},
  15. noimg:"/static/lanhu_record/ps3lynngrkw77ya7zb5jydv23q6xcffyj53c6fe453-54c4-4078-b021-8c1b292a08c2.png",
  16. data: {
  17. uid: '0',
  18. realname: '',
  19. idcard: '',
  20. idcardimg1: '',
  21. idcardimg2: '',
  22. },
  23. userinfo: null
  24. };
  25. },
  26. onShow() {
  27. var user = this.$api.getUserinfo();
  28. if (user) {
  29. this.userinfo = user;
  30. this.data.uid=this.userinfo.id;
  31. this.data.realname=this.userinfo.xm;
  32. this.data.idcard=this.userinfo.sfz;
  33. this.data.idcardimg1=this.userinfo.idcardimg1;
  34. this.data.idcardimg2=this.userinfo.idcardimg2;
  35. } else {
  36. this.userinfo = null;
  37. }
  38. },
  39. methods: {
  40. onClick_1() {
  41. var data = new Object();
  42. data.uid=this.data.uid;
  43. data.xm=this.data.realname;
  44. data.sfz=this.data.idcard;
  45. // console.log(this.userinfo.sfz);
  46. if(data.uid=="0"){
  47. uni.showToast({
  48. title: "请重新登录",
  49. icon: 'none'
  50. });
  51. uni.switchTab({
  52. url:"/pages/my/index"
  53. })
  54. return;
  55. }
  56. this.$api
  57. .MhPostModel(data, 'user/shiming')
  58. .then(res => {
  59. // console.log('MhUserRenzheng信息', JSON.stringify(res));
  60. if (res.data.code != 1) {
  61. uni.showModal({
  62. title: '提示',
  63. content: res.data.msg,
  64. showCancel:false,
  65. success: function (res) {
  66. if (res.confirm) {
  67. console.log('用户点击确定');
  68. } else if (res.cancel) {
  69. console.log('用户点击取消');
  70. }
  71. }
  72. });
  73. this.getCode();
  74. return;
  75. } else {
  76. uni.showModal({
  77. title: '提示',
  78. content: res.data.msg,
  79. showCancel:false,
  80. success: function (res) {
  81. if (res.confirm) {
  82. console.log('用户点击确定');
  83. } else if (res.cancel) {
  84. console.log('用户点击取消');
  85. }
  86. }
  87. });
  88. }
  89. })
  90. .catch(err => {
  91. // console.log('request fail', JSON.stringify(err));
  92. });
  93. }
  94. }
  95. };
  96. </script>
  97. <style lang='css'>
  98. @import '../common/common.css';
  99. @import './assets/style/index.rpx.css';
  100. page {
  101. padding: 15rpx;
  102. background: #98a737;
  103. background-attachment: fixed !important;
  104. background-repeat: no-repeat !important;
  105. }
  106. .srk {
  107. color: #000;
  108. height: 60rpx;
  109. line-height: 60rpx;
  110. background: #fff;
  111. border-radius: 10rpx;
  112. padding-left: 20rpx;
  113. font-size: 30rpx;
  114. }
  115. .tit {
  116. color: #fff;
  117. height: 60rpx;
  118. line-height: 60rpx;
  119. margin-top: 10rpx;
  120. }
  121. </style>