列表页更新时间优化

cyl/dev
wangxia 4 years ago
parent e96e829e8d
commit f4cbd28835

@ -252,10 +252,19 @@
</div> </div>
</div> </div>
<div class="subsetright"> <div class="subsetright">
<div class="topContainer">
<div class="updateTime">
<span
>更新时间{{ item.updateTime || "--" }}{{
item.diffTime || "--"
}}</span
>
</div>
<div class="topbox"> <div class="topbox">
<div>服务费</div> <div>服务费</div>
<div>{{ item.servetype }}</div> <div>{{ item.servetype }}</div>
</div> </div>
</div>
<div class="bottombox1"> <div class="bottombox1">
<router-link <router-link
:to="'/detail/' + item.id" :to="'/detail/' + item.id"
@ -1262,7 +1271,7 @@ export default {
justify-content: space-between; justify-content: space-between;
// width: 944px; // width: 944px;
// height: 212px; // height: 212px;
padding: 16px; padding: 12px 20px;
margin-bottom: 16px; margin-bottom: 16px;
background: #ffffff; background: #ffffff;
border-radius: 4px; border-radius: 4px;
@ -1355,9 +1364,20 @@ export default {
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
align-items: flex-end; align-items: flex-end;
.topContainer {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-end;
}
.updateTime {
font-size: 14px;
color: #999;
}
.topbox { .topbox {
width: 116px; width: 116px;
height: 54px; height: 54px;
margin-top: 12px;
overflow: hidden; overflow: hidden;
text-align: center; text-align: center;
background: rgba(255, 106, 0, 0.1); background: rgba(255, 106, 0, 0.1);

@ -26,22 +26,22 @@
</ul> --> </ul> -->
<a-anchor :affix="true"> <a-anchor :affix="true">
<a-anchor-link <a-anchor-link
@click.prevent="false" @click.native.prevent=""
href="#toAboutBill" href="#toAboutBill"
title="关于一手单" title="关于一手单"
/> />
<a-anchor-link <a-anchor-link
@click.prevent="false" @click.native.prevent=""
href="#cooperativeBrand" href="#cooperativeBrand"
title="合作品牌" title="合作品牌"
/> />
<a-anchor-link <a-anchor-link
@click.prevent="false" @click.native.prevent=""
href="#businessLandscape" href="#businessLandscape"
title="业务版图" title="业务版图"
/> />
<a-anchor-link <a-anchor-link
@click.prevent="false" @click.native.prevent=""
href="#relationUs" href="#relationUs"
title="联系我们" title="联系我们"
/> />
@ -94,8 +94,8 @@
<div class="title">联系我们</div> <div class="title">联系我们</div>
<div class="content"> <div class="content">
<div class="left"> <div class="left">
<p>总部地址郑州市管城回族区东站南街升龙广场2号楼A座1116室</p> <p>总部地址河南省郑州市郑东新区升龙广场2号楼A座</p>
<p>接待地址伯才人力资源服务中心航空港区店</p> <p>接待地址河南省郑州市航空港区相州街29-60</p>
<p>联系电话168 3666 8888</p> <p>联系电话168 3666 8888</p>
</div> </div>
<div class="right"> <div class="right">
@ -118,7 +118,7 @@
</div> </div>
<footer> <footer>
<div class="w"> <div class="w">
<ul> <!-- <ul>
<li @click="totop"><router-link to="/list">一手职位</router-link></li> <li @click="totop"><router-link to="/list">一手职位</router-link></li>
<li></li> <li></li>
<li @click="totop"> <li @click="totop">
@ -128,7 +128,7 @@
<li @click="totop"> <li @click="totop">
<router-link to="/aboutus">关于我们</router-link> <router-link to="/aboutus">关于我们</router-link>
</li> </li>
</ul> </ul> -->
<div> <div>
Copyright © 2015 - 2022 Matripe. All Rights Reserved. <i></i> Copyright © 2015 - 2022 Matripe. All Rights Reserved. <i></i>
<a target="_blank" href="https://beian.miit.gov.cn/#/Integrated/index" <a target="_blank" href="https://beian.miit.gov.cn/#/Integrated/index"
@ -143,7 +143,6 @@
<script> <script>
import Vue from "vue"; import Vue from "vue";
import { animate } from "popmotion";
const path = require("path"); const path = require("path");
const files = require.context("../../../static/img", false, /.png$/); const files = require.context("../../../static/img", false, /.png$/);
@ -209,18 +208,18 @@ export default {
} }
}); });
}, },
toTargetLocation(target) { // toTargetLocation(target) {
// console.log(123); // // console.log(123);
const now = window.scrollY; // const now = window.scrollY;
// 2. // // 2.
const dist = document.getElementById(target).getBoundingClientRect().top; // const dist = document.getElementById(target).getBoundingClientRect().top;
console.log(dist); // console.log(dist);
animate({ // animate({
from: now, // // from: now, //
to: dist, // // to: dist, //
onUpdate: (latest) => window.scrollTo(0, latest), // onUpdate: (latest) => window.scrollTo(0, latest),
}); // });
}, // },
totop() { totop() {
// console.log(window); // console.log(window);
document.body.scrollTop = 0; document.body.scrollTop = 0;
@ -286,6 +285,7 @@ export default {
border-radius: 8px 8px 0 0; border-radius: 8px 8px 0 0;
overflow: hidden; overflow: hidden;
transform: translateX(-50%); transform: translateX(-50%);
transition: all 0.2s;
z-index: 999; z-index: 999;
.ant-anchor { .ant-anchor {
display: flex; display: flex;

@ -26,22 +26,22 @@
</ul> --> </ul> -->
<a-anchor :affix="true"> <a-anchor :affix="true">
<a-anchor-link <a-anchor-link
@click.prevent="false" @click.native.prevent=""
href="#toAboutBill" href="#toAboutBill"
title="关于一手单" title="关于一手单"
/> />
<a-anchor-link <a-anchor-link
@click.prevent="false" @click.native.prevent=""
href="#cooperativeBrand" href="#cooperativeBrand"
title="合作品牌" title="合作品牌"
/> />
<a-anchor-link <a-anchor-link
@click.prevent="false" @click.native.prevent=""
href="#businessLandscape" href="#businessLandscape"
title="业务版图" title="业务版图"
/> />
<a-anchor-link <a-anchor-link
@click.prevent="false" @click.native.prevent=""
href="#relationUs" href="#relationUs"
title="联系我们" title="联系我们"
/> />

@ -1245,6 +1245,27 @@ export function disposeJobListData(jobList) {
} }
item["age"] = ageStr; item["age"] = ageStr;
// 更新时间距离现在的差距
let differenceTime =
new Date().getTime() -
new Date(item.updateTime || new Date()).getTime();
var D = Math.floor(differenceTime / (24 * 60 * 60 * 1000));
var leave1 = differenceTime % (24 * 3600 * 1000);
var H = Math.floor(leave1 / (3600 * 1000));
var leave2 = leave1 % (3600 * 1000);
var M = Math.floor(leave2 / (60 * 1000));
var leave3 = leave2 % (60 * 1000);
var S = Math.floor(leave3 / 1000);
item.diffTime = null;
if (D > 0) {
item.diffTime = D + "天前";
} else if (H > 0) {
item.diffTime = H + "小时前";
} else if (M > 0) {
item.diffTime = M + "分钟前";
} else {
item.diffTime = S + "秒前";
}
// 服务费 // 服务费
// console.log(item); // console.log(item);

@ -12,8 +12,8 @@ console.log(baseURL);
axios.defaults.withCredentials = true; //添加这行代码 axios.defaults.withCredentials = true; //添加这行代码
// console.log(axios); // console.log(axios);
const service = axios.create({ const service = axios.create({
// baseURL: "/api_prod", // url = base url + request url baseURL: "/api_prod", // url = base url + request url
baseURL: baseURL, // baseURL: "/api", // url = base url + request url // baseURL: baseURL, // baseURL: "/api", // url = base url + request url
withCredentials: true, // send cookies when cross-domain requests withCredentials: true, // send cookies when cross-domain requests
timeout: 10000, // request timeout timeout: 10000, // request timeout
crossDomain: true, crossDomain: true,

@ -16,7 +16,7 @@
<router-link to="/"> <router-link to="/">
<a <a
href="javascript:;" href="javascript:;"
:class="routertitleindex === 0 ? 'titleactive' : ''" :class="routertitleindex == 0 ? 'titleactive' : ''"
>首页</a >首页</a
></router-link ></router-link
> >
@ -25,7 +25,7 @@
<router-link to="/list" @click.native="toList" <router-link to="/list" @click.native="toList"
><a ><a
href="javascript:;" href="javascript:;"
:class="routertitleindex === 1 ? 'titleactive' : ''" :class="routertitleindex == 1 ? 'titleactive' : ''"
>一手职位</a >一手职位</a
></router-link ></router-link
> >
@ -33,7 +33,7 @@
<li> <li>
<router-link <router-link
to="/mybill" to="/mybill"
:class="routertitleindex === 5 ? 'titleactiveafter' : ''" :class="routertitleindex == 5 ? 'titleactive' : ''"
>我的报名 >我的报名
</router-link> </router-link>
</li> </li>
@ -406,11 +406,12 @@ export default {
if (this.$route.fullPath == "/main") { if (this.$route.fullPath == "/main") {
if ( if (
navigationBar.getBoundingClientRect().top <= 0 && navigationBar.getBoundingClientRect().top <= 0 &&
aboutBill.getBoundingClientRect().top < 84 aboutBill.getBoundingClientRect().top < 85
) { ) {
navigationBar.style.position = "fixed"; navigationBar.style.position = "fixed";
navigationBar.style.top = "0px"; navigationBar.style.top = "0px";
navigationBar.style.boxShadow = "0 0 10px 0 #eee"; navigationBar.style.boxShadow = "0 0 10px 0 #eee";
navigationBar.style.width = "1920px";
} else if ( } else if (
navigationBar.getBoundingClientRect().top == 0 && navigationBar.getBoundingClientRect().top == 0 &&
aboutBill.getBoundingClientRect().top >= 84 aboutBill.getBoundingClientRect().top >= 84
@ -420,6 +421,7 @@ export default {
navigationBar.style.top = "unset"; navigationBar.style.top = "unset";
navigationBar.style.bottom = "0px"; navigationBar.style.bottom = "0px";
navigationBar.style.boxShadow = "none"; navigationBar.style.boxShadow = "none";
navigationBar.style.width = "1200px";
} }
} }
}, },
@ -456,7 +458,7 @@ export default {
if (data.status === 200) { if (data.status === 200) {
this.jobMainList = disposeJobListData(data.data.recordList); this.jobMainList = disposeJobListData(data.data.recordList);
this.formvalue.total = data.data.recordCount; this.formvalue.total = data.data.recordCount;
// console.log(this.jobMainList); console.log(this.jobMainList);
} else { } else {
this.$message.info("数据获取失败"); this.$message.info("数据获取失败");
} }

Loading…
Cancel
Save