no message

cyl/job_im
jscyl13849007907 3 weeks ago
parent c72c0577e3
commit 1cc76033a8

@ -84,7 +84,7 @@
</view> </view>
</view> </view>
<view class="g_flex_none g_flex_column_center" style="font-size: 14px;color: #666;"> <view class="g_flex_none g_flex_column_center" style="font-size: 14px;color: #666;">
招聘人数{{ Math.floor(Math.random() * 81) + 280 }} 招聘人数{{ recruitNum }}
</view> </view>
</view> </view>
<!-- 地址 --> <!-- 地址 -->
@ -635,19 +635,15 @@ export default {
], ],
btnLoading: false, // loading btnLoading: false, // loading
validEndTime: "", // validEndTime: "", //
recruitNum: 0, //
}; };
}, },
onLoad(options) { onLoad(options) {
let that = this; let that = this;
// 48 // +48
let now = new Date(); this.calcValidEndTime();
let endTime = new Date(now.getTime() + 48 * 60 * 60 * 1000); // 12
let year = endTime.getFullYear(); this.getRecruitNum();
let month = String(endTime.getMonth() + 1).padStart(2, '0');
let day = String(endTime.getDate()).padStart(2, '0');
let hour = String(endTime.getHours()).padStart(2, '0');
let minute = String(endTime.getMinutes()).padStart(2, '0');
this.validEndTime = `${year}${month}${day}${hour}:${minute} 前有效`;
// console.log("", options); // console.log("", options);
// console.log("this.G.store().cdnBaseImg", this.G.store().cdnBaseImg); // console.log("this.G.store().cdnBaseImg", this.G.store().cdnBaseImg);
if (options.id) { if (options.id) {
@ -759,6 +755,40 @@ export default {
}, },
methods: { methods: {
//
calcValidEndTime() {
let now = new Date();
let endTime = new Date(now.getTime() + 48 * 60 * 60 * 1000);
let year = endTime.getFullYear();
let month = String(endTime.getMonth() + 1).padStart(2, '0');
let day = String(endTime.getDate()).padStart(2, '0');
let hour = String(endTime.getHours()).padStart(2, '0');
let minute = String(endTime.getMinutes()).padStart(2, '0');
this.validEndTime = `${year}${month}${day}${hour}:${minute} 前有效`;
},
// 12
getRecruitNum() {
let storageKey = 'job_recruit_num_' + this.uid;
let storedData = uni.getStorageSync(storageKey);
let now = new Date().getTime();
if (storedData) {
let data = JSON.parse(storedData);
// 12
if (now - data.timestamp < 12 * 60 * 60 * 1000) {
this.recruitNum = data.num;
return;
}
}
//
let num = Math.floor(Math.random() * 81) + 280;
this.recruitNum = num;
uni.setStorageSync(storageKey, JSON.stringify({
num: num,
timestamp: now
}));
},
showFee() { showFee() {
let that = this; let that = this;
if (uni.getStorageSync("apply-token")) { if (uni.getStorageSync("apply-token")) {

Loading…
Cancel
Save