institution_list.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. {extend name="public/base_human"/}
  2. {block name="css"}
  3. <style>
  4. .lw-list {width:90%;margin:0 auto;}
  5. .lw-item {background: #fff;box-shadow: 0 4px 8px 1px rgba(0,0,0,.03);border-radius: 6px;padding: 13px 8px;margin-top:10px;}
  6. .lw-item .title {display: flex;flex-direction: row;align-items: center;font-size:16px;font-weight: bold;}
  7. .lw-item .tel {font-size:14px;margin-top:10px;border-bottom:1px solid #ddd;padding-bottom: 10px;}
  8. .lw-item .join {display: flex;flex-direction: row;align-items: center;color:#777;font-size:14px;margin-top:10px;}
  9. .lw-item .join .flex-1{flex:1;}
  10. .lw-item .join .mobile{display: flex;flex-direction: row;align-items: center;}
  11. .lw-item .address {color:#777;font-size:14px;margin-top:10px;}
  12. .lw-item .tags {margin-top:10px;}
  13. .lw-item .tags .van-tag{margin-right:5px;}
  14. </style>
  15. {/block}
  16. {block name="body"}
  17. <van-sticky>
  18. <van-nav-bar
  19. class="nav-theme"
  20. :fixed="true"
  21. :placeholder="true"
  22. >
  23. <template #title>
  24. <span class="text-white">机构列表</span>
  25. </template>
  26. </van-nav-bar>
  27. <van-search v-model="keyword" placeholder="请输入机构名称" @search="onRefresh"></van-search>
  28. <van-dropdown-menu >
  29. <van-dropdown-item v-model="cooperate" :options="cooperate_list" @change="onRefresh"></van-dropdown-item>
  30. </van-dropdown-menu>
  31. </van-sticky>
  32. <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
  33. <van-list
  34. v-model:loading="loading"
  35. :finished="finished"
  36. finished-text="没有更多了"
  37. @load="onList"
  38. >
  39. <div class="lw-list">
  40. <div class="lw-item" v-for="item in list" @click="toDetail(item.id)">
  41. <div class="title">
  42. <div style="width: 6px; height: 6px; background: #dd4250; border-radius: 50%; margin-right: 11px;"><span></span></div>
  43. <div>{{item.name}}</div>
  44. </div>
  45. <div class="tel" @click.stop="call(item.tel)">
  46. <van-icon name="phone" color=" #dd4250"></van-icon>
  47. {{item.tel}}
  48. </div>
  49. <div class="tags">
  50. <van-tag type="primary" v-for="tag in item.cooperate" size="medium">{{tag}}</van-tag>
  51. </div>
  52. <div class="join" v-if="item.join">
  53. <div class="flex-1">参会人:{{item.join}}</div>
  54. <div class="flex-1 mobile" v-if="item.join_mobile" @click.stop="call(item.join_mobile)">
  55. <van-icon name="phone" color=" #dd4250"></van-icon>
  56. {{item.join_mobile}}
  57. </div>
  58. </div>
  59. <div class="address">
  60. 机构地址:{{item.address}}
  61. </div>
  62. </div>
  63. </div>
  64. </van-list>
  65. </van-pull-refresh>
  66. <div style="width:100%;height:50px;"></div>
  67. <van-tabbar v-model="active">
  68. <van-tabbar-item icon="home-o" @click="toEnterprise">企业列表</van-tabbar-item>
  69. <van-tabbar-item icon="friends-o">机构列表</van-tabbar-item>
  70. <van-tabbar-item icon="manager-o" @click="toCenter">服务中心</van-tabbar-item>
  71. </van-tabbar>
  72. {/block}
  73. {block name="script"}
  74. <script>
  75. function v_setup() {
  76. let base = {};
  77. base.active = Vue.ref(1);
  78. //搜索
  79. base.keyword = Vue.ref('');
  80. base.cooperate = Vue.ref('');
  81. base.cooperate_list = Vue.reactive({$cooperate_list});
  82. //列表
  83. base.page = Vue.ref(1);
  84. base.loading = Vue.ref(false);
  85. base.finished = Vue.ref(false);
  86. base.refreshing = Vue.ref(false);
  87. base.list = Vue.reactive([]);
  88. base.onList = () => {
  89. let param = {};
  90. param.page = base.page.value;
  91. param.name = base.keyword.value;
  92. param.cooperate = base.cooperate.value;
  93. base.page.value++;
  94. postJson("human/listInstitution", param).then( ({data}) => {
  95. base.loading.value = false;
  96. if (base.refreshing.value) base.refreshing.value = false;
  97. if (data.length === 0) {
  98. base.finished.value = true;
  99. } else {
  100. base.list.push(...data);
  101. }
  102. });
  103. };
  104. base.onRefresh = () => {
  105. base.list = Vue.reactive([]);
  106. base.page.value = 1;
  107. base.loading.value = true;
  108. base.finished.value = false;
  109. base.onList();
  110. };
  111. base.call = (tel) => {
  112. location.href = "tel://" + tel;
  113. };
  114. base.toDetail = (id) => {
  115. location.href = "{:url('human/institutionDetail')}?id=" + id;
  116. };
  117. base.toEnterprise = () => {
  118. location.href = "{:url('human/enterpriseList')}";
  119. };
  120. base.toCenter = () => {
  121. location.href = "{:url('human/center')}";
  122. };
  123. return base;
  124. }
  125. </script>
  126. {/block}