upgrade.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <view>
  3. <image class="banner" src="../../static/img/banner-upgrade.png" mode="scaleToFill"></image>
  4. <u-card class="skill-list" margin="0 30rpx" :body-style="{'padding-bottom':'0'}" :border="false"
  5. :foot-border-top="false" :full="true" border-radius="0">
  6. <view class="card-head" slot="head">
  7. <view class="card-head-title">热门专业</view>
  8. </view>
  9. <view class="news-list-body u-flex u-row-between u-flex-wrap" slot="body">
  10. <u-nodata notice="暂无热门专业" v-if="majorList.length==0"></u-nodata>
  11. <view v-for="(item,index) in majorList" @click="skillClick(item)" :key="item.artId" class="u-body-item">
  12. <image :src="item.img" mode="scaleToFill"></image>
  13. <view class="text">
  14. <view class="name">{{item.name}}</view>
  15. <view class="school">{{item.school}}</view>
  16. </view>
  17. </view>
  18. </view>
  19. </u-card>
  20. <u-card class="school-list" :body-style="{'margin-bottom':'0','padding-bottom':'0'}" :border="false"
  21. :foot-border-top="false" :full="true" border-radius="0">
  22. <view class="card-head u-flex u-row-between" slot="head">
  23. <view class="card-head-title">合作院校</view>
  24. <view class="right" @click="openPage('pages/schools/schools')">
  25. 查看更多
  26. <u-icon name="arrow-right" color="#969799" size="28"></u-icon>
  27. </view>
  28. </view>
  29. <view class="school-list-body" slot="body">
  30. <u-nodata notice="暂无合作院校" v-if="schoolList.length==0"></u-nodata>
  31. <view class="school-logo-wrap u-flex u-row-between">
  32. <image @click="schoolToggle(index)" :class="{active:schoolActive==index}" class="school-logo"
  33. v-for="(item,index) in schoolList" :key="item.id" :src="item.schoolLogoUrl" mode="aspectFit">
  34. </image>
  35. </view>
  36. <view class="name u-flex u-row-between" @click="schoolClick(schoolList[schoolActive])">
  37. <!-- <view class="text">{{schoolList[schoolActive].schoolName}}</view> -->
  38. <u-icon name="arrow-right" color="#969799" size="28"></u-icon>
  39. </view>
  40. <view class="content">
  41. <!-- {{schoolList[schoolActive].detatil}} -->
  42. </view>
  43. </view>
  44. </u-card>
  45. <u-card class="support" :body-style="{'margin-bottom':'24rpx'}" :border="false" :foot-border-top="false"
  46. :full="true" border-radius="0">
  47. <view class="card-head u-flex u-row-between" slot="head">
  48. <view class="card-head-title">政策支持</view>
  49. </view>
  50. <view class="support-body" slot="body">
  51. <u-nodata notice="暂无新闻" v-if="schoolList.length==0"></u-nodata>
  52. <view class="big-news" @click="$u.route('/pages/newsDetails/newsDetails',{artId:bigNews.artId})">
  53. <image :src="bigNews.artImage" mode="aspectFill"></image>
  54. <view class="text">{{bigNews.artTitle}}</view>
  55. </view>
  56. <view v-for="(item,index) in newsList"
  57. @click="$u.route('/pages/newsDetails/newsDetails',{artId:item.artId})" :key="item.artId"
  58. class="u-body-item u-flex u-border-bottom u-col-between u-row-between">
  59. <view class="news-text">
  60. <view class="u-body-item-title u-line-2">{{item.artTitle}}</view>
  61. <view class="foot u-flex">
  62. <view class="">{{item.artCategoryName}}</view>
  63. <view class="time">{{$u.timeFormat(item.createTime.replace(/-/g, '/'), 'mm月dd日 hh时MM分')}}
  64. </view>
  65. </view>
  66. </view>
  67. <image :src="item.artImage" mode="aspectFill"></image>
  68. </view>
  69. </view>
  70. </u-card>
  71. </view>
  72. </template>
  73. <script>
  74. import mock from "../../static/js/mock.js";
  75. export default {
  76. data() {
  77. return {
  78. schoolActive: 0,
  79. keyword: '',
  80. selectShow: false,
  81. newsList: [],
  82. bigNews: [],
  83. majorList: mock.majorList,
  84. schoolList: [],
  85. selectList: [{
  86. value: 1,
  87. label: '贵州交通职业技术学院',
  88. children: [{
  89. value: 2,
  90. label: '技术1'
  91. },
  92. {
  93. value: 5,
  94. label: '技术2'
  95. }
  96. ]
  97. },
  98. {
  99. value: 8,
  100. label: '贵州医学院',
  101. children: [{
  102. value: 9,
  103. label: '技术3'
  104. }]
  105. }
  106. ],
  107. }
  108. },
  109. // onLoad() {
  110. // this.getNewsList();
  111. // this.getSchoolList();
  112. // },
  113. onShow() {
  114. },
  115. methods: {
  116. getSchoolList() {
  117. this.$u.api.getSchoolList({
  118. pageNum: 1,
  119. pageSize: 5
  120. }).then(res => {
  121. if (res.code == 200) {
  122. this.schoolList = res.rows
  123. } else {
  124. uni.showToast({
  125. icon: 'none',
  126. title: res.msg
  127. })
  128. }
  129. })
  130. },
  131. openPage(path, msg) {
  132. this.$u.route({
  133. url: path,
  134. params: {
  135. msg: msg
  136. }
  137. })
  138. },
  139. getNewsList() {
  140. let params = {
  141. artCategoryId: 2,
  142. pageNum: 1,
  143. pageSize: 10
  144. }
  145. this.$u.api.indexApi.getIndexNewsListApi(params)
  146. .then(res => {
  147. this.newsList = res.rows;
  148. this.bigNews = this.newsList[0];
  149. this.newsList.shift();
  150. console.log('this.newsList', this.newsList)
  151. // console.log('newsList',JSON.parse(JSON.stringify(res.rows)));
  152. })
  153. },
  154. selectConfirm(e) {
  155. console.log('selectConfirm', e);
  156. this.keyword = e[0].label + ' ' + e[1].label
  157. },
  158. search(e) {
  159. console.log('selectConfirm', e)
  160. },
  161. schoolToggle(index) {
  162. this.schoolActive = index;
  163. console.log('schoolToggle index', index);
  164. },
  165. skillClick(item) {
  166. console.log('item', item);
  167. let analysisParams = {
  168. platform: '1', //平台:1-H5 2-APP 3-小程序 4-PC端
  169. pages: location.href, //页面路径
  170. btnName: '', //按钮名称
  171. btnEvent: '1', //按钮事件: 1-点击 2-长按 3-滑动
  172. ipAddress: '', //IP地址
  173. typeName: '学历提升关注度', //类型名称 例:学校关注度 、适应性考试等
  174. typeCode: '', //类型编码 例:类型名称首字母缩写(XXGZD)
  175. categoryName: item.name, //类别名称 例:XX学校,SS考试
  176. };
  177. uni.request({
  178. url: '/apis/cityjson?ie=utf-8',
  179. method: 'GET',
  180. success: (res) => {
  181. // console.log('this',this);
  182. const reg = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/;
  183. let ip = reg.exec(res.data);
  184. analysisParams.ipAddress = ip[0];
  185. console.log('analysisParams', analysisParams);
  186. }
  187. });
  188. this.$u.api.postAnalysis(analysisParams).then(res => {
  189. console.log('res', res);
  190. });
  191. this.$u.route({
  192. url: '/pages/inbuild/inbuild',
  193. params: {
  194. msg: '热门专业',
  195. artId: item.artId
  196. }
  197. });
  198. },
  199. schoolClick(item) {
  200. console.log('schoolClick item', item);
  201. let analysisParams = {
  202. platform: '1', //平台:1-H5 2-APP 3-小程序 4-PC端
  203. pages: location.href, //页面路径
  204. btnName: '', //按钮名称
  205. btnEvent: '1', //按钮事件: 1-点击 2-长按 3-滑动
  206. ipAddress: '', //IP地址
  207. typeName: '学校关注度', //类型名称 例:学校关注度 、适应性考试等
  208. typeCode: '', //类型编码 例:类型名称首字母缩写(XXGZD)
  209. categoryName: item.schoolName, //类别名称 例:XX学校,SS考试
  210. };
  211. this.$u.api.postAnalysis(analysisParams).then(res => {
  212. console.log('res', res);
  213. if (res.code == 200) {
  214. location.href = item.schoolUrl
  215. } else {
  216. uni.showToast({
  217. icon: 'none',
  218. title: res.msg
  219. })
  220. }
  221. });
  222. }
  223. }
  224. }
  225. </script>
  226. <style lang="scss" scoped>
  227. @import './upgrade.scss'
  228. </style>