耀实惠小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

205 lines
4.4 KiB

  1. <template>
  2. <view class="page">
  3. <view class="hint_info">
  4. <text>个人实名认证</text>
  5. <text>请如实填写个人信息</text>
  6. </view>
  7. <view class="submit_info">
  8. <u-form :model="form" ref="uForm">
  9. <u-form-item label="姓名" :label-style="{'font-size': '32rpx'}" :borderBottom="true">
  10. <u-input placeholder="请输入姓名" v-model="form.name" />
  11. </u-form-item>
  12. <u-form-item label-width="140" label="身份证号" :label-style="{'font-size': '32rpx'}">
  13. <u-input placeholder="请输入身份证号" v-model="form.idCard" maxlength="18" />
  14. </u-form-item>
  15. </u-form>
  16. </view>
  17. <!-- <text class="identity_title">身份证照片</text>
  18. <view class="identity_pic_upload_box">
  19. <view class="pic_box">
  20. <u-upload
  21. ref="uUpload"
  22. :header="headerInfo"
  23. :action="href"
  24. :custom-btn="true"
  25. image-mode="none"
  26. @on-success="onSuccess"
  27. max-count="1"
  28. width="281" height="192">
  29. <view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
  30. <image :src="img_url+'member/obverse.png'" mode=""></image>
  31. </view>
  32. </u-upload>
  33. <text>身份证头像面</text>
  34. </view>
  35. <view class="pic_box">
  36. <u-upload :custom-btn="true" :action="href" :header="headerInfo" max-count="1" width="278" height="187" @on-success="onSuccess2">
  37. <view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
  38. <image :src="img_url+'member/reverse.png'" mode=""></image>
  39. </view>
  40. </u-upload>
  41. <text>身份证国徽面</text>
  42. </view>
  43. </view>
  44. -->
  45. <button @click="toCardAdd" class="btn_success">提交认证</button>
  46. </view>
  47. </template>
  48. <script>
  49. import config_img from "@/utils/js/config.js"
  50. export default {
  51. data() {
  52. return {
  53. img_url: config_img.img_url,
  54. headerInfo: {
  55. "content-type": "application/x-www-form-urlencoded",
  56. "X-Access-Token": ''
  57. },
  58. href: "", //图片上传地址
  59. form: {
  60. name: '',
  61. idCard: '',
  62. // idCardPhoto: '',
  63. // isCardImage: '',
  64. uid: ''
  65. },
  66. userInfo: {},
  67. id: '',
  68. type:''
  69. }
  70. },
  71. onLoad(options) {
  72. this.id = options.id
  73. this.type = options.type
  74. this.href = this.$upload_img;
  75. console.log(this.href);
  76. this.headerInfo["X-Access-Token"] = uni.getStorageSync("__user_token");
  77. this.form.uid= uni.getStorageSync("__user_info").uid;
  78. },
  79. methods: {
  80. // onSuccess(res) {
  81. // this.form.idCardPhoto = res.result;
  82. // },
  83. // onSuccess2(res) {
  84. // this.form.isCardImage = res.result;
  85. // },
  86. toCardAdd() {
  87. // 实名认证
  88. const params = this.form
  89. uni.showLoading();
  90. this.$api('getCardAdd',params).then(res => {
  91. let { code, result, message} = res;
  92. uni.hideLoading();
  93. if( code == 200) {
  94. // console.log(result);
  95. // this.$Toast(message);
  96. uni.navigateTo({
  97. url: `./../authentication_success/index?id=${this.id}&type=${this.type}`
  98. })
  99. }else {
  100. this.$Toast(message);
  101. }
  102. }).catch( err => {
  103. uni.hideLoading();
  104. this.$Toast(err.message);
  105. })
  106. },
  107. }
  108. }
  109. </script>
  110. <style lang="scss" scoped>
  111. .page {
  112. background-color: #fff;
  113. }
  114. .hint_info {
  115. width: 100%;
  116. height: 161rpx;
  117. background-color: #01AEEA;
  118. display: flex;
  119. flex-direction: column;
  120. padding-left: 29rpx;
  121. text {
  122. color: #fff;
  123. &:first-child {
  124. padding-top: 40rpx;
  125. padding-bottom: 14rpx;
  126. font-size: 28rpx;
  127. font-weight: bold;
  128. }
  129. &:last-child {
  130. font-size: 26rpx;
  131. }
  132. }
  133. }
  134. .submit_info {
  135. width: 687rpx;
  136. margin: 0 auto;
  137. /deep/ .u-form-item {
  138. border-bottom: 1px solid #707070;
  139. .u-input__input{
  140. color: #929292;
  141. }
  142. }
  143. }
  144. .identity_title {
  145. display: inline-block;
  146. margin-top: 61rpx;
  147. margin-left: 33rpx;
  148. margin-bottom: 56rpx;
  149. font-size: 28rpx;
  150. font-weight: bold;
  151. }
  152. .identity_pic_upload_box {
  153. margin: 0 33rpx;
  154. display: flex;
  155. justify-content: space-between;
  156. .pic_box {
  157. display: flex;
  158. flex-direction: column;
  159. align-items: center;
  160. /deep/.u-list-item {
  161. margin: 0;
  162. }
  163. image {
  164. width: 281rpx;
  165. height: 192rpx;
  166. }
  167. text {
  168. margin-top: 46rpx;
  169. font-size: 28rpx;
  170. color: #929292;
  171. }
  172. }
  173. }
  174. .btn_success{
  175. margin: 0 auto;
  176. margin-top: 115rpx;
  177. margin-bottom: 168rpx;
  178. width: 668rpx;
  179. height: 88rpx;
  180. background-color: #01AEEA;
  181. border-radius: 38rpx;
  182. font-size: 28rpx;
  183. color: #fff;
  184. text-align: center;
  185. line-height: 88rpx;
  186. }
  187. </style>