schoolDetails.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. uni.showLoading({
  125. title: '加载中'
  126. })
  127. if (this.schoolId) {
  128. setTimeout(() => {
  129. this.getSchoolDetails(this.schoolId)
  130. }, 300)
  131. }
  132. },
  133. methods: {
  134. /**
  135. * 通过学校id获取学校详情
  136. * @param { String } id 学校id
  137. */
  138. getSchoolDetails(id) {
  139. this.$u.api.school.getSchoolDetails({
  140. id: id
  141. }).then(res => {
  142. uni.hideLoading()
  143. if (res.code === 200) {
  144. this.schoolInfo = res.data
  145. }
  146. }).catch(err => {
  147. uni.hideLoading()
  148. this.$refs.uToast.show({
  149. title: err.data.message,
  150. type: 'error'
  151. })
  152. })
  153. },
  154. /**
  155. * 获取学校性质字典
  156. */
  157. getSchoolTypeList() {
  158. this.$u.api.getDictdataUrl({
  159. key: 'school_nature'
  160. }).then(res => {
  161. if (res.code === 200) {
  162. this.schoolTypeList = res.data
  163. }
  164. })
  165. },
  166. /**
  167. * 通过字典值去获取名称
  168. * @param { String } val 字典text值
  169. */
  170. getSchoolTypeName(val) {
  171. let name
  172. this.schoolTypeList.forEach(item => {
  173. if (Number(item.text) === Number(val)) {
  174. name = item.label
  175. }
  176. })
  177. return name
  178. },
  179. /**
  180. * 跳转到外部网页
  181. */
  182. jumpSchoolHome(url) {
  183. if (url) {
  184. location.href = url
  185. }
  186. },
  187. /**
  188. * 跳转到到指定页面
  189. */
  190. jumpPage(url, params) {
  191. this.$u.route({
  192. url: url,
  193. params: params
  194. })
  195. }
  196. }
  197. }
  198. </script>
  199. <style lang="scss" scoped>
  200. @import './schoolDetails.scss';
  201. </style>