master
zsk 2 years ago
parent d62ca3d9c4
commit 32d4d70bb1

@ -18,6 +18,8 @@ Page({
recordList: [],
jobSpecialLabelNames: [],
storeJobListSearchForm: {
jobCategoryLabelIds:'',
recruitment:1,
pageNum: 1,
pageSize: 20,
classify: 1,
@ -45,61 +47,24 @@ Page({
totalPage: 0,
currPage: 0,
list:[
{
label:'全部',
tip:0,
},
{
label:'分类1',
tip:1,
children:[
{
title:'模拟0-1'
},
{
title:'模拟0-2'
}
]
},
{
label:'分类2',
tip:2,
children:[
{
title:'模拟1-1'
},
{
title:'模拟1-2'
}
]
},
{
label:'分类3',
tip:3,
children:[
{
title:'模拟2-1'
},
{
title:'模拟2-2'
}
]
}
],
list:[],
active:0,
scrollInfoView:'category_0',
sList:[],
},
handleTab(e){
var that = this;
console.log('点击tab',e.currentTarget.dataset.active)
console.log('点击tab',e.currentTarget.dataset.id)
that.data.storeJobListSearchForm['jobCategoryLabelIds'] = e.currentTarget.dataset.id
this.setData({
active:e.currentTarget.dataset.active,// tab切换
// scrollInfoView:'category_' + e.currentTarget.dataset.active // 右侧锚点滚动
active:e.currentTarget.dataset.active,// tab切换
storeJobListSearchForm: that.data.storeJobListSearchForm
});
console.log(this.data.scrollInfoView)
console.log(this.data.scrollInfoView)
that.getJobList();
},
goLogin() {
@ -124,7 +89,7 @@ Page({
onShow() {
let that = this;
that.data.storeJobListSearchForm.pageNum = 1;
that.getJobList('onshow');
that.getType();
},
getType(){
@ -135,22 +100,28 @@ Page({
header: app.globalData.headers,
success: function (res) {
console.log(res);
that.data.storeJobListSearchForm['jobCategoryLabelIds'] = res.data.data.labels[0].id
that.setData({
list:res.data.data.labels,
storeJobListSearchForm: that.data.storeJobListSearchForm
})
that.getJobList();
}
})
},
getJobList($type) {
getJobList() {
var that = this;
that.setData({
pageShow: false,
pageShow: false,
recordList:[]
});
return new Promise(function (resolve, reject) {
wx.showLoading({
title: "加载中...",
});
console.log(that.data.storeJobListSearchForm);
});
wx.request({
url: app.globalData.ip + "/overall/store/job/list",
url: app.globalData.ip + "/yishoudan/custom/job/listApp",
method: "POST",
header: app.globalData.headers,
data: that.data.storeJobListSearchForm,
@ -159,8 +130,8 @@ Page({
console.log(res);
that.setData({
totalPage: res.data.data.pageCount,
currPage: res.data.data.currentPage,
totalPage: res.data.data.pageBean.pageCount,
currPage: res.data.data.pageBean.currentPage,
});
setTimeout(function () {
@ -168,8 +139,8 @@ Page({
triggered: false,
});
}, 1000);
if (res.data.data.recordList == null || res.data.data.recordList.length == 0 || res.data.data.recordList.length < that.data.storeJobListSearchForm.pageSize) {
var jobListTemp = commonUtil.disposeJobListData(res.data.data.recordList);
if (res.data.data.pageBean.recordList == null || res.data.data.pageBean.recordList.length == 0 || res.data.data.pageBean.recordList.length < that.data.storeJobListSearchForm.pageSize) {
var jobListTemp = commonUtil.disposeJobListData(res.data.data.pageBean.recordList);
that.data.recordList = that.data.recordList.concat(jobListTemp);
that.setData({
@ -178,7 +149,7 @@ Page({
isTrigger: false,
});
} else {
var jobListTemp = commonUtil.disposeJobListData(res.data.data.recordList);
var jobListTemp = commonUtil.disposeJobListData(res.data.data.pageBean.recordList);
that.data.recordList = that.data.recordList.concat(jobListTemp);
that.setData({
@ -227,7 +198,7 @@ Page({
recordList: that.data.recordList,
currentJobDrawer: that.data.currentJobDrawer,
});
// if (that.data.recordList.length < res.data.data.recordCount) {
// if (that.data.recordList.length < res.data.data.pageBean.recordCount) {
// that.setData({
// hasMoreData: true,
// });
@ -291,7 +262,23 @@ Page({
});
},
// 下拉加载更多
onScrollToLower () {
console.log("====================================================");
var that = this;
that.data.storeJobListSearchForm.pageNum =
that.data.storeJobListSearchForm.pageNum + 1;
if (that.data.hasMoreData) {
that.getJobList();
}
// 根据实际数据加载情况设定 loadMore 的值即可,分别为 load 和 over
this.setData({
loadMore: "load",
// loading:true
});
},
goEnroll(e) {
console.log(e);
// wx.navigateTo({
@ -357,6 +344,31 @@ Page({
url: "/pages/filterPage/index",
});
},
recordBill (e) {
// if (!this.data.isLogin) {
// wx.navigateTo({
// url: "/pages/login/index",
// });
// return;
// }
console.log(e.currentTarget.dataset.job);
console.log(123);
let middleInfo = e.currentTarget.dataset.job;
let info = JSON.stringify({
id: middleInfo.id,
jobName: middleInfo.jobName,
storeName: middleInfo.storeName,
aliasName: middleInfo.aliasName,
storeId: middleInfo.storeId,
});
console.log(info);
wx.navigateTo({
url: `../../newEnroll/enroll/index?applyType=1&info=${info}`,
});
// wx.navigateTo({
// url: `../newEnroll/enroll/index?applyType=1&info=${info}`,
// });
},
makePhone(e){
var that = this;
var tel = e.currentTarget.dataset.tel;

@ -4,10 +4,11 @@
<view wx:for="{{list}}" wx:for-item="item" wx:key="index"
class="{{active == index ? 'label-box g_flex_column_center label-box-active' : 'label-box g_flex_column_center'}}"
catchtap="handleTab"
data-active='{{index}}'
data-active='{{index}}'
data-id='{{item.id}}'
>
<view class="{{active == index ? 'label g_flex_c label-active' : 'label g_flex_c'}}"
>{{item.label}}</view>
>{{item.name}}</view>
</view>
</view>
<!-- 右 -->
@ -19,6 +20,7 @@
scroll-into-view="{{scrollInfoView}}"
scroll-with-animation="true"
bindscroll='bindCategoryScroll'
bindscrolltolower="onScrollToLower"
>
<view class="category-child category_0" id="category_0">
<view wx:if="{{recordList != null && recordList.length > 0}}" style="padding-top: 0;">
@ -32,7 +34,7 @@
<view class="display-flex">
<view class="flex-1 vsb">
<view class="display-flex">
<view class="storeName" style="font-size: 14px;">分类1--{{item.jobName || item.aliasName}}</view>
<view class="storeName" style="font-size: 14px;">{{item.jobName || item.aliasName}}</view>
<view class="hourPay" style="font-size: 14px;">{{item.salaryClassifyValue}}</view>
</view>
<view class="v-center mt12 mb12">
@ -67,106 +69,29 @@
</view>
</view>
</view>
</view>
</view>
<block wx:if="{{(recordList == null || recordList.length == 0) && (storeJobListSearchForm.keys != null && storeJobListSearchForm.keys != '')}}">
<view class="tc p20 f12 c045">没有符合条件的职位</view>
</block>
<block wx:else>
<block wx:if="{{isLogin}}">
<view class="tc p20 f12 c045" wx:if="{{!hasMoreData && recordList.length != 0}}">已经到底啦~</view>
<view class="tc p20 f12 c045" wx:if="{{hasMoreData }}">上滑加载更多</view>
</block>
<!-- <block wx:if="{{!isLogin}}">
<view style="padding:10px 12px;">
<text style="font-size: 14px;color: #999999;line-height: 20px;">未登录时只能使用部分功能,申请加入稻田即可使用更多功能。</text>
</view>
<view class="mt12 f14 tc" bindtap="goLogin" style="color: #576b95;padding-bottom: 80px;">登录稻田</view>
</block> -->
</block>
<view wx:if="{{(recordList == null || recordList.length == 0) && pageShow}}" class="tc">
<view class="t-icon t-icon-zanwu" style="width: 80px; height: 80px; margin: 50% auto 20px"></view>
<view class="tc f14 c045">暂无记录</view>
</view>
</view>
<view class="category-child category_1" id="category_1">
<view wx:if="{{recordList != null && recordList.length > 0}}" style="padding-top: 0;">
<view class="jcenter bgf br8">
<view class="listcontainer" style="border-top: 1px solid #f3f3f3;">
<view class="jobOne" hover-start-time="50" hover-stay-time="0"
wx:for="{{recordList}}" data-id="{{item.id}}" bindtap="goDetail" wx:key="index"
hover-class="{{item.recruitment == '1' ? 'ahover':''}}"
style="background-color:{{item.recruitment == '1' ? '#fff':'#f5f5f5'}};border-bottom: {{item.recruitment == '1' ? '':'1px solid #ddd'}};">
<view class="p1020 jobIn" hover-class="none">
<view class="display-flex">
<view class="flex-1 vsb">
<view class="display-flex">
<view class="storeName" style="font-size: 14px;">分类2--{{item.jobName || item.aliasName}}</view>
<view class="hourPay" style="font-size: 14px;">{{item.salaryClassifyValue}}</view>
</view>
<view class="v-center mt12 mb12">
<view class="f12 c045 flex-1 display-flex">
<view hover-class="none" hover-stop-propagation="false" style="max-width:220px;">
<view class="overText fl" style="max-width: 150px;">
{{item.district == "" ?'':item.district}}
</view>
<view class="fl ml4" wx:if="{{item.distance != null && item.distance != '' && storeJobListSearchForm.sortTag == 2}}"> {{ ' | ' + item.distanceKm}}</view>
<view class="fl ml4" wx:else>{{' | ' +item.age}}</view>
</view>
<!-- <view class="fr f14s fw400" style="color: var(--color-f40);">{{item.monthlyPay}}</view> -->
</view>
</view>
<view class="display-flex">
<scroll-view scroll-x="{{true}}" catchscroll="scroll" bindtap="stoptap" class="tttg">
<view class="tagsLi" wx:for="{{item.jobSpecialLabelNameArray}}" wx:for-item="item1" wx:key="index">{{item1}}</view>
<view class="tagsLi" wx:if="{{item.jobSpecialLabelNameArray.length <= 0}}">暂无特色</view>
</scroll-view>
<block wx:if="{{item.state == 1 && item.recruitment == 2}}">
<view class="miniBtn disabled" hover-stop-propagation="false">立即报名</view>
</block>
<block wx:else>
<view class="miniBtn" catchtap="recordBill" data-job="{{item}}" hover-class="thover"
hover-stop-propagation="false">立即报名</view>
</block>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="category-child category_2" id="category_2">
<view wx:if="{{recordList != null && recordList.length > 0}}" style="padding-top: 0;">
<view class="jcenter bgf br8">
<view class="listcontainer" style="border-top: 1px solid #f3f3f3;">
<view class="jobOne" hover-start-time="50" hover-stay-time="0"
wx:for="{{recordList}}" data-id="{{item.id}}" bindtap="goDetail" wx:key="index"
hover-class="{{item.recruitment == '1' ? 'ahover':''}}"
style="background-color:{{item.recruitment == '1' ? '#fff':'#f5f5f5'}};border-bottom: {{item.recruitment == '1' ? '':'1px solid #ddd'}};">
<view class="p1020 jobIn" hover-class="none">
<view class="display-flex">
<view class="flex-1 vsb">
<view class="display-flex">
<view class="storeName" style="font-size: 14px;">分类3--{{item.jobName || item.aliasName}}</view>
<view class="hourPay" style="font-size: 14px;">{{item.salaryClassifyValue}}</view>
</view>
<view class="v-center mt12 mb12">
<view class="f12 c045 flex-1 display-flex">
<view hover-class="none" hover-stop-propagation="false" style="max-width:220px;">
<view class="overText fl" style="max-width: 150px;">
{{item.district == "" ?'':item.district}}
</view>
<view class="fl ml4" wx:if="{{item.distance != null && item.distance != '' && storeJobListSearchForm.sortTag == 2}}"> {{ ' | ' + item.distanceKm}}</view>
<view class="fl ml4" wx:else>{{' | ' +item.age}}</view>
</view>
<!-- <view class="fr f14s fw400" style="color: var(--color-f40);">{{item.monthlyPay}}</view> -->
</view>
</view>
<view class="display-flex">
<scroll-view scroll-x="{{true}}" catchscroll="scroll" bindtap="stoptap" class="tttg">
<view class="tagsLi" wx:for="{{item.jobSpecialLabelNameArray}}" wx:for-item="item1" wx:key="index">{{item1}}</view>
<view class="tagsLi" wx:if="{{item.jobSpecialLabelNameArray.length <= 0}}">暂无特色</view>
</scroll-view>
<block wx:if="{{item.state == 1 && item.recruitment == 2}}">
<view class="miniBtn disabled" hover-stop-propagation="false">立即报名</view>
</block>
<block wx:else>
<view class="miniBtn" catchtap="recordBill" data-job="{{item}}" hover-class="thover"
hover-stop-propagation="false">立即报名</view>
</block>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>

Loading…
Cancel
Save