wxml代码:
<view class="delete" data-index="{
{index}}" bindtap="deleteItem">删除</view>
wxss代码:
.delete{
width: 70px;
height: 45rpx;
font-size: 12px;
border-width: 1rpx 1rpx 1rpx 1rpx;
border-color: #797979;
border-style: solid;
background-color: #ffffff;
color: #797979;
border-radius: 98rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
js代码:
deleteItem: function (e) {
var that = this;
wx.showModal({
title: '提示',
content: '确定要删除吗?',
success: function (sm) {
if (sm.confirm) {
// 用户点击了确定 可以调用删除方法了
console.log('用户点击确定')
let id = that.data.bookReviewList[e.currentTarget.dataset.index].book_id
console.log(id)
that.da