student_require_add.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771
  1. <template>
  2. <view class="stu-require-container" style="background-color: #f0f0f0;">
  3. <uni-forms ref="baseForm" :model="baseFormData" labelWidth="75px" :rules="rules" validateTrigger="bind">
  4. <uni-forms-item label="姓名" name="name" required>
  5. <uni-easyinput v-model="baseFormData.name" placeholder="请输入姓名" maxlength="4" trim="both" />
  6. </uni-forms-item>
  7. <uni-forms-item label="手机号" name="phone" required>
  8. <uni-row>
  9. <uni-col :span="14">
  10. <uni-easyinput v-model="baseFormData.phone" placeholder="请输入手机号" :disabled="disabledPhone" trim="both" />
  11. </uni-col>
  12. <uni-col :span="8" :offset="2">
  13. <view class="phoneClass">
  14. <button class="getPhone" open-type="getPhoneNumber" type="primary" size="mini"
  15. @getphonenumber="getPhoneNumber">一键获取</button>
  16. </view>
  17. </uni-col>
  18. </uni-row>
  19. </uni-forms-item>
  20. <uni-forms-item label="微信号" name="wxid" required>
  21. <uni-easyinput v-model="baseFormData.wxid" placeholder="微信号(不便接听电话时微信沟通)" maxlength="25"
  22. trim="both" />
  23. </uni-forms-item>
  24. <uni-forms-item label="地址:" name="locationStr" required>
  25. <uni-easyinput type="text" v-model="baseFormData.locationStr" @focus="getLocation" maxlength="250" trim="both" />
  26. </uni-forms-item>
  27. <uni-forms-item label="选择课程" required>
  28. <uni-data-picker placeholder="请选择课程" popup-title="课程大纲-具体课程" v-model="baseFormData.subjectSmall" :clearIcon="false"
  29. :localdata="courseTree" />
  30. </uni-forms-item>
  31. <uni-forms-item label="辅导方式" required>
  32. <uni-data-checkbox v-model="baseFormData.mode" :localdata="modes" />
  33. </uni-forms-item>
  34. <uni-forms-item label="学员性别" required>
  35. <uni-data-checkbox v-model="baseFormData.sex" :localdata="sexs" />
  36. </uni-forms-item>
  37. <uni-forms-item label="上传头像" required>
  38. <uni-file-picker fileMediatype="image" :sizeType="sizeType" v-model="hhPhoto" :fileExtname="fileExtname" :imageStyles="listStyle" limit="1" @select="selectProfilePhoto" @delete="deletePhoto('profilePhoto', $event)" />
  39. </uni-forms-item>
  40. <uni-forms-item label="课时费" name="salary" required :errorMessage="errorPrice">
  41. <uni-easyinput v-model="baseFormData.salary" type="number" placeholder="请输入课时金额" />
  42. </uni-forms-item>
  43. <uni-forms-item label="上课时间" required>
  44. </uni-forms-item>
  45. <view class="tr-container">
  46. <view class="tr_1">
  47. <text class="th_0" decode="true">&ensp;&ensp;&ensp;&ensp;</text>
  48. <text class="th_1">周一</text>
  49. <text class="th_1">周二</text>
  50. <text class="th_1">周三</text>
  51. <text class="th_1">周四</text>
  52. <text class="th_1">周五</text>
  53. <text class="th_1">周六</text>
  54. <text class="th_1">周日</text>
  55. </view>
  56. <view class="tr_2">
  57. <checkbox-group @change="chechboxChangeAM">
  58. <view class="th2_0">上午</view>
  59. <label v-for="item in timeAM" :key="item.value">
  60. <checkbox class="th2_1" :value="item.value" :checked="item.checked"></checkbox>
  61. </label>
  62. </checkbox-group>
  63. </view>
  64. <view class="tr_2">
  65. <checkbox-group @change="chechboxChangePM">
  66. <view class="th2_0">下午</view>
  67. <label v-for="item in timePM" :key="item.value">
  68. <checkbox class="th2_1" :value="item.value" :checked="item.checked"></checkbox>
  69. </label>
  70. </checkbox-group>
  71. </view>
  72. <view class="tr_2">
  73. <checkbox-group @change="chechboxChangeEvening">
  74. <view class="th2_0">晚上</view>
  75. <label v-for="item in timeEvening" :key="item.value">
  76. <checkbox class="th2_1" :value="item.value" :checked="item.checked"></checkbox>
  77. </label>
  78. </checkbox-group>
  79. </view>
  80. </view>
  81. <uni-forms-item label="期望目标" name="goal">
  82. <uni-easyinput type="textarea" v-model="baseFormData.goal" maxlength="100" trim="both" />
  83. </uni-forms-item>
  84. <uni-forms-item label="教员身份" required>
  85. <uni-data-checkbox v-model="baseFormData.teacherType" :localdata="identifies" />
  86. </uni-forms-item>
  87. <uni-forms-item label="教员学历" required>
  88. <uni-data-select v-model="baseFormData.teacherEdu" :localdata="educations" />
  89. </uni-forms-item>
  90. <uni-forms-item label="教员性别" required>
  91. <uni-data-checkbox v-model="baseFormData.teacherGender" :localdata="sexsTeacher" />
  92. </uni-forms-item>
  93. <uni-forms-item label="教员照片" required>
  94. <uni-data-checkbox v-model="baseFormData.teacherProfilePhoto" :localdata="hasPhotoes" />
  95. </uni-forms-item>
  96. <uni-forms-item label="对教员要求" name="teacherDemanded">
  97. <uni-easyinput type="textarea" v-model="baseFormData.teacherDemanded" maxlength="100" trim="both" />
  98. </uni-forms-item>
  99. </uni-forms>
  100. <view class="submitBtnWrapper">
  101. <button class="submitBtn" type="primary" @click="submit" :disabled="addflag">提交需求</button>
  102. </view>
  103. <!-- 裁剪图片的插件 -->
  104. <ksp-cropper mode="fixed" :width="160" :height="160" :maxWidth="1024" :maxHeight="1024" :url="profilePhotoUrl" @cancel="profilePhotoUrloncancel" @ok="profilePhotoUrlonok"></ksp-cropper>
  105. </view>
  106. </template>
  107. <script>
  108. import { mapState } from 'vuex'
  109. export default {
  110. computed: {
  111. ...mapState('m_user', ['userinfo'])
  112. },
  113. data() {
  114. return {
  115. disabledPhone: true,
  116. listStyle: {
  117. "height": 100, // 边框高度
  118. "width": 100, // 边框宽度
  119. "border":{ // 如果为 Boolean 值,可以控制边框显示与否
  120. "color":"#ccc", // 边框颜色
  121. "width":"1px", // 边框宽度
  122. "style":"solid", // 边框样式
  123. }
  124. },
  125. addflag: false,
  126. profilePhotoUrl: '',
  127. fileExtname: 'png,jpg',
  128. sizeType: ['compressed'],
  129. hhPhoto: [{
  130. url: '',
  131. extname: '',
  132. name: ''
  133. }],
  134. loading: false,
  135. errorPrice: '',
  136. courseAM: [],
  137. coursePM: [],
  138. courseEV: [],
  139. courseWeekday: [],
  140. // 表单数据
  141. baseFormData: {
  142. name: '',
  143. phone: '',
  144. wxid: '',
  145. subjectSmall: '1-1',
  146. mode: '教员上门',
  147. sex: '男',
  148. profilePhoto: '',
  149. salary: 0,
  150. courseWeekday: [],
  151. goal: '',
  152. teacherType: '专职教员',
  153. teacherEdu: '',
  154. teacherGender: '男',
  155. teacherProfilePhoto: '有',
  156. teacherDemanded: '',
  157. locationStr: '',
  158. locationAl: ''
  159. },
  160. coursePrice: [],
  161. // 选择课程
  162. courseTree: [{
  163. text: '一年级',
  164. value: '1-0',
  165. children: [{
  166. text: '1.1班',
  167. value: '1-1'
  168. }
  169. ]
  170. }
  171. ],
  172. // 单选辅导方式数据源
  173. modes: [{
  174. text: '教员上门',
  175. value: '教员上门'
  176. },
  177. {
  178. text: '学员上门',
  179. value: '学员上门'
  180. },
  181. {
  182. text: '线上辅导',
  183. value: '线上辅导'
  184. }],
  185. // 单选性别数据源
  186. sexs: [{
  187. text: '男',
  188. value: '男'
  189. },
  190. {
  191. text: '女',
  192. value: '女'
  193. }],
  194. // 单选老师身份
  195. identifies: [{
  196. text: '专职教员',
  197. value: '专职教员'
  198. }, {
  199. text: '学生教员',
  200. value: '学生教员'
  201. }],
  202. educations: [{
  203. value: '专科在读',
  204. text: '专科在读及以上'
  205. },
  206. {
  207. value: '专科毕业',
  208. text: '专科毕业及以上'
  209. },
  210. {
  211. value: '本科在读',
  212. text: '本科在读及以上'
  213. },
  214. {
  215. value: '本科毕业',
  216. text: '本科毕业及以上'
  217. },
  218. {
  219. value: '硕士在读',
  220. text: '硕士在读及以上'
  221. },
  222. {
  223. value: '硕士毕业',
  224. text: '硕士毕业及以上'
  225. },
  226. {
  227. value: '博士在读',
  228. text: '博士在读及以上'
  229. },
  230. {
  231. value: '博士毕业',
  232. text: '博士毕业及以上'
  233. },
  234. {
  235. value: '不限',
  236. text: '不限'
  237. }],
  238. // 单选老师性别
  239. sexsTeacher: [{
  240. text: '男',
  241. value: '男'
  242. },
  243. {
  244. text: '女',
  245. value: '女'
  246. }],
  247. // 单选老师有无照片
  248. hasPhotoes: [{
  249. text: '有',
  250. value: '有'
  251. },
  252. {
  253. text: '无',
  254. value: '无'
  255. }],
  256. // 上课时间
  257. // 上午
  258. timeAM: [{
  259. value: 'A1',
  260. name: '1',
  261. checked: false
  262. },
  263. {
  264. name: '2',
  265. value: 'A2',
  266. checked: false
  267. },
  268. {
  269. name: '3',
  270. value: 'A3',
  271. checked: false
  272. },
  273. {
  274. name: '4',
  275. value: 'A4',
  276. checked: false
  277. },
  278. {
  279. name: '5',
  280. value: 'A5',
  281. checked: false
  282. },
  283. {
  284. name: '6',
  285. value: 'A6',
  286. checked: false
  287. },
  288. {
  289. name: '7',
  290. value: 'A7',
  291. checked: false
  292. }
  293. ],
  294. // 下午
  295. timePM: [{
  296. value: 'P1',
  297. name: '1',
  298. checked: false
  299. },
  300. {
  301. name: '2',
  302. value: 'P2',
  303. checked: false
  304. },
  305. {
  306. name: '3',
  307. value: 'P3',
  308. checked: false
  309. },
  310. {
  311. name: '4',
  312. value: 'P4',
  313. checked: false
  314. },
  315. {
  316. name: '5',
  317. value: 'P5',
  318. checked: false
  319. },
  320. {
  321. name: '6',
  322. value: 'P6',
  323. checked: false
  324. },
  325. {
  326. name: '7',
  327. value: 'P7',
  328. checked: false
  329. }
  330. ],
  331. // 晚上
  332. timeEvening: [{
  333. name: '1',
  334. value: 'E1',
  335. checked: false
  336. },
  337. {
  338. name: '2',
  339. value: 'E2',
  340. checked: false
  341. },
  342. {
  343. name: '3',
  344. value: 'E3',
  345. checked: false
  346. },
  347. {
  348. name: '4',
  349. value: 'E4',
  350. checked: false
  351. },
  352. {
  353. name: '5',
  354. value: 'E5',
  355. checked: false
  356. },
  357. {
  358. name: '6',
  359. value: 'E6',
  360. checked: false
  361. },
  362. {
  363. name: '7',
  364. value: 'E7',
  365. checked: false
  366. }
  367. ],
  368. rules: {
  369. name: {
  370. rules: [{
  371. required: true,
  372. errorMessage: '请输入姓名',
  373. }]
  374. },
  375. wxid: {
  376. rules: [{
  377. required: true,
  378. errorMessage: '请输入微信号',
  379. }, {
  380. errorMessage: '请输入正确的微信号',
  381. pattern: '^[a-zA-Z][a-zA-Z\\d_-]{5,19}$',
  382. }]
  383. },
  384. phone: {
  385. rules: [{
  386. required: true,
  387. errorMessage: '请输入手机号',
  388. }, {
  389. errorMessage: '请输入正确的手机号',
  390. pattern: '^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\\d{8}$',
  391. }]
  392. },
  393. salary: {
  394. rules: [{
  395. required: true,
  396. errorMessage: '请输入课时费'
  397. }]
  398. },
  399. }
  400. };
  401. },
  402. onLoad(option) {
  403. if (option.item) {
  404. let item = JSON.parse(decodeURIComponent(option.item))
  405. this.formatStuNeed(item)
  406. } else {
  407. this.hhPhoto = []
  408. }
  409. this.getPriceAndTree()
  410. },
  411. methods: {
  412. deletePhoto(item, e) {
  413. this.baseFormData[item] = ''
  414. },
  415. selectProfilePhoto(e) {
  416. this.hhPhoto = []
  417. this.profilePhotoUrl = e.tempFilePaths[0]
  418. },
  419. profilePhotoUrlonok(ev) {
  420. const evPath = ev.path
  421. this.hhPhoto = {
  422. url: evPath
  423. }
  424. this.profilePhotoUrl = ''
  425. this.upload(evPath, 'profilePhoto')
  426. },
  427. profilePhotoUrloncancel() {
  428. this.hhPhoto = null
  429. // url设置为空,隐藏控件
  430. this.profilePhotoUrl = "";
  431. },
  432. upload(path, item) {
  433. wx.uploadFile({
  434. url: uni.$http.baseUrl + '/file/uploading',
  435. filePath: path,
  436. name: 'file',
  437. header: {
  438. token: uni.getStorageSync('token')
  439. },
  440. success: res => {
  441. const result = JSON.parse(res.data)
  442. this.baseFormData[item] = result.data.url
  443. },
  444. fail: res => {
  445. if (res.errno === 1001) {
  446. uni.$showMsg('只能选择.jpg或者.png的图片')
  447. }
  448. }
  449. })
  450. },
  451. // 格式化传递过来的stuneed信息
  452. formatStuNeed(item) {
  453. item.datetime = null
  454. item.deal = null
  455. item.deleted = null
  456. item.display = null
  457. item.id = null
  458. item.locked = null
  459. item.requireId = null
  460. item.uid = null
  461. item.verifyRefuseReason = null
  462. item.verifyStatus = null
  463. this.baseFormData = item
  464. this.courseWeekday = item.courseWeekday.split(",")
  465. this.baseFormData.courseWeekday = this.courseWeekday
  466. for (let i = 0; i < this.courseWeekday.length; i++) {
  467. for (let x = 0; x < this.timeAM.length; x++) {
  468. if (this.courseWeekday[i] == this.timeAM[x].value) {
  469. this.timeAM[x].checked = true
  470. this.courseAM.push(this.courseWeekday[i])
  471. }
  472. }
  473. for (let y = 0; y < this.timePM.length; y++) {
  474. if (this.courseWeekday[i] == this.timePM[y].value) {
  475. this.timePM[y].checked = true
  476. this.coursePM.push(this.courseWeekday[i])
  477. }
  478. }
  479. for (let z = 0; z < this.timeEvening.length; z++) {
  480. if (this.courseWeekday[i] == this.timeEvening[z].value) {
  481. this.timeEvening[z].checked = true
  482. this.courseEV.push(this.courseWeekday[i])
  483. }
  484. }
  485. }
  486. if (this.courseAM.length > 0) {
  487. this.courseAM.push(this.courseAM.join().split(','))
  488. }
  489. if (this.coursePM.length > 0) {
  490. this.coursePM.push(this.coursePM.join().split(','))
  491. }
  492. if (this.courseEV.length > 0) {
  493. this.courseEV.push(this.courseEV.join().split(','))
  494. }
  495. this.hhPhoto[0].url = this.baseFormData.profilePhoto
  496. this.hhPhoto[0].name = 'profilePhoto'
  497. },
  498. // 手机号
  499. async getPhoneNumber(e) {
  500. if (e.detail.code === undefined) return uni.$showMsg('获取手机号失败!')
  501. const query = {
  502. code: e.detail.code
  503. }
  504. const {
  505. data: result
  506. } = await uni.$http.get('/ucenter/mini-program-openid-uid/wxGetPhone', query)
  507. if (result.data.phone === '' || result.data.phone === null) {
  508. this.disabledPhone = false
  509. return uni.$showMsg('手机号获取失败,请手动输入')
  510. } else {
  511. this.baseFormData.phone = result.data.phone
  512. return uni.$showMsg('获取手机成功!')
  513. }
  514. },
  515. // 树形结构的课程和价格表
  516. async getPriceAndTree() {
  517. const {
  518. data: result
  519. } = await uni.$http.get('/education/course-price/treeAndPrice')
  520. this.courseTree = result.data.treeCourse
  521. this.coursePrice = result.data.coursePrice
  522. },
  523. // 上午复选框
  524. chechboxChangeAM(e) {
  525. this.courseAM.push(e.detail.value)
  526. },
  527. // 下午复选框
  528. chechboxChangePM(e) {
  529. this.coursePM.push(e.detail.value)
  530. },
  531. // 晚上复选框
  532. chechboxChangeEvening(e) {
  533. this.courseEV.push(e.detail.value)
  534. },
  535. // 获取老师地理位置
  536. getLocation() {
  537. wx.chooseLocation({
  538. success: res => {
  539. if (res.errMsg === 'chooseLocation:ok') {
  540. this.baseFormData.locationStr = res.address + res.name
  541. this.baseFormData.locationAl = res.latitude + ',' + res.longitude
  542. }
  543. }
  544. })
  545. },
  546. // 提交
  547. submit() {
  548. if (this.isLoading) {
  549. return uni.$showMsg('操作过快,请耐心等待…')
  550. }
  551. this.isLoading = true
  552. this.baseFormData.courseWeekday = []
  553. this.$refs.baseForm.validate().then(res => {
  554. if (this.baseFormData.phone === '') return uni.$showMsg('手机号未获取!')
  555. if (this.baseFormData.locationStr === '') return uni.$showMsg('请选择地址!')
  556. if (this.baseFormData.profilePhoto === undefined || this.baseFormData.profilePhoto === '') return uni.$showMsg('头像未上传!')
  557. if (this.baseFormData.subjectSmall === '1-1' || this.baseFormData.subjectSmall === '') return uni.$showMsg('请选择课程')
  558. if (this.courseAM.length === 0 && this.coursePM.length === 0 && this.courseEV.length === 0 ) return uni.$showMsg('请选择上课时间!')
  559. if (this.courseAM[this.courseAM.length - 1] == '' && this.coursePM.length === 0 && this.courseEV.length === 0 ) return uni.$showMsg('请选择上课时间!')
  560. if (this.courseAM.length === 0 && this.coursePM[this.coursePM.length - 1] == '' && this.courseEV.length === 0 ) return uni.$showMsg('请选择上课时间!')
  561. if (this.courseAM.length === 0 && this.coursePM.length === 0 && this.courseEV[this.courseEV.length - 1] == '' ) return uni.$showMsg('请选择上课时间!')
  562. if (this.courseAM[this.courseAM.length - 1] == '' && this.coursePM[this.coursePM.length - 1] == '' && this.courseEV.length === 0 ) return uni.$showMsg('请选择上课时间!')
  563. if (this.courseAM[this.courseAM.length - 1] == '' && this.coursePM.length === 0 && this.courseEV[this.courseEV.length - 1] == '' ) return uni.$showMsg('请选择上课时间!')
  564. if (this.courseAM.length === 0 && this.coursePM[this.coursePM.length - 1] == '' && this.courseEV[this.courseEV.length - 1] == '' ) return uni.$showMsg('请选择上课时间!')
  565. if (this.courseAM[this.courseAM.length - 1] == '' && this.coursePM[this.coursePM.length - 1] == '' && this.courseEV[this.courseEV.length - 1] == '' ) return uni.$showMsg('请选择上课时间!')
  566. if (this.courseAM.length > 0) {
  567. this.baseFormData.courseWeekday.push(this.courseAM[this.courseAM.length - 1])
  568. }
  569. if (this.coursePM.length > 0) {
  570. this.baseFormData.courseWeekday.push(this.coursePM[this.coursePM.length - 1])
  571. }
  572. if (this.courseEV.length > 0) {
  573. this.baseFormData.courseWeekday.push(this.courseEV[this.courseEV.length - 1])
  574. }
  575. // 上课时间
  576. this.baseFormData.courseWeekday = this.baseFormData.courseWeekday.join()
  577. // 末尾为,
  578. if (this.baseFormData.courseWeekday.slice(-1) === ',') {
  579. this.baseFormData.courseWeekday = this.baseFormData.courseWeekday.substring(0, this.baseFormData.courseWeekday.length - 1)
  580. }
  581. // 开始为,
  582. if (this.baseFormData.courseWeekday.slice(0,1) === ',') {
  583. let temp = this.baseFormData.courseWeekday.substring(1, this.baseFormData.courseWeekday.length )
  584. this.baseFormData.courseWeekday = temp
  585. }
  586. // 教员学历
  587. if (this.baseFormData.teacherEdu === '') return uni.$showMsg('请选择教员学历!')
  588. // 课时费
  589. let city = this.userinfo.city
  590. for(let i = 0; i < this.coursePrice.length; i++) {
  591. if(this.coursePrice[i].courseName === this.baseFormData.subjectSmall) {
  592. // console.log(this.coursePrice[i].priceMapping.stu_price_2_l)
  593. // 二线城市
  594. if (city != '北京' || city != '上海' || city != '广州' || city != '深圳') {
  595. // 学生
  596. if (this.baseFormData.teacherType === '学生教员') {
  597. if (this.coursePrice[i].priceMapping.stu_price_2_l > this.baseFormData.salary || this.baseFormData.salary > this.coursePrice[i].priceMapping.stu_price_2_h) {
  598. this.errorPrice = '价格在' + this.coursePrice[i].priceMapping.stu_price_2_l + '~' + this.coursePrice[i].priceMapping.stu_price_2_h + '之间'
  599. return uni.$showMsg('请合理选择课时费')
  600. }
  601. } else {
  602. if (this.coursePrice[i].priceMapping.fulltime_price_2_l > this.baseFormData.salary || this.baseFormData.salary > this.coursePrice[i].priceMapping.fulltime_price_2_h) {
  603. this.errorPrice = '价格在' + this.coursePrice[i].priceMapping.fulltime_price_2_l + '~' + this.coursePrice[i].priceMapping.fulltime_price_2_h + '元之间'
  604. return uni.$showMsg('请合理选择课时费')
  605. }
  606. }
  607. } else {
  608. // 学生
  609. if (this.baseFormData.teacherType === '学生教员') {
  610. if (this.coursePrice[i].priceMapping.stu_price_1_l > this.baseFormData.salary || this.baseFormData.salary > this.coursePrice[i].priceMapping.stu_price_1_h) {
  611. this.errorPrice = '价格在' + this.coursePrice[i].priceMapping.stu_price_1_l + '~' + this.coursePrice[i].priceMapping.stu_price_1_h + '之间'
  612. return uni.$showMsg('请合理选择课时费')
  613. }
  614. } else {
  615. if (this.coursePrice[i].priceMapping.fulltime_price_1_l > this.baseFormData.salary || this.baseFormData.salary > this.coursePrice[i].priceMapping.fulltime_price_1_h) {
  616. this.errorPrice = '价格在' + this.coursePrice[i].priceMapping.fulltime_price_1_l + '~' + this.coursePrice[i].priceMapping.fulltime_price_1_h + '之间'
  617. return uni.$showMsg('请合理选择课时费')
  618. }
  619. }
  620. }
  621. }
  622. }
  623. // 课程科目
  624. for (let x = 0; x < this.courseTree.length; x++) {
  625. for (let y = 0; y < this.courseTree[x].children.length; y++) {
  626. if (this.courseTree[x].children[y].value === this.baseFormData.subjectSmall) {
  627. this.baseFormData.subjectBig = this.courseTree[x].value
  628. }
  629. }
  630. }
  631. this.addflag = true
  632. uni.request({
  633. url: `${uni.$http.baseUrl}/education/student-requirements/publishRequirements`,
  634. data: this.baseFormData,
  635. header: {
  636. token: uni.getStorageSync('token')
  637. },
  638. method: 'POST',
  639. success: res => {
  640. uni.$showMsg(res.data.message)
  641. setTimeout(() => {
  642. uni.navigateBack({
  643. delta: 2
  644. })
  645. }, 1000)
  646. },
  647. complete: () => {
  648. setTimeout(() => {
  649. this.addflag = false
  650. }, 1000)
  651. }
  652. })
  653. }).catch(err => {
  654. this.isLoading = false
  655. })
  656. this.isLoading = false
  657. }
  658. }
  659. }
  660. </script>
  661. <!-- 设置页面背景 -->
  662. <style lang="scss">
  663. page{
  664. height: 100%;
  665. //background-color: #FFF2CC;
  666. }
  667. </style>
  668. <style lang="scss" scoped>
  669. .stu-require-container{
  670. width: 96%;
  671. height: 100%;
  672. padding-left: 20rpx;
  673. }
  674. .tr-container{
  675. display: flex;
  676. position: relative;
  677. width: 96%;
  678. flex-direction: column;
  679. font-size: 26rpx;
  680. /* border: 1rpx solid gray; */
  681. margin: -10px 20rpx;
  682. margin-bottom: 20px;
  683. }
  684. .tr_1 {
  685. display: flex;
  686. position: relative;
  687. height: 80rpx;
  688. line-height: 80rpx;
  689. }
  690. .tr_2{
  691. display: block;
  692. height: 80rpx;
  693. line-height: 80rpx;
  694. }
  695. .th_0,
  696. .th_1,
  697. .th_2,
  698. .th2_0,
  699. .th2_1,
  700. .th2_2{
  701. width: 12%;
  702. height: 80rpx;
  703. line-height: 80rpx;
  704. border-right: 1rpx solid gray;
  705. border-bottom: 1rpx solid gray;
  706. text-align: center;
  707. }
  708. .th_0,
  709. .th_1,
  710. .th_2{
  711. border-top: 1rpx solid gray;
  712. }
  713. .th_0,
  714. .th2_0{
  715. border-left: 1rpx solid gray;
  716. }
  717. .th2_0{
  718. float: left;
  719. width: 12%;
  720. height: 80rpx;
  721. line-height: 80rpx;
  722. text-align: center;
  723. /* background-color: greenyellow; */
  724. }
  725. // 提交按钮样式
  726. .submitBtnWrapper{
  727. height: 140rpx;
  728. align-items: center;
  729. }
  730. .submitBtn{
  731. width: 300rpx;
  732. border-radius: 50rpx;
  733. // margin-bottom: 40rpx;
  734. background-color: #35b882;
  735. }
  736. // 获取手机号按钮背景颜色
  737. .getPhone{
  738. background-color: #35b882;
  739. }
  740. .profilePhotoClass {
  741. position: absolute;
  742. left:-6000px;
  743. top:-6000px;
  744. }
  745. .phoneClass {
  746. margin-top: 6rpx;
  747. }
  748. </style>