初始上传
This commit is contained in:
21
addon/notes/component/controller/Notes.php
Executable file
21
addon/notes/component/controller/Notes.php
Executable file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace addon\notes\component\controller;
|
||||
|
||||
use app\component\controller\BaseDiyView;
|
||||
|
||||
/**
|
||||
* 店铺笔记·组件
|
||||
*
|
||||
*/
|
||||
class Notes extends BaseDiyView
|
||||
{
|
||||
|
||||
/**
|
||||
* 设计界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("notes/design.html");
|
||||
}
|
||||
}
|
||||
51
addon/notes/component/view/notes/css/design.css
Executable file
51
addon/notes/component/view/notes/css/design.css
Executable file
@@ -0,0 +1,51 @@
|
||||
@CHARSET "UTF-8";
|
||||
.component-notes .goods-head {display: -webkit-box;display: -webkit-flex;display: flex;-webkit-box-pack: justify;-webkit-justify-content: space-between;justify-content: space-between;-webkit-box-align: center;-webkit-align-items: center;align-items: center;margin-bottom: 10px;padding: 10px;}
|
||||
.component-notes .goods-head .title-wrap {display: -webkit-box;display: -webkit-flex;display: flex;-webkit-box-align: center;-webkit-align-items: center;align-items: center;width: calc(100% - 75px);}
|
||||
.component-notes .goods-head .title-wrap .name {font-size: 14px;margin-right: 8px; font-weight: 600;}
|
||||
.component-notes .goods-head .more {display: -webkit-box;display: -webkit-flex;display: flex;-webkit-box-align: center;-webkit-align-items: center;align-items: center;justify-content: flex-end;}
|
||||
.component-notes .goods-head .more {font-size: 12px;width: 75px;}
|
||||
.component-notes .goods-head .left-icon, .component-notes .goods-head .right-icon {display: inline-block; height: 20px; line-height: 20px; flex-shrink: 0;}
|
||||
.component-notes .goods-head .iconfont {flex-shrink: 0;}
|
||||
.component-notes .goods-head .more span, .component-notes .goods-head .title-wrap .name {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
|
||||
.component-notes .goods-head .more span {text-align: right;}
|
||||
.component-notes .goods-head .more i {font-size: 12px; margin-left: 2px;}
|
||||
.component-notes .goods-head .title-wrap .name {max-width: 180px;}
|
||||
.component-notes .goods-head .left-icon img, .component-notes .goods-head .right-icon img {max-height: 20px;vertical-align: top;}
|
||||
.component-notes .goods-head .left-icon img {margin-right: 5px;}
|
||||
.component-notes .goods-head .right-icon img {margin-left: 5px;}
|
||||
.component-notes .goods-head .time {font-size: 12px; color: #777777;}
|
||||
.component-notes .goods-head .time span {display: inline-block; width: 18px; height: 18px; line-height: 18px; text-align: center; background-color: #383838; color: #FFFFFF; border-radius: 3px; margin: 0 3px;}
|
||||
.component-notes .goods-head .time .second {background-color: #FF4544;}
|
||||
|
||||
/* 风格一 */
|
||||
.component-notes .list-wrap {width: 100%;}
|
||||
.component-notes .list-wrap .item {width: 100%; height: 100%; border-radius: 5px; overflow: hidden; margin-top: 15px; box-sizing: border-box; -moz-box-shadow: 1px 2px 4px rgba(0, 0, 0, .1); -webkit-box-shadow: 1px 2px 4px rgba(0, 0, 0, .1); box-shadow: 1px 2px 4px rgba(0, 0, 0, .1);}
|
||||
.component-notes .list-wrap .item:first-child{margin-top: 0;}
|
||||
.component-notes .list-wrap .item .img-wrap {width: 100%; height: 130px; padding: 0 10px; box-sizing: border-box;}
|
||||
.component-notes .list-wrap .item .img-wrap img {width: 100%; height: 100%; object-fit: cover; padding: 0; margin: 0;}
|
||||
.component-notes .list-wrap .item .img-wrap-boxs {display: flex; justify-content: space-between; flex-wrap: wrap; height: auto;}
|
||||
.component-notes .list-wrap .item .img-wrap-boxs img {display: inline-block; width: 31%; height: 100px; margin-top: 10px;}
|
||||
.component-notes .list-wrap .item .img-wrap-boxs img:nth-child(-n+3) {margin-top: 0;}
|
||||
.component-notes .list-wrap .item .item-con {padding: 10px;}
|
||||
.component-notes .list-wrap .item .item-con .notes-title {font-size: 16px; font-weight: 600; line-height: 22px;}
|
||||
.component-notes .list-wrap .item .item-con .notes-highlights-list {margin-top: 5px;}
|
||||
.component-notes .list-wrap .item .item-con .notes-highlights-list span {display: inline-block; color: #FFFFFF; font-size: 12px; line-height: 18px; padding: 0 5px; border-radius: 2px;}
|
||||
.component-notes .list-wrap .item .item-con .notes-intro {margin-top: 5px; font-size: 14px;}
|
||||
.component-notes .list-wrap .item .item-con .notes-intro span {float: left; margin-right: 7px;}
|
||||
.component-notes .list-wrap .item .item-con .notes-info {display: flex; justify-content: space-between; align-items: center; margin-top: 3px;}
|
||||
.component-notes .list-wrap .item .item-con .notes-info span {color: #969799; font-size: 12px; display: flex; align-items: center;}
|
||||
.component-notes .list-wrap .item .item-con .notes-info span img {width: 11px; margin-right: 3px;}
|
||||
.component-notes .list-wrap .item .new-price {font-size: 14px;display: block;}
|
||||
.component-notes .list-wrap .item .old-price {font-size: 12px;color: #898989;text-decoration: line-through;}
|
||||
.component-notes .list-wrap .item .good-name {margin-top: 5px;}
|
||||
.component-notes .list-wrap .item .good-desc {color: #898989; font-size: 12px;}
|
||||
.component-notes .list-wrap .item .good-stock {color: #898989; font-size: 12px;}
|
||||
.component-notes .goods-show-box .layui-input-inline {padding-left: 20px;}
|
||||
|
||||
/* 风格 */
|
||||
.component-notes .notes-list-style{display: none;}
|
||||
.style-list-con-notes{display: flex;flex-wrap: wrap;}
|
||||
.style-list-con-notes .style-li-notes{width: 32%;height: 300px;line-height: 300px;margin-right: 2%;margin-bottom: 15px;cursor: pointer;border: 1px solid #ededed;background: #f7f8fa;box-sizing: border-box;}
|
||||
.style-list-con-notes .style-li-notes:nth-child(3n){margin-right: 0;}
|
||||
.style-list-con-notes .style-li-notes img{width: 100%;}
|
||||
.layui-layer-page .layui-layer-content{overflow: auto !important;}
|
||||
196
addon/notes/component/view/notes/design.html
Executable file
196
addon/notes/component/view/notes/design.html
Executable file
@@ -0,0 +1,196 @@
|
||||
<nc-component :data="data[index]" class="component-notes">
|
||||
|
||||
<!-- 预览 -->
|
||||
<template slot="preview">
|
||||
<div class="preview-box">
|
||||
<div class="notes-list-preview" :class="'text-title-'+ nc.style" :style="{ backgroundColor : nc.componentBgColor }">
|
||||
<div class="goods-head">
|
||||
<div class="title-wrap">
|
||||
<span class="name" :style="{color: nc.titleTextColor || 'rgba(0,0,0,0)'}">{{nc.title}}</span>
|
||||
</div>
|
||||
<div class="more red-color" v-if="nc.more">
|
||||
<span :style="{color: nc.moreTextColor || 'rgba(0,0,0,0)'}">{{nc.more}}</span>
|
||||
<i class="iconfont iconyoujiantou" :style="{color: nc.moreTextColor || 'rgba(0,0,0,0)'}"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list-wrap" v-if="nc.style==1">
|
||||
<div class="item" :style="{
|
||||
backgroundColor : nc.contentBgColor,
|
||||
borderTopLeftRadius: (nc.elementAngle == 'round' ? nc.topElementAroundRadius + 'px' : 0),
|
||||
borderTopRightRadius: (nc.elementAngle == 'round' ? nc.topElementAroundRadius + 'px' : 0),
|
||||
borderBottomLeftRadius: (nc.elementAngle == 'round' ? nc.bottomElementAroundRadius + 'px' : 0),
|
||||
borderBottomRightRadius: (nc.elementAngle == 'round' ? nc.bottomElementAroundRadius + 'px' : 0)
|
||||
}">
|
||||
<div class="item-con">
|
||||
<p class="notes-title multi-line-hiding">这里显示笔记标题最多显示2行</p>
|
||||
<div class="notes-highlights-list" v-show="nc.notesLabel == 1">
|
||||
<span class="bg-color">亮点</span>
|
||||
</div>
|
||||
<div class="notes-intro">
|
||||
<span class="notes-label text-color">#掌柜说#</span>
|
||||
<p>笔记内容介绍</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="img-wrap">
|
||||
<img :src="changeImgUrl('public/static/img/default_img/figure.png')" />
|
||||
</div>
|
||||
<div class="item-con">
|
||||
<div class="notes-info">
|
||||
<div class="notes-num"><span v-show="nc.uploadTime == 1">2020-01-01</span></div>
|
||||
<div class="notes-num"><span v-show="nc.readNum == 1">阅读 1000</span></div>
|
||||
<!-- <div class="notes-num"><span v-show="nc.thumbsUpNum == 1"><img src="{$resource_path}/img/thumbs_up.png" /><span>1000</span></span></div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" :style="{
|
||||
backgroundColor : nc.contentBgColor,
|
||||
borderTopLeftRadius: (nc.elementAngle == 'round' ? nc.topElementAroundRadius + 'px' : 0),
|
||||
borderTopRightRadius: (nc.elementAngle == 'round' ? nc.topElementAroundRadius + 'px' : 0),
|
||||
borderBottomLeftRadius: (nc.elementAngle == 'round' ? nc.bottomElementAroundRadius + 'px' : 0),
|
||||
borderBottomRightRadius: (nc.elementAngle == 'round' ? nc.bottomElementAroundRadius + 'px' : 0)
|
||||
}">
|
||||
<div class="item-con">
|
||||
<p class="notes-title multi-line-hiding">这里显示笔记标题最多显示2行</p>
|
||||
<div class="notes-highlights-list" v-show="nc.notesLabel == 1">
|
||||
<span class="bg-color">亮点</span>
|
||||
</div>
|
||||
<div class="notes-intro">
|
||||
<span class="notes-label text-color">#掌柜说#</span>
|
||||
<p>笔记内容介绍</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="img-wrap img-wrap-boxs">
|
||||
<img :src="changeImgUrl('public/static/img/default_img/square.png')" />
|
||||
<img :src="changeImgUrl('public/static/img/default_img/square.png')" />
|
||||
<img :src="changeImgUrl('public/static/img/default_img/square.png')" />
|
||||
</div>
|
||||
<div class="item-con">
|
||||
<div class="notes-info">
|
||||
<div class="notes-num"><span v-show="nc.uploadTime == 1">2020-01-01</span></div>
|
||||
<div class="notes-num"><span v-show="nc.readNum == 1">阅读 1000</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 内容编辑 -->
|
||||
<template slot="edit-content">
|
||||
<template v-if="nc.lazyLoad">
|
||||
<notes-set></notes-set>
|
||||
<div class="template-edit-title">
|
||||
<h3>风格选择</h3>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label sm">风格</label>
|
||||
<div class="layui-input-block" v-if="nc.tempData.methods">
|
||||
<div class="text-color selected-style" @click="nc.tempData.methods.selectStyle()">
|
||||
<span>{{nc.styleName}}</span>
|
||||
<i class="layui-icon layui-icon-right"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="template-edit-title">
|
||||
<h3>笔记数据</h3>
|
||||
<div class="layui-form-item" v-if="nc.tempData.goodsSources">
|
||||
<label class="layui-form-label sm">数据来源</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="source-selected">
|
||||
<div class="source">{{ nc.tempData.goodsSources[nc.sources].text }}</div>
|
||||
<div v-for="(item,sourcesKey) in nc.tempData.goodsSources" :key="sourcesKey" class="source-item" :title="item.text" @click="nc.sources=sourcesKey" :class="{ 'text-color border-color' : (nc.sources == sourcesKey) }">
|
||||
<i class='iconfont' :class='item.icon'></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<slide v-if="nc.sources != 'diy'" :data="{ field : 'count', label : '显示数量', max: 9, min: 1 }"></slide>
|
||||
<div class="layui-form-item" v-if="nc.sources == 'diy'">
|
||||
<label class="layui-form-label sm">手动选择</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="selected-style" @click="nc.tempData.methods.addNotes()">
|
||||
<span v-if="nc.noteId.length == 0">请选择</span>
|
||||
<span v-if="nc.noteId.length > 0" class="text-color">已选{{ nc.noteId.length }}个</span>
|
||||
<i class="iconfont iconyoujiantou"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="template-edit-title">
|
||||
<h3>顶部标题</h3>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label sm">标题</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name='title' v-model="nc.title" class="layui-input" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label sm">文本内容</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name='title' v-model="nc.more" class="layui-input" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="template-edit-title">
|
||||
<h3>显示内容</h3>
|
||||
<div class="layui-form-item" v-for="item in nc.tempData.showContentList">
|
||||
<label class="layui-form-label sm">{{item.title}}</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-unselect layui-form-checkbox" lay-skin="primary" @click="nc.tempData.methods.changeStatus(item.name)" :class="{ 'layui-form-checked' : nc[item.name] }">
|
||||
<span>{{ nc[item.name] ? '显示' : '隐藏' }}</span>
|
||||
<i class="layui-icon layui-icon-ok"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 弹框 -->
|
||||
<article class="notes-list-style">
|
||||
<div class="style-list-notes layui-form">
|
||||
<div class="style-list-con-notes">
|
||||
<div class="style-li-notes" :class="{'selected border-color': nc.style == 1}">
|
||||
<img src="{$resource_path}/img/notes_style_1.png" />
|
||||
<span class="layui-hide">风格一</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="style">
|
||||
<input type="hidden" name="style_name">
|
||||
</div>
|
||||
</article>
|
||||
|
||||
</template>
|
||||
|
||||
<!-- 样式编辑 -->
|
||||
<template slot="edit-style">
|
||||
<div class="template-edit-title">
|
||||
<h3>顶部标题</h3>
|
||||
<color :data="{ field : 'titleTextColor', label : '标题颜色', defaultColor : '#333333' }"></color>
|
||||
<color :data="{ field : 'moreTextColor', defaultColor: '#858585' }"></color>
|
||||
</div>
|
||||
<div class="template-edit-title">
|
||||
<h3>笔记内容</h3>
|
||||
<color :data="{ field : 'contentBgColor', 'label' : '背景颜色' , defaultColor : '#FFFFFF'}"></color>
|
||||
|
||||
<slide v-show="nc.elementAngle == 'round'" :data="{ field : 'topElementAroundRadius', label : '上圆角', max : 50 }"></slide>
|
||||
<slide v-show="nc.elementAngle == 'round'" :data="{ field : 'bottomElementAroundRadius', label : '下圆角', max : 50 }"></slide>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 资源 -->
|
||||
<template slot="resource">
|
||||
<js>
|
||||
var notesResourcePath = "{$resource_path}"; // http路径
|
||||
var notesRelativePath = "{$relative_path}"; // 相对路径
|
||||
</js>
|
||||
<js src="{$resource_path}/js/design.js"></js>
|
||||
<css src="{$resource_path}/css/design.css"></css>
|
||||
</template>
|
||||
|
||||
</nc-component>
|
||||
BIN
addon/notes/component/view/notes/img/notes_style_1.png
Executable file
BIN
addon/notes/component/view/notes/img/notes_style_1.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
addon/notes/component/view/notes/img/thumbs_up.png
Executable file
BIN
addon/notes/component/view/notes/img/thumbs_up.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
90
addon/notes/component/view/notes/js/design.js
Executable file
90
addon/notes/component/view/notes/js/design.js
Executable file
@@ -0,0 +1,90 @@
|
||||
var notesSetHtml = '<div style="display:none;"></div>';
|
||||
|
||||
Vue.component("notes-set", {
|
||||
template: notesSetHtml,
|
||||
data: function () {
|
||||
return {
|
||||
data: this.$parent.data,
|
||||
goodsSources: {
|
||||
initial: {
|
||||
text: "默认",
|
||||
icon: "iconmofang"
|
||||
},
|
||||
diy: {
|
||||
text: "手动选择",
|
||||
icon: "iconshoudongxuanze"
|
||||
},
|
||||
},
|
||||
showContentList: [
|
||||
{
|
||||
title: "亮点",
|
||||
name: "notesLabel"
|
||||
},
|
||||
{
|
||||
title: "阅读数",
|
||||
name: "readNum"
|
||||
},
|
||||
{
|
||||
title: "更新时间",
|
||||
name: "uploadTime"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
if (!this.$parent.data.verify) this.$parent.data.verify = [];
|
||||
this.$parent.data.verify.push(this.verify);//加载验证方法
|
||||
|
||||
this.$parent.data.ignore = ['textColor', 'componentAngle', 'elementBgColor']; //加载忽略内容 -- 其他设置中的属性设置
|
||||
this.$parent.data.ignoreLoad = true; // 等待忽略数组赋值后加载
|
||||
|
||||
// 组件所需的临时数据
|
||||
this.$parent.data.tempData = {
|
||||
goodsSources: this.goodsSources,
|
||||
showContentList: this.showContentList,
|
||||
methods: {
|
||||
selectStyle: this.selectStyle,
|
||||
addNotes: this.addNotes,
|
||||
changeStatus: this.changeStatus
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
changeStatus: function (field) {
|
||||
this.$parent.data[field] = this.$parent.data[field] ? 0 : 1;
|
||||
},
|
||||
addNotes: function () {
|
||||
var self = this;
|
||||
notesSelect(function (res) {
|
||||
self.$parent.data.noteId = [];
|
||||
for (var i = 0; i < res.length; i++) {
|
||||
self.$parent.data.noteId.push(res[i]);
|
||||
}
|
||||
}, self.$parent.data.noteId, {});
|
||||
},
|
||||
selectStyle: function () {
|
||||
var self = this;
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '风格选择',
|
||||
area: ['930px', '630px'],
|
||||
btn: ['确定', '返回'],
|
||||
content: $(".draggable-element[data-index='" + self.data.index + "'] .edit-attribute .notes-list-style").html(),
|
||||
success: function (layero, index) {
|
||||
$(".layui-layer-content input[name='style']").val(self.data.style);
|
||||
$(".layui-layer-content input[name='style_name']").val(self.data.styleName);
|
||||
$("body").off("click", ".layui-layer-content .style-list-con-notes .style-li-notes").on("click", ".layui-layer-content .style-list-con-notes .style-li-notes", function () {
|
||||
$(this).addClass("selected border-color").siblings().removeClass("selected border-color");
|
||||
$(".layui-layer-content input[name='style']").val($(this).index() + 1);
|
||||
$(".layui-layer-content input[name='style_name']").val($(this).find("span").text());
|
||||
});
|
||||
},
|
||||
yes: function (index, layero) {
|
||||
self.data.style = $(".layui-layer-content input[name='style']").val();
|
||||
self.data.styleName = $(".layui-layer-content input[name='style_name']").val();
|
||||
layer.closeAll()
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user