houseadd.vue 8.3 KB

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