主题 : 图片集的问题
级别: 举人
UID: 77615
积分:121 加为好友
威望: 20 精华: 0
主题:21 回复:141
注册时间:2015-07-07
在线时长:0
1#   发表于:2015-08-31 16:05:35  IP:114.150.*.*
修改添加的图片集代码是不一样的,如果修改是传来的*类为null  var picIndex = ${content.pictures?size} ;报错的。换成添加的图片集代码则,之前如果有添加过的图片是看不到的,怎么办呢
级别: 版主
UID: 70293
积分:78391 加为好友
威望: 1 精华: 0
主题:7 回复:68397
注册时间:2014-12-03
在线时长:0
2#   发表于:2015-08-31 16:06:21  IP:111.18.*.*
之前添加的图片现在看不到?
1
级别: 举人
UID: 77615
积分:121 加为好友
威望: 20 精华: 0
主题:21 回复:141
注册时间:2015-07-07
在线时长:0
3#   发表于:2015-08-31 16:09:23  IP:114.150.*.*
如果用添加图片集的代码, 不是修改图片集的代码~~~
 <tr>
                    <td width="13%" height="30" align="right" bgcolor="#fafafa">图片集:</td>
                    <td bgcolor="#FFFFFF">
                    <div>
<span id="spanButtonPlaceHolder"></span>
<span style="display: none;"><input class="cancel" id="btnCancel" type="button" value="取消" onclick="swfu.cancelQueue();" disabled="disabled" /></span>
<div id="fsUploadProgress" style="display: none;"></div>
</div>
<div id="picBefore" style="clear:both"></div>
<div id="picTable" style="display:none;">
<table id="picTable{0}" border="0" style="float:left;">
<tr>
<td>
<div><input type="text" id="uploadImgPath{0}" name="picPaths" style="width:160px"/> <a href="javascript:void(0);" onclick="$('#picTable{0}').remove();" class="pn-opt">删除</a></div>
<div>
<span id="ufc{0}" style="position:relative">
<input type='text' id='uploadFileText{0}' size="10"/>  
<input onchange="$('#uploadFileText{0}').val(this.value)" size="10" type="file" id="uploadFile{0}"/>
</span>
<input type="button" value="上传" onclick="upload({0});" />
</div>
<div><textarea style="width:200px;height:60px;" name="picDescs" maxlength="255"></textarea></div>
</td>
<td><img id="preImg{0}" alt="预览" noResize="true" style="width:110px;height:110px;background-color:#ccc;border:1px solid #333"/></td>
</tr>
</table>
</div>
<script type="text/javascript">
var picIndex = 1;
var picTpl = $.format($("#picTable").html());
function addPicLine() {
$('#picBefore').before(picTpl(picIndex++));
}
</script>
                    </td>
               </tr>
级别: 举人
UID: 77615
积分:121 加为好友
威望: 20 精华: 0
主题:21 回复:141
注册时间:2015-07-07
在线时长:0
4#   发表于:2015-08-31 16:10:00  IP:114.150.*.*
var picIndex = 100 ;  我把这个改成100  行不
级别: 版主
UID: 70293
积分:78391 加为好友
威望: 1 精华: 0
主题:7 回复:68397
注册时间:2014-12-03
在线时长:0
5#   发表于:2015-08-31 16:11:26  IP:111.18.*.*
这个你要去看内容添加页里是怎么获取原来的内容了,修改页是edit.html,前台没有例子
1
级别: 举人
UID: 77615
积分:121 加为好友
威望: 20 精华: 0
主题:21 回复:141
注册时间:2015-07-07
在线时长:0
6#   发表于:2015-08-31 16:12:27  IP:114.150.*.*
我现在是这样写的
<tr>
                 <td height="25" align="right" bgcolor="#f6fbff">图片集:</td>
                 <td bgcolor="#FFFFFF">
<div>
<span id="spanButtonPlaceHolder"></span>
<span style="display: none;"><input class="cancel" id="btnCancel" type="button" value=取消" onclick="swfu.cancelQueue();" disabled="disabled" /></span>
<div id="fsUploadProgress" style="display: none;"></div>
</div>
[#if c??]
[#if c.pictures ??]
[#list c.pictures as p]
<table id="picTable${p_index+3}" border="0" style="float:left;">
<tr>
<td>
<div><input type="text" id="uploadImgPath${p_index+3}" name="picPaths" value="${p.imgPath}" style="width:170px"/> <a href="javascript:void(0);" onclick="$('#picTable${p_index+3}').remove();" class="pn-opt">删除</a></div>
<div>
<span id="ufc${p_index+3}" style="position:relative">
<input type='text' id='uploadFileText${p_index+3}' size="10"/>  
<input onchange="$('#uploadFileText${p_index+3}').val(this.value)" size="10" type="file" id="uploadFile${p_index+3}" class="file-button"/>
</span> 
<input type="button" value="上传" onclick="upload(${p_index+3});" class="upload-button"/>
</div>
<div><textarea style="width:200px;height:60px;" name="picDescs" maxlength="255">${p.description!}</textarea></div>
</td>
<td><img id="preImg${p_index+3}" src="${p.imgPath!}" alt="预览" noResize="true" style="width:110px;height:110px;background-color:#ccc;border:1px solid #333"/></td>
</tr>
</table>
[/#list]
[/#if]
[/#if]
<div id="picBefore" style="clear:both"></div>
<div id="picTable" style="display:none;">
<table id="picTable{0}" border="0" style="float:left;">
<tr>
<td>
<div><input type="text" id="uploadImgPath{0}" name="picPaths" style="width:160px"/> <a href="javascript:void(0);" onclick="$('#picTable{0}').remove();" class="pn-opt">删除</a></div>
<div>
<span id="ufc{0}" style="position:relative">
<input type='text' id='uploadFileText{0}' size="10"/>  
<input onchange="$('#uploadFileText{0}').val(this.value)" size="10" type="file" id="uploadFile{0}" class="file-button"/>
</span> 
<input type="button" value="上传" onclick="upload({0});" />
</div>
<div><textarea style="width:200px;height:60px;" name="picDescs" maxlength="255"></textarea></div>
</td>
<td><img id="preImg{0}" alt="预览" noResize="true" style="width:110px;height:110px;background-color:#ccc;border:1px solid #333"/>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
var picIndex = 100 ;
var picTpl = $.format($("#picTable").html());
function addPicLine() {
$('#picBefore').before(picTpl(picIndex++));
}
</script>
                 </td>
               </tr>
级别: 举人
UID: 77615
积分:121 加为好友
威望: 20 精华: 0
主题:21 回复:141
注册时间:2015-07-07
在线时长:0
7#   发表于:2015-08-31 16:13:22  IP:114.150.*.*
[#if c??] 
[#if c.pictures ??] 
[#list c.pictures as p] 
判断了一下是否存在,
var picIndex = 100 ;  把这个${c.pictures?size}改成了100····
级别: 举人
UID: 77615
积分:121 加为好友
威望: 20 精华: 0
主题:21 回复:141
注册时间:2015-07-07
在线时长:0
8#   发表于:2015-08-31 16:14:06  IP:114.150.*.*
${c.pictures?size}因为我实在不是的在js里怎么判断c这个对象是否为空
级别: 版主
UID: 70293
积分:78391 加为好友
威望: 1 精华: 0
主题:7 回复:68397
注册时间:2014-12-03
在线时长:0
9#   发表于:2015-08-31 16:16:00  IP:111.18.*.*
抱歉,这个请自己研究
1
1 共1页