people.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <extend name="public@base"/>
  2. <block name="css">
  3. <link rel="stylesheet" href="__TMPL__/public/assets/css/userwall.css">
  4. <style>
  5. #app{
  6. padding-bottom:50px;
  7. }
  8. </style>
  9. </block>
  10. <block name="body">
  11. <van-nav-bar
  12. @click-right="onClickRight"
  13. left-text="返回"
  14. left-arrow
  15. @click-left="onBack"
  16. style="position: fixed;top: 0;width: 100%;z-index: 100;"
  17. >
  18. <template #title>
  19. <span>嘉宾</span>
  20. </template>
  21. <template #right>
  22. <span>筛选</span>
  23. </template>
  24. </van-nav-bar>
  25. <div style="position: fixed;top: 46px;width: 100%;z-index: 100;background:white;box-sizing:border-box;padding:5px 10px;">
  26. <van-search v-model="form.id" placeholder="请输入嘉宾编号" @search="onRefresh"></van-search>
  27. </div>
  28. <van-popup v-model="show" position="right" :style="{width: '80%',height: '100%'}">
  29. <div class="search_wrapper">
  30. <p class="search_title">是否到场</p>
  31. <van-row :gutter="10">
  32. <van-col span="8" v-for="(item) in site_status_option">
  33. <div :class="{btn_search_item:true,active:item.value == form.site_status}"
  34. @click="selectOption('site_status',item.value)">
  35. {{item.text}}
  36. <van-icon v-if="item.value == form.site_status"
  37. class="iconfont icon-gouxuan-youxiajiaogouxuan btn_search_icon text-pink"></van-icon>
  38. </div>
  39. </van-col>
  40. </van-row>
  41. <p class="search_title">性别</p>
  42. <van-row :gutter="10">
  43. <van-col span="8" v-for="(item) in sex_option">
  44. <div :class="{btn_search_item:true,active:item.value == form.sex}"
  45. @click="selectOption('sex',item.value)">
  46. {{item.text}}
  47. <van-icon v-if="item.value == form.sex"
  48. class="iconfont icon-gouxuan-youxiajiaogouxuan btn_search_icon text-pink"></van-icon>
  49. </div>
  50. </van-col>
  51. </van-row>
  52. <p class="search_title">年龄</p>
  53. <van-row :gutter="10">
  54. <van-col span="8" v-for="(item) in age_option">
  55. <div :class="{btn_search_item:true,active:item.value == form.age}"
  56. @click="selectOption('age',item.value)">
  57. {{item.text}}
  58. <van-icon v-if="item.value == form.age"
  59. class="iconfont icon-gouxuan-youxiajiaogouxuan btn_search_icon text-pink"></van-icon>
  60. </div>
  61. </van-col>
  62. </van-row>
  63. <p class="search_title">身高</p>
  64. <van-row :gutter="10">
  65. <van-col span="8" v-for="(item) in high_option">
  66. <div :class="{btn_search_item:true,active:item.value == form.high}"
  67. @click="selectOption('high',item.value)">
  68. {{item.text}}
  69. <van-icon v-if="item.value == form.high"
  70. class="iconfont icon-gouxuan-youxiajiaogouxuan btn_search_icon text-pink"></van-icon>
  71. </div>
  72. </van-col>
  73. </van-row>
  74. <p class="search_title">体重</p>
  75. <van-row :gutter="10">
  76. <van-col span="8" v-for="(item) in weight_option">
  77. <div :class="{btn_search_item:true,active:item.value == form.weight}"
  78. @click="selectOption('weight',item.value)">
  79. {{item.text}}
  80. <van-icon v-if="item.value == form.weight"
  81. class="iconfont icon-gouxuan-youxiajiaogouxuan btn_search_icon text-pink"></van-icon>
  82. </div>
  83. </van-col>
  84. </van-row>
  85. <p class="search_title">学历</p>
  86. <van-row :gutter="10">
  87. <van-col span="8" v-for="(item) in education_option">
  88. <div :class="{btn_search_item:true,active:item.value == form.education}"
  89. @click="selectOption('education',item.value)">
  90. {{item.text}}
  91. <van-icon v-if="item.value == form.education"
  92. class="iconfont icon-gouxuan-youxiajiaogouxuan btn_search_icon text-pink"></van-icon>
  93. </div>
  94. </van-col>
  95. </van-row>
  96. </div>
  97. <div class="search_wrapper_btnbox">
  98. <van-button round @click="searchReset" style="width: 40%;height: 40px;line-height: 40px;" class="btn_reset">
  99. 重置
  100. </van-button>
  101. <van-button round style="width: 40%;height: 40px;line-height: 40px;" class="bg-pink"
  102. @click="show=false;onRefresh()">搜索
  103. </van-button>
  104. </div>
  105. </van-popup>
  106. <!--列表-->
  107. <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
  108. <van-list
  109. v-model="loading"
  110. :finished="finished"
  111. finished-text="没有更多了"
  112. @load="onLoad"
  113. >
  114. <div class="masonry">
  115. <div class="item" v-for="(item) in list">
  116. <div class="item__content">
  117. <a :href="'{:url('love/userwall/detail')}?id=' + item.id">
  118. <div class="box">
  119. <img class="image"
  120. :src="item.main_image_thumb ? item.main_image_thumb : '__TMPL__/public/assets/images/userwall/no_image_thumb.png'"/>
  121. <div class="info">
  122. <h3 class="user_name">
  123. <span class="inline_block">
  124. <van-icon
  125. :class="[item.sex == 1 ? 'icon-xingbie-nan text-blue' : 'icon-xingbie-nv text-pink','iconfont']"></van-icon>
  126. {{item.realname}}{{item.user_no}}<span v-if="item.user_no">({{item.user_no}})</span>
  127. </span>
  128. </h3>
  129. <div class="describe">
  130. <van-tag type="primary" v-if="item.site_status == 1">到场</van-tag>
  131. <van-tag v-if="item.site_status == 2">未到场</van-tag>
  132. </div>
  133. <div class="describe">
  134. {{item.age}}岁
  135. · {{item.education}}
  136. · {{item.high}}CM
  137. </div>
  138. <div class="detail">
  139. {{item.signature}}
  140. </div>
  141. </div>
  142. </div>
  143. </a>
  144. </div>
  145. </div>
  146. </div>
  147. </van-list>
  148. </van-pull-refresh>
  149. </block>
  150. <block name="script">
  151. <script>
  152. new Vue({
  153. el: '#app',
  154. data() {
  155. return {
  156. age_option: [
  157. {text: '不限年龄', value: 0},
  158. {text: '18-25岁', value: 1},
  159. {text: '26-30岁', value: 2},
  160. {text: '31-40岁', value: 3},
  161. {text: '41-50岁', value: 4},
  162. {text: '50岁以上', value: 5},
  163. ],
  164. sort_option: [
  165. {text: '默认排序', value: 'star desc'},
  166. {text: '最新注册', value: 'create_time desc'},
  167. {text: '最新登录', value: 'last_login_time desc'},
  168. ],
  169. site_status_option: [
  170. {text: '不限', value: 0},
  171. {text: '到场', value: 1},
  172. {text: '未到场', value: 2},
  173. ],
  174. sex_option: [
  175. {text: '不限', value: 0},
  176. {text: '男嘉宾', value: 1},
  177. {text: '女嘉宾', value: 2},
  178. ],
  179. high_option: [
  180. {text: '不限', value: 0},
  181. {text: '150-160CM', value: 1},
  182. {text: '161-170CM', value: 2},
  183. {text: '171-180CM', value: 3},
  184. {text: '180CM以上', value: 4},
  185. ],
  186. weight_option: [
  187. {text: '不限', value: 0},
  188. {text: '40-50KG', value: 1},
  189. {text: '51-60KG', value: 2},
  190. {text: '61-70KG', value: 3},
  191. {text: '71-80KG', value: 4},
  192. {text: '80KG以上', value: 5},
  193. ],
  194. education_option: [
  195. {text: '不限', value: ''},
  196. {text: '本科以下', value: '本科以下'},
  197. {text: '本科', value: '本科'},
  198. {text: '硕士', value: '硕士'},
  199. {text: '博士', value: '博士'},
  200. ],
  201. form: {
  202. age: 0,
  203. sort: 'star desc',
  204. id: '',
  205. site_status: 0,
  206. sex: 0,
  207. high: 0,
  208. weight: 0,
  209. education: '',
  210. active_id:{$id},
  211. },
  212. show: false,
  213. page: 2,
  214. loading: false,
  215. finished: false,
  216. refreshing: false,
  217. list: {$list},
  218. };
  219. },
  220. methods: {
  221. onBack() {
  222. history.back();
  223. },
  224. //筛选
  225. onClickRight() {
  226. this.show = true;
  227. },
  228. onAgeChange(value) {
  229. this.form.age = value;
  230. this.onRefresh();
  231. },
  232. onSortChange(value) {
  233. this.form.sort = value;
  234. this.onRefresh();
  235. },
  236. selectOption(key, value) {
  237. this.form[key] = value;
  238. },
  239. searchReset() {
  240. this.form = {
  241. age: 0,
  242. sort: 'star desc',
  243. id: '',
  244. site_status: 0,
  245. sex: 0,
  246. high: 0,
  247. weight: 0,
  248. marry: 0,
  249. education: 0,
  250. active_id:{$id},
  251. };
  252. this.show = false;
  253. this.onRefresh();
  254. },
  255. //加载
  256. onLoad() {
  257. //参数
  258. let self = this;
  259. let param = this.form;
  260. param.page = this.page;
  261. this.page++;
  262. $.post("{:url('peopleList')}", this.form, function (json) {
  263. //下拉刷新
  264. if (self.refreshing) {
  265. self.refreshing = false;
  266. }
  267. // 加载状态结束
  268. self.loading = false;
  269. if (json.data.length == 0) {
  270. // 数据全部加载完成
  271. self.finished = true;
  272. } else {
  273. // 增加数据
  274. for (let i = 0; i < json.data.length; i++) {
  275. self.list.push(json.data[i]);
  276. }
  277. }
  278. }, 'json');
  279. },
  280. onRefresh() {
  281. // 清空列表数据
  282. this.list = [];
  283. this.page = 1;
  284. this.loading = true;
  285. this.finished = false;
  286. this.onLoad();
  287. },
  288. tabbarChange() {
  289. return false;
  290. },
  291. },
  292. });
  293. </script>
  294. </block>