兼兼街租房小程序
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.

426 lines
8.3 KiB

  1. <template>
  2. <view class="container">
  3. <view class="ant-banner-box">
  4. <image class="ant-banner" mode="scaleToFill" :src="bannerList[3].image"/>
  5. <view class="ant-title">
  6. <p>一个有温度的家</p>
  7. <p class="ant-font-24">超多房源等你来挑</p>
  8. </view>
  9. </view>
  10. <view class="ant-float">
  11. <view class="ant-flex-line">
  12. <view class="ant-select">江华</view>
  13. <!-- <input class="ant-input" value="" placeholder="试试输入你想住的地点"/> -->
  14. </view>
  15. </view>
  16. <view class="ant-menu-card">
  17. <view class="ant-flex-line">
  18. <view class="ant-icon-menu">
  19. <view class="ant-icon">
  20. <image :src="image"></image>
  21. </view>
  22. <view class="ant-text">整租</view>
  23. </view>
  24. <view class="ant-icon-menu">
  25. <view class="ant-icon">
  26. <image :src="image"></image>
  27. </view>
  28. <view class="ant-text">新房源</view>
  29. </view>
  30. <view class="ant-icon-menu">
  31. <view class="ant-icon">
  32. <image :src="image"></image>
  33. </view>
  34. <view class="ant-text">合租</view>
  35. </view>
  36. <view class="ant-icon-menu">
  37. <view class="ant-icon">
  38. <image :src="image"></image>
  39. </view>
  40. <view class="ant-text">转租</view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="ant-content">
  45. <view class="ant-content-page">
  46. <view class="ant-flex-line">
  47. <view class="ant-page-title">好房源</view>
  48. <view class="ant-page-span">平台甄选</view>
  49. <view class="ant-page-span">品质保障</view>
  50. </view>
  51. <view class="ant-flex-line">
  52. <view class="ant-page-image-item" v-for="(item,index) in hotList">
  53. <image class="ant-page-image-item" mode="aspectFill" :src="item.image === null? image:item.image"/>
  54. <view class="ant-img-tags">
  55. <!-- <view class="ant-tags-title">{{item.title}}</view> -->
  56. <view class="ant-tags-text">{{item.price}}元起</view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="ant-content-page">
  62. <view class="ant-flex-line ant-head-line" @click="test">
  63. <view class="ant-page-title">推荐房源</view>
  64. </view>
  65. <view class="ant-item-box" v-for="(item,index) in list" >
  66. <view>
  67. <image class="ant-item-image" mode="aspectFill"
  68. :src="item.image === null? image:item.image"/>
  69. </view>
  70. <view class="ant-item-content">
  71. <view class="ant-item-title">{{item.title}}</view>
  72. <view class="ant-item-span">{{item.titleText}}</view>
  73. <view class="ant-item-span">{{item.address}}</view>
  74. <view class="ant-item-span"><span>{{item.payType}}</span></view>
  75. <view class="ant-item-price">{{item.price}} <span>/</span></view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="content-end">
  81. <view class="line"/>
  82. <view class="center">湖南瀚海黎明·技术支持</view>
  83. </view>
  84. </view>
  85. </template>
  86. <script>
  87. export default{
  88. data(){
  89. return{
  90. image:"https://vrlab-image4.ljcdn.com/release/auto3dhd/eba09229a901cb5cba66fda38f281405/screenshot/1657677701_15/pc0_m7ks1AA5Y.jpg?imageMogr2/quality/70/thumbnail/1024x",
  91. bannerList:[],
  92. addressList:[],
  93. classList:[],
  94. hotList:[],
  95. list:[]
  96. }
  97. },
  98. onLoad() {
  99. this.getBannerList();
  100. this.getAddressList();
  101. this.getClassList();
  102. this.getHotList();
  103. this.getHouseListPage();
  104. },
  105. // 隐藏微信h5的标题栏
  106. onReady() {
  107. },
  108. methods:{
  109. //获取轮播图
  110. getBannerList(){
  111. this.$request('/job-dev/house/applet/banner',{},'GET', (res) => {
  112. this.bannerList = res;
  113. console.log("111111")
  114. console.log(res[0].image)
  115. })
  116. },
  117. //获取地区
  118. getAddressList(){
  119. this.$request('/job-dev/house/applet/indexListPage',{},'GET', (res) => {
  120. this.addressList = res.records;
  121. console.log(res.records)
  122. })
  123. },
  124. //获取分类
  125. getClassList(){
  126. this.$request('/job-dev/house/applet/indexClass',{},'GET', (res) => {
  127. this.classList = res.records;
  128. console.log(res.records)
  129. })
  130. },
  131. //获取好房源
  132. getHotList(){
  133. this.$request('/job-dev/house/applet/indexHotList',{},'GET', (res) => {
  134. this.hotList = res.records;
  135. console.log(res.records)
  136. })
  137. },
  138. //请求接口获得后台列表数据信息 = 推荐房源
  139. getHouseListPage() {
  140. this.$request('/job-dev/house/applet/indexListPage',{},'GET', (res) => {
  141. this.list = res.records;
  142. console.log(res.records)
  143. })
  144. }
  145. }
  146. }
  147. </script>
  148. <style lang="scss">
  149. .container{
  150. background-color: #FFF !important;
  151. position: relative;
  152. }
  153. .ant-float{
  154. position: fixed;
  155. top: 60rpx;
  156. left: 24rpx;
  157. z-index: -2;
  158. .ant-select{
  159. width: 120rpx;
  160. padding: 10rpx 24rpx;
  161. color: #fff;
  162. font-weight: bolder;
  163. position: relative;
  164. }
  165. .ant-select::after{
  166. content: "";
  167. position: absolute;
  168. top: 8rpx;
  169. right: 55rpx;
  170. width: 12rpx;
  171. height: 12rpx;
  172. border-bottom: 2rpx solid #FFF;
  173. border-right: 2rpx solid #FFF;
  174. transform: rotate(45deg);
  175. }
  176. .ant-input{
  177. height: 48rpx;
  178. min-width: 460rpx;
  179. line-height: 48rpx;
  180. background: rgba(255, 255, 255, .4);
  181. border-radius: 8rpx;
  182. padding: 6rpx 24rpx;
  183. color: #333;
  184. font-size: 20rpx;
  185. }
  186. .ant-input::placeholder{
  187. color: #FFF;
  188. font-size: 20rpx;
  189. }
  190. }
  191. .ant-banner-box{
  192. position: fixed;
  193. top: 0;
  194. z-index: -3;
  195. background-color: #FFF;
  196. .ant-banner{
  197. width: 100vw;
  198. height: 500rpx;
  199. border-bottom-left-radius: 100rpx;
  200. border-bottom-right-radius: 100rpx;
  201. }
  202. .ant-title{
  203. color: #FFF;
  204. font-size: 42rpx;
  205. font-weight: bolder;
  206. text-align: center;
  207. position: absolute;
  208. top: 45%;
  209. width: 100%;
  210. line-height: 50rpx;
  211. }
  212. }
  213. .ant-menu-card{
  214. position: absolute;
  215. top: -40rpx;
  216. z-index: 1;
  217. margin: 0 24rpx;
  218. width: calc(100vw - 96rpx);
  219. background-color: #FFF;
  220. border-radius: 16rpx;
  221. min-height: 100rpx;
  222. padding: 24rpx;
  223. box-shadow: 10rpx 10rpx 20rpx rgba(134, 136, 136, 0.2);
  224. .ant-icon-menu{
  225. width: 150rpx;
  226. flex: 1;
  227. .ant-icon{
  228. width: 80rpx;
  229. height: 80rpx;
  230. margin: 8rpx auto;
  231. border-radius: 50%;
  232. // border: 1rpx dashed red;
  233. image{
  234. width: 80rpx;
  235. height: 80rpx;
  236. border-radius: 50%;
  237. }
  238. }
  239. .ant-text{
  240. width: 100%;
  241. font-size: 22rpx;
  242. color: #222;
  243. font-weight: bold;
  244. line-height: 40rpx;
  245. text-align: center;
  246. }
  247. }
  248. }
  249. .ant-content{
  250. margin-top: 520rpx;
  251. padding: 120rpx 24rpx 20rpx;
  252. width: calc(100vw - 48rpx);
  253. overflow: hidden;
  254. .ant-content-page{
  255. border-radius: 16rpx;
  256. min-height: 100rpx;
  257. padding: 24rpx 0;
  258. margin-bottom: 24rpx;
  259. .ant-page-title{
  260. color: #000;
  261. font-size: 32rpx;
  262. font-weight: bolder;
  263. line-height: 62rpx;
  264. width: 140rpx;
  265. }
  266. .ant-head-line{
  267. width: 100%;
  268. border-bottom: 1rpx solid #ccc;
  269. margin-bottom: 20rpx;
  270. }
  271. .ant-page-span{
  272. color: #aaa;
  273. font-size: 20rpx;
  274. margin-right: 10rpx;
  275. }
  276. .ant-page-image-item{
  277. border-radius: 4rpx;
  278. width: 240rpx;
  279. height: 300rpx;
  280. margin: 0 10rpx 0 0;
  281. flex-shrink: 0;
  282. position: relative;
  283. .ant-img-tags{
  284. background-color: rgba(255, 255, 255, .8);
  285. width: calc(240rpx - 36rpx);
  286. height: 50rpx;
  287. position: absolute;
  288. bottom: 8rpx;
  289. left: 8rpx;
  290. padding: 20rpx 10rpx;
  291. border-radius: 4rpx;
  292. .ant-tags-title{
  293. line-height: 30rpx;
  294. color: #000;
  295. font-size: 24rpx;
  296. }
  297. .ant-tags-text{
  298. font-size: 18rpx;
  299. color: #888;
  300. line-height: 40rpx;
  301. }
  302. }
  303. }
  304. }
  305. }
  306. .ant-item-box{
  307. display: flex;
  308. min-height: 80rpx;
  309. margin-bottom: 20rpx;
  310. .ant-item-image{
  311. width: 200rpx;
  312. height: 200rpx;
  313. border-radius: 4rpx;
  314. }
  315. .ant-item-content{
  316. color: #888;
  317. font-size: 28rpx;
  318. line-height: 42rpx;
  319. padding: 0 20rpx;
  320. .ant-item-title{
  321. color: #000;
  322. font-weight: bold;
  323. font-size: 32rpx;
  324. }
  325. .ant-item-span{
  326. color: #888;
  327. line-height: 40rpx;
  328. font-size: 24rpx;
  329. span{
  330. margin-right: 20rpx;
  331. font-size: 18rpx;
  332. background-color: #eee;
  333. padding: 5rpx 8rpx;
  334. border-radius: 4rpx;
  335. }
  336. }
  337. .ant-item-price{
  338. color: #4996f5;
  339. line-height: 48rpx;
  340. font-size: 34rpx;
  341. font-weight: bolder;
  342. span{
  343. line-height: 42rpx;
  344. font-size: 22rpx;
  345. font-weight: normal;
  346. margin-left: 10rpx
  347. }
  348. }
  349. }
  350. }
  351. </style>