brokerlist.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. <template>
  2. <view>
  3. <view class="cu-bar search bg-gray">
  4. <view class="search-form round text-center">
  5. <text class="cuIcon-search"></text>
  6. <input @input="bindInput" :adjust-position="false" type="text" placeholder="搜索经纪人名称或区域"
  7. confirm-type="search"></input>
  8. </view>
  9. <view class="action" v-if="searchval!==''">
  10. <button class="cu-btn bg-white shadow-blur round" @click="btnSearch()">搜索</button>
  11. </view>
  12. </view>
  13. <view class="menu" v-if="false">
  14. <view class="menu-top">
  15. <view class="menu-top-item">优秀经纪人
  16. <view class="item-icon">
  17. <u-icon name="arrow-down" color="#000000" size="25rpx"></u-icon>
  18. </view>
  19. </view>
  20. <view class="menu-top-item" :style="filterbox!==null? 'color:#CA151C' : ''" data-filterbox="area"
  21. @tap="showFilter">{{arealist.title}}
  22. <view class="item-icon" :style="{transform:filterbox!==null?transform:'', transition:transition}">
  23. <u-icon name="arrow-down" :color="filterbox!==null? '#CA151C' : '#000000'"
  24. size="25rpx"></u-icon>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="filtercon" v-if="filterbox!==null">
  29. <view class="grid margin-bottom text-left col-3 bg-white" v-if="filterbox=='area'">
  30. <view class="solids-right padding-bottom">
  31. <scroll-view scroll-y="true" style="height: 600rpx;">
  32. <view class="solid-bottom text-gray padding-lr-sm padding-tb-sm">选择省</view>
  33. <view class="solid-bottom padding-lr-sm padding-tb-sm" @click="checkArea(4,0)">全部</view>
  34. <block v-for="(item,index) in arealist.data" :key="index">
  35. <view class="solid-bottom padding-lr-sm padding-tb-sm" @click="checkArea(1,index)">
  36. {{item.title}}
  37. </view>
  38. </block>
  39. </scroll-view>
  40. </view>
  41. <view class="solids-right padding-bottom">
  42. <scroll-view scroll-y="true" style="height: 600rpx;">
  43. <view class="solid-bottom text-gray padding-lr-sm padding-tb-sm">选择市</view>
  44. <block v-for="(item,index) in arealist.cityarr" :key="index">
  45. <view class="solid-bottom padding-lr-sm padding-tb-sm" @click="checkArea(2,index)">
  46. {{item.title}}
  47. </view>
  48. </block>
  49. </scroll-view>
  50. </view>
  51. <view class="padding-bottom">
  52. <scroll-view scroll-y="true" style="height: 600rpx;">
  53. <view class="solid-bottom text-gray padding-lr-sm padding-tb-sm">选择区县</view>
  54. <block v-for="(item,index) in arealist.districtarr" :key="index">
  55. <view class="solid-bottom padding-lr-sm padding-tb-sm" @click="checkArea(3,index)">
  56. {{item.title}}
  57. </view>
  58. </block>
  59. </scroll-view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="mainArea">
  65. <view class="areaList">
  66. <view class="areaCard" :class="areaItem == '' ? 'areaCardSel' : ''" @click="selArea('全部')">全部</view>
  67. <view class="areaCard" v-for="(item,index) in mainArea" :key="index" :class="areaItem == item ? 'areaCardSel' : ''" @click="selArea(item)">{{item}}</view>
  68. </view>
  69. <view class="brokerList">
  70. <view class="brokerCard" v-for="(item,index) in plist" :key="index">
  71. <view class="brokerCard-avatar">
  72. <image class="brokerCard-avatar-image"
  73. :src="item.muser.avatar ? item.muser.avatar : $getImageUrl('static/images/applet/dfhead.jpg')">
  74. </image>
  75. <view class="avatar-bg"
  76. :style="'background-image:url('+$getImageUrl('static/images/applet/bg/brokerIdentity.png')+');'">
  77. <view class="avatar-bg-title">金牌经纪人 {{item.title}}</view>
  78. <!-- <view class="avatar-bg-name"></view> -->
  79. </view>
  80. </view>
  81. <view class="brokerCard-infor">
  82. <view class="infor-header">
  83. <view :data-index="index" @tap="showModal">{{item.title}}</view>
  84. <image :data-telephone="item.mobile" @tap="makeTelephone" class="infor-header-icon"
  85. :src="$getImageUrl('static/images/applet/broker/contact.png')" mode="widthFix"></image>
  86. </view>
  87. <view class="infor-item" :data-index="index" @tap="showModal">
  88. <image class="infor-item-icon" :src="$getImageUrl('static/images/applet/broker/broker.png')"
  89. mode="widthFix"></image>
  90. <view class="infor-item-text">优秀经纪人</view>
  91. </view>
  92. <view class="infor-item" :data-index="index" @tap="showModal">
  93. <image class="infor-item-icon" :src="$getImageUrl('static/images/applet/broker/broker.png')"
  94. mode="widthFix"></image>
  95. <view class="infor-item-text">镇/村:{{item.town}} - {{item.village}}</view>
  96. </view>
  97. <view class="infor-item" :data-index="index" @tap="showModal">
  98. <image class="infor-item-icon" :src="$getImageUrl('static/images/applet/index/cardD.png')"
  99. mode="widthFix"></image>
  100. <view class="infor-item-text">服务区域:{{item.region}}</view>
  101. </view>
  102. </view>
  103. </view>
  104. <uni-load-more :status="pstatus"></uni-load-more>
  105. </view>
  106. </view>
  107. <view class="filterbg" v-if="false">
  108. <view class="flex justify-between solids-bottom padding bg-white">
  109. <view class="text-bold">推荐</view>
  110. <view class="flex justify-end">
  111. <view class="cu-tag radius" data-filterbox="area" @tap="showFilter">{{arealist.title}}</view>
  112. </view>
  113. </view>
  114. </view>
  115. <view class="bg-white cu-list menu-avatar" v-if="false">
  116. <block v-for="(item,index) in plist" :key="index">
  117. <view class="cu-item" style="border-bottom: 0rpx !important; border-top: 0rpx !important;">
  118. <view class="cu-avatar round lg"
  119. :style="'background-image:url('+(item.muser.avatar ? item.muser.avatar : $getImageUrl('static/images/applet/dfhead.jpg'))+');'">
  120. </view>
  121. <view class="content" :data-index="index" @tap="showModal">
  122. <view class="text-cut text-bold">{{item.title}}</view>
  123. </view>
  124. <view class="action">
  125. <button class="cu-btn bg-blue cuIcon" :data-telephone="item.mobile" @tap="makeTelephone">
  126. <text class="cuIcon-dianhua"></text>
  127. </button>
  128. </view>
  129. </view>
  130. <view class="itembox" :data-index="index" @tap="showModal">
  131. <view class="itembox-til">服务区域:</view>
  132. <view class="itembox-con text-gray">{{item.province}} - {{item.city}} - {{item.district}}</view>
  133. </view>
  134. <view class="itembox" :data-index="index" @tap="showModal">
  135. <view class="itembox-til">镇/村:</view>
  136. <view class="itembox-con text-gray">{{item.town}} - {{item.village}}</view>
  137. </view>
  138. <view class="itembox solids-bottom" style="padding-bottom: 30rpx;" :data-index="index" @tap="showModal">
  139. <view class="itembox-til">区域:</view>
  140. <view class="itembox-con text-gray" style="height: 75rpx; overflow: hidden;">
  141. <text>{{item.region}}</text>
  142. </view>
  143. </view>
  144. <view class="itembox solids-bottom" style="padding-bottom: 30rpx;" :data-index="index" @tap="showModal">
  145. <view class="itembox-til">基本介绍:</view>
  146. <view class="itembox-con text-gray" style="height: 75rpx; overflow: hidden;">
  147. <text>{{item.details}}</text>
  148. </view>
  149. </view>
  150. </block>
  151. </view>
  152. <!-- <uni-load-more :status="pstatus"></uni-load-more> -->
  153. <view class="cu-modal bottom-modal" :class="modal.name=='detailsbox'?'show':''">
  154. <view class="cu-dialog">
  155. <view class="cu-bar bg-white">
  156. <view class="action text-green">确定</view>
  157. <view class="action text-blue" @tap="hideModal">取消</view>
  158. </view>
  159. <view class="padding-tb">
  160. <scroll-view scroll-y="true" style="height: 800rpx;">
  161. <view class="itembox text-left">
  162. <view class="itembox-til text-right">姓名:</view>
  163. <view class="itembox-con text-gray">{{modal.brokerinfo.title}}</view>
  164. </view>
  165. <view class="itembox text-left">
  166. <view class="itembox-til text-right">手机号:</view>
  167. <view class="itembox-con text-gray">{{modal.brokerinfo.mobile}}</view>
  168. </view>
  169. <view class="itembox text-left">
  170. <view class="itembox-til text-right">微信号:</view>
  171. <view class="itembox-con text-gray">{{modal.brokerinfo.weixin}}</view>
  172. </view>
  173. <view class="itembox text-left">
  174. <view class="itembox-til text-right">QQ号:</view>
  175. <view class="itembox-con text-gray">{{modal.brokerinfo.qq}}</view>
  176. </view>
  177. <view class="itembox text-left">
  178. <view class="itembox-til text-right">服务区域:</view>
  179. <view class="itembox-con text-gray">{{modal.brokerinfo.province}} -
  180. {{modal.brokerinfo.city}}
  181. </view>
  182. </view>
  183. <view class="itembox text-left" style="padding-bottom: 30rpx;" :data-index="index"
  184. @tap="showModal">
  185. <view class="itembox-til text-right">基本介绍:</view>
  186. <view class="itembox-con text-gray">
  187. <text>{{modal.brokerinfo.details}}</text>
  188. </view>
  189. </view>
  190. </scroll-view>
  191. </view>
  192. </view>
  193. </view>
  194. <view class="padding-sm"></view>
  195. <view class="padding-xl"></view>
  196. <view class="cu-bar tabbar bg-white foot">
  197. <view class="action text-gray" @tap="goNavPage('/pages/index/index')">
  198. <view class="cuIcon-cu-image">
  199. <image src="../../static/tabbar/index.png"></image>
  200. </view>
  201. 首页
  202. </view>
  203. <view class="action text-gray" @tap="goNavPage('/pages/comjobs/comjobs')">
  204. <view class="cuIcon-cu-image">
  205. <image src="../../static/tabbar/jobs.png"></image>
  206. </view>
  207. 招聘
  208. </view>
  209. <!-- #ifndef MP-WEIXIN -->
  210. <view class="action text-gray videoimg" @tap="goNavPage('/pages/video/videolist')">
  211. <view class="cuIcon-cu-image">
  212. <image src="../../static/tabbar/video.png"></image>
  213. </view>
  214. 微工作
  215. </view>
  216. <!-- #endif -->
  217. <view class="action text-blue" @tap="goNavPage('/pages/broker/brokerlist')">
  218. <view class="cuIcon-cu-image">
  219. <image src="../../static/tabbar/brokerSelected.png"></image>
  220. </view>
  221. 经纪人
  222. </view>
  223. <view class="action text-gray" @tap="goNavPage('/pages/my/my')">
  224. <view class="cuIcon-cu-image">
  225. <image src="../../static/tabbar/my.png"></image>
  226. </view>
  227. 我的
  228. </view>
  229. </view>
  230. </view>
  231. </template>
  232. <script>
  233. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  234. var _this;
  235. export default {
  236. components: {
  237. uniLoadMore
  238. },
  239. data() {
  240. return {
  241. filterbox: null,
  242. arealist: {
  243. title: "区域",
  244. value: "",
  245. cityarr: [],
  246. districtarr: [],
  247. data: []
  248. },
  249. pstatus: 'more',
  250. ppage: 1,
  251. psize: 20,
  252. plist: [],
  253. searchval: "",
  254. modal: {
  255. name: null,
  256. brokerinfo: {}
  257. },
  258. transform: "rotate(180deg)",
  259. transition: "all .3s",
  260. mainArea: [],
  261. areaItem: "",
  262. };
  263. },
  264. onLoad: function() {
  265. _this = this;
  266. _this.arealist.data = require('@/common/area.json');
  267. _this.getMore();
  268. _this.getArea();
  269. },
  270. onPullDownRefresh: function() {
  271. _this.pageRefresh();
  272. },
  273. onReachBottom: function() {
  274. if (_this.pstatus !== 'more') {
  275. return;
  276. }
  277. _this.getMore();
  278. },
  279. onShareAppMessage: function(res) {
  280. return {
  281. title: "经纪人列表",
  282. path: "/pages/broker/brokerlist"
  283. }
  284. },
  285. methods: {
  286. selArea(item) {
  287. if(item == '全部') {
  288. _this.areaItem = ''
  289. } else {
  290. _this.areaItem = item;
  291. }
  292. _this.pageRefresh();
  293. },
  294. getArea() {
  295. _this.$req.ajax({
  296. path: "index/getStreet"
  297. }).then((data) => {
  298. _this.mainArea = data;
  299. console.log("列表", data, _this.mainArea)
  300. }).catch((err) => {
  301. uni.showModal({
  302. title: '信息提示',
  303. content: err,
  304. showCancel: false
  305. });
  306. });
  307. },
  308. showFilter: function(e) {
  309. var nowfilterbox = e.currentTarget.dataset.filterbox;
  310. if (_this.filterbox == nowfilterbox) {
  311. _this.filterbox = null;
  312. } else {
  313. _this.filterbox = nowfilterbox;
  314. }
  315. uni.pageScrollTo({
  316. scrollTop: 0,
  317. duration: 300
  318. });
  319. },
  320. checkArea: function(level, index) {
  321. if (level == 1) {
  322. _this.arealist.cityarr = _this.arealist.data[index].children;
  323. _this.arealist.districtarr = [];
  324. } else if (level == 2) {
  325. _this.arealist.districtarr = _this.arealist.cityarr[index].children;
  326. } else if (level == 3) {
  327. _this.arealist.title = _this.arealist.districtarr[index].title;
  328. _this.arealist.value = _this.arealist.districtarr[index].title;
  329. _this.filterbox = null;
  330. _this.pageRefresh();
  331. } else if (level == 4) {
  332. _this.arealist.cityarr = [];
  333. _this.arealist.districtarr = [];
  334. _this.arealist.title = "全部";
  335. _this.arealist.value = "";
  336. _this.filterbox = null;
  337. _this.pageRefresh();
  338. }
  339. },
  340. // 搜索
  341. bindInput: function(e) {
  342. _this.searchval = e.detail.value;
  343. },
  344. btnSearch: function() {
  345. if (_this.searchval == "") {
  346. uni.showModal({
  347. title: '信息提示',
  348. content: "请输入要搜索的关键字...",
  349. showCancel: false
  350. });
  351. return false;
  352. }
  353. _this.pageRefresh();
  354. },
  355. pageRefresh: function() {
  356. _this.pstatus = 'more';
  357. _this.ppage = 1;
  358. _this.plist = [];
  359. _this.getMore();
  360. },
  361. getMore: function() {
  362. _this.$req.ajax({
  363. path: "broker/getListBroker",
  364. data: {
  365. ppage: _this.ppage,
  366. psize: _this.psize,
  367. searchval: _this.searchval,
  368. // district: _this.arealist.value
  369. town: _this.areaItem
  370. }
  371. }).then((data) => {
  372. _this.pstatus = data.pstatus;
  373. _this.plist = _this.plist.concat(data.plist);
  374. _this.ppage += 1;
  375. uni.stopPullDownRefresh();
  376. console.log("列表", _this.plist)
  377. }).catch((err) => {
  378. uni.showModal({
  379. title: '信息提示',
  380. content: err,
  381. showCancel: false
  382. });
  383. });
  384. },
  385. showModal: function(e) {
  386. var index = e.currentTarget.dataset.index;
  387. _this.modal.name = "detailsbox";
  388. _this.modal.brokerinfo = _this.plist[index];
  389. },
  390. hideModal: function(e) {
  391. _this.modal.name = null;
  392. },
  393. // 咨询电话
  394. makeTelephone: function(e) {
  395. var telephone = e.currentTarget.dataset.telephone;
  396. uni.makePhoneCall({
  397. phoneNumber: telephone
  398. });
  399. },
  400. goNavPage: function(pageurl) {
  401. uni.redirectTo({
  402. url: pageurl
  403. });
  404. },
  405. goDetail: function(agentid) {
  406. uni.navigateTo({
  407. url: '/pages/agent/detail?agentid=' + agentid
  408. });
  409. }
  410. }
  411. }
  412. </script>
  413. <style lang="scss">
  414. .echo-agent-list .echo-item .echo-tilpic {
  415. width: 120rpx;
  416. height: 120rpx;
  417. }
  418. .echo-agent-list .echo-item .echo-content {
  419. width: 550rpx;
  420. }
  421. .cu-item:after {
  422. border: 0rpx !important;
  423. }
  424. .itembox {
  425. padding: 10rpx 30rpx;
  426. width: 100%;
  427. display: flex;
  428. justify-content: start;
  429. }
  430. .itembox-til {
  431. width: 160rpx;
  432. }
  433. .itembox-con {
  434. width: 530rpx;
  435. }
  436. .menu {
  437. width: 100%;
  438. background-color: #FFFFFF;
  439. position: relative;
  440. .menu-top {
  441. display: flex;
  442. padding: 25rpx 20rpx;
  443. .menu-top-item {
  444. margin-right: 50rpx;
  445. display: flex;
  446. align-items: center;
  447. font-size: 28rpx;
  448. .item-icon {
  449. margin-left: 10rpx;
  450. // width: 20rpx;
  451. // height: 20rpx;
  452. // display: inline-block;
  453. // background-image: url(@/static/images/goods/up.png);
  454. // background-size: cover;
  455. // background-repeat: no-repeat;
  456. // background-position: center;
  457. //方向向下的箭头图片,实际就是实现了点击下箭头后旋转变成上箭头
  458. }
  459. }
  460. }
  461. }
  462. .mainArea {
  463. padding-left: 15rpx;
  464. width: 100%;
  465. display: flex;
  466. justify-content: space-between;
  467. }
  468. .areaList {
  469. flex: 1;
  470. padding: 30rpx 20rpx 0;
  471. background-color: #FFFFFF;
  472. .areaCard {
  473. margin-bottom: 20rpx;
  474. height: 50rpx;
  475. line-height: 50rpx;
  476. font-size: 25rpx;
  477. font-weight: 600;
  478. text-align: center;
  479. border-radius: 25rpx;
  480. }
  481. .areaCardSel {
  482. margin-bottom: 20rpx;
  483. height: 50rpx;
  484. line-height: 50rpx;
  485. font-size: 25rpx;
  486. font-weight: 600;
  487. text-align: center;
  488. border-radius: 25rpx;
  489. background-color: #383838;
  490. color: #FFFFFF;
  491. }
  492. }
  493. .brokerList {
  494. flex: 3;
  495. padding: 28rpx 26rpx 0;
  496. .brokerCard {
  497. margin-bottom: 30rpx;
  498. padding: 24rpx 28rpx;
  499. display: flex;
  500. background-color: #FFFFFF;
  501. border-radius: 12rpx;
  502. .brokerCard-avatar {
  503. width: 170rpx;
  504. height: 170rpx;
  505. position: relative;
  506. display: flex;
  507. justify-content: center;
  508. .brokerCard-avatar-image {
  509. width: 170rpx;
  510. height: 170rpx;
  511. }
  512. .avatar-bg {
  513. width: 160rpx;
  514. height: 40rpx;
  515. position: absolute;
  516. bottom: 10rpx;
  517. background-size: cover;
  518. background-position: 0 1rpx;
  519. font-size: 13rpx;
  520. color: #F9E2AC;
  521. display: flex;
  522. align-items: center;
  523. .avatar-bg-title {
  524. margin-left: 40rpx;
  525. line-height: 40rpx;
  526. overflow: hidden;
  527. text-overflow: ellipsis;
  528. -webkit-line-clamp: 1;
  529. display: -webkit-box;
  530. -webkit-box-orient: vertical;
  531. }
  532. // .avatar-bg-name {
  533. // margin-left: 5rpx;
  534. // line-height: 30rpx;
  535. // }
  536. }
  537. }
  538. .brokerCard-infor {
  539. flex: 1;
  540. margin-left: 28rpx;
  541. height: 170rpx;
  542. display: flex;
  543. flex-direction: column;
  544. justify-content: space-between;
  545. .infor-header {
  546. font-size: 28rpx;
  547. font-weight: 600;
  548. color: #383838;
  549. display: flex;
  550. align-items: center;
  551. justify-content: space-between;
  552. .infor-header-icon {
  553. width: 100rpx;
  554. }
  555. }
  556. .infor-item {
  557. font-size: 22rpx;
  558. font-weight: 400;
  559. color: #747474;
  560. display: flex;
  561. align-items: center;
  562. .infor-item-icon {
  563. margin-right: 20rpx;
  564. width: 22rpx;
  565. }
  566. .infor-item-text {
  567. flex: 1;
  568. overflow: hidden;
  569. text-overflow: ellipsis;
  570. -webkit-line-clamp: 1;
  571. display: -webkit-box;
  572. -webkit-box-orient: vertical;
  573. }
  574. }
  575. }
  576. }
  577. }
  578. </style>