96 行
3.8 KiB
HTML
可执行文件
96 行
3.8 KiB
HTML
可执行文件
<!doctype html>
|
|
<html lang="en">
|
|
<!--[1.8.20]-->
|
|
<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__/Retail/css/myscroll.css"/>
|
|
<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;" id="app" v-cloak>
|
|
<el-form label-width="100px" id="form">
|
|
<el-form-item label="展示标题" required>
|
|
<el-input type="text" name="title" v-model="title" auto-complete="off" placeholder="请输入展示标题" size="small"
|
|
style="width:240px;"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="展示图" required>
|
|
<choose-one-file :file-url.sync="imgurl" :file-id.sync="imgurl_id"></choose-one-file>
|
|
</el-form-item>
|
|
</el-form>
|
|
<div class="center" style="margin-top: 50px">
|
|
<el-button type="primary" size="medium" @click="save">保存</el-button>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
<script src="__PUBLIC__/jquery/js/jquery-3.2.1.min.js"></script>
|
|
<script type="text/javascript">
|
|
var app = new Vue({
|
|
el: '#app',
|
|
data: function () {
|
|
return {
|
|
showSelectImage: false,
|
|
actFileName: '',
|
|
title: '',
|
|
imgurl: '',
|
|
imgurl_id: '',
|
|
}
|
|
},
|
|
methods: {
|
|
save() {
|
|
if (!this.imgurl && !this.imgurl_id) {
|
|
return this.$message.warning('请完善图片设置');
|
|
}
|
|
if (!this.title) {
|
|
return this.$message.warning('请输入标题');
|
|
}
|
|
this.$loading({
|
|
lock: true,
|
|
text: '保存中,请等待',
|
|
spinner: 'el-icon-loading',
|
|
background: 'rgba(255, 255, 255, 0.7)'
|
|
});
|
|
$.ajax({
|
|
url: "{:U('gift_addpro')}",
|
|
type: "POST",
|
|
data: {
|
|
title: this.title,
|
|
imgurl: this.imgurl,
|
|
imgurl_id: this.imgurl_id,
|
|
},
|
|
success: (res) => {
|
|
this.$loading().close();
|
|
if (res.status == 1) {
|
|
this.$message({
|
|
type: 'success',
|
|
message: res.msg,
|
|
duration: 1000,
|
|
onClose: function () {
|
|
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
|
parent.layer.close(index); //再执行关闭
|
|
}
|
|
});
|
|
} else {
|
|
this.$message.error(res.msg);
|
|
}
|
|
},
|
|
error: () => {
|
|
this.$loading().close();
|
|
}
|
|
})
|
|
}
|
|
},
|
|
created() {
|
|
|
|
}
|
|
});
|
|
</script>
|
|
</html> |