85 行
3.1 KiB
HTML
可执行文件
85 行
3.1 KiB
HTML
可执行文件
<!doctype html>
|
|
<html lang="en">
|
|
<!--[1.8.45]-->
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport"
|
|
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
<link rel="stylesheet" type="text/css" href="__PUBLIC__/vue/element-ui.css">
|
|
<link rel="stylesheet" href="__PUBLIC__/css/system-gallery.css?v=1.0.3">
|
|
<script src="__PUBLIC__/jquery/js/jquery-3.2.1.min.js"></script>
|
|
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/vue/js/vue2.5.16.js"></script>
|
|
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/vue/element-ui.js"></script>
|
|
<script charset="utf-8" src="__PUBLIC__/js/system-gallery.js?v=1.0.4"></script>
|
|
<title>添加封面</title>
|
|
</head>
|
|
<body>
|
|
<div style="padding: 30px;text-align: center" id="app" v-cloak>
|
|
|
|
<choose-one-file :file-url.sync="img_url" :file-id.sync="img_url_id"></choose-one-file>
|
|
|
|
<div class="center" style="margin-top: 50px">
|
|
<el-button type="primary" size="medium" @click="save">保存</el-button>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
<script type="text/javascript">
|
|
var app = new Vue({
|
|
el: '#app',
|
|
data() {
|
|
return {
|
|
img_url: '',
|
|
img_url_id: '',
|
|
gift_cardid: "{$giftid}"
|
|
}
|
|
},
|
|
methods: {
|
|
save() {
|
|
if (!this.img_url && !this.img_url_id) {
|
|
return this.$message.warning('请完善图片设置');
|
|
}
|
|
this.$loading({
|
|
lock: true,
|
|
text: '保存中,请等待',
|
|
spinner: 'el-icon-loading',
|
|
background: 'rgba(255, 255, 255, 0.7)'
|
|
});
|
|
$.ajax({
|
|
url: "{:U('gift_add_img')}",
|
|
type: "POST",
|
|
data: {
|
|
img_url: this.img_url,
|
|
img_url_id: this.img_url_id,
|
|
gift_cardid: this.gift_cardid,
|
|
},
|
|
success: (res) => {
|
|
this.$loading().close();
|
|
if (res.status == 1) {
|
|
this.$message({
|
|
type: 'success',
|
|
message: res.msg,
|
|
duration: 1000,
|
|
onClose: () => {
|
|
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
|
parent.layer.close(index); //再执行关闭
|
|
}
|
|
});
|
|
} else {
|
|
this.$message.error(res.msg);
|
|
}
|
|
},
|
|
error: () => {
|
|
this.$message.error('出错了');
|
|
this.$loading().close();
|
|
}
|
|
})
|
|
}
|
|
},
|
|
mounted() {
|
|
},
|
|
created() {
|
|
}
|
|
});
|
|
</script>
|
|
</html> |