addProperties.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <template>
  2. <view>
  3. <view class="main-left cross-center search">
  4. <image src="https://t17.9026.com/web/statics/image/index/search.png" mode=""></image>
  5. <input style="width: 560rpx;" type="text" v-model="name" placeholder="搜索楼盘"
  6. placeholder-style="font-size:28rpx;color:#999;" @input="search" />
  7. </view>
  8. <view class="properties_list">
  9. <view class="item main-left" v-for="(item,index) in dataList" :key="index" @click="selectEstate(index,item.name,item.id)">
  10. <view class="left">
  11. <image :src="item.cover_img" mode=""></image>
  12. </view>
  13. <view class="main-between-y right ">
  14. <view class="title">{{item.name}}</view>
  15. <view class="addr">{{item.address}}</view>
  16. <view class="content t-omit-two" v-html="item.details"></view>
  17. </view>
  18. <image class="bg" src="https://t17.9026.com/web/statics/image/sale/properties_gradual.png" mode="">
  19. </image>
  20. </view>
  21. <app-no-goods v-if="dataList.length === 0" :title="'暂无数据'" background="#f7f7f7"></app-no-goods>
  22. </view>
  23. <u-popup v-model="show" mode="center" border-radius="14" @close="show = false">
  24. <view class="model">
  25. <viwe class="main-right">
  26. <image src="https://t17.9026.com/web/statics/image/index/close.png" mode=""
  27. style="width: 25rpx;height: 24rpx;" @click="show=false"></image>
  28. </viwe>
  29. <viwe class="title">{{dataList[selectIndex].name}}</viwe>
  30. <viwe class="main-left cross-center addr">
  31. <image src="https://t17.9026.com/web/statics/image/index/location.png" mode=""
  32. style="width: 18rpx;height: 20rpx;margin-right: 8rpx;"></image>
  33. {{dataList[selectIndex].address}}
  34. </viwe>
  35. <viwe class="img">
  36. <image class="img" :src="dataList[selectIndex].cover_img" mode=""></image>
  37. </viwe>
  38. <viwe class="desc t-omit-three" v-html="dataList[selectIndex].details"></viwe>
  39. <button type="default" class="btn" @click="bindingEstate">确认选择</button>
  40. </view>
  41. </u-popup>
  42. </view>
  43. </template>
  44. <script>
  45. import appNoGoods from '@/components/page-component/app-no-goods/app-no-goods.vue';
  46. import uPopup from '@/components/basic-component/u-popup/u-popup.vue';
  47. export default {
  48. components: {
  49. appNoGoods,
  50. uPopup
  51. },
  52. data() {
  53. return {
  54. type:'',
  55. show: false,
  56. page:1,
  57. name:'',
  58. dataList:[],
  59. selectIndex:-1,
  60. };
  61. },
  62. onLoad(option) {
  63. this.type=option.type
  64. this.getDate(1)
  65. },
  66. methods:{
  67. selectEstate(index,name,id){
  68. // if(this.type==='addCustomer'){
  69. var pages = getCurrentPages();
  70. var currPage = pages[pages.length - 1]; //当前页面
  71. var prevPage = pages[pages.length - 2]; //上一个页面
  72. prevPage.$vm.estateInfo={id:id,name:name}
  73. // uni.navigateBack()
  74. // return
  75. // }
  76. this.selectIndex=index
  77. this.show=true
  78. },
  79. bindingEstate(){
  80. uni.navigateBack()
  81. // this.$request({
  82. // url: this.$api.sale.binding_estate,
  83. // data: {
  84. // estate_id:this.dataList[this.selectIndex].id
  85. // },
  86. // method: 'post'
  87. // }).then(res=>{
  88. // uni.showToast({
  89. // icon:'none',
  90. // title:res.msg
  91. // })
  92. // })
  93. },
  94. search(e){
  95. this.$utils.debounce(()=>{
  96. this.getDate(1,this.name)
  97. },800)
  98. },
  99. getDate(page){
  100. this.$request({
  101. url: this.$api.sale.estate_list,
  102. data: {
  103. page: page,
  104. is_myself: 0,
  105. name: this.name,
  106. },
  107. method: 'post'
  108. }).then(res=>{
  109. if(res.code===0){
  110. this.dataList=res.data.list
  111. }
  112. })
  113. }
  114. },
  115. onReachBottom() {
  116. this.page++
  117. this.getDate(this.page)
  118. }
  119. }
  120. </script>
  121. <style lang="scss" scoped>
  122. .model {
  123. width: 626rpx;
  124. height: 839rpx;
  125. background: #FFFFFF;
  126. border-radius: 14rpx;
  127. padding: 37rpx 49rpx;
  128. .title {
  129. font-size: 36rpx;
  130. font-weight: bold;
  131. color: #222222;
  132. }
  133. .addr {
  134. font-size: 22rpx;
  135. font-weight: 500;
  136. color: #999999;
  137. margin-top: 20rpx;
  138. }
  139. .img {
  140. width: 528rpx;
  141. height: 311rpx;
  142. border-radius: 14rpx;
  143. margin-top: 28rpx;
  144. }
  145. .desc {
  146. font-size: 26rpx;
  147. font-weight: 500;
  148. color: #222222;
  149. line-height: 36rpx;
  150. margin-top: 36rpx;
  151. max-height: 100rpx;
  152. }
  153. .btn {
  154. width: 525rpx;
  155. height: 85rpx;
  156. background: #A18353;
  157. border-radius: 6rpx;
  158. margin: 49rpx auto;
  159. font-size: 32rpx;
  160. font-weight: bold;
  161. color: #FFFFFF;
  162. }
  163. }
  164. .page {
  165. padding: 22rpx 0 0 0;
  166. min-height: 100vh;
  167. }
  168. .search {
  169. width: 680rpx;
  170. height: 82rpx;
  171. background: #FFFFFF;
  172. border: 1rpx solid #EEEEEE;
  173. border-radius: 4rpx;
  174. margin: 0 auto;
  175. padding-left: 22rpx;
  176. image {
  177. width: 22rpx;
  178. height: 22rpx;
  179. margin-right: 18rpx;
  180. }
  181. }
  182. .properties_list {
  183. background-color: #F8F8F8;
  184. .item {
  185. font-family: PingFang SC;
  186. margin: 25rpx auto;
  187. width: 678rpx;
  188. height: 206rpx;
  189. background: #FFFFFF;
  190. border-radius: 10rpx;
  191. // background-image: url(https://t17.9026.com/web/statics/image/sale/properties_gradual.png);
  192. padding: 25rpx;
  193. position: relative;
  194. .bg {
  195. position: absolute;
  196. top: 0;
  197. left: 0;
  198. width: 80%;
  199. height: 100%;
  200. }
  201. .left {
  202. image {
  203. width: 153rpx;
  204. height: 153rpx;
  205. border-radius: 10rpx;
  206. }
  207. }
  208. .right {
  209. margin-left: 25rpx;
  210. .title {
  211. font-size: 30rpx;
  212. font-weight: bold;
  213. color: #222222;
  214. }
  215. .addr {
  216. font-size: 22rpx;
  217. font-weight: 500;
  218. color: #222222;
  219. }
  220. .content {
  221. font-size: 24rpx;
  222. font-weight: 500;
  223. color: #666666;
  224. line-height: 34rpx;
  225. }
  226. }
  227. }
  228. .addPro {
  229. position: fixed;
  230. bottom: 0;
  231. width: 100%;
  232. height: 100rpx;
  233. background: #A18353;
  234. font-size: 32rpx;
  235. font-family: PingFang SC;
  236. font-weight: bold;
  237. color: #FFFFFF;
  238. }
  239. }
  240. </style>