completeInformation.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. <template>
  2. <view id="completeInformation">
  3. <view class="top-title-box-">
  4. <view>个人信息</view>
  5. <view>请完善个人信息</view>
  6. </view>
  7. <view class="bottom-input-max-box">
  8. <view class="text-max-box">
  9. <view class="text-top-box">
  10. <view>*</view>
  11. <view>姓名</view>
  12. </view>
  13. <view class="text-bottom-p">{{newData.data1}}</view>
  14. </view>
  15. <view class="text-max-box">
  16. <view class="text-top-box">
  17. <view>*</view>
  18. <view>学号</view>
  19. </view>
  20. <view class="text-bottom-p">{{newData.data2}}</view>
  21. </view>
  22. <view class="text-max-box">
  23. <view class="text-top-box">
  24. <view>*</view>
  25. <view>所在学院</view>
  26. </view>
  27. <view class="text-bottom-p">{{newData.data3}}</view>
  28. </view>
  29. <view class="text-max-box">
  30. <view class="text-top-box">
  31. <view>*</view>
  32. <view>专业</view>
  33. </view>
  34. <view class="text-bottom-p">{{newData.data4}}</view>
  35. </view>
  36. <view class="input-max-box">
  37. <view class="input-top-box">
  38. <view>*</view>
  39. <view>手机号</view>
  40. </view>
  41. <input class="input-top-p" v-model="form.phone" maxlength="11" focus placeholder="请输入手机号码">
  42. </view>
  43. <view class="button-max-box">
  44. <view class="button-top-box">
  45. <view>*</view>
  46. <view>导师</view>
  47. </view>
  48. <input class="button-bottom-p" :disabled="true" v-model="form.supervisorName"
  49. maxlength="30" focus placeholder="请选择导师" @click="userButton()">
  50. </view>
  51. <view class="bottom-button-p" @click="submitButton()">确定</view>
  52. </view>
  53. <view class="shade-max-big-box" v-if="userShowType">
  54. <view class="null-back-box" @click="userButton()"></view>
  55. <view class="shade-big-box">
  56. <view class="shade-top-box">
  57. <view class="shade-top-left-box">
  58. <uni-icons type="search" class="icon-view" size="20" color="#999999"></uni-icons>
  59. <input class="input-top-p" v-model="getData.searchValue" maxlength="10" focus placeholder="请输入导师">
  60. </view>
  61. <view class="shade-top-right-button" @click="searchButton()">搜索</view>
  62. </view>
  63. <scroll-view scroll-y @scrolltolower="scrollGet" class="shade-bottom-box">
  64. <view @click="checkUser(item,index)"
  65. class="for-user-box" :class="checkUserIndex==index?'check-user':''"
  66. v-for="(item,index) in dataList" :key="index">
  67. <view>{{item.name}}{{item.num?'('+item.num+')':''}}</view>
  68. <view>{{item.deptName}}</view>
  69. </view>
  70. <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
  71. <view class="get-data-null-p" v-else="getDataType">- 滑动加载更多 -</view>
  72. </scroll-view>
  73. </view>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. import {
  79. systemSubjectGetAppSubject,
  80. } from '@/pages_manage/api/index.js'
  81. export default {
  82. data() {
  83. return {
  84. newData:{
  85. data1:"刘晓明",
  86. data2:"2024060236",
  87. data3:"园艺学院",
  88. data4:"茶艺",
  89. },
  90. form:{
  91. phone:"",
  92. supervisorName:"",
  93. supervisorId:"",
  94. },
  95. userShowType:false,
  96. checkUserIndex:null,
  97. //查询
  98. getData: {
  99. page: 1,
  100. pageSize: 20,
  101. searchValue: '',
  102. },
  103. getDataType: false,
  104. total: 0,
  105. //教师查询列表
  106. dataList:[
  107. {name:"一二三四五",num:"01234567890123456789",deptName:"学院名称五六七八九十",},
  108. {name:"一二三四五",num:"01234567890123456789",deptName:"学院名称五六七八九十",},
  109. {name:"一二三四五",num:"01234567890123456789",deptName:"学院名称五六七八九十",},
  110. {name:"一二三四五",num:"01234567890123456789",deptName:"学院名称五六七八九十",},
  111. {name:"一二三四五",num:"01234567890123456789",deptName:"学院名称五六七八九十",},
  112. {name:"一二三四五",num:"01234567890123456789",deptName:"学院名称五六七八九十",},
  113. {name:"一二三四五",num:"01234567890123456789",deptName:"学院名称五六七八九十",},
  114. {name:"一二三四五",num:"01234567890123456789",deptName:"学院名称五六七八九十",},
  115. {name:"一二三四五",num:"01234567890123456789",deptName:"学院名称五六七八九十",},
  116. {name:"一二三四五",num:"01234567890123456789",deptName:"学院名称五六七八九十",},
  117. {name:"一二三四五",num:"01234567890123456789",deptName:"学院名称五六七八九十",},
  118. {name:"一二三四五",num:"01234567890123456789",deptName:"学院名称五六七八九十",},
  119. {name:"一二三四五",num:"01234567890123456789",deptName:"学院名称五六七八九十",},
  120. {name:"一二三四五",num:"01234567890123456789",deptName:"学院名称五六七八九十",},
  121. {name:"一二三四五",num:"01234567890123456789",deptName:"学院名称五六七八九十",},
  122. {name:"一二三四五",num:"01234567890123456789",deptName:"学院名称五六七八九十",},
  123. ],
  124. }
  125. },
  126. onLoad(option) {
  127. },
  128. onShow() {
  129. // this.systemSubjectGetAppSubject();
  130. },
  131. methods: {
  132. //提交
  133. submitButton(){
  134. const reg = /^1[3|4|5|7|8|9][0-9]\d{8}$/
  135. if(!this.form.phone){
  136. uni.showToast({
  137. title: '请输入手机号码',
  138. icon: "none",
  139. duration: 3000
  140. });
  141. return
  142. }else if (!reg.test(this.form.phone)) {
  143. uni.showToast({
  144. title: '请输入正确的手机号码',
  145. icon: "none",
  146. duration: 3000
  147. });
  148. return
  149. }
  150. if(!this.form.supervisorName){
  151. uni.showToast({
  152. title: '请选择导师',
  153. icon: "none",
  154. duration: 3000
  155. });
  156. return
  157. }
  158. uni.showModal({
  159. title: '确认提交?',
  160. cancelColor: '#999999',
  161. confirmColor: '#0183FA',
  162. content: '',
  163. success(res) {
  164. if (res.confirm) {
  165. console.log('确定')
  166. } else if (res.cancel) {
  167. console.log('取消')
  168. }
  169. }
  170. })
  171. },
  172. //搜索按钮
  173. searchButton(){
  174. this.$set(this, 'getDataType', false);
  175. this.$set(this, 'dataList', []);
  176. this.$set(this, 'total', 0);
  177. this.$set(this.getData, 'page', 1);
  178. this.systemSubjectGetAppSubject();
  179. },
  180. //教师弹窗开关啊
  181. userButton(type){
  182. this.$set(this,'userShowType',!this.userShowType);
  183. },
  184. //选中教师
  185. checkUser(item,index){
  186. this.$set(this.form,'supervisorName',item.name);
  187. this.$set(this.form,'supervisorId',item.num);
  188. this.$set(this,'checkUserIndex',index);
  189. this.$set(this,'userShowType',false);
  190. },
  191. //滚动加载事件
  192. scrollGet() {
  193. let self = this;
  194. if (self.total / self.getData.pageSize <= self.getData.page) {
  195. this.$set(this, 'getDataType', true);
  196. } else {
  197. this.getData.page += 1;
  198. this.$nextTick(() => {
  199. this.systemSubjectGetAppSubject();
  200. })
  201. }
  202. },
  203. //获取实验室
  204. async systemSubjectGetAppSubject() {
  205. let self = this;
  206. const {
  207. data
  208. } = await systemSubjectGetAppSubject(this.getData);
  209. if (data.code == 200) {
  210. if (self.getData.page == 1) {
  211. this.dataList = data.data.records;
  212. this.total = data.data.total;
  213. if (data.data.total / self.getData.pageSize <= self.getData.page) {
  214. this.$set(this, 'getDataType', true);
  215. }
  216. } else {
  217. this.dataList = [...this.dataList, ...data.data.records]
  218. this.total = data.data.total;
  219. if (data.data.total / self.getData.pageSize <= self.getData.page) {
  220. this.$set(this, 'getDataType', true);
  221. }
  222. }
  223. }
  224. },
  225. },
  226. }
  227. </script>
  228. <style lang="stylus" scoped>
  229. #completeInformation {
  230. height:100%;
  231. display: flex;
  232. flex-direction: column;
  233. overflow: hidden;
  234. .top-title-box-{
  235. height:110rpx;
  236. display: flex;
  237. background-color: #FFFFFF;
  238. margin-bottom:20rpx;
  239. view:nth-child(1){
  240. line-height:100rpx;
  241. font-size:34rpx;
  242. margin:0 45rpx 0 32rpx;
  243. color:#333;
  244. font-weight:700;
  245. }
  246. view:nth-child(2){
  247. line-height:100rpx;
  248. font-size:30rpx;
  249. color:#999999;
  250. }
  251. }
  252. .bottom-input-max-box{
  253. flex:1;
  254. overflow-x: hidden;
  255. overflow-y: scroll;
  256. background-color: #FFFFFF;
  257. .text-max-box{
  258. .text-top-box{
  259. display: flex;
  260. margin-left:32rpx;
  261. view{
  262. font-size:30rpx;
  263. line-height: 100rpx;
  264. }
  265. view:nth-child(1){
  266. color:#FF0000;
  267. }
  268. view:nth-child(2){
  269. color:#333;
  270. }
  271. }
  272. .text-bottom-p{
  273. margin-left:32rpx;
  274. width: 630rpx;
  275. line-height: 100rpx;
  276. background: #F5F5F5;
  277. border-radius: 10rpx 10rpx 10rpx 10rpx;
  278. padding:0 30rpx;
  279. }
  280. }
  281. .input-max-box{
  282. .input-top-box{
  283. display: flex;
  284. margin-left:32rpx;
  285. view{
  286. font-size:30rpx;
  287. line-height: 100rpx;
  288. }
  289. view:nth-child(1){
  290. color:#FF0000;
  291. }
  292. view:nth-child(2){
  293. color:#333;
  294. }
  295. }
  296. .input-top-p{
  297. margin-left:34rpx;
  298. width: 630rpx;
  299. height: 100rpx;
  300. padding:0 30rpx;
  301. border-radius: 10rpx 10rpx 10rpx 10rpx;
  302. border: 1rpx solid #E0E0E0;
  303. }
  304. }
  305. .button-max-box{
  306. .button-top-box{
  307. display: flex;
  308. margin-left:32rpx;
  309. view{
  310. font-size:30rpx;
  311. line-height: 100rpx;
  312. }
  313. view:nth-child(1){
  314. color:#FF0000;
  315. }
  316. view:nth-child(2){
  317. color:#333;
  318. }
  319. }
  320. .button-bottom-p{
  321. margin-left:34rpx;
  322. width: 630rpx;
  323. height: 100rpx;
  324. padding:0 30rpx;
  325. border-radius: 10rpx 10rpx 10rpx 10rpx;
  326. border: 1rpx solid #E0E0E0;
  327. }
  328. }
  329. .bottom-button-p{
  330. margin:40rpx 34rpx;
  331. background-color: #0183FA;
  332. line-height:100rpx;
  333. text-align: center;
  334. color:#fff;
  335. font-size:30rpx;
  336. border-radius:50rpx;
  337. }
  338. }
  339. .shade-max-big-box{
  340. position: fixed;
  341. height:100%;
  342. width:100%;
  343. background-color: rgba(0,0,0,0.5);
  344. z-index:1;
  345. display: flex;
  346. flex-direction: column;
  347. overflow: hidden;
  348. .null-back-box{
  349. height:20%;
  350. }
  351. .shade-big-box{
  352. flex:1;
  353. display: flex;
  354. flex-direction: column;
  355. background-color: #fff;
  356. border-top-left-radius:20rpx;
  357. border-top-right-radius:20rpx;
  358. overflow: hidden;
  359. z-index:10;
  360. .shade-top-box{
  361. height:122rpx;
  362. border-bottom:1px solid #dedede;
  363. display: flex;
  364. .shade-top-left-box{
  365. display: flex;
  366. border-radius: 50rpx 50rpx 50rpx 50rpx;
  367. border: 1rpx solid #E0E0E0;
  368. height:80rpx;
  369. margin:20rpx 0 0 30rpx;
  370. width:580rpx;
  371. .icon-view{
  372. margin:20rpx 21rpx 0 18rpx;
  373. color:#999999;
  374. }
  375. .input-top-p{
  376. line-height:80rpx;
  377. height:80rpx;
  378. width:500rpx;
  379. }
  380. }
  381. .shade-top-right-button{
  382. width:120rpx;
  383. text-align: center;
  384. line-height:80rpx;
  385. margin:20rpx 0;
  386. color:#0183FA;
  387. font-size:28rpx;
  388. }
  389. }
  390. .shade-bottom-box{
  391. flex:1;
  392. overflow-x: hidden;
  393. overflow-y: scroll;
  394. .for-user-box:nth-child(1){
  395. border:none;
  396. }
  397. .for-user-box{
  398. border-top:1px solid #e0e0e0;
  399. margin:0 30rpx;
  400. padding:20rpx 0;
  401. view{
  402. font-size:28rpx;
  403. line-height:39rpx;
  404. }
  405. view:nth-child(1){
  406. margin-bottom:19rpx;
  407. }
  408. }
  409. .check-user{
  410. color:#0183FA;
  411. }
  412. .get-data-null-p {
  413. text-align: center;
  414. line-height: 100rpx;
  415. padding-bottom: 80px;
  416. color: #999;
  417. }
  418. }
  419. }
  420. }
  421. }
  422. </style>