142 lines
4.6 KiB
HTML
142 lines
4.6 KiB
HTML
{extend name="app/shop/view/base.html"/}
|
|
{block name="resources"}
|
|
<style>
|
|
.tips{
|
|
font-size: 13px;
|
|
color: #cccccc;
|
|
}
|
|
.hide{
|
|
display: none;
|
|
}
|
|
.goods-list{
|
|
width: calc(100% - 230px);
|
|
display: inline-flex;
|
|
flex-direction: row;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
justify-content: flex-start;
|
|
margin-left: 200px;
|
|
margin-top: 10px;
|
|
}
|
|
.goods-list .goods-item{
|
|
position: relative;
|
|
margin-top: 10px;
|
|
margin-right: 10px;
|
|
display: inline-flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
justify-content: center;
|
|
border: 1px solid #cccccc;
|
|
padding: 10px;
|
|
}
|
|
.goods-list .goods-item .image{
|
|
width: 80px;
|
|
height: 80px;
|
|
margin-right: 10px;
|
|
}
|
|
.goods-list .goods-item .image .image-img{
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
.goods-list .goods-item .info{
|
|
width: 150px;
|
|
}
|
|
.goods-list .goods-item .info .name{
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
display: -webkit-box;
|
|
-webkit-box-orient: vertical; /*设置对齐模式*/
|
|
-webkit-line-clamp: 2; /*设置多行的行数*/
|
|
}
|
|
.goods-list .goods-item .del-button{
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
font-size: 25px;
|
|
color: #e30000;
|
|
cursor: pointer;
|
|
}
|
|
</style>
|
|
{/block}
|
|
|
|
{block name="body"}
|
|
<div class="layui-form form-wrap" lay-filter="formInfo">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label img-upload-lable short-label"><span class="required">*</span>消息标题:</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" name="title" autocomplete="off" class="layui-input" />
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label img-upload-lable short-label">消息类型:</label>
|
|
<div class="layui-input-inline">
|
|
<select name="type">
|
|
<option value="2">系统消息</option>
|
|
<option value="3">通知消息</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label img-upload-lable short-label"><span class="required">*</span>消息内容:</label>
|
|
<div class="layui-input-inline">
|
|
<textarea name="message_content" class="layui-textarea len-long" rows="15"></textarea>
|
|
</div>
|
|
</div>
|
|
<!--提交按钮-->
|
|
<div class="form-row">
|
|
<button class="layui-btn" lay-submit lay-filter="save">提交</button>
|
|
<button class="layui-btn layui-btn-primary" onclick="closeIframe()">关闭</button>
|
|
</div>
|
|
</div>
|
|
{/block}
|
|
{block name="script"}
|
|
<script>
|
|
var _thisIndex,form,repeat_flag = false,goods_info = {};
|
|
$(function () {
|
|
// 基本参数
|
|
_thisIndex = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
|
// 表单内容
|
|
layui.use(['form'], function() {
|
|
form = layui.form;
|
|
form.render();
|
|
// 表单提交
|
|
form.on('submit(save)', function(data){
|
|
var field = data.field;
|
|
// 判断信息是否完整
|
|
if(!field['message_content']){
|
|
layer.msg('请输入消息内容!');
|
|
return false;
|
|
}
|
|
if(!field['title']){
|
|
layer.msg('请输入消息标题!');
|
|
return false;
|
|
}
|
|
// 数据提交
|
|
layer.confirm('确认发布当前消息给所有用户?', {icon: 3, title:'提示'}, function(index){
|
|
layer.close(index);
|
|
$.ajax({
|
|
type: 'POST',
|
|
dataType: 'JSON',
|
|
url: ns.url("message://shop/message/sendMessage"),
|
|
data: field,
|
|
async: false,
|
|
success: function(res){
|
|
if (res.code == 0) {
|
|
layer.alert('发布成功', function(index){
|
|
parent.layer.close(_thisIndex);
|
|
});
|
|
}else{
|
|
layer.msg(res.message);
|
|
}
|
|
}
|
|
})
|
|
});
|
|
});
|
|
});
|
|
});
|
|
// 点击关闭弹框
|
|
function closeIframe() {
|
|
parent.layer.close(_thisIndex); //再执行关闭
|
|
}
|
|
</script>
|
|
{/block} |