record.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. <template>
  2. <view class="record">
  3. <u-popup v-model="stu_show" mode="center" border-radius="42" width="85%">
  4. <view class="student-show">
  5. <view class="stu-title">
  6. 学生基本信息
  7. </view>
  8. <view class="stu-mess">
  9. <image :src="stu_detail.headimg ? stu_detail.headimg : '../../static/images/avator.png'" mode="">
  10. </image>
  11. <view class="right">
  12. <view class="stu-text">
  13. 姓名:{{stu_detail.truename}}
  14. </view>
  15. <view class="stu-text">
  16. 学号:{{stu_detail.account}}
  17. </view>
  18. <view class="stu-text">
  19. 班级:{{stu_detail.class ? stu_detail.class :'--'}}
  20. </view>
  21. <view class="stu-text">
  22. 手机号:{{stu_detail.mobile ? stu_detail.mobile :'--'}}
  23. </view>
  24. </view>
  25. </view>
  26. <view class="e-mail">
  27. <u-icon name="email"></u-icon>{{stu_detail.email ? stu_detail.email :'--'}}
  28. </view>
  29. <view class="remark-title">
  30. {{stu_detail.sex==2?"她":"他"}}的需求
  31. </view>
  32. <view class="remark">
  33. {{stu_detail.demand}}
  34. </view>
  35. </view>
  36. </u-popup>
  37. <view class="" v-if="list.length>0">
  38. <view class="item" v-for="(item,index) in list" :key='index'>
  39. <view class="item-left">
  40. <view class="image" :style="{backgroundImage:'url('+ item.teacher.headimg +')'}">
  41. </view>
  42. <!-- <image :src="item.teacher.headimg" mode=""></image> -->
  43. <view class="name">
  44. {{item.teacher.truename}}
  45. </view>
  46. </view>
  47. <view class="item-right">
  48. <view class="text">
  49. 值班时间:
  50. <view class="time">
  51. {{item.start_time}}-{{item.end_time}}
  52. </view>
  53. </view>
  54. <view class="text">
  55. 值班日期:
  56. <view class="time">
  57. {{item.day}}
  58. </view>
  59. </view>
  60. <view class="text">
  61. 有无预约:
  62. <view class="time">
  63. {{item.student ? '有预约' :'无预约' }}
  64. </view>
  65. </view>
  66. </view>
  67. <view class="cancel" v-if="item.student" @click="stuDetail(item.student)">
  68. 查看学生
  69. </view>
  70. </view>
  71. </view>
  72. <view class="empty" v-else>
  73. <view class="enptyStatus">
  74. <image src="../../static/empty.png" mode=""></image>
  75. <view class="words">
  76. 暂无内容
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. export default {
  84. data() {
  85. return {
  86. list: [],
  87. page: 1,
  88. stu_show: false,
  89. stu_detail: '',
  90. teacher_id: '',
  91. last: false
  92. }
  93. },
  94. onShow() {
  95. if(this.is_weixin()){
  96. this.navTitle()
  97. }
  98. this.list = []
  99. this.page = 1
  100. this.last = false
  101. this.getList()
  102. },
  103. onReachBottom() {
  104. if (!this.last) {
  105. this.page++
  106. }
  107. console.log(this.page)
  108. this.getList()
  109. },
  110. methods: {
  111. //判断是否是微信
  112. is_weixin() {
  113. let ua = navigator.userAgent.toLowerCase();
  114. return ua.indexOf('micromessenger') != -1;
  115. },
  116. navTitle() {
  117. let navTitle = document.getElementsByTagName('uni-page-head');
  118. navTitle[0].style.display = 'none'
  119. },
  120. getList() {
  121. let teacher_id = this.$store.state.vuex_user.type_id
  122. this.$u.get('/mentor/scheduling', {
  123. teacher_id: teacher_id,
  124. page: this.page,
  125. per_page:15
  126. }).then(res => {
  127. let data = res.data.list
  128. console.log(res, 'course1')
  129. if (this.page > 1 && data.length == 0) {
  130. uni.showToast({
  131. title: '暂无更多',
  132. icon: 'none'
  133. })
  134. this.last = true
  135. } else {
  136. this.list = this.list.concat(data)
  137. }
  138. })
  139. },
  140. stuDetail(item) {
  141. this.stu_show = true
  142. this.stu_detail = item
  143. }
  144. }
  145. }
  146. </script>
  147. <style lang="scss" scoped>
  148. .record {
  149. padding: 0 20px;
  150. }
  151. .enptyStatus{
  152. display: flex;
  153. justify-content: center;
  154. align-items: center;
  155. flex-direction: column;
  156. padding: 30px 10px;
  157. image{
  158. width: 120px;
  159. height: 150px;
  160. margin-top: 100px;
  161. }
  162. .words{
  163. color: #ffae21;
  164. font-size: 18px;
  165. padding-top: 18px;
  166. }
  167. }
  168. .item {
  169. display: flex;
  170. position: relative;
  171. align-items: center;
  172. padding: 10px;
  173. margin-top: 12px;
  174. font-size: 13px;
  175. background: rgba(234, 237, 242, .28);
  176. border-radius: 7px;
  177. .tips {
  178. position: absolute;
  179. width: 57px;
  180. height: 20px;
  181. background: #C1915A;
  182. line-height: 20px;
  183. font-size: 12px;
  184. font-family: PingFang SC;
  185. font-weight: 400;
  186. color: #FFFFFF;
  187. opacity: 1;
  188. opacity: 1;
  189. right: 12px;
  190. z-index: 2;
  191. top: 0;
  192. text-align: center;
  193. border-radius: 0px 0px 6px 6px;
  194. }
  195. .item-left {
  196. text-align: center;
  197. width: 30%;
  198. .image {
  199. height: 42px;
  200. width: 42px;
  201. border: solid 1px;
  202. border-radius: 50%;
  203. display: inline-block;
  204. background-position: center;
  205. background-repeat: no-repeat;
  206. background-size: cover;
  207. }
  208. .name {
  209. font-size: 10px;
  210. font-family: PingFang SC;
  211. font-weight: 400;
  212. text-align: center;
  213. line-height: 20px;
  214. color: #292929;
  215. opacity: 1
  216. }
  217. }
  218. .item-right {
  219. width: 47%;
  220. .text {
  221. line-height: 17px;
  222. font-size: 12px;
  223. font-family: PingFang SC;
  224. font-weight: 400;
  225. color: #282828;
  226. opacity: 1;
  227. .time {
  228. font-family: PingFang SC;
  229. font-weight: 400;
  230. color: #282828;
  231. opacity: 1;
  232. display: inline-block;
  233. margin-left: 15px;
  234. margin-top: 5px;
  235. }
  236. }
  237. }
  238. .cancel {
  239. // width: 60px;
  240. display: inline-block;
  241. padding: 2px 10px;
  242. // height: 23px;
  243. // line-height: 23px;
  244. border: 1px solid rgba(193, 145, 90, 0.44);
  245. border-radius: 12px;
  246. font-size: 12px;
  247. font-family: PingFang SC;
  248. font-weight: 500;
  249. line-height: 20px;
  250. color: #C1915A;
  251. opacity: 1;
  252. text-align: center;
  253. }
  254. }
  255. //查看学生信息弹框
  256. .student-show {
  257. padding-bottom:5px;
  258. .stu-title {
  259. font-size: 20px;
  260. font-family: PingFang SC;
  261. font-weight: bold;
  262. line-height: 20px;
  263. color: #282828;
  264. opacity: 1;
  265. text-align: center;
  266. padding: 35px 0;
  267. }
  268. .stu-mess {
  269. display: flex;
  270. padding: 0 22px;
  271. image {
  272. height: 75px;
  273. width: 75px;
  274. margin-right: 14px;
  275. border-radius: 9px;
  276. }
  277. .right {
  278. flex: 1;
  279. .stu-text {
  280. font-size: 13px;
  281. font-family: PingFang SC;
  282. font-weight: 400;
  283. line-height: 20px;
  284. color: #282828;
  285. }
  286. }
  287. }
  288. .e-mail {
  289. margin: 18px 22px 22px;
  290. height: 36px;
  291. line-height: 36px;
  292. font-size: 14px;
  293. font-family: PingFang SC;
  294. font-weight: bold;
  295. color: rgba(40, 40, 40, .78);
  296. border-bottom: 1px solid rgba(112, 112, 112, .06);
  297. }
  298. .remark-title {
  299. margin: 10px 22px 0px;
  300. padding: 5px;
  301. font-size: 13px;
  302. font-family: PingFang SC;
  303. font-weight: bold;
  304. line-height: 20px;
  305. color: #282828;
  306. opacity: 0.61;
  307. }
  308. .remark {
  309. margin: 0px 22px 22px;
  310. font-size: 12px;
  311. font-family: PingFang SC;
  312. font-weight: 400;
  313. line-height: 20px;
  314. color: #282828;
  315. opacity: 0.54;
  316. padding: 5px;
  317. overflow: hidden;
  318. display: -webkit-box; //将对象作为弹性伸缩盒子模型显示;
  319. text-overflow: ellipsis; //溢出部分用省略号代替
  320. -webkit-line-clamp: 3; //设置文本显示两行
  321. -webkit-box-orient: vertical; //从上到下排列子元素;
  322. white-space: normal;
  323. // border-bottom: 1px solid rgba(112, 112, 112, .06);
  324. }
  325. }
  326. </style>