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

917 lines
32 KiB

6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
2 months ago
6 months ago
2 months ago
6 months ago
6 months ago
6 months ago
6 months ago
2 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
2 months ago
2 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 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="homeAge">
  11. <uv-input v-model="form.homeAge" 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="house">
  14. <uv-input v-model="form.house" 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="proportion">
  17. <uv-input v-model="form.proportion" type="text" placeholder="请输入房屋面积" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  18. </uv-form-item>
  19. <uv-form-item label="房屋结构" prop="homeJg">
  20. <uv-input v-model="form.homeJg" type="text" placeholder="请输入房屋结构" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  21. </uv-form-item>
  22. <uv-form-item label="交通" prop="homeJt">
  23. <uv-input v-model="form.homeJt" type="text" placeholder="请输入交通" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  24. </uv-form-item>
  25. <uv-form-item label="面积" prop="homeMi">
  26. <uv-input v-model="form.homeMi" type="text" placeholder="请输入面积" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  27. </uv-form-item>
  28. <uv-form-item label="所属位置" prop="address" @click="handleAreaChange()">
  29. <uv-input v-model="form.address" @click="handleAreaChange()" disabled disabledColor="#ffffff" placeholder="选择所在位置" border="none">
  30. </uv-input>
  31. <template v-slot:right>
  32. <uv-icon name="arrow-right"></uv-icon>
  33. </template>
  34. </uv-form-item>
  35. <uv-form-item label="分类标识" prop="classId" @click="handleClass()">
  36. <uv-input v-model="form.className" @click="handleClass()" disabled disabledColor="#ffffff" placeholder="选择分类标识" border="none">
  37. </uv-input>
  38. <template v-slot:right>
  39. <uv-icon name="arrow-right"></uv-icon>
  40. </template>
  41. </uv-form-item>
  42. <uv-form-item label="所属分类" prop="commonId" @click="handleCommon()">
  43. <uv-input v-model="form.commonName" @click="handleCommon()" disabled disabledColor="#ffffff" placeholder="选择所属分类" border="none">
  44. </uv-input>
  45. <template v-slot:right>
  46. <uv-icon name="arrow-right"></uv-icon>
  47. </template>
  48. </uv-form-item>
  49. <uv-form-item label="编号" prop="number">
  50. <uv-input v-model="form.number" type="text" placeholder="请输入编号" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  51. </uv-form-item>
  52. <uv-form-item label="房屋周边" prop="perimeter">
  53. <uv-input v-model="form.perimeter" type="text" placeholder="请输入房屋周边" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  54. </uv-form-item>
  55. <uv-form-item label="房屋朝向及海拔" prop="homeHb">
  56. <uv-input v-model="form.homeHb" type="text" placeholder="请输入房屋朝向及海拔" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  57. </uv-form-item>
  58. <uv-form-item label="距离场镇距离" prop="homeJl">
  59. <uv-input v-model="form.homeJl" type="text" placeholder="请输入距离场镇距离" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  60. </uv-form-item>
  61. <uv-form-item label="户主家庭职业" prop="homeJtzy">
  62. <uv-input v-model="form.homeJtzy" type="text" placeholder="请输入户主家庭职业" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  63. </uv-form-item>
  64. <uv-form-item label="标签" prop="iconTitle">
  65. <uv-input v-model="form.iconTitle" type="text" placeholder="请输入标签用逗号隔开" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  66. </uv-form-item>
  67. <uv-form-item label="房间数量" prop="housesNumber">
  68. <uv-number-box v-model="form.housesNumber" :min="1" :max="10"></uv-number-box>
  69. </uv-form-item>
  70. <uv-form-item label="房屋主体是否改造" prop="revamp">
  71. <uv-radio-group v-model="form.revamp" placement="row">
  72. <uv-radio name="1" label="是"></uv-radio>
  73. <uv-radio name="0" customStyle="margin-left:30rpx;" label="否"></uv-radio>
  74. </uv-radio-group>
  75. </uv-form-item>
  76. <uv-form-item label="是否经过安置" prop="resettle">
  77. <uv-radio-group v-model="form.resettle" placement="row">
  78. <uv-radio name="1" label="是"></uv-radio>
  79. <uv-radio name="0" customStyle="margin-left:30rpx;" label="否"></uv-radio>
  80. </uv-radio-group>
  81. </uv-form-item>
  82. <uv-form-item label="院子总面积" prop="yardProportion">
  83. <uv-input v-model="form.yardProportion" type="text" placeholder="请输入院子总面积" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  84. </uv-form-item>
  85. <uv-form-item label="坟包及电塔工厂噪音" prop="noise">
  86. <uv-input v-model="form.noise" type="text" placeholder="请输入坟包及电塔工厂噪音" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  87. </uv-form-item>
  88. <uv-form-item label="菜地" prop="homeCai">
  89. <uv-input v-model="form.homeCai" 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 label="水电气网" prop="net">
  92. <uv-input v-model="form.net" type="text" placeholder="请输入水电气网" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  93. </uv-form-item>
  94. <uv-form-item label="距离成都西三环" prop="homeShjl">
  95. <uv-input v-model="form.homeShjl" type="text" placeholder="请输入距离成都西三环" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  96. </uv-form-item>
  97. <uv-form-item label="停车" prop="park">
  98. <uv-input v-model="form.park" type="text" placeholder="请输入停车" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  99. </uv-form-item>
  100. <uv-form-item label="付款方式及押金" prop="deposit">
  101. <uv-input v-model="form.deposit" type="text" placeholder="请输入押金" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  102. </uv-form-item>
  103. <uv-form-item label="天府市民云房屋信息档案查询" prop="archival">
  104. <uv-input v-model="form.archival" type="text" placeholder="请输入天府市民云房屋信息档案查询" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  105. </uv-form-item>
  106. <uv-form-item label="租期" prop="tenancy">
  107. <uv-input v-model="form.tenancy" type="text" placeholder="请输入租期" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  108. </uv-form-item>
  109. <uv-form-item label="邻居对房东的评价" prop="evaluate">
  110. <uv-input v-model="form.evaluate" type="text" placeholder="请输入邻居对房东的评价" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  111. </uv-form-item>
  112. <uv-form-item label="非正常死亡" prop="death">
  113. <uv-input v-model="form.death" type="text" placeholder="请输入非正常死亡" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  114. </uv-form-item>
  115. <uv-form-item label="钥匙" prop="key">
  116. <uv-radio-group v-model="form.key" placement="row">
  117. <uv-radio name="1" label="有"></uv-radio>
  118. <uv-radio name="0" customStyle="margin-left:30rpx;" label="无"></uv-radio>
  119. </uv-radio-group>
  120. <!-- <uv-input v-model="form.key" type="text" placeholder="请输入钥匙" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input> -->
  121. </uv-form-item>
  122. <uv-form-item label="佣金" prop="commission">
  123. <uv-input v-model="form.commission" type="text" placeholder="请输入佣金" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  124. </uv-form-item>
  125. <uv-form-item label="年限" prop="timeGo">
  126. <uv-input v-model="form.timeGo" type="text" placeholder="请输入年限" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  127. </uv-form-item>
  128. <uv-form-item label="浏览量" prop="num">
  129. <uv-input v-model="form.num" type="text" placeholder="请输入浏览量" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  130. </uv-form-item>
  131. <uv-form-item label="单位" prop="unit">
  132. <uv-input v-model="form.unit" type="text" placeholder="请输入单位" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  133. </uv-form-item>
  134. <uv-form-item label="报建手续" prop="procedures">
  135. <uv-input v-model="form.procedures" type="text" placeholder="请输入报建手续" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  136. </uv-form-item>
  137. <uv-form-item label="房屋照片" labelWidth="250" prop="isOwnershipList" labelPosition="top">
  138. <uv-upload customStyle="margin-top:20rpx;" :fileList="form.ownershipList" @afterRead="afterOwnershipRead" @delete="deleteOwnershipPic" name="1"
  139. multiple :maxCount="10"></uv-upload>
  140. </uv-form-item>
  141. <uv-form-item label="产权证照片" labelWidth="250" prop="isHouseList" labelPosition="top">
  142. <uv-upload customStyle="margin-top:20rpx;" :fileList="form.houseList" @afterRead="afterHouseRead" @delete="deleteHousePic" name="1"
  143. multiple :maxCount="10"></uv-upload>
  144. </uv-form-item>
  145. <uv-form-item label="视频" labelWidth="250" prop="isMp4List" labelPosition="top">
  146. <uv-upload customStyle="margin-top:20rpx;" accept="media" :fileList="form.mp4List" @afterRead="aftermp4Read" @delete="deletemp4Pic" name="1"
  147. multiple :maxCount="1"></uv-upload>
  148. </uv-form-item>
  149. <uv-form-item label="备注" prop="remark" labelPosition="top">
  150. <uv-input v-model="form.remark" type="text" placeholder="请输入备注" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
  151. </uv-form-item>
  152. <uv-form-item>
  153. <uv-button type="primary" text="确认发布" customStyle="margin-top: 30px;background-color: #1EC77A;border-radius: 30px;" @click="submit"></uv-button>
  154. </uv-form-item>
  155. </uv-form>
  156. <!-- 地址 -->
  157. <citySelect ref="citySelectRef" :zIndex="0" @city-change="handleCityChange"></citySelect>
  158. <!-- 选择分类 -->
  159. <uv-picker ref="picker" :columns="columns" @confirm="confirm"></uv-picker>
  160. <uv-picker ref="pickerCommon" :columns="commonColumns" @confirm="commonConfirm"></uv-picker>
  161. </view>
  162. </template>
  163. <script>
  164. import { saveOrUpdateHouse,houseDetail,houseType,commonIndexIndexIcon } from "@/common/api.js"
  165. import citySelect from "@/components/cityselect/index.vue"
  166. import QQMapWX from "@/util/qqmap-wx-jssdk.min.js"
  167. export default{
  168. components:{
  169. citySelect
  170. },
  171. data(){
  172. return{
  173. id:"",
  174. houseTypeList:[],
  175. columns:[],
  176. commonColumns:[],
  177. form:{
  178. // title:"这是标题",//标题
  179. // price:"32.34",//价格
  180. // house:"这是户型",//户型
  181. // proportion:"89",//面积
  182. // address:"湖南长沙岳麓区",//所属位置
  183. // number:"2006",//编号
  184. // perimeter:"商场,地铁",//房屋周边
  185. // iconTitle:"商场,地铁,学校",//标签
  186. // housesNumber:1,//房间数量
  187. // revamp:0,//房屋主体是否改造
  188. // resettle:0,//是否经过安置
  189. // yardProportion:"无",//院子总面积
  190. // noise:"大",//噪音
  191. // net:"有",//水电气网
  192. // park:"有一个停车位",//停车
  193. // deposit:"1200",//押金
  194. // archival:"档案查询",//档案查询
  195. // tenancy:"租期",//租期
  196. // evaluate:"评价",//评价
  197. // death:"非正常死亡",//非正常死亡
  198. // key:"1",//钥匙
  199. // commission:"230",//佣金
  200. // timeGo:"",//年限
  201. // procedures:"20",//手续
  202. // isOwnershipList:"1",
  203. // ownershipList:[
  204. // {
  205. // url:"https://tennis-oss.xzaiyp.top/2024-12-04/61d46ae3-bf72-430f-8046-698b92b18f81.jpg"
  206. // },
  207. // {
  208. // url:"https://tennis-oss.xzaiyp.top/2024-12-04/3987c047-1c50-43e4-940d-9ce96cd06225.jpg"
  209. // }
  210. // ],
  211. // isHouseList:"1",
  212. // houseList:[
  213. // {
  214. // url:"https://tennis-oss.xzaiyp.top/2024-12-04/61d46ae3-bf72-430f-8046-698b92b18f81.jpg"
  215. // },
  216. // {
  217. // url:"https://tennis-oss.xzaiyp.top/2024-12-04/3987c047-1c50-43e4-940d-9ce96cd06225.jpg"
  218. // }
  219. // ],
  220. // isMp4List:"1",
  221. // mp4List:[],
  222. // remark:""
  223. title:"",//标题
  224. classId:"",//分类
  225. className:"",//分类名称
  226. commonId:"",//
  227. commonName:"",//
  228. price:"",//价格
  229. house:"",//户型
  230. proportion:"",//面积
  231. homeJg:"",//房屋结构
  232. address:"",//所属位置
  233. number:"",//编号
  234. perimeter:"",//房屋周边
  235. homeCai:"",//菜地
  236. homeHb:"",//房屋朝向及海拔
  237. homeJl:"",//距离场镇距离
  238. iconTitle:"",//标签
  239. housesNumber:1,//房间数量
  240. revamp:'0',//房屋主体是否改造
  241. resettle:'0',//是否经过安置
  242. yardProportion:"",//院子总面积
  243. noise:"",//噪音
  244. net:"",//水电气网
  245. homeJt:"",//交通
  246. park:"",//停车
  247. deposit:"",//押金
  248. archival:"",//档案查询
  249. tenancy:"",//租期
  250. evaluate:"",//评价
  251. unit:"",//单位
  252. death:"",//非正常死亡
  253. key:"1",//钥匙
  254. commission:"",//佣金
  255. timeGo:"",//年限
  256. procedures:"",//手续
  257. isOwnershipList:"",
  258. ownershipList:[],
  259. isHouseList:"",
  260. houseList:[],
  261. isMp4List:"",
  262. mp4List:[],
  263. remark:"",
  264. num:"",
  265. longitude:"",//经度
  266. latitude:"",//纬度
  267. },
  268. rules:{
  269. title:[
  270. {
  271. type: 'string',
  272. required: true,
  273. message: '请输入标题',
  274. trigger: ['blur', 'change']
  275. }
  276. ],
  277. classId:[
  278. {
  279. type: 'string',
  280. required: true,
  281. message: '请选择分类',
  282. trigger: ['blur', 'change']
  283. }
  284. ],
  285. commonId:[
  286. {
  287. type: 'string',
  288. required: true,
  289. message: '请选择所属分类',
  290. trigger: ['blur', 'change']
  291. }
  292. ],
  293. homeAge:[
  294. {
  295. type: 'string',
  296. required: true,
  297. message: '请输入户主年龄',
  298. trigger: ['blur', 'change']
  299. }
  300. ],
  301. price:[
  302. {
  303. type: 'string',
  304. required: true,
  305. message: '请输入价格',
  306. trigger: ['blur', 'change']
  307. }
  308. ],
  309. house:[
  310. {
  311. type: 'string',
  312. required: true,
  313. message: '请输入户型',
  314. trigger: ['blur', 'change']
  315. }
  316. ],
  317. unit:[
  318. {
  319. type: 'string',
  320. required: true,
  321. message: '请输入单位',
  322. trigger: ['blur', 'change']
  323. }
  324. ],
  325. homeCai:[
  326. {
  327. type: 'string',
  328. required: true,
  329. message: '请输入菜地',
  330. trigger: ['blur', 'change']
  331. }
  332. ],
  333. proportion:[
  334. {
  335. type: 'string',
  336. required: true,
  337. message: '请输入面积',
  338. trigger: ['blur', 'change']
  339. }
  340. ],
  341. homeJg:[
  342. {
  343. type: 'string',
  344. required: true,
  345. message: '请输入房屋结构',
  346. trigger: ['blur', 'change']
  347. }
  348. ],
  349. number:[
  350. {
  351. type: 'string',
  352. required: true,
  353. message: '请输入编号',
  354. trigger: ['blur', 'change']
  355. }
  356. ],
  357. perimeter:[
  358. {
  359. type: 'string',
  360. required: true,
  361. message: '请输入房屋周边',
  362. trigger: ['blur', 'change']
  363. }
  364. ],
  365. homeJl:[
  366. {
  367. type: 'string',
  368. required: true,
  369. message: '请输入距离场镇距离',
  370. trigger: ['blur', 'change']
  371. }
  372. ],
  373. iconTitle:[
  374. {
  375. type: 'string',
  376. required: true,
  377. message: '请输入标签用,隔开',
  378. trigger: ['blur', 'change']
  379. }
  380. ],
  381. yardProportion:[
  382. {
  383. type: 'string',
  384. required: true,
  385. message: '请输入院子总面积',
  386. trigger: ['blur', 'change']
  387. }
  388. ],
  389. noise:[
  390. {
  391. type: 'string',
  392. required: true,
  393. message: '请输入坟包及电塔工厂噪音',
  394. trigger: ['blur', 'change']
  395. }
  396. ],
  397. net:[
  398. {
  399. type: 'string',
  400. required: true,
  401. message: '请输入水电气网',
  402. trigger: ['blur', 'change']
  403. }
  404. ],
  405. homeHb:[
  406. {
  407. type: 'string',
  408. required: true,
  409. message: '请输入房屋朝向及海拔',
  410. trigger: ['blur', 'change']
  411. }
  412. ],
  413. num:[
  414. {
  415. type: 'string',
  416. required: true,
  417. message: '请输入浏览量',
  418. trigger: ['blur', 'change']
  419. }
  420. ],
  421. homeJt:[
  422. {
  423. type: 'string',
  424. required: true,
  425. message: '请输入交通',
  426. trigger: ['blur', 'change']
  427. }
  428. ],
  429. homeJtzy:[
  430. {
  431. type: 'string',
  432. required: true,
  433. message: '请输入户主家庭职业',
  434. trigger: ['blur', 'change']
  435. }
  436. ],
  437. park:[
  438. {
  439. type: 'string',
  440. required: true,
  441. message: '请输入停车',
  442. trigger: ['blur', 'change']
  443. }
  444. ],
  445. deposit:[
  446. {
  447. type: 'string',
  448. required: true,
  449. message: '请输入押金',
  450. trigger: ['blur', 'change']
  451. }
  452. ],
  453. homeShjl:[
  454. {
  455. type: 'string',
  456. required: true,
  457. message: '请输入距离成都西三环',
  458. trigger: ['blur', 'change']
  459. }
  460. ],
  461. archival:[
  462. {
  463. type: 'string',
  464. required: true,
  465. message: '请输入天府市民云房屋信息档案查询',
  466. trigger: ['blur', 'change']
  467. }
  468. ],
  469. tenancy:[
  470. {
  471. type: 'string',
  472. required: true,
  473. message: '请输入租期',
  474. trigger: ['blur', 'change']
  475. }
  476. ],
  477. evaluate:[
  478. {
  479. type: 'string',
  480. required: true,
  481. message: '请输入邻居对房东的评价',
  482. trigger: ['blur', 'change']
  483. }
  484. ],
  485. death:[
  486. {
  487. type: 'string',
  488. required: true,
  489. message: '请输入非正常死亡',
  490. trigger: ['blur', 'change']
  491. }
  492. ],
  493. num:[
  494. {
  495. type: 'string',
  496. required: true,
  497. message: '请输入浏览量',
  498. trigger: ['blur', 'change']
  499. }
  500. ],
  501. key:[
  502. {
  503. type: 'string',
  504. required: true,
  505. message: '请输入钥匙',
  506. trigger: ['blur', 'change']
  507. }
  508. ],
  509. commission:[
  510. {
  511. type: 'string',
  512. required: true,
  513. message: '请输入佣金',
  514. trigger: ['blur', 'change']
  515. }
  516. ],
  517. timeGo:[
  518. {
  519. type: 'string',
  520. required: true,
  521. message: '请输入年限',
  522. trigger: ['blur', 'change']
  523. }
  524. ],
  525. procedures:[
  526. {
  527. type: 'string',
  528. required: true,
  529. message: '请输入报建手续',
  530. trigger: ['blur', 'change']
  531. }
  532. ],
  533. }
  534. }
  535. },
  536. watch: {
  537. 'form.ownershipList'(newValue, oldValue) {
  538. if (newValue.length > 0) {
  539. this.form.isOwnershipList = '有'
  540. } else {
  541. this.form.isOwnershipList = ''
  542. }
  543. },
  544. 'form.houseList'(newValue, oldValue) {
  545. if (newValue.length > 0) {
  546. this.form.isHouseList = '有'
  547. } else {
  548. this.form.isHouseList = ''
  549. }
  550. },
  551. 'form.mp4List'(newValue, oldValue) {
  552. if (newValue.length > 0) {
  553. this.form.isMp4List = '有'
  554. } else {
  555. this.form.isMp4List = ''
  556. }
  557. }
  558. },
  559. onReady() {
  560. this.$refs.form.setRules(this.rules)
  561. },
  562. onLoad(options) {
  563. let that = this
  564. that.id = options.id
  565. that.onHouseType()
  566. that.onCommonIndexIndexIcon()
  567. if(options.id){
  568. houseDetail({houseId:options.id}).then(response=>{
  569. let form = response.result
  570. console.info('responseform',form)
  571. that.form={
  572. userId: uni.getStorageSync('userInfo').id,
  573. id:form.id,
  574. classId:form.classId,//分类标识
  575. className:"",//分类标识名称
  576. commonClass:form.commonId,//
  577. commonName:"",//
  578. // commonClass:"",//所属分类
  579. address:form.address,//地址
  580. homeAge:form.homeAge,//户主年龄
  581. resettle:form.homeAz,//是否经过安置
  582. perimeter:form.homeBian,//房屋周边
  583. procedures:form.homeBjsx,//报建手续
  584. homeCai:form.homeCai,//菜地
  585. park:form.homeCat,//停车
  586. revamp:form.homeGz,//房屋主体是否改造
  587. homeHb:form.homeHb,//房屋朝向及海拔
  588. remark:form.homeBz,//备注
  589. homeJg:form.homeJg,//房屋结构
  590. homeJl:form.homeJl,//距离场镇距离
  591. homeJt:form.homeJt,//交通
  592. homeJtzy:form.homeJtzy,//户主家庭职业
  593. homeMi:form.homeMi,//面积
  594. proportion:form.homeMj,//房屋面积
  595. commission:String(form.homeMoney),//佣金
  596. number:String(form.homeNo),//房屋编号
  597. housesNumber:String(form.homeNum),//房间数量
  598. deposit:String(form.homePay),//付款方式及押金
  599. evaluate:form.homePj,//邻居对房东评价
  600. net:form.homeSd,//水电气网
  601. homeShjl:form.homeShjl,//距离成都西三环
  602. death:form.homeSw,//非正常死亡
  603. archival:form.homeTf,//府市民云房屋信息档案查询
  604. tenancy:form.homeTime,//租期
  605. house:form.homeType,//户型
  606. key:String(form.homeYs),//钥匙
  607. yardProportion:form.homeYzmj,//院子总面积
  608. noise:form.homeZy,//坟包及电塔 工厂噪音
  609. // iconName:"",//热点名称
  610. iconTitle:form.iconTitle,//标签
  611. num:form.num,//浏览量
  612. price:String(form.price) ,//价格
  613. timeGo:String(form.timeGo),//年限
  614. title:form.title,//标题
  615. unit:form.unit,//单位
  616. latitude:form.latitude,
  617. longitude:form.longitude,
  618. ownershipList:that.stringToKeyValueArray(form.image),//图片
  619. // iconImage:"",//左上角图标
  620. houseList:that.stringToKeyValueArray(form.homeImage),//产权证照片
  621. homeMp4:"",//视频
  622. }
  623. that.onHouseType()
  624. that.onCommonIndexIndexIcon()
  625. }).catch(error=>{
  626. })
  627. }
  628. },
  629. mounted() {
  630. },
  631. methods:{
  632. onHouseType(){
  633. let that = this
  634. houseType({}).then(response=>{
  635. let arr=[]
  636. that.houseTypeList = response.result
  637. response.result.forEach(items=>{
  638. arr.push(items.title)
  639. if(items.id==that.form.commonClass){
  640. that.form.commonName = items.title
  641. }
  642. })
  643. that.columns[0]=arr
  644. }).catch(error=>{
  645. })
  646. },
  647. onCommonIndexIndexIcon(){
  648. let that = this
  649. commonIndexIndexIcon({}).then(response=>{
  650. let arr=[]
  651. that.commonIconList = response.result
  652. response.result.forEach(items=>{
  653. arr.push(items.title)
  654. if(items.id==that.form.classId){
  655. that.form.className = items.title
  656. }
  657. })
  658. that.commonColumns[0]=arr
  659. }).catch(error=>{
  660. })
  661. },
  662. stringToKeyValueArray(str, delimiter1 = ',') {
  663. console.info(str)
  664. if(str){
  665. let arro = str.split(delimiter1);
  666. console.info('arro',arro)
  667. let arr = [];
  668. arro.forEach(items=>{
  669. let obj = {};
  670. obj["url"] = items
  671. arr.push(obj)
  672. })
  673. console.info(arr)
  674. return arr
  675. }else{
  676. return []
  677. }
  678. },
  679. deleteHousePic(event) {
  680. this.form.houseList.splice(event.index, 1)
  681. },
  682. async afterHouseRead(e) {
  683. let self = this
  684. e.file.forEach(file => {
  685. self.$Oss.ossUpload(file.url).then(url => {
  686. self.form.houseList.push({
  687. url
  688. })
  689. })
  690. })
  691. },
  692. deleteOwnershipPic(event) {
  693. this.form.ownershipList.splice(event.index, 1)
  694. },
  695. async afterOwnershipRead(e) {
  696. let self = this
  697. e.file.forEach(file => {
  698. self.$Oss.ossUpload(file.url).then(url => {
  699. self.form.ownershipList.push({
  700. url
  701. })
  702. })
  703. })
  704. },
  705. deletemp4Pic(event) {
  706. this.form.mp4List.splice(event.index, 1)
  707. },
  708. async aftermp4Read(e) {
  709. let self = this
  710. e.file.forEach(file => {
  711. self.$Oss.ossUpload(file.url).then(url => {
  712. self.form.mp4List.push({
  713. url
  714. })
  715. })
  716. })
  717. },
  718. handleClass(){
  719. this.$refs.picker.open();
  720. },
  721. confirm(e) {
  722. let that = this
  723. let {indexs,value,values} = e
  724. that.form.classId = that.houseTypeList[indexs[0]].id;
  725. that.form.className = that.houseTypeList[indexs[0]].title;
  726. },
  727. handleCommon(){
  728. this.$refs.pickerCommon.open();
  729. },
  730. commonConfirm(e){
  731. let that = this
  732. let {indexs,value,values} = e
  733. that.form.commonId = that.commonIconList[indexs[0]].id;
  734. that.form.commonName = that.commonIconList[indexs[0]].title;
  735. },
  736. handleAreaChange(){
  737. const that = this;
  738. wx.chooseLocation({
  739. // type: 'wgs84',
  740. success: function (res) {
  741. console.log('当前位置的经度:', res);
  742. console.log('当前位置的纬度:' + res.latitude);
  743. that.form.longitude = res.longitude
  744. that.form.latitude = res.latitude
  745. that.form.address = res.address
  746. // const qqmapsdk = new QQMapWX({
  747. // key: 'TT7BZ-Z3LW4-KOAUB-KWHOA-SBJJ6-Y5B6R' // 必填
  748. // });
  749. // uni.showLoading({
  750. // title:"获取中...."
  751. // })
  752. // qqmapsdk.reverseGeocoder({
  753. // location: {
  754. // latitude: res.latitude,
  755. // longitude: res.longitude
  756. // },
  757. // success: function(response) {
  758. // console.log('逆地理编码结果:', response);
  759. // uni.hideLoading()
  760. // that.form.longitude = response.result.location.lng
  761. // that.form.latitude = response.result.location.lat
  762. // that.form.address = response.result.address
  763. // },
  764. // fail: function(error) {
  765. // uni.hideLoading()
  766. // console.error('逆地理编码失败:', error);
  767. // }
  768. // });
  769. }
  770. })
  771. // this.$refs.citySelectRef.open()
  772. },
  773. handleCityChange(e) {
  774. this.form.address = e.province.label + '-' + e.city.label + '-' + e.area.label;
  775. },
  776. submit() {
  777. // price:"",//价格
  778. // house:"",//户型
  779. // proportion:"",//面积
  780. // address:"",//所属位置
  781. // number:"",//编号
  782. // perimeter:"",//房屋周边
  783. // housesNumber:1,//房间数量
  784. // revamp:0,//房屋主体是否改造
  785. // resettle:0,//是否经过安置
  786. // yardProportion:"",//院子总面积
  787. // noise:"",//噪音
  788. // net:"",//水电气网
  789. // park:"",//停车
  790. // deposit:"",//押金
  791. // archival:"",//档案查询
  792. // tenancy:"",//租期
  793. // evaluate:"",//评价
  794. // death:"",//非正常死亡
  795. // key:"",//钥匙
  796. // commission:"",//佣金
  797. // procedures:"",//手续
  798. // isOwnershipList:"",
  799. // ownershipList:[],
  800. // isHouseList:"",
  801. // houseList:[],
  802. // remark:""
  803. let that = this
  804. that.$refs.form.validate().then(res => {
  805. let params={
  806. userId:"",
  807. id:that.form.id,
  808. classId:that.form.classId,//分类标识
  809. commonClass:that.form.commonId,//所属分类
  810. address:that.form.address,//地址
  811. homeAge:that.form.homeAge,//户主年龄
  812. homeAz:that.form.resettle,//是否经过安置
  813. homeBian:that.form.perimeter,//房屋周边
  814. homeBjsx:that.form.procedures,//报建手续
  815. homeCai:that.form.homeCai,//菜地
  816. homeCat:that.form.park,//停车
  817. homeGz:that.form.revamp,//房屋主体是否改造
  818. homeHb:that.form.homeHb,//房屋朝向及海拔
  819. homeBz:that.form.remark,//备注
  820. homeJg:that.form.homeJg,//房屋结构
  821. homeJl:that.form.homeJl,//距离场镇距离
  822. homeJt:that.form.homeJt,//交通
  823. homeJtzy:that.form.homeJtzy,//户主家庭职业
  824. homeMi:that.form.homeMi,//面积
  825. homeMj:that.form.proportion,//房屋面积
  826. homeMoney:that.form.commission,//佣金
  827. homeNo:that.form.number,//房屋编号
  828. homeNum:that.form.housesNumber,//房间数量
  829. homePay:that.form.deposit,//付款方式及押金
  830. homePj:that.form.evaluate,//邻居对房东评价
  831. homeSd:that.form.net,//水电气网
  832. homeShjl:that.form.homeShjl,//距离成都西三环
  833. homeSw:that.form.death,//非正常死亡
  834. homeTf:that.form.archival,//府市民云房屋信息档案查询
  835. homeTime:that.form.tenancy,//租期
  836. homeType:that.form.house,//户型
  837. homeYs:that.form.key,//钥匙
  838. homeYzmj:that.form.yardProportion,//院子总面积
  839. homeZy:that.form.noise,//坟包及电塔 工厂噪音
  840. iconName:"",//热点名称
  841. iconTitle:that.form.iconTitle,//标签
  842. num:that.form.num,//浏览量
  843. price:that.form.price,//价格
  844. timeGo:that.form.timeGo,//年限
  845. title:that.form.title,//标题
  846. unit:that.form.unit,//单位
  847. image:that.form.ownershipList.map(item => item.url).join(','),//图片
  848. iconImage:"",//左上角图标
  849. homeImage:that.form.houseList.map(item => item.url).join(','),//产权证照片
  850. homeMp4:that.form.mp4List.map(item => item.url).join(','),//视频
  851. latitude:that.form.latitude,
  852. longitude:that.form.longitude
  853. }
  854. console.log(that.form);
  855. console.log(params);
  856. if(this.$utils.verificationAll(params, {
  857. image : '请上传房屋照片',
  858. homeImage : '产权证照片',
  859. address : '请选择房屋位置',
  860. })){
  861. return
  862. }
  863. // console.info(JSON.stringify(params))
  864. // params = {"userId":"","classId":"1860389382874828802","commonClass":"1860387853019222017","address":"湖南省岳阳市湘阴县芙蓉北路","homeAge":"66666","homeAz":"1","homeBian":"11","homeBjsx":"11","homeCai":"11","homeCat":"11","homeGz":"1","homeHb":"11","homeBz":"aaaa","homeJg":"22","homeJl":"11","homeJt":"22","homeJtzy":"11","homeMi":"22","homeMj":"22","homeMoney":"11","homeNo":"11","homeNum":2,"homePay":"11","homePj":"11","homeSd":"11","homeShjl":"11","homeSw":"11","homeTf":"11","homeTime":"11","homeType":"666666","homeYs":"1","homeYzmj":"11","homeZy":"11","iconName":"","iconTitle":"11","num":"11","price":"6666","timeGo":"11","title":"66666","unit":"11","image":"https://tennis-oss.xzaiyp.top/2024-12-07/950752cc-2a22-4296-a8fa-f3c5718a60a1.png,https://tennis-oss.xzaiyp.top/2024-12-07/803308f0-06e1-482a-836c-2b500c281fdc.png","iconImage":"","homeImage":"https://tennis-oss.xzaiyp.top/2024-12-07/8e7e321d-8bf5-43d9-a9ff-de849d4d60fd.png,https://tennis-oss.xzaiyp.top/2024-12-07/024dbfc1-29ba-4dbe-8554-1d19feff220b.png","homeMp4":"https://tennis-oss.xzaiyp.top/2024-12-07/b9ebc286-b293-4ec0-8e1c-205cd1ea94b5.mp4","latitude":28.689608,"longitude":112.911421}
  865. saveOrUpdateHouse(params).then(response=>{
  866. console.info('response',response)
  867. uni.showToast({
  868. title: response.message,
  869. mask: false,
  870. icon: 'none',
  871. duration: 2000
  872. })
  873. setTimeout(()=>{
  874. uni.redirectTo({
  875. url:"/pages_subpack/successful-apply/index"
  876. })
  877. },2000)
  878. }).catch(error=>{
  879. })
  880. }).catch(errors => {
  881. console.info('errors',errors)
  882. })
  883. }
  884. }
  885. }
  886. </script>
  887. <style>
  888. page{
  889. background-color: #f5f5f5;
  890. }
  891. </style>