major.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <view class="check">
  3. <uni-forms ref="form" :model="datainfo">
  4. <view class="cbox">
  5. <view class="chmain">
  6. <!-- <uni-forms-item label="上户经验" name="phonenumber">
  7. <view class="flexc">
  8. <uni-easyinput v-model="datainfo.phonenumber" :inputBorder='false' placeholder="选择或输入" />
  9. <picker range-key='text' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  10. <view class="tips">年</view>
  11. </picker>
  12. </view>
  13. </uni-forms-item> -->
  14. <picker range-key='text' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  15. <uni-forms-item label="上户经验" name="phonenumber">
  16. <view class="flexc" @click.stop="">
  17. <uni-easyinput v-model="datainfo.phonenumber" :inputBorder='false' placeholder="选择或输入学历" />
  18. <view class="tips">年</view>
  19. </view>
  20. </uni-forms-item>
  21. </picker>
  22. <picker range-key='text' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  23. <uni-forms-item label="学历" name="phonenumber">
  24. <view class="flexc" @click.stop="">
  25. <uni-easyinput v-model="datainfo.phonenumber" :inputBorder='false' placeholder="选择或输入学历" />
  26. </view>
  27. </uni-forms-item>
  28. </picker>
  29. <picker range-key='text' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  30. <uni-forms-item label="有无继续教育" name="phonenumber">
  31. <view class="flexc ml10">
  32. <view class="flex1 txr f13" :class="datainfo.iszc?'co27':'coa'">{{datainfo.iszc?'是':'选择有/无'}}</view>
  33. </view>
  34. </uni-forms-item>
  35. </picker>
  36. <uni-forms-item label="继续教育证明" name="phonenumber">
  37. <view class="flexe mt10">
  38. <view class="addimgs">
  39. <view class="assimg">
  40. <image :src="aphoto" class="img"></image>
  41. <image :src="rdelimg" class="delimg" @click="getDelFn"></image>
  42. </view>
  43. </view>
  44. <view class="addbox">
  45. <image :src="aphoto"></image>
  46. <view>添加图片</view>
  47. </view>
  48. </view>
  49. </uni-forms-item>
  50. <picker range-key='text' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  51. <uni-forms-item label="有无传染性疾病" name="phonenumber">
  52. <view class="flexc ml10">
  53. <view class="flex1 txr f13" :class="datainfo.iszc?'co27':'coa'">{{datainfo.iszc?'是':'选择有/无'}}</view>
  54. </view>
  55. </uni-forms-item>
  56. </picker>
  57. <uni-forms-item label="健康证明" name="phonenumber">
  58. <view class="flexe mt10">
  59. <view class="addimgs">
  60. <view class="assimg">
  61. <image :src="aphoto" class="img"></image>
  62. <image :src="rdelimg" class="delimg" @click="getDelFn"></image>
  63. </view>
  64. </view>
  65. <view class="addbox">
  66. <image :src="aphoto"></image>
  67. <view>添加图片</view>
  68. </view>
  69. </view>
  70. </uni-forms-item>
  71. </view>
  72. </view>
  73. </uni-forms>
  74. <view class="rhbtn mt30" @click="getNext">提交</view>
  75. <loading></loading>
  76. </view>
  77. </template>
  78. <script>
  79. import config from '@/config'
  80. import {
  81. checkPermi,
  82. checkRole
  83. } from "@/utils/permission"; // 权限判断函数
  84. import {
  85. uploadIdentify
  86. } from '@/utils/common.js'
  87. export default {
  88. components: {},
  89. data() {
  90. return {
  91. // line: require('@/work/static/car/line.png'),
  92. // car: require('@/work/static/car/carico.png'),
  93. // rimg: require('@/work/static/people/rimg.png'),
  94. aphoto: require('@/static/images/photo.png'),
  95. rdelimg: require('@/static/images/rdel.png'),
  96. baseUrl: config.baseUrl,
  97. checkflag:true,
  98. datainfo: {
  99. sex:0,
  100. realName: '',
  101. idCard: '',
  102. address: '',
  103. expirationDate: '',
  104. phonenumber: '',
  105. front: '',
  106. back: '',
  107. },
  108. syqxidx:'',
  109. sexs: [{
  110. text: '男',
  111. value: 0
  112. }, {
  113. text: '女',
  114. value: 1
  115. }],
  116. }
  117. },
  118. onLoad: function() {
  119. },
  120. methods: {
  121. checkPermi,
  122. checkRole,
  123. bindDateChange(e){
  124. var val=e.detail.value;
  125. // this.datainfo.applicationBank=this.sdyhlist[val].value;
  126. // this.applicationBank=this.sdyhlist[val].label;
  127. },
  128. getaddImage(e) {
  129. let that = this;
  130. // var rs=['D:\\idcard.png']
  131. // if(rs&&rs.length>0){
  132. // var obj={
  133. // type:e,
  134. // // url:baseUrl+rs.join(',')
  135. // url:rs.join(',')
  136. // }
  137. // that.getOcrIdCard(obj)
  138. // }
  139. // return
  140. let file = [],
  141. count = 9
  142. uni.chooseImage({
  143. count: 1,
  144. success: function(res) {
  145. let img = res.tempFilePaths;
  146. if (img.length + file.length > count) {
  147. uni.showToast({
  148. title: '最多上传' + count + '张图片',
  149. icon: 'none',
  150. duration: 2000
  151. })
  152. } else {
  153. let imglen = res.tempFilePaths.length;
  154. var fuwufile = [];
  155. uploadIdentify('/common/upload', img, 0, 0, 0, imglen, fuwufile, function(rs) {
  156. var resurl = rs[0];
  157. if (e == 'front') {
  158. that.datainfo.front = resurl.fileName;
  159. } else {
  160. that.datainfo.back = resurl.fileName;
  161. }
  162. if (rs && rs.length > 0) {
  163. var obj = {
  164. type: e,
  165. url: resurl.urlOnline
  166. }
  167. that.getOcrIdCard(obj)
  168. }
  169. })
  170. }
  171. }
  172. });
  173. },
  174. getOcrIdCard(obj) {
  175. var params = {
  176. image: obj.url,
  177. idCardSide: obj.type
  178. }
  179. getOcrIdCard(params).then(res => {
  180. if (res.code == 200) {
  181. var datainfo = res.data;
  182. if (obj.type == 'front') {
  183. this.datainfo.realName = datainfo.realName;
  184. this.datainfo.idCard = datainfo.idCard;
  185. this.datainfo.address = datainfo.address;
  186. } else {
  187. this.datainfo.expirationDate = datainfo.expirationDate
  188. }
  189. }
  190. })
  191. }
  192. }
  193. }
  194. </script>
  195. <style>
  196. page{background: #F3F3F0;}
  197. </style>
  198. <style lang="scss" scoped>
  199. .check /deep/ .uni-forms-item{min-height: 106rpx;box-sizing: border-box;display: flex;align-items: center;margin-bottom: 0;border-bottom: 2rpx solid #E6E6E6;padding:10rpx 0;}
  200. // .check .cbox /deep/ .uni-forms-item:last-child{border: none;}
  201. .check /deep/ .uni-forms-item__label{font-weight: bold;font-size: 26rpx;color: #222327;flex: 0 0 auto;width: auto !important;}
  202. .check /deep/ .uni-easyinput{flex: 1;text-align: right;font-size: 26rpx;color: #222327;}
  203. .check /deep/ .uni-easyinput__content-textarea{min-height: 40rpx;font-size: 26rpx;}
  204. .check /deep/ .uni-easyinput__placeholder-class{font-size: 26rpx;color: #AAAAAA;}
  205. .check /deep/ .uni-input-input{font-size: 26rpx;}
  206. .check /deep/ .uni-textarea-textarea{font-size: 26rpx;}
  207. .check /deep/ .is-disabled{color: #222327;background-color: #ffffff !important;}
  208. .check /deep/ .uni-data-checklist .checklist-group .checklist-box{margin:10rpx 8rpx 10rpx 16rpx;}
  209. .check /deep/ .uni-forms-item__label text{width: 110rpx;text-align-last: justify;}
  210. .check /deep/ .uni-data-checklist{flex: 0 0 auto;}
  211. .check{min-height: 100vh;padding: 20rpx 18rpx 24rpx;box-sizing: border-box;}
  212. .cbox{background: #FFFFFF;border-radius: 20rpx;flex: 1;margin-bottom: 24rpx;
  213. .chmain{
  214. padding: 0 32rpx;
  215. .upbox{height: 224rpx;background: #EFF4FF;border-radius: 20rpx;display: flex;align-items: center;justify-content: center;flex-direction: column;margin-bottom: 8rpx;overflow: auto;
  216. .img{width: 100%;height: 100%;}
  217. .addimg{width: 70rpx;height: 70rpx;margin-bottom: 16rpx;}
  218. view{font-weight: bold;font-size: 26rpx;color: #4C6686;}
  219. }
  220. .rimg{width: 16rpx;height: 28rpx;flex: 0 0 auto;margin-left: 20rpx;
  221. image{width: 100%;height: 100%;}
  222. }
  223. .checkimg{width: 80rpx;height: 40rpx;margin-right: 8rpx;}
  224. .aphoto{padding: 0 24rpx;border-left: 2rpx solid #e6e6e6;margin-left: 26rpx;
  225. image{width: 40rpx;height: 38rpx;}
  226. }
  227. }
  228. }
  229. .addimgs{display: flex;align-items: center;flex-wrap: wrap;justify-content: flex-end;
  230. .assimg{width: 128rpx;height: 128rpx;position: relative;overflow: hidden;margin: 0 0 20rpx 24rpx;
  231. .img{width: 100%;height: 100%;}
  232. .delimg{width: 24rpx;height: 24rpx;position: absolute;right: 0;top: 0;}
  233. }
  234. }
  235. .addbox{width: 160rpx;height: 128rpx;background: #F0F0F0;border-radius: 20rpx;display: flex;flex-direction: column;align-items: center;justify-content: center;margin-left: 24rpx;margin-bottom: 20rpx;flex: 0 0 auto;
  236. image{width: 48rpx;height: 42rpx;margin-bottom: 12rpx;}
  237. view{font-weight: 500;font-size: 24rpx;color: #666666;}
  238. }
  239. .tips{font-weight: bold;color: #272727;font-size: 26rpx;margin-left: 8rpx;}
  240. </style>