completeInformation.vue 12 KB

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