diff --git a/pages/detail/index.js b/pages/detail/index.js
index 5f169c5..06f71a9 100644
--- a/pages/detail/index.js
+++ b/pages/detail/index.js
@@ -133,20 +133,7 @@ Page({
this.wxLogin();
}
- var query = wx.createSelectorQuery();
- query.select(".page-section").boundingClientRect();
- query.exec(function (res) {
- //res就是 所有标签为v1的元素的信息 的数组
- console.log(res);
- //取高度
- console.log(res[0].height);
- that.setData({
- swiperHeight: res[0].height,
- });
- });
- that.searchAnimate();
-
- console.log(that.data.userInfo);
+
},
showphone: function () {
var that = this;
diff --git a/pages/type/type/filtercss.wxss b/pages/type/type/filtercss.wxss
deleted file mode 100644
index 635eff9..0000000
--- a/pages/type/type/filtercss.wxss
+++ /dev/null
@@ -1,71 +0,0 @@
-
-.container {
- /* margin: 10px;
- padding: 0 10px; */
- padding-bottom: 32px;
- margin-bottom: 10px;
- background-color: #fff;
- border-radius: 8px;
-}
-.sub {
- overflow: hidden;
-}
-.sub .title {
- margin: 32px 0 20px 0;
- font-size: 18px;
- line-height: 1;
- font-weight: bold;
- text-align: left;
-}
-.sub .content {
- display: flex;
- flex-wrap: wrap;
-}
-.sub .content > span {
- width: calc(32% - 2px);
- height: 34px;
- line-height: 34px;
- border-radius: 4px;
- background-color: #fff;
- text-align: center;
- color: #333;
- font-size: 14px;
- border: 1px solid transparent;
-}
-.sub .content > span.active {
- background-color: var(--color-ysd-bg);
- color: var(--color-ysd);
- border-color: var(--color-ysd);
-}
-.sub .content > span:not(:nth-child(3n)) {
- margin-right: 2%;
-}
-.sub .content > span:not(:nth-last-child(-n + 3)) {
- margin-bottom: 12px;
-}
-.btnBox {
- position: sticky;
- bottom: 0;
- height: 44px;
- padding-top: 12px;
- display: flex;
- justify-content: center;
- background-color: #fff;
-}
-.btnBox button {
- width: 128px !important;
- height: 32px;
- padding: 0;
- margin: 0;
- border-radius: 24px;
- line-height: 32px;
- font-size: 14px;
- box-sizing: border-box;
-}
-.btnBox .clearFilter{
- margin-right: 20px;
- line-height: 30px;
- border:1px solid var(--color-ysd);
- background-color: #fff;
- color: var(--color-ysd);
-}
\ No newline at end of file
diff --git a/pages/type/type/index.js b/pages/type/type/index.js
index bca8ab0..9685cd9 100644
--- a/pages/type/type/index.js
+++ b/pages/type/type/index.js
@@ -3,17 +3,7 @@ const app = getApp();
const commonUtil = require("../../../utils/commonUtil.js");
Page({
data: {
- toped: "1",
- chaShowed: false,
- isTrigger: false,
- // background: ["../../assets/images/banner1.jpg", "../../assets/images/banner2.jpg", "../../assets/images/banner3.jpg", "../../assets/images/banner4.jpg"],
pullNum: 0, //下拉次数
- tabs: [],
- activeTab: 0,
- systemInfo: {},
- getMenuButtonBoundingClientRect: {},
- // 手机基础信息
- tabs2: [],
loadMore: "",
loadContent: ["马不停蹄加载更多数据中...", "-- 已经到底了,加不了咯 --"],
@@ -25,10 +15,6 @@ Page({
menuButton: wx.getStorageSync("menuButtonInfo"), // 胶囊信息
navigatorHeight: 60,
- activeTab2: 0,
- contentIndex: 0,
- latestClass: 0,
- zoneClass: 0,
recordList: [],
jobSpecialLabelNames: [],
storeJobListSearchForm: {
@@ -48,112 +34,16 @@ Page({
ucj: 0,
},
loading: true,
- topJobList: [],
- hasLocation: false,
- chooseActive: false, //筛选是否高亮
-
- labelItems: [],
- checkedlabelItems: [],
hasMoreData: false, //下拉是否还有更多数据
inputShowed: false,
inputVal: "搜索工作",
wxCode: "",
- isCollect: false,
- collectTxt: "收藏",
isLogin: app.globalData.isLogin,
hasUserInfo: 0,
- searchCityParamStorage: {
- name: "",
- shortName: "",
- },
- iosDialog1: false,
- phoneDialog: false,
- triggered: false,
pageShow: false,
- whichOneShow: "",
- siv: "",
- activez: "zuigao",
- sexid: "-1", // 性别筛选的id
- dialog1: false,
- dialog2: false,
- jobSpecialLabelList: [],
- brandList: [],
- firstMenu: "排序", // 工价筛选tab显示
- secondMenu: "性别", // 性别筛选tab显示
- selectBrandList: [], // 选中的品牌标签
- selectJobList: [], // 选中的特色标签
- tagArray0: [],
- tagArray1: [],
- tagArray2: [],
- tagArray3: [],
- tagArray4: [],
- recordBillType: "", // 报名类型(拍照或者直接报名)
- signType: 0, // 职位类型(自营 三方)
recordCount: 0,
totalPage: 0,
currPage: 0,
- currentJobDrawer: {}, // 当前简版职位抽屉信息
- drawerShow: false, // 简版职位抽屉显隐
- choiceCollect: 0, //收藏的筛选
- corpUserFlag: app.globalData.loginUserInfo.corpUserFlag, // 内部成员的判断
- agencyStatus: app.globalData.loginUserInfo.agencyStatus, // 是否是代理的判断
- serviceInfo: {}, // 代理信息
- navigatorBarHeight: 0, // 头部整体高度信息
- iosDialog: false, // 成为代理弹窗
- isLoading: true, // 成为代理图片加载loading效果
- isScrollTop: false, // 控制职位列表的滚动
- leftShow: false, // 左侧智能匹配抽屉显示
- /**
- * 滑动相关变量
- */
- lastX: 0, //滑动开始x轴位置
- lastY: 0, //滑动开始y轴位置
- text: "没有滑动",
- currentGesture: 0, //标识手势
- listPosition: null, // 存储列表当前位置
- halfHide: true, // 智能匹配显示一半控制
- topNum: 0,
- scrollTo: "", // 列表滚动的控制
- navList: [
- {
- img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/ztrt.png",
- url: "/pages/hotList/index",
- title: "主推/热推",
- },
- // { img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/dtld.png",url:'/pages/hotList/index', title: "职位云亮点" },
- // { img: "http://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/zjzp.png",url:'/pages/hotList/index', title: "职教职培" },
- {
- img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/cwdl.png",
- url: "/pages/tobeAgency/index",
- title: "成为代理",
- },
- // { img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/dzkf.png",url:'/pages/hotList/index', title: "定制开发" },
- {
- img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/xmhz.png",
- url: "/pages/xiangmuhezuo/index",
- title: "项目合作",
- },
- {
- img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/xtxx.png",
- url: "/pages/message/index",
- title: "消息中心",
- },
- {
- img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/lxwm.png",
- url: "/pages/connectUs/index",
- title: "联系我们",
- },
- // { img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/jqqd.png",url:'/pages/hotList/index', title: "敬请期待" },
- ],
- bannerList: [],
- /**
- * 筛选的相关变量
- *
- *
- */
-
- copyList: {},
- innerFilter: false,
list:[
{
@@ -197,26 +87,6 @@ Page({
scrollInfoView:'category_0',
sList:[],
- },
- // onPullDownRefresh:function(){
- // this.getJobList();
- // console.log(123);
-
- // wx.stopPullDownRefresh({
- // success() {
- // app.refreshSuccess();
- // }
- // });
- // },
- handleTab(e){
- console.log('点击tab',e)
-
- this.setData({
- active:e.currentTarget.dataset.active,// tab切换
- scrollInfoView:'category_' + e.currentTarget.dataset.active // 右侧锚点滚动
- });
- console.log(this.data.scrollInfoView)
-
},
goLogin() {
wx.setStorageSync("comeFromPage", "index");
@@ -224,560 +94,6 @@ Page({
url: "/pages/login/index",
});
},
- close() {
- let that = this;
- let brandList = that.data.brandList;
- let selectBrandList = that.data.selectBrandList;
- if (selectBrandList.length > 0) {
- for (let i = 0; i < brandList.length; i++) {
- console.log("level1");
- for (let j = 0; j < selectBrandList.length; j++) {
- console.log("level2");
- if (brandList[i].id == selectBrandList[j].id) {
- return (brandList[i].checked = true);
- } else {
- brandList[i].checked = false;
- }
- }
- }
- } else {
- brandList.forEach((item) => {
- item.checked = false;
- });
- }
- return brandList;
- },
- closeFix: function () {
- var that = this;
- // let brandList = that.close()
- // that.data.brandList.forEach((item) => {
- // if (that.data.selectBrandList.length > 0) {
- // that.data.selectBrandList.forEach((item1) => {
- // if (item.id != item1.id) {
- // console.log("isSame");
- // item.checked = false;
- // console.log(item.checked);
- // } else {
- // item.checked = true;
- // }
- // });
- // } else {
- // item.checked = false;
- // }
- // });
- // console.log(that.data.brandList);
- // console.log(that.data.selectBrandList);
- console.log("isout");
- },
- touchStart(e) {
- // console.log("滚起来", e);
- // this.setData({
- // scrollStop: false
- // })
- this.setData({
- // whichOneShow: mark,
- siv: "",
- });
- },
- choosenTop(e) {
- var that = this;
- // that.data.storeJobListSearchForm.pageNum = 1;
- let id = e.currentTarget.dataset.id;
- setTimeout(() => {
- that.setData({
- toped: id,
- // isScrollTop: false,
- });
- }, 0);
- // 切换标准 简版 重新查询列表
- // that.data.storeJobListSearchForm.pageNum = 1;
- // that.setData({
- // toped: id,
- // recordList: [],
- // });
- // that.getJobList();
- },
-
- chooseNl: function (e) {
- var that = this;
- console.log(e);
- let mark = "";
- let type = e.target.dataset.type;
- let whichOneShow = that.data.whichOneShow;
- // if (!that.data.isLogin) {
- // wx.navigateTo({
- // url: "/pages/login/index",
- // });
- // return;
- // }
- if (type == "gj") {
- if (whichOneShow == "gj") {
- mark = "";
- } else {
- mark = "gj";
- }
- } else if (type == "sex") {
- if (whichOneShow == "sex") {
- mark = "";
- } else {
- mark = "sex";
- }
- } else if (type == "brand") {
- if (whichOneShow == "brand") {
- mark = "";
- } else {
- mark = "brand";
- }
- } else if (type == "special") {
- if (whichOneShow == "special") {
- mark = "";
- } else {
- mark = "special";
- }
- }
- if (that.data.siv != "menu") {
- setTimeout(() => {
- that.setData({
- whichOneShow: mark,
- // siv:'menu'
- });
- console.log(this.data.whichOneShow);
- }, 0);
- that.setData({
- // siv: "menu",
- // scrollTo: "sticky",
- });
- }
- this.hideLeft();
- },
- toSpecialArea: function (e) {
- var id = e.currentTarget.dataset.id;
- wx.navigateTo({
- url: "../specialArea/index?id=" + id,
- });
- },
- chooseM: function (e) {
- var str = e.currentTarget.dataset.id;
- console.log(str);
- this.setData({
- activez: str,
- });
- },
- watch() {},
- witchNav(e) {
- console.log(e);
- if (!this.data.isLogin) {
- wx.navigateTo({
- url: "/pages/login/index",
- });
- return;
- }
- if (e.currentTarget.dataset.title == "成为代理") {
- console.log("成为代理");
- if (app.globalData.loginUserInfo.agencyStatus == 1) {
- wx.showToast({
- title: "您已经是代理了",
- icon: "none",
- duration: 2000,
- });
- return;
- }
- } else if (e.currentTarget.dataset.title == "主推/热推") {
- wx.navigateTo({
- url: e.currentTarget.dataset.url + "?listtype=" + this.data.toped,
- });
- return;
- }
-
- wx.navigateTo({
- url: e.currentTarget.dataset.url,
- });
- },
- toHot(e) {
- if (e.currentTarget.dataset.path) {
- if (e.currentTarget.dataset.path == "/pages/hotList/index") {
- wx.navigateTo({
- url: `${e.currentTarget.dataset.path}?listtype=${this.data.toped}`,
- });
- }
- }
- },
- choiceSex(e) {
- var that = this;
- let data = e.currentTarget.dataset;
- that.data.filterData[data.type].forEach((item) => {
- item.active = 0;
- });
- let index = that.data.filterData[data.type].findIndex((item) => {
- return item.id == data.id;
- });
- that.data.filterData[data.type][index].active = data.id;
- // let str = that.data.sexid
- console.log(e);
- let str = e.currentTarget.dataset.id;
- console.log(str);
- if (str == "1") {
- that.data.secondMenu = "男生";
- } else if (str == "2") {
- that.data.secondMenu = "女生";
- } else if (str == "-1") {
- that.data.secondMenu = "不限";
- }
- that.setData({
- sexid: str,
- secondMenu: this.data.secondMenu,
- });
- that.data.storeJobListSearchForm.pageNum = 1;
- that.data.storeJobListSearchForm.sex = str;
- that.setData({
- storeJobListSearchForm: that.data.storeJobListSearchForm,
- recordList: [],
- filterData: that.data.filterData,
- innerFilter: true,
- });
- that.getJobList().then(() => {
- that.setData({
- siv: "menu",
- whichOneShow: "",
- });
- });
- },
- onScrollRefresh: function () {
- var that = this;
- that.data.storeJobListSearchForm.pageNum = 1;
- that.setData({
- recordList: [],
- });
- that.getJobList();
-
- // setTimeout(function(){
- // that.setData({
- // recordList: [],: false,
- // })
- // },2000);
- },
-
- cc: function () {},
- close: function () {
- this.setData({
- dialog1: false,
- dialog2: false,
- phoneDialog: false,
- });
- },
- searchKey: function (e) {
- if (!this.data.isLogin) {
- wx.navigateTo({
- url: "../login/index",
- });
- return;
- }
- console.log(e);
- this.data.recordList = [];
- this.data.storeJobListSearchForm.pageNum = 1;
- this.data.storeJobListSearchForm.keys = this.data.inputVal;
- this.getJobList();
- },
- onShareAppMessage: function () {
- var path = commonUtil.getCurrentPageUrlWithArgs();
- if (app.globalData.isLogin && app.globalData.agencyStatus - 0 != 0) {
- //当前用户是代理人
- path += (path.indexOf("?") >= 0 ? "&" : "?") + "agencyUserId=" + app.globalData.loginUserInfo.id;
- }
- console.log(path);
- let img;
-
- this.data.templateList.forEach((element) => {
- if (element.title == "职位云小程序首页卡片分享封面") {
- img = element.img + "?" + new Date().getTime();
- }
- });
- return {
- title: " ",
- path: path,
- imageUrl: img,
- };
- },
- goSearch() {
- if (!this.data.isLogin) {
- wx.navigateTo({
- url: "../login/index",
- });
- return;
- }
- wx.navigateTo({
- url: `../jobListSearch/index?from=project&listtype=${this.data.toped}&key=${this.data.placeholderText}`,
- });
- },
- clearInput: function () {
- this.setData({
- inputVal: "搜索工作",
- chaShowed: false,
- inputShowed: false,
- hasMoreData: true,
- });
- this.inputBlur();
- this.data.recordList = [];
- this.data.storeJobListSearchForm.pageNum = 1;
- this.data.storeJobListSearchForm.keys = "";
- this.getJobList();
- },
- inputTyping: function (e) {
- this.setData({
- inputVal: e.detail.value,
- });
- console.log(this.data.inputVal == "");
- if (this.data.inputVal == "") {
- this.data.recordList = [];
- this.data.storeJobListSearchForm.pageNum = 1;
- this.data.storeJobListSearchForm.keys = "";
- this.getJobList();
- }
- },
- /**
- * 清除本地缓存
- *
- *
- */
- clear() {
- wx.clearStorage();
-
- console.log("清除成功");
- },
- inputBlur() {},
- getListByTypeAndIndustry: function () {
- var that = this;
- wx.request({
- url: app.globalData.ip + "/labels/getListByTypeAndIndustry",
- data: {
- type: 90,
- industry: 2,
- },
- header: app.globalData.header,
- method: "GET",
- success: function (res) {
- console.log(res.data.data);
- wx.setStorageSync("FILTER_LIST", res.data.data);
- res.data.data.forEach((item) => {
- if (item.typeClassify == "0") {
- that.data.tagArray0.push(item);
- } else if (item.typeClassify == "1") {
- that.data.tagArray1.push(item);
- } else if (item.typeClassify == "2") {
- that.data.tagArray2.push(item);
- } else if (item.typeClassify == "3") {
- that.data.tagArray3.push(item);
- } else if (item.typeClassify == "4") {
- that.data.tagArray4.push(item);
- }
- });
- that.setData({
- tagArray0: that.data.tagArray0,
- tagArray1: that.data.tagArray1,
- tagArray2: that.data.tagArray2,
- tagArray3: that.data.tagArray3,
- tagArray4: that.data.tagArray4,
- });
-
- var jobSpecialLabelIdArray = that.data.storeJobListSearchForm.jobSpecialLabelIds.split(",");
-
- res.data.data.forEach((item) => {
- item["checked"] = false;
- jobSpecialLabelIdArray.forEach((item1) => {
- if (item.id == item1) {
- item["checked"] = true;
- }
- });
- });
-
- that.setData({
- jobSpecialLabelList: res.data.data,
- });
- },
- });
- },
- golistSharePage() {
- if (this.data.isLogin) {
- if (app.globalData.loginUserInfo.agencyStatus == 1) {
- wx.navigateTo({
- url: `/pages/listSharePage/index?listtype=${this.data.toped}`,
- });
- } else {
- wx.navigateTo({
- url: `/pages/tobeAgency/index`,
- });
- }
- } else {
- wx.navigateTo({
- url: `/pages/login/index`,
- });
- }
- },
- getBrandNameAllList: function () {
- var that = this;
- wx.request({
- url: app.globalData.ip + "/labels/type/95", // 分类列表获取接口
- header: app.globalData.header,
- method: "GET",
- success: function (res) {
- console.log(res);
- if (res.data.status == 200) {
- if (that.data.storeJobListSearchForm.brandIds) {
- var brandIdArray = that.data.storeJobListSearchForm.brandIds.split(",");
- }
- console.log(res.data.data.labels);
- wx.setStorageSync("CLASSIFY_LIST", res.data.data.labels);
- res.data.data.labels.forEach((item) => {
- item["checked"] = false;
- if (brandIdArray) {
- brandIdArray.forEach((item1) => {
- if (item.id == item1) {
- item["checked"] = true;
- }
- });
- }
- });
- that.setData({
- brandList: res.data.data.labels,
- });
- }
- },
- });
- // wx.request({
- // url: app.globalData.ip + "/brand/getBrandNameAllList", // 品牌列表获取接口
- // data: {},
- // header: app.globalData.header,
- // method: "GET",
- // success: function (res) {
- // console.log(res);
-
- // var brandIdArray = that.data.storeJobListSearchForm.brandIds.split(",");
-
- // res.data.data.forEach((item) => {
- // item["checked"] = false;
- // brandIdArray.forEach((item1) => {
- // if (item.id == item1) {
- // item["checked"] = true;
- // }
- // });
- // });
- // that.setData({
- // brandList: res.data.data,
- // });
- // },
- // });
- },
-
- selectBrand: function (e) {
- var that = this;
- let data = e.currentTarget.dataset;
- let index = that.data.filterData[data.type].findIndex((item) => {
- return item.id == data.id;
- });
- that.data.filterData[data.type][index].active = data.id;
-
- if (that.data.brandList[data.index].checked) {
- that.data.brandList[data.index].checked = false;
- // let index1 = that.data.selectBrandList.indexOf(that.data.brandList[index])
- // that.data.selectBrandList.splice(index1,1)
- } else {
- that.data.brandList[data.index].checked = true;
- }
- console.log(that.data.selectBrandList);
- this.setData({
- brandList: that.data.brandList,
- filterData: that.data.filterData,
- });
- },
- reset: function (e) {
- var that = this;
- console.log(e);
- if (e.target.dataset.type == 1) {
- //特色
- that.data.jobSpecialLabelList.forEach((item) => {
- // console.log(item);
- if (item.checked) {
- item.checked = false;
- }
- });
- that.setData({
- jobSpecialLabelList: that.data.jobSpecialLabelList,
- tagArray0: that.data.tagArray0,
- tagArray1: that.data.tagArray1,
- tagArray2: that.data.tagArray2,
- tagArray3: that.data.tagArray3,
- selectJobList: [],
- whichOneShow: "",
- });
- that.data.storeJobListSearchForm.jobSpecialLabelIds = "";
- } else if (e.target.dataset.type == 2) {
- //品牌
- that.data.brandList.forEach((item) => {
- if (item.checked) {
- item.checked = false;
- }
- });
- that.setData({
- brandList: that.data.brandList,
- selectBrandList: [],
- whichOneShow: "",
- });
- that.data.storeJobListSearchForm.jobCategoryLabelIds = "";
- // that.data.storeJobListSearchForm.brandIds = "";
- } else if (e.target.dataset.type == 4) {
- that.setData({
- activez: "",
- });
- }
- that.data.storeJobListSearchForm.pageNum = 1;
- that.setData({
- recordList: [],
- innerFilter: false,
- });
- that.getJobList();
- },
- loginOut: function () {
- var that = this;
- var jobSpecialLabelIdArray = [];
-
- // var brandIdArray = [];
- that.data.selectBrandList = [];
- that.data.filterData.classifyList.forEach((item) => {
- if (item.active) {
- if (that.data.selectBrandList.indexOf(item) == -1) {
- that.data.selectBrandList.push(item);
- }
- // brandIdArray.push(item.id);
- }
- });
- that.data.selectJobList = [];
- let subArr = that.data.filterData.jobFilter;
- let jobList = subArr.tagArray0.concat(subArr.tagArray1, subArr.tagArray2, subArr.tagArray3, subArr.tagArray4);
- jobList.forEach((item) => {
- if (item.active) {
- if (that.data.selectJobList.indexOf(item) == -1) {
- that.data.selectJobList.push(item);
- }
- }
- });
- // if (brandIdArray.length > 0) {
- // // that.data.storeJobListSearchForm.brandIds = brandIdArray.join(",");
- // that.data.storeJobListSearchForm.jobCategoryLabelIds = brandIdArray.join(",");
- // } else {
- // // that.data.storeJobListSearchForm.brandIds = "";
- // that.data.storeJobListSearchForm.jobCategoryLabelIds = "";
- // }
- // that.data.storeJobListSearchForm.pageNum = 1;
- that.setData({
- // recordList: [],
- // siv: "",
- // whichOneShow: "",
- selectBrandList: that.data.selectBrandList,
- selectJobList: that.data.selectJobList,
- // innerFilter:true
- });
- // that.getJobList();
- },
onLoad(options) {
var that = this;
let arr = [];
@@ -899,237 +215,6 @@ Page({
*
*
*/
- goChannel(e) {
- console.log(e);
- },
- /**
- * 筛选标签的点击
- *
- *
- */
- setActive(e) {
- console.log(e);
- let data = e.currentTarget.dataset;
- if (data.type == "yanba" || data.type == "sex" || data.type == "price") {
- console.log(data.id);
- let index = this.data.filterData[data.type].findIndex((item) => {
- return item.id == data.id;
- });
- if (this.data.filterData[data.type][index].active == data.id) {
- this.data.filterData[data.type][index].active = 0;
- } else {
- this.data.filterData[data.type].forEach((item) => {
- item.active = 0;
- });
- this.data.filterData[data.type][index].active = data.id;
- }
-
- this.setData({
- filterData: this.data.filterData,
- });
- } else if (data.type != "jobFilter") {
- this.data.filterData[data.type].forEach((item) => {
- if (item.id == data.id) {
- if (item.active == data.id) {
- item.active = 0;
- } else {
- item.active = data.id;
- }
- }
- });
- console.log(this.data.filterData[data.type]);
- } else {
- this.data.filterData[data.type][data.arr].forEach((item) => {
- if (item.id == data.id) {
- if (item.active == data.id) {
- item.active = 0;
- } else {
- item.active = data.id;
- }
- }
- });
- }
-
- this.setData({
- filterData: this.data.filterData,
- });
- },
-
- /**
- * 获取banner信息
- *
- *
- */
- getBannerList() {
- let that = this;
- wx.request({
- url: app.globalData.ip + "/daotian/banner/list",
- success(res) {
- console.log(res);
- if (res.data.status == 200) {
- that.setData({
- bannerList: res.data.data.banners,
- });
- }
- },
- });
- },
-
- /**
- * 获取图片模板信息
- *
- *
- */
- getTemplateList() {
- let that = this;
- wx.request({
- url: app.globalData.ip + "/daotian/image/list",
- success(res) {
- console.log(res);
- if (res.data.status == 200) {
- app.globalData.templateList = res.data.data.images;
- that.setData({
- templateList: res.data.data.images,
- });
- }
- },
- });
- },
-
- /**
- * 获取频道列表
- *
- *
- */
- getchannelList() {
- let that = this;
- wx.request({
- url: app.globalData.ip + "/daotian/channel/list",
- success(res) {
- console.log(res);
- if (res.data.status == 200) {
- that.setData({
- navList: res.data.data.channels,
- });
- }
- },
- });
- },
- /**
- * 清除筛选信息
- *
- *
- */
- clearFilter1(e) {
- let middleList = JSON.parse(JSON.stringify(this.data.copyList));
- let type = e.currentTarget.dataset.type;
- let filterData = this.data.filterData;
- console.log(type);
- if (type == 2) {
- filterData = {
- ...filterData,
- classifyList: middleList.classifyList,
- };
- this.setData({
- selectBrandList: [],
- });
- } else if (type == 1) {
- filterData = {
- ...filterData,
- jobFilter: middleList.jobFilter,
- };
- this.setData({
- selectJobList: [],
- });
- } else if (type == "outerClear") {
- filterData = middleList;
- this.setData({
- selectJobList: [],
- selectBrandList: [],
- firstMenu: "排序",
- secondMenu: "不限",
- sexid: -1,
- activez: "zuigao",
- innerFilter: false,
- });
- } else if (type == "innerclear") {
- filterData = middleList;
- this.setData({
- selectJobList: [],
- selectBrandList: [],
- firstMenu: "排序",
- secondMenu: "不限",
- sexid: -1,
- activez: "zuigao",
- innerFilter: false,
- });
- }
- console.log(filterData);
- this.setData({
- filterData,
- leftShow: false,
- recordList: [],
- whichOneShow: "",
- // scrollTo: "sticky",
- });
- if (this.data.choiceCollect == 0) {
- this.data.storeJobListSearchForm.ucj = 0;
- } else {
- this.data.storeJobListSearchForm.ucj = 1;
- }
- this.toList();
-
- // this.getJobList();
- },
-
-
- onChange(e) {
- const index = e.detail.index;
- this.setData({
- activeTab: index,
- });
- },
-
-
-
- emptyMethod(e) {
- console.log(e);
- },
-
- navigatorToRecord() {
- if (this.data.agencyStatus != 1) {
- this.setData({
- iosDialog: true,
- });
- return;
- }
- wx.navigateTo({
- url: `../newEnroll/enroll/index?applyType=1`,
- });
- },
- PageScroll(e) {
- let that = this;
- const query = wx.createSelectorQuery().in(this);
- query
- .select(".sticky")
- .boundingClientRect(function (res) {
- // console.log(res);
- if (res.top <= 5) {
- that.setData({
- isScrollTop: true,
- });
- } else if (res.top > 0 && res.top < 90) {
- that.setData({
- isScrollTop: false,
- });
- } else if (res.top >= 90) {
- that.setData({
- isScrollTop: false,
- });
- }
- })
- .exec();
- },
onShow() {
let that = this;
that.data.storeJobListSearchForm.pageNum = 1;
@@ -1184,27 +269,6 @@ Page({
key: "townsManInfoJob",
});
- /*this.wxLogin();
- let res = wx.getStorageSync({
- key: "storeJobId"
- }); //详情页返回
-
- if (app.isEmptyCheck(res.data)) {
- this.setData({
- recordList: []
- });
- } else {
- wx.removeStorageSync({
- key: "storeJobId"
- });
- }
-
- console.log("on show");
- this.getHopeJobLabels();
- var reset = true;*/
- that.getTemplateList();
- that.searchAnimate();
-
},
getJobList($type) {
@@ -1285,19 +349,7 @@ Page({
} else {
item["fuWuFei"] = "";
}
- // 简版弹窗通告显示
- if (item.id == that.data.currentJobDrawer.id) {
- item["jobDesp"] = item.jobDesp.replace(/\*\*\*\*\*/g, "").split("————————")[0];
- // 展示用字段
- item["jobDesp1"] = item.jobDesp.replace("⚠", "");
- item["jobDesp1"] = item.jobDesp1.replace("[红包]", "");
- that.data.currentJobDrawer = {
- ...item,
- index: that.data.currentJobDrawer.index ? that.data.currentJobDrawer.index : null,
- };
- }
-
-
+
});
let _stopList = [];
@@ -1335,7 +387,7 @@ Page({
},
bindCategoryScroll(e){
let that = this;
- console.log('分类滚动:',e.detail.scrollTop,' ',that.data.sList)
+ // console.log('分类滚动:',e.detail.scrollTop,' ',that.data.sList)
// 核心思想:判断当前数值在数组的哪两个区间中,取临界值 Math方法
if(0 <= e.detail.scrollTop && e.detail.scrollTop < 4241){
that.setData({
@@ -1371,58 +423,7 @@ Page({
});
};
},
- onScrollRefresh() {
- this.data.recordList = [];
- this.data.storeJobListSearchForm.pageNum = 1;
- this.getJobList();
- },
-
- // 下拉加载更多
- onScrollToLower() {
- console.log("====================================================");
- var that = this;
- // if (app.globalData.isLogin) {
- that.data.storeJobListSearchForm.pageNum = that.data.storeJobListSearchForm.pageNum + 1;
- if (that.data.hasMoreData) {
- that.getJobList();
- }
-
- this.setData({
- loadMore: "load",
- });
- // } else {
-
- // }
-
- that.data.pullNum = that.data.pullNum + 1;
- },
-
- handleTabClick(e) {
- var that = this;
- var index = e.detail.index;
- console.log(e.detail.index);
- let categoryCurr = that.data.tabs2[index].category; // that.data.tabs2.forEach((item,index2) => {
- // if (index == index2) {
- // categoryCurr = item.category
- // }
- // if( index == 0){
- // categoryCurr = -1
- // }
- // })
-
- this.setData({
- // [tabsName]: index,
- contentIndex: index,
- });
- console.log(categoryCurr);
- that.data.storeJobListSearchForm.jobClassify = categoryCurr;
- that.data.storeJobListSearchForm.pageNum = 1;
- that.setData({
- recordList: [],
- });
- that.getJobList();
- },
/**
* 标准详情
*
@@ -1436,83 +437,7 @@ Page({
});
},
- /**
- * 简版抽屉
- *
- *
- */
- goDrawer(event) {
- let that = this;
-
- console.log(event.currentTarget.dataset.item);
- event.currentTarget.dataset.item["jobDesp"] = event.currentTarget.dataset.item.jobDesp.replace(/\*\*\*\*\*/g, "").split("————————")[0];
- // 展示用字段
- event.currentTarget.dataset.item["jobDesp1"] = event.currentTarget.dataset.item.jobDesp.replace("⚠", "");
- event.currentTarget.dataset.item["jobDesp1"] = event.currentTarget.dataset.item.jobDesp1.replace("[红包]", "");
-
- // wx.hideTabBar({
- // success(e) {
- this.getTabBar().setData({
- isShow: false,
- });
- that.setData({
- currentJobDrawer: {
- ...event.currentTarget.dataset.item,
- index: event.currentTarget.dataset.index,
- },
- drawerShow: true,
- });
- // },
- // });
- console.log(this.data.currentJobDrawer);
- },
- copyClose() {
- var that = this;
- var contentInfo;
- const query = wx.createSelectorQuery().in(this);
- query
- .select(".contactInfo")
- .boundingClientRect(function (res) {
- contentInfo = res.dataset.info;
- var text = that.data.currentJobDrawer.jobDesp + contentInfo;
- wx.setClipboardData({
- data: text,
- success(res) {
- wx.getClipboardData({
- success(res) {
- console.log(res.data); // data
- wx.showToast({
- title: "内容已复制",
- icon: "none",
- duration: 1500,
- });
- },
- });
- },
- });
- })
- .exec();
- },
- // showDrawer() {
- // this.setData({
- // });
- // },
- hideDrawer() {
- let that = this;
- this.getTabBar().setData({
- isShow: true,
- });
- that.setData({
- drawerShow: false,
- });
- // this.getJobList();
- // setTimeout(() => {
- // wx.showTabBar({
- // success(e) {},
- // });
- // }, 300);
- },
goEnroll(e) {
console.log(e);
// wx.navigateTo({
@@ -1556,273 +481,14 @@ Page({
},
});
},
- getPhoneNumber(e) {
- var that = this;
- console.log(e);
- console.log(e.detail.errMsg);
- /*wx.setStorageSync({
- key: "jobDetailStorage",
- data: that.data.recordList[e.currentTarget.dataset.idx]
- });*/
-
- wx.setStorageSync("jobDetailStorage", that.data.recordList[e.currentTarget.dataset.idx]);
-
- // console.log(e);
- // console.log(e.detail.errMsg)
- // console.log(e.detail.iv)
- // console.log(e.detail.encryptedData)
- if ("getPhoneNumber:ok" == e.detail.errMsg) {
- //同意
- var iv = e.detail.iv;
- var encryptedData = e.detail.encryptedData;
- console.log(iv, "=-=========", encryptedData);
- wx.checkSession({
- success() {
- //session_key 未过期,并且在本生命周期一直有效
- wx.request({
- url: app.globalData.ip + "/getWechatTel",
- data: {
- code: that.data.wxCode,
- iv: iv,
- encryptedData: encryptedData,
- type: "yishoudan",
- appId:app.globalData.appId
- },
- success: function (res) {
- console.log(res);
- app.globalData.openId = res.data.data.openId;
- let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null);
- var collected = e.currentTarget.dataset.collected;
- if (collected) {
- promise.then((res) => {
- that.setData({
- isLogin: app.globalData.isLogin,
- });
- that.doCollected(collected, e.currentTarget.dataset.jobid);
- // that.collectedStoreJobList();
- });
- } else {
- if (that.data.recordBillType == "photo" || that.data.recordBillType == "record") {
- promise.then((res) => {
- if (that.data.recordBillType == "photo") {
- that.chooseIdCard();
- } else {
- that.navigatorToRecord();
- }
- });
- } else {
- promise.then((res) => {
- let argument;
- argument = JSON.stringify(e.currentTarget.dataset.info).replace(/\=|\&/g, "3D");
- wx.navigateTo({
- url: `../newEnroll/enroll/index?applyType=1&info=${argument}`,
- });
- });
- }
- }
- },
- fail: function (res) {
- console.log("获取用户手机号错误");
- },
- });
- },
- fail() {
- // session_key 已经失效,需要重新执行登录流程
- wx.login({
- success(res) {
- if (res.code) {
- console.log(res.code);
- //发起网络请求
- wx.request({
- url: app.globalData.ip + "/getWechatTel",
- data: {
- code: res.code,
- iv: iv,
- encryptedData: encryptedData,
- type: "yishoudan",
- appId:app.globalData.appId
- },
- success: function (res) {
- console.log(res);
- let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null);
- var collected = e.currentTarget.dataset.collected;
- if (collected) {
- promise.then((res) => {
- that.setData({
- isLogin: app.globalData.isLogin,
- });
- that.doCollected(collected, e.currentTarget.dataset.jobid);
- });
- } else {
- promise.then((res) => {
- wx.navigateTo({
- url: "../enroll/index?applyType=1",
- //url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber
- });
- });
- }
- },
- fail: function (res) {
- console.log("获取用户手机号错误");
- },
- });
- } else {
- console.log("获取手机号失败!" + res.errMsg);
- }
- },
- });
- },
- });
- } else {
- //拒绝
- var collected = e.currentTarget.dataset.collected;
- if (collected) {
- try {
- wx.setStorageSync("comeFromPage", "index");
- } catch (e) {
- console.log("index-页面跳转,设置参数错误:", e);
- }
- wx.navigateTo({
- url: "/pages/login/index",
- });
- } else {
- wx.navigateTo({
- url: "../enroll/index?applyType=1",
- });
- }
- }
- return false;
- },
-
- getAgencyUserId(id) {
- var that = this;
- wx.request({
- url: app.globalData.ip + "/channel/contact/getAgencyUserId",
- method: "GET",
- header: app.globalData.header,
- data: {
- channelContactId: id,
- },
- success: function (res) {
- console.log("获取来源对应的代理人,来源ID:", id);
- console.log(res);
- try {
- if (app.isNotEmptyCheck(res.data.data)) {
- wx.setStorageSync("storageSyncAgencyUserId", res.data.data);
- }
- //先设置代理人缓存人再登录
- app.getLoginUserTokenInfo();
- } catch (e) {
- console.log("0-扫描微信二维码,设置参数错误:", e);
- //先设置代理人缓存人再登录
- app.getLoginUserTokenInfo();
- }
- },
- fail: function (res0) {
- console.log("获取来源对应的代理人错误", id);
- },
- });
- },
-
-
scroll(e) {
return false;
},
stoptap(e) {
return false;
},
- changeContact() {
- console.log(2123);
- wx.navigateTo({
- url: `/pages/configAnnunciate/index`,
- });
- },
- imageLoad() {
- this.setData({
- isLoading: false,
- });
- },
- closeDialog() {
- this.setData({
- iosDialog: false,
- });
- },
- showLeft() {
- this.setData({
- leftShow: true,
- });
- },
- hideLeft() {
- this.setData({
- leftShow: false,
- whichOneShow: "",
- });
- console.log(this.data.innerFilter);
- if (!this.data.innerFilter) {
- this.setData({
- filterData: JSON.parse(JSON.stringify(this.data.copyList)),
- });
- }
- },
- /**
- * 阻止滑动穿透
- *
- *
- */
- modalMove() {
- return false;
- },
- /**
- * 获取搜索轮播的关键字索引
- *
- *
- */
-
- onPageScroll(e) {},
-
- searchAnimate() {
- let that = this;
- wx.createSelectorQuery()
- .select("#listBox")
- .fields(
- {
- scrollOffset: true,
- size: true,
- },
- (res) => {
-
- this.animate(
- ".navigatorBar",
- [
- {
- opacity: 0
- },
- {
- opacity: 1
- },
- ],
- 800,
- {
- scrollSource: "#listBox",
- timeRange: 1000,
- startScrollOffset: 0,
- endScrollOffset: that.data.swiperHeight - 34,
- }
- );
- }
- )
- .exec();
- },
-
- // tabbar点击监听
- onTabItemTap(e) {
- console.log(e);
- let that = this;
- that.setData({
- topNum: 1,
- });
- },
+
onHide() {
this.setData({
whichOneShow: "",