| @@ -2204,7 +2204,7 @@ | |||||
| }, | }, | ||||
| "async-validator": { | "async-validator": { | ||||
| "version": "1.8.5", | "version": "1.8.5", | ||||
| "resolved": "https://registry.npm.taobao.org/async-validator/download/async-validator-1.8.5.tgz?cache=0&sync_timestamp=1596625482773&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fasync-validator%2Fdownload%2Fasync-validator-1.8.5.tgz", | |||||
| "resolved": "https://registry.npm.taobao.org/async-validator/download/async-validator-1.8.5.tgz?cache=0&sync_timestamp=1596625258256&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fasync-validator%2Fdownload%2Fasync-validator-1.8.5.tgz", | |||||
| "integrity": "sha1-3D4I7B/Q3dtn5ghC8CwM0c7G1/A=", | "integrity": "sha1-3D4I7B/Q3dtn5ghC8CwM0c7G1/A=", | ||||
| "requires": { | "requires": { | ||||
| "babel-runtime": "6.x" | "babel-runtime": "6.x" | ||||
| @@ -2249,6 +2249,14 @@ | |||||
| "integrity": "sha1-oXs6jqgRBg501H0wYSJACtRJeuI=", | "integrity": "sha1-oXs6jqgRBg501H0wYSJACtRJeuI=", | ||||
| "dev": true | "dev": true | ||||
| }, | }, | ||||
| "axios": { | |||||
| "version": "0.20.0", | |||||
| "resolved": "https://registry.npm.taobao.org/axios/download/axios-0.20.0.tgz?cache=0&sync_timestamp=1597979791211&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Faxios%2Fdownload%2Faxios-0.20.0.tgz", | |||||
| "integrity": "sha1-BXujDwSIRpSZOozQf6OUz/EcUL0=", | |||||
| "requires": { | |||||
| "follow-redirects": "^1.10.0" | |||||
| } | |||||
| }, | |||||
| "babel-eslint": { | "babel-eslint": { | ||||
| "version": "10.1.0", | "version": "10.1.0", | ||||
| "resolved": "https://registry.npm.taobao.org/babel-eslint/download/babel-eslint-10.1.0.tgz", | "resolved": "https://registry.npm.taobao.org/babel-eslint/download/babel-eslint-10.1.0.tgz", | ||||
| @@ -2306,7 +2314,7 @@ | |||||
| }, | }, | ||||
| "regenerator-runtime": { | "regenerator-runtime": { | ||||
| "version": "0.11.1", | "version": "0.11.1", | ||||
| "resolved": "https://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.11.1.tgz?cache=0&sync_timestamp=1595456511811&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fregenerator-runtime%2Fdownload%2Fregenerator-runtime-0.11.1.tgz", | |||||
| "resolved": "https://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.11.1.tgz", | |||||
| "integrity": "sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk=" | "integrity": "sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk=" | ||||
| } | } | ||||
| } | } | ||||
| @@ -4345,7 +4353,7 @@ | |||||
| }, | }, | ||||
| "element-ui": { | "element-ui": { | ||||
| "version": "2.13.2", | "version": "2.13.2", | ||||
| "resolved": "https://registry.npm.taobao.org/element-ui/download/element-ui-2.13.2.tgz", | |||||
| "resolved": "https://registry.npm.taobao.org/element-ui/download/element-ui-2.13.2.tgz?cache=0&sync_timestamp=1589795164194&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felement-ui%2Fdownload%2Felement-ui-2.13.2.tgz", | |||||
| "integrity": "sha1-WCv0eqqqr+I+oZWPriF6aHrQZEc=", | "integrity": "sha1-WCv0eqqqr+I+oZWPriF6aHrQZEc=", | ||||
| "requires": { | "requires": { | ||||
| "async-validator": "~1.8.1", | "async-validator": "~1.8.1", | ||||
| @@ -5297,8 +5305,7 @@ | |||||
| "follow-redirects": { | "follow-redirects": { | ||||
| "version": "1.12.1", | "version": "1.12.1", | ||||
| "resolved": "https://registry.npm.taobao.org/follow-redirects/download/follow-redirects-1.12.1.tgz?cache=0&sync_timestamp=1592518348860&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffollow-redirects%2Fdownload%2Ffollow-redirects-1.12.1.tgz", | "resolved": "https://registry.npm.taobao.org/follow-redirects/download/follow-redirects-1.12.1.tgz?cache=0&sync_timestamp=1592518348860&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffollow-redirects%2Fdownload%2Ffollow-redirects-1.12.1.tgz", | ||||
| "integrity": "sha1-3lSmIFMRuT1gOY68Ac9wFWgjErY=", | |||||
| "dev": true | |||||
| "integrity": "sha1-3lSmIFMRuT1gOY68Ac9wFWgjErY=" | |||||
| }, | }, | ||||
| "for-in": { | "for-in": { | ||||
| "version": "1.0.2", | "version": "1.0.2", | ||||
| @@ -7194,6 +7201,11 @@ | |||||
| "minimist": "^1.2.5" | "minimist": "^1.2.5" | ||||
| } | } | ||||
| }, | }, | ||||
| "moment": { | |||||
| "version": "2.28.0", | |||||
| "resolved": "https://registry.npm.taobao.org/moment/download/moment-2.28.0.tgz", | |||||
| "integrity": "sha1-zf5zzgEyfO5lN7D6+sLg8hojfXU=" | |||||
| }, | |||||
| "move-concurrently": { | "move-concurrently": { | ||||
| "version": "1.0.1", | "version": "1.0.1", | ||||
| "resolved": "https://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz", | "resolved": "https://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz", | ||||
| @@ -10425,7 +10437,7 @@ | |||||
| }, | }, | ||||
| "throttle-debounce": { | "throttle-debounce": { | ||||
| "version": "1.1.0", | "version": "1.1.0", | ||||
| "resolved": "https://registry.npm.taobao.org/throttle-debounce/download/throttle-debounce-1.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fthrottle-debounce%2Fdownload%2Fthrottle-debounce-1.1.0.tgz", | |||||
| "resolved": "https://registry.npm.taobao.org/throttle-debounce/download/throttle-debounce-1.1.0.tgz?cache=0&sync_timestamp=1597223522218&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fthrottle-debounce%2Fdownload%2Fthrottle-debounce-1.1.0.tgz", | |||||
| "integrity": "sha1-UYU9o3vmihVctugns1FKPEIuic0=" | "integrity": "sha1-UYU9o3vmihVctugns1FKPEIuic0=" | ||||
| }, | }, | ||||
| "through": { | "through": { | ||||
| @@ -8,8 +8,10 @@ | |||||
| "lint": "vue-cli-service lint" | "lint": "vue-cli-service lint" | ||||
| }, | }, | ||||
| "dependencies": { | "dependencies": { | ||||
| "axios": "^0.20.0", | |||||
| "core-js": "^3.6.5", | "core-js": "^3.6.5", | ||||
| "element-ui": "^2.13.2", | "element-ui": "^2.13.2", | ||||
| "moment": "^2.28.0", | |||||
| "vue": "^2.6.11", | "vue": "^2.6.11", | ||||
| "vue-router": "^3.2.0", | "vue-router": "^3.2.0", | ||||
| "vuex": "^3.4.0" | "vuex": "^3.4.0" | ||||
| @@ -0,0 +1,86 @@ | |||||
| import request from "../request.js" | |||||
| var services = { | |||||
| /* 获取轮播图 */ | |||||
| getBannerList(params) { | |||||
| return request({ | |||||
| url: "/api/yjyBanner/list", | |||||
| method: "get", | |||||
| params: { | |||||
| pageNum: params.pageNum, | |||||
| pageSize: params.pageSize | |||||
| } | |||||
| }) | |||||
| }, | |||||
| /* 合作伙伴 */ | |||||
| getPartnersList(params) { | |||||
| return request({ | |||||
| url: "/api/yjyPartners/list", | |||||
| method: "get", | |||||
| params: { | |||||
| pageNum: params.pageNum, | |||||
| pageSize: params.pageSize | |||||
| } | |||||
| }) | |||||
| }, | |||||
| /* 新闻列表 */ | |||||
| getNewsList(params) { | |||||
| return request({ | |||||
| url: "/api/yjyNews/list", | |||||
| method: "get", | |||||
| params: { | |||||
| pageNum: params.pageNum, | |||||
| pageSize: params.pageSize, | |||||
| type: params.type | |||||
| } | |||||
| }) | |||||
| }, | |||||
| /* 新闻列表详情 */ | |||||
| getNewsDetail(id) { | |||||
| return request({ | |||||
| url: "/api/yjyNews/findById", | |||||
| method: "get", | |||||
| params: { | |||||
| id: id | |||||
| } | |||||
| }) | |||||
| }, | |||||
| /* 获取浏览次数 */ | |||||
| /* getView(params) { | |||||
| let url = params.tag === 'news' ? '/api/yjyNews/viewById' : '' | |||||
| return request({ | |||||
| url: url, | |||||
| method: "get", | |||||
| params: { | |||||
| id: params.id | |||||
| } | |||||
| }) | |||||
| }, */ | |||||
| /* 首页留言 */ | |||||
| addConsumerInto(data) { | |||||
| return request({ | |||||
| url: "/api/yjyConsumerInto/add", | |||||
| method: "post", | |||||
| data: { | |||||
| businessName: data.businessName, | |||||
| liaisonMan: data.liaisonMan, | |||||
| liaisonPhone: data.liaisonPhone | |||||
| } | |||||
| }) | |||||
| }, | |||||
| /* 我要应聘 */ | |||||
| addCandidates(data) { | |||||
| return request({ | |||||
| url: "/api/yjyCandidates/add", | |||||
| method: "post", | |||||
| data: { | |||||
| liaisonEmail: data.liaisonEmail, | |||||
| liaisonMan: data.liaisonMan, | |||||
| liaisonPhone: data.liaisonPhone, | |||||
| explains: data.explains | |||||
| } | |||||
| }) | |||||
| } | |||||
| } | |||||
| export default services | |||||
| @@ -0,0 +1,5 @@ | |||||
| import homeService from "./home/index" | |||||
| export { | |||||
| homeService | |||||
| } | |||||
| @@ -0,0 +1,48 @@ | |||||
| import axios from "axios" | |||||
| import { Message } from "element-ui" | |||||
| // request拦截器 | |||||
| axios.interceptors.request.use( | |||||
| config => { | |||||
| return config | |||||
| }, | |||||
| error => { | |||||
| // Do something with request error | |||||
| console.log("interceptors.request.use receive error") | |||||
| console.log(error) // for debug | |||||
| Promise.reject(error) | |||||
| } | |||||
| ) | |||||
| // respone拦截器 | |||||
| axios.interceptors.response.use( | |||||
| response => { | |||||
| /** | |||||
| * code为非200是抛错 可结合自己业务进行修改 | |||||
| */ | |||||
| const res = response.data | |||||
| if (res.code === 200) { | |||||
| return res.data | |||||
| } else { | |||||
| Message({ | |||||
| message: '异常', | |||||
| type: "error", | |||||
| duration: 2 * 1000 | |||||
| }) | |||||
| return Promise.reject(res) | |||||
| } | |||||
| }, | |||||
| error => { | |||||
| Message({ | |||||
| message: '参数异常', | |||||
| type: "error", | |||||
| duration: 5 * 1000 | |||||
| }) | |||||
| return Promise.reject({ | |||||
| data: error, | |||||
| message: '参数异常' | |||||
| }) | |||||
| } | |||||
| ) | |||||
| export default axios | |||||
| @@ -61,6 +61,7 @@ | |||||
| <script> | <script> | ||||
| import { homeService } from "@/api" | |||||
| export default { | export default { | ||||
| data() { | data() { | ||||
| return { | return { | ||||
| @@ -75,10 +76,18 @@ export default { | |||||
| submitForm(formName) { | submitForm(formName) { | ||||
| this.$refs[formName].validate((valid) => { | this.$refs[formName].validate((valid) => { | ||||
| if (valid) { | if (valid) { | ||||
| console.log( | |||||
| this.dynamicValidateForm.uesrName, | |||||
| this.dynamicValidateForm.enterpriseName | |||||
| ); | |||||
| let data = { | |||||
| businessName: this.dynamicValidateForm.enterpriseName, | |||||
| liaisonMan: this.dynamicValidateForm.uesrName, | |||||
| liaisonPhone: this.dynamicValidateForm.phone | |||||
| } | |||||
| homeService.addConsumerInto(data).then(res => { | |||||
| this.$message({ | |||||
| message: "提交成功", | |||||
| type: "success", | |||||
| duration: 1 * 1000 | |||||
| }) | |||||
| }) | |||||
| } else { | } else { | ||||
| console.log("error submit!!"); | console.log("error submit!!"); | ||||
| return false; | return false; | ||||
| @@ -2,14 +2,15 @@ | |||||
| <div> | <div> | ||||
| <div class="bank"> | <div class="bank"> | ||||
| <img class="img" :src="url" > | <img class="img" :src="url" > | ||||
| <a href class="url">www.baidu.com</a> | |||||
| <a :href="link" target="_blank" class="url">{{link}}</a> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </template> | </template> | ||||
| <script> | <script> | ||||
| export default { | export default { | ||||
| props:{ | props:{ | ||||
| url:String | |||||
| url: String, | |||||
| link: String | |||||
| } | } | ||||
| } | } | ||||
| </script> | </script> | ||||
| @@ -13,36 +13,22 @@ | |||||
| <div class="makeBtn" @click="go('companySynopsis')">预约服务</div> | <div class="makeBtn" @click="go('companySynopsis')">预约服务</div> | ||||
| <div class="journalismTitle"> | <div class="journalismTitle"> | ||||
| <div>新闻中心</div> | <div>新闻中心</div> | ||||
| <p>MORE</p> | |||||
| <p @click="moreNews">MORE</p> | |||||
| </div> | </div> | ||||
| <div class="journalismBox" @click="goparticulars"> | |||||
| <img class="logo" src="../../assets/img/journalism/on1.png" /> | |||||
| <div class="journalismText"> | |||||
| <h3>新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻</h3> | |||||
| <span>内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容</span> | |||||
| <div class="time">2020-08-06</div> | |||||
| <div class="journalismBox" v-for="(item, index) in newsList" :key="index" @click="goparticulars(item)"> | |||||
| <img class="logo" :src="item.mainPicRealPath" alt /> | |||||
| <div class="journalismText"> | |||||
| <h3>{{item.title}}</h3> | |||||
| <span>{{item.assistantTitle}}</span> | |||||
| <div class="time">{{item.publishDate}} <span class="el-icon-view"> {{item.view}}</span></div> | |||||
| </div> | |||||
| </div> | </div> | ||||
| </div> | |||||
| <div class="journalismBox" @click="goparticulars"> | |||||
| <img class="logo" src="../../assets/img/journalism/on1.png" /> | |||||
| <div class="journalismText"> | |||||
| <h3>新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻</h3> | |||||
| <span>内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容</span> | |||||
| <div class="time">2020-08-06</div> | |||||
| </div> | |||||
| </div> | |||||
| <div class="journalismBox" @click="goparticulars"> | |||||
| <img class="logo" src="../../assets/img/journalism/on1.png" /> | |||||
| <div class="journalismText"> | |||||
| <h3>新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻</h3> | |||||
| <span>内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容</span> | |||||
| <div class="time">2020-08-06</div> | |||||
| </div> | |||||
| </div> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </template> | </template> | ||||
| <script> | <script> | ||||
| import { homeService } from "@/api" | |||||
| import moment from "moment" | |||||
| export default { | export default { | ||||
| data() { | data() { | ||||
| return { | return { | ||||
| @@ -64,15 +50,17 @@ export default { | |||||
| text: "了解更多", | text: "了解更多", | ||||
| }, | }, | ||||
| ], | ], | ||||
| activity:sessionStorage.getItem("sidebarIndex") | |||||
| activity:sessionStorage.getItem("sidebarIndex"), | |||||
| newsList: [] | |||||
| }; | }; | ||||
| }, | }, | ||||
| methods: { | methods: { | ||||
| goparticulars() { | |||||
| goparticulars(item) { | |||||
| this.$router.push({ | this.$router.push({ | ||||
| path: "/particulars", | path: "/particulars", | ||||
| query: { | query: { | ||||
| ifjournalism: 2, | ifjournalism: 2, | ||||
| id: item.id | |||||
| }, | }, | ||||
| }); | }); | ||||
| }, | }, | ||||
| @@ -80,7 +68,26 @@ export default { | |||||
| this.$router.push(path); | this.$router.push(path); | ||||
| sessionStorage.setItem('sidebarIndex',index) | sessionStorage.setItem('sidebarIndex',index) | ||||
| }, | }, | ||||
| getNewsList() { | |||||
| let data = { | |||||
| type: 1, | |||||
| pageNum: 1, | |||||
| pageSize: 3 | |||||
| } | |||||
| homeService.getNewsList(data).then(res => { | |||||
| res.list.forEach(ele => { | |||||
| ele.publishDate = moment(ele.publishDate).format("YYYY-MM-DD") | |||||
| }); | |||||
| this.newsList = res.list | |||||
| }) | |||||
| }, | |||||
| moreNews() { | |||||
| this.$router.push('/journalism'); | |||||
| } | |||||
| }, | }, | ||||
| created() { | |||||
| this.getNewsList() | |||||
| } | |||||
| }; | }; | ||||
| </script> | </script> | ||||
| <style lang="scss" scoped> | <style lang="scss" scoped> | ||||
| @@ -136,6 +143,7 @@ export default { | |||||
| height: 45px; | height: 45px; | ||||
| float: right; | float: right; | ||||
| margin-right: 10px; | margin-right: 10px; | ||||
| cursor: pointer; | |||||
| } | } | ||||
| } | } | ||||
| .journalismBox { | .journalismBox { | ||||
| @@ -174,6 +182,9 @@ export default { | |||||
| .time { | .time { | ||||
| color: rgb(214, 214, 206); | color: rgb(214, 214, 206); | ||||
| padding: 2px 0; | padding: 2px 0; | ||||
| span{ | |||||
| float: right; | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -2,7 +2,7 @@ | |||||
| <div class="Box"> | <div class="Box"> | ||||
| <el-carousel :interval="4000" type="card" height="323px"> | <el-carousel :interval="4000" type="card" height="323px"> | ||||
| <el-carousel-item v-for="(item,index) in list" :key="index"> | <el-carousel-item v-for="(item,index) in list" :key="index"> | ||||
| <img :src="item.url" style="width: 600px; | |||||
| <img :src="item.mainPicRealPath" style="width: 600px; | |||||
| height: 323px;" /> | height: 323px;" /> | ||||
| </el-carousel-item> | </el-carousel-item> | ||||
| </el-carousel> | </el-carousel> | ||||
| @@ -2,16 +2,15 @@ | |||||
| <div class="Box"> | <div class="Box"> | ||||
| <div class="leftBox"> | <div class="leftBox"> | ||||
| <textTitle text="优秀案例"/> | <textTitle text="优秀案例"/> | ||||
| <ul class="imgBox"> | |||||
| <li v-for="(item, index) in 4" :key="index"> | |||||
| <div class="casesBox" @click="goparticulars"> | |||||
| <cases/> | |||||
| <div class="imgBox" v-for="(item, index) in list" :key="index"> | |||||
| <div class="casesBox" @click="goparticulars(item)"> | |||||
| <div class="imgBox"> | |||||
| <img class="img" :src="item.mainPicRealPath" > | |||||
| <h1>{{item.title}}</h1> | |||||
| <span>培训时间:{{item.publishDate}}</span> | |||||
| </div> | |||||
| </div> | </div> | ||||
| <div class="casesBox"> | |||||
| <cases/> | |||||
| </div> | |||||
| </li> | |||||
| </ul> | |||||
| </div> | |||||
| </div> | </div> | ||||
| <sidebar/> | <sidebar/> | ||||
| </div> | </div> | ||||
| @@ -19,22 +18,47 @@ | |||||
| <script> | <script> | ||||
| import textTitle from "@/components/headTail/textTitle"; | import textTitle from "@/components/headTail/textTitle"; | ||||
| import sidebar from "@/components/sidebar/sidebar"; | import sidebar from "@/components/sidebar/sidebar"; | ||||
| import cases from "@/components/partner/case"; | |||||
| /* import cases from "@/components/partner/case"; | |||||
| */import { homeService } from "@/api" | |||||
| import moment from "moment" | |||||
| export default { | export default { | ||||
| components: { | components: { | ||||
| textTitle, | textTitle, | ||||
| sidebar, | sidebar, | ||||
| cases, | |||||
| /* cases, */ | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| list: [] | |||||
| } | |||||
| }, | }, | ||||
| methods:{ | methods:{ | ||||
| goparticulars(){ | |||||
| goparticulars(item){ | |||||
| this.$router.push({ | this.$router.push({ | ||||
| path:'/particulars', | path:'/particulars', | ||||
| query:{ | query:{ | ||||
| ifjournalism:1 | |||||
| ifjournalism:1, | |||||
| id: item.id | |||||
| } | } | ||||
| }) | }) | ||||
| } | |||||
| }, | |||||
| /* 新闻列表 */ | |||||
| getList() { | |||||
| let d = { | |||||
| type: 2, | |||||
| pageNum: 1, | |||||
| pageSize: 1000 | |||||
| } | |||||
| homeService.getNewsList(d).then(res => { | |||||
| res.list.forEach(ele => { | |||||
| ele.publishDate = moment(ele.publishDate).format("YYYY-MM-DD") | |||||
| }); | |||||
| this.list = res.list | |||||
| }) | |||||
| } | |||||
| }, | |||||
| created() { | |||||
| this.getList() | |||||
| } | } | ||||
| }; | }; | ||||
| </script> | </script> | ||||
| @@ -49,4 +73,21 @@ export default { | |||||
| margin-left: 20px; | margin-left: 20px; | ||||
| margin-right: 20px; | margin-right: 20px; | ||||
| } | } | ||||
| .imgBox{ | |||||
| margin: 10px 30px; | |||||
| .img{ | |||||
| width: 300px; | |||||
| height: 200px; | |||||
| // background-color: sandybrown; | |||||
| } | |||||
| h1{ | |||||
| text-align: center; | |||||
| font-size: 18px; | |||||
| margin: 10px 0; | |||||
| } | |||||
| span{ | |||||
| display: block; | |||||
| text-align: center; | |||||
| } | |||||
| } | |||||
| </style> | </style> | ||||
| @@ -2,10 +2,15 @@ | |||||
| <div class="Box"> | <div class="Box"> | ||||
| <div class="leftBox"> | <div class="leftBox"> | ||||
| <textTitle :text="textTop" /> | <textTitle :text="textTop" /> | ||||
| <div> | |||||
| <!-- <div> | |||||
| <h1 class="titels">{{this.ifjournalism==1?'中国农业银行礼仪培训':'新闻标题'}}</h1> | <h1 class="titels">{{this.ifjournalism==1?'中国农业银行礼仪培训':'新闻标题'}}</h1> | ||||
| <p >{{this.ifjournalism==1?'培训时间:2019年3月1日':"2019年3月1日"}}</p> | <p >{{this.ifjournalism==1?'培训时间:2019年3月1日':"2019年3月1日"}}</p> | ||||
| <img class="particularsBox" src="../../assets/img/journalism/on2.png" alt=""> | <img class="particularsBox" src="../../assets/img/journalism/on2.png" alt=""> | ||||
| </div> --> | |||||
| <div> | |||||
| <h1 class="titels">{{data.title}}</h1> | |||||
| <p >{{data.publishDate}}</p> | |||||
| <div v-html="data.content"></div> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <sidebar /> | <sidebar /> | ||||
| @@ -14,6 +19,8 @@ | |||||
| <script> | <script> | ||||
| import textTitle from "@/components/headTail/textTitle"; | import textTitle from "@/components/headTail/textTitle"; | ||||
| import sidebar from "@/components/sidebar/sidebar"; | import sidebar from "@/components/sidebar/sidebar"; | ||||
| import moment from "moment" | |||||
| import { homeService } from "@/api" | |||||
| export default { | export default { | ||||
| components: { | components: { | ||||
| textTitle, | textTitle, | ||||
| @@ -22,10 +29,28 @@ export default { | |||||
| data() { | data() { | ||||
| return { | return { | ||||
| textTop :"优秀案例", | textTop :"优秀案例", | ||||
| ifjournalism:1 ,//1 => 优秀案例 2 =>新闻详情 | |||||
| ifjournalism:1 ,//1 => 优秀案例 2 =>新闻详情, | |||||
| id: this.$route.query.id, | |||||
| data: {} | |||||
| } | } | ||||
| }, | }, | ||||
| mounted() { | |||||
| methods: { | |||||
| getDetail() { | |||||
| homeService.getNewsDetail(this.id).then(res => { | |||||
| res.publishDate = moment(res.publishDate).format("YYYY-MM-DD") | |||||
| this.data = res | |||||
| }) | |||||
| }, | |||||
| /* getView() { | |||||
| let data = { | |||||
| tag: this.$route.query.ifjournalism === "2" ? 'news' : '', | |||||
| id: this.id | |||||
| } | |||||
| homeService.getView(data).then(res => {}) | |||||
| } */ | |||||
| }, | |||||
| created() { | |||||
| this.getDetail() | |||||
| if(this.$route.query.ifjournalism){ | if(this.$route.query.ifjournalism){ | ||||
| this.ifjournalism = this.$route.query.ifjournalism | this.ifjournalism = this.$route.query.ifjournalism | ||||
| console.log(this.ifjournalism); | console.log(this.ifjournalism); | ||||
| @@ -2,16 +2,9 @@ | |||||
| <div class="Box"> | <div class="Box"> | ||||
| <div class="leftBox"> | <div class="leftBox"> | ||||
| <textTitle text="合作伙伴"/> | <textTitle text="合作伙伴"/> | ||||
| <ul style="overflow: hidden;"> | |||||
| <li v-for="(item, index) in 4" :key="index" style="overflow: hidden;"> | |||||
| <div class="partner"> | |||||
| <partnerBox :url="partnerUrl"/> | |||||
| </div> | |||||
| <div class="partner"> | |||||
| <partnerBox :url="partnerUrl"/> | |||||
| </div> | |||||
| </li> | |||||
| </ul> | |||||
| <div class="partner" v-for="(item, index) in partnersList" :key="index"> | |||||
| <partnerBox :url="item.assistantPicRealPath" :link="item.linkUrl"/> | |||||
| </div> | |||||
| </div> | </div> | ||||
| <sidebar /> | <sidebar /> | ||||
| </div> | </div> | ||||
| @@ -20,6 +13,8 @@ | |||||
| import textTitle from "@/components/headTail/textTitle"; | import textTitle from "@/components/headTail/textTitle"; | ||||
| import sidebar from "@/components/sidebar/sidebar"; | import sidebar from "@/components/sidebar/sidebar"; | ||||
| import partnerBox from "@/components/partner/partnerBox" | import partnerBox from "@/components/partner/partnerBox" | ||||
| import { homeService } from "@/api" | |||||
| export default { | export default { | ||||
| components:{ | components:{ | ||||
| textTitle, | textTitle, | ||||
| @@ -28,9 +23,23 @@ export default { | |||||
| }, | }, | ||||
| data() { | data() { | ||||
| return { | return { | ||||
| partnerUrl:require('../../assets/img/cooperation/on1.png') | |||||
| partnersList: [] | |||||
| } | |||||
| }, | |||||
| methods: { | |||||
| getPartnersList() { | |||||
| let d = { | |||||
| pageNum: 1, | |||||
| pageSize: 1000 | |||||
| } | |||||
| homeService.getPartnersList(d).then(res => { | |||||
| this.partnersList = res.list | |||||
| }) | |||||
| } | } | ||||
| }, | }, | ||||
| created() { | |||||
| this.getPartnersList() | |||||
| } | |||||
| } | } | ||||
| </script> | </script> | ||||
| @@ -37,43 +37,23 @@ | |||||
| </div> | </div> | ||||
| <div class="partnerBox"> | <div class="partnerBox"> | ||||
| <div class="title">合作伙伴</div> | <div class="title">合作伙伴</div> | ||||
| <div class="partner" v-for="(item, index) in 3" :key="index"> | |||||
| <partnerBox :url="partnerUrl" /> | |||||
| <div class="partner" v-for="(item, index) in partnersList" :key="index"> | |||||
| <partnerBox :url="item.mainPicRealPath" :link="item.linkUrl" /> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div class="right"> | <div class="right"> | ||||
| <div class="journalismTitle"> | <div class="journalismTitle"> | ||||
| <p>新闻中心</p> | <p>新闻中心</p> | ||||
| <span>MORE</span> | |||||
| </div> | |||||
| <div class="journalismBox" @click="goparticulars"> | |||||
| <img class="logo" src="../../assets/img/journalism/on1.png" alt /> | |||||
| <div class="journalismText"> | |||||
| <h3>新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻</h3> | |||||
| <span>内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容</span> | |||||
| <div class="time">2020-08-06</div> | |||||
| </div> | |||||
| </div> | |||||
| <div class="journalismBox" @click="goparticulars"> | |||||
| <img class="logo" src="../../assets/img/journalism/on1.png" alt /> | |||||
| <div class="journalismText"> | |||||
| <h3>新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻</h3> | |||||
| <span>内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容</span> | |||||
| <div class="time">2020-08-06</div> | |||||
| </div> | |||||
| <span @click="moreNews">MORE</span> | |||||
| </div> | </div> | ||||
| <div class="journalismBox" @click="goparticulars"> | |||||
| <img class="logo" src="../../assets/img/journalism/on1.png" alt /> | |||||
| <div class="journalismBox" v-for="(item, index) in newsList" :key="index" @click="goparticulars(item)"> | |||||
| <img class="logo" :src="item.mainPicRealPath" alt /> | |||||
| <div class="journalismText"> | <div class="journalismText"> | ||||
| <h3>新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻新闻</h3> | |||||
| <span>内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容</span> | |||||
| <div class="time">2020-08-06</div> | |||||
| <h3>{{item.title}}</h3> | |||||
| <span>{{item.assistantTitle}}</span> | |||||
| <div class="time">{{item.publishDate}} <span class="el-icon-view"> {{item.view}}</span></div> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -88,6 +68,8 @@ import slideshow from "@/components/slideshow/slideshow"; | |||||
| import consult from "@/components/consult/consult"; | import consult from "@/components/consult/consult"; | ||||
| import textTitle from "@/components/headTail/textTitle"; | import textTitle from "@/components/headTail/textTitle"; | ||||
| import partnerBox from "@/components/partner/partnerBox"; | import partnerBox from "@/components/partner/partnerBox"; | ||||
| import { homeService } from "@/api" | |||||
| import moment from "moment" | |||||
| export default { | export default { | ||||
| components: { | components: { | ||||
| slideshow, | slideshow, | ||||
| @@ -97,28 +79,67 @@ export default { | |||||
| }, | }, | ||||
| data() { | data() { | ||||
| return { | return { | ||||
| slideList: [ | |||||
| { url: require("../../assets/img/slideshow/1.png") }, | |||||
| { url: require("../../assets/img/slideshow/2.png") }, | |||||
| { url: require("../../assets/img/slideshow/1.png") }, | |||||
| { url: require("../../assets/img/slideshow/2.png") }, | |||||
| ], | |||||
| partnerUrl: require("../../assets/img/cooperation/on1.png"), | |||||
| slideList: [], | |||||
| partnersList: [], | |||||
| newsList: [] | |||||
| }; | }; | ||||
| }, | }, | ||||
| methods: { | methods: { | ||||
| goparticulars() { | |||||
| /* 轮播图 */ | |||||
| getSlideList() { | |||||
| let data = { | |||||
| pageNum: 1, | |||||
| pageSize: 100 | |||||
| } | |||||
| homeService.getBannerList(data).then(res => { | |||||
| this.slideList = res.list | |||||
| }) | |||||
| }, | |||||
| /* 左侧合作伙伴 */ | |||||
| getPartnersList() { | |||||
| let data = { | |||||
| pageNum: 1, | |||||
| pageSize: 5 | |||||
| } | |||||
| homeService.getPartnersList(data).then(res => { | |||||
| this.partnersList = res.list | |||||
| }) | |||||
| }, | |||||
| /* 新闻列表 */ | |||||
| getNewsList() { | |||||
| let data = { | |||||
| type: 1, | |||||
| pageNum: 1, | |||||
| pageSize: 3 | |||||
| } | |||||
| homeService.getNewsList(data).then(res => { | |||||
| res.list.forEach(ele => { | |||||
| ele.publishDate = moment(ele.publishDate).format("YYYY-MM-DD") | |||||
| }); | |||||
| this.newsList = res.list | |||||
| }) | |||||
| }, | |||||
| moreNews() { | |||||
| this.$router.push('/journalism'); | |||||
| }, | |||||
| goparticulars(item) { | |||||
| this.$router.push({ | this.$router.push({ | ||||
| path: "/particulars", | path: "/particulars", | ||||
| query: { | query: { | ||||
| ifjournalism: 2, | ifjournalism: 2, | ||||
| }, | |||||
| id: item.id | |||||
| } | |||||
| }); | }); | ||||
| }, | }, | ||||
| go(path) { | go(path) { | ||||
| this.$router.push(`/${path}`); | this.$router.push(`/${path}`); | ||||
| }, | }, | ||||
| }, | }, | ||||
| created() { | |||||
| this.getSlideList() | |||||
| this.getPartnersList() | |||||
| this.getNewsList() | |||||
| } | |||||
| }; | }; | ||||
| </script> | </script> | ||||
| @@ -279,6 +300,7 @@ export default { | |||||
| line-height: 45px; | line-height: 45px; | ||||
| text-indent: 30px; | text-indent: 30px; | ||||
| float: left; | float: left; | ||||
| cursor: pointer; | |||||
| } | } | ||||
| span { | span { | ||||
| height: 45px; | height: 45px; | ||||
| @@ -324,6 +346,9 @@ export default { | |||||
| line-height: 19px; | line-height: 19px; | ||||
| color: rgb(214, 214, 206); | color: rgb(214, 214, 206); | ||||
| padding: 10px 0; | padding: 10px 0; | ||||
| span{ | |||||
| float: right; | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,48 +0,0 @@ | |||||
| <template> | |||||
| <div class="detailBox"> | |||||
| <h3>标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题</h3> | |||||
| <div class="imgBox"> | |||||
| <img class="img" src="../../assets/img/journalism/on1.png" /> | |||||
| <div class="text"> | |||||
| <p>内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容</p> | |||||
| <span class="time">2020-8-07</span> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| </template> | |||||
| <style lang="scss" scoped> | |||||
| .detailBox { | |||||
| margin-top: 30px; | |||||
| margin-left: 20px; | |||||
| h3 { | |||||
| font-size: 14px; | |||||
| padding-bottom: 20px; | |||||
| } | |||||
| .imgBox { | |||||
| overflow: hidden; | |||||
| .img { | |||||
| float: left; | |||||
| width: 150px; | |||||
| height: 100px; | |||||
| } | |||||
| .text { | |||||
| float: left; | |||||
| width: 630px; | |||||
| height: 100px; | |||||
| margin-left: 20px; | |||||
| p { | |||||
| display: -webkit-box; | |||||
| -webkit-line-clamp: 3; | |||||
| -webkit-box-orient: vertical; | |||||
| line-height: 20px; | |||||
| overflow: hidden; | |||||
| } | |||||
| .time { | |||||
| display: block; | |||||
| margin-top: 20px; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| </style> | |||||
| @@ -2,9 +2,24 @@ | |||||
| <div class="Box"> | <div class="Box"> | ||||
| <div class="leftBox"> | <div class="leftBox"> | ||||
| <textTitle text="新闻咨询" /> | <textTitle text="新闻咨询" /> | ||||
| <div @click="goparticulars"> | |||||
| <detail v-for="(item, index) in 5" :key="index" /> | |||||
| <!-- <div @click="goparticulars"> | |||||
| <detail v-for="(item, index) in newsList" :key="index" /> | |||||
| </div> --> | |||||
| <div class="detailBox" v-for="(item, index) in newsList" :key="index" @click="goparticulars(item)"> | |||||
| <h3>{{item.title}}</h3> | |||||
| <div class="imgBox"> | |||||
| <img class="img" :src="item.mainPicRealPath" /> | |||||
| <div class="text"> | |||||
| <p>{{item.assistantTitle}}</p> | |||||
| <span class="time">{{item.publishDate}} <span class="el-icon-view"> {{item.view}}</span></span> | |||||
| </div> | |||||
| </div> | |||||
| </div> | </div> | ||||
| <el-pagination :current-page.sync="paging.pageNum" | |||||
| background | |||||
| layout="prev, pager, next" | |||||
| :total="paging.total"> | |||||
| </el-pagination> | |||||
| </div> | </div> | ||||
| <sidebar /> | <sidebar /> | ||||
| </div> | </div> | ||||
| @@ -12,22 +27,98 @@ | |||||
| <script> | <script> | ||||
| import textTitle from "@/components/headTail/textTitle"; | import textTitle from "@/components/headTail/textTitle"; | ||||
| import sidebar from "@/components/sidebar/sidebar"; | import sidebar from "@/components/sidebar/sidebar"; | ||||
| import detail from "./details"; | |||||
| import { homeService } from "@/api" | |||||
| import moment from "moment" | |||||
| export default { | export default { | ||||
| components: { | components: { | ||||
| textTitle, | textTitle, | ||||
| sidebar, | sidebar, | ||||
| detail, | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| newsList: [], | |||||
| paging: { | |||||
| pageNum: 1, | |||||
| pageSize: 4, | |||||
| total: 4 | |||||
| } | |||||
| } | |||||
| }, | }, | ||||
| methods: { | methods: { | ||||
| goparticulars() { | |||||
| goparticulars(item) { | |||||
| this.$router.push({ | this.$router.push({ | ||||
| path: "/particulars", | path: "/particulars", | ||||
| query: { | query: { | ||||
| ifjournalism: 2, | ifjournalism: 2, | ||||
| id: item.id | |||||
| }, | }, | ||||
| }); | }); | ||||
| }, | }, | ||||
| /* 新闻列表 */ | |||||
| getNewsList() { | |||||
| let d = { | |||||
| type: 1, | |||||
| pageNum: this.paging.pageNum, | |||||
| pageSize: this.paging.pageSize | |||||
| } | |||||
| homeService.getNewsList(d).then(res => { | |||||
| res.list.forEach(ele => { | |||||
| ele.publishDate = moment(ele.publishDate).format("YYYY-MM-DD") | |||||
| }); | |||||
| this.paging.total = Number(res.total) | |||||
| this.newsList = res.list | |||||
| }) | |||||
| } | |||||
| }, | }, | ||||
| created() { | |||||
| this.getNewsList() | |||||
| } | |||||
| }; | }; | ||||
| </script> | </script> | ||||
| <style lang="scss" scoped> | |||||
| .el-pagination{ | |||||
| text-align: center; | |||||
| margin-top: 20px; | |||||
| } | |||||
| .detailBox { | |||||
| margin-top: 30px; | |||||
| margin-left: 20px; | |||||
| h3 { | |||||
| font-size: 14px; | |||||
| padding-bottom: 20px; | |||||
| } | |||||
| .imgBox { | |||||
| overflow: hidden; | |||||
| .img { | |||||
| float: left; | |||||
| width: 150px; | |||||
| height: 100px; | |||||
| } | |||||
| .text { | |||||
| float: left; | |||||
| width: 630px; | |||||
| height: 100px; | |||||
| margin-left: 20px; | |||||
| position: relative; | |||||
| p { | |||||
| display: -webkit-box; | |||||
| -webkit-line-clamp: 3; | |||||
| -webkit-box-orient: vertical; | |||||
| line-height: 20px; | |||||
| overflow: hidden; | |||||
| } | |||||
| .time { | |||||
| display: block; | |||||
| margin-top: 20px; | |||||
| position: absolute; | |||||
| bottom: 0; | |||||
| width: 100%; | |||||
| span{ | |||||
| float: right; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| </style> | |||||
| @@ -31,13 +31,14 @@ | |||||
| prop="email" | prop="email" | ||||
| :rules="[ | :rules="[ | ||||
| {required: true, message: '请输入邮箱', trigger: 'blur'}, | {required: true, message: '请输入邮箱', trigger: 'blur'}, | ||||
| { type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] } | |||||
| ]" | ]" | ||||
| > | > | ||||
| <el-input v-model="dynamicValidateForm.email"></el-input> | <el-input v-model="dynamicValidateForm.email"></el-input> | ||||
| </el-form-item> | </el-form-item> | ||||
| <el-form-item label="说明"> | <el-form-item label="说明"> | ||||
| <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="textarea"></el-input> | |||||
| <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="dynamicValidateForm.explains"></el-input> | |||||
| </el-form-item> | </el-form-item> | ||||
| <el-form-item style=" text-align: center;"> | <el-form-item style=" text-align: center;"> | ||||
| @@ -53,6 +54,8 @@ | |||||
| </template> | </template> | ||||
| <script> | <script> | ||||
| import { homeService } from "@/api" | |||||
| export default { | export default { | ||||
| data() { | data() { | ||||
| return { | return { | ||||
| @@ -60,18 +63,27 @@ export default { | |||||
| uesrName: "", | uesrName: "", | ||||
| email: "", | email: "", | ||||
| phone: "", | phone: "", | ||||
| }, | |||||
| textarea:"", | |||||
| explains: "" | |||||
| } | |||||
| }; | }; | ||||
| }, | }, | ||||
| methods: { | methods: { | ||||
| submitForm(formName) { | submitForm(formName) { | ||||
| this.$refs[formName].validate((valid) => { | this.$refs[formName].validate((valid) => { | ||||
| if (valid) { | if (valid) { | ||||
| console.log( | |||||
| this.dynamicValidateForm, | |||||
| this.textarea | |||||
| ); | |||||
| let data = { | |||||
| liaisonEmail: this.dynamicValidateForm.email, | |||||
| liaisonMan: this.dynamicValidateForm.uesrName, | |||||
| liaisonPhone: this.dynamicValidateForm.phone, | |||||
| explains: this.dynamicValidateForm.explains | |||||
| } | |||||
| homeService.addCandidates(data).then(res => { | |||||
| this.$message({ | |||||
| message: "提交成功", | |||||
| type: "success", | |||||
| duration: 1 * 1000 | |||||
| }) | |||||
| }) | |||||
| } else { | } else { | ||||
| console.log("error submit!!"); | console.log("error submit!!"); | ||||
| return false; | return false; | ||||
| @@ -110,6 +110,12 @@ const routes = [ | |||||
| }, | }, | ||||
| ] | ] | ||||
| const originalPush = VueRouter.prototype.push | |||||
| VueRouter.prototype.push = function push(location) { | |||||
| return originalPush.call(this, location).catch(err => err) | |||||
| } | |||||
| const router = new VueRouter({ | const router = new VueRouter({ | ||||
| mode: 'history', | mode: 'history', | ||||
| base: process.env.BASE_URL, | base: process.env.BASE_URL, | ||||
| @@ -1,3 +1,8 @@ | |||||
| const path = require('path'); | |||||
| function resolve(dir) { | |||||
| return path.join(__dirname, dir); | |||||
| } | |||||
| module.exports = { | module.exports = { | ||||
| devServer: { | devServer: { | ||||
| overlay: { | overlay: { | ||||
| @@ -12,9 +17,19 @@ module.exports = { | |||||
| '^/qwer': '' | '^/qwer': '' | ||||
| } | } | ||||
| }, | }, | ||||
| '/api': { | |||||
| target: 'http://plat.yjyculture.com/C/', | |||||
| changeOrigin: true, | |||||
| pathRewrite: { | |||||
| '^/api': '' | |||||
| } | |||||
| }, | |||||
| } | } | ||||
| }, | }, | ||||
| lintOnSave: false, | lintOnSave: false, | ||||
| chainWebpack: (config) => { | |||||
| config.resolve.alias | |||||
| .set('@', resolve('src')) | |||||
| } | |||||
| } | } | ||||