微信小程序实现分类列表

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://xiahunao.cn/news/143554.html

如若内容造成侵权/违法违规/事实不符,请联系瞎胡闹网进行投诉反馈,一经查实,立即删除!

相关文章

小程序 | 微信小程序实现商品分类列表

小程序 | 微信小程序实现商品分类列表 一、效果展示 二、代码实现 <!-- wxml --> <view class"container"> <!-- 商品列表 --><view class"cate"><!-- 左侧导航 --><scroll-view scroll-y class"nav-left"&g…

微信小程序之多列表的显示和隐藏功能【附源码】

效果图&#xff1a; 实现思路&#xff1a; 实现单个列表的显示和隐藏应该使用唯一元素让程序知道你应该显示和隐藏哪个列表项&#xff0c;可以用数据的id&#xff1b;css中定义一个hidden{display&#xff1a;none}控制显示和隐藏&#xff0c;然后通过三元运算符来判断&#x…

微信小程序显示列表数据

目录 微信小程序创建项目配置底部导航栏 微信小程序滚动播放内容 微信小程序功能中心模块开发 微信小程序个人中心页面开发 微信小程序获取电话号码 微信小程序显示列表数据 微信小程序显示分页列表 微信小程序添加插屏广告 微信小程序添加激励式广告 最终效果可扫码查看 遇…

微信小程序编辑与显示列表信息

在上一篇中在后台利用SpringBoot实现了对区域列表信息的增删改查操作&#xff0c;这篇将利用微信小程序完成前端与用户的交互操作。 新建一个小程序后默认含有index页面和logs页面&#xff0c;index页面会获取用户名和头像并显示&#xff0c; 通过点击头像会触发bindViewTap方…

微信小程序列表筛选组件

x效果图&#xff1a; wxml: <view class"tabTit box"><view class"flex1{{!tab[index]? active:}}" wx:for"{{tabTxt}}" wx:key"type" data-index"{{index}}" bindtap"filterTab"><text>{{it…

微信小程序点击数据列表,进入列表详情页面的思路

1.在index.wxml 通过 bindtap去绑定一个事件。 对于详情页的传输数据&#xff0c;点击事件可以通过 data- 去实现&#xff0c;后面相当于是键值对&#xff0c;data-id"{{item.id}}"&#xff0c;意思是把列表的id传过去。 <view class"goods"><vi…

微信小程序删除list指定列表项

一、删除效果展示&#xff1a; // 重要代码片段async deleteListItem(e) {const sureResult await wx.showModal({title: "提示",content: "确定要删除这项吗",});if (sureResult.confirm) {const { index } e.currentTarget.dataset;setTimeout(()>{…

小程序---小程序列表项拖拽排序

一、拖拽效果图展示 首先&#xff0c;上个gif图看看效果 吐血测试了一天&#xff0c;目前还未发现bug。ps(拖拽效果仅在前端实现&#xff0c;未和后端交互) 文章代码参考小程序实现列表拖拽排序 &#xff0c;参考文章还是存在一些bug和不足&#xff0c;比如&#xff0c;样式代…

微信小程序列表页

我们在做Android开发时,几乎每个app都有几个列表,在Android中列表一般是用listview&#xff0c;后来就使用recyclerview做了,不管是小程序还是Android或者ios&#xff0c;列表都是常见的一种数据展示方式,那么在小程序中怎么实现呢&#xff1f;先使用最笨的方法做, 如图&#…

微信小程序信息展示列表

微信小程序信息展示列表 效果展示: 代码展示: wxml <view class"head"><view class"head_item">分类</view><view class"ring"></view><view class"head_item">价格</view> </view>…

微信小程序列表开发-个人中心界面(一)

先放个效果图让你们看一下是不是你们需要的&#xff0c;到时候会写几篇博客把里面的组件也讲一下 .wxml .wxss .js .json 我里面的引用的照片都放在image文件里的&#xff0c;image文件是放在pages文件下面的&#xff0c;因为放的位置不同&#xff0c;图片引用的路径…

JDK8-JDK17中的新特性(var类型推断、模式匹配、Record、密封类)

文章目录 1. 新语法结构1.1 Java的REPL工具&#xff1a; jShell命令1.2 异常处理之try-catch资源关闭1.3 局部变量类型推断1.4 instanceof的模式匹配1.5 switch表达式1.6 文本块1.7 Record1.8 密封类 2. API的变化2.1 Optional类2.2 String存储结构和API变更2.3 JDK17&#xff…

linux下安装使用dig命令

有时候用的精简版linux系统会发现没有dig命令,这时候就需要安装一下。 centos系 yum install bind-utils dig命令大多时候可以取代nslookup 简明使用,只会输出A记录(写脚本的时候容易获取ip地址) dig www.baidu.com +short只输出mx记录,简明使用 dig mx www.baidu.com…

dig命令后+trace的含义

dig trace命令 dig ip 域名 类型 trace工作过程 以 dig pbc.gov.cn trace 为例。 用户看到的结果 wireshark抓包看到的结果&#xff08;只显示了查询部分&#xff0c;响应就是查询目的对源地址的响应&#xff09; 步骤源目的查询1本机ip中指定的ip.的NS2本机本地DNS.的NS…

linux dig命令使用详解

linux dig命令使用详解 Linux下解析域名除了使用nslookup之外&#xff0c;开可以使用dig命令来解析域名&#xff0c;dig命令可以得到更多的域名信息。dig 命令主要用来从 DNS 域名服务器查询主机地址信息。 dig的全称是 (domain information groper)。它是一个用来灵活探测DN…

dig命令笔记

dig 命令全称域信息搜索器&#xff0c;是一个用于查询 DNS 域名服务器信息的命令行工具。因为dig命令灵活&#xff0c;容易使用&#xff0c;多数DNS管理员使用dig命令来诊断 DNS 问题。 dig 常用命令格式 dig [server] [-p port] [-t type] [-4] [-6] [trace] name 指定 DNS …

linux中dig 命令解释

dig&#xff08;域信息搜索器&#xff09;命令是个用于询问 DNS 域名服务器的灵活的工具。他执行 DNS 搜索&#xff0c;显示从受请求的域名服务器返回的答复。多数 DNS 管理员利用 dig 作为 DNS 问题的故障诊断&#xff0c;因为他灵活性好、易用、输出清楚 1、A记录&#xff1…

从dig命令理解DNS

DNS&#xff08;Domain Name System&#xff0c;域名系统&#xff09;&#xff0c;是一种用于将域名解析为IP的服务器系统&#xff0c;当你上网时输入一个网址&#xff0c;它之所以能够找到该网址指向的服务器地址&#xff0c;都是靠域名系统来进行解析的。 先来讲讲域名。以华…

dig命令(dig命令怎么用)

林肯公园digdeeper是哪首歌 出自专辑《Minutes to Midnight》 nslookup、dig和host这几个命令有什么作用&#xff1f; nslookup、dig和host 这几个命令在UNIX和linux系统中使用,都可以进行域名的解析?nslookup使用交互方式查询域名与IP地址的映射关系?dig的功能是发送域名查…

Windows10 下安装 dig 命令的步骤(一)

前言&#xff1a; 今天在电脑上解析域名&#xff0c;但是发现dig命令报以下错误&#xff1a; Dig 工具全称为域名信息搜索器&#xff08;Domain InformationGroper&#xff09;&#xff0c;能够显示详细的DNS查询过程&#xff0c;是一个非常强大的DNS故障诊断工具。一般Linux…