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

199 lines
5.8 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
2 months ago
6 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
2 months ago
6 months ago
6 months ago
6 months ago
  1. <template>
  2. <view class="uv-page">
  3. <searchVue @onSearch="onSearch($event)" @onParent="onDropDown($event)" />
  4. <!-- <view class="se-pb-200">
  5. <view v-if="list.length>0">
  6. <view @click="onDetail(item)" class="se-my-10 se-mx-20 se-px-20 se-py-20 se-br-20 se-bgc-white se-flex" v-for="(item,index) in list" :key="index">
  7. <view class="se-pos se-w-260 se-h-180">
  8. <image v-if="item.iconImage" class="se-a-80 se-pos-lt" :src="item.iconImage" mode=""></image>
  9. <image class="se-w-260 se-h-180 se-br-10" :src="item.images[0]" mode=""></image>
  10. </view>
  11. <view class="se-pl-10 se-w-p-100">
  12. <view class="se-c-black se-fs-28">
  13. {{item.title}}
  14. </view>
  15. <view class="se-flex se-flex-h-sb se-flex-ai-c se-fs-24 se-mt-10 se-c-66">
  16. <text>{{item.homeType}}</text>
  17. <text>{{item.timeGo}}</text>
  18. </view>
  19. <view class="se-flex se-flex-h-sb se-flex-ai-c se-mt-10">
  20. <template v-if="item.iconTitles.length>0">
  21. <view class="se-flex">
  22. <view class="se-display-ib se-c-white se-bgc-orange se-fs-22 se-br-8 se-px-10 se-py-5 se-mr-10" v-for="(items,indexs) in item.iconTitles" :key="indexs">
  23. {{items}}
  24. </view>
  25. </view>
  26. </template>
  27. <template v-else><view></view></template>
  28. <view class="se-c-66 se-flex se-flex-ai-c">
  29. <uv-icon name="eye"></uv-icon>
  30. <text class="se-ml-5 se-fs-18">{{item.num}}</text>
  31. </view>
  32. </view>
  33. <view class="se-flex se-flex-h-sb se-flex-ai-c se-mt-10">
  34. <text class="se-c-red se-fs-24 se-fw-6 se-toe-1">{{item.price}}/{{item.unit}}</text>
  35. <text class="se-c-66 se-fs-22 se-toe-1">{{item.address}}</text>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <view v-else>
  41. <uv-empty mode="list" ></uv-empty>
  42. </view>
  43. </view> -->
  44. <homeList :list="list" />
  45. <!-- <view class="se-my-10 se-mx-20 se-px-20 se-py-20 se-br-20 se-bgc-white se-flex" v-for="(item,index) in 20" :key="index">
  46. <view class="se-pos se-w-260 se-h-180">
  47. <image class="se-a-80 se-pos-lt" src="../../static/image/2x.png" mode=""></image>
  48. <image class="se-w-260 se-h-180 se-br-10" src="https://cdn.uviewui.com/uview/swiper/swiper1.png" mode=""></image>
  49. </view>
  50. <view class="se-pl-10 se-w-p-100">
  51. <view class="se-c-black se-fs-28">
  52. 整租·四季峰景四期 2室2厅1卫
  53. </view>
  54. <view class="se-flex se-flex-h-sb se-flex-ai-c se-fs-24 se-mt-10 se-c-66">
  55. <text>精装修</text>
  56. <text>1</text>
  57. </view>
  58. <view class="se-flex se-flex-h-sb se-flex-ai-c se-mt-10">
  59. <view class="se-display-ib se-c-white se-bgc-orange se-fs-22 se-br-8 se-px-10 se-py-5">
  60. 全新首租
  61. </view>
  62. <view class="se-c-66 se-flex se-flex-ai-c">
  63. <uv-icon name="eye"></uv-icon>
  64. <text class="se-ml-5 se-fs-18">999+</text>
  65. </view>
  66. </view>
  67. <view class="se-flex se-flex-h-sb se-flex-ai-c se-mt-10">
  68. <text class="se-c-red se-fs-28 se-fw-6">1500/</text>
  69. <text class="se-c-66 se-fs-22">四季峰景四期</text>
  70. </view>
  71. </view>
  72. </view> -->
  73. </view>
  74. </template>
  75. <script>
  76. import searchVue from './component/search.vue'
  77. import { housePageList } from "@/common/api.js"
  78. import homeList from '@/components/home/homeList.vue'
  79. export default{
  80. components:{
  81. searchVue,
  82. homeList,
  83. },
  84. data(){
  85. return{
  86. keyword:"",
  87. id:null,
  88. pageNo:1,
  89. pageSize:10,
  90. areaId:null,
  91. priceId:null,
  92. typeId:null,
  93. yearId:null,
  94. list:[]
  95. }
  96. },
  97. onLoad(options) {
  98. this.id = options.id
  99. uni.setNavigationBarTitle({
  100. title: options.title ? options.title :"分类"
  101. })
  102. this.onHousePageList()
  103. },
  104. onPullDownRefresh() {
  105. let that = this
  106. that.pageNo = 1
  107. that.list = []
  108. that.onHousePageList()
  109. },
  110. onReachBottom() {
  111. let that = this
  112. that.pageNo = that.pageNo + 1
  113. that.onHousePageList()
  114. },
  115. methods:{
  116. onHousePageList(){
  117. let that = this
  118. let params={
  119. commonClass:that.id,//所属分类
  120. pageNo:that.pageNo,
  121. pageSize:that.pageSize,
  122. title:that.keyword,
  123. areaId:that.areaId,
  124. priceId:that.priceId,
  125. classId:that.typeId,
  126. yearId:that.yearId
  127. }
  128. housePageList(params).then((response) => {
  129. console.info("responseindexsindexsindexs",response.result.records)
  130. response.result.records.forEach((items,indexs)=>{
  131. if(items.image){
  132. items.images = items.image.split(',')
  133. }else{
  134. items.images = []
  135. }
  136. if(items.homeImage){
  137. items.homeImages = items.homeImage.split(',')
  138. }else{
  139. items.homeImages = []
  140. }
  141. if(items.iconTitle){
  142. items.iconTitles = items.iconTitle.split(',')
  143. }else{
  144. items.iconTitles = []
  145. }
  146. })
  147. console.info('response.resultindexsindexsindexs',response.result.records)
  148. that.list = that.list.concat(response.result.records)
  149. }).catch((error) =>{
  150. })
  151. },
  152. onSearch(event){
  153. console.info('onSearch',event)
  154. // console.info(event)
  155. let that = this
  156. that.keyword = event
  157. that.pageNo = 1
  158. that.list=[]
  159. that.onHousePageList()
  160. },
  161. onDropDown(event){
  162. console.info('onDropDown',event)
  163. let that = this
  164. that.areaId = null;
  165. that.pageNo = 1
  166. that.priceId = null;
  167. that.typeId = null;
  168. that.yearId = null
  169. event.forEach(items=>{
  170. if(items.name=='region'){
  171. that.areaId = items.value
  172. }else if(items.name=='rent'){
  173. that.priceId = items.value
  174. }else if(items.name=='type'){
  175. that.typeId = items.value
  176. }else if(items.name=='duration'){
  177. that.yearId = items.value
  178. }
  179. })
  180. console.info('that.areaId',that.areaId)
  181. that.list=[]
  182. that.onHousePageList()
  183. },
  184. onDetail(event){
  185. uni.navigateTo({
  186. url:"/pages_subpack/detail/index?id="+event.id
  187. })
  188. }
  189. }
  190. }
  191. </script>
  192. <style>
  193. page{
  194. background-color: #f5f5f5;
  195. }
  196. </style>