瑶都万能墙
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.

397 lines
7.5 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="发布租房" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="form">
  5. <view class="help-issue">
  6. <text>租房标题</text>
  7. <text style="color: #BD3624;">*</text>
  8. </view>
  9. <view class="form-sheet-cell">
  10. <input type="text" class="title-input"/>
  11. </view>
  12. <uv-cell
  13. title="租房地点"
  14. rightIconStyle="fontSize: 30rpx;"
  15. value="请选择租房地点"
  16. isLink
  17. ></uv-cell>
  18. <uv-cell
  19. title="朝向"
  20. rightIconStyle="fontSize: 30rpx;"
  21. value="请选择朝向"
  22. isLink
  23. ></uv-cell>
  24. <uv-cell
  25. title="装修"
  26. rightIconStyle="fontSize: 30rpx;"
  27. value="请选择装修"
  28. isLink
  29. ></uv-cell>
  30. <uv-cell
  31. title="楼层"
  32. rightIconStyle="fontSize: 30rpx;"
  33. value="请选择楼层"
  34. isLink
  35. ></uv-cell>
  36. <view class="form-sheet-cell">
  37. <view class="label">
  38. 户型
  39. </view>
  40. <view class="price">
  41. <input placeholder="请输入户型(三室一厅)" v-model="form.home" />
  42. </view>
  43. </view>
  44. <view class="form-sheet-cell">
  45. <view class="label">
  46. 付款方式
  47. </view>
  48. <view class="price">
  49. <input placeholder="请输入付款方式(押一付三)" v-model="form.price" />
  50. </view>
  51. </view>
  52. <view class="form-sheet-cell">
  53. <view class="label">
  54. 租金/
  55. </view>
  56. <view class="price">
  57. <input placeholder="请输入租金" type="number" v-model="form.money" />
  58. </view>
  59. </view>
  60. <view class="form-sheet-cell">
  61. <view class="label">
  62. 面积
  63. </view>
  64. <view class="price">
  65. <input placeholder="请输入面积(米平方)" type="number" v-model="form.crm" />
  66. </view>
  67. </view>
  68. <view class="form-sheet-cell">
  69. <view class="label">
  70. 看房
  71. </view>
  72. <uv-radio-group v-model="radiovalue">
  73. <view class="price">
  74. <uv-radio
  75. :customStyle="{margin: '8px'}"
  76. iconSize="30rpx"
  77. size="40rpx"
  78. labelSize="26rpx"
  79. label="随时可看"
  80. name="随时可看">
  81. </uv-radio>
  82. <uv-radio
  83. :customStyle="{margin: '8px'}"
  84. iconSize="30rpx"
  85. size="40rpx"
  86. labelSize="26rpx"
  87. label="电话预约"
  88. name="电话预约">
  89. </uv-radio>
  90. </view>
  91. </uv-radio-group>
  92. </view>
  93. <view class="form-sheet-cell">
  94. <view class="label">
  95. 租房类型
  96. </view>
  97. <uv-radio-group v-model="form.type">
  98. <view class="price">
  99. <uv-radio
  100. :customStyle="{margin: '8px'}"
  101. iconSize="30rpx"
  102. size="40rpx"
  103. labelSize="26rpx"
  104. label="整租"
  105. name="整租">
  106. </uv-radio>
  107. <uv-radio
  108. :customStyle="{margin: '8px'}"
  109. iconSize="30rpx"
  110. size="40rpx"
  111. labelSize="26rpx"
  112. label="合租"
  113. name="合租">
  114. </uv-radio>
  115. </view>
  116. </uv-radio-group>
  117. </view>
  118. <view class="form-sheet-cell">
  119. <view class="label">
  120. 联系电话
  121. </view>
  122. <input placeholder="请输入联系电话" v-model="form.phone" />
  123. </view>
  124. <view class="images box">
  125. <view class="">
  126. 精选照片
  127. </view>
  128. <uv-upload
  129. :fileList="fileList"
  130. :maxCount="imageMax"
  131. multiple
  132. width="150rpx"
  133. height="150rpx"
  134. @delete="deleteImage"
  135. @afterRead="afterRead"
  136. :previewFullImage="true"></uv-upload>
  137. </view>
  138. <view class="category">
  139. <view class="title">
  140. 选择地区
  141. </view>
  142. <view class="tagList">
  143. <view
  144. :class="{act : t.id == form.addId}"
  145. @click="form.addId = t.id"
  146. v-for="(t, i) in cityList"
  147. :key="i">
  148. {{ t.name }}
  149. </view>
  150. </view>
  151. </view>
  152. <!-- <view class="">
  153. <uv-textarea
  154. v-model="form.content"
  155. count
  156. :maxlength="300"
  157. autoHeight
  158. placeholder="请输入详细介绍"></uv-textarea>
  159. </view> -->
  160. <uv-picker ref="picker"
  161. :columns="columns"
  162. @confirm="pickerConfirm"></uv-picker>
  163. <view class="uni-color-btn">
  164. 发布
  165. </view>
  166. </view>
  167. </view>
  168. </template>
  169. <script>
  170. import { mapState } from 'vuex'
  171. export default {
  172. data() {
  173. return {
  174. form : {
  175. addId : '',//地区id
  176. address : '',//地址
  177. crm : '',//面积
  178. },
  179. radiovalue : '',
  180. priceType : [
  181. {
  182. name : '月付',
  183. },
  184. {
  185. name : '季付',
  186. },
  187. {
  188. name : '年付',
  189. },
  190. ],
  191. radiolist : [
  192. {
  193. name : '日结',
  194. },
  195. {
  196. name : '月结',
  197. },
  198. ],
  199. fileList : [],
  200. imageMax : 9,
  201. picker : {
  202. workYear : [
  203. '不限',
  204. ],
  205. school : [
  206. '不限',
  207. '初中',
  208. '高中',
  209. '专科',
  210. '本科',
  211. '研究生',
  212. '博士',
  213. ],
  214. },
  215. }
  216. },
  217. onLoad() {
  218. for (var i = 0; i < 30; i++) {
  219. this.picker.workYear.push((i + 1) + '年')
  220. }
  221. this.form.addId = this.cityList[0].id
  222. },
  223. computed : {
  224. columns(){
  225. return [this.picker[this.pickerKey]]
  226. },
  227. ...mapState(['cityList', 'category']),
  228. },
  229. methods: {
  230. openPicker(key){
  231. this.pickerKey = key
  232. this.$refs.picker.open()
  233. },
  234. pickerConfirm(e){
  235. this.form[this.pickerKey] = e.value[0]
  236. },
  237. deleteImage(e){
  238. this.fileList.splice(e.index, 1)
  239. },
  240. afterRead(e){
  241. let self = this
  242. e.file.forEach(file => {
  243. self.$Oss.ossUpload(file.url).then(url => {
  244. self.fileList.push({
  245. url
  246. })
  247. })
  248. })
  249. },
  250. //地图上选择地址
  251. selectAddr() {
  252. Position.selectAddress(res => {
  253. //经纬度信息
  254. this.form.latitude = res.latitude
  255. this.form.longitude = res.longitude
  256. if (res.name) {
  257. return this.form.address = res.name
  258. }
  259. this.form.address = ''
  260. })
  261. },
  262. // 提交
  263. submit(){
  264. if(this.fileList.length == 0){
  265. return uni.showToast({
  266. title: '请上传精选照片',
  267. icon : 'none'
  268. })
  269. }
  270. if (this.$utils.verificationAll(this.form, {
  271. title: '请输入标题',
  272. address : '请选择租房地点',
  273. money : '请输入租金',
  274. phone: '请输入联系电话',
  275. titleSub : '请输入备注',
  276. })) {
  277. return
  278. }
  279. this.$api('publishJob', this.form, res => {
  280. if(res.code == 200){
  281. uni.showToast({
  282. title: '发布成功!',
  283. icon: 'none'
  284. })
  285. setTimeout(uni.navigateBack, 1000, -1)
  286. }
  287. })
  288. },
  289. }
  290. }
  291. </script>
  292. <style scoped lang="scss">
  293. .page{
  294. background-color: #fff;
  295. min-height: 100vh;
  296. box-sizing: border-box;
  297. color: #333333;
  298. font-size: 28rpx;
  299. /deep/ text{
  300. font-size: 28rpx !important;
  301. }
  302. .form{
  303. padding: 30rpx;
  304. .help-issue {
  305. margin: 20rpx;
  306. }
  307. .title-input{
  308. border: 1px solid $uni-color;
  309. width: 100%;
  310. border-radius: 10rpx;
  311. padding: 10rpx 20rpx;
  312. box-sizing: border-box;
  313. height: 65rpx;
  314. }
  315. .form-sheet-cell{
  316. display: flex;
  317. background-color: #fff;
  318. padding: 20rpx 30rpx;
  319. align-items: center;
  320. .label{
  321. width: 160rpx;
  322. }
  323. .price{
  324. display: flex;
  325. // text-align: center;
  326. input{
  327. width: 450rpx;
  328. // border: 1px solid $uni-color;
  329. margin: 0 10rpx;
  330. }
  331. }
  332. .right-icon{
  333. margin-left: auto;
  334. }
  335. }
  336. .images{
  337. padding: 30rpx;
  338. view{
  339. padding-bottom: 20rpx;
  340. }
  341. }
  342. }
  343. .category{
  344. padding: 20rpx;
  345. .title{
  346. // font-weight: 900;
  347. // font-size: 30rpx;
  348. }
  349. .tagList{
  350. display: flex;
  351. flex-wrap: wrap;
  352. padding: 10rpx 0;
  353. view{
  354. background: rgba($uni-color, 0.1);
  355. padding: 10rpx 20rpx;
  356. margin: 10rpx;
  357. border-radius: 10rpx;
  358. font-size: 26rpx;
  359. }
  360. .act{
  361. color: #fff;
  362. background: $uni-color;
  363. }
  364. }
  365. }
  366. }
  367. </style>