Authored by 马力

Merge branch 'hotfix_guang_pcurl' into grey

# Conflicts:
#	code/index.js
... ... @@ -38,7 +38,8 @@ module.exports={
{name: 'coverImageType', type: 'Number'},
{name: 'articleType', type: 'Number'},
{name: 'adsImgSize', type: 'String'},
{name: 'isRecommend', type: 'Number'}
{name: 'isRecommend', type: 'Number'}
]
},
timePublish:{
... ... @@ -97,6 +98,7 @@ module.exports={
{name:"articleType",type:"Number"},
{name:"adsImgSize",type:"String"},
{name:"url",type:"String"},
{name:"pcUrl",type:"String"},
{name:"contentData",type:"String"},
{name:"brands",type:"String"},
{name:"tag",type:"String"},
... ... @@ -119,6 +121,7 @@ module.exports={
{name:"articleType",type:"Number"},
{name:"adsImgSize",type:"String"},
{name:"url",type:"String"},
{name:"pcUrl",type:"String"},
{name:"contentData",type:"String"},
{name:"brands",type:"String"},
{name:"tag",type:"String"},
... ...
... ... @@ -133,17 +133,33 @@
<div class="row">
<div class="form-group">
<label class="col-sm-2 control-label">链接:</label>
<label class="col-sm-2 control-label">PC链接:</label>
<div class="col-sm-7">
<div class="col-sm-6">
<input type="text" name="pcUrl" id="pcUrl" value='[[pcUrl]]' class="form-control" placeholder="请输入内容链接"
readonly="true">
</div>
<div class="col-sm-2">
<button type="button" class="btn btn-info" id="addPcUrl">添加链接</button>
<button type="button" class="btn btn-default" id="clearPcUrl">清除链接</button>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">APP链接:</label>
<div class="col-sm-6">
<input type="text" name="url" id="url" value='[[url]]' class="form-control" placeholder="请输入内容链接"
readonly="true">
<p style="color:#999">注:链接中不能有英文单引号</p>
</div>
<div class="col-sm-1">
<button type="button" class="btn btn-info" id="addUrl">添加链接</button>
<div class="col-sm-2">
<button type="button" class="btn btn-info" id="addAppUrl">添加链接</button>
<button type="button" class="btn btn-default" id="clearAppUrl">清除链接</button>
</div>
</div>
... ...
... ... @@ -1182,15 +1182,35 @@ var e = new common.edit("#panel-body", {
});
e.init();
e.on("validate", function () {
if (Bll.contentDatas.length == 0 && $("#url").val() == "") {
return "链接和内容不能同时为空";
if (Bll.contentDatas.length == 0 && $("#pcUrl").val() == "" && $("#url").val() == "") {
return "PC链接和APP链接和内容不能同时为空";
}
});
var imgsTem = "?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90";
/**
* 添加链接
* 添加PC链接
*/
$(document).on("click", "#addUrl", function () {
$(document).on("click", "#addPcUrl", function () {
common.dialog.confirm("添加链接", common.util.__template2($("#template2").html(), {}), function () {
if($("#goTo").val() == '' && $("#goToUrl").val() == ''){
$("#pcUrl").val('');
}else{
$("#pcUrl").val(JSON.stringify({
action: $("#goTo").val(),
url: $("#goToUrl").val()
}));
}
});
});
$(document).on("click", "#clearPcUrl", function () {
$("#pcUrl").val('');
});
/**
* 添加APP链接
*/
$(document).on("click", "#addAppUrl", function () {
common.dialog.confirm("添加链接", common.util.__template2($("#template2").html(), {}), function () {
if($("#goTo").val() == '' && $("#goToUrl").val() == ''){
$("#url").val('');
... ... @@ -1202,6 +1222,12 @@ $(document).on("click", "#addUrl", function () {
}
});
});
$(document).on("click", "#clearAppUrl", function () {
$("#url").val('');
});
/*上传多张图片*/
$(document).on("click", "#imgsSelectBtn", function () {
Bll.d.close();
... ...