微信小程序实现分类列表

article/2025/11/6 15:50:47

1、效果展示

2、fenleiliebiao.wxml文件代码


<!-- 头部搜索 -->
<view class="title_search"></view>
<!-- 头部搜索 -->
<!-- Tab布局 -->
<view catchtouchmove='true'><view class='navBox'><view class='titleBox1' id="allaid" bindtap='titleClick' data-idx='0'><text class="{{0 == currentIndex ? 'fontColorBox' : 'fontColorBox1'}}">服务预约</text><hr class="{{0 == currentIndex ? 'lineBox' : 'notLineBox'}}" /></view><view class='titleBox2' bindtap='titleClick' data-idx='1'><text class="{{1 == currentIndex ? 'fontColorBox' : 'fontColorBox1'}}">订单消息</text><hr class="{{1 == currentIndex ? 'lineBox' : 'notLineBox'}} " /></view></view><!-- 内容布局 --><swiper class='swiperTtemBox' bindchange='pagechange' current='{{currentIndex}}'><!--服务预约 --><swiper-item class='swiperTtemBox' catchtouchmove='onTouchMove'><!-- 家属列表 --><scroll-view class="box-scroll" scroll-y='true'><!-- 服务列表 --><block wx:for="{{listItem}}" wx:key="id" wx:for-item="itemName" wx:for-index="id"><view class="up_service"><view class="up_service_content"><!-- 上门服务 --><view class="up_service_title_txt"><text>{{itemName.packageName }}</text></view><!-- 服务内容 --><view class="upitem_list"><block wx:for="{{itemName.services.length}}" wx:key="ids" wx:for-item="chilgrenItem" wx:for-index="ids"><view class="item_nursin" catchtap="nursin_servies" id="{{itemName.services[ids].serviceId}}"><image class="up_service_icon" src="/images/lemon.png" catchtap="nursin_servies" id="{{itemName.services[ids].serviceId}}"></image><text class="up_ser_it_txt" id="up_ser_it_txt_id" catchtap="nursin_servies" id="{{itemName.services[ids].serviceId}}">{{itemName.services[ids].brandName}}</text></view></block></view></view></view></block></scroll-view></swiper-item><!-- 订单消息 --><swiper-item class='swiperTtemBox' catchtouchmove='onTouchMove'><view class="order_msg_md">暂无订单消息</view></swiper-item></swiper>
</view>

3、fenleiliebiao.wxss文件


