realname.vue 24 KB

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