<view class='back'></view>
<view class="container">
<!-- 睡眠记录 -->
<view class='sp-list'>
<view class='sp-item acl255 flexba f30'>
<view class='item-lf'>
<text>药品名称</text>
</view>
<view class='item-rt flexca'>
<text>佳乐定</text>
<image mode='widthFix' class='img-w ml20' src='../../../../imgs/index/right.png'></image>
</view>
</view>
<view class='sp-item acl255 flexba f30'>
<view class='item-lf flexa'>
<view class="so-3 flexca {{selectIndex[0].sureid?'active1':''}}" data-selectIndex='0' bindtap='selectFn'>
<view class="so-2 {{selectIndex[0].sureid?'active2':''}}"></view>
</view>
<text>早上用量</text>
</view>
<view class='item-rt flexca'>
<text>佳乐定</text>
<image mode='widthFix' class='img-w ml20' src='../../../../imgs/index/right.png'></image>
</view>
</view>
<view class='sp-item acl255 flexba f30'>
<view class='item-lf flexa'>
<view class="so-3 flexca {{selectIndex[1].sureid?'active1':''}}" data-selectIndex='1' bindtap='selectFn'>
<view class="so-2 {{selectIndex[1].sureid?'active2':''}}"></view>
</view>
<text>中午用量</text>
</view>
<view class='item-rt flexca'>
<text>佳乐定</text>
<image mode='widthFix' class='img-w ml20' src='../../../../imgs/index/right.png'></image>
</view>
</view>
<view class='sp-item acl255 flexba f30'>
<view class='item-lf flexa'>
<view class="so-3 flexca {{selectIndex[2].sureid?'active1':''}}" data-selectIndex='2' bindtap='selectFn'>
<view class="so-2 {{selectIndex[2].sureid?'active2':''}}"></view>
</view>
<text>晚上用量</text>
</view>
<view class='item-rt flexca'>
<text>佳乐定</text>
<image mode='widthFix' class='img-w ml20' src='../../../../imgs/index/right.png'></image>
</view>
</view>
<view class='sp-item acl255 flexba f30'>
<view class='item-lf flexa'>
<view class="so-3 flexca {{selectIndex[3].sureid?'active1':''}}" data-selectIndex='3' bindtap='selectFn'>
<view class="so-2 {{selectIndex[3].sureid?'active2':''}}"></view>
</view>
<text>睡前用量</text>
</view>
<view class='item-rt flexca'>
<text>佳乐定</text>
<image mode='widthFix' class='img-w ml20' src='../../../../imgs/index/right.png'></image>
</view>
</view>
</view>
<!-- 确定按钮 -->
<view class='btn flexca abl'>
<text class='f34 acl255'>确定</text>
</view>
</view>
 
 
 
css
.back{
width: 100%;
height: 100%;
position: fixed;
left: 0;
bottom: 0;
z-index: -1;
background-image:linear-gradient( 0deg, rgb(185,199,221) 0%, rgb(110,123,144) 61%, rgb(35,47,67) 100%);
}
/* 睡眠记录 */
.sp-item{
width: 100%;
height: 88rpx;
padding: 0 24rpx;
">rgba(255,255,255,0.1);
margin-top: 20rpx;
}
.sp-item image{
width: 14rpx;
height: 224rpx;
}
.btn{
width: 480rpx;
height: 80rpx;
border-radius: 41rpx;
margin: 0 auto;
margin-top: 100rpx;
box-shadow: 0 0 5rpx 5rpx rgba(35,47,67,0.3);
}
.userperson{
margin-top: 40rpx;
}
.userperson>view:first-child{
color: #14a1fd;
}
button{
margin-top: 70rpx;
width: 100%;
border-radius: 50rpx;
color: white;
">#14a1fd;
box-shadow: 0 0 4rpx 1rpx rgba(20,161,253,0.7)
}
.select-only{
width: 100%;
display: flex;
justify-content: space-between ;
align-items: center;
margin-top: 30rpx;
}
.so-3{
width: 36rpx;
height: 36rpx;
border-radius: 50%;
border: 1px solid #67C9C5;
margin-right: 20rpx;
}
.so-2{
width: 24rpx;
height: 24rpx;
border-radius: 50%;
">transparent;
}
.active1{
border: 1px solid #67C9C5;
}
.active2{
">#67C9C5;
}
 
 
 
data:
selectIndex: [
{ sureid: false },
{ sureid: false },
{ sureid: false },
{sureid:false},
],
 
// 多选
selectFn: function (e) {
let selectIndex = this.data.selectIndex;
let index = e.currentTarget.dataset.selectindex;
selectIndex[index].sureid = !selectIndex[index].sureid;
// console.log(selectIndex)
this.setData({
selectIndex: selectIndex
})
},
 

