brokerlist.vue 15 KB

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