增加预览
This commit is contained in:
+14
-1
@@ -177,7 +177,7 @@ namespace COMCMS.Common
|
||||
{
|
||||
if (str.Length != 11)
|
||||
return false;
|
||||
return Regex.IsMatch(str, @"^1[3|4|5|7|8][0-9]\d{4,8}$");
|
||||
return Regex.IsMatch(str, @"^1[3|4|5|7|8|9][0-9]\d{4,8}$");
|
||||
}
|
||||
/// <summary>
|
||||
/// 是否为ip
|
||||
@@ -308,6 +308,19 @@ namespace COMCMS.Common
|
||||
#endregion
|
||||
|
||||
#region 获取部分
|
||||
|
||||
/// <summary>
|
||||
/// 获取配置
|
||||
/// </summary>
|
||||
/// <param name="path">路径,如:SystemSetting:COMCMSPrefixKey</param>
|
||||
/// <returns></returns>
|
||||
public static string GetSetting(string path)
|
||||
{
|
||||
string value = Configuration[path];
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回字符串真实长度, 1个汉字长度为2
|
||||
/// </summary>
|
||||
|
||||
@@ -110,6 +110,9 @@
|
||||
<label class="col-sm-3 control-label">文章图片:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn my-preview">
|
||||
<button type="button" class="btn btn-primary"><i class="fa fa-search-plus"></i></button>
|
||||
</span>
|
||||
<input id="Pic" name="Pic" maxlength="250" type="text" class="form-control upload-path" placeholder="请选择或上传一个图片" value="">
|
||||
<span class="input-group-addon my-upload-span upload-img"></span>
|
||||
</div>
|
||||
|
||||
@@ -109,6 +109,9 @@
|
||||
<label class="col-sm-3 control-label">文章图片:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn my-preview">
|
||||
<button type="button" class="btn btn-primary"><i class="fa fa-search-plus"></i></button>
|
||||
</span>
|
||||
<input id="Pic" name="Pic" maxlength="250" type="text" class="form-control upload-path" placeholder="请选择或上传一个图片" value="@Model.Pic">
|
||||
<span class="input-group-addon my-upload-span upload-img"></span>
|
||||
</div>
|
||||
|
||||
@@ -81,6 +81,30 @@
|
||||
checkboxClass: 'icheckbox_square-green',
|
||||
radioClass: 'iradio_square-green',
|
||||
});
|
||||
$(".my-preview").click(function () {
|
||||
var url = $(this).siblings(".upload-path").val();
|
||||
if (url) {
|
||||
var data = {
|
||||
"status": 1,
|
||||
"msg": "",
|
||||
"title": "预览图片",
|
||||
"id": 1,
|
||||
"start": 0,
|
||||
"data": [
|
||||
{
|
||||
"alt": "",
|
||||
"pid": 1,
|
||||
"src": url,
|
||||
"thumb": ""
|
||||
}
|
||||
]
|
||||
};
|
||||
layer.photos({
|
||||
photos: data,
|
||||
anim: 0
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
$("input").each(function (index, item) {
|
||||
if ($(this).attr("placeholder") && $(this).attr("placeholder") != "") {
|
||||
|
||||
Reference in New Issue
Block a user