brokerlist.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  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="搜索经纪人名称或区域" confirm-type="search"></input>
  7. </view>
  8. <view class="action" v-if="searchval!==''">
  9. <button class="cu-btn bg-white shadow-blur round" @click="btnSearch()">搜索</button>
  10. </view>
  11. </view>
  12. <view class="filterbg">
  13. <view class="flex justify-between solids-bottom padding bg-white">
  14. <view class="text-bold">推荐</view>
  15. <view class="flex justify-end">
  16. <view class="cu-tag radius" data-filterbox="area" @tap="showFilter">{{arealist.title}}</view>
  17. </view>
  18. </view>
  19. <view class="filtercon" v-if="filterbox!==null">
  20. <view class="grid margin-bottom text-left col-3 bg-white" v-if="filterbox=='area'">
  21. <view class="solids-right padding-bottom">
  22. <scroll-view scroll-y="true" style="height: 600rpx;">
  23. <view class="solid-bottom text-gray padding-lr-sm padding-tb-sm">选择省</view>
  24. <view class="solid-bottom padding-lr-sm padding-tb-sm" @click="checkArea(4,0)">全部</view>
  25. <block v-for="(item,index) in arealist.data" :key="index">
  26. <view class="solid-bottom padding-lr-sm padding-tb-sm" @click="checkArea(1,index)">{{item.title}}</view>
  27. </block>
  28. </scroll-view>
  29. </view>
  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. <block v-for="(item,index) in arealist.cityarr" :key="index">
  34. <view class="solid-bottom padding-lr-sm padding-tb-sm" @click="checkArea(2,index)">{{item.title}}</view>
  35. </block>
  36. </scroll-view>
  37. </view>
  38. <view class="padding-bottom">
  39. <scroll-view scroll-y="true" style="height: 600rpx;">
  40. <view class="solid-bottom text-gray padding-lr-sm padding-tb-sm">选择区县</view>
  41. <block v-for="(item,index) in arealist.districtarr" :key="index">
  42. <view class="solid-bottom padding-lr-sm padding-tb-sm" @click="checkArea(3,index)">{{item.title}}</view>
  43. </block>
  44. </scroll-view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="bg-white cu-list menu-avatar">
  50. <block v-for="(item,index) in plist" :key="index">
  51. <view class="cu-item" style="border-bottom: 0rpx !important; border-top: 0rpx !important;">
  52. <view class="cu-avatar round lg" :style="'background-image:url('+(item.muser.avatar ? item.muser.avatar : $getImageUrl('static/images/applet/dfhead.jpg'))+');'"></view>
  53. <view class="content" :data-index="index" @tap="showModal">
  54. <view class="text-cut text-bold">{{item.title}}</view>
  55. </view>
  56. <view class="action">
  57. <button class="cu-btn bg-blue cuIcon" :data-telephone="item.mobile" @tap="makeTelephone">
  58. <text class="cuIcon-dianhua"></text>
  59. </button>
  60. </view>
  61. </view>
  62. <view class="itembox" :data-index="index" @tap="showModal">
  63. <view class="itembox-til">服务区域:</view>
  64. <view class="itembox-con text-gray">{{item.province}} - {{item.city}} - {{item.district}}</view>
  65. </view>
  66. <view class="itembox" :data-index="index" @tap="showModal">
  67. <view class="itembox-til">镇/村:</view>
  68. <view class="itembox-con text-gray">{{item.town}} - {{item.village}}</view>
  69. </view>
  70. <view class="itembox solids-bottom" style="padding-bottom: 30rpx;" :data-index="index" @tap="showModal">
  71. <view class="itembox-til">区域:</view>
  72. <view class="itembox-con text-gray" style="height: 75rpx; overflow: hidden;">
  73. <text>{{item.region}}</text>
  74. </view>
  75. </view>
  76. <view class="itembox solids-bottom" style="padding-bottom: 30rpx;" :data-index="index" @tap="showModal">
  77. <view class="itembox-til">基本介绍:</view>
  78. <view class="itembox-con text-gray" style="height: 75rpx; overflow: hidden;">
  79. <text>{{item.details}}</text>
  80. </view>
  81. </view>
  82. </block>
  83. </view>
  84. <uni-load-more :status="pstatus"></uni-load-more>
  85. <view class="cu-modal bottom-modal" :class="modal.name=='detailsbox'?'show':''">
  86. <view class="cu-dialog">
  87. <view class="cu-bar bg-white">
  88. <view class="action text-green">确定</view>
  89. <view class="action text-blue" @tap="hideModal">取消</view>
  90. </view>
  91. <view class="padding-tb">
  92. <scroll-view scroll-y="true" style="height: 800rpx;">
  93. <view class="itembox text-left">
  94. <view class="itembox-til text-right">姓名:</view>
  95. <view class="itembox-con text-gray">{{modal.brokerinfo.title}}</view>
  96. </view>
  97. <view class="itembox text-left">
  98. <view class="itembox-til text-right">手机号:</view>
  99. <view class="itembox-con text-gray">{{modal.brokerinfo.mobile}}</view>
  100. </view>
  101. <view class="itembox text-left">
  102. <view class="itembox-til text-right">微信号:</view>
  103. <view class="itembox-con text-gray">{{modal.brokerinfo.weixin}}</view>
  104. </view>
  105. <view class="itembox text-left">
  106. <view class="itembox-til text-right">QQ号:</view>
  107. <view class="itembox-con text-gray">{{modal.brokerinfo.qq}}</view>
  108. </view>
  109. <view class="itembox text-left">
  110. <view class="itembox-til text-right">服务区域:</view>
  111. <view class="itembox-con text-gray">{{modal.brokerinfo.province}} - {{modal.brokerinfo.city}}</view>
  112. </view>
  113. <view class="itembox text-left" style="padding-bottom: 30rpx;" :data-index="index" @tap="showModal">
  114. <view class="itembox-til text-right">基本介绍:</view>
  115. <view class="itembox-con text-gray">
  116. <text>{{modal.brokerinfo.details}}</text>
  117. </view>
  118. </view>
  119. </scroll-view>
  120. </view>
  121. </view>
  122. </view>
  123. <view class="padding-sm"></view>
  124. <view class="padding-xl"></view>
  125. <view class="cu-bar tabbar bg-white foot">
  126. <view class="action text-gray" @tap="goNavPage('/pages/index/index')">
  127. <view class="cuIcon-cu-image">
  128. <image src="../../static/tabbar/index.png"></image>
  129. </view>
  130. 首页
  131. </view>
  132. <view class="action text-gray" @tap="goNavPage('/pages/comjobs/comjobs')">
  133. <view class="cuIcon-cu-image">
  134. <image src="../../static/tabbar/jobs.png"></image>
  135. </view>
  136. 招聘
  137. </view>
  138. <!-- #ifndef MP-WEIXIN -->
  139. <view class="action text-gray videoimg" @tap="goNavPage('/pages/video/videolist')">
  140. <view class="cuIcon-cu-image">
  141. <image src="../../static/tabbar/video.png"></image>
  142. </view>
  143. 微工作
  144. </view>
  145. <!-- #endif -->
  146. <view class="action text-blue" @tap="goNavPage('/pages/broker/brokerlist')">
  147. <view class="cuIcon-cu-image">
  148. <image src="../../static/tabbar/brokerSelected.png"></image>
  149. </view>
  150. 经纪人
  151. </view>
  152. <view class="action text-gray" @tap="goNavPage('/pages/my/my')">
  153. <view class="cuIcon-cu-image">
  154. <image src="../../static/tabbar/my.png"></image>
  155. </view>
  156. 我的
  157. </view>
  158. </view>
  159. </view>
  160. </template>
  161. <script>
  162. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  163. var _this;
  164. export default {
  165. components: {
  166. uniLoadMore
  167. },
  168. data() {
  169. return {
  170. filterbox: null,
  171. arealist: {
  172. title: "区域",
  173. value: "",
  174. cityarr: [],
  175. districtarr: [],
  176. data: []
  177. },
  178. pstatus: 'more',
  179. ppage: 1,
  180. psize: 20,
  181. plist: [],
  182. searchval: "",
  183. modal: {
  184. name: null,
  185. brokerinfo: {}
  186. }
  187. };
  188. },
  189. onLoad: function(){
  190. _this = this;
  191. _this.arealist.data = require('@/common/area.json');
  192. _this.getMore();
  193. },
  194. onPullDownRefresh: function() {
  195. _this.pageRefresh();
  196. },
  197. onReachBottom: function() {
  198. if (_this.pstatus !== 'more') {
  199. return;
  200. }
  201. _this.getMore();
  202. },
  203. onShareAppMessage: function(res) {
  204. return {
  205. title: "经纪人列表",
  206. path: "/pages/broker/brokerlist"
  207. }
  208. },
  209. methods: {
  210. showFilter: function(e) {
  211. var nowfilterbox = e.currentTarget.dataset.filterbox;
  212. if (_this.filterbox == nowfilterbox){
  213. _this.filterbox = null;
  214. }else{
  215. _this.filterbox = nowfilterbox;
  216. }
  217. uni.pageScrollTo({
  218. scrollTop: 0,
  219. duration: 300
  220. });
  221. },
  222. checkArea: function(level, index) {
  223. if (level==1){
  224. _this.arealist.cityarr = _this.arealist.data[index].children;
  225. _this.arealist.districtarr = [];
  226. }else if (level==2){
  227. _this.arealist.districtarr = _this.arealist.cityarr[index].children;
  228. }else if (level==3){
  229. _this.arealist.title = _this.arealist.districtarr[index].title;
  230. _this.arealist.value = _this.arealist.districtarr[index].title;
  231. _this.filterbox = null;
  232. _this.pageRefresh();
  233. }else if (level==4){
  234. _this.arealist.cityarr = [];
  235. _this.arealist.districtarr = [];
  236. _this.arealist.title = "全部";
  237. _this.arealist.value = "";
  238. _this.filterbox = null;
  239. _this.pageRefresh();
  240. }
  241. },
  242. // 搜索
  243. bindInput: function(e) {
  244. _this.searchval = e.detail.value;
  245. },
  246. btnSearch: function() {
  247. if (_this.searchval == "") {
  248. uni.showModal({
  249. title: '信息提示',
  250. content: "请输入要搜索的关键字...",
  251. showCancel: false
  252. });
  253. return false;
  254. }
  255. _this.pageRefresh();
  256. },
  257. pageRefresh: function() {
  258. _this.pstatus = 'more';
  259. _this.ppage = 1;
  260. _this.plist = [];
  261. _this.getMore();
  262. },
  263. getMore: function() {
  264. _this.$req.ajax({
  265. path: "broker/getlistbroker",
  266. data: {
  267. ppage: _this.ppage,
  268. psize: _this.psize,
  269. searchval: _this.searchval,
  270. district: _this.arealist.value
  271. }
  272. }).then((data) => {
  273. _this.pstatus = data.pstatus;
  274. _this.plist = _this.plist.concat(data.plist);
  275. _this.ppage += 1;
  276. uni.stopPullDownRefresh();
  277. }).catch((err) => {
  278. uni.showModal({
  279. title: '信息提示',
  280. content: err,
  281. showCancel: false
  282. });
  283. });
  284. },
  285. showModal: function(e) {
  286. var index = e.currentTarget.dataset.index;
  287. _this.modal.name = "detailsbox";
  288. _this.modal.brokerinfo = _this.plist[index];
  289. },
  290. hideModal: function(e) {
  291. _this.modal.name = null;
  292. },
  293. // 咨询电话
  294. makeTelephone: function(e) {
  295. var telephone = e.currentTarget.dataset.telephone;
  296. uni.makePhoneCall({
  297. phoneNumber: telephone
  298. });
  299. },
  300. goNavPage: function(pageurl) {
  301. uni.redirectTo({
  302. url: pageurl
  303. });
  304. },
  305. goDetail: function(agentid) {
  306. uni.navigateTo({
  307. url: '/pages/agent/detail?agentid=' + agentid
  308. });
  309. }
  310. }
  311. }
  312. </script>
  313. <style>
  314. .echo-agent-list .echo-item .echo-tilpic {
  315. width: 120rpx;
  316. height: 120rpx;
  317. }
  318. .echo-agent-list .echo-item .echo-content{
  319. width: 550rpx;
  320. }
  321. .cu-item:after{
  322. border: 0rpx !important;
  323. }
  324. .itembox{ padding: 10rpx 30rpx; width: 100%; display: flex; justify-content: start;}
  325. .itembox-til{ width: 160rpx; }
  326. .itembox-con{ width: 530rpx; }
  327. </style>