当前位置:网站首页>微信小程序中的列点击隐藏,再点击显示
微信小程序中的列点击隐藏,再点击显示
2022-07-25 09:17:00 【zk_Kang】
先上图,

小程序中的,js中的前台数据进行加载
DATA_TO_ListOneResetUserPwd: function (that, data) {
var rows = data;//data为查询的数据,自己根据自己情况自己生成就行
for (var i = 0; i < rows.length; i++) {
var tempObject = {};
tempObject.menuid = rows[i].MENU_ID;
tempObject.index = i;
tempObject.Arrays = [];
if (rows[i].MENU_ID.toString().length == "2") {
tempObject.image ="../../../../../resources/img/menu/xia.png"
// tempObject.MENU_NAME_tow = rows[i].MENU_NAME;
tempObject.CHCKED = false;//这个是控制,初始化显示
tempObject.Arrays.push(rows[i].MENU_NAME);
}
tempObject.Arrays2 = [];
if (rows[i].MENU_ID.toString().length == "4") {
tempObject.CHCKED = true;//初始化隐藏
if (rows[i].QXBJ!=null){
var qx = rows[i].QXBJ.split('_');
tempObject.EDIT_BJ = parseInt(qx[0]);
tempObject.SH_BJ = parseInt(qx[1]);
tempObject.SELECT_BJ = parseInt(qx[2]);
tempObject.PRINT_BJ = parseInt(qx[3]);
tempObject.QXALL = parseInt(qx[4]);
}else{
tempObject.EDIT_BJ = 0;
tempObject.SH_BJ = 0;
tempObject.SELECT_BJ = 0;
tempObject.PRINT_BJ = 0;
tempObject.QXALL = 0;
}
tempObject.Arrays2.push(rows[i].MENU_NAME);
}
that.data.listOne.push(tempObject);
}
that.setData({
listOne: that.data.listOne,
});
},js中进行点击方法
clickLine:function(e){//点击事件,进行显隐控制
var that= this;
var index = e.currentTarget.dataset.index;
var menuid = e.currentTarget.dataset.menuid;
var Alllist = that.data.listOne;
for (var i = 0; i < Alllist.length; i++) {
if (Alllist[i].menuid.toString().length==4 && Alllist[i].menuid.toString().substring(0, 2) == menuid) {
if (Alllist[i].CHCKED == true) {
Alllist[i].CHCKED = false;
} else {
Alllist[i].CHCKED = true;
}
}
}
that.setData({
listOne: Alllist,
// ALLList: that.data.ALLList,
// _Total: data.total
});
wxhl中:
<view class='hz-main_tow' wx:for="{
{listOne}}" wx:for-item="row" wx:key="Arrays">
<view data-menuid="{
{row.menuid}}" class='hz-list' data-index="{
{row.index}}" hidden="{
{row.CHCKED}}" bindtap='clickLine' wx:for="{
{row.Arrays}}" wx:for-item="item" wx:key="title" >
<text class='hz-content'>{
{item}}</text>
<image src="{
{row.image}}" style='max-height:15px;max-width:15px;padding-left: 10px;'></image>
</view>
<view data-menuid="{
{row.menuid}}" data-index="{
{row.index}}" hidden="{
{row.CHCKED}}" class='hz-list' wx:for="{
{row.Arrays2}}" wx:for-item="item" wx:key="title" >
<checkbox-group data-index="{
{row.index}}" name="CHCKED_{
{row.menuid}}" data-menuid="{
{row.menuid}}" bindchange="changeCHCMenuid" >
<label >
<checkbox color="green" value="{
{row.menuid}}" checked="{
{row.QXALL}}"><text class='selectCon-list-tit_tow'>{
{item}}</text></checkbox>
</label>
</checkbox-group>
<checkbox-group bindchange="changeCHCMenuid_Two" data-index="{
{row.index}}" data-menuid="{
{row.menuid}}">
<label class='selectCon-tit-label'>
<checkbox color="green" value="1" name="cboQxEdit" checked="{
{row.EDIT_BJ}}">编辑</checkbox>
</label>
<label wx:key="id" class='selectCon-tit-label'>
<checkbox color="green" value="2" name="cboQxSH" checked="{
{row.SH_BJ}}">审核</checkbox>
</label>
<label wx:key="id" class='selectCon-tit-label'>
<checkbox color="green" value="3" name="cboQxSearch" checked="{
{row.SELECT_BJ}}">查询</checkbox>
</label>
<label wx:key="id" class='selectCon-tit-label'>
<checkbox color="green" value="4" name="cboQxPrint" checked="{
{row.PRINT_BJ}}">打印</checkbox>
</label>
</checkbox-group>
</view>
</view>
边栏推荐
- office文件对应的Content-Type类型
- [deep learning] overview | the latest progress of deep learning
- 分享一个避免递归的部门设计方法
- activemq--可持久化机制之JDBC
- Activemq-- delayed delivery and scheduled delivery
- [SCADA case] myscada helps VIB company realize the modernization and upgrading of production line
- 超赞的yolo目标检测训练所用垃圾分类数据集共享——标注好的约3000张
- Canvas dynamic picture avatar shaking JS special effect
- What are the commands used by pl/sql tools to export SQL files?
- 学习周刊-总第 63 期-一款开源的本地代码片段管理工具
猜你喜欢

Feiling ok1028a core board adapts to rtl8192cu WiFi module

yarn : 无法加载文件 yarn.ps1,因为在此系统上禁止运行脚本。

ActiveMQ -- dead letter queue

『每日一问』ReentrantLock加锁解锁

Arrange the array into the smallest number

Cool canvas animation shock wave JS special effect

分享一个避免递归的部门设计方法

PL/SQL工具导出sql文件所使用的命令是什么?

Guangzhou has carried out in-depth "100 day action" to check the safety of self built commercial houses, and more than 2 million houses have been checked in two months

Leetcode组合总和+剪枝
随机推荐
leetcode-238.除自身以外数组的乘积
『每日一问』简单聊聊JMM/说说对JMM的了解
The hole of scroll view in uniapp
Kubedm introduction
Ten thousand words long, one word thoroughly! Finally, someone has made business intelligence (BI) clear
Disable module (attribute node) in LabVIEW
[NPM] the "NPM" item cannot be recognized as the name of cmdlets, functions, script files or runnable programs. Please check the spelling of the name. If the path is included, make sure the path is co
[C language] dynamic memory management, flexible array
The operation cannot be completed because a folder or file in it is already open in another program
Nacos启动报错Unable to start web server
How to avoid duplicate data when the database is high and distributed
Troubleshooting error: NPM install emojis list failed
API parsing of JDBC
JDBC的API解析
【Nacos】NacosClient在服务注册时做了什么
LabVIEW experiment - temperature detection system (experimental learning version)
整理 华为AP-3010DN_V2配置创建wifi
What is steel grating?
ActiveMQ -- JDBC Journal of persistent mechanism
Write two channel (stereo) immediately Wav file