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

930 lines
32 KiB

8 months ago
8 months ago
7 months ago
7 months ago
8 months ago
7 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
8 months ago
7 months ago
8 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
7 months ago
7 months ago
8 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
8 months ago
7 months ago
8 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
8 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
7 months ago
8 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
7 months ago
7 months ago
8 months ago
8 months ago
7 months ago
8 months ago
8 months ago
7 months ago
8 months ago
7 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
8 months ago
8 months ago
8 months ago
4 months ago
8 months ago
7 months ago
8 months ago
7 months ago
7 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
8 months ago
7 months ago
8 months ago
8 months ago
8 months ago
7 months ago
8 months ago
8 months ago
8 months ago
4 months ago
7 months ago
8 months ago
4 months ago
4 months ago
4 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 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="number" 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="number" 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="digit" 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="digit" 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="number" 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="digit" 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="digit" 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="number" 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="number" 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="number" 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. houseType:"", // 房源类型
  175. houseTitle:"", // 房源类型标题
  176. houseTypeList:[],
  177. columns:[],
  178. commonColumns:[],
  179. form:{
  180. // title:"这是标题",//标题
  181. // price:"32.34",//价格
  182. // house:"这是户型",//户型
  183. // proportion:"89",//面积
  184. // address:"湖南长沙岳麓区",//所属位置
  185. // number:"2006",//编号
  186. // perimeter:"商场,地铁",//房屋周边
  187. // iconTitle:"商场,地铁,学校",//标签
  188. // housesNumber:1,//房间数量
  189. // revamp:0,//房屋主体是否改造
  190. // resettle:0,//是否经过安置
  191. // yardProportion:"无",//院子总面积
  192. // noise:"大",//噪音
  193. // net:"有",//水电气网
  194. // park:"有一个停车位",//停车
  195. // deposit:"1200",//押金
  196. // archival:"档案查询",//档案查询
  197. // tenancy:"租期",//租期
  198. // evaluate:"评价",//评价
  199. // death:"非正常死亡",//非正常死亡
  200. // key:"1",//钥匙
  201. // commission:"230",//佣金
  202. // timeGo:"",//年限
  203. // procedures:"20",//手续
  204. // isOwnershipList:"1",
  205. // ownershipList:[
  206. // {
  207. // url:"https://tennis-oss.xzaiyp.top/2024-12-04/61d46ae3-bf72-430f-8046-698b92b18f81.jpg"
  208. // },
  209. // {
  210. // url:"https://tennis-oss.xzaiyp.top/2024-12-04/3987c047-1c50-43e4-940d-9ce96cd06225.jpg"
  211. // }
  212. // ],
  213. // isHouseList:"1",
  214. // houseList:[
  215. // {
  216. // url:"https://tennis-oss.xzaiyp.top/2024-12-04/61d46ae3-bf72-430f-8046-698b92b18f81.jpg"
  217. // },
  218. // {
  219. // url:"https://tennis-oss.xzaiyp.top/2024-12-04/3987c047-1c50-43e4-940d-9ce96cd06225.jpg"
  220. // }
  221. // ],
  222. // isMp4List:"1",
  223. // mp4List:[],
  224. // remark:""
  225. title:"",//标题
  226. classId:"",//分类
  227. className:"",//分类名称
  228. commonId:"",//
  229. commonName:"",//
  230. price:"",//价格
  231. house:"",//户型
  232. proportion:"",//面积
  233. homeJg:"",//房屋结构
  234. address:"",//所属位置
  235. number:"",//编号
  236. perimeter:"",//房屋周边
  237. homeCai:"",//菜地
  238. homeHb:"",//房屋朝向及海拔
  239. homeJl:"",//距离场镇距离
  240. iconTitle:"",//标签
  241. housesNumber:1,//房间数量
  242. revamp:'0',//房屋主体是否改造
  243. resettle:'0',//是否经过安置
  244. yardProportion:"",//院子总面积
  245. noise:"",//噪音
  246. net:"",//水电气网
  247. homeJt:"",//交通
  248. park:"",//停车
  249. deposit:"",//押金
  250. archival:"",//档案查询
  251. tenancy:"",//租期
  252. evaluate:"",//评价
  253. unit:"",//单位
  254. death:"",//非正常死亡
  255. key:"1",//钥匙
  256. commission:"",//佣金
  257. timeGo:"",//年限
  258. procedures:"",//手续
  259. isOwnershipList:"",
  260. ownershipList:[],
  261. isHouseList:"",
  262. houseList:[],
  263. isMp4List:"",
  264. mp4List:[],
  265. remark:"",
  266. num:"",
  267. longitude:"",//经度
  268. latitude:"",//纬度
  269. },
  270. rules:{
  271. title:[
  272. {
  273. type: 'string',
  274. required: true,
  275. message: '请输入标题',
  276. trigger: ['blur', 'change']
  277. }
  278. ],
  279. classId:[
  280. {
  281. type: 'string',
  282. required: true,
  283. message: '请选择分类',
  284. trigger: ['blur', 'change']
  285. }
  286. ],
  287. commonId:[
  288. {
  289. type: 'string',
  290. required: true,
  291. message: '请选择所属分类',
  292. trigger: ['blur', 'change']
  293. }
  294. ],
  295. homeAge:[
  296. {
  297. type: 'string',
  298. required: true,
  299. message: '请输入户主年龄',
  300. trigger: ['blur', 'change']
  301. }
  302. ],
  303. price:[
  304. {
  305. type: 'string',
  306. required: true,
  307. message: '请输入价格',
  308. trigger: ['blur', 'change']
  309. }
  310. ],
  311. house:[
  312. {
  313. type: 'string',
  314. required: true,
  315. message: '请输入户型',
  316. trigger: ['blur', 'change']
  317. }
  318. ],
  319. unit:[
  320. {
  321. type: 'string',
  322. required: true,
  323. message: '请输入单位',
  324. trigger: ['blur', 'change']
  325. }
  326. ],
  327. homeCai:[
  328. {
  329. type: 'string',
  330. required: true,
  331. message: '请输入菜地',
  332. trigger: ['blur', 'change']
  333. }
  334. ],
  335. proportion:[
  336. {
  337. type: 'string',
  338. required: true,
  339. message: '请输入面积',
  340. trigger: ['blur', 'change']
  341. }
  342. ],
  343. homeJg:[
  344. {
  345. type: 'string',
  346. required: true,
  347. message: '请输入房屋结构',
  348. trigger: ['blur', 'change']
  349. }
  350. ],
  351. number:[
  352. {
  353. type: 'string',
  354. required: true,
  355. message: '请输入编号',
  356. trigger: ['blur', 'change']
  357. }
  358. ],
  359. perimeter:[
  360. {
  361. type: 'string',
  362. required: true,
  363. message: '请输入房屋周边',
  364. trigger: ['blur', 'change']
  365. }
  366. ],
  367. homeJl:[
  368. {
  369. type: 'string',
  370. required: true,
  371. message: '请输入距离场镇距离',
  372. trigger: ['blur', 'change']
  373. }
  374. ],
  375. iconTitle:[
  376. {
  377. type: 'string',
  378. required: true,
  379. message: '请输入标签用,隔开',
  380. trigger: ['blur', 'change']
  381. }
  382. ],
  383. yardProportion:[
  384. {
  385. type: 'string',
  386. required: true,
  387. message: '请输入院子总面积',
  388. trigger: ['blur', 'change']
  389. }
  390. ],
  391. noise:[
  392. {
  393. type: 'string',
  394. required: true,
  395. message: '请输入坟包及电塔工厂噪音',
  396. trigger: ['blur', 'change']
  397. }
  398. ],
  399. net:[
  400. {
  401. type: 'string',
  402. required: true,
  403. message: '请输入水电气网',
  404. trigger: ['blur', 'change']
  405. }
  406. ],
  407. homeHb:[
  408. {
  409. type: 'string',
  410. required: true,
  411. message: '请输入房屋朝向及海拔',
  412. trigger: ['blur', 'change']
  413. }
  414. ],
  415. num:[
  416. {
  417. type: 'string',
  418. required: true,
  419. message: '请输入浏览量',
  420. trigger: ['blur', 'change']
  421. }
  422. ],
  423. homeJt:[
  424. {
  425. type: 'string',
  426. required: true,
  427. message: '请输入交通',
  428. trigger: ['blur', 'change']
  429. }
  430. ],
  431. homeJtzy:[
  432. {
  433. type: 'string',
  434. required: true,
  435. message: '请输入户主家庭职业',
  436. trigger: ['blur', 'change']
  437. }
  438. ],
  439. park:[
  440. {
  441. type: 'string',
  442. required: true,
  443. message: '请输入停车',
  444. trigger: ['blur', 'change']
  445. }
  446. ],
  447. deposit:[
  448. {
  449. type: 'string',
  450. required: true,
  451. message: '请输入押金',
  452. trigger: ['blur', 'change']
  453. }
  454. ],
  455. homeShjl:[
  456. {
  457. type: 'string',
  458. required: true,
  459. message: '请输入距离成都西三环',
  460. trigger: ['blur', 'change']
  461. }
  462. ],
  463. archival:[
  464. {
  465. type: 'string',
  466. required: true,
  467. message: '请输入天府市民云房屋信息档案查询',
  468. trigger: ['blur', 'change']
  469. }
  470. ],
  471. tenancy:[
  472. {
  473. type: 'string',
  474. required: true,
  475. message: '请输入租期',
  476. trigger: ['blur', 'change']
  477. }
  478. ],
  479. evaluate:[
  480. {
  481. type: 'string',
  482. required: true,
  483. message: '请输入邻居对房东的评价',
  484. trigger: ['blur', 'change']
  485. }
  486. ],
  487. death:[
  488. {
  489. type: 'string',
  490. required: true,
  491. message: '请输入非正常死亡',
  492. trigger: ['blur', 'change']
  493. }
  494. ],
  495. num:[
  496. {
  497. type: 'string',
  498. required: true,
  499. message: '请输入浏览量',
  500. trigger: ['blur', 'change']
  501. }
  502. ],
  503. key:[
  504. {
  505. type: 'string',
  506. required: true,
  507. message: '请输入钥匙',
  508. trigger: ['blur', 'change']
  509. }
  510. ],
  511. commission:[
  512. {
  513. type: 'string',
  514. required: true,
  515. message: '请输入佣金',
  516. trigger: ['blur', 'change']
  517. }
  518. ],
  519. timeGo:[
  520. {
  521. type: 'string',
  522. required: true,
  523. message: '请输入年限',
  524. trigger: ['blur', 'change']
  525. }
  526. ],
  527. procedures:[
  528. {
  529. type: 'string',
  530. required: true,
  531. message: '请输入报建手续',
  532. trigger: ['blur', 'change']
  533. }
  534. ],
  535. }
  536. }
  537. },
  538. watch: {
  539. 'form.ownershipList'(newValue, oldValue) {
  540. if (newValue.length > 0) {
  541. this.form.isOwnershipList = '有'
  542. } else {
  543. this.form.isOwnershipList = ''
  544. }
  545. },
  546. 'form.houseList'(newValue, oldValue) {
  547. if (newValue.length > 0) {
  548. this.form.isHouseList = '有'
  549. } else {
  550. this.form.isHouseList = ''
  551. }
  552. },
  553. 'form.mp4List'(newValue, oldValue) {
  554. if (newValue.length > 0) {
  555. this.form.isMp4List = '有'
  556. } else {
  557. this.form.isMp4List = ''
  558. }
  559. }
  560. },
  561. onReady() {
  562. this.$refs.form.setRules(this.rules)
  563. },
  564. onLoad(options) {
  565. let that = this
  566. that.id = options.id
  567. // 接收从选择页面传来的类型参数
  568. if(options.type && options.title) {
  569. that.houseType = options.type
  570. that.houseTitle = options.title
  571. // 设置页面标题
  572. uni.setNavigationBarTitle({
  573. title: options.title
  574. })
  575. }
  576. that.onHouseType()
  577. that.onCommonIndexIndexIcon()
  578. if(options.id){
  579. houseDetail({houseId:options.id}).then(response=>{
  580. let form = response.result
  581. console.info('responseform',form)
  582. that.form={
  583. userId: uni.getStorageSync('userInfo').id,
  584. id:form.id,
  585. classId:form.classId,//分类标识
  586. className:"",//分类标识名称
  587. commonClass:form.commonId,//
  588. commonName:"",//
  589. // commonClass:"",//所属分类
  590. address:form.address,//地址
  591. homeAge:form.homeAge,//户主年龄
  592. resettle:form.homeAz,//是否经过安置
  593. perimeter:form.homeBian,//房屋周边
  594. procedures:form.homeBjsx,//报建手续
  595. homeCai:form.homeCai,//菜地
  596. park:form.homeCat,//停车
  597. revamp:form.homeGz,//房屋主体是否改造
  598. homeHb:form.homeHb,//房屋朝向及海拔
  599. remark:form.homeBz,//备注
  600. homeJg:form.homeJg,//房屋结构
  601. homeJl:form.homeJl,//距离场镇距离
  602. homeJt:form.homeJt,//交通
  603. homeJtzy:form.homeJtzy,//户主家庭职业
  604. homeMi:form.homeMi,//面积
  605. proportion:form.homeMj,//房屋面积
  606. commission:String(form.homeMoney),//佣金
  607. number:String(form.homeNo),//房屋编号
  608. housesNumber:String(form.homeNum),//房间数量
  609. deposit:String(form.homePay),//付款方式及押金
  610. evaluate:form.homePj,//邻居对房东评价
  611. net:form.homeSd,//水电气网
  612. homeShjl:form.homeShjl,//距离成都西三环
  613. death:form.homeSw,//非正常死亡
  614. archival:form.homeTf,//府市民云房屋信息档案查询
  615. tenancy:form.homeTime,//租期
  616. house:form.homeType,//户型
  617. key:String(form.homeYs),//钥匙
  618. yardProportion:form.homeYzmj,//院子总面积
  619. noise:form.homeZy,//坟包及电塔 工厂噪音
  620. // iconName:"",//热点名称
  621. iconTitle:form.iconTitle,//标签
  622. num:form.num,//浏览量
  623. price:String(form.price) ,//价格
  624. timeGo:String(form.timeGo),//年限
  625. title:form.title,//标题
  626. unit:form.unit,//单位
  627. latitude:form.latitude,
  628. longitude:form.longitude,
  629. ownershipList:that.stringToKeyValueArray(form.image),//图片
  630. // iconImage:"",//左上角图标
  631. houseList:that.stringToKeyValueArray(form.homeImage),//产权证照片
  632. homeMp4:"",//视频
  633. }
  634. that.onHouseType()
  635. that.onCommonIndexIndexIcon()
  636. }).catch(error=>{
  637. })
  638. }
  639. },
  640. mounted() {
  641. },
  642. methods:{
  643. onHouseType(){
  644. let that = this
  645. houseType({}).then(response=>{
  646. let arr=[]
  647. that.houseTypeList = response.result
  648. response.result.forEach(items=>{
  649. arr.push(items.title)
  650. if(items.id==that.form.commonClass){
  651. that.form.commonName = items.title
  652. }
  653. })
  654. that.columns[0]=arr
  655. }).catch(error=>{
  656. })
  657. },
  658. onCommonIndexIndexIcon(){
  659. let that = this
  660. commonIndexIndexIcon({}).then(response=>{
  661. let arr=[]
  662. that.commonIconList = response.result
  663. response.result.forEach(items=>{
  664. arr.push(items.title)
  665. if(items.id==that.form.classId){
  666. that.form.className = items.title
  667. }
  668. })
  669. that.commonColumns[0]=arr
  670. }).catch(error=>{
  671. })
  672. },
  673. stringToKeyValueArray(str, delimiter1 = ',') {
  674. console.info(str)
  675. if(str){
  676. let arro = str.split(delimiter1);
  677. console.info('arro',arro)
  678. let arr = [];
  679. arro.forEach(items=>{
  680. let obj = {};
  681. obj["url"] = items
  682. arr.push(obj)
  683. })
  684. console.info(arr)
  685. return arr
  686. }else{
  687. return []
  688. }
  689. },
  690. deleteHousePic(event) {
  691. this.form.houseList.splice(event.index, 1)
  692. },
  693. async afterHouseRead(e) {
  694. let self = this
  695. e.file.forEach(file => {
  696. self.$Oss.ossUpload(file.url).then(url => {
  697. self.form.houseList.push({
  698. url
  699. })
  700. })
  701. })
  702. },
  703. deleteOwnershipPic(event) {
  704. this.form.ownershipList.splice(event.index, 1)
  705. },
  706. async afterOwnershipRead(e) {
  707. let self = this
  708. e.file.forEach(file => {
  709. self.$Oss.ossUpload(file.url).then(url => {
  710. self.form.ownershipList.push({
  711. url
  712. })
  713. })
  714. })
  715. },
  716. deletemp4Pic(event) {
  717. this.form.mp4List.splice(event.index, 1)
  718. },
  719. async aftermp4Read(e) {
  720. let self = this
  721. e.file.forEach(file => {
  722. self.$Oss.ossUpload(file.url).then(url => {
  723. self.form.mp4List.push({
  724. url
  725. })
  726. })
  727. })
  728. },
  729. handleClass(){
  730. this.$refs.picker.open();
  731. },
  732. confirm(e) {
  733. let that = this
  734. let {indexs,value,values} = e
  735. that.form.classId = that.houseTypeList[indexs[0]].id;
  736. that.form.className = that.houseTypeList[indexs[0]].title;
  737. },
  738. handleCommon(){
  739. this.$refs.pickerCommon.open();
  740. },
  741. commonConfirm(e){
  742. let that = this
  743. let {indexs,value,values} = e
  744. that.form.commonId = that.commonIconList[indexs[0]].id;
  745. that.form.commonName = that.commonIconList[indexs[0]].title;
  746. },
  747. handleAreaChange(){
  748. const that = this;
  749. wx.chooseLocation({
  750. // type: 'wgs84',
  751. success: function (res) {
  752. console.log('当前位置的经度:', res);
  753. console.log('当前位置的纬度:' + res.latitude);
  754. that.form.longitude = res.longitude
  755. that.form.latitude = res.latitude
  756. that.form.address = res.address
  757. // const qqmapsdk = new QQMapWX({
  758. // key: 'TT7BZ-Z3LW4-KOAUB-KWHOA-SBJJ6-Y5B6R' // 必填
  759. // });
  760. // uni.showLoading({
  761. // title:"获取中...."
  762. // })
  763. // qqmapsdk.reverseGeocoder({
  764. // location: {
  765. // latitude: res.latitude,
  766. // longitude: res.longitude
  767. // },
  768. // success: function(response) {
  769. // console.log('逆地理编码结果:', response);
  770. // uni.hideLoading()
  771. // that.form.longitude = response.result.location.lng
  772. // that.form.latitude = response.result.location.lat
  773. // that.form.address = response.result.address
  774. // },
  775. // fail: function(error) {
  776. // uni.hideLoading()
  777. // console.error('逆地理编码失败:', error);
  778. // }
  779. // });
  780. }
  781. })
  782. // this.$refs.citySelectRef.open()
  783. },
  784. handleCityChange(e) {
  785. this.form.address = e.province.label + '-' + e.city.label + '-' + e.area.label;
  786. },
  787. submit() {
  788. // price:"",//价格
  789. // house:"",//户型
  790. // proportion:"",//面积
  791. // address:"",//所属位置
  792. // number:"",//编号
  793. // perimeter:"",//房屋周边
  794. // housesNumber:1,//房间数量
  795. // revamp:0,//房屋主体是否改造
  796. // resettle:0,//是否经过安置
  797. // yardProportion:"",//院子总面积
  798. // noise:"",//噪音
  799. // net:"",//水电气网
  800. // park:"",//停车
  801. // deposit:"",//押金
  802. // archival:"",//档案查询
  803. // tenancy:"",//租期
  804. // evaluate:"",//评价
  805. // death:"",//非正常死亡
  806. // key:"",//钥匙
  807. // commission:"",//佣金
  808. // procedures:"",//手续
  809. // isOwnershipList:"",
  810. // ownershipList:[],
  811. // isHouseList:"",
  812. // houseList:[],
  813. // remark:""
  814. let that = this
  815. that.$refs.form.validate().then(res => {
  816. let params={
  817. userId:"",
  818. id:that.form.id,
  819. classId:that.form.classId,//分类标识
  820. commonClass:that.form.commonId,//所属分类
  821. address:that.form.address,//地址
  822. homeAge:that.form.homeAge,//户主年龄
  823. homeAz:that.form.resettle,//是否经过安置
  824. homeBian:that.form.perimeter,//房屋周边
  825. homeBjsx:that.form.procedures,//报建手续
  826. homeCai:that.form.homeCai,//菜地
  827. homeCat:that.form.park,//停车
  828. homeGz:that.form.revamp,//房屋主体是否改造
  829. homeHb:that.form.homeHb,//房屋朝向及海拔
  830. homeBz:that.form.remark,//备注
  831. homeJg:that.form.homeJg,//房屋结构
  832. homeJl:that.form.homeJl,//距离场镇距离
  833. homeJt:that.form.homeJt,//交通
  834. homeJtzy:that.form.homeJtzy,//户主家庭职业
  835. homeMi:that.form.homeMi,//面积
  836. homeMj:that.form.proportion,//房屋面积
  837. homeMoney:that.form.commission,//佣金
  838. homeNo:that.form.number,//房屋编号
  839. homeNum:that.form.housesNumber,//房间数量
  840. homePay:that.form.deposit,//付款方式及押金
  841. homePj:that.form.evaluate,//邻居对房东评价
  842. homeSd:that.form.net,//水电气网
  843. homeShjl:that.form.homeShjl,//距离成都西三环
  844. homeSw:that.form.death,//非正常死亡
  845. homeTf:that.form.archival,//府市民云房屋信息档案查询
  846. homeTime:that.form.tenancy,//租期
  847. homeType:that.form.house,//户型
  848. homeYs:that.form.key,//钥匙
  849. homeYzmj:that.form.yardProportion,//院子总面积
  850. homeZy:that.form.noise,//坟包及电塔 工厂噪音
  851. iconName:"",//热点名称
  852. iconTitle:that.form.iconTitle,//标签
  853. num:that.form.num,//浏览量
  854. price:that.form.price,//价格
  855. timeGo:that.form.timeGo,//年限
  856. title:that.form.title,//标题
  857. unit:that.form.unit,//单位
  858. image:that.form.ownershipList.map(item => item.url).join(','),//图片
  859. iconImage:"",//左上角图标
  860. homeImage:that.form.houseList.map(item => item.url).join(','),//产权证照片
  861. homeMp4:that.form.mp4List ? that.form.mp4List.map(item => item.url).join(',') : "",//视频
  862. latitude:that.form.latitude,
  863. longitude:that.form.longitude
  864. }
  865. // console.log(that.form);
  866. // console.log(params);
  867. if(this.$utils.verificationAll(params, {
  868. image : '请上传房屋照片',
  869. homeImage : '产权证照片',
  870. address : '请选择房屋位置',
  871. })){
  872. return
  873. }
  874. // console.info(JSON.stringify(params))
  875. // 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}
  876. saveOrUpdateHouse(params).then(response=>{
  877. console.info('response',response)
  878. uni.showToast({
  879. title: response.message,
  880. mask: false,
  881. icon: 'none',
  882. duration: 2000
  883. })
  884. setTimeout(()=>{
  885. uni.redirectTo({
  886. url:"/pages_subpack/successful-apply/index"
  887. })
  888. },2000)
  889. }).catch(error=>{
  890. })
  891. }).catch(errors => {
  892. console.info('errors',errors)
  893. })
  894. }
  895. }
  896. }
  897. </script>
  898. <style>
  899. page{
  900. background-color: #f5f5f5;
  901. }
  902. </style>