registrationNotice.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!-- 报班通知 -->
  2. <template>
  3. <view class="registration">
  4. <u-navbar back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }"
  5. :border-bottom="false"></u-navbar>
  6. <z-paging ref="paging" v-model="noticeList" @query="queryList">
  7. <view class="registration-list">
  8. <view class="registration-list-item" v-for="(item, index) in noticeList" :key="index">
  9. <view class="left">
  10. <u-image :src="item.img" mode="aspectFill" width="200" height="216" border-radius="10" />
  11. </view>
  12. <view class="right">
  13. <view class="name">{{ item.name }}</view>
  14. <view class="school">{{ item.schoolName }}</view>
  15. <view class="content">
  16. <!-- <u-parse :html="item.description"></u-parse> -->
  17. </view>
  18. <view class="button" @click="signUp(item)">报名</view>
  19. </view>
  20. </view>
  21. </view>
  22. </z-paging>
  23. <u-toast ref="uToast" />
  24. <judge-auth ref="judgeAuth" @adoptAuth="adoptAuth" />
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. noticeList: []
  32. }
  33. },
  34. methods: {
  35. /**
  36. * 下拉分页组件触发
  37. * @param {Number} pageNum
  38. * @param {Number} pageSize
  39. */
  40. queryList(pageNum, pageSize) {
  41. this.getList(pageNum, pageSize)
  42. },
  43. /**
  44. * 获取列表
  45. * @param {Object} pageNum
  46. * @param {Object} pageSize
  47. */
  48. getList(pageNum, pageSize) {
  49. this.$u.api.skillTraining.getClassNoticeApi({
  50. pageNum,
  51. pageSize
  52. }).then(res => {
  53. if (res.code === 200) {
  54. this.$refs.paging.complete(res.rows)
  55. } else {
  56. this.$refs.paging.complete([]);
  57. this.$refs.uToast.show({
  58. title: res.msg,
  59. type: 'error'
  60. })
  61. }
  62. })
  63. },
  64. /**
  65. * 报名
  66. * @param {Object} item
  67. */
  68. signUp(item) {
  69. this.$refs['judgeAuth'].modalShow(item)
  70. },
  71. adoptAuth(item) {
  72. this.$u.api.skillTraining.signUpClassApi({
  73. packageId: item.id
  74. }).then(res => {
  75. if (res.code === 200) {
  76. this.jumpPage('/pages/skillsTraining/submitSuccess/submitSuccess');
  77. } else {
  78. this.$refs.uToast.show({
  79. title: res.msg,
  80. type: 'error'
  81. })
  82. }
  83. })
  84. },
  85. /**
  86. * 跳转到指定页面
  87. * @param { String } url
  88. * @param {Object} parmas
  89. */
  90. jumpPage(url, params) {
  91. this.$u.route({
  92. url,
  93. params
  94. })
  95. },
  96. }
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. @import './registrationNotice.scss';
  101. </style>