博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
微信 小程序组件 焦点切换
阅读量:4678 次
发布时间:2019-06-09

本文共 944 字,大约阅读时间需要 3 分钟。

.monery-detail .active{
">#e5c41d;
color: white;
}
 
<block wx:key="recharge" wx:for="{
{recharge}}" wx:for-index="index">
<!-- 绑定焦点函数rechargeActive -->
<view class='monery-text {
{item.active}}' data-id="{
{item.id}}" bindtap='rechargeActive'>
<text>充{
{item.fulfill}}</text>
<text class='monery-text-min'>送{
{item.present}}</text>
</view>
</block>
 
 
data: {
recharge: [
{ id: 1, fulfill: 1000, present: 500, active:"active"},
{ id: 2, fulfill: 1500, present: 800, active:''},
{ id: 3, fulfill: 2000, present: 1000, active:''},
{ id: 4, fulfill: 3000, present: 1500, active:''},
{ id: 5, fulfill: 3000, present: 1500, active:''}
]
},
 
// 焦点函数
rechargeActive:function(e){
var activeId = e.currentTarget.dataset.id;
var recharge = this.data.recharge;
for (var i = 0; i < recharge.length;i++){
recharge[i].active='';
}
recharge[activeId-1].active = 'active';
this.setData({
recharge: recharge,
});
},

转载于:https://www.cnblogs.com/dianzan/p/7574969.html

你可能感兴趣的文章
Codeforces Round #431 (Div. 2) A 水 B 暴力模拟 C 思维
查看>>
php-fpm 进程管理
查看>>
[linux-内核][转]内核日志及printk结构浅析
查看>>
SWMM[Storm Water Management Model]模型代码编译调试环境设置
查看>>
s11 day Linux 和nginx 部署
查看>>
程序猿的爱情-2012-01-22
查看>>
CentOS7.2 安装iptables
查看>>
网络是怎样连接的—1.浏览器生成消息
查看>>
codevs1430 素数判定
查看>>
2017年6月2号课堂笔记
查看>>
github
查看>>
poj1015【DP.......无奈了】
查看>>
C#性能优化的一些技巧
查看>>
PAT 甲级 1024 Palindromic Number
查看>>
信息安全经典书籍
查看>>
ios坐标位置转换
查看>>
Java多线程—JUC原子类
查看>>
C#中常用到的时间函数(天数差、星期几等)
查看>>
如何理解一台服务器可以绑定多个ip,一个ip可以绑定多个域名
查看>>
改进delphi中的RoundTo函数
查看>>