微信小程序组件 自定义多选的更多相关文章

  1. 微信小程序 - 组件 | 自定义组件 | 组件事件传递页面

    组件 小程序允许我们使用自定义组件的方式来构建页面 类似Vue的小组件 自定义组件 类似于页面,一个自定义组件由 json, wxml, wxss, js 4个文件组成 1.创建 1.创建compon ...

  2. 微信小程序组件 自定义弹出框

    <!-- 点击立即抢拼弹出框 --> <view class='add-rob' bindtap="setModalStatus" data-status=&qu ...

  3. 微信小程序组件 自定义单选

    <view class='userperson'> <view class='f30 flexca'>请选择您的注册身份</view> <view class ...

  4. 微信小程序 修改(自定义) 单选/复选按钮样式 checkbox/radio样式自定义

    参考文章: 微信小程序 修改(自定义) 单选/复选按钮样式 checkbox/radio样式自定义

  5. 微信小程序中自定义modal

    微信小程序中自定义modal .wxml <modal hidden="{{hidden}}" title="这里是title" confirm-text ...

  6. 微信小程序组件设计规范

    微信小程序组件设计规范 组件化开发的思想贯穿着我开发设计过程的始终.在过去很长一段时间里,我都受益于这种思想. 组件可复用 - 减少了重复代码量 组件做为抽离的功能单元 - 方便维护 组件作为temp ...

  7. 微信小程序组件学习 -- 注册页面

    微信小程序组件使用手册地址: 1. 百度搜索"微信公众平台",扫码登录之后,点击帮助文档里面的普通小程序. 2. 接着选择"开发"-->"组件& ...

  8. 微信小程序之自定义select下拉选项框组件

    知识点:组件,animation,获取当前点击元素的索引与内容 微信小程序中没有select下拉选项框,所以只有自定义.自定义的话,可以选择模板的方式,也可以选择组件的方式来创建. 这次我选择了组件, ...

  9. 微信小程序之自定义组件

    在微信小程序项目中 肯定会存在很多功能和样式上相似的部分 面对这种情况 只是单单的ctrl+c ctrl+v 就显得很low了,而且也不便于后期维护那么这时候 使用微信小程序中的自定义组件功能就很合适 ...

随机推荐

  1. 2-5 re模块练习题

    1 练习: 1.验证手机号是否合法 2.验证邮箱是否合法 3.开发一个简单的python计算器,实现加减乘除及拓号优先级解析 用户输入 1 - 2 * ( (60-30 +(-40/5) * (9-2 ...

  2. SpringCloud-微服务的注册与发现Eureka(二)

    一.SpringCloud简介 Spring Cloud是一系列框架的有序集合.它利用Spring Boot的开发便利性巧妙地简化了分布式系统基础设施的开发,如服务发现注册.配置中心.消息总线.负载均 ...

  3. #6435. 「PKUSC2018」星际穿越

    考场上写出了70分,现在填个坑 比较好写的70分是这样的:(我考场上写的贼复杂) 设\(L(i)=\min_{j=i}^nl(j)\) 那么从i开始向左走第一步能到达的就是\([l(i),i-1]\) ...

  4. STM8S——Analog/digital converter (ADC)

    1.ADC1 and ADC2 are 10-bit successive approximation Anolog to Digital Converters. 所谓successive appro ...

  5. mysql 中sql语句关键字的书写顺序与执行顺序

    书写顺序: select -> from -> where -> group by -> having -> order by 执行顺序: from -> wher ...

  6. JS截图(html2canvas)

    JS截图(html2canvas) • 引入js <script type="text/javascript" src="js/html2canvas.js&quo ...

  7. [Processing]点到线段的最小距离

    PVector p1,p2,n; float d = 0; void setup() { size(600,600); p1 = new PVector(150,30);//线段第一个端点 p2 = ...

  8. 三种UIScrollView嵌套实现方案

    背景 随着产品功能不断的迭代,总会有需求希望在保证不影响其他区域功能的前提下,在某一区域实现根据选择器切换不同的内容显示. 苹果并不推荐嵌套滚动视图,如果直接添加的话,就会出现下图这种情况,手势的冲突 ...

  9. Hyperledger Fabric 1.0 从零开始(一)

    在HyperLedger/Fabric发布0.6的时候,公司就已经安排了一个团队研究这一块,后来也请IBM的专家组过来培训了一批人,不幸的是,这批人后来全走了,然后1.0就发布了.自从2017年7月H ...

  10. ubuntu安装中文输入法必看

    ubuntu安装中文输入法必看以下两篇文章,按照顺序来做: http://www.2cto.com/os/201207/144189.html http://www.cnblogs.com/slide ...