realname.vue 25 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048
  1. <template>
  2. <view class="real-name">
  3. <view class="study" v-if="tea_type==1">
  4. <view class="item">
  5. <view class="star">
  6. *
  7. </view>
  8. <view class="label">
  9. 姓名
  10. </view>
  11. <view class="right" @click="goEdit('姓名',1,type=0)">
  12. {{form.truename ? form.truename : '去填写'}}
  13. <u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  14. </view>
  15. </view>
  16. <view class="item">
  17. <view class="star">
  18. *
  19. </view>
  20. <view class="label">
  21. 个人照片
  22. </view>
  23. <view class="right" @click="goEdit('上传个人照片',2,type=2)">
  24. {{form.headimg ? '已上传' : '点击上传'}}
  25. <u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  26. </view>
  27. </view>
  28. <view class="item">
  29. <view class="star">
  30. *
  31. </view>
  32. <view class="label">
  33. 性别
  34. </view>
  35. <view class="right">
  36. <u-radio-group v-model="form.sex" @change="radioGroupChange">
  37. <u-radio v-for="(item, index) in list_sex" :key="index" :name="item.label">
  38. {{item.name}}
  39. </u-radio>
  40. </u-radio-group>
  41. </view>
  42. </view>
  43. <view class="item">
  44. <view class="star">
  45. *
  46. </view>
  47. <view class="label">
  48. 毕业院校
  49. </view>
  50. <view class="right" @click="goEdit('毕业院校',3,type=0)">
  51. {{form.school ? form.school : '去填写'}}
  52. <u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  53. </view>
  54. </view>
  55. <view class="item">
  56. <view class="star">
  57. *
  58. </view>
  59. <view class="label">
  60. 职称
  61. </view>
  62. <view class="right" @click="goEdit('职称',30,type=0)">
  63. {{form.rank ? form.rank : '去填写'}}
  64. <u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  65. </view>
  66. </view>
  67. <view class="item">
  68. <view class="star">
  69. *
  70. </view>
  71. <view class="label">
  72. 邮箱
  73. </view>
  74. <view class="right" @click="goEdit('填写邮箱',4,type=0)">
  75. {{form.email ? form.email : '去填写'}}
  76. <u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  77. </view>
  78. </view>
  79. <view class="item" v-if="!form.subject">
  80. <view class="star">
  81. *
  82. </view>
  83. <view class="label">
  84. 学科
  85. </view>
  86. <view class="right" @click="goEdit('填写学科',5,type=1)">
  87. {{form.subject ? '已填写' : '去填写'}}
  88. <u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  89. </view>
  90. </view>
  91. <view class="item1" v-if="form.subject">
  92. <view class="star">
  93. *
  94. </view>
  95. <view class="item">
  96. <view class="label">
  97. 学科
  98. </view>
  99. <view class="right" @click="goEdit('担任课程',5,type=1)">
  100. 修改<u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  101. </view>
  102. </view>
  103. <view class="dec">
  104. {{form.subject}}
  105. </view>
  106. </view>
  107. <view class="item">
  108. <view class="star">
  109. *
  110. </view>
  111. <view class="label">
  112. 手机号
  113. </view>
  114. <view class="right" @click="goEdit('填写手机号',6,type=0)">
  115. {{form.mobile ? form.mobile : '去填写'}}
  116. <u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  117. </view>
  118. </view>
  119. <view class="item" v-if="pwd_show">
  120. <view class="star">
  121. *
  122. </view>
  123. <view class="label">
  124. 密码
  125. </view>
  126. <view class="right" @click="goEdit('填写密码',20,type=5)">
  127. {{form.password ? form.password : '去填写'}}
  128. <u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  129. </view>
  130. </view>
  131. <view class="item" v-if="!form.class">
  132. <view class="star">
  133. *
  134. </view>
  135. <view class="label">
  136. 担任课程
  137. </view>
  138. <view class="right" @click="goEdit('担任课程',7,type=1)">
  139. {{form.class ? form.class : '去填写'}}
  140. <u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  141. </view>
  142. </view>
  143. <view class="item1" v-if="form.class">
  144. <view class="star">
  145. *
  146. </view>
  147. <view class="item">
  148. <view class="label">
  149. 担任课程
  150. </view>
  151. <view class="right" @click="goEdit('担任课程',7,type=1)">
  152. 修改<u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  153. </view>
  154. </view>
  155. <view class="dec">
  156. {{form.class}}
  157. </view>
  158. </view>
  159. <view class="item" v-if="!form.direction">
  160. <view class="star">
  161. *
  162. </view>
  163. <view class="label">
  164. 近年研究方向
  165. </view>
  166. <view class="right" @click="goEdit('近年研究方向',8,type=1)">
  167. <!-- 去填写<u-icon name="arrow-right" size="20" margin-left="20"></u-icon> -->
  168. <image src="../../static/images/edit.png" mode=""></image>
  169. </view>
  170. </view>
  171. <view class="item1" v-if="form.direction">
  172. <view class="star">
  173. *
  174. </view>
  175. <view class="item">
  176. <view class="label">
  177. 近年研究方向
  178. </view>
  179. <view class="right" @click="goEdit('近年研究方向',8,type=1)">
  180. <!-- 修改<u-icon name="arrow-right" size="20" margin-left="20"></u-icon> -->
  181. <image src="../../static/images/edit.png" mode=""></image>
  182. </view>
  183. </view>
  184. <view class="dec">
  185. {{form.direction}}
  186. </view>
  187. </view>
  188. <view class="item" v-if="!form.project">
  189. <view class="star">
  190. *
  191. </view>
  192. <view class="label">
  193. 承担项目
  194. </view>
  195. <view class="right" @click="goEdit('承担项目',9,type=1)">
  196. <!-- 去填写<u-icon name="arrow-right" size="20" margin-left="20"></u-icon> -->
  197. <image src="../../static/images/edit.png" mode=""></image>
  198. </view>
  199. </view>
  200. <view class="item1" v-if="form.project">
  201. <view class="star">
  202. *
  203. </view>
  204. <view class="item">
  205. <view class="label">
  206. 承担项目
  207. </view>
  208. <view class="right" @click="goEdit('承担项目',9,type=1)">
  209. <!-- 修改<u-icon name="arrow-right" size="20" margin-left="20"></u-icon> -->
  210. <image src="../../static/images/edit.png" mode=""></image>
  211. </view>
  212. </view>
  213. <view class="dec">
  214. {{form.project}}
  215. </view>
  216. </view>
  217. <view class="item" v-if="!form.results">
  218. <view class="star">
  219. *
  220. </view>
  221. <view class="label">
  222. 代表性成果
  223. </view>
  224. <view class="right" @click="goEdit('代表性成果',10,type=1)">
  225. <!-- 去填写<u-icon name="arrow-right" size="20" margin-left="20"></u-icon> -->
  226. <image src="../../static/images/edit.png" mode=""></image>
  227. </view>
  228. </view>
  229. <view class="item1" v-if="form.results">
  230. <view class="star">
  231. *
  232. </view>
  233. <view class="item">
  234. <view class="label">
  235. 代表性成果
  236. </view>
  237. <view class="right" @click="goEdit('代表性成果',10,type=1)">
  238. <!-- 修改<u-icon name="arrow-right" size="20" margin-left="20"></u-icon> -->
  239. <image src="../../static/images/edit.png" mode=""></image>
  240. </view>
  241. </view>
  242. <view class="dec">
  243. {{form.results}}
  244. </view>
  245. </view>
  246. </view>
  247. <view class="pengbei" v-if="tea_type !=1">
  248. <view class="item">
  249. <view class="star">
  250. *
  251. </view>
  252. <view class="label">
  253. 姓名
  254. </view>
  255. <view class="right" @click="goEdit('姓名',1,type=0)">
  256. {{form.truename ? form.truename : '去填写'}}
  257. <u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  258. </view>
  259. </view>
  260. <view class="item">
  261. <view class="star">
  262. *
  263. </view>
  264. <view class="label">
  265. 个人照片
  266. </view>
  267. <view class="right" @click="goEdit('上传个人照片',2,type=2)">
  268. {{form.headimg ? '已上传' : '点击上传'}}
  269. <u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  270. </view>
  271. </view>
  272. <view class="item">
  273. <view class="star">
  274. *
  275. </view>
  276. <view class="label">
  277. 性别
  278. </view>
  279. <view class="right">
  280. <u-radio-group v-model="form.sex" @change="radioGroupChange">
  281. <u-radio v-for="(item, index) in list_sex" :key="index" :name="item.label">
  282. {{item.name}}
  283. </u-radio>
  284. </u-radio-group>
  285. </view>
  286. </view>
  287. <view class="item">
  288. <view class="star">
  289. *
  290. </view>
  291. <view class="label">
  292. 毕业院校
  293. </view>
  294. <view class="right" @click="goEdit('毕业院校',3,type=0)">
  295. {{form.school ? form.school : '去填写'}}
  296. <u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  297. </view>
  298. </view>
  299. <view class="item">
  300. <view class="star">
  301. *
  302. </view>
  303. <view class="label">
  304. 邮箱
  305. </view>
  306. <view class="right" @click="goEdit('填写邮箱',4,type=0)">
  307. {{form.email ? form.email : '去填写'}}
  308. <u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  309. </view>
  310. </view>
  311. <view class="item">
  312. <view class="star">
  313. *
  314. </view>
  315. <view class="label">
  316. 手机号
  317. </view>
  318. <view class="right" @click="goEdit('填写手机号',6,type=0)">
  319. {{form.mobile ? form.mobile : '去填写'}}
  320. <u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  321. </view>
  322. </view>
  323. <view class="item" v-if="pwd_show">
  324. <view class="star">
  325. *
  326. </view>
  327. <view class="label">
  328. 密码
  329. </view>
  330. <view class="right" @click="goEdit('填写密码',20,type=5)">
  331. {{form.password ? form.password : '去填写'}}
  332. <u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  333. </view>
  334. </view>
  335. <!-- <view class="item" v-if="!form.class">
  336. <view class="star">
  337. *
  338. </view>
  339. <view class="label">
  340. 担任课程
  341. </view>
  342. <view class="right" @click="goEdit('担任课程',7,type=1)">
  343. {{form.class ? form.class : '去填写'}}
  344. <u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  345. </view>
  346. </view>
  347. <view class="item1" v-if="form.class">
  348. <view class="star">
  349. *
  350. </view>
  351. <view class="item">
  352. <view class="label">
  353. 担任课程
  354. </view>
  355. <view class="right" @click="goEdit('担任课程',7,type=1)">
  356. 修改<u-icon name="arrow-right" size="20" margin-left="20"></u-icon>
  357. </view>
  358. </view>
  359. <view class="dec">
  360. {{form.class}}
  361. </view>
  362. </view> -->
  363. <view class="item" v-if="!form.direction">
  364. <view class="star">
  365. *
  366. </view>
  367. <view class="label">
  368. 特长
  369. </view>
  370. <view class="right" @click="goEdit('特长',8,type=1)">
  371. <!-- 去填写<u-icon name="arrow-right" size="20" margin-left="20"></u-icon> -->
  372. <image src="../../static/images/edit.png" mode=""></image>
  373. </view>
  374. </view>
  375. <view class="item1" v-if="form.direction">
  376. <view class="star">
  377. *
  378. </view>
  379. <view class="item">
  380. <view class="label">
  381. 特长
  382. </view>
  383. <view class="right" @click="goEdit('特长',8,type=1)">
  384. <!-- 修改<u-icon name="arrow-right" size="20" margin-left="20"></u-icon> -->
  385. <image src="../../static/images/edit.png" mode=""></image>
  386. </view>
  387. </view>
  388. <view class="dec">
  389. {{form.direction}}
  390. </view>
  391. </view>
  392. <view class="item" v-if="!form.project">
  393. <view class="star">
  394. *
  395. </view>
  396. <view class="label">
  397. 寄语
  398. </view>
  399. <view class="right" @click="goEdit('寄语',9,type=1)">
  400. <!-- 去填写<u-icon name="arrow-right" size="20" margin-left="20"></u-icon> -->
  401. <image src="../../static/images/edit.png" mode=""></image>
  402. </view>
  403. </view>
  404. <view class="item1" v-if="form.project">
  405. <view class="star">
  406. *
  407. </view>
  408. <view class="item">
  409. <view class="label">
  410. 寄语
  411. </view>
  412. <view class="right" @click="goEdit('寄语',9,type=1)">
  413. <!-- 修改<u-icon name="arrow-right" size="20" margin-left="20"></u-icon> -->
  414. <image src="../../static/images/edit.png" mode=""></image>
  415. </view>
  416. </view>
  417. <view class="dec">
  418. {{form.project}}
  419. </view>
  420. </view>
  421. </view>
  422. <u-popup v-model="show" mode="bottom" height="100%">
  423. <view class="form">
  424. <view class="back" @click="show=false">
  425. <u-icon name="arrow-left" size="30"></u-icon>
  426. </view>
  427. <u-navbar :is-back="false" title="填写信息"></u-navbar>
  428. <view class="title">
  429. {{input_name}}
  430. </view>
  431. <view class="input" v-if="type==0">
  432. <u-input v-model="value" :placeholder=' "请输入" + input_name' />
  433. </view>
  434. <view class="input" v-if="type==5">
  435. <u-input v-model="password" :placeholder=' "请输入" + input_name' type="password" />
  436. </view>
  437. <!-- 上传图片 -->
  438. <view class="upload_image" v-if="item==2&&image_edit==0">
  439. <u-upload ref="uUpload" :action="action" :auto-upload="true" :form-data='imageDate'
  440. :file-list="fileList" @on-success='uploadSuccess'></u-upload>
  441. </view>
  442. <view class="upload_image" v-if="item==2 && image_edit==1">
  443. <u-image width="300rpx" height="300rpx" :src="uploadImage"></u-image>
  444. <text>图片最佳尺寸为150*150</text>
  445. </view>
  446. <view class="complate" v-if="item==2 && image_edit==1" @click="reload">
  447. 重新上传
  448. </view>
  449. <view class="complate1" v-if="item==2 " @click="complate">
  450. 完成
  451. </view>
  452. <!-- textear编辑 -->
  453. <view class="upload_image" v-if="type==1">
  454. <u-input v-model="textarea" type="textarea" :border="true" height="400" :auto-height="true" />
  455. </view>
  456. <view class="complate" v-if="item!=2" @click="complate">
  457. 完成
  458. </view>
  459. </view>
  460. </u-popup>
  461. <view class="buttom" @click="mentor" v-if="tea_type==1">
  462. {{type==1 ? '提交' : '保存编辑'}}
  463. </view>
  464. <view class="buttom" @click="mentor1" v-if=" tea_type!==1">
  465. {{type==1 ? '提交' : '保存编辑'}}
  466. </view>
  467. </view>
  468. </template>
  469. <script>
  470. export default {
  471. data() {
  472. return {
  473. show: false,
  474. input_name: '',
  475. item: '',
  476. image_edit: 0,
  477. value: '', //输入框的内容
  478. action: '', //封面图上传地址
  479. imageDate: {
  480. file_type: 'img',
  481. type: 'tearcher_headimg'
  482. }, //上传图片携带参数
  483. fileList: [],
  484. uploadImage: '',
  485. type: 0, //0input输入框,1textare输入框
  486. textarea: '',
  487. form: {
  488. status: 1,
  489. sex: 0
  490. },
  491. type: 1,
  492. password: '',
  493. list_sex: [
  494. {
  495. name: '男',
  496. label: 1
  497. },
  498. {
  499. name: '女',
  500. label: 2
  501. },
  502. ],
  503. pwd_show: true,
  504. tea_type: 0,
  505. rank: ''
  506. }
  507. },
  508. onLoad(options) {
  509. if (this.is_weixin()) {
  510. this.navTitle()
  511. }
  512. if (options.type == 0) {
  513. this.type = options.type
  514. }
  515. this.getMe(options.type)
  516. },
  517. onShow() {
  518. this.action = '/api/base/common/upload'
  519. },
  520. methods: {
  521. radioGroupChange(e) {
  522. console.log(e);
  523. this.form.sex = e
  524. },
  525. //判断是否是微信
  526. is_weixin() {
  527. let ua = navigator.userAgent.toLowerCase();
  528. return ua.indexOf('micromessenger') != -1;
  529. },
  530. navTitle() {
  531. let navTitle = document.getElementsByTagName('uni-page-head');
  532. navTitle[0].style.display = 'none'
  533. },
  534. getMe(type) {
  535. console.log(type, '')
  536. this.$u.get('/base/auth/me').then(res => {
  537. console.log(res, 'ppp')
  538. this.form = res.data.type_model
  539. console.log(this.form, '=======')
  540. this.tea_type = res.data.type_model.type
  541. if (type == 1) {
  542. this.uploadImage = ''
  543. this.form.headimg = ''
  544. } else {
  545. this.uploadImage = res.data.type_model.headimg
  546. }
  547. if (this.uploadImage) {
  548. this.image_edit = 1
  549. }
  550. if (this.form.is_register == 1) {
  551. this.pwd_show = false
  552. }
  553. })
  554. },
  555. //学业导师保存修改
  556. mentor() {
  557. if (!this.form.truename) {
  558. uni.showToast({
  559. title: '姓名不能为空',
  560. icon: 'none'
  561. })
  562. return
  563. }
  564. if (!this.form.rank) {
  565. uni.showToast({
  566. title: '职称不能为空',
  567. icon: 'none'
  568. })
  569. return
  570. }
  571. if (!this.form.headimg) {
  572. uni.showToast({
  573. title: '头像不能为空',
  574. icon: 'none'
  575. })
  576. return
  577. }
  578. if (!this.form.sex) {
  579. uni.showToast({
  580. title: '性别不能为空',
  581. icon: 'none'
  582. })
  583. return
  584. }
  585. if (!this.form.school) {
  586. uni.showToast({
  587. title: '毕业院校不能为空',
  588. icon: 'none'
  589. })
  590. return
  591. }
  592. var reg = /^\w+@[a-zA-Z0-9]{2,10}(?:\.[a-z]{2,4}){1,3}$/
  593. if (!reg.test(this.form.email)) {
  594. uni.showToast({
  595. title: '您输入的邮箱有误,请检查!',
  596. icon: 'none'
  597. })
  598. return
  599. }
  600. if (!this.form.subject) {
  601. uni.showToast({
  602. title: '学科不能为空',
  603. icon: 'none'
  604. })
  605. return
  606. }
  607. let myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
  608. if (!myreg.test(this.form.mobile)) {
  609. uni.showToast({
  610. title: '您输入的手机号有误,请检查!',
  611. icon: 'none'
  612. })
  613. return
  614. }
  615. if (!this.form.password && this.pwd_show == true) {
  616. uni.showToast({
  617. title: '密码不能为空',
  618. icon: 'none'
  619. })
  620. return
  621. }
  622. if (!this.form.class) {
  623. uni.showToast({
  624. title: '担任课程不能为空',
  625. icon: 'none'
  626. })
  627. return
  628. }
  629. if (!this.form.direction) {
  630. uni.showToast({
  631. title: '近年研究方向不能为空',
  632. icon: 'none'
  633. })
  634. return
  635. }
  636. if (!this.form.project) {
  637. uni.showToast({
  638. title: '承担项目不能为空',
  639. icon: 'none'
  640. })
  641. return
  642. }
  643. if (!this.form.results) {
  644. uni.showToast({
  645. title: '代表性成果不能为空',
  646. icon: 'none'
  647. })
  648. return
  649. }
  650. let id = this.$store.state.vuex_user.type_id
  651. console.log(this.$store.state.vuex_user)
  652. // this.form.account=this.$store.state.vuex_user.account
  653. this.$u.put('/mentor/perfect-teacher-info', this.form).then(res => {
  654. if (res.code == 200) {
  655. uni.showToast({
  656. title: '保存成功',
  657. icon: 'none'
  658. })
  659. setTimeout(function() {
  660. uni.reLaunch({
  661. url: './index'
  662. })
  663. }, 1500)
  664. }
  665. })
  666. },
  667. //朋辈导师保存修改
  668. mentor1() {
  669. if (!this.form.truename) {
  670. uni.showToast({
  671. title: '姓名不能为空',
  672. icon: 'none'
  673. })
  674. return
  675. }
  676. if (!this.form.headimg) {
  677. uni.showToast({
  678. title: '头像不能为空',
  679. icon: 'none'
  680. })
  681. return
  682. }
  683. if (!this.form.sex) {
  684. uni.showToast({
  685. title: '性别不能为空',
  686. icon: 'none'
  687. })
  688. return
  689. }
  690. if (!this.form.school) {
  691. uni.showToast({
  692. title: '毕业院校不能为空',
  693. icon: 'none'
  694. })
  695. return
  696. }
  697. var reg = /^\w+@[a-zA-Z0-9]{2,10}(?:\.[a-z]{2,4}){1,3}$/
  698. if (!reg.test(this.form.email)) {
  699. uni.showToast({
  700. title: '您输入的邮箱有误,请检查!',
  701. icon: 'none'
  702. })
  703. return
  704. }
  705. let myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
  706. if (!myreg.test(this.form.mobile)) {
  707. uni.showToast({
  708. title: '您输入的手机号有误,请检查!',
  709. icon: 'none'
  710. })
  711. return
  712. }
  713. if (!this.form.password && this.pwd_show == true) {
  714. uni.showToast({
  715. title: '密码不能为空',
  716. icon: 'none'
  717. })
  718. return
  719. }
  720. if (!this.form.direction) {
  721. uni.showToast({
  722. title: '特长不能为空',
  723. icon: 'none'
  724. })
  725. return
  726. }
  727. if (!this.form.project) {
  728. uni.showToast({
  729. title: '寄语不能为空',
  730. icon: 'none'
  731. })
  732. return
  733. }
  734. let id = this.$store.state.vuex_user.type_id
  735. console.log(this.$store.state.vuex_user)
  736. // this.form.account=this.$store.state.vuex_user.account
  737. this.$u.put('/mentor/perfect-teacher-info', this.form).then(res => {
  738. if (res.code == 200) {
  739. uni.showToast({
  740. title: '保存成功',
  741. icon: 'none'
  742. })
  743. setTimeout(function() {
  744. uni.reLaunch({
  745. url: './index'
  746. })
  747. }, 1500)
  748. }
  749. })
  750. },
  751. //上传图片成功
  752. uploadSuccess(data) {
  753. console.log(data, 'ppp')
  754. this.form.headimg = data.data.path
  755. this.uploadImage = data.data.url
  756. this.image_edit = 1
  757. },
  758. //重新上传
  759. reload() {
  760. this.image_edit = 0
  761. console.log('---------')
  762. this.fileList = [],
  763. this.uploadImage = ''
  764. this.form.headimg = ''
  765. },
  766. goEdit(name, item) {
  767. if (this.uploadImage) {
  768. this.fileList.push({
  769. url: this.uploadImage
  770. })
  771. }
  772. switch (item) {
  773. case 1:
  774. this.value = this.form.truename
  775. break
  776. case 2:
  777. break
  778. case 3:
  779. this.value = this.form.school
  780. break
  781. case 4:
  782. this.value = this.form.email
  783. break
  784. case 5:
  785. this.textarea = this.form.subject
  786. break
  787. case 6:
  788. this.value = this.form.mobile
  789. break
  790. case 7:
  791. this.textarea = this.form.class
  792. break
  793. case 8:
  794. this.textarea = this.form.direction
  795. break
  796. case 9:
  797. this.textarea = this.form.project
  798. break
  799. case 10:
  800. this.textarea = this.form.results
  801. break
  802. case 20:
  803. this.password = this.form.password
  804. break
  805. case 30:
  806. this.value = this.form.rank
  807. break
  808. }
  809. this.show = true
  810. this.item = item
  811. this.input_name = name
  812. // this.textarea = ''
  813. // this.value = ''
  814. },
  815. complate() {
  816. let item = this.item
  817. switch (item) {
  818. case 1:
  819. this.form.truename = this.value
  820. break
  821. case 2:
  822. break
  823. case 3:
  824. this.form.school = this.value
  825. break
  826. case 4:
  827. this.form.email = this.value
  828. break
  829. case 5:
  830. this.form.subject = this.textarea
  831. break
  832. case 6:
  833. this.form.mobile = this.value
  834. break
  835. case 7:
  836. this.form.class = this.textarea
  837. break
  838. case 8:
  839. this.form.direction = this.textarea
  840. break
  841. case 9:
  842. this.form.project = this.textarea
  843. break
  844. case 10:
  845. this.form.results = this.textarea
  846. break
  847. case 20:
  848. this.form.password = this.password
  849. break
  850. case 30:
  851. this.form.rank = this.value
  852. break
  853. }
  854. this.show = !this.show
  855. }
  856. }
  857. }
  858. </script>
  859. <style lang="scss" scoped>
  860. .upload_image {
  861. width: 90%;
  862. margin: 0 auto;
  863. text {
  864. // color: ;
  865. display: inline-block;
  866. margin-top: 10px;
  867. }
  868. }
  869. .complate,
  870. .complate1 {
  871. width: 50%;
  872. margin: 0 auto;
  873. margin-top: 20%;
  874. line-height: 44px;
  875. text-align: center;
  876. height: 44px;
  877. background: #3B7653;
  878. opacity: 1;
  879. border-radius: 24px;
  880. font-size: 18px;
  881. font-family: PingFang SC;
  882. font-weight: 500;
  883. color: #FFFFFF;
  884. opacity: 1;
  885. }
  886. .complate1 {
  887. margin-top: 30px;
  888. }
  889. .real-name {
  890. padding: 0 16px;
  891. padding-bottom: 40px;
  892. .item {
  893. display: flex;
  894. align-items: center;
  895. height: 46px;
  896. line-height: 46px;
  897. position: relative;
  898. padding-left: 10px;
  899. .star {
  900. position: absolute;
  901. color: red;
  902. left: 0;
  903. }
  904. .label {
  905. flex: 0 0 30%;
  906. font-size: 16px;
  907. font-family: PingFang SC;
  908. font-weight: bold;
  909. line-height: 20px;
  910. color: #282828;
  911. opacity: 1;
  912. }
  913. .right {
  914. flex: 1;
  915. font-size: 13px;
  916. font-family: PingFang SC;
  917. font-weight: 400;
  918. line-height: 20px;
  919. color: rgba($color: #282828, $alpha: 0.42);
  920. // opacity: 0.42;
  921. text-align: right;
  922. image {
  923. width: 17px;
  924. height: 17px;
  925. opacity: 1;
  926. }
  927. }
  928. }
  929. .form {
  930. position: relative;
  931. .back {
  932. position: absolute;
  933. left: 10px;
  934. top: 0px;
  935. width: 30px;
  936. height: 44px;
  937. line-height: 44px;
  938. text-align: center;
  939. z-index: 9999;
  940. // background: #18B566;
  941. }
  942. .title {
  943. padding: 0 20px;
  944. height: 40px;
  945. line-height: 40px;
  946. }
  947. .input {
  948. margin: 0 20px;
  949. height: 40px;
  950. line-height: 40px;
  951. border-bottom: solid 1px rgba(175, 175, 175, .2);
  952. }
  953. }
  954. .item1 {
  955. position: relative;
  956. // padding-left: 10px;
  957. .star {
  958. position: absolute;
  959. color: red;
  960. left: 0;
  961. top: 14px;
  962. }
  963. .dec {
  964. font-size: 13px;
  965. font-family: PingFang SC;
  966. font-weight: 400;
  967. line-height: 20px;
  968. color: #AFAFAF;
  969. opacity: 1;
  970. padding-bottom: 10px;
  971. border-bottom: solid 1px rgba(175, 175, 175, .2);
  972. }
  973. }
  974. .buttom {
  975. width: 229px;
  976. height: 56px;
  977. line-height: 56px;
  978. background: #3B7653;
  979. ;
  980. text-align: center;
  981. border-radius: 28px;
  982. margin: 0 auto;
  983. margin-top: 50px;
  984. font-size: 18px;
  985. font-family: PingFang SC;
  986. font-weight: bold;
  987. color: #fff;
  988. opacity: 1;
  989. }
  990. }
  991. </style>