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

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