info.vue 7.2 KB

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