岗位推荐固定位置插入改为随机插入
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
<view
|
<view
|
||||||
class="item button-click "
|
class="item button-click "
|
||||||
:class="{
|
:class="{
|
||||||
|
optional:machHasZph(item),
|
||||||
noOptional: !item.isThisMonth,
|
noOptional: !item.isThisMonth,
|
||||||
active: current.date === item.date && item.isThisMonth,
|
active: current.date === item.date && item.isThisMonth,
|
||||||
}"
|
}"
|
||||||
@@ -79,6 +80,10 @@ onLoad((options) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function machHasZph(item) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
function backParams() {
|
function backParams() {
|
||||||
if (isValidDateString(current.value.date)) {
|
if (isValidDateString(current.value.date)) {
|
||||||
navBack({
|
navBack({
|
||||||
|
|||||||
@@ -359,7 +359,11 @@ function getJobRecommend(type = 'add') {
|
|||||||
...pageState.search,
|
...pageState.search,
|
||||||
...conditionSearch.value,
|
...conditionSearch.value,
|
||||||
};
|
};
|
||||||
let comd = { recommend: true, jobCategory: '', tip: '确认你的兴趣,为您推荐更多合适的岗位' };
|
let comd = {
|
||||||
|
recommend: true,
|
||||||
|
jobCategory: '',
|
||||||
|
tip: '确认你的兴趣,为您推荐更多合适的岗位',
|
||||||
|
};
|
||||||
$api.createRequest('/app/job/recommend', params).then((resData) => {
|
$api.createRequest('/app/job/recommend', params).then((resData) => {
|
||||||
const { data, total } = resData;
|
const { data, total } = resData;
|
||||||
pageState.total = 0;
|
pageState.total = 0;
|
||||||
@@ -380,7 +384,16 @@ function getJobRecommend(type = 'add') {
|
|||||||
|
|
||||||
if (question) {
|
if (question) {
|
||||||
comd.jobCategory = question;
|
comd.jobCategory = question;
|
||||||
data.unshift(comd);
|
// 生成随机插入位置,排除前两个和最后两个位置
|
||||||
|
let insertIndex;
|
||||||
|
if (data.length <= 4) {
|
||||||
|
// 如果数据长度小于等于4,直接插入到中间位置
|
||||||
|
insertIndex = Math.floor(data.length / 2);
|
||||||
|
} else {
|
||||||
|
// 生成2到data.length-2之间的随机位置
|
||||||
|
insertIndex = Math.floor(Math.random() * (data.length - 4)) + 2;
|
||||||
|
}
|
||||||
|
data.splice(insertIndex, 0, comd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const reslist = dataToImg(data);
|
const reslist = dataToImg(data);
|
||||||
|
|||||||
@@ -596,7 +596,16 @@ function getJobRecommend(type = 'add') {
|
|||||||
|
|
||||||
if (question) {
|
if (question) {
|
||||||
comd.jobCategory = question;
|
comd.jobCategory = question;
|
||||||
data.unshift(comd);
|
// 生成随机插入位置,排除前两个和最后两个位置
|
||||||
|
let insertIndex;
|
||||||
|
if (data.length <= 4) {
|
||||||
|
// 如果数据长度小于等于4,直接插入到中间位置
|
||||||
|
insertIndex = Math.floor(data.length / 2);
|
||||||
|
} else {
|
||||||
|
// 生成2到data.length-2之间的随机位置
|
||||||
|
insertIndex = Math.floor(Math.random() * (data.length - 4)) + 2;
|
||||||
|
}
|
||||||
|
data.splice(insertIndex, 0, comd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const reslist = dataToImg(data);
|
const reslist = dataToImg(data);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<scroll-view scroll-y class="main-scroll">
|
<scroll-view scroll-y class="main-scroll">
|
||||||
<view class="scrollmain">
|
<view v-if="msgList.length" class="scrollmain">
|
||||||
<view
|
<view
|
||||||
class="list-card press-button"
|
class="list-card press-button"
|
||||||
v-for="(item, index) in msgList"
|
v-for="(item, index) in msgList"
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<empty v-else pdTop="200" content="暂无消息~"></empty>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<scroll-view scroll-y class="main-scroll">
|
<scroll-view scroll-y class="main-scroll">
|
||||||
<view class="scrollmain">
|
<view v-if="unreadMsgList.length" class="scrollmain">
|
||||||
<view
|
<view
|
||||||
class="list-card press-button"
|
class="list-card press-button"
|
||||||
v-for="(item, index) in unreadMsgList"
|
v-for="(item, index) in unreadMsgList"
|
||||||
@@ -34,6 +34,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<empty v-else pdTop="200" content="暂无消息~"></empty>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user