student_require_my_detail.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <view>
  3. <my-requiredetail v-if="showDetail" :item="item" :location="location" :marker="marker" :timeAM="timeAM" :timePM="timePM" :timeEvening="timeEvening" :isShowPrivate="isShowPrivate" buttonMessage="新发布" @publishButton="publishButton"></my-requiredetail>
  4. </view>
  5. </template>
  6. <script>
  7. import formTime from '@/mixins/form-time.js'
  8. export default {
  9. mixins: [formTime],
  10. data() {
  11. return {
  12. showDetail: false,
  13. isShowPrivate: true,
  14. item: {},
  15. location: [],
  16. marker: [{
  17. id: 1,
  18. joinCluster:true,
  19. latitude: 0,
  20. longitude: 0,
  21. width: 40,
  22. height: 40,
  23. iconPath: '/static/location.png',
  24. }],
  25. };
  26. },
  27. onLoad(option) {
  28. if (option.requireId !== undefined) {
  29. const requireId = decodeURIComponent(option.requireId)
  30. this.getStuNeedDetailById(requireId)
  31. }
  32. },
  33. methods: {
  34. // 获取需求详情
  35. async getStuNeedDetailById(id) {
  36. const {data: result} = await uni.$http.get('/education/student-requirements/getPublishStuNeedsDetailById', {requireId: id})
  37. this.item = result.data.one
  38. this.formatForm()
  39. },
  40. // 上课表格格式化
  41. formatForm() {
  42. this.location = this.item.locationAl.split(",")
  43. this.marker[0].latitude = Number(this.location[0])
  44. this.marker[0].longitude = Number(this.location[1])
  45. this.courseWeekday = this.item.courseWeekday.split(",")
  46. this.parseCourseWeekday()
  47. this.showDetail = true
  48. },
  49. publishButton() {
  50. uni.navigateTo({
  51. url:'/subpkg/student/require/student_require_add?item='+encodeURIComponent(JSON.stringify(this.item))
  52. })
  53. }
  54. }
  55. }
  56. </script>
  57. <!-- 设置页面背景 -->
  58. <style lang="scss">
  59. page{
  60. height: 100%;
  61. // background-color: #FFF;
  62. }
  63. </style>
  64. <style lang="scss" scoped>
  65. </style>