小程序
小游戏
企业微信
微信支付
扫描小程序码分享
多次(10次左右)切换左边和右边的一样了
1 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
我打印是接口返回数据变了,但是postman多次测试没有错误
var httpClient = require('../utils/HttpClient.js');
var tools = require('../utils/util.js');
import url from "../utils/apiUrl.js"
var pageData = {
//被点击的左侧菜单
currentIndex:0,
//右侧内容的滚动条距离顶部的距离
scrollTop:0,
//左侧菜单的数据
leftMenuList:[],
//右侧列表
rightList:[],
type:'',
id:'',
skip:'',
jobIndustryParent:'1001',
height:''
};
var methods = {
//获取行业左侧内容
getLeftMenuList(){
let that=this
httpClient.get(url.getJobIndustryList).then(function(r){
console.log('11111',url.getJobIndustryList);
console.log('左边',r)
//构造左侧的大菜单数据
let leftMenuList=r
//console.log("左侧菜单",leftMenuList);
that.setData({
leftMenuList,
})
},
//获取行业信息右侧内容
getJobIndustryList(value){
wx.showLoading({
title: '正在加载...',
});
httpClient.get(url.getJobIndustryList+"?parent_no="+value).then(function(r){
wx.hideLoading();
console.log('右边',r)
let rightList=r
//console.log("右侧菜单",rightList);
rightList,
//右侧行业信息传参跳转
rightClick(e){
const {industry}=e.currentTarget.dataset
const {name}=e.currentTarget.dataset
const {type}=e.currentTarget.dataset;
// console.log('industryNo',industry);
//console.log('name',name);
// console.log('type',type);
//console.log('id',this.data.id);
let jobIndustryParent=this.data.jobIndustryParent
//企业行业
if(this.data.skip==1){
var parentPage= tools.getPage(getCurrentPages(),'pages/enterpris-data-entry/enterpris-data-entry');
//console.log('parentPage',parentPage);
parentPage.changeIndustry(industry,name,jobIndustryParent)
wx.navigateBack({
delta: 1
}
else if(this.data.skip==3){
var parentPage= tools.getPage(getCurrentPages(),'pages/new-posts-added/new-posts-added');
parentPage.changeIndustry(industry,name)
else{
var parentPage= tools.getPage(getCurrentPages(),'pages/job-intention/job-intention');
//获取职位左侧内容
getJobPositionList(value){
httpClient.get(url.getJobPositionList).then(function(r){
console.log('22222',url.getJobPositionList);
//获取职位右侧内容
getJobIndustryList2(value){
//console.log('value',value);
httpClient.get(url.getJobPositionList+"?parent_no="+value).then(function(r){
//右侧职位菜单传参跳转
positionClick(e){
const {positionno}=e.currentTarget.dataset;
if(this.data.skip==2){
parentPage.changePositionName(name,positionno)
}else{
//左侧菜单点击事件
handleItemTap(e){
const {index}=e.currentTarget.dataset;
const {industry}=e.currentTarget.dataset;
if(type==1){
this.getJobIndustryList(industry)
this.getJobIndustryList2(industry)
//console.log(e.currentTarget.dataset);
let jobIndustryParent=this.data.leftMenuList[index].industryNo
this.setData({
currentIndex:index,
/* 重新设置 右侧内容的 scroll-view标签的距离顶部的距离*/
jobIndustryParent
//返回带参
back(e){
const {id}=e.currentTarget.dataset
//console.log('id back',id);
module.exports = {
pageData: pageData,
methods: methods
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
我打印是接口返回数据变了,但是postman多次测试没有错误
var httpClient = require('../utils/HttpClient.js');
var tools = require('../utils/util.js');
import url from "../utils/apiUrl.js"
var pageData = {
//被点击的左侧菜单
currentIndex:0,
//右侧内容的滚动条距离顶部的距离
scrollTop:0,
//左侧菜单的数据
leftMenuList:[],
//右侧列表
rightList:[],
type:'',
id:'',
skip:'',
jobIndustryParent:'1001',
height:''
};
var methods = {
//获取行业左侧内容
getLeftMenuList(){
let that=this
httpClient.get(url.getJobIndustryList).then(function(r){
console.log('11111',url.getJobIndustryList);
console.log('左边',r)
//构造左侧的大菜单数据
let leftMenuList=r
//console.log("左侧菜单",leftMenuList);
that.setData({
leftMenuList,
})
})
},
//获取行业信息右侧内容
getJobIndustryList(value){
wx.showLoading({
title: '正在加载...',
});
let that=this
httpClient.get(url.getJobIndustryList+"?parent_no="+value).then(function(r){
wx.hideLoading();
console.log('右边',r)
//构造左侧的大菜单数据
let rightList=r
//console.log("右侧菜单",rightList);
that.setData({
rightList,
})
})
},
//右侧行业信息传参跳转
rightClick(e){
const {industry}=e.currentTarget.dataset
const {name}=e.currentTarget.dataset
const {type}=e.currentTarget.dataset;
// console.log('industryNo',industry);
//console.log('name',name);
// console.log('type',type);
//console.log('id',this.data.id);
let jobIndustryParent=this.data.jobIndustryParent
//企业行业
if(this.data.skip==1){
var parentPage= tools.getPage(getCurrentPages(),'pages/enterpris-data-entry/enterpris-data-entry');
//console.log('parentPage',parentPage);
parentPage.changeIndustry(industry,name,jobIndustryParent)
wx.navigateBack({
delta: 1
});
}
else if(this.data.skip==3){
var parentPage= tools.getPage(getCurrentPages(),'pages/new-posts-added/new-posts-added');
//console.log('parentPage',parentPage);
parentPage.changeIndustry(industry,name)
wx.navigateBack({
delta: 1
});
}
else{
var parentPage= tools.getPage(getCurrentPages(),'pages/job-intention/job-intention');
//console.log('parentPage',parentPage);
parentPage.changeIndustry(industry,name)
wx.navigateBack({
delta: 1
});
}
},
//获取职位左侧内容
getJobPositionList(value){
let that=this
httpClient.get(url.getJobPositionList).then(function(r){
console.log('22222',url.getJobPositionList);
console.log('左边',r)
//构造左侧的大菜单数据
let leftMenuList=r
//console.log("左侧菜单",leftMenuList);
that.setData({
leftMenuList,
})
})
},
//获取职位右侧内容
getJobIndustryList2(value){
//console.log('value',value);
wx.showLoading({
title: '正在加载...',
});
let that=this
httpClient.get(url.getJobPositionList+"?parent_no="+value).then(function(r){
wx.hideLoading();
console.log('右边',r)
//构造左侧的大菜单数据
let rightList=r
//console.log("右侧菜单",rightList);
that.setData({
rightList,
})
})
},
//右侧职位菜单传参跳转
positionClick(e){
const {industry}=e.currentTarget.dataset
const {name}=e.currentTarget.dataset
const {type}=e.currentTarget.dataset;
const {positionno}=e.currentTarget.dataset;
if(this.data.skip==2){
var parentPage= tools.getPage(getCurrentPages(),'pages/new-posts-added/new-posts-added');
parentPage.changePositionName(name,positionno)
wx.navigateBack({
delta: 1
});
}else{
var parentPage= tools.getPage(getCurrentPages(),'pages/job-intention/job-intention');
parentPage.changePositionName(name,positionno)
wx.navigateBack({
delta: 1
});
}
},
//左侧菜单点击事件
handleItemTap(e){
const {index}=e.currentTarget.dataset;
const {industry}=e.currentTarget.dataset;
const {type}=e.currentTarget.dataset;
if(type==1){
this.getJobIndustryList(industry)
}else{
this.getJobIndustryList2(industry)
}
//console.log(e.currentTarget.dataset);
let jobIndustryParent=this.data.leftMenuList[index].industryNo
this.setData({
currentIndex:index,
/* 重新设置 右侧内容的 scroll-view标签的距离顶部的距离*/
scrollTop:0,
jobIndustryParent
})
},
//返回带参
back(e){
const {id}=e.currentTarget.dataset
//console.log('id back',id);
wx.navigateBack({
delta: 1
});
},
}
module.exports = {
pageData: pageData,
methods: methods
}