this.swipeaction.closeOther is not a function
解决方法,在<uni-swipe-action-item>外层套一个<uni-swipe-action>,代码如下:
<uni-swipe-action>
<uni-swipe-action-item :right-options="options" :left-options="options" @click="onClick($event,item.id)"> <!-- @change="change" -->
<view class="tab">
<view>
<image v-if="item.bank_name =='支付宝'" src="/static/img/alipay.png" class="ico"></image>
<image v-else-if="item.bank_name =='微信'" src="/static/img/wxpay.png" class="ico"></image>
<image v-else src="/static/img/bankpay.png" class="ico"></image>
{{item.bank_name}}
</view>
<view class="date">{{item.bank_number}}</view>
<text class="val">{{item.name}}</text>
<image src="/static/img/jt_r.png" class="jtr"></image>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
onClick(e,id){
switch(e.content.text){
case '删除':
uni.request({
url: this.api_url+'/api/user/bankdel',
header: {
// 'X-Auth-Token': 123456, //授权token
'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8',
'token':this.token,
},
method:'POST',
data: {
id:id,
},
success: (res) => {
uni.showToast({
title: res.data.msg,
duration: 2000
});
if(res.data.code == 1){
// uni.navigateTo({
// url:'/pages/member/banklist',
// })
}
},
fail:(err) => {
uni.showToast({
title: '请求失败!',
duration: 2000
});
}
});
break;
}
},
发表评论 取消回复