1.引入css样式
<link rel="stylesheet" type="text/css" href="../css/aui.css"/>
<link rel="stylesheet" type="text/css" href="../css/aui-list-swipe.css"/>
2.设置列表样式 和显示
<section class="aui-content" id="banner">
<ul class="aui-list-view">
<li class="aui-user-view-cell aui-img" tapmode onclick="showMsg(this);">
<div class="aui-swipe-handle">
<img class="aui-img-object aui-pull-left" src="../image/liulangnan.png"/>
<div class="aui-img-body">
<span>流浪男 <em>11M</em> </span>
<p class="aui-ellipsis-1">山东 潍坊</p>
</div>
</div>
<div class="aui-swipe-right-btn aui-bg-warning" tapmode onclick="rightClick(this)"><i class="aui-iconfont aui-icon-favor"></i></div>
<div class="aui-swipe-right-btn aui-bg-danger"><i class="aui-iconfont aui-icon-comment"></i></div>
<div class="aui-swipe-right-btn aui-bg-success"><i class="aui-iconfont aui-icon-delete"></i></div>
</li>
<li class="aui-user-view-cell aui-img" tapmode onclick="showMsg(this)">
<div class="aui-swipe-handle">
<img class="aui-pull-left aui-img-object" src='../image/demo4.png'/>
<div class="aui-img-body">
<span class="aui-text-danger">淡淡的忧伤<em>11.1KM</em></span>
<p class="aui-ellipsis-1">山东 潍坊</p>
</div>
</div>
<div class="aui-swipe-right-btn aui-bg-warning"><i class="aui-iconfont aui-icon-favor"></i></div>
<div class="aui-swipe-right-btn aui-bg-danger">删除</i></div>
</li>
</ul>
</section>
3.设置js事件
首页引入:<script type="text/javascript" src="../script/aui-list-swipe.js"></script>
var swipe = new ListSwipe();
function showMsg(el){
console.log('cell 点击事件' + el.classList.contains("aui-swipe-selected"));
if(!el.classList.contains("aui-swipe-selected")){
api.alert({
title: '提示消息',
msg: '正常点击操作'
});
}
}