From 32d4d70bb16b5041f10a01c8899994085cb6504b Mon Sep 17 00:00:00 2001
From: zsk <710162063@qq.com>
Date: Sat, 2 Mar 2024 09:11:29 +0800
Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E6=89=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/type/type/index.js | 128 +++++++++++++++++++++++++--------------------
pages/type/type/index.wxml | 127 +++++++++-----------------------------------
2 files changed, 96 insertions(+), 159 deletions(-)
diff --git a/pages/type/type/index.js b/pages/type/type/index.js
index 634a6b6..99c5717 100644
--- a/pages/type/type/index.js
+++ b/pages/type/type/index.js
@@ -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;
diff --git a/pages/type/type/index.wxml b/pages/type/type/index.wxml
index 2b90567..a7685aa 100644
--- a/pages/type/type/index.wxml
+++ b/pages/type/type/index.wxml
@@ -4,10 +4,11 @@
{{item.label}}
+ >{{item.name}}
@@ -19,6 +20,7 @@
scroll-into-view="{{scrollInfoView}}"
scroll-with-animation="true"
bindscroll='bindCategoryScroll'
+ bindscrolltolower="onScrollToLower"
>
@@ -32,7 +34,7 @@
- 分类1--{{item.jobName || item.aliasName}}
+ {{item.jobName || item.aliasName}}
{{item.salaryClassifyValue}}
@@ -67,106 +69,29 @@
-
+
+
+ 没有符合条件的职位
+
+
+
+ 已经到底啦~
+ 上滑加载更多
+
+
+
+
+
+
+ 暂无记录
+
-
-
-
-
-
-
-
-
-
- 分类2--{{item.jobName || item.aliasName}}
- {{item.salaryClassifyValue}}
-
-
-
-
-
- {{item.district == "" ?'':item.district}}
-
- {{ ' | ' + item.distanceKm}}
- {{' | ' +item.age}}
-
-
-
-
-
-
- {{item1}}
- 暂无特色
-
-
-
- 立即报名
-
-
- 立即报名
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 分类3--{{item.jobName || item.aliasName}}
- {{item.salaryClassifyValue}}
-
-
-
-
-
- {{item.district == "" ?'':item.district}}
-
- {{ ' | ' + item.distanceKm}}
- {{' | ' +item.age}}
-
-
-
-
-
-
- {{item1}}
- 暂无特色
-
-
- 立即报名
-
-
- 立即报名
-
-
-
-
-
-
-
-
-
-