租房小程序前端代码
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.

637 lines
19 KiB

7 months ago
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const citySelect = () => "../../components/cityselect/index.js";
  4. const _sfc_main = {
  5. components: {
  6. citySelect
  7. },
  8. data() {
  9. return {
  10. form: {
  11. title: "",
  12. //标题
  13. price: "",
  14. //价格
  15. house: "",
  16. //户型
  17. proportion: "",
  18. //面积
  19. address: "",
  20. //所属位置
  21. number: "",
  22. //编号
  23. perimeter: "",
  24. //房屋周边
  25. housesNumber: 1,
  26. //房间数量
  27. revamp: 0,
  28. //房屋主体是否改造
  29. resettle: 0,
  30. //是否经过安置
  31. yardProportion: "",
  32. //院子总面积
  33. noise: "",
  34. //噪音
  35. net: "",
  36. //水电气网
  37. park: "",
  38. //停车
  39. deposit: "",
  40. //押金
  41. archival: "",
  42. //档案查询
  43. tenancy: "",
  44. //租期
  45. evaluate: "",
  46. //评价
  47. death: "",
  48. //非正常死亡
  49. key: "",
  50. //钥匙
  51. commission: "",
  52. //佣金
  53. procedures: "",
  54. //手续
  55. isOwnershipList: "",
  56. ownershipList: [],
  57. isHouseList: "",
  58. houseList: [],
  59. remark: ""
  60. },
  61. rules: {
  62. title: [
  63. {
  64. type: "string",
  65. required: true,
  66. message: "请输入账号",
  67. trigger: ["blur", "change"]
  68. }
  69. ],
  70. price: [
  71. {
  72. type: "string",
  73. required: true,
  74. message: "请输入价格",
  75. trigger: ["blur", "change"]
  76. }
  77. ],
  78. house: [
  79. {
  80. type: "string",
  81. required: true,
  82. message: "请输入户型",
  83. trigger: ["blur", "change"]
  84. }
  85. ],
  86. proportion: [
  87. {
  88. type: "string",
  89. required: true,
  90. message: "请输入面积",
  91. trigger: ["blur", "change"]
  92. }
  93. ],
  94. number: [
  95. {
  96. type: "string",
  97. required: true,
  98. message: "请输入编号",
  99. trigger: ["blur", "change"]
  100. }
  101. ],
  102. perimeter: [
  103. {
  104. type: "string",
  105. required: true,
  106. message: "请输入房屋周边",
  107. trigger: ["blur", "change"]
  108. }
  109. ],
  110. yardProportion: [
  111. {
  112. type: "string",
  113. required: true,
  114. message: "请输入院子总面积",
  115. trigger: ["blur", "change"]
  116. }
  117. ],
  118. noise: [
  119. {
  120. type: "string",
  121. required: true,
  122. message: "请输入坟包及电塔工厂噪音",
  123. trigger: ["blur", "change"]
  124. }
  125. ],
  126. net: [
  127. {
  128. type: "string",
  129. required: true,
  130. message: "请输入水电气网",
  131. trigger: ["blur", "change"]
  132. }
  133. ],
  134. park: [
  135. {
  136. type: "string",
  137. required: true,
  138. message: "请输入停车",
  139. trigger: ["blur", "change"]
  140. }
  141. ],
  142. deposit: [
  143. {
  144. type: "string",
  145. required: true,
  146. message: "请输入押金",
  147. trigger: ["blur", "change"]
  148. }
  149. ],
  150. archival: [
  151. {
  152. type: "string",
  153. required: true,
  154. message: "请输入天府市民云房屋信息档案查询",
  155. trigger: ["blur", "change"]
  156. }
  157. ],
  158. tenancy: [
  159. {
  160. type: "string",
  161. required: true,
  162. message: "请输入租期",
  163. trigger: ["blur", "change"]
  164. }
  165. ],
  166. evaluate: [
  167. {
  168. type: "string",
  169. required: true,
  170. message: "请输入邻居对房东的评价",
  171. trigger: ["blur", "change"]
  172. }
  173. ],
  174. death: [
  175. {
  176. type: "string",
  177. required: true,
  178. message: "请输入非正常死亡",
  179. trigger: ["blur", "change"]
  180. }
  181. ],
  182. key: [
  183. {
  184. type: "string",
  185. required: true,
  186. message: "请输入钥匙",
  187. trigger: ["blur", "change"]
  188. }
  189. ],
  190. commission: [
  191. {
  192. type: "string",
  193. required: true,
  194. message: "请输入佣金",
  195. trigger: ["blur", "change"]
  196. }
  197. ],
  198. procedures: [
  199. {
  200. type: "string",
  201. required: true,
  202. message: "请输入报建手续",
  203. trigger: ["blur", "change"]
  204. }
  205. ]
  206. }
  207. };
  208. },
  209. watch: {
  210. "form.ownershipList"(newValue, oldValue) {
  211. if (newValue.length > 0) {
  212. this.form.isOwnershipList = "有";
  213. } else {
  214. this.form.isOwnershipList = "";
  215. }
  216. },
  217. "form.houseList"(newValue, oldValue) {
  218. if (newValue.length > 0) {
  219. this.form.isHouseList = "有";
  220. } else {
  221. this.form.isHouseList = "";
  222. }
  223. }
  224. },
  225. onReady() {
  226. this.$refs.form.setRules(this.rules);
  227. },
  228. methods: {
  229. deleteHousePic(event) {
  230. this.form.houseList.splice(event.index, 1);
  231. },
  232. async afterHouseRead(e) {
  233. let self = this;
  234. e.file.forEach((file) => {
  235. self.$Oss.ossUpload(file.url).then((url) => {
  236. self.form.houseList.push({
  237. url
  238. });
  239. });
  240. });
  241. },
  242. deleteOwnershipPic(event) {
  243. this.form.ownershipList.splice(event.index, 1);
  244. },
  245. async afterOwnershipRead(e) {
  246. let self = this;
  247. e.file.forEach((file) => {
  248. self.$Oss.ossUpload(file.url).then((url) => {
  249. self.form.ownershipList.push({
  250. url
  251. });
  252. });
  253. });
  254. },
  255. handleAreaChange() {
  256. this.$refs.citySelectRef.open();
  257. },
  258. handleCityChange(e) {
  259. this.form.address = e.province.label + "-" + e.city.label + "-" + e.area.label;
  260. },
  261. submit() {
  262. this.$refs.form.validate().then((res) => {
  263. common_vendor.index.showToast({
  264. icon: "none",
  265. title: "校验通过"
  266. });
  267. }).catch((errors) => {
  268. common_vendor.index.showToast({
  269. icon: "none",
  270. title: "校验失败"
  271. });
  272. });
  273. }
  274. }
  275. };
  276. if (!Array) {
  277. const _easycom_uv_input2 = common_vendor.resolveComponent("uv-input");
  278. const _easycom_uv_form_item2 = common_vendor.resolveComponent("uv-form-item");
  279. const _easycom_uv_icon2 = common_vendor.resolveComponent("uv-icon");
  280. const _easycom_uv_number_box2 = common_vendor.resolveComponent("uv-number-box");
  281. const _easycom_uv_radio2 = common_vendor.resolveComponent("uv-radio");
  282. const _easycom_uv_radio_group2 = common_vendor.resolveComponent("uv-radio-group");
  283. const _easycom_uv_upload2 = common_vendor.resolveComponent("uv-upload");
  284. const _easycom_uv_button2 = common_vendor.resolveComponent("uv-button");
  285. const _easycom_uv_form2 = common_vendor.resolveComponent("uv-form");
  286. const _component_citySelect = common_vendor.resolveComponent("citySelect");
  287. (_easycom_uv_input2 + _easycom_uv_form_item2 + _easycom_uv_icon2 + _easycom_uv_number_box2 + _easycom_uv_radio2 + _easycom_uv_radio_group2 + _easycom_uv_upload2 + _easycom_uv_button2 + _easycom_uv_form2 + _component_citySelect)();
  288. }
  289. const _easycom_uv_input = () => "../../uni_modules/uv-input/components/uv-input/uv-input.js";
  290. const _easycom_uv_form_item = () => "../../uni_modules/uv-form/components/uv-form-item/uv-form-item.js";
  291. const _easycom_uv_icon = () => "../../uni_modules/uv-icon/components/uv-icon/uv-icon.js";
  292. const _easycom_uv_number_box = () => "../../uni_modules/uv-number-box/components/uv-number-box/uv-number-box.js";
  293. const _easycom_uv_radio = () => "../../uni_modules/uv-radio/components/uv-radio/uv-radio.js";
  294. const _easycom_uv_radio_group = () => "../../uni_modules/uv-radio/components/uv-radio-group/uv-radio-group.js";
  295. const _easycom_uv_upload = () => "../../uni_modules/uv-upload/components/uv-upload/uv-upload.js";
  296. const _easycom_uv_button = () => "../../uni_modules/uv-button/components/uv-button/uv-button.js";
  297. const _easycom_uv_form = () => "../../uni_modules/uv-form/components/uv-form/uv-form.js";
  298. if (!Math) {
  299. (_easycom_uv_input + _easycom_uv_form_item + _easycom_uv_icon + _easycom_uv_number_box + _easycom_uv_radio + _easycom_uv_radio_group + _easycom_uv_upload + _easycom_uv_button + _easycom_uv_form)();
  300. }
  301. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  302. return {
  303. a: common_vendor.o(($event) => $data.form.title = $event),
  304. b: common_vendor.p({
  305. type: "text",
  306. placeholder: "请输入标题",
  307. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  308. modelValue: $data.form.title
  309. }),
  310. c: common_vendor.p({
  311. label: "标题",
  312. prop: "title"
  313. }),
  314. d: common_vendor.o(($event) => $data.form.price = $event),
  315. e: common_vendor.p({
  316. type: "text",
  317. placeholder: "请输入价格",
  318. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  319. modelValue: $data.form.price
  320. }),
  321. f: common_vendor.p({
  322. label: "价格",
  323. prop: "price"
  324. }),
  325. g: common_vendor.o(($event) => $data.form.house = $event),
  326. h: common_vendor.p({
  327. type: "text",
  328. placeholder: "请输入户型",
  329. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  330. modelValue: $data.form.house
  331. }),
  332. i: common_vendor.p({
  333. label: "户型",
  334. prop: "house"
  335. }),
  336. j: common_vendor.o(($event) => $data.form.proportion = $event),
  337. k: common_vendor.p({
  338. type: "text",
  339. placeholder: "请输入面积",
  340. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  341. modelValue: $data.form.proportion
  342. }),
  343. l: common_vendor.p({
  344. label: "面积",
  345. prop: "proportion"
  346. }),
  347. m: common_vendor.o(($event) => $options.handleAreaChange()),
  348. n: common_vendor.o(($event) => $data.form.address = $event),
  349. o: common_vendor.p({
  350. disabled: true,
  351. disabledColor: "#ffffff",
  352. placeholder: "所属位置",
  353. border: "none",
  354. modelValue: $data.form.address
  355. }),
  356. p: common_vendor.p({
  357. name: "arrow-right"
  358. }),
  359. q: common_vendor.o(($event) => $options.handleAreaChange()),
  360. r: common_vendor.p({
  361. label: "所属位置",
  362. prop: "address"
  363. }),
  364. s: common_vendor.o(($event) => $data.form.number = $event),
  365. t: common_vendor.p({
  366. type: "text",
  367. placeholder: "请输入编号",
  368. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  369. modelValue: $data.form.number
  370. }),
  371. v: common_vendor.p({
  372. label: "编号",
  373. prop: "number"
  374. }),
  375. w: common_vendor.o(($event) => $data.form.perimeter = $event),
  376. x: common_vendor.p({
  377. type: "text",
  378. placeholder: "请输入房屋周边",
  379. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  380. modelValue: $data.form.perimeter
  381. }),
  382. y: common_vendor.p({
  383. label: "房屋周边",
  384. prop: "perimeter"
  385. }),
  386. z: common_vendor.o(($event) => $data.form.housesNumber = $event),
  387. A: common_vendor.p({
  388. min: 1,
  389. max: 10,
  390. modelValue: $data.form.housesNumber
  391. }),
  392. B: common_vendor.p({
  393. label: "房间数量",
  394. prop: "housesNumber"
  395. }),
  396. C: common_vendor.p({
  397. name: "1",
  398. label: "是"
  399. }),
  400. D: common_vendor.p({
  401. name: "0",
  402. customStyle: "margin-left:30rpx;",
  403. label: "否"
  404. }),
  405. E: common_vendor.o(($event) => $data.form.revamp = $event),
  406. F: common_vendor.p({
  407. placement: "row",
  408. modelValue: $data.form.revamp
  409. }),
  410. G: common_vendor.p({
  411. label: "房屋主体是否改造",
  412. labelWidth: "200",
  413. prop: "revamp"
  414. }),
  415. H: common_vendor.p({
  416. name: "1",
  417. label: "是"
  418. }),
  419. I: common_vendor.p({
  420. name: "0",
  421. customStyle: "margin-left:30rpx;",
  422. label: "否"
  423. }),
  424. J: common_vendor.o(($event) => $data.form.resettle = $event),
  425. K: common_vendor.p({
  426. placement: "row",
  427. modelValue: $data.form.resettle
  428. }),
  429. L: common_vendor.p({
  430. label: "是否经过安置",
  431. labelWidth: "200",
  432. prop: "resettle"
  433. }),
  434. M: common_vendor.o(($event) => $data.form.yardProportion = $event),
  435. N: common_vendor.p({
  436. type: "text",
  437. placeholder: "请输入院子总面积",
  438. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  439. modelValue: $data.form.yardProportion
  440. }),
  441. O: common_vendor.p({
  442. label: "院子总面积",
  443. labelWidth: "100",
  444. prop: "yardProportion"
  445. }),
  446. P: common_vendor.o(($event) => $data.form.noise = $event),
  447. Q: common_vendor.p({
  448. type: "text",
  449. placeholder: "请输入坟包及电塔工厂噪音",
  450. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  451. modelValue: $data.form.noise
  452. }),
  453. R: common_vendor.p({
  454. label: "坟包及电塔工厂噪音",
  455. labelWidth: "150",
  456. prop: "noise"
  457. }),
  458. S: common_vendor.o(($event) => $data.form.net = $event),
  459. T: common_vendor.p({
  460. type: "text",
  461. placeholder: "请输入水电气网",
  462. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  463. modelValue: $data.form.net
  464. }),
  465. U: common_vendor.p({
  466. label: "水电气网",
  467. prop: "net"
  468. }),
  469. V: common_vendor.o(($event) => $data.form.park = $event),
  470. W: common_vendor.p({
  471. type: "text",
  472. placeholder: "请输入停车",
  473. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  474. modelValue: $data.form.park
  475. }),
  476. X: common_vendor.p({
  477. label: "停车",
  478. prop: "park"
  479. }),
  480. Y: common_vendor.o(($event) => $data.form.deposit = $event),
  481. Z: common_vendor.p({
  482. type: "text",
  483. placeholder: "请输入押金",
  484. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  485. modelValue: $data.form.deposit
  486. }),
  487. aa: common_vendor.p({
  488. label: "付款方式及押金",
  489. labelWidth: "120",
  490. prop: "deposit"
  491. }),
  492. ab: common_vendor.o(($event) => $data.form.archival = $event),
  493. ac: common_vendor.p({
  494. type: "text",
  495. placeholder: "请输入天府市民云房屋信息档案查询",
  496. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  497. modelValue: $data.form.archival
  498. }),
  499. ad: common_vendor.p({
  500. label: "天府市民云房屋信息档案查询",
  501. labelWidth: "100",
  502. prop: "archival",
  503. labelPosition: "top"
  504. }),
  505. ae: common_vendor.o(($event) => $data.form.tenancy = $event),
  506. af: common_vendor.p({
  507. type: "text",
  508. placeholder: "请输入租期",
  509. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  510. modelValue: $data.form.tenancy
  511. }),
  512. ag: common_vendor.p({
  513. label: "租期",
  514. prop: "tenancy"
  515. }),
  516. ah: common_vendor.o(($event) => $data.form.evaluate = $event),
  517. ai: common_vendor.p({
  518. type: "text",
  519. placeholder: "请输入邻居对房东的评价",
  520. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  521. modelValue: $data.form.evaluate
  522. }),
  523. aj: common_vendor.p({
  524. label: "邻居对房东的评价",
  525. labelWidth: "120",
  526. prop: "evaluate"
  527. }),
  528. ak: common_vendor.o(($event) => $data.form.death = $event),
  529. al: common_vendor.p({
  530. type: "text",
  531. placeholder: "请输入非正常死亡",
  532. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  533. modelValue: $data.form.death
  534. }),
  535. am: common_vendor.p({
  536. label: "非正常死亡",
  537. labelWidth: "80",
  538. prop: "death"
  539. }),
  540. an: common_vendor.o(($event) => $data.form.key = $event),
  541. ao: common_vendor.p({
  542. type: "text",
  543. placeholder: "请输入钥匙",
  544. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  545. modelValue: $data.form.key
  546. }),
  547. ap: common_vendor.p({
  548. label: "钥匙",
  549. prop: "key"
  550. }),
  551. aq: common_vendor.o(($event) => $data.form.commission = $event),
  552. ar: common_vendor.p({
  553. type: "text",
  554. placeholder: "请输入佣金",
  555. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  556. modelValue: $data.form.commission
  557. }),
  558. as: common_vendor.p({
  559. label: "佣金",
  560. prop: "commission"
  561. }),
  562. at: common_vendor.o(($event) => $data.form.procedures = $event),
  563. av: common_vendor.p({
  564. type: "text",
  565. placeholder: "请输入报建手续",
  566. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  567. modelValue: $data.form.procedures
  568. }),
  569. aw: common_vendor.p({
  570. label: "报建手续",
  571. prop: "procedures"
  572. }),
  573. ax: common_vendor.o($options.afterOwnershipRead),
  574. ay: common_vendor.o($options.deleteOwnershipPic),
  575. az: common_vendor.p({
  576. customStyle: "margin-top:20rpx;",
  577. fileList: $data.form.ownershipList,
  578. name: "1",
  579. multiple: true,
  580. maxCount: 10
  581. }),
  582. aA: common_vendor.p({
  583. label: "产权证照片",
  584. labelWidth: "250",
  585. prop: "isOwnershipList",
  586. labelPosition: "top"
  587. }),
  588. aB: common_vendor.o($options.afterHouseRead),
  589. aC: common_vendor.o($options.deleteHousePic),
  590. aD: common_vendor.p({
  591. customStyle: "margin-top:20rpx;",
  592. fileList: $data.form.houseList,
  593. name: "1",
  594. multiple: true,
  595. maxCount: 10
  596. }),
  597. aE: common_vendor.p({
  598. label: "房屋照片/视频",
  599. labelWidth: "250",
  600. prop: "isHouseList",
  601. labelPosition: "top"
  602. }),
  603. aF: common_vendor.o(($event) => $data.form.remark = $event),
  604. aG: common_vendor.p({
  605. type: "text",
  606. placeholder: "请输入备注",
  607. customStyle: "border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;",
  608. modelValue: $data.form.remark
  609. }),
  610. aH: common_vendor.p({
  611. label: "备注",
  612. prop: "remark",
  613. labelPosition: "top"
  614. }),
  615. aI: common_vendor.o($options.submit),
  616. aJ: common_vendor.p({
  617. type: "primary",
  618. text: "确认发布",
  619. customStyle: "margin-top: 30px;background-color: #1EC77A;border-radius: 30px;"
  620. }),
  621. aK: common_vendor.sr("form", "75a279ac-0"),
  622. aL: common_vendor.p({
  623. labelPosition: "left",
  624. model: $data.form,
  625. rules: $data.rules,
  626. labelWidth: "60",
  627. labelStyle: "font-size:26rpx;"
  628. }),
  629. aM: common_vendor.sr("citySelectRef", "75a279ac-58"),
  630. aN: common_vendor.o($options.handleCityChange),
  631. aO: common_vendor.p({
  632. zIndex: 0
  633. })
  634. };
  635. }
  636. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
  637. wx.createPage(MiniProgramPage);