初始上传
This commit is contained in:
80
addon/wechat/shop/view/material/add_text.html
Executable file
80
addon/wechat/shop/view/material/add_text.html
Executable file
@@ -0,0 +1,80 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_graphic_message.css">
|
||||
<style type="text/css">
|
||||
.layui-tab-brief{width: 800px;height: 646px}
|
||||
.input-text-hint{float:right}
|
||||
</style>
|
||||
|
||||
<div class="layui-collapse tips-wrap">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示<i class="layui-icon layui-colla-icon"></i></h2>
|
||||
<ul class="layui-colla-content layui-show">
|
||||
<li>由于微信公众平台的接口规范,仅提供向微信认证服务号商家。如你的公众号同时具有微信支付权限,你还可以在正文内添加超级链接。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id='graphic_message'>
|
||||
<!-- 添加文本消息 -->
|
||||
<div class="layui-tab layui-tab-brief" id="add_material_text">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">添加文本消息</li>
|
||||
</ul>
|
||||
<div class="layui-form" style="margin-top: 20px;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label sm">内容</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="content" placeholder="请输入内容" id="material_text_content" class="layui-textarea" maxlength="300" lay-verify='material_text_content'></textarea>
|
||||
<span class='input-text-hint'>剩余300字</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row sm">
|
||||
<button class="layui-btn" lay-submit lay-filter="addText">保存</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary" onclick="backWechatMaterialList()">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use('form', function () {
|
||||
var form = layui.form,repeat_flag = false;
|
||||
|
||||
$('#material_text_content').on('input', function (e) {
|
||||
var num = e.target.value.length;
|
||||
num = 300 - parseInt(num);
|
||||
$('#add_material_text .input-text-hint').html('剩余' + num);
|
||||
});
|
||||
form.verify({
|
||||
'material_text_content': function (value, item) {
|
||||
if (value == '' || value == undefined) {
|
||||
return '文本内容不可为空';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
form.on('submit(addText)', function (data) {
|
||||
var value = JSON.stringify(data.field);
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ns.url('wechat://shop/material/addTextMaterial'),
|
||||
data: {type: 5, value},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
if (res.code == 0) {
|
||||
//_self.material_id = res.data;
|
||||
location.hash = ns.hash('wechat://shop/material/lists');
|
||||
}
|
||||
repeat_flag = false;
|
||||
layer.msg(res.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function backWechatMaterialList() {
|
||||
location.hash = ns.hash("wechat://shop/material/lists");
|
||||
}
|
||||
|
||||
</script>
|
||||
163
addon/wechat/shop/view/material/edit.html
Executable file
163
addon/wechat/shop/view/material/edit.html
Executable file
@@ -0,0 +1,163 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_graphic_message.css">
|
||||
<style type="text/css">
|
||||
.img-upload{margin-left: 0}
|
||||
.body-content{padding-top: 15px !important;}
|
||||
</style>
|
||||
|
||||
<div class="layui-collapse tips-wrap">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示<i class="layui-icon layui-colla-icon"></i></h2>
|
||||
<ul class="layui-colla-content layui-show">
|
||||
<li>由于微信公众平台的接口规范,仅提供向微信认证服务号商家。如你的公众号同时具有微信支付权限,你还可以在正文内添加超级链接。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id='graphic_message'>
|
||||
<div class='graphic-message'>
|
||||
<img src='WECHAT_IMG/mobile_head.png'/>
|
||||
<ul class='graphic-message-list'>
|
||||
<template v-for="(value, index) in article_item_list">
|
||||
<li @click.stop="chooseGraphicMessage(index)" @mouseenter="moveThis(index)" @mouseleave="leaveThis(index)">
|
||||
<content>
|
||||
<template v-if="value.cover.path == ''">
|
||||
<div class='empty-img'></div>
|
||||
<span class='empty-hint'>{{index == 0 ? '封面图片' : '缩略图'}}</span>
|
||||
</template>
|
||||
<img v-else :src="value.cover.path"/>
|
||||
<div class='mask-layer'></div>
|
||||
<h4 class='title'><span>{{value.title == '' ? '标题' : value.title}}</span></h4>
|
||||
</content>
|
||||
<div class='action'>
|
||||
<template v-if="(index == 0 && index == current_msg_index) || (move_index == 0 && index == 0)">
|
||||
<span class='edit' @click.stop="chooseGraphicMessage(index)">编辑</span>
|
||||
</template>
|
||||
<template v-else-if="move_index == index || index == current_msg_index">
|
||||
<span class='edit' @click.stop="chooseGraphicMessage(index)">编辑</span>
|
||||
<span class='delete' @click.stop="deleteGraphicMessage(index)">删除</span>
|
||||
</template>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
</ul>
|
||||
<div class='add-graphic-message'>
|
||||
<h4>
|
||||
<a @click="addGraphicMessage()">新增</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div class='bottom-botton'>
|
||||
<template v-if="material_id == 0">
|
||||
<button class='layui-btn' @click="saveGraphicMessage()">保存</button>
|
||||
</template>
|
||||
<button class='layui-btn' v-else @click="editGraphicMessage()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class='editor-box' :style="'margin-top:' + editBoxTopPosition + 'px'">
|
||||
<div class='arrow'></div>
|
||||
<div class='editor-title'>
|
||||
<label>标题<span class='hint'>(必填)</span></label>
|
||||
<input class="layui-input" id="input_title" placeholder="请在这里输入标题" maxlength="64" v-model="inputTitle" max-length="70"/>
|
||||
</div>
|
||||
<div class='editor-author'>
|
||||
<label>作者<span class='hint'>(选填)</span></label>
|
||||
<input class="layui-input" id="input_autor" placeholder="请输入作者" maxlength="16" v-model="inputAutor" max-length="20"/>
|
||||
</div>
|
||||
<div class='editor-cover'>
|
||||
<label>封面<span class='hint'>(图片建议尺寸:900 x 500像素 必填)</span></label>
|
||||
<!--<div class="choose-cover">-->
|
||||
<!--<div class="choose-cover-pic">-->
|
||||
<!--<img :src="coverImg"/>-->
|
||||
<!--</div>-->
|
||||
<!--<template v-if="coverImg == ''">-->
|
||||
<!--<a class="text-color" id="uploadImg" href="javascript:;">上传图片...</a>-->
|
||||
<!--</template>-->
|
||||
<!--<template v-else>-->
|
||||
<!--<a id="uploadImg" style="margin-top: 15px;" href="javascript:;">更换封面图...</a>-->
|
||||
<!--</template>-->
|
||||
<!--</div>-->
|
||||
|
||||
<div class="layui-input-block img-upload">
|
||||
<div class="upload-img-block">
|
||||
<div class="upload-img-box hover" v-if="coverImg">
|
||||
<div class="upload-default" id="uploadImg" >
|
||||
<div id="preview_uploadImg" class="preview_img">
|
||||
<img layer-src :src="coverImg" class="img_prev" :data-img="coverImg"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="operation">
|
||||
<div>
|
||||
<i title="图片预览" class="iconfont iconreview js-preview" style="margin-right: 20px;"></i>
|
||||
<i title="删除图片" class="layui-icon layui-icon-delete js-delete"></i>
|
||||
</div>
|
||||
<div class="replace_img js-replace">点击替换</div>
|
||||
</div>
|
||||
<input type="hidden" name="logo" id="logo" :value="coverImg"/>
|
||||
</div>
|
||||
<div class="upload-img-box" v-else>
|
||||
<div class="upload-default" id="uploadImg" >
|
||||
<div class="upload">
|
||||
<i class="iconfont iconshangchuan"></i>
|
||||
<p>点击上传</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="operation">
|
||||
<div>
|
||||
<i title="图片预览" class="iconfont iconreview js-preview" style="margin-right: 20px;"></i>
|
||||
<i title="删除图片" class="layui-icon layui-icon-delete js-delete"></i>
|
||||
</div>
|
||||
<div class="replace_img js-replace">点击替换</div>
|
||||
</div>
|
||||
<input type="hidden" name="logo" id="logo" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<label class="editor-msg-label" :class="checkShowCoverPic ? 'selected' : ''" for="check_show_cover_pic">
|
||||
<input type="checkbox" id="check_show_cover_pic" value="1" v-model="checkShowCoverPic"/>
|
||||
封面图片显示在正文中
|
||||
</label>
|
||||
</div>
|
||||
<div class='editor-content'>
|
||||
<label>正文<span class='hint'>(必填)</span></label>
|
||||
<script id="editor" type="text/plain" style="width:380px; height:300px;"></script>
|
||||
</div>
|
||||
<div class='editor-url'>
|
||||
<label>原文链接<span class='hint'>(选填)</span></label>
|
||||
<input class="layui-input" id="original_url" placeholder="例:http://www.example.com" maxlength="100" v-model="inputOriginalUrl"/>
|
||||
</div>
|
||||
</div>
|
||||
<input type='hidden' id='edit_flag' value='{$flag}'/>
|
||||
<input type='hidden' id='material_id' value='{$material_id}'/>
|
||||
<div class="loading" :class="{ show: loading }"><i class=" layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop"></i></div>
|
||||
</div>
|
||||
|
||||
<script src="STATIC_JS/vue.js"></script>
|
||||
<script src='WECHAT_JS/wx_graphic_message.js'></script>
|
||||
<script>
|
||||
var material_id = $("#material_id").val();
|
||||
if(material_id != 0){
|
||||
var timer_new = setInterval(function () {
|
||||
if($(".img_prev").attr('data-img') && $("#material_id").val()){
|
||||
loadImgMagnify();
|
||||
var logo_upload = new Upload({
|
||||
elem: '#uploadImg',
|
||||
callback:function (res) {
|
||||
if (res.code >= 0) {
|
||||
//成功之后将图片的路径存放再隐藏域中,便于提交使用
|
||||
// $("input[name='web_qrcode']").val(res.data.pic_path);
|
||||
vue_obj.coverImg = ns.img(res.data.pic_path);
|
||||
vue_obj.article_item_list[vue_obj.current_msg_index].cover.path = ns.img(res.data.pic_path);
|
||||
//将图片展示在页面上
|
||||
// $("#webQrcodeUpload").html("<img src=" + ns.img(res.data.pic_path) + " >");
|
||||
}
|
||||
}
|
||||
});
|
||||
clearInterval(timer_new);
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
</script>
|
||||
<!-- 百度编辑器 -->
|
||||
<script type="text/javascript" charset="utf-8" src="STATIC_EXT/ueditor/ueditor.config.js?time=20240614"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="STATIC_EXT/ueditor/ueditor.all.js?time=20240614"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="STATIC_EXT/ueditor/lang/zh-cn/zh-cn.js"></script>
|
||||
82
addon/wechat/shop/view/material/edit_text.html
Executable file
82
addon/wechat/shop/view/material/edit_text.html
Executable file
@@ -0,0 +1,82 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_graphic_message.css">
|
||||
<style>
|
||||
.layui-tab-brief{width: 800px;height:646px}
|
||||
.input-text-hint{float:right}
|
||||
</style>
|
||||
|
||||
<div class="layui-collapse tips-wrap">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示<i class="layui-icon layui-colla-icon"></i></h2>
|
||||
<ul class="layui-colla-content layui-show">
|
||||
<li>由于微信公众平台的接口规范,仅提供向微信认证服务号商家。如你的公众号同时具有微信支付权限,你还可以在正文内添加超级链接。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id='graphic_message'>
|
||||
<!-- 添加文本消息 -->
|
||||
<div class="layui-tab layui-tab-brief" id="add_material_text">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">添加文本消息</li>
|
||||
</ul>
|
||||
<div class="layui-form" style="margin-top: 20px;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label sm">内容</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="content" placeholder="请输入内容" id="material_text_content" class="layui-textarea" maxlength="300" lay-verify='material_text_content'>{$material_data.value.content}</textarea>
|
||||
<span class='input-text-hint'>剩余300字</span>
|
||||
<input type="hidden" name="media_id" id="media_id" value="{$material_data.id}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row sm">
|
||||
<button class="layui-btn" lay-submit lay-filter="addText">保存</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary" onclick="backWechatMaterialList()">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use('form', function () {
|
||||
var form = layui.form;
|
||||
|
||||
$('#material_text_content').on('input', function (e) {
|
||||
var num = e.target.value.length;
|
||||
num = 300 - parseInt(num);
|
||||
$('#add_material_text .input-text-hint').html('剩余' + num);
|
||||
});
|
||||
form.verify({
|
||||
'material_text_content': function (value, item) {
|
||||
if (value == '' || value == undefined) {
|
||||
return '文本内容不可为空';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
form.on('submit(addText)', function (data) {
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ns.url('wechat://shop/material/editTextMaterial'),
|
||||
data: {type: 5,content: data.field.content,media_id:data.field.media_id},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
if (res.code == 0) {
|
||||
location.hash = ns.hash('wechat://shop/material/lists');
|
||||
} else {
|
||||
repeat_flag = false;
|
||||
}
|
||||
layer.msg(res.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function backWechatMaterialList() {
|
||||
location.hash = ns.hash("wechat://shop/material/lists");
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
144
addon/wechat/shop/view/material/lists.html
Executable file
144
addon/wechat/shop/view/material/lists.html
Executable file
@@ -0,0 +1,144 @@
|
||||
<style>
|
||||
.news-material>ul{display: flex;flex-wrap: wrap}
|
||||
.news-material>ul>li{border: 1px solid rgb(233, 233, 233);position: relative;margin:14px 14px 0 0 ;width: calc((100% - 16px*5)/ 5);height: 315px;}
|
||||
.news-material .add-news{text-align: center;display: flex;position: relative;}
|
||||
.news-material .add-news .add-box{margin: auto}
|
||||
.news-material .add-news .iconfont{font-size: 100px; font-weight: 800;color: #606266;}
|
||||
.news-material .add-news:hover .add-li{display: block;}
|
||||
.news-material .add-li{display: none;width: 130px;height: 60px; box-shadow:0px 0px 5px rgb(231, 231, 231) ; background: #fff; position: absolute;left: 50%;top: 85%;transform: translate(-50%,-50%)}
|
||||
.news-material .add-li li{line-height: 30px;}
|
||||
.news-material .add-li li .iconfont{font-size: 16px;}
|
||||
.news-material .add-li li:hover{background: var(--base-color)}
|
||||
.news-material .add-li li:hover span{color: #fff;cursor: pointer;}
|
||||
.news-material .add-li li:hover i{color: #fff;}
|
||||
.material-content{padding: 20px}
|
||||
.news-material .meterail-img{height:200px;text-align: center;line-height: 200px;}
|
||||
.meterail-img img{max-width: 100%; max-height: 100%;}
|
||||
.meterail-title {height: 200px;padding: 20px 40px;box-sizing: border-box;text-align: center;display: flex; overflow: hidden}
|
||||
.meterail-title .title{margin: auto ;}
|
||||
.meterail-title-text{height: 235px !important;}
|
||||
.material-content .meterail-text {overflow: hidden;height: 35px;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2; overflow:hidden; -webkit-box-orient: vertical;}
|
||||
.material-content .meterail-time{margin-top: 20px ;color: #999}
|
||||
.del-edit{position: absolute;right: 10px;top: 10px;display: none;}
|
||||
.del{margin-right: 5px;}
|
||||
.del,.edit{display: inline-block;background: #fff;height: 30px; width: 30px;text-align: center;border-radius: 50%;line-height: 30px;box-shadow:0px 0px 5px rgb(231, 231, 231) ;}
|
||||
.news-material>ul>li:hover .del-edit{display: inline-block}
|
||||
.del:hover,.edit:hover {color: var(--base-color);cursor: pointer;}
|
||||
#MaterailList{display: flex;justify-content: flex-end;margin-right: 14px;}
|
||||
</style>
|
||||
|
||||
<div class="news-material">
|
||||
<ul id="newsMaterialContent"></ul>
|
||||
<div id="MaterailList"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//删除
|
||||
function delMaterial(id){
|
||||
$.ajax({
|
||||
url: ns.url('wechat://shop/material/delete'),
|
||||
data: {
|
||||
id,
|
||||
},
|
||||
dataType: "JSON",
|
||||
success: function(res) {
|
||||
listenerHash(); // 刷新页面
|
||||
}
|
||||
});
|
||||
}
|
||||
function add_tuwen(){
|
||||
window.open(ns.href("wechat://shop/material/add"));
|
||||
}
|
||||
function add_text(){
|
||||
window.open(ns.href("wechat://shop/material/addtextmaterial"));
|
||||
}
|
||||
var data = '';
|
||||
function getMaterailList(page){
|
||||
$.ajax({
|
||||
url: ns.url('wechat://shop/material/lists'),
|
||||
data: {
|
||||
page,
|
||||
},
|
||||
dataType: "JSON",
|
||||
success: function(res) {
|
||||
this.data = res.data.list;
|
||||
//列表渲染
|
||||
var str = ``;
|
||||
if(page == undefined || page == 1 || !page){
|
||||
str += `
|
||||
<li class="add-news">
|
||||
<div class="add-box">
|
||||
<i class="iconfont iconadd_light icon-hover"></i><br>
|
||||
<span>添加素材</span>
|
||||
<div class="add-li">
|
||||
<ul>
|
||||
<li onclick="add_tuwen()">
|
||||
<i class="iconfont icondoc_plaintext"></i> <span>添加图文</span>
|
||||
</li>
|
||||
<li onclick="add_text()">
|
||||
<i class="iconfont icontext"></i> <span>添加文字</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
`;
|
||||
|
||||
}
|
||||
$.each(this.data, function(index, item) {
|
||||
if(item.type == 1){
|
||||
str += `
|
||||
<li>
|
||||
<div class="del-edit">
|
||||
<a class="del" onclick="delMaterial(`+ item.id +`)" ><i class="iconfont iconshanchu"></i></a>
|
||||
<a href="`+ ns.href('wechat://shop/material/edit',{"id": item.id,'media_id':item.media_id,'type':item.type}) +`" target='_blank' class="edit"><i class="iconfont iconbianji-copy"></i></a>
|
||||
</div>
|
||||
<div class="meterail-img">
|
||||
<img src=" `+ item.value[0].cover.path +` " alt="">
|
||||
</div>
|
||||
<div class="material-content">
|
||||
<p class="meterail-text">`+ item.value[0].title +`</p>
|
||||
<p class="meterail-time">更新于<span>`+ ns.time_to_date(item.update_time) +`</span></p>
|
||||
</div>
|
||||
</li>
|
||||
`
|
||||
}else{
|
||||
str += `
|
||||
<li>
|
||||
<div class="del-edit">
|
||||
<a class="del" onclick="delMaterial(`+ item.id +`)"><i class="iconfont iconshanchu"></i></a>
|
||||
<a href="`+ ns.href('wechat://shop/material/edittextmaterial',{"id": item.id,'media_id':item.media_id,'type':item.type}) +`" target='_blank' class="edit"><i class="iconfont iconbianji-copy"></i></a>
|
||||
</div>
|
||||
<div class="meterail-title meterail-title-text">
|
||||
<p class="title">`+ item.value.content +`</p>
|
||||
</div>
|
||||
<div class="material-content">
|
||||
<p class="meterail-time">更新于<span>`+ ns.time_to_date(item.update_time) +`</span></p>
|
||||
</div>
|
||||
</li>
|
||||
`
|
||||
}
|
||||
|
||||
});
|
||||
$("#newsMaterialContent").html(str);
|
||||
//分页
|
||||
layui.use('laypage', function(){
|
||||
var laypage = layui.laypage;
|
||||
laypage.render({
|
||||
elem: 'MaterailList' ,
|
||||
curr: page, //当前页
|
||||
count: res.data.count,
|
||||
layout: ['count', 'prev', 'page', 'next'],
|
||||
jump: function(obj, first){
|
||||
//首次不执行
|
||||
if(!first){
|
||||
getMaterailList(obj.curr);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
getMaterailList();
|
||||
</script>
|
||||
93
addon/wechat/shop/view/material/material.html
Executable file
93
addon/wechat/shop/view/material/material.html
Executable file
@@ -0,0 +1,93 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_menu.css">
|
||||
<script src="WECHAT_JS/common.js"></script>
|
||||
|
||||
<!-- 内容 -->
|
||||
{if $type == 1}
|
||||
<div class="layui-tab layui-tab-brief" id="marterial_graphic_message">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">图文消息</li>
|
||||
<!-- <li>高级图文</li> -->
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<table id="marterial_graphic_message_list" lay-filter="marterial_graphic_message"></table>
|
||||
<!-- 标题 -->
|
||||
<script type="text/html" id="graphic_message_title">
|
||||
<div class="layui-row grid-demo">
|
||||
{{# for (var index in d.value) { }}
|
||||
<div class="layui-col-md12 layui-clear">
|
||||
<div class="layui-col-md3 article-img" style="float:left;">
|
||||
<span style="color: #fff;padding: 2px 4px;background: #1aad19;">图文</span>
|
||||
</div>
|
||||
<div class="layui-col-md3 title" style="float:left;">
|
||||
<a href="javascript:void(0);" onclick="preview({{d.id}}, {{index}})">{{d.value[index].title}}</a>
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
{{# if (d.value.length == 1) { }}
|
||||
<div class='layui-col-md12 read-all layui-clear' onclick="preview({{d.id}})">
|
||||
<div class='layui-col-md4' style="float:left;">阅读全文</div>
|
||||
<div class='layui-col-md4 layui-col-md-offset4'> </div>
|
||||
</div>
|
||||
{{# } }}
|
||||
</div>
|
||||
</script>
|
||||
<!-- 创建时间 -->
|
||||
<script type="text/html" id="create_time">
|
||||
<div>{{ ns.time_to_date(d.create_time) }}</div>
|
||||
</script>
|
||||
<!-- 修改时间 -->
|
||||
<script type="text/html" id="update_time">
|
||||
<div>{{ ns.time_to_date(d.update_time) }}</div>
|
||||
</script>
|
||||
<!-- 列表操作 -->
|
||||
<script type="text/html" id="operation">
|
||||
<a class="default layui-btn-sm hover_cursor text-color" style="cursor:pointer;" lay-event="choose">选取</a>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{else/}
|
||||
|
||||
<!-- 文本消息 -->
|
||||
<div class="layui-tab layui-tab-brief" id="material_text">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">文本消息</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<table id="material_text_list" lay-filter="material_text"></table>
|
||||
<!-- 内容 -->
|
||||
<script type="text/html" id="text_content">
|
||||
<div class="layui-row grid-demo">
|
||||
<div class="layui-col-md12 layui-clear">
|
||||
<div class="layui-col-md12 article-img" style="text-align: left;">
|
||||
<span style="color: #fff;padding: 2px 4px;">文本</span>
|
||||
</div>
|
||||
<div class="layui-col-md12 title line-hiding" style="float:left;">
|
||||
<a href="javascript:void(0);" onclick="previewText('{{d.value.content}}')" title="{{d.value.content}}">{{d.value.content}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<!-- 创建时间 -->
|
||||
<script type="text/html" id="create_time">
|
||||
<div>{{ ns.time_to_date(d.create_time) }}</div>
|
||||
</script>
|
||||
<!-- 修改时间 -->
|
||||
<script type="text/html" id="update_time">
|
||||
<div>{{ ns.time_to_date(d.update_time) }}</div>
|
||||
</script>
|
||||
<!-- 列表操作 -->
|
||||
<script type="text/html" id="operation">
|
||||
<a class="default layui-btn-sm hover_cursor text-color" style="cursor:pointer;" lay-event="choose">选取</a>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<script type="text/javascript" src="WECHAT_JS/wx_material_mannager.js"></script>
|
||||
<script type="text/javascript">
|
||||
loadMaterialList({$type});
|
||||
</script>
|
||||
91
addon/wechat/shop/view/material/material_list.html
Executable file
91
addon/wechat/shop/view/material/material_list.html
Executable file
@@ -0,0 +1,91 @@
|
||||
<link rel="stylesheet" href="ADDON_WECHAT_CSS/wx_material.css">
|
||||
|
||||
<div class="layui-tab-item layui-show">
|
||||
<div class='mg'>
|
||||
<button class="layui-btn" onclick="window.open(ns.href('wechat://shop/material/addgraphicmessage'))">新建图文</button>
|
||||
</div>
|
||||
<div>
|
||||
<table id="graphic_message_list" lay-filter="graphic_message"></table>
|
||||
</div>
|
||||
<!-- 标题 -->
|
||||
<script type="text/html" id="title">
|
||||
<div class="layui-row grid-demo">
|
||||
{{# for (var index in d.value) { }}
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-col-md3 article-img">
|
||||
<span class="bg-color">图文</span>
|
||||
</div>
|
||||
<div class="layui-col-md8 title">
|
||||
<a class="graphic-message-title" href="javascript:void(0);" onclick="preview({{d.id}}, {{index}})">{{d.value[index].title}}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{# } }}
|
||||
{{# if (d.value.length == 1) { }}
|
||||
<div class='layui-col-md12 read-all' onclick="preview({{d.id}})">
|
||||
<div class='layui-col-md4'>阅读全文</div>
|
||||
<div class='layui-col-md4 layui-col-md-offset4'> > </div>
|
||||
</div>
|
||||
{{# } }}
|
||||
</div>
|
||||
</script>
|
||||
<!-- 创建时间 -->
|
||||
<script type="text/html" id="create_time">
|
||||
<div>{{ ns.time_to_date(d.create_time) }}</div>
|
||||
</script>
|
||||
<!-- 修改时间 -->
|
||||
<script type="text/html" id="update_time">
|
||||
<div>{{ ns.time_to_date(d.update_time) }}</div>
|
||||
</script>
|
||||
<!-- 列表操作 -->
|
||||
<script type="text/html" id="operation">
|
||||
<a class="default" lay-event="edit">编辑</a>
|
||||
<a class="default" lay-event="delete">删除</a>
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<script src="ADDON_WECHAT_JS/wx_material.js"></script>
|
||||
<script>
|
||||
loadMaterialList(1);
|
||||
layui.use(['table','form'], function() {
|
||||
var table,
|
||||
form = layui.form;
|
||||
|
||||
table = new Table({
|
||||
elem: '#Fans_list',
|
||||
url: ns.url("wechat://shop/material/lists"),
|
||||
page: false,
|
||||
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
field: 'title',
|
||||
title: '标题',
|
||||
unresize: 'false'
|
||||
}, {
|
||||
field: 'create_time',
|
||||
title: '创建时间',
|
||||
unresize: 'false',
|
||||
templet: function(data) {
|
||||
return ns.time_to_date(data.create_time);
|
||||
}
|
||||
}, {
|
||||
field: 'update_time',
|
||||
title: '更新时间',
|
||||
unresize: 'false',
|
||||
templet: function(data) {
|
||||
return ns.time_to_date(data.update_time);
|
||||
}
|
||||
}, {
|
||||
title: '操作',
|
||||
toolbar: '#operation',
|
||||
align: 'right',
|
||||
unresize: 'false'
|
||||
}
|
||||
]
|
||||
],
|
||||
bottomToolbar: "#batchOperation"
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
48
addon/wechat/shop/view/material/preview_material.html
Executable file
48
addon/wechat/shop/view/material/preview_material.html
Executable file
@@ -0,0 +1,48 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="referrer" content="never">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0,viewport-fit=cover"/>
|
||||
<meta http-equiv="X-UA-COMPATIBLE" content="IE=edge,chrome=1">
|
||||
<title>{$info.value[$index]['title']}</title>
|
||||
<meta name="keywords" content="">
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" type="text/css" href="__STATIC__/ext/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="SITEHOME_CSS/home.css">
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_preview_graphic_message.css">
|
||||
<script src="__STATIC__/js/jquery-2.2.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class='preview-box'>
|
||||
<img class='head' src='WECHAT_IMG/mobile_head.png'/>
|
||||
<div class='graphic-message'>
|
||||
<h1 class='title'>{$info.value[$index]['title']}</h1>
|
||||
{if condition="$info.update_time eq 0"}
|
||||
<span class='time'>{$info['create_time']|time_to_date='Y-m-d'}</span>
|
||||
{else/}
|
||||
<span class='time'>{$info['update_time']|time_to_date='Y-m-d'}</span>
|
||||
{/if}
|
||||
<span class='author'>{$info.value[$index]['autor']}</span>
|
||||
<content>
|
||||
{if condition="$info.value[$index]['show_cover_pic'] == 1"}
|
||||
<div class="rich-media-thumb" id="media">
|
||||
<img onerror="this.parentNode.removeChild(this)" src="{$info.value[$index]['cover']['path']}">
|
||||
</div>
|
||||
{/if}
|
||||
{:html_entity_decode($info.value[$index]['content'])}
|
||||
</content>
|
||||
{if condition="!empty($info.value[$index]['url'])"}
|
||||
<a class='original-text' href="{$info.value[$index]['url']}">阅读原文</a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
$(function () {
|
||||
$("img").each(function () {
|
||||
$(this).replaceWith(this);
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
32
addon/wechat/shop/view/material/preview_text.html
Executable file
32
addon/wechat/shop/view/material/preview_text.html
Executable file
@@ -0,0 +1,32 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="referrer" content="never">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0,viewport-fit=cover"/>
|
||||
<meta http-equiv="X-UA-COMPATIBLE" content="IE=edge,chrome=1">
|
||||
<meta name="keywords" content="">
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" type="text/css" href="__STATIC__/ext/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="SITEHOME_CSS/home.css">
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_preview_graphic_message.css">
|
||||
<script src="__STATIC__/js/jquery-2.2.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class='preview-box'>
|
||||
<img class='head' src='WECHAT_IMG/mobile_head.png'/>
|
||||
<div class='graphic-message'>
|
||||
<content>
|
||||
{:html_entity_decode($info.value['content'])}
|
||||
</content>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
$(function () {
|
||||
$("img").each(function () {
|
||||
$(this).replaceWith(this);
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user