diff --git a/src/api/index.js b/src/api/index.js index bc247f1..5d6a15b 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -72,7 +72,8 @@ export default { secondaryColumnsByFirst: `occupationlab/enterprise/information/column/secondaryColumnsByFirst`, // 线上赛事 - onlineContestQuery: `occupationlab/enterprise/match/onlineContest/onlineContestQuery`, // 线上赛事列表分页条件查询 + contestPageConditionQueryByOccupationlabStu: `occupationlab/enterprise/match/contest/contestPageConditionQueryByOccupationlabStu`, + contestPageConditionQueryByOccupationlab: `occupationlab/enterprise/match/contest/contestPageConditionQueryByOccupationlab`, addApplicant: `occupationlab/enterprise/match/applicant/addApplicant`, // 添加报名人员 getContestProgress: `occupationlab/enterprise/match/contest-progress/getContestProgress`, // 根据赛事id查询竞赛进展 getContest: `occupationlab/enterprise/match/contest/getContest`, // 根据id查询赛事 diff --git a/src/assets/img/index/customer.jpg b/src/assets/img/index/customer.jpg index 1d3313b..69cb274 100644 Binary files a/src/assets/img/index/customer.jpg and b/src/assets/img/index/customer.jpg differ diff --git a/src/assets/img/index/sug.png b/src/assets/img/index/sug.png new file mode 100644 index 0000000..5048935 Binary files /dev/null and b/src/assets/img/index/sug.png differ diff --git a/src/assets/img/index/tel-2.png b/src/assets/img/index/tel-2.png new file mode 100644 index 0000000..e886cd0 Binary files /dev/null and b/src/assets/img/index/tel-2.png differ diff --git a/src/layouts/navbar/index.vue b/src/layouts/navbar/index.vue index 8dd501d..ed7e927 100644 --- a/src/layouts/navbar/index.vue +++ b/src/layouts/navbar/index.vue @@ -72,6 +72,10 @@ export default { index: "/log/list", title: "更新日志" }, + { + index: "/touristMatch/list", + title: "大赛资讯" + }, { index: "trial", title: "试用申请" diff --git a/src/pages/index/list/index.vue b/src/pages/index/list/index.vue index 4fc3d31..0ce3738 100644 --- a/src/pages/index/list/index.vue +++ b/src/pages/index/list/index.vue @@ -187,8 +187,36 @@
+
-
+ +
@@ -212,7 +240,16 @@ export default { toPart(i){ this.active = i document.querySelector(`#part${i}`).scrollIntoView() - } + }, + // 置顶 + topping() { + document.documentElement.scrollTop = 0 + document.body.scrollTop = 0 + }, + // 申请试用 + toTrial() { + window.open('https://www.wjx.cn/vm/wB0RcMm.aspx') + }, } }; @@ -696,6 +733,9 @@ export default { &:hover { background-image: url(../../../assets/img/index/wechat-1.png); background-color: #006EFF; + & + .popup { + display: block; + } } } .tel { @@ -703,6 +743,9 @@ export default { &:hover { background-image: url(../../../assets/img/index/tel-1.png); background-color: #006EFF; + & + .popup { + display: block; + } } } .topping { @@ -712,5 +755,63 @@ export default { background-color: #006EFF; } } + .popup { + position: absolute; + display: none; + } + .wechat-popup { + top: -100px; + left: -230px; + padding: 20px; + text-align: center; + background-color: #fff; + box-shadow: 0px 0px 7px 0px rgba(203, 203, 203, 0.55); + .tips { + font-size: 14px; + } + .des { + margin: 5px 0 15px; + font-size: 12px; + color: #333; + } + } + .tel-popup { + top: -10px; + left: -250px; + width: 250px; + border-right: 20px solid transparent; + &:hover { + display: block; + } + .tel-inner { + padding: 20px; + background-color: #fff; + box-shadow: 0px 0px 7px 0px rgba(203, 203, 203, 0.55); + } + .line { + display: flex; + &:first-child { + margin-bottom: 20px; + } + } + .text { + margin-left: 15px; + } + .title { + margin-bottom: 5px; + font-size: 14px; + cursor: pointer; + &:hover { + color: #006EFF; + } + } + .tel-num { + font-size: 12px; + color: #006EFF; + } + .des { + font-size: 12px; + } + } } \ No newline at end of file diff --git a/src/pages/match/list/index.vue b/src/pages/match/list/index.vue index 35ce01b..d1f1f66 100644 --- a/src/pages/match/list/index.vue +++ b/src/pages/match/list/index.vue @@ -10,44 +10,44 @@
-
+
比赛范围:
省份 - +
城市 - +
筛选排序:
-
{{ item.name }}
+
{{ item.name }}
-
-
@@ -107,7 +114,7 @@ @@ -130,32 +137,37 @@ import { mapActions } from "vuex"; import { Loading } from "element-ui"; import bus from "@/libs/bus"; +import Setting from "@/setting" +import util from "@/libs/util" export default { name: "match", data() { return { - way: "", + token: util.local.get(Setting.tokenKey), + way: util.local.get(Setting.tokenKey) ? 1 : '', statusList: ["等待报名", "已报名", "立即报名", "报名截止", "比赛中", "已结束"], endList: ["报名开始", "报名截止", "报名截止", "竞赛开始", "竞赛结束", ""], typeList: [ { - id: "", + id: 1, name: "本校赛事" }, { - id: 0, + id: 2, name: "赛事广场" }, { - id: 1, + id: 3, name: "已报名" } ], provinces: [], cities: [], form: { - + provinceId: '', + cityId: '', + sequence: '' }, sorts: [ { @@ -170,7 +182,7 @@ export default { sort: 1, keyword: "", searchTimer: null, - pageNo: 1, + page: 1, pageSize: 10, totals: 0, listData: [], @@ -258,14 +270,13 @@ export default { keyword: function(val) { clearTimeout(this.searchTimer); this.searchTimer = setTimeout(() => { - this.getData(); + this.initData(); }, 500); } }, mounted() { - bus.$emit("setBg", "match"); - this.getData(); - + this.getProvince() + this.getData() this.$once("hook:beforeDestroy", function() { this.timerList.forEach((n, k) => { clearInterval(n); @@ -277,84 +288,118 @@ export default { ...mapActions("match", [ "setMatchId", "setMatchSignupStatus" ]), - getData() { - let data = { - name: this.keyword, - way: this.way - }; - this.loadIns = Loading.service(); - this.$get(`${this.api.onlineContestQuery}/${this.pageNo}/${this.pageSize}`, data).then(res => { - this.listData = res.contestList; - if (this.listData[0].coverUrl){ + async getData() { + this.loadIns = Loading.service() + const { way, form } = this + const res = await this.$post(this.api[way === 1 ? 'contestPageConditionQueryByOccupationlab' : 'contestPageConditionQueryByOccupationlabStu'], { + pageNum: this.page, + pageSize: this.pageSize, + platformSource: 1, // 大赛来源(0中台,1职站) + cityId: form.cityId || null, + provinceId: form.provinceId || null, + sequence: form.sequence || null, + keyWord: this.keyword + }) + const { data } = res + this.listData = data.records + this.totals = data.total + // let contestIds = res.contestIds; + // this.contestIds = contestIds; + let time = 60 * 60 * 1000 * 24; + let covers = []; + this.listData.forEach((n, k) => { + // 报名时间、比赛时间处理 + let now = new Date().getTime(); + let signUpStartTime = new Date(this.core.dateCompatible(n.signUpStartTime)).getTime(); // 报名开始时间 + let signUpEndTime = new Date(this.core.dateCompatible(n.signUpEndTime)).getTime(); // 报名结束时间 + let playStartTime = new Date(this.core.dateCompatible(n.playStartTime)).getTime(); // 比赛开始时间 + let playEndTime = new Date(this.core.dateCompatible(n.playEndTime)).getTime(); // 比赛结束时间 - }else{ - this.listData[0].coverUrl = defaultBanner - } - let contestIds = res.contestIds; - this.contestIds = contestIds; - let time = 60 * 60 * 1000 * 24; - let covers = []; - this.listData.forEach((n, k) => { - let now = new Date().getTime(); - let signUpStartTime = new Date(this.core.dateCompatible(n.signUpStartTime)).getTime(); // 报名开始时间 - let signUpEndTime = new Date(this.core.dateCompatible(n.signUpEndTime)).getTime(); // 报名结束时间 - let playStartTime = new Date(this.core.dateCompatible(n.playStartTime)).getTime(); // 比赛开始时间 - let playEndTime = new Date(this.core.dateCompatible(n.playEndTime)).getTime(); // 比赛结束时间 + if (now < signUpStartTime) { // 报名没开始 + n.status = 0; + n.end = Math.floor((signUpStartTime - now) / time); + } else if (now > signUpStartTime && now < signUpEndTime) { // 报名进行中 + n.status = 1; + n.end = Math.floor((signUpEndTime - now) / time); + } else if (now > signUpEndTime && now < playStartTime) { // 报名结束了,但比赛没开始 + n.status = 3; + n.end = Math.floor((playStartTime - now) / time); + } else if (now > playStartTime && now < playEndTime) { // 比赛进行中 + n.status = 4; + n.end = Math.floor((playEndTime - now) / time); + } else if (now > playEndTime) { // 比赛结束 + n.status = 5; + } - if (now < signUpStartTime) { // 报名没开始 - n.status = 0; - n.end = Math.floor((signUpStartTime - now) / time); - } else if (now > signUpStartTime && now < signUpEndTime) { // 报名进行中 - n.status = 1; - n.end = Math.floor((signUpEndTime - now) / time); - } else if (now > signUpEndTime && now < playStartTime) { // 报名结束了,但比赛没开始 - n.status = 3; - n.end = Math.floor((playStartTime - now) / time); - } else if (now > playStartTime && now < playEndTime) { // 比赛进行中 - n.status = 4; - n.end = Math.floor((playEndTime - now) / time); - } else if (now > playEndTime) { // 比赛结束 - n.status = 5; - } + // 比赛范围 + const list = n.contestRangeRespList + if (list) { + const range = [] + list.map(e => { + range.push(e.type ? (e.provinceName || e.cityName) : e.schoolName) + }) + n.ranges = `${n.range}(${range.join(',')})` + } else { + n.ranges = n.range + } - // 判断该用户已报名的比赛id集合中有没有该比赛id - let isInclude = contestIds.includes(n.id); - if (n.status == 1 && !isInclude) { // 如果报名在进行中,而且该用户没报名,则显示报名按钮,必须status为2,并且signup为true才能报名,下面报名的方法中有做判断 - n.status = 2; - n.signup = true; - } else { - n.signup = false; - } - (covers.length < 3 && n.carouselUrl) && covers.push(n); - }); - if (this.isFirst) this.covers = covers; - this.totals = res.total; - this.loadIns.close(); - this.isFirst = false; - }).catch(res => { - this.loadIns.close(); - }); + // 判断该用户已报名的比赛id集合中有没有该比赛id + // let isInclude = contestIds.includes(n.id); + // if (n.status == 1 && !isInclude) { // 如果报名在进行中,而且该用户没报名,则显示报名按钮,必须status为2,并且signup为true才能报名,下面报名的方法中有做判断 + // n.status = 2; + // n.signup = true; + // } else { + // n.signup = false; + // } + // (covers.length < 3 && n.carouselUrl) && covers.push(n); + }); + if (this.isFirst) this.covers = covers; + this.loadIns.close(); + this.isFirst = false; + }, + initData() { + this.page = 1 + this.getData() + }, + // 获取省份 + getProvince() { + this.$get(this.api.queryProvince).then(({ list }) => { + this.provinces = list + }).catch(res => {}) + }, + // 获取城市 + getCity() { + const { form } = this + form.cityId = '' + this.$get(this.api.queryCity, { + provinceId: form.provinceId + }).then(({ list }) => { + this.cities = list + this.initData() + }).catch(res => {}) }, changeType(type) { this.way = type; - if (type != 1) { - this.getData(); - } else { - let listData = this.listData; - let result = []; - listData.forEach((n, k) => { - let isInclude = this.contestIds.includes(n.id); - if (n.status == 1 && isInclude) { - result.push(n); - } - }); - this.listData = result; - this.totals = this.listData.length; - } + this.initData() + // if (type != 1) { + // this.getData(); + // } else { + // let listData = this.listData; + // let result = []; + // listData.forEach((n, k) => { + // let isInclude = this.contestIds.includes(n.id); + // if (n.status == 1 && isInclude) { + // result.push(n); + // } + // }); + // this.listData = result; + // this.totals = this.listData.length; + // } }, // 筛选排序 changeSort(type) { - this.sort = type; + this.form.sequence = type + this.initData() }, toDetail(item) { // console.log(item.status); @@ -364,7 +409,7 @@ export default { this.$router.push(`/match/details?status=${item.status}&end=${item.end}`); }, handleCurrentChange(val) { - this.pageNo = val; + this.page = val; this.getData(); }, signup(item) { @@ -451,7 +496,7 @@ export default { margin-right: 10px; } } - .center-wrap { + .list-inner { display: flex; justify-content: center; align-items:flex-start; diff --git a/src/pages/touristMatch/details/index.vue b/src/pages/touristMatch/details/index.vue new file mode 100644 index 0000000..a0ca9dd --- /dev/null +++ b/src/pages/touristMatch/details/index.vue @@ -0,0 +1,433 @@ + + + + + \ No newline at end of file diff --git a/src/pages/touristMatch/list/index.vue b/src/pages/touristMatch/list/index.vue new file mode 100644 index 0000000..a728aab --- /dev/null +++ b/src/pages/touristMatch/list/index.vue @@ -0,0 +1,666 @@ + + + + + \ No newline at end of file diff --git a/src/router/modules/touristMatch.js b/src/router/modules/touristMatch.js new file mode 100644 index 0000000..57d3346 --- /dev/null +++ b/src/router/modules/touristMatch.js @@ -0,0 +1,29 @@ +import BasicLayout from "@/layouts/home"; + +const meta = {}; + +const pre = "touristMatch-"; + +export default { + path: "/touristMatch", + name: "touristMatch", + redirect: { + name: `${pre}list` + }, + meta, + component: BasicLayout, + children: [ + { + name: `${pre}list`, + path: `list`, + component: () => import("@/pages/touristMatch/list"), + meta: { title: "线上赛事" } + }, + { + name: `${pre}details`, + path: `details`, + component: () => import("@/pages/touristMatch/details"), + meta: { title: "竞赛信息" } + } + ] +}; \ No newline at end of file diff --git a/src/router/routes.js b/src/router/routes.js index 238bce5..d653f6a 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -9,6 +9,7 @@ import setting from "./modules/setting"; import course from "./modules/course"; import info from "./modules/info"; import match from "./modules/match"; +import touristMatch from "./modules/touristMatch"; import log from "./modules/log"; const frameIn = [ @@ -27,6 +28,7 @@ const frameIn = [ course, info, match, + touristMatch, log ]; diff --git a/src/setting.js b/src/setting.js index f053fe9..01dae41 100644 --- a/src/setting.js +++ b/src/setting.js @@ -30,8 +30,8 @@ if (isHh) { } else if (isDev) { // 本地 systemPath = `http://${location.hostname}:8093/#/` - host = "http://121.37.12.51:9000/"; // 中台测试服 - // host = "http://192.168.31.151:9000/"; // 榕 + // host = "http://121.37.12.51:9000/"; // 中台测试服 + host = "http://192.168.31.151:9000/"; // 榕 // host = "http://192.168.31.137:9000/"; // 赓 } @@ -59,7 +59,7 @@ const Setting = { /** * 路由白名单 * */ - whiteList: ['/login', '/index/list', '/cityPartner/list', '/devPlatform/list', '/log/list'], + whiteList: ['/login', '/index/list', '/cityPartner/list', '/devPlatform/list', '/log/list', '/touristMatch/list'], /** * 平台列表 * */