父页面
var edit = layer.open({
type: 2,
fixed: false, //不固定
content: './edit.html?id=' + id,
title: '编辑连续签到设置',
end: function() {
tableIns.reload({
page: {
curr: currpage
}
})
}
});
layer.full(edit);
子页面
saveForm() {//提交数据
var _this = this;
$.post(utils.baseUrl + '/shaker/signConfig/update',{
id:utils.getQueryString('id'),
prizeType:_this.prizeType,
prizeName:_this.prizeName,
prizeImage:_this.poster,
prizeAmount:_this.prizeAmount,
}, function (res) {
if(res.code == 200) {
//在当前iframe => 关闭当前iframe
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
parent.layer.close(index); //再执行关闭
}else{
layer.msg(res.message);
}
});
}