您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

user-card.vue 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <view class="main" :style="{height: height+'px'}">
  3. <view class="item-row">
  4. <view class="item-left">
  5. <view class="title">身份证人像面</view>
  6. <view class="desc">补传身份证人像面</view>
  7. <view class="flag"><text>拍摄示例</text> </view>
  8. </view>
  9. <view class="item-right" @click="chooseImage(1)">
  10. <view class="empty-node"></view>
  11. <image :src="state.headstockImg ?? defHeadstockImg" :data-url="state.headstockImg ?? defHeadstockImg" ></image>
  12. </view>
  13. </view>
  14. <view class="item-row">
  15. <view class="item-left">
  16. <view class="title">身份证国徽面</view>
  17. <view class="desc">补传身份证国徽面</view>
  18. <view class="flag"><text>拍摄示例</text> </view>
  19. </view>
  20. <view class="item-right" @click="chooseImage(2)">
  21. <view class="empty-node"></view>
  22. <image :src="state.installImg ?? defInstallImg" ></image>
  23. </view>
  24. </view>
  25. <view class="btn">
  26. <submit-button @submit="saveHandle" title="保存" ></submit-button>
  27. </view>
  28. </view>
  29. </template>
  30. <script lang="ts" setup>
  31. import { reactive } from "vue";
  32. import { msg, navTo } from '@/utils/utils';
  33. import {fileURL} from "@/datas/fileURL.js";
  34. const height = uni.getSystemInfoSync().windowHeight
  35. const defHeadstockImg = `${fileURL}image/applyCard/renxiang.png`;
  36. const defInstallImg = `${fileURL}image/applyCard/guohui.png`;
  37. const state = reactive({
  38. headstockImg:null,
  39. installImg:null
  40. });
  41. //选择图片
  42. const chooseImage = (type:number) => {
  43. uni.chooseImage({
  44. count: 1,
  45. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  46. //sourceType: ['album','camera'],
  47. success: function (res) {
  48. console.log(res.tempFilePaths);
  49. if (type === 1) {
  50. state.headstockImg = res.tempFilePaths[0];
  51. } else{
  52. state.installImg = res.tempFilePaths[0];
  53. }
  54. }
  55. });
  56. }
  57. //下一步
  58. const saveHandle = ()=>{
  59. if(!state.headstockImg || !state.installImg){
  60. msg('请按照要求上传图片!');
  61. return;
  62. }
  63. msg('保存成功')
  64. }
  65. </script>
  66. <style>
  67. page{
  68. background: #F3F3F3;
  69. }
  70. </style>
  71. <style lang="scss" scoped>
  72. .main{
  73. overflow: hidden;
  74. .item-row{
  75. width: calc(100% - 60rpx);
  76. margin-left: 30rpx;
  77. display: flex;
  78. justify-content: space-between;
  79. margin-top: 30rpx;
  80. background: white;
  81. padding: 30rpx;
  82. border-radius: 20rpx;
  83. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223,223,223,0.8);
  84. .item-left{
  85. .title{
  86. font-size: 34rpx;
  87. color: #333;
  88. font-weight: bold;
  89. }
  90. .desc{
  91. font-size: 24rpx;
  92. color: #999;
  93. margin: 10rpx 0;
  94. }
  95. .flag{
  96. width: 110rpx;
  97. height: 45rpx;
  98. line-height: 42rpx;
  99. color: #0A8F8A;
  100. margin-top: 16rpx;
  101. border-radius: 6rpx;
  102. text-align: center;
  103. font-size: 20rpx;
  104. background: #D9F8F1;
  105. }
  106. }
  107. .item-right{
  108. width: 295rpx;
  109. height: 188rpx;
  110. position: relative;
  111. image{
  112. position: relative;
  113. z-index: 10;
  114. width: 100%;
  115. height: 188rpx;
  116. }
  117. &::before{
  118. content:'';
  119. position: absolute;
  120. width: 22rpx;
  121. height: 22rpx;
  122. border: 4rpx solid #21BEB1;
  123. border-bottom: none;
  124. border-right: none;
  125. z-index: 0;
  126. left:-4rpx;
  127. top: -4rpx;
  128. }
  129. &::after{
  130. content:'';
  131. position: absolute;
  132. width: 22rpx;
  133. height: 22rpx;
  134. border: 4rpx solid #21BEB1;
  135. border-top: none;
  136. border-right: none;
  137. z-index: 0;
  138. left: -4rpx;
  139. bottom: -4rpx;
  140. }
  141. }
  142. .empty-node{
  143. position: absolute;
  144. z-index: 0;
  145. width: 100%;
  146. height: 100%;
  147. &::before{
  148. content:'';
  149. position: absolute;
  150. width: 22rpx;
  151. height: 22rpx;
  152. border: 4rpx solid #21BEB1;
  153. border-left: none;
  154. border-bottom: none;
  155. z-index: 0;
  156. right:-4rpx;
  157. top: -4rpx;
  158. }
  159. &::after{
  160. content:'';
  161. position: absolute;
  162. width: 22rpx;
  163. height: 22rpx;
  164. border: 4rpx solid #21BEB1;
  165. border-top: none;
  166. border-left: none;
  167. z-index: 0;
  168. right: -4rpx;
  169. bottom: -4rpx;
  170. }
  171. }
  172. }
  173. .hint{
  174. display: flex;
  175. flex-direction: row;
  176. justify-content: center;
  177. font-size: 26rpx;
  178. color: #666666;
  179. padding: 0px 30rpx;
  180. margin-top: 60rpx;
  181. .icon{
  182. width: 36rpx;
  183. height: 36rpx;
  184. margin-right: 10rpx;
  185. }
  186. view{
  187. width: calc(100% - 36rpx);
  188. }
  189. }
  190. .btn{
  191. margin:470rpx 40rpx 30rpx;
  192. }
  193. }
  194. </style>