Authored by leo

Update: 店铺信息优化,店铺简介支持富文本

... ... @@ -94,7 +94,8 @@
<label>店铺简介:</label>
</div>
<div class="col-sm-7">
<textarea class="form-control" form="storeForm" rows="10" name="shopIntro" id="shopIntro"><%data.shopIntro%></textarea>
<script id="edit-shop-intro" type="text/plain" style="width:100%;height:500px;"></script>
<input id="shopIntro" type="hidden" placeholder="店铺简介" value="<%data.shopIntro%>">
</div>
</div>
<div class="form-group">
... ...
... ... @@ -45,7 +45,10 @@
</div>
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">店铺简介:</div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8"><%data.shopIntro%></div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
<script id="edit-shop-intro" type="text/plain" style="width:100%;height:500px;"></script>
<input id="shopIntro" type="hidden" placeholder="店铺简介" value="<%data.shopIntro%>">
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">店铺状态:</div>
... ...
... ... @@ -2,8 +2,15 @@
'use strict';
var $ = require('jquery'),
common=require('../../common/common');
require('../../common/umeditor.config');
require('../../common/umeditor');
require('../../common/zh-cn');
var e=new common.edit("#storeForm",{bucket:"yhb-img01"});
window.UMshopintro = UM.getEditor('edit-shop-intro');
var Bll={
toast:function(content,url,id){
common.dialog.confirm("温馨提示",content,function(){
... ... @@ -92,6 +99,11 @@ e.on("render",function(){
// Array.prototype.push.apply(g2.__rows, a);
g2.init(g2.__rows);
}
var shopIntroContent = $('#shopIntro').val();
if(shopIntroContent) {
UMshopintro.setContent(shopIntroContent);
}
});
e.on("bind",function(){
... ... @@ -263,6 +275,7 @@ e.init();
var submit=function(callback){
e.submit($("#storeForm").attr("action"),function(option){
option.data=$.extend({},option.data,_arr);
option.data.shopIntro = UMshopintro.getContent();
console.log(option.data);
option.success=function(res){
if(res.code=="200"){
... ...
... ... @@ -4,6 +4,10 @@
var $ = require('jquery'),
common=require('../../common/common');
require('../../common/umeditor.config');
require('../../common/umeditor');
require('../../common/zh-cn');
var ENUM={
shopNature:{1:'旗舰店',2:'专卖店'},
shopsType:{1:'单品店',2:'多品店'},
... ... @@ -64,3 +68,10 @@ if($("#shopRelationList").val()){
var a=JSON.parse($("#shopRelationList").val());
g2.init(a);
}
window.UMshopintro = UM.getEditor('edit-shop-intro');
window.UMshopintro.setDisabled('fullscreen');
var shopIntroContent = $('#shopIntro').val();
if(shopIntroContent) {
UMshopintro.setContent(shopIntroContent);
}
\ No newline at end of file
... ...