upgrade.vue 7.0 KB

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