offlineTrainingDetails.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <!-- 专业详情 -->
  2. <template>
  3. <view class="details">
  4. <view class="details-name">{{ info.adaptName }}</view>
  5. <view class="details-code">({{ info.adaptAddress }})</view>
  6. <view class="details-content">
  7. <u-parse v-if="info.adaptPlan" :html="info.adaptPlan"></u-parse>
  8. <u-empty v-else text="暂无专业详情" mode="data"></u-empty>
  9. </view>
  10. <u-toast ref="uToast" />
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. // id
  18. offlineId: '',
  19. // 信息
  20. info: ''
  21. }
  22. },
  23. onLoad(page) {
  24. if (page.id) {
  25. this.offlineId = page.id
  26. }
  27. },
  28. onShow() {
  29. if (this.offlineId) {
  30. uni.showLoading({
  31. title: '加载中'
  32. })
  33. this.getOfflineDetails(this.offlineId)
  34. }
  35. },
  36. methods: {
  37. /**
  38. * 通过本地获取专业信息
  39. */
  40. getOfflineDetails(id) {
  41. this.$u.api.training.getOfflineDetailsApi({
  42. id: id
  43. }).then(res => {
  44. uni.hideLoading()
  45. if (res.code === 200) {
  46. this.info = res.data
  47. }
  48. }).catch(err => {
  49. uni.hideLoading()
  50. this.$refs.uToast.show({
  51. title: '系统错误!',
  52. type: 'error'
  53. })
  54. })
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss" scoped>
  60. .details {
  61. padding: 0 32rpx;
  62. font-family: 'PingFangSC-Medium, PingFang SC';
  63. &-name {
  64. padding-top: 60rpx;
  65. text-align: center;
  66. font-size: 42rpx;
  67. color: #3D5D4C;
  68. font-weight: 600;
  69. }
  70. &-code {
  71. color: #606060;
  72. font-size: 36rpx;
  73. text-align: center;
  74. margin: 30rpx 0;
  75. }
  76. &-content {
  77. color: #545454;
  78. font-size: 24rpx;
  79. line-height: 40rpx;
  80. }
  81. &-total {
  82. color: #9B9B9B;
  83. font-size: 24rpx;
  84. margin-top: 60rpx;
  85. }
  86. }
  87. </style>