schoolDetails.vue 5.6 KB

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