一,点击查看大图
html
<view class="iitem" wx:for="{{imgLists}}" wx:for-index="idx">
<image src="{{item}}" class="img" catchtap="previewImg" data-index="{{idx}}"></image>
<view>
js
previewImg: function (e) {
wx.previewImage({
current: this.data.imgLists[e.target.dataset.index],//点击的第几张
urls: this.data.imgLists//图片地址集合
})
},
二,返回上一页刷新
//提交成功之后
updateResult: function () {
let that = this;
wx.showLoading({
title: '数据提交中',
});
let nowData = that.data;
wx.request({
url: '/student/delete?teacher',
data: {
nowData:nowData
},
method: 'DELETE',
success: function(res) {
//成功执行事件
wx.hideLoading();
wx.showToast({
title: data.data.message,
icon: 'none'
});
if (data.data.isSuccess) {
//刷新结果页面
var pages = getCurrentPages(); // 当前页面
var beforePage = pages[pages.length - 2]; // 前一个页面
beforePage.resetFunc();
wx.navigateBack({
delta: 1
});
}
}
}
})
}