addhouse.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <view class="check">
  3. <view class="cbox">
  4. <view class="chtop flexc">
  5. <view class="line"></view>
  6. <view>房屋信息</view>
  7. </view>
  8. <view class="chmain">
  9. <uni-forms ref="form" :model="datainfo">
  10. <view class="upbox" @click="getaddImage">
  11. <image :src="baseUrl+datainfo.front" class="img" v-if="datainfo.front"></image>
  12. <image :src="cmico" class="addimg"></image>
  13. <view>扫描房产证自动填写</view>
  14. </view>
  15. <uni-forms-item label="房屋坐落" name="realName">
  16. <view class="flexc">
  17. <uni-easyinput v-model="datainfo.realName" disabled :inputBorder='false' placeholder="自动识别" />
  18. <view class="rimg"></view>
  19. </view>
  20. </uni-forms-item>
  21. <uni-forms-item label="房屋所属" name="phonenumber">
  22. <view class="flexc">
  23. <uni-easyinput v-model="datainfo.phonenumber" disabled :inputBorder='false' placeholder="自动识别" />
  24. <view class="rimg"></view>
  25. </view>
  26. </uni-forms-item>
  27. <uni-forms-item label="建筑面积" name="phonenumber">
  28. <view class="flexc">
  29. <uni-easyinput v-model="datainfo.phonenumber" disabled :inputBorder='false' placeholder="自动识别" />
  30. <view class="rimg"></view>
  31. </view>
  32. </uni-forms-item>
  33. <uni-forms-item label="房型" name="realName">
  34. <view class="flexjd">
  35. <picker range-key='text' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  36. <view class="flexc ml10">
  37. <view class="flex1 txr f13" :class="datainfo.iszc?'co27':'coa'">{{datainfo.iszc?'是':'请选择'}}</view>
  38. <view class="tips">室</view>
  39. </view>
  40. </picker>
  41. <picker range-key='text' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  42. <view class="flexc ml10">
  43. <view class="flex1 txr f13" :class="datainfo.iszc?'co27':'coa'">{{datainfo.iszc?'是':'请选择'}}</view>
  44. <view class="tips">厅</view>
  45. </view>
  46. </picker>
  47. <view class="rimg"></view>
  48. </view>
  49. </uni-forms-item>
  50. <uni-forms-item label="姓名" name="phonenumber">
  51. <view class="flexc">
  52. <uni-easyinput v-model="datainfo.phonenumber" :inputBorder='false' placeholder="请输入姓名" />
  53. <view class="rimg"></view>
  54. </view>
  55. </uni-forms-item>
  56. <uni-forms-item label="住户类型" name="realName">
  57. <picker range-key='text' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  58. <view class="flexc">
  59. <view class="flex1 txr f13" :class="datainfo.iszc?'co27':'coa'">{{datainfo.iszc?'是':'请选择住户类型'}}</view>
  60. <view class="rimg"><image :src="rimg"></image></view>
  61. </view>
  62. </picker>
  63. </uni-forms-item>
  64. <uni-forms-item label="是否户主" name="phonenumber">
  65. <view class="flexc">
  66. <uni-easyinput v-model="datainfo.phonenumber" disabled :inputBorder='false' placeholder="自动识别" />
  67. <view class="rimg"></view>
  68. </view>
  69. </uni-forms-item>
  70. <uni-forms-item label="与户主关系" name="realName">
  71. <picker range-key='text' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  72. <view class="flexc">
  73. <view class="flex1 txr f13" :class="datainfo.iszc?'co27':'coa'">{{datainfo.iszc?'是':'请选择与户主关系'}}</view>
  74. <view class="rimg"><image :src="rimg"></image></view>
  75. </view>
  76. </picker>
  77. </uni-forms-item>
  78. <uni-forms-item label="居住人口" name="realName">
  79. <picker range-key='text' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  80. <view class="flexc">
  81. <view class="flex1 txr f13" :class="datainfo.iszc?'co27':'coa'">{{datainfo.iszc?'是':'请选择居住人口'}}</view>
  82. <view class="rimg"><image :src="rimg"></image></view>
  83. </view>
  84. </picker>
  85. </uni-forms-item>
  86. <uni-forms-item label="有无车位" name="realName">
  87. <picker range-key='text' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  88. <view class="flexc">
  89. <view class="flex1 txr f13" :class="datainfo.iszc?'co27':'coa'">{{datainfo.iszc?'是':'请选择有/无'}}</view>
  90. <view class="rimg"><image :src="rimg"></image></view>
  91. </view>
  92. </picker>
  93. </uni-forms-item>
  94. </uni-forms>
  95. <view class="rhbtn mt30" @click="getNext">确定添加</view>
  96. </view>
  97. </view>
  98. <loading></loading>
  99. </view>
  100. </template>
  101. <script>
  102. import config from '@/config'
  103. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  104. import {uploadIdentify} from '@/utils/common.js'
  105. export default{
  106. components:{},
  107. data(){
  108. return{
  109. rimg: require('@/mine/static/house/rimg.png'),
  110. cmico:require('@/mine/static/house/cmico.png'),
  111. baseUrl:config.baseUrl,
  112. datainfo:{
  113. realName:'',
  114. idCard:'',
  115. address:'',
  116. expirationDate:'',
  117. phonenumber:'',
  118. front:'',
  119. back:'',
  120. },
  121. syqxidx:'',
  122. sexs: [{
  123. text: '男',
  124. value: 0
  125. }, {
  126. text: '女',
  127. value: 1
  128. }],
  129. }
  130. },
  131. onLoad: function() {
  132. },
  133. methods:{
  134. checkPermi, checkRole,
  135. getaddImage(e){
  136. let that = this;
  137. // var rs=['D:\\idcard.png']
  138. // if(rs&&rs.length>0){
  139. // var obj={
  140. // type:e,
  141. // // url:baseUrl+rs.join(',')
  142. // url:rs.join(',')
  143. // }
  144. // that.getOcrIdCard(obj)
  145. // }
  146. // return
  147. let file =[],count=9
  148. uni.chooseImage({
  149. count: 1,
  150. success:function(res){
  151. let img= res.tempFilePaths;
  152. if(img.length + file.length > count){
  153. uni.showToast({
  154. title: '最多上传'+count+'张图片',
  155. icon: 'none',
  156. duration: 2000
  157. })
  158. }else{
  159. let imglen = res.tempFilePaths.length;
  160. var fuwufile = [];
  161. uploadIdentify('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
  162. var resurl=rs[0];
  163. if(e=='front'){
  164. that.datainfo.front=resurl.fileName;
  165. }else{
  166. that.datainfo.back=resurl.fileName;
  167. }
  168. if(rs&&rs.length>0){
  169. var obj={
  170. type:e,
  171. url:resurl.urlOnline
  172. }
  173. that.getOcrIdCard(obj)
  174. }
  175. })
  176. }
  177. }
  178. });
  179. },
  180. getOcrIdCard(obj){
  181. var params={
  182. image:obj.url,
  183. idCardSide:obj.type
  184. }
  185. getOcrIdCard(params).then(res=>{
  186. if(res.code==200){
  187. var datainfo=res.data;
  188. if(obj.type=='front'){
  189. this.datainfo.realName=datainfo.realName;
  190. this.datainfo.idCard=datainfo.idCard;
  191. this.datainfo.address=datainfo.address;
  192. }else{
  193. this.datainfo.expirationDate=datainfo.expirationDate
  194. }
  195. }
  196. })
  197. }
  198. }
  199. }
  200. </script>
  201. <style>
  202. page{background: #F3F3F0;}
  203. </style>
  204. <style lang="scss" scoped>
  205. .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;}
  206. .check /deep/ .uni-forms-item__label{font-weight: bold;font-size: 26rpx;color: #222327;flex: 0 0 auto;width: auto !important;}
  207. .check /deep/ .uni-easyinput{flex: 1;text-align: right;font-size: 26rpx;color: #222327;}
  208. .check /deep/ .uni-easyinput__content-textarea{min-height: 40rpx;font-size: 26rpx;}
  209. .check /deep/ .uni-easyinput__placeholder-class{font-size: 26rpx;color: #AAAAAA;}
  210. .check /deep/ .uni-input-input{font-size: 26rpx;}
  211. .check /deep/ .uni-textarea-textarea{font-size: 26rpx;}
  212. .check /deep/ .uni-forms-item__label text{width: 110rpx;text-align-last: justify;}
  213. .check /deep/ .is-disabled{color: #222327;background-color: #ffffff !important;}
  214. .check{min-height: 100vh;padding: 20rpx 18rpx 22rpx;box-sizing: border-box;display: flex;box-sizing: border-box;}
  215. .cbox{background: #FFFFFF;border-radius: 20rpx;flex: 1;padding-bottom: 28rpx;
  216. .chtop{padding-top: 32rpx;margin-bottom: 22rpx;
  217. .line{width: 14rpx;height: 48rpx;background: #0256FD;border-radius:0 12rpx 12rpx 0;margin-right: 18rpx;}
  218. view{font-weight: bold;font-size: 32rpx;color: #272727;}
  219. }
  220. .chmain{
  221. padding: 0 32rpx;
  222. .upbox{height: 224rpx;background: #EFF4FF;border-radius: 20rpx;display: flex;align-items: center;justify-content: center;flex-direction: column;margin-bottom: 8rpx;overflow: auto;
  223. .img{width: 100%;height: 100%;}
  224. .addimg{width: 90rpx;height: 90rpx;margin-bottom: 8rpx;}
  225. view{font-weight: bold;font-size: 26rpx;color: #4C6686;}
  226. }
  227. }
  228. .rimg{width: 16rpx;height: 28rpx;flex: 0 0 auto;margin-left: 20rpx;
  229. image{width: 100%;height: 100%;}
  230. }
  231. }
  232. .tips{font-weight: bold;color: #272727;font-size: 26rpx;margin-left: 8rpx;}
  233. </style>