schoolInfo.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <view class="content">
  3. <view class="box">
  4. <view class="vidLi">
  5. <view class="libox dfsb">
  6. <view class="imgbox dfsb"><image :src="newsInfo.logo" mode=""></image></view>
  7. <view class="dffd flex1">
  8. <view class="title">{{ newsInfo.name }}</view>
  9. <view class="subtit">
  10. <text v-for="(item, ind) in newsInfo.tags" :key="ind" class="fontssm">{{ item }}</text>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="vidinfo dfsb">
  15. <view class="li dffs fontssm">
  16. <image src="/static/img/pro/scadd.png" mode=""></image>
  17. {{ newsInfo.type_name }}
  18. </view>
  19. <view class="li dffs fontssm">
  20. <image src="/static/img/pro/scthr.png" mode=""></image>
  21. <!-- flag 1 = 公办 2 = 民办 -->
  22. {{ newsInfo.flag == 1 ? '公办' : '民办' }}
  23. </view>
  24. <view class=" li dffs fontssm">
  25. <image src="/static/img/pro/scadd.png" mode=""></image>
  26. {{ newsInfo.address }}
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="conwarp">
  32. <view class="gdHead bb">学校简介</view>
  33. <view class="auth">
  34. <view :style="{ height: height1 }" class="tit fontssm textgrey"><u-parse :content="newsInfo.content"></u-parse></view>
  35. <text @click="changHeight(1)" class="fontssm show green">{{ height1 == '100%' ? '收起' : '查看全部' }}</text>
  36. </view>
  37. </view>
  38. <view class="conwarp">
  39. <view class="gdHead bb">办学优势</view>
  40. <view class="auth">
  41. <view :style="{ height: height2 }" class="tit fontssm textgrey"><u-parse :content="newsInfo.advantage"></u-parse></view>
  42. <text @click="changHeight(2)" class="fontssm show green">{{ height2 == '100%' ? '收起' : '查看全部' }}</text>
  43. </view>
  44. </view>
  45. <view class="conwarp">
  46. <view class="gdHead bb">专业设置</view>
  47. <view class="auth">
  48. <view :style="{ height: height3 }" class="tit fontssm textgrey"><u-parse :content="newsInfo.major"></u-parse></view>
  49. <text @click="changHeight(3)" class="fontssm show green">{{ height3 == '100%' ? '收起' : '查看全部' }}</text>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. data() {
  57. return {
  58. id: '',
  59. height1: '196rpx',
  60. height2: '196rpx',
  61. height3: '196rpx',
  62. newsInfo: {}
  63. };
  64. },
  65. onPullDownRefresh() {
  66. setTimeout(res => {
  67. uni.stopPullDownRefresh();
  68. }, 1000);
  69. },
  70. onLoad(opt) {
  71. this.id = opt.id;
  72. this.getInfoList();
  73. },
  74. methods: {
  75. // 修改高度
  76. changHeight(val) {
  77. if (val == 1) {
  78. if (this.height1 == '100%') {
  79. this.height1 = '196rpx';
  80. } else {
  81. this.height1 = '100%';
  82. }
  83. } else if (val == 2) {
  84. if (this.height2 == '100%') {
  85. this.height2 = '196rpx';
  86. } else {
  87. this.height2 = '100%';
  88. }
  89. } else {
  90. if (this.height3 == '100%') {
  91. this.height3 = '196rpx';
  92. } else {
  93. this.height3 = '100%';
  94. }
  95. }
  96. },
  97. getInfoList() {
  98. this.$api
  99. .request('index/getSchoolInfo', {
  100. id: this.id
  101. })
  102. .then(data => {
  103. console.log(data);
  104. if (data.code == 200) {
  105. let tags = data.data.up_name.split('|');
  106. this.newsInfo = data.data;
  107. this.newsInfo.tags = tags;
  108. } else {
  109. this.$api.toast(data.msg);
  110. }
  111. });
  112. }
  113. }
  114. };
  115. </script>
  116. <style lang="scss" scoped>
  117. .content {
  118. .box {
  119. width: 750rpx;
  120. // height: 386rpx;
  121. background: linear-gradient(360deg, rgba(147, 173, 158, 0) 0%, #14ac54 100%);
  122. padding: 58rpx 30rpx 0rpx;
  123. }
  124. .vidLi {
  125. width: 100%;
  126. padding: 40rpx 38rpx 42rpx;
  127. margin-bottom: 32rpx;
  128. background-color: #fff;
  129. border-radius: 20rpx;
  130. .imgbox {
  131. width: 95rpx;
  132. height: 95rpx;
  133. margin-right: 30rpx;
  134. image {
  135. width: 100%;
  136. height: 100%;
  137. border-radius: 50%;
  138. }
  139. }
  140. .libox {
  141. width: 100%;
  142. margin-bottom: 30rpx;
  143. }
  144. .title {
  145. overflow: hidden;
  146. font-size: 30rpx;
  147. line-height: 42rpx;
  148. }
  149. .subtit {
  150. margin-top: 15rpx;
  151. .fontssm {
  152. padding: 3rpx 12rpx;
  153. color: #14ac54;
  154. background: rgba(20, 172, 84, 0.1);
  155. border-radius: 6px;
  156. border: 1px solid #14ac54;
  157. margin-right: 15rpx;
  158. }
  159. }
  160. .vidinfo {
  161. padding: 24rpx 0;
  162. background: rgba(#14ac54, 0.1);
  163. border-radius: 13rpx 13rpx 0 0;
  164. flex-wrap: wrap;
  165. &:nth-of-type(2) {
  166. border-radius: 0 0 13rpx 13rpx;
  167. }
  168. .li {
  169. padding: 0 30rpx;
  170. justify-content: center;
  171. align-items: center;
  172. image {
  173. width: 34rpx;
  174. height: 34rpx;
  175. margin-right: 11rpx;
  176. }
  177. &:last-of-type{
  178. margin-top: 20rpx;
  179. }
  180. }
  181. .spec{
  182. width: 100%;
  183. justify-content: flex-start;
  184. }
  185. }
  186. }
  187. .conwarp {
  188. background-color: #fff;
  189. padding: 32rpx 30rpx 30rpx;
  190. border-radius: 16rpx;
  191. margin-bottom: 20rpx;
  192. .gdHead {
  193. padding: 15rpx 18rpx;
  194. line-height: 58rpx;
  195. margin-bottom: 16rpx;
  196. font-size: 30rpx;
  197. font-family: PingFangSC-Medium, PingFang SC;
  198. font-weight: 500;
  199. color: #333333;
  200. line-height: 42rpx;
  201. border-left: 5rpx solid #15ab54;
  202. }
  203. .auth {
  204. margin-top: 15rpx;
  205. width: 100%;
  206. position: relative;
  207. .tit {
  208. font-size: 24rpx;
  209. line-height: 40rpx;
  210. overflow: hidden;
  211. }
  212. .show {
  213. height: 38rpx;
  214. line-height: 38rpx;
  215. position: absolute;
  216. background-color: #fff;
  217. bottom: 0;
  218. right: 0;
  219. }
  220. }
  221. }
  222. }
  223. </style>