schoolDetails.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <!-- 学校详情 -->
  2. <template>
  3. <view class="school-details">
  4. <!-- 导航栏 -->
  5. <u-navbar title="" :background="background" title-color="#fff" back-icon-color="#fff" :border-bottom="false"/>
  6. <view class="school-details-bg"></view>
  7. <view class="school-details-content">
  8. <view class="school-details-content-logo">
  9. <u-image :src="schoolInfo.schoolLogoUrl" width="140" height="140" border-radius="70" mode="aspectFill">
  10. <view slot="error">
  11. <u-image src="../../static/img/default-company.png" width="140" height="140" border-radius="70" mode="aspectFill"/>
  12. </view>
  13. </u-image>
  14. </view>
  15. <view class="school-details-content-name">{{ schoolInfo.schoolName }}</view>
  16. <!-- <view class="school-details-content-evaluate">
  17. <view class="left">
  18. <view class="evaluate">优秀</view>
  19. <view class="describe">综合评分</view>
  20. <view class="star">
  21. <u-icon name="star-fill" color="#EF651F"></u-icon>
  22. <u-icon name="star-fill" color="#EF651F"></u-icon>
  23. <u-icon name="star-fill" color="#EF651F"></u-icon>
  24. <u-icon name="star-fill" color="#EF651F"></u-icon>
  25. <u-icon name="star-fill" color="#EF651F"></u-icon>
  26. </view>
  27. <view class="grade">4.8</view>
  28. </view>
  29. <view class="right">
  30. 详情
  31. <u-icon class="icon" name="arrow-right" color="#666666"></u-icon>
  32. </view>
  33. </view> -->
  34. <!-- 学校概况 -->
  35. <view class="school-details-content-survey">
  36. <view class="title">学校概况</view>
  37. <view class="item">
  38. <view>学校名称:{{ schoolInfo.schoolName || '-' }}</view>
  39. <view>学校性质:{{ getSchoolTypeName(schoolInfo.schoolNature) }}</view>
  40. <view>培养方式:{{ schoolInfo.trainMethod || '-' }}</view>
  41. <view class="home" @click="jumpSchoolHome(schoolInfo.schoolUrl)">
  42. <view>
  43. 学校主页:<text>{{ schoolInfo.schoolUrl || '-' }}</text>
  44. </view>
  45. <view>
  46. <u-icon name="arrow-right" color="#EF651F" size="24"/>
  47. </view>
  48. </view>
  49. <view>招生邮箱:{{ schoolInfo.email || '-' }}</view>
  50. <view>联系人:{{ schoolInfo.linkUser || '-' }}</view>
  51. <view>联系电话:{{ schoolInfo.linkPhone || '-' }}</view>
  52. <view>地址:{{ schoolInfo.schoolAddress || '-' }}</view>
  53. <!-- <view class="address">
  54. <view>
  55. <image src="../../static/img/dingwei.png"/>
  56. 查看位置
  57. </view>
  58. </view> -->
  59. </view>
  60. </view>
  61. <!-- 学校信息 -->
  62. <view class="school-details-content-introduce">
  63. <view class="title">学校信息</view>
  64. <view class="content" v-if="schoolInfo.detatil">
  65. <u-parse :html="schoolInfo.detatil"/>
  66. </view>
  67. <u-empty v-else text="暂无学校信息" mode="data"></u-empty>
  68. </view>
  69. <!-- 学校相册 -->
  70. <!-- <view class="school-details-content-album">
  71. <view class="title">学校相册</view>
  72. <view class="pic-list">
  73. <view
  74. class="pic-list-item"
  75. v-for="(item, index) in picList"
  76. :key="index"
  77. >
  78. <image :src="item.url" mode=""></image>
  79. </view>
  80. </view>
  81. </view> -->
  82. <!-- 特色专业 -->
  83. <view class="school-details-content-major" v-if="schoolInfo.twinList && schoolInfo.twinList.length > 0">
  84. <view class="title">双高专业</view>
  85. <view class="major-list">
  86. <view class="major-list-item" v-for="(item, index) in schoolInfo.twinList" :key="index" @click="jumpPage('/pages/professionalDetails/professionalDetails', { id: item.id })">
  87. <view>{{ item.professionName }}(专业代码:{{ item.professionCode }})</view>
  88. <view>
  89. <u-icon name="arrow-right"/>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. <view class="school-details-content-major" v-if="schoolInfo.enrollList && schoolInfo.enrollList.length > 0">
  95. <view class="title">招生专业</view>
  96. <view class="major-list">
  97. <view class="major-list-item" v-for="(item, index) in schoolInfo.enrollList" :key="index" @click="jumpPage('/pages/professionalDetails/professionalDetails', { id: item.id })">
  98. <view>{{ item.professionName }}(专业代码:{{ item.professionCode }})</view>
  99. <view>
  100. <u-icon name="arrow-right"/>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. <u-toast ref="uToast" />
  107. </view>
  108. </template>
  109. <script>
  110. export default {
  111. data() {
  112. return {
  113. background: {
  114. backgroundColor: '#3D5D4C'
  115. },
  116. // 学校相册
  117. picList: [],
  118. // 学校id
  119. schoolId: '',
  120. // 学校信息
  121. schoolInfo: {},
  122. // 学校性质
  123. schoolTypeList: []
  124. }
  125. },
  126. onLoad(page) {
  127. if (page.schoolId) {
  128. this.schoolId = page.schoolId
  129. }
  130. },
  131. onShow() {
  132. this.getSchoolTypeList()
  133. if (this.schoolId) {
  134. uni.showLoading({
  135. title: '加载中'
  136. })
  137. this.getSchoolDetails(this.schoolId)
  138. }
  139. },
  140. methods: {
  141. /**
  142. * 通过学校id获取学校详情
  143. * @param { String } id 学校id
  144. */
  145. getSchoolDetails(id) {
  146. this.$u.api.school.getSchoolDetails({
  147. id: id
  148. }).then(res => {
  149. uni.hideLoading()
  150. if (res.code === 200) {
  151. this.schoolInfo = res.data
  152. }
  153. }).catch(err => {
  154. uni.hideLoading()
  155. this.$refs.uToast.show({
  156. title: err.data.message,
  157. type: 'error'
  158. })
  159. })
  160. },
  161. /**
  162. * 获取学校性质字典
  163. */
  164. getSchoolTypeList() {
  165. this.$u.api.getDictdataUrl({
  166. key: 'school_nature'
  167. }).then(res => {
  168. if (res.code === 200) {
  169. this.schoolTypeList = res.data
  170. }
  171. })
  172. },
  173. /**
  174. * 通过字典值去获取名称
  175. * @param { String } val 字典text值
  176. */
  177. getSchoolTypeName(val) {
  178. let name
  179. this.schoolTypeList.forEach(item => {
  180. if (Number(item.text) === Number(val)) {
  181. name = item.label
  182. }
  183. })
  184. return name
  185. },
  186. /**
  187. * 跳转到外部网页
  188. */
  189. jumpSchoolHome(url) {
  190. if (url) {
  191. location.href = url
  192. }
  193. },
  194. /**
  195. * 跳转到到指定页面
  196. */
  197. jumpPage(url, params) {
  198. this.$u.route({
  199. url: url,
  200. params: params
  201. })
  202. }
  203. }
  204. }
  205. </script>
  206. <style lang="scss" scoped>
  207. @import './schoolDetails.scss';
  208. </style>