institution_list.html 5.4 KB

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