详情小程序
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.

190 lines
5.0 KiB

  1. <template>
  2. <view class="lf-w-100 lf-h-100">
  3. <view class="lf-row-between lf-p-t-30 lf-p-b-30 lf-p-l-32 lf-p-r-32 title-border">
  4. <view class="input-title">
  5. <text style="color: #E21196;">*</text>
  6. <text class="lf-m-l-10" style="color: #131315;">真实姓名</text>
  7. </view>
  8. <view>
  9. <input type="text" placeholder="请填写真实姓名" style="text-align: right;" />
  10. </view>
  11. </view>
  12. <view class="lf-row-between lf-p-t-30 lf-p-b-30 lf-p-l-32 lf-p-r-32">
  13. <view class="input-title">
  14. <text style="color: #E21196;">*</text>
  15. <text class="lf-m-l-10" style="color: #131315;">身份证号</text>
  16. </view>
  17. <view>
  18. <input type="text" placeholder="请填写身份证号" style="text-align: right;" />
  19. </view>
  20. </view>
  21. <view class="flr"></view>
  22. <view>
  23. <view class="lf-color-777 lf-font-32 lf-p-t-30 lf-p-b-30 lf-p-l-32">
  24. 请根据示例图上传清晰照片
  25. </view>
  26. <view class="authen-pic">
  27. <view @click="lookImage(1,image_list.length-1)" v-if="image_list.length">
  28. <image :src="image_list[image_list.length-1]" mode="aspectFill" style="width: 200rpx;height: 135rpx;"></image>
  29. </view>
  30. <view v-else>
  31. <text class="lf-iconfont icon-shenfenzhengzhengmian" style="font-size: 150rpx;"></text>
  32. <!-- <image src="../../static/logo.png" mode="aspectFill" style="width: 200rpx;height: 135rpx;"></image> -->
  33. </view>
  34. <view @tap="uploadImage(1)">
  35. <view>
  36. <u-icon name="camera-fill" style="font-size: 80rpx;"></u-icon>
  37. </view>
  38. <view class="lf-color-999 lf-font-24">点击上传照片</view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="lf-row-center lf-font-28 lf-m-t-20">
  43. <text style="color: #E21196;">*</text><text class="lf-m-l-10 lf-color-222">上传身份证正面</text>
  44. </view>
  45. <view class="authen-pic" style="margin-top: 60rpx;">
  46. <view @click="lookImage(2,image_list_back.length-1)" v-if="image_list_back.length">
  47. <image :src="image_list_back[image_list_back.length-1]" mode="aspectFill" style="width: 200rpx;height: 135rpx;"></image>
  48. </view>
  49. <view v-else>
  50. <text class="lf-iconfont icon-shenfenzhengbeimian" style="font-size: 150rpx;"></text>
  51. </view>
  52. <view @tap="uploadImage(2)">
  53. <view>
  54. <u-icon name="camera-fill" style="font-size: 80rpx;"></u-icon>
  55. </view>
  56. <view class="lf-color-999 lf-font-24">点击上传照片</view>
  57. </view>
  58. </view>
  59. <view class="lf-row-center lf-font-28 lf-m-t-20">
  60. <text style="color: #E21196;">*</text><text class="lf-m-l-10 lf-color-222">上传身份证反面</text>
  61. </view>
  62. <view class="apply-btn">
  63. 申请认证
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. export default {
  69. data() {
  70. return {
  71. image_list: [],
  72. image_list_back: [],
  73. image_count: 6,
  74. content: '',
  75. frontImg: '',
  76. backImg: ''
  77. }
  78. },
  79. methods: {
  80. // 预览图片
  81. lookImage(type,index){
  82. if(type == 1) {
  83. this.$u.throttle(() => {
  84. uni.previewImage({
  85. urls: this.image_list,
  86. current: index
  87. });
  88. }, 500);
  89. }else {
  90. this.$u.throttle(() => {
  91. uni.previewImage({
  92. urls: this.image_list_back,
  93. current: index
  94. });
  95. }, 500);
  96. }
  97. },
  98. // 移除图片
  99. removeInage(current){
  100. this.image_list.splice(current, 1);
  101. },
  102. // 上传凭证图片
  103. uploadImage(type){
  104. let current_count = this.image_count - this.image_list.length;
  105. if(current_count == 0) return;
  106. uni.chooseImage({
  107. count: current_count,
  108. complete: result => {
  109. let tempFiles = result.tempFiles;
  110. let image_list = [];
  111. let overstep = false;
  112. tempFiles.map(item => {
  113. // 上传的图片需小于10MB
  114. if(item.size < 10464788){
  115. if(type == 1) {
  116. this.image_list.push(item.path)
  117. console.log(this.image_list)
  118. // this.frontImg = item.path
  119. }else {
  120. // this.backImg = item.path
  121. this.image_list_back.push(item.path)
  122. }
  123. }else{
  124. overstep = true;
  125. }
  126. })
  127. if(overstep){
  128. uni.showModal({
  129. title: '温馨提示',
  130. content: '您上传的图片含有超出10M大小的限制,请优化大小后再上传!',
  131. showCancel: false
  132. })
  133. }
  134. // this.image_list.push(...image_list);
  135. }
  136. })
  137. },
  138. }
  139. }
  140. </script>
  141. <style scoped="scoped">
  142. .apply-btn {
  143. width: 686rpx;
  144. height: 100rpx;
  145. background: #E21196;
  146. border-radius: 60rpx;
  147. margin: 0 auto;
  148. font-size: 36rpx;
  149. color: white;
  150. display: flex;
  151. justify-content: center;
  152. align-items: center;
  153. margin-top: 60rpx;
  154. }
  155. .flr{
  156. width: 100%;
  157. height: 20rpx;
  158. background: #F5F5F5;
  159. }
  160. .title-border {
  161. border-bottom: 1rpx solid rgba(0,0,0,0.1);
  162. border-top: 1rpx solid rgba(0,0,0,0.1) ;
  163. }
  164. .input-title {
  165. font-size: 32rpx;
  166. color: #131315;
  167. display: flex;
  168. justify-content: center;
  169. align-items: center;
  170. }
  171. .authen-pic {
  172. width: 686rpx;
  173. height: 349rpx;
  174. background: #F5F5F5;
  175. border-radius: 10rpx;
  176. margin: 0 auto;
  177. display: flex;
  178. flex-direction: column;
  179. justify-content: space-around;
  180. align-items: center;
  181. text-align: center;
  182. }
  183. </style>