租房小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

441 lines
15 KiB

11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
  1. <template>
  2. <view class="se-p-40 se-bgc-white">
  3. <uv-form labelPosition="left" :model="form" :rules="rules" ref="form" labelWidth="60" labelStyle="font-size:26rpx;">
  4. <uv-form-item label="标题" prop="title" >
  5. <uv-input v-model="form.title" type="text" placeholder="请输入标题" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  6. </uv-form-item>
  7. <uv-form-item label="价格" prop="price">
  8. <uv-input v-model="form.price" type="text" placeholder="请输入价格" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  9. </uv-form-item>
  10. <uv-form-item label="户型" prop="house">
  11. <uv-input v-model="form.house" type="text" placeholder="请输入户型" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  12. </uv-form-item>
  13. <uv-form-item label="面积" prop="proportion">
  14. <uv-input v-model="form.proportion" type="text" placeholder="请输入面积" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  15. </uv-form-item>
  16. <uv-form-item label="所属位置" prop="address" @click="handleAreaChange()">
  17. <uv-input v-model="form.address" @click="handleAreaChange()" disabled disabledColor="#ffffff" placeholder="所属位置" border="none">
  18. </uv-input>
  19. <template v-slot:right>
  20. <uv-icon name="arrow-right"></uv-icon>
  21. </template>
  22. </uv-form-item>
  23. <uv-form-item label="编号" prop="number">
  24. <uv-input v-model="form.number" type="text" placeholder="请输入编号" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  25. </uv-form-item>
  26. <uv-form-item label="房屋周边" prop="perimeter">
  27. <uv-input v-model="form.perimeter" type="text" placeholder="请输入房屋周边" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  28. </uv-form-item>
  29. <uv-form-item label="房间数量" prop="housesNumber">
  30. <uv-number-box v-model="form.housesNumber" :min="1" :max="10"></uv-number-box>
  31. </uv-form-item>
  32. <uv-form-item label="房屋主体是否改造" labelWidth="200" prop="revamp">
  33. <uv-radio-group v-model="form.revamp" placement="row">
  34. <uv-radio name="1" label="是"></uv-radio>
  35. <uv-radio name="0" customStyle="margin-left:30rpx;" label="否"></uv-radio>
  36. </uv-radio-group>
  37. </uv-form-item>
  38. <uv-form-item label="是否经过安置" labelWidth="200" prop="resettle">
  39. <uv-radio-group v-model="form.resettle" placement="row">
  40. <uv-radio name="1" label="是"></uv-radio>
  41. <uv-radio name="0" customStyle="margin-left:30rpx;" label="否"></uv-radio>
  42. </uv-radio-group>
  43. </uv-form-item>
  44. <uv-form-item label="院子总面积" labelWidth="100" prop="yardProportion">
  45. <uv-input v-model="form.yardProportion" type="text" placeholder="请输入院子总面积" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  46. </uv-form-item>
  47. <uv-form-item label="坟包及电塔工厂噪音" labelWidth="150" prop="noise">
  48. <uv-input v-model="form.noise" type="text" placeholder="请输入坟包及电塔工厂噪音" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  49. </uv-form-item>
  50. <uv-form-item label="水电气网" prop="net">
  51. <uv-input v-model="form.net" type="text" placeholder="请输入水电气网" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  52. </uv-form-item>
  53. <uv-form-item label="停车" prop="park">
  54. <uv-input v-model="form.park" type="text" placeholder="请输入停车" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  55. </uv-form-item>
  56. <uv-form-item label="付款方式及押金" labelWidth="120" prop="deposit">
  57. <uv-input v-model="form.deposit" type="text" placeholder="请输入押金" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  58. </uv-form-item>
  59. <uv-form-item label="天府市民云房屋信息档案查询" labelWidth="100" prop="archival" labelPosition="top">
  60. <uv-input v-model="form.archival" type="text" placeholder="请输入天府市民云房屋信息档案查询" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  61. </uv-form-item>
  62. <uv-form-item label="租期" prop="tenancy">
  63. <uv-input v-model="form.tenancy" type="text" placeholder="请输入租期" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  64. </uv-form-item>
  65. <uv-form-item label="邻居对房东的评价" labelWidth="120" prop="evaluate">
  66. <uv-input v-model="form.evaluate" type="text" placeholder="请输入邻居对房东的评价" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  67. </uv-form-item>
  68. <uv-form-item label="非正常死亡" labelWidth="80" prop="death">
  69. <uv-input v-model="form.death" type="text" placeholder="请输入非正常死亡" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  70. </uv-form-item>
  71. <uv-form-item label="钥匙" prop="key">
  72. <uv-input v-model="form.key" type="text" placeholder="请输入钥匙" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  73. </uv-form-item>
  74. <uv-form-item label="佣金" prop="commission">
  75. <uv-input v-model="form.commission" type="text" placeholder="请输入佣金" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  76. </uv-form-item>
  77. <uv-form-item label="报建手续" prop="procedures">
  78. <uv-input v-model="form.procedures" type="text" placeholder="请输入报建手续" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  79. </uv-form-item>
  80. <uv-form-item label="产权证照片" labelWidth="250" prop="isOwnershipList" labelPosition="top">
  81. <uv-upload customStyle="margin-top:20rpx;" :fileList="form.ownershipList" @afterRead="afterOwnershipRead" @delete="deleteOwnershipPic" name="1"
  82. multiple :maxCount="10"></uv-upload>
  83. </uv-form-item>
  84. <uv-form-item label="房屋照片/视频" labelWidth="250" prop="isHouseList" labelPosition="top">
  85. <uv-upload customStyle="margin-top:20rpx;" :fileList="form.houseList" @afterRead="afterHouseRead" @delete="deleteHousePic" name="1"
  86. multiple :maxCount="10"></uv-upload>
  87. </uv-form-item>
  88. <uv-form-item label="备注" prop="remark" labelPosition="top">
  89. <uv-input v-model="form.remark" type="text" placeholder="请输入备注" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  90. </uv-form-item>
  91. <uv-form-item>
  92. <uv-button type="primary" text="确认发布" customStyle="margin-top: 30px;background-color: #1EC77A;border-radius: 30px;" @click="submit"></uv-button>
  93. </uv-form-item>
  94. </uv-form>
  95. <!-- 地址 -->
  96. <citySelect ref="citySelectRef" :zIndex="0" @city-change="handleCityChange"></citySelect>
  97. </view>
  98. </template>
  99. <script>
  100. import { saveOrUpdateHouse } from "@/common/api.js"
  101. import citySelect from "@/components/cityselect/index.vue"
  102. export default{
  103. components:{
  104. citySelect
  105. },
  106. data(){
  107. return{
  108. id:"",
  109. form:{
  110. title:"",//标题
  111. price:"",//价格
  112. house:"",//户型
  113. proportion:"",//面积
  114. address:"",//所属位置
  115. number:"",//编号
  116. perimeter:"",//房屋周边
  117. housesNumber:1,//房间数量
  118. revamp:0,//房屋主体是否改造
  119. resettle:0,//是否经过安置
  120. yardProportion:"",//院子总面积
  121. noise:"",//噪音
  122. net:"",//水电气网
  123. park:"",//停车
  124. deposit:"",//押金
  125. archival:"",//档案查询
  126. tenancy:"",//租期
  127. evaluate:"",//评价
  128. death:"",//非正常死亡
  129. key:"",//钥匙
  130. commission:"",//佣金
  131. procedures:"",//手续
  132. isOwnershipList:"",
  133. ownershipList:[],
  134. isHouseList:"",
  135. houseList:[],
  136. remark:""
  137. },
  138. rules:{
  139. title:[
  140. {
  141. type: 'string',
  142. required: true,
  143. message: '请输入账号',
  144. trigger: ['blur', 'change']
  145. }
  146. ],
  147. price:[
  148. {
  149. type: 'string',
  150. required: true,
  151. message: '请输入价格',
  152. trigger: ['blur', 'change']
  153. }
  154. ],
  155. house:[
  156. {
  157. type: 'string',
  158. required: true,
  159. message: '请输入户型',
  160. trigger: ['blur', 'change']
  161. }
  162. ],
  163. proportion:[
  164. {
  165. type: 'string',
  166. required: true,
  167. message: '请输入面积',
  168. trigger: ['blur', 'change']
  169. }
  170. ],
  171. number:[
  172. {
  173. type: 'string',
  174. required: true,
  175. message: '请输入编号',
  176. trigger: ['blur', 'change']
  177. }
  178. ],
  179. perimeter:[
  180. {
  181. type: 'string',
  182. required: true,
  183. message: '请输入房屋周边',
  184. trigger: ['blur', 'change']
  185. }
  186. ],
  187. yardProportion:[
  188. {
  189. type: 'string',
  190. required: true,
  191. message: '请输入院子总面积',
  192. trigger: ['blur', 'change']
  193. }
  194. ],
  195. noise:[
  196. {
  197. type: 'string',
  198. required: true,
  199. message: '请输入坟包及电塔工厂噪音',
  200. trigger: ['blur', 'change']
  201. }
  202. ],
  203. net:[
  204. {
  205. type: 'string',
  206. required: true,
  207. message: '请输入水电气网',
  208. trigger: ['blur', 'change']
  209. }
  210. ],
  211. park:[
  212. {
  213. type: 'string',
  214. required: true,
  215. message: '请输入停车',
  216. trigger: ['blur', 'change']
  217. }
  218. ],
  219. deposit:[
  220. {
  221. type: 'string',
  222. required: true,
  223. message: '请输入押金',
  224. trigger: ['blur', 'change']
  225. }
  226. ],
  227. archival:[
  228. {
  229. type: 'string',
  230. required: true,
  231. message: '请输入天府市民云房屋信息档案查询',
  232. trigger: ['blur', 'change']
  233. }
  234. ],
  235. tenancy:[
  236. {
  237. type: 'string',
  238. required: true,
  239. message: '请输入租期',
  240. trigger: ['blur', 'change']
  241. }
  242. ],
  243. evaluate:[
  244. {
  245. type: 'string',
  246. required: true,
  247. message: '请输入邻居对房东的评价',
  248. trigger: ['blur', 'change']
  249. }
  250. ],
  251. death:[
  252. {
  253. type: 'string',
  254. required: true,
  255. message: '请输入非正常死亡',
  256. trigger: ['blur', 'change']
  257. }
  258. ],
  259. key:[
  260. {
  261. type: 'string',
  262. required: true,
  263. message: '请输入钥匙',
  264. trigger: ['blur', 'change']
  265. }
  266. ],
  267. commission:[
  268. {
  269. type: 'string',
  270. required: true,
  271. message: '请输入佣金',
  272. trigger: ['blur', 'change']
  273. }
  274. ],
  275. procedures:[
  276. {
  277. type: 'string',
  278. required: true,
  279. message: '请输入报建手续',
  280. trigger: ['blur', 'change']
  281. }
  282. ],
  283. }
  284. }
  285. },
  286. watch: {
  287. 'form.ownershipList'(newValue, oldValue) {
  288. if (newValue.length > 0) {
  289. this.form.isOwnershipList = '有'
  290. } else {
  291. this.form.isOwnershipList = ''
  292. }
  293. },
  294. 'form.houseList'(newValue, oldValue) {
  295. if (newValue.length > 0) {
  296. this.form.isHouseList = '有'
  297. } else {
  298. this.form.isHouseList = ''
  299. }
  300. }
  301. },
  302. onReady() {
  303. this.$refs.form.setRules(this.rules)
  304. },
  305. onLoad(options) {
  306. this.id = options.id
  307. },
  308. mounted() {
  309. },
  310. methods:{
  311. deleteHousePic(event) {
  312. this.form.houseList.splice(event.index, 1)
  313. },
  314. async afterHouseRead(e) {
  315. let self = this
  316. e.file.forEach(file => {
  317. self.$Oss.ossUpload(file.url).then(url => {
  318. self.form.houseList.push({
  319. url
  320. })
  321. })
  322. })
  323. },
  324. deleteOwnershipPic(event) {
  325. this.form.ownershipList.splice(event.index, 1)
  326. },
  327. async afterOwnershipRead(e) {
  328. let self = this
  329. e.file.forEach(file => {
  330. self.$Oss.ossUpload(file.url).then(url => {
  331. self.form.ownershipList.push({
  332. url
  333. })
  334. })
  335. })
  336. },
  337. handleAreaChange(){
  338. this.$refs.citySelectRef.open()
  339. },
  340. handleCityChange(e) {
  341. this.form.address = e.province.label + '-' + e.city.label + '-' + e.area.label;
  342. },
  343. submit() {
  344. // price:"",//价格
  345. // house:"",//户型
  346. // proportion:"",//面积
  347. // address:"",//所属位置
  348. // number:"",//编号
  349. // perimeter:"",//房屋周边
  350. // housesNumber:1,//房间数量
  351. // revamp:0,//房屋主体是否改造
  352. // resettle:0,//是否经过安置
  353. // yardProportion:"",//院子总面积
  354. // noise:"",//噪音
  355. // net:"",//水电气网
  356. // park:"",//停车
  357. // deposit:"",//押金
  358. // archival:"",//档案查询
  359. // tenancy:"",//租期
  360. // evaluate:"",//评价
  361. // death:"",//非正常死亡
  362. // key:"",//钥匙
  363. // commission:"",//佣金
  364. // procedures:"",//手续
  365. // isOwnershipList:"",
  366. // ownershipList:[],
  367. // isHouseList:"",
  368. // houseList:[],
  369. // remark:""
  370. this.$refs.form.validate().then(res => {
  371. let params={
  372. userId:"",
  373. id:"",
  374. classId:"",//分类标识
  375. commonClass:"",//所属分类
  376. address:that.form.address,//地址
  377. homeAge:"",//户主年龄
  378. homeAz:"",//是否经过安置
  379. homeBian:"",//房屋周边
  380. homeBjsx:"",//报建手续
  381. homeCai:"",//菜地
  382. homeCat:that.form.park,//停车
  383. homeGz:that.form.revamp,//房屋主体是否改造
  384. homeHb:"",//房屋朝向及海拔
  385. homeBz:that.form.remark,//备注
  386. homeJg:"",//房屋结构
  387. homeJl:"",//距离场镇距离
  388. homeJt:"",//交通
  389. homeJtzy:"",//户主家庭职业
  390. homeMi:"",//面积
  391. homeMj:that.form.proportion,//房屋面积
  392. homeMoney:that.form.commission,//佣金
  393. homeNo:"",//房屋编号
  394. homeNum:that.form.housesNumber,//房间数量
  395. homePay:that.form.deposit,//付款方式及押金
  396. homePj:that.form.evaluate,//邻居对房东评价
  397. homeSd:that.form.net,//水电气网
  398. homeShjl:"",//距离成都西三环
  399. homeSw:that.form.death,//非正常死亡
  400. homeTf:"",//府市民云房屋信息档案查询
  401. homeTime:that.form.tenancy,//租期
  402. homeType:that.form.house,//户型
  403. homeYs:that.form.key,//钥匙
  404. homeYzmj:that.form.yardProportion,//院子总面积
  405. homeZy:that.form.noise,//坟包及电塔 工厂噪音
  406. iconName:"",//热点名称
  407. iconTitle:"",//标签
  408. num:"",//浏览量
  409. price:that.form.price,//价格
  410. timeGo:"",//年限
  411. title:that.form.title,//标题
  412. unit:"",//单位
  413. image:"",//图片
  414. iconImage:"",//左上角图标
  415. homeImage:"",//产权证照片
  416. homeMp4:"",//视频
  417. }
  418. saveOrUpdateHouse(params).then(response=>{
  419. console.info('response',response)
  420. }).catch(error=>{
  421. })
  422. }).catch(errors => {
  423. })
  424. }
  425. }
  426. }
  427. </script>
  428. <style>
  429. page{
  430. background-color: #f5f5f5;
  431. }
  432. </style>