Page({
data: {
showsearch:false, //显示搜索按钮
searchtext:'', //搜索文字
filterdata:{}, //筛选条件数据
showfilter:false, //是否显示下拉筛选
showfilterindex:null, //显示哪个筛选类目
sortindex:0, //一级分类索引
sortid:null, //一级分类id
subsortindex:0, //二级分类索引
subsortid:null, //二级分类id
cityindex:0, //一级城市索引
cityid:null, //一级城市id
subcityindex:0, //二级城市索引
subcityid:null, //二级城市id
servicelist:[], //服务集市列表
scrolltop:null, //滚动位置
page: 0 //分页
},
onLoad: function () { //加载数据渲染页面
this.fetchServiceData();
this.fetchFilterData();
},
fetchFilterData:function(){ //获取筛选条件
this.setData({
filterdata:{
"sort": [
{
"id": 0,
"title": "全部"
},
{
"id": 1,
"title": "人力资源",
"subsort": [
{
"id": 1,
"title": "全部"
},
{
"id": 11,
"title": "社会及商业保险"
},
{
"id": 12,
"title": "招聘、猎头"
},
{
"id": 13,
"title": "薪酬绩效"
},
]
},
{
"id": 2,
"title": "财务法务",
"subsort": [
{
"id": 2,
"title": "全部"
},
{
"id": 21,
"title": "知识产权保护"
},
{
"id": 22,
"title": "工商注册"
},
{
"id": 23,
"title": "法律咨询"
},
]
},
{
"id": 3,
"title": "行政办公",
"subsort": [
{
"id": 3,
"title": "全部"
},
{
"id": 31,
"title": "翻译"
},
{
"id": 32,
"title": "速记"
}
]
},
{
"id": 4,
"title": "创业指导",
"subsort": [
{
"id": 4,
"title": "全部"
},
{
"id": 41,
"title": "创业培训"
}
]
},
],
"city": [
{
"id": 0,
"title": "全部"
},
{
"id": 1,
"title": "湖北省",
"subcity": [
{
"id": 1,
"title": "全部"
},
{
"id": 11,
"title": "武汉市"
},
{
"id": 12,
"title": "襄阳市"
},
{
"id": 13,
"title": "孝感市"
},
{
"id": 14,
"title": "随州市"
},
{
"id": 15,
"title": "荆州市"
},
{
"id": 16,
"title": "黄冈市"
},
{
"id": 17,
"title": "天门市"
},
{
"id": 18,
"title": "仙桃市"
},
{
"id": 19,
"title": "潜江市"
},
{
"id": 20,
"title": "十堰市"
},
{
"id": 21,
"title": "宜昌市"
},
{
"id": 22,
"title": "咸宁市"
},
]
},
{
"id": 2,
"title": "浙江省",
"subcity": [
{
"id": 2,
"title": "全部"
},
{
"id": 21,
"title": "杭州市"
},
{
"id": 22,
"title": "金华市"
},
{
"id": 23,
"title": "义乌市"
},
]
},
{
"id": 3,
"title": "江苏省",
"subcity": [
{
"id": 3,
"title": "全部"
},
{
"id": 31,
"title": "南京市"
},
{
"id": 32,
"title": "苏州市"
}
]
}
],
}
})
},
fetchServiceData:function(){ //获取城市列表
let _this = this;
wx.showToast({
title: '加载中',
icon: 'loading'
})
const perpage = 10;
this.setData({
page:this.data.page+1
})
const page = this.data.page;
const newlist = [];
for (var i = (page-1)*perpage; i < page*perpage; i++) {
newlist.push({
"id":i+1,
"name":"上海拜特信息技术有限公司"+(i+1),
"city":"上海",
"tag":"法律咨询",
"imgurl":"http://img.mukewang.com/57fdecf80001fb0406000338-240-135.jpg"
})
}
setTimeout(()=>{
_this.setData({
servicelist:_this.data.servicelist.concat(newlist)
})
},1500)
},
inputSearch:function(e){ //输入搜索文字
this.setData({
showsearch:e.detail.cursor>0,
searchtext:e.detail.value
})
},
submitSearch:function(){ //提交搜索
console.log(this.data.searchtext);
this.fetchServiceData();
},
setFilterPanel: function(e){ //展开筛选面板
const d = this.data;
const i = e.currentTarget.dataset.findex;
if(d.showfilterindex == i){
this.setData({
showfilter: false,
showfilterindex: null
})
}else{
this.setData({
showfilter: true,
showfilterindex:i,
})
}
console.log(d.showfilterindex);
},
setSortIndex:function(e){ //服务类别一级索引
const d= this.data;
const dataset = e.currentTarget.dataset;
this.setData({
sortindex:dataset.sortindex,
sortid:dataset.sortid,
subsortindex: d.sortindex==dataset.sortindex ? d.subsortindex:0
})
console.log('服务类别id:一级--'+this.data.sortid+',二级--'+this.data.subsortid);
},
setSubsortIndex:function(e){ //服务类别二级索引
const dataset = e.currentTarget.dataset;
this.setData({
subsortindex:dataset.subsortindex,
subsortid:dataset.subsortid,
})
console.log('服务类别id:一级--'+this.data.sortid+',二级--'+this.data.subsortid);
},
setCityIndex:function(e){ //服务城市一级索引
const d= this.data;
const dataset = e.currentTarget.dataset;
this.setData({
cityindex:dataset.cityindex,
cityid:dataset.cityid,
subcityindex: d.cityindex==dataset.cityindex ? d.subcityindex:0
})
console.log('服务城市id:一级--'+this.data.cit

荣华富贵8
- 粉丝: 803
最新资源
- LeadingThink_digital-city-tutorial_20824_1755584885067.zip
- 报废车拆解全流程智能管理系统_报废车回收拆解企业专用ERP软件_包含验收入库拆解管理销售管理库存核对统计报表等核心功能_适用于报废机动车回收拆解企业的全流程数字化管理_采用宏达数据.zip
- 基于Linux内核的开源操作系统项目_包含系统内核开发_驱动程序编写_命令行工具集_图形界面优化_文件系统管理_网络协议栈实现_安全模块加固_性能调优工具_虚拟化支持_容器化技术_.zip
- 【工业自动化】基于C#与MX Component控件实现三菱PLC软元件数据读写的三种方法及应用:包含通信设置、仿真PLC操作与FX1S PLC的实际读写控制了文档的核心内容
- 城市路灯智能运维管理系统是一款专为市政管理部门和物业公司设计的综合性路灯管理平台_包含路灯基本信息登记_巡查记录管理_月度报修汇总_检修复验记录_按报修类型统计分析_电表信息管.zip
- 财政票据管理系统_非税收入票据全流程管理软件_专为各级财政部门设计的综合性票据管理平台_包含票据入库销毁发售退回作废缴验等全生命周期管理功能_支持多维度票据查询统计报表_实现票据领.zip
- 1265578519_kernel_13092_1755583630789.zip
- 交通客运车辆综合管理系统_长途客运短途客运公交车出租车校车旅游车通勤车营运登记车辆技术参数变更等级评定二维维修驾驶员考核事故违章进出站年审保险预警管理_用于交通局全面管理各类客运车.zip
- VlsyV_Multi-Core-Experiment_29388_1755583690707.zip
- shan-liangguang_Project_7244_1755583691730.zip
- 擦鞋修鞋店全流程智能管理系统_专为擦鞋修鞋行业设计的会员管理消费统计库存管理员工考勤一体化解决方案_包含基础信息设置会员卡充值客户预定消费产品进出库服务消费统计报表等核心功能_采用.zip
- cz0729zc_4G_Monitoring_System_for_Train_Noise_13092_1755584900220.zip
- wangguoshuang_Book-Pricing-System-Based-on-Python-3-V10_13092_1755584908612.zip
- wangguoshuang_Book-Pricing-System-Based-on-Python-3-V20_20824_1755584907574.zip
- 沙石料运输全流程信息化管理系统_针对沙石厂销售运输业务开发的综合管理平台_包含现金出库单挂账出库单押金出库单油料管理应收应付账款管理员工考核租赁登记等核心功能_采用宏达.zip
- 基于Vuejs框架开发的电子班牌后台管理系统_支持LED显示屏内容管理与实时更新_包含班级信息展示_课表管理_通知公告_考勤统计_校园文化宣传_多媒体内容播放_远程控制_多终端适.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


