addProperties.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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. this.$request({
  81. url: this.$api.sale.binding_estate,
  82. data: {
  83. estate_id:this.dataList[this.selectIndex].id
  84. },
  85. method: 'post'
  86. }).then(res=>{
  87. uni.showToast({
  88. icon:'none',
  89. title:res.msg
  90. })
  91. })
  92. },
  93. search(e){
  94. this.$utils.debounce(()=>{
  95. this.getDate(1,this.name)
  96. },800)
  97. },
  98. getDate(page){
  99. this.$request({
  100. url: this.$api.sale.estate_list,
  101. data: {
  102. page: page,
  103. is_myself: 0,
  104. name: this.name,
  105. },
  106. method: 'post'
  107. }).then(res=>{
  108. if(res.code===0){
  109. this.dataList=res.data.list
  110. }
  111. })
  112. }
  113. },
  114. onReachBottom() {
  115. this.page++
  116. this.getDate(this.page)
  117. }
  118. }
  119. </script>
  120. <style lang="scss" scoped>
  121. .model {
  122. width: 626rpx;
  123. height: 839rpx;
  124. background: #FFFFFF;
  125. border-radius: 14rpx;
  126. padding: 37rpx 49rpx;
  127. .title {
  128. font-size: 36rpx;
  129. font-weight: bold;
  130. color: #222222;
  131. }
  132. .addr {
  133. font-size: 22rpx;
  134. font-weight: 500;
  135. color: #999999;
  136. margin-top: 20rpx;
  137. }
  138. .img {
  139. width: 528rpx;
  140. height: 311rpx;
  141. border-radius: 14rpx;
  142. margin-top: 28rpx;
  143. }
  144. .desc {
  145. font-size: 26rpx;
  146. font-weight: 500;
  147. color: #222222;
  148. line-height: 36rpx;
  149. margin-top: 36rpx;
  150. max-height: 100rpx;
  151. }
  152. .btn {
  153. width: 525rpx;
  154. height: 85rpx;
  155. background: #A18353;
  156. border-radius: 6rpx;
  157. margin: 49rpx auto;
  158. font-size: 32rpx;
  159. font-weight: bold;
  160. color: #FFFFFF;
  161. }
  162. }
  163. .page {
  164. padding: 22rpx 0 0 0;
  165. min-height: 100vh;
  166. }
  167. .search {
  168. width: 680rpx;
  169. height: 82rpx;
  170. background: #FFFFFF;
  171. border: 1rpx solid #EEEEEE;
  172. border-radius: 4rpx;
  173. margin: 0 auto;
  174. padding-left: 22rpx;
  175. image {
  176. width: 22rpx;
  177. height: 22rpx;
  178. margin-right: 18rpx;
  179. }
  180. }
  181. .properties_list {
  182. background-color: #F8F8F8;
  183. .item {
  184. font-family: PingFang SC;
  185. margin: 25rpx auto;
  186. width: 678rpx;
  187. height: 206rpx;
  188. background: #FFFFFF;
  189. border-radius: 10rpx;
  190. // background-image: url(https://t17.9026.com/web/statics/image/sale/properties_gradual.png);
  191. padding: 25rpx;
  192. position: relative;
  193. .bg {
  194. position: absolute;
  195. top: 0;
  196. left: 0;
  197. width: 80%;
  198. height: 100%;
  199. }
  200. .left {
  201. image {
  202. width: 153rpx;
  203. height: 153rpx;
  204. border-radius: 10rpx;
  205. }
  206. }
  207. .right {
  208. margin-left: 25rpx;
  209. .title {
  210. font-size: 30rpx;
  211. font-weight: bold;
  212. color: #222222;
  213. }
  214. .addr {
  215. font-size: 22rpx;
  216. font-weight: 500;
  217. color: #222222;
  218. }
  219. .content {
  220. font-size: 24rpx;
  221. font-weight: 500;
  222. color: #666666;
  223. line-height: 34rpx;
  224. }
  225. }
  226. }
  227. .addPro {
  228. position: fixed;
  229. bottom: 0;
  230. width: 100%;
  231. height: 100rpx;
  232. background: #A18353;
  233. font-size: 32rpx;
  234. font-family: PingFang SC;
  235. font-weight: bold;
  236. color: #FFFFFF;
  237. }
  238. }
  239. </style>