Page {background: #f0f0f0;height: 100%;position: fixed;
}
/* 头部搜索 */
/* 搜索标题 */
.title_search{background: linear-gradient(to right, #0455a7, #62c8ec);height: 170rpx;width: 100%;display: flex;flex-direction: row;align-items: flex-end;justify-content: flex-start;
}
.seeck_md{display: flex;flex-direction: row;width: 100%;justify-content: space-between;align-items: flex-end;
}
.ahead_md{display: flex;flex-direction: row;width: 100%;margin-bottom: 20rpx;
}.title_icon_ss{height: 70rpx;width: 70rpx;background-color: white;border-radius: 35rpx;margin-left: 20rpxrpx;
}
/* 搜索部分bg*/
.search_md{background-color: #69ccf1;margin-left: 10rpx;height: 70rpx;width: 390rpx;border-radius: 35rpx;display: flex;flex-direction: row;align-items: center;justify-content: space-between;
}/* 搜索 */
.seeck_ic{height: 46rpx;width: 46rpx;margin-left: 20rpx;border-radius: 23rpx;
}
/* 语音 */
.vioce_icon{height: 46rpx;width: 46rpx;border-radius: 23rpx;margin-right: 20rpx;
}
/* 消息 */
.msg{width: 100rpx;height: 90rpx; display: flex;flex-direction: column;justify-content: center;align-items: center;margin-right: 0rpx;margin-left: 30rpx;
}/* 消息提示 */
.msg_tag{position: absolute;background-color: #ff6162;width: 14rpx;height: 14rpx;border-radius: 7rpx;margin-bottom: 72rpx;margin-left: 24rpx;
}.msg_ic{height: 44rpx;width: 48rpx;margin-right: 2rpx;margin-right: 10rpx;
}
.msg_txt{font-size: 24rpx;height: 40rpx;width: 60rpx;margin-bottom: 20rpx;align-items: flex-start;color: #fff;display: flex;justify-content: flex-start;
}
/* 退出 */
.logout{width: 100rpx;height: 90rpx; display: flex;flex-direction: column;justify-content: center;align-items: center;margin-right: 30rpx; 
}
.logout_ic{height: 44rpx;width: 48rpx;margin-right: 2rpx;
}
.logout_txt{font-size: 24rpx;height: 40rpx;width: 60rpx;margin-bottom: 20rpx;align-items: flex-start;color: #fff;display: flex;justify-content: flex-start;
}
/* 搜索标题 */
/* 头部搜索  */
.box-scroll{background-color: #EFEFEF;width: 100%;flex: 1 auto;height: calc(100vh - 260rpx);left: 0rpx;right: 0rpx;top: 0rpx;padding-bottom: 0rpx;
}/* .box-scroll {flex: 1 auto;height: calc(100vh - 390rpx);left: 0rpx;right: 0rpx;top: 0rpx;padding-bottom: 20rpx;
} *//* 顶部切换 */
.navBox {/* 顶部tab盒子样式 */width: 100%;height: 80rpx;background: white;display: flex;flex-direction: row;align-items: center;justify-content: center;
}/* 文字默认颜色 */
.fontColorBox {color: #07c8ae;
}.fontColorBox1 {color: black;
}/* 文字默认颜色 */
.titleBox1,
.titleBox2 {/* 未选中文字的样式 */width: 50%;font-size: 30rpx;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: flex-end;padding-top: 10rpx;
}.lineBox,
.notLineBox {/* 选中及未选中底线共同样式 */width: 100%;height: 4rpx;margin-top: 16rpx;border-radius: 4rpx;
}.lineBox {/* 选中底线样式 */background: #06c7ae;width: 100%;height: 4rpx;margin-top: 16rpx;border-radius: 4rpx;
}.notLineBox {/* 未选中底线样式 */background: transparent;width: 100%;height: 4rpx;
}/* 底部内容样式 */
.swiperTtemBox {height: 100vh;overflow: scroll;margin: 0rpx 0rpx;background: #f0f0f0;border-radius: 30rpx;font-size: 28rpx;margin-top: 5rpx;
}/* 顶部切换 */
.up_service {justify-content: left;padding-left: 40rpx;padding-right: 40rpx;
}.up_service_content {justify-content: space-between;
}.up_service_title_txt {color: #666666;
}.upitem_list {display: flex;flex-direction: row;justify-content: space-between;flex-wrap: wrap;
}.item_nursin {width: 320rpx;height: 200rpx;display: flex;flex-direction: column;justify-content: center;align-items: center;flex-shrink: 0;flex-grow: 0;margin-top: 30rpx;background-color: white;border-radius: 20rpx;
}.up_service_icon {width: 130rpx;height: 110rpx;border-radius: 10rpx;margin-top: 10rpx;
}#up_ser_it_txt_id {color: #1b1b1b;font-size: 32rpx;margin-top: 10rpx;
}.cn_medicine {margin-top: 30rpx;display: flex;flex-direction: row;justify-content: space-between;
}/* 院内服务 */
.hospital_service {justify-content: left;padding-left: 40rpx;padding-right: 40rpx;margin-top: 10rpx;
}.order_msg_md{display: flex;margin-top: 30rpx;align-items: center;justify-content: center;color: #919199;
}.scroll-view_H {overflow: scroll;white-space: nowrap;background-color: white;margin-right: 30rpx;
}.head_list {display: flex;/* display: inline-block; */flex-direction: row;background-color: white;height: 160rpx;width: 100%;justify-content: flex-start;align-items: center;
}/* 家属选择背景 */
.head_list_item_one {flex-shrink: 0;flex-grow: 0;display: flex;flex-direction: column;background-color: #f0f0f0;width: 140rpx;height: 140rpx;align-items: center;justify-content: center;margin-left: 30rpx;border-radius: 10rpx;
}/* 家属选背景 */
.head_list_item_one_ed {display: flex;flex-direction: column;background-color: #06c7ae;flex-shrink: 0;flex-grow: 0;width: 140rpx;height: 140rpx;align-items: center;justify-content: center;margin-left: 30rpx;border-radius: 10rpx;
}.head_list_item_one_im_parent {background-color: white;width: 80rpx;height: 80rpx;border-radius: 40rpx;display: flex;align-items: center;justify-content: center;
}.head_list_item_one_im {width: 72rpx;height: 72rpx;border-radius: 36rpx;background-color: white;
}.head_list_item_one_txt {margin-top: 6rpx;font-size: 26rpx;color: #252525;
}.head_list_item_one_txt_ed {margin-top: 6rpx;font-size: 26rpx;color: #ffffff;
}.first {margin-top: 20rpx;
}

4、fenleiliebiao.ts文件

// pages/healdata/healthydata.ts
Page({/*** 页面的初始数据*/data: {currentIndex: 0, //默认是活动项home: "#979797",find: "#979797",services: "#00c2a5",mind: "#979797",homeChoose: false,findChoose: false,servicesChoose: true,mindChoose: false,msg: {},//消息数noNewMsg: true,//true表示新有新消息servicesAppiontData: [//服务预约数据列表{}],listItem: [{"deptId": 2098494533, "packageId": 1, "packageName": "院内服务", "services": [{"serviceId": 1, "deptId": 2098494533, "brandName": "PICC护理", "serviceType": "1"}, {"serviceId": 2, "deptId": 2098494533, "brandName": "压疮护理", "serviceType": "1"}, {"serviceId": 3, "deptId": 2098494533, "brandName": "导尿管护理", "serviceType": "1"}, {"serviceId": 4, "deptId": 2098494533, "brandName": "胃管护理", "serviceType": "1",}]}, {"deptId": 2098494533, "packageId": 2, "packageName": "中医服务", "services": [{"serviceId": 7, "deptId": 2098494533, "brandName": "失眠", "serviceType": "2"}, {"serviceId": 8, "deptId": 2098494533, "brandName": "便秘", "serviceType": "2"}, {"serviceId": 9, "deptId": 2098494533, "brandName": "颈椎病", "serviceType": "2"} ]}, {"deptId": 2098494533, "packageId": 2, "packageName": "中医服务", "services": [{"serviceId": 10, "deptId": 2098494533, "brandName": "便秘", "serviceType": "2"}, {"serviceId": 11, "deptId": 2098494533, "brandName": "颈椎病", "serviceType": "2"} ]}, ],//数据列表数据patintIdS: ''},/*** 生命周期函数--监听页面加载*/onLoad() {},//点击tab时触发titleClick: function (e: any) {this.setData({//拿到当前索引并动态改变currentIndex: e.currentTarget.dataset.idx})//  console.log("======拿到当前索引并动态改变=dddd======")    },/*** 生命周期函数--监听页面初次渲染完成*/onReady() {},/*** 生命周期函数--监听页面显示*/onShow() {wx.hideHomeButton()},/*** 生命周期函数--监听页面隐藏*/onHide() {},/*** 生命周期函数--监听页面卸载*/onUnload() {},/*** 页面相关事件处理函数--监听用户下拉动作*/onPullDownRefresh() {},/*** 页面上拉触底事件的处理函数*/onReachBottom() {},/*** 用户点击右上角分享*/onShareAppMessage() {}
})

5、fenleiliebiao.json文件

{"usingComponents": {},"navigationBarTitleText": "分类列表","navigationStyle": "custom"
}


http://chatgpt.dhexx.cn/article/In8Mmbnm.shtml

相关文章

微信小程序--数据列表

设置页面标题 首页可以使用&#xff1a; app.json中window对象的"navigationBarTitleText"参数进行标题设置&#xff0c; 每个页面也可以在对应json文件中使用"navigationBarTitleText"参数进行标题设置 也可以在js文件的onRead函数中使用&#xff1a;js中…

用小程序完成简单的详情列表功能

最近学习了微信小程序&#xff0c;写了一个详情列表 主要思路是&#xff1a; 1.先通过接口拿到数据&#xff0c;在onLoad(options){}中调用wx.request(){}函数&#xff0c;获取到数据 2.完成数据渲染后&#xff0c;&#xff0c;用catchtab给它绑定一个点击事件&#xff0c;点…

微信小程序--列表展示

小知识&#xff1a; wx:for"{{list}}"用来循环数组。 wx:for-item‘变量名&#xff08;随便起&#xff09;’ 它是指定循环数据当前的变量名&#xff0c;可以通过 {{变量名.属性}} 展示数组的元素。 wx:for-index‘变量名&#xff08;随便起&#xff09;’&#x…

vmware 下 ubuntu 双网卡设置

写在前面&#xff1a; 本文章旨在总结备份、方便以后查询&#xff0c;由于是个人总结&#xff0c;如有不对&#xff0c;欢迎指正&#xff1b;另外&#xff0c;内容大部分来自网络、书籍、和各类手册&#xff0c;如若侵权请告知&#xff0c;马上删帖致歉。 目录 step 1&#xf…

Ubuntu18.04 配置网卡

2019/10/29, Ubuntu Server 18.04 摘要&#xff1a;Ubuntu Server 18.04 采用netplan作为网络配置管理&#xff0c;修改IP使其连上网络&#xff0c;修改替换软件源 修改网卡配置# 首先使用ip a查看当前网卡名称&#xff1a; 可以看到eth0就是我们的网卡名称&#xff0c;这个要…

linux Ubuntu网卡配置,Windows 7下用VirtualBox安装Ubuntu网卡配置

Windows 7下用VirtualBox安装Ubuntu&#xff0c;要求Ubuntu能连上互联网&#xff0c;同时在Ubuntu中配置SSH、FTP、NFS服务&#xff0c;能从Win7进行访问。 此时Linux虚拟机需要两块网卡&#xff0c;一块使用NAT方式(网络地址翻译网络)连接&#xff0c;用于连接互联网&#xff…

Ubuntu 双网卡配置优先级

Ubuntu 双网卡配置优先级 作者&#xff1a;Bright Xu Ubuntu的网卡配置跟CentOS不太一样。 更多请参考&#xff1a;CentOS 双网卡配置优先级 根据业务需要&#xff0c;有时候服务器需要两张网卡&#xff0c;一张用于访问外网&#xff0c;另一种用于连接内网。 如果在安装系统是…

ubuntu配置网卡

第一步&#xff1a;查看网卡信息 输入ifconfig命令查看网卡信息&#xff0c;下图红圈处就是网卡名称。 第二步&#xff1a;配置网卡文件 注意&#xff1a;不同的linux系统&#xff0c;网卡配置文件是不同的&#xff0c;这里ubuntu的网卡配置文件是/etc/network/interfaces。 输…

Ubuntu18.04  网卡配置

Ubuntu18.04 网卡配置 Ubuntu18.04网卡配置&#xff0c;不同于其他Linux网卡配置&#xff0c;Ubuntu18.04采用的是 Netplan ,想要了解具体可查看官网。 1、设置网络为&#xff1a;桥接网卡 2、在宿主电脑上使用管理员输入CMD 命令 ipconfig /all 查看子网掩码&#xff…

ubuntu16.04配置网卡

第一步&#xff1a;查看网卡信息 输入ifconfig命令查看网卡信息&#xff0c;下图红圈处就是网卡名称。 第二步&#xff1a;配置网卡文件 注意&#xff1a;不同的linux系统&#xff0c;网卡配置文件是不同的&#xff0c;这里ubuntu的网卡配置文件是/etc/network/interfaces。 …

Ubuntu配置网卡信息(ip、网关、子网掩码、dns)

目录 一、前言二、配置网卡信息三、注意事项 一、前言 本文介绍了Ubuntu系统下配置网卡的信息&#xff0c;包含网卡的ip地址、网关、子网掩码和dns。   网卡的ip地址可以设置成动态&#xff08;DHCP&#xff09;或静态的&#xff0c;网关和掩码根据实际需求选择是否设置。dns…

idea如何用git更新和提交代码

一、git更新操作 第一步&#xff1a; 在提交项目之前必须先对项目进行更新&#xff0c;此项特别重要&#xff0c;如果不进行更新&#xff0c;别人有项目提交到服务器上&#xff0c;那么你的项目将会提交不上去&#xff0c;使用git解决冲突会比较麻烦&#xff0c;即使你解决了冲…

gitee更新代码库

步骤&#xff1a; 克隆仓库(有则省略此步) git clone https://gitee.com/master_wei/trainticketsale_fork.git 一、同步远程仓库信息 git pull origin master …

Git更新代码到本地

一.首先查看git 远程仓库的地址 git remote -v 二,更新代码本地到仓库两种方式&#xff1a; /方法一 $ git fetch origin master //从远程的origin仓库的master分支下载代码到本地的origin master$ git log -p master.. origin/master//比较本地的仓库和远程参考的区别$ git …

git强制更新本地代码,git pull无法更新本地代码,git pull显示更新成功但是本地并没有拉去到最新的代码

git pull之后看见没有&#xff0c;看见了吧&#xff0c;Already up to date. 操作了N遍&#xff0c;但是当对比本地和远程库之后&#xff0c;发现自己本地的代码根本就不是最新的&#xff0c; 怎么解决&#xff1f; 强制更新&#xff0c;将本地代码更新为仓库里最新的代码&a…

Git如何更新远程仓库代码到本地

1.首先可以暂存本地的修改&#xff0c;如果本地没有修改&#xff0c;则会显示“没有要保存的本地修改” git stash 2.执行命令会找到项目重新拉取代码进行更新&#xff0c;可以看到该程序有更新。 git fetch --all3.执行命令进行更新文件的下载覆盖&#xff0c;下面会列出哪些…

Gitee上传、更新仓库代码

Gitee上传、更新仓库代码 Gitee上传1、进入到Gitee中&#xff0c;并创建该项目的远程仓库。2、进入本地你想要上传的文件目录下&#xff0c;右键单击空白处&#xff0c;点击**Git Bash Here**。3、配置你的用户名和邮箱4、初始化本地仓库5、添加项目目录下所有文件至本地仓库6、…

git命令更新代码

拉取代码&#xff1a; git pull 推本地代码上去&#xff1a; 1、git status 2、git add [filename1] [filename2] 3、git commit [filename1] -m “提交信息说明” 4、git push 回退 1、退回至缓存区的coding回退 git reset [filename1] 2、会退到制定版本 git rese…

如何使用git更新别人的代码

文章目录 如何使用git更新别人的代码问题说明省流问题示例操作步骤总结总结 如何使用git更新别人的代码 问题说明 当自己git clone别人的代码之后&#xff0c;代码一直停留到本地电脑上&#xff0c;而你就跑了一次程序就搁置了。 后来有一天你想再次运行该代码&#xff0c;但…

更新github上的代码

昨晚熬夜写完了“git上传本地项目代码到github”的任务&#xff0c;早上来公司先把早上的工作完成后&#xff0c;抽点时间继续来继续更新文章 更新github上的代码 一、克隆代码 1、把大神的代码clone到本地&#xff0c;或者clone自己github上的代码使用命令 git clone http…