search.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. <template>
  2. <view class="search">
  3. <view class="top" v-if="is_show">
  4. <text class="warning">以下条件至少填写一个!</text>
  5. <view class="item">
  6. <text>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</text>
  7. <u-input class="input" v-model="form.name" type="text" />
  8. </view>
  9. <view class="item" @click="is_sex=!is_sex">
  10. <text>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别</text>
  11. <view class="choose">
  12. {{form.sex == '' || form.sex == undefined? '请选择':form.sex ==1?'男':form.sex == 2?'女':'请选择'}}
  13. </view>
  14. </view>
  15. <u-picker v-model="is_sex" mode="selector" :range="sex_type" @confirm="choose_sex"></u-picker>
  16. <view class="item">
  17. <text>硕士单位</text>
  18. <u-input class="input" v-model="form.master_units" type="text" />
  19. </view>
  20. <view class="item">
  21. <text>工作地址</text>
  22. <u-input class="input" v-model="form.work_address" type="text" />
  23. </view>
  24. <!-- <u-picker v-model="is_school" mode="selector" :range="school_type" @confirm="choose_school"></u-picker> -->
  25. <view class="btn_wrap btn_wrap1">
  26. <view class="btn" @click="search">
  27. 搜索
  28. </view>
  29. </view>
  30. </view>
  31. <view class="people_wrap" v-if="!is_show">
  32. <view class="people">
  33. <view class="empty" v-if="people_list.length == 0" >
  34. <u-empty text="没有内容哦!" mode="list"></u-empty>
  35. </view>
  36. <view class="people_list" v-for="(item,index) in people_list" :key="index" @click="detail(item)">
  37. <view class="img">
  38. <image :src="item.headimg ? item.headimg : '../../static/images/avater.jpg'"
  39. mode=""></image>
  40. </view>
  41. <view class="right">
  42. <text>{{item.name}}</text>
  43. <view class="label">
  44. <text class="sex">{{item.sex_text}}</text>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="btn_wrap" >
  50. <view class="btn" @click="re_search">
  51. 重新搜索
  52. </view>
  53. </view>
  54. <u-popup v-model="is_detail" mode="center" border-radius="42" width="85%" @close="close">
  55. <view class="student-show">
  56. <view class="stu-title">
  57. 校友基本信息
  58. </view>
  59. <view class="stu-mess">
  60. <image :src="stu_detail.headimg ? stu_detail.headimg : '../../static/images/avator.png'" mode="">
  61. </image>
  62. <view class="right">
  63. <view class="stu-text">
  64. 姓名:{{stu_detail.name}}
  65. </view>
  66. <view class="stu-text">
  67. 性别:{{stu_detail.sex ? stu_detail.sex == 1?'男':'女' :'未知'}}
  68. </view>
  69. <view class="stu-text">
  70. 学号:{{stu_detail.account}}
  71. </view>
  72. <view class="stu-text">
  73. 手机号:{{stu_detail.mobile ? stu_detail.mobile :'--'}}
  74. </view>
  75. </view>
  76. </view>
  77. <view class="stu-text1">
  78. 硕士单位:{{stu_detail.master_units ? stu_detail.master_units : '--'}}
  79. </view>
  80. <view class="stu-text1">
  81. 现工作单位:{{stu_detail.work_units ? stu_detail.work_units : '--'}}
  82. </view>
  83. </view>
  84. </u-popup>
  85. </view>
  86. </view>
  87. </template>
  88. <script>
  89. export default{
  90. data(){
  91. return{
  92. form:{
  93. page:1,
  94. },
  95. people_list:[
  96. {
  97. name:'丽丽',
  98. headimg:'../../static/images/avater.jpg',
  99. sex_text:'女'
  100. },
  101. {
  102. name:'丽丽',
  103. headimg:'../../static/images/avater.jpg',
  104. sex_text:'女'
  105. }
  106. ],
  107. is_sex:false,
  108. sex_type:['请选择','男','女'],
  109. // school_type:['河南中医药大学'],
  110. // is_school:false,
  111. last:false,
  112. is_show:true,
  113. is_detail:false,
  114. stu_detail:{}
  115. }
  116. },
  117. onLoad() {
  118. this.form.page = 1
  119. this.people_list = []
  120. this.last = false
  121. },
  122. onReachBottom() {
  123. console.log(this.last, 'lasts')
  124. if (!this.last) {
  125. this.form.page++
  126. }
  127. console.log(this.form.page)
  128. this.getPeople()
  129. },
  130. methods:{
  131. choose_sex(e){
  132. console.log(e)
  133. this.form.sex = e
  134. },
  135. choose_school(e){
  136. console.log(e)
  137. this.form.school = this.school_type[e]
  138. },
  139. search(){
  140. console.log(this.form,'form')
  141. if(this.form.name||this.form.sex||this.form.school||this.form.work_address){
  142. this.people_list = []
  143. this.getPeople()
  144. this.is_show = false
  145. }else{
  146. uni.showToast({
  147. title:'请输入查找条件',
  148. icon:'none'
  149. })
  150. }
  151. },
  152. re_search(){
  153. this.is_show = true
  154. this.form = {page:1}
  155. },
  156. getPeople() {
  157. this.$u.get('/page/organization-people',this.form).then(res => {
  158. console.log(res, '成员')
  159. let data = res.data.data
  160. if (this.form.page > 1 && data.length == 0) {
  161. uni.showToast({
  162. title: '暂无更多',
  163. icon: 'none'
  164. })
  165. this.last = true
  166. } else {
  167. this.people_list = this.people_list.concat(data)
  168. }
  169. })
  170. },
  171. detail(item){
  172. console.log(item,'item')
  173. this.is_detail = true
  174. this.stu_detail = item
  175. },
  176. close() {
  177. this.stu_detail = {}
  178. },
  179. }
  180. }
  181. </script>
  182. <style lang="scss">
  183. page{
  184. background-color: #f1f1f1 !important;
  185. // padding: 16px 0;
  186. // background-color: #fff;
  187. }
  188. .search{
  189. .top{
  190. background-color: #fff;
  191. padding: 0 16px;
  192. .warning{
  193. display: block;
  194. width: 100%;
  195. text-align: center;
  196. color: #CD5C5C;
  197. padding-top: 10px;
  198. }
  199. .item{
  200. display: flex;
  201. align-items: center;
  202. height: 50px;
  203. border-bottom: 1px solid #eee;
  204. &:last-child{
  205. border-bottom: none;
  206. }
  207. text{
  208. font-size: 16px;
  209. margin-right: 10px;
  210. }
  211. ::v-deep .input{
  212. .u-input__input{
  213. color: #C0C4CC !important;
  214. }
  215. }
  216. .choose{
  217. color: #C0C4CC;
  218. }
  219. }
  220. .btn_wrap{
  221. text-align: center;
  222. margin-top: 20px;
  223. }
  224. .btn_wrap1{
  225. padding-bottom: 20px;
  226. }
  227. .btn{
  228. display: inline-block;
  229. width: 200px;
  230. height: 40px;
  231. line-height: 40px;
  232. border-radius: 20px;
  233. text-align: center;
  234. font-size: 18px;
  235. font-weight: bold;
  236. color: #fff;
  237. background-color: rgba($color: #84705E, $alpha: 0.8);
  238. }
  239. }
  240. .people_wrap{
  241. padding-bottom: 40px;
  242. .people {
  243. padding:0 10px;
  244. &:first-child {
  245. margin-top: 20px;
  246. }
  247. .empty{
  248. height: 80vh;
  249. }
  250. .people_list {
  251. height: 79px;
  252. background: #FFFFFF;
  253. box-shadow: 0px 8px 12px rgba(12, 20, 61, 0.12);
  254. border-radius: 10px;
  255. display: flex;
  256. align-items: center;
  257. margin-bottom: 10px;
  258. .img {
  259. width: 55px;
  260. height: 55px;
  261. border-radius: 50%;
  262. overflow: hidden;
  263. margin: 0 8px 0 20px;
  264. image {
  265. width: 55px;
  266. height: 55px;
  267. }
  268. }
  269. .right {
  270. text {
  271. font-size: 15px;
  272. font-family: Graphit;
  273. font-weight: 500;
  274. color: #282828;
  275. }
  276. .label {
  277. margin-top: 8px;
  278. text {
  279. display: inline-block;
  280. width: 44px;
  281. height: 18px;
  282. line-height: 18px;
  283. text-align: center;
  284. background: #E7E2DD;
  285. border-radius: 9px;
  286. font-size: 12px;
  287. font-family: PingFang HK;
  288. font-weight: 400;
  289. color: #674023;
  290. margin-right: 8px;
  291. }
  292. }
  293. }
  294. }
  295. }
  296. .btn_wrap{
  297. position: fixed;
  298. bottom: 0px;
  299. width: 100%;
  300. }
  301. .btn{
  302. display: inline-block;
  303. // width: 160px;
  304. width: 100%;
  305. height: 40px;
  306. line-height: 40px;
  307. // border-radius: 20px;
  308. text-align: center;
  309. font-size: 18px;
  310. font-weight: bold;
  311. color: #fff;
  312. background-color: rgba($color: #84705E, $alpha: 1);
  313. }
  314. }
  315. //查看学生信息弹框
  316. .student-show {
  317. padding-bottom: 15px;
  318. .stu-title {
  319. font-size: 20px;
  320. font-family: PingFang SC;
  321. font-weight: bold;
  322. line-height: 20px;
  323. color: #282828;
  324. opacity: 1;
  325. text-align: center;
  326. padding: 20px 0 20px;
  327. }
  328. .stu-mess {
  329. display: flex;
  330. padding: 0 22px;
  331. image {
  332. height: 75px;
  333. width: 75px;
  334. margin-right: 14px;
  335. border-radius: 9px;
  336. }
  337. .right {
  338. flex: 1;
  339. .stu-text {
  340. font-size: 13px;
  341. font-family: PingFang SC;
  342. font-weight: 400;
  343. line-height: 20px;
  344. color: #282828;
  345. overflow: hidden;
  346. display: -webkit-box; //将对象作为弹性伸缩盒子模型显示;
  347. text-overflow: ellipsis; //溢出部分用省略号代替
  348. -webkit-line-clamp: 2; //设置文本显示两行
  349. -webkit-box-orient: vertical; //从上到下排列子元素;
  350. white-space: normal;
  351. }
  352. }
  353. }
  354. .stu-text1{
  355. padding: 0 20px;
  356. font-size: 13px;
  357. font-family: PingFang SC;
  358. font-weight: 400;
  359. line-height: 20px;
  360. color: #282828;
  361. margin-top: 10px;
  362. // line-height: 36px;
  363. }
  364. .e-mail {
  365. margin: 10px 22px 0px;
  366. height: 36px;
  367. line-height: 36px;
  368. font-size: 14px;
  369. font-family: PingFang SC;
  370. font-weight: bold;
  371. color: rgba(40, 40, 40, .78);
  372. border-bottom: 1px solid rgba(112, 112, 112, .06);
  373. }
  374. .remark-title {
  375. margin: 10px 22px 0px;
  376. padding: 5px;
  377. font-size: 13px;
  378. font-family: PingFang SC;
  379. font-weight: bold;
  380. line-height: 20px;
  381. color: #282828;
  382. opacity: 0.61;
  383. }
  384. .remark {
  385. margin: 0px 22px 22px;
  386. font-size: 12px;
  387. font-family: PingFang SC;
  388. font-weight: 400;
  389. line-height: 20px;
  390. color: #282828;
  391. opacity: 0.54;
  392. padding: 5px;
  393. overflow: hidden;
  394. display: -webkit-box; //将对象作为弹性伸缩盒子模型显示;
  395. text-overflow: ellipsis; //溢出部分用省略号代替
  396. -webkit-line-clamp: 3; //设置文本显示两行
  397. -webkit-box-orient: vertical; //从上到下排列子元素;
  398. white-space: normal;
  399. // border-bottom: 1px solid rgba(112, 112, 112, .06);
  400. }
  401. }
  402. }
  403. </style>