# 图片空间
图片空间
文件路径:shop/controllers/Seller/AlbumCtl.php;
初始化:
```
<pre class="calibre14">```
<span class="token2">function</span> <span class="token3">initPage</span><span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span>
_page<span class="token1">.</span>$imageList<span class="token1">.</span><span class="token3">empty</span><span class="token1">(</span><span class="token1">)</span><span class="token1">,</span> _page<span class="token1">.</span>$pagination<span class="token1">.</span><span class="token3">empty</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span>
$<span class="token1">.</span><span class="token3">post</span><span class="token1">(</span>SITE_URL <span class="token">+</span> <span class="token4">'?ctl=Seller_Album&met=listImage&typ=json&firstRow='</span> <span class="token">+</span> _page<span class="token1">.</span>firstRow <span class="token">+</span> <span class="token4">'&totalRows='</span> <span class="token">+</span> _page<span class="token1">.</span>totalRows<span class="token1">,</span> <span class="token1">{</span>
page<span class="token1">:</span> _page<span class="token1">.</span>page<span class="token1">,</span>
rows<span class="token1">:</span> _page<span class="token1">.</span>rows<span class="token1">,</span>
param<span class="token1">:</span> _page<span class="token1">.</span>param<span class="token1">,</span>
firstRow<span class="token1">:</span> _page<span class="token1">.</span>firstRow<span class="token1">,</span>
totalRows<span class="token1">:</span> _page<span class="token1">.</span>totalRows<span class="token1">,</span>
<span class="token1">}</span><span class="token1">,</span> <span class="token2">function</span> <span class="token1">(</span>data<span class="token1">)</span> <span class="token1">{</span>console<span class="token1">.</span><span class="token3">info</span><span class="token1">(</span><span class="token6">123</span><span class="token1">)</span><span class="token1">;</span>
<span class="token2">if</span> <span class="token1">(</span>data<span class="token1">.</span>status <span class="token">==</span> <span class="token6">200</span><span class="token1">)</span> <span class="token1">{</span>
var data <span class="token">=</span> data<span class="token1">.</span>data<span class="token1">,</span>
itmes <span class="token">=</span> data<span class="token1">.</span>items<span class="token1">;</span>
<span class="token2">if</span> <span class="token1">(</span>itmes<span class="token1">.</span>length <span class="token">></span> <span class="token6">0</span><span class="token1">)</span> <span class="token1">{</span>
_page<span class="token1">.</span>$pagination<span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">show</span><span class="token1">(</span><span class="token1">)</span><span class="token1">,</span> <span class="token3">loadingPagination</span><span class="token1">(</span>data<span class="token1">)</span><span class="token1">,</span> <span class="token3">loadingImageList</span><span class="token1">(</span>itmes<span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span>
_page<span class="token1">.</span>$imageList<span class="token1">.</span><span class="token3">append</span><span class="token1">(</span><span class="token4">'<div class="no_account"><img src="'</span> <span class="token">+</span> BASE_URL <span class="token">+</span> <span class="token4">'/shop/static/default/images/ico_none.png"><p>暂无符合条件的数据记录</p></div>'</span><span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span>
<span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span>
<span class="token3">alert</span><span class="token1">(</span><span class="token4">'读取数据失败'</span><span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span>
<span class="token2">if</span><span class="token1">(</span>_page<span class="token1">.</span>firstPreview<span class="token1">)</span> <span class="token1">{</span>
<span class="token3">initCategory</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span>
<span class="token1">}</span><span class="token1">)</span>
<span class="token1">}</span>
```
```
生成图片列表:
```
<pre class="calibre14">```
$imageItem <span class="token">=</span> $<span class="token1">(</span><span class="token4">'<div class="image-item" data-album_id="'</span> <span class="token">+</span> itmes<span class="token1">[</span>i<span class="token1">]</span><span class="token1">.</span>album_id <span class="token">+</span> <span class="token4">'" data-upload_id="'</span> <span class="token">+</span> itmes<span class="token1">[</span>i<span class="token1">]</span><span class="token1">.</span>upload_id <span class="token">+</span> <span class="token4">'">'</span> <span class="token">+</span>
<span class="token4">'<div class="image-box" style="background-image:url('</span> <span class="token">+</span> itmes<span class="token1">[</span>i<span class="token1">]</span><span class="token1">.</span>upload_path <span class="token">+</span> <span class="token4">');"></div>'</span> <span class="token">+</span>
<span class="token4">'</div>'</span><span class="token1">)</span><span class="token1">;</span>
$imageTitle <span class="token">=</span> $<span class="token1">(</span><span class="token4">'<div class="image-title"><label><input name="image-box" type="checkbox"><span>'</span> <span class="token">+</span> itmes<span class="token1">[</span>i<span class="token1">]</span><span class="token1">.</span>upload_name <span class="token">+</span> <span class="token4">'</span></label></div>'</span><span class="token1">)</span><span class="token1">;</span>
$imageOpt <span class="token">=</span> $<span class="token1">(</span><span class="token4">'<div class="image-opt"></div>'</span><span class="token1">)</span><span class="token1">;</span>
$rename <span class="token">=</span> $<span class="token1">(</span><span class="token4">'<a href="javascript:;">改名</a>'</span><span class="token1">)</span><span class="token1">;</span>
$link <span class="token">=</span> $<span class="token1">(</span><span class="token4">'<a href="javascript:;" name="imageUrl" data-imageurl="'</span> <span class="token">+</span> itmes<span class="token1">[</span>i<span class="token1">]</span><span class="token1">.</span>upload_path <span class="token">+</span> <span class="token4">'">链接</a>'</span><span class="token1">)</span><span class="token1">;</span>
$assignGroup <span class="token">=</span> $<span class="token1">(</span><span class="token4">'<a href="javascript:;">分组</a>'</span><span class="token1">)</span><span class="token1">;</span>
$delete <span class="token">=</span> $<span class="token1">(</span><span class="token4">'<a href="javascript:;">删除</a>'</span><span class="token1">)</span><span class="token1">;</span>
```
```
改名:
```
<pre class="calibre14">```
$rename<span class="token1">.</span><span class="token3">on</span><span class="token1">(</span><span class="token4">'click'</span><span class="token1">,</span> <span class="token2">function</span><span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span>
$<span class="token1">.</span><span class="token3">dialog</span><span class="token1">(</span><span class="token1">{</span>
content<span class="token1">:</span> <span class="token4">'<div class="ui-popover-inner" style="min-width: auto; width: 180px;">'</span> <span class="token">+</span>
<span class="token4">'<div style="margin-bottom: 6px;">修改名称</div>'</span> <span class="token">+</span>
<span class="token4">'<div style="margin-bottom: 6px;">'</span> <span class="token">+</span>
<span class="token4">'<input class="js-name-input" type="text" value="'</span> <span class="token">+</span> $<span class="token1">(</span>this<span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">prev</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">find</span><span class="token1">(</span><span class="token4">'span'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">html</span><span class="token1">(</span><span class="token1">)</span> <span class="token">+</span> <span class="token4">'" placeholder="" style=" width: 166px;">'</span> <span class="token">+</span>
<span class="token4">'</div>'</span> <span class="token">+</span>
<span class="token4">'</div>'</span><span class="token1">,</span>
title<span class="token1">:</span> <span class="token4">'改名'</span><span class="token1">,</span>
width<span class="token1">:</span> <span class="token6">250</span><span class="token1">,</span>
cancel<span class="token1">:</span> <span class="token6">true</span><span class="token1">,</span>
data<span class="token1">:</span> <span class="token1">{</span> upload_id<span class="token1">:</span> $<span class="token1">(</span>this<span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">data</span><span class="token1">(</span><span class="token4">'upload_id'</span><span class="token1">)</span><span class="token1">,</span> upload_name<span class="token1">:</span> $<span class="token1">(</span>this<span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">prev</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">find</span><span class="token1">(</span><span class="token4">'span'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">html</span><span class="token1">(</span><span class="token1">)</span><span class="token1">,</span> _thisSpan<span class="token1">:</span> $<span class="token1">(</span>this<span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">prev</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">find</span><span class="token1">(</span><span class="token4">'span'</span><span class="token1">)</span> <span class="token1">}</span><span class="token1">,</span>
ok<span class="token1">:</span> <span class="token2">function</span> <span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span>
var _thisSpan <span class="token">=</span> this<span class="token1">.</span>data<span class="token1">.</span>_thisSpan<span class="token1">,</span>
upload_id <span class="token">=</span> this<span class="token1">.</span>data<span class="token1">.</span>upload_id<span class="token1">,</span>
upload_name <span class="token">=</span> this<span class="token1">.</span>DOM<span class="token1">.</span>wrap<span class="token1">.</span><span class="token3">find</span><span class="token1">(</span><span class="token4">'.js-name-input'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">val</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span>
<span class="token2">if</span> <span class="token1">(</span>upload_name <span class="token">&&</span> upload_name <span class="token">!=</span> this<span class="token1">.</span>data<span class="token1">.</span>upload_name<span class="token1">)</span> <span class="token1">{</span>
$<span class="token1">.</span><span class="token3">post</span><span class="token1">(</span>SITE_URL <span class="token">+</span> <span class="token4">'?ctl=Seller_Album&met=edit&typ=json'</span><span class="token1">,</span> <span class="token1">{</span> upload_id<span class="token1">:</span> upload_id<span class="token1">,</span> upload_name<span class="token1">:</span> upload_name <span class="token1">}</span><span class="token1">,</span> <span class="token2">function</span> <span class="token1">(</span>data<span class="token1">)</span> <span class="token1">{</span>
<span class="token2">if</span> <span class="token1">(</span>data<span class="token1">.</span>status <span class="token">==</span> <span class="token6">200</span><span class="token1">)</span> <span class="token1">{</span>
_thisSpan<span class="token1">.</span><span class="token3">html</span><span class="token1">(</span>data<span class="token1">.</span>data<span class="token1">.</span>upload_name<span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span>
<span class="token1">}</span><span class="token1">)</span>
<span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span>
<span class="token3">alert</span><span class="token1">(</span><span class="token4">'请输入名称'</span><span class="token1">)</span><span class="token1">;</span>
<span class="token2">return</span> <span class="token6">false</span><span class="token1">;</span>
<span class="token1">}</span>
<span class="token1">}</span>
<span class="token1">}</span><span class="token1">)</span>
<span class="token1">}</span><span class="token1">)</span><span class="token1">;</span>
```
```
分组:
```
<pre class="calibre14">```
$assignGroup<span class="token1">.</span><span class="token3">on</span><span class="token1">(</span><span class="token4">'click'</span><span class="token1">,</span> <span class="token2">function</span> <span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span>
var thisImageItem <span class="token">=</span> $<span class="token1">(</span>this<span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">,</span>
upload_id <span class="token">=</span> $<span class="token1">(</span>this<span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">data</span><span class="token1">(</span><span class="token4">'upload_id'</span><span class="token1">)</span><span class="token1">;</span>
<span class="token3">assignGroup</span><span class="token1">(</span><span class="token1">{</span>
thisImageItem<span class="token1">:</span> thisImageItem<span class="token1">,</span>
upload_id<span class="token1">:</span> upload_id
<span class="token1">}</span><span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span><span class="token1">)</span><span class="token1">;</span>
```
```
删除:
```
<pre class="calibre14">```
$delete<span class="token1">.</span><span class="token3">on</span><span class="token1">(</span><span class="token4">'click'</span><span class="token1">,</span> <span class="token2">function</span> <span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span>
var thisImageItem <span class="token">=</span> $<span class="token1">(</span>this<span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">,</span>
upload_id <span class="token">=</span> $<span class="token1">(</span>this<span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">data</span><span class="token1">(</span><span class="token4">'upload_id'</span><span class="token1">)</span><span class="token1">;</span>
<span class="token3">deleteImage</span><span class="token1">(</span><span class="token1">{</span>
thisImageItem<span class="token1">:</span> thisImageItem<span class="token1">,</span>
upload_id<span class="token1">:</span> upload_id
<span class="token1">}</span><span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span><span class="token1">)</span><span class="token1">;</span>
```
```
获取分组数据:
```
<pre class="calibre14">```
<span class="token2">function</span> <span class="token3">initCategory</span><span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span>
$<span class="token1">.</span><span class="token3">post</span><span class="token1">(</span>SITE_URL <span class="token">+</span> <span class="token4">'?ctl=Seller_Album&met=getAlbumList&typ=json'</span><span class="token1">,</span> <span class="token1">{</span><span class="token1">}</span><span class="token1">,</span> <span class="token2">function</span> <span class="token1">(</span>data<span class="token1">)</span> <span class="token1">{</span>
<span class="token2">if</span> <span class="token1">(</span>data<span class="token1">.</span>status <span class="token">==</span> <span class="token6">200</span><span class="token1">)</span> <span class="token1">{</span>
var items <span class="token">=</span> data<span class="token1">.</span>data<span class="token1">.</span>items<span class="token1">;</span>
<span class="token2">for</span> <span class="token1">(</span>var i <span class="token">=</span> <span class="token6">0</span><span class="token1">;</span> i <span class="token"><</span> items<span class="token1">.</span>length<span class="token1">;</span> i<span class="token">++</span><span class="token1">)</span> <span class="token1">{</span>
_page<span class="token1">.</span>$categoryList<span class="token1">.</span><span class="token3">append</span><span class="token1">(</span><span class="token4">' <li class="ui-tooltip '</span> <span class="token">+</span> <span class="token1">(</span> i <span class="token">==</span> <span class="token6">0</span> <span class="token">?</span> <span class="token4">'active'</span> <span class="token1">:</span> <span class="token4">''</span><span class="token1">)</span> <span class="token">+</span> <span class="token4">'" data-album-id="'</span> <span class="token">+</span> items<span class="token1">[</span>i<span class="token1">]</span><span class="token1">.</span>album_id <span class="token">+</span> <span class="token4">'" data-tooltip-title="'</span> <span class="token">+</span> items<span class="token1">[</span>i<span class="token1">]</span><span class="token1">.</span>album_desc <span class="token">+</span> <span class="token4">'" data-tooltip-placement="left">'</span> <span class="token">+</span>
<span class="token4">'<span class="category-name">'</span> <span class="token">+</span> items<span class="token1">[</span>i<span class="token1">]</span><span class="token1">.</span>album_desc <span class="token">+</span> <span class="token4">'</span>'</span> <span class="token">+</span>
<span class="token4">'<span class="category-num">'</span> <span class="token">+</span> items<span class="token1">[</span>i<span class="token1">]</span><span class="token1">.</span>image_num <span class="token">+</span> <span class="token4">'</span>'</span> <span class="token">+</span>
<span class="token4">'</li>'</span><span class="token1">)</span>
<span class="token1">}</span>
<span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span>
<span class="token3">alert</span><span class="token1">(</span><span class="token4">'服务器响应失败'</span><span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span>
<span class="token2">if</span><span class="token1">(</span>_page<span class="token1">.</span>firstPreview<span class="token1">)</span> <span class="token1">{</span>
_page<span class="token1">.</span>firstPreview <span class="token">=</span> <span class="token6">false</span><span class="token1">;</span>
<span class="token3">initEvent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span>
<span class="token1">}</span><span class="token1">)</span>
<span class="token1">}</span>
```
```
新增分组:
```
<pre class="calibre14">```
_page<span class="token1">.</span>$addAlbum<span class="token1">.</span><span class="token3">on</span><span class="token1">(</span><span class="token4">'click'</span><span class="token1">,</span> <span class="token2">function</span> <span class="token1">(</span>e<span class="token1">)</span> <span class="token1">{</span>
$<span class="token1">.</span><span class="token3">dialog</span><span class="token1">(</span><span class="token1">{</span>
title<span class="token1">:</span> <span class="token4">'新增分组'</span><span class="token1">,</span>
content<span class="token1">:</span> <span class="token4">'<div class="ui-popover-inner" style="min-width: auto; width: 180px;">'</span> <span class="token">+</span>
<span class="token4">'<div style="margin-bottom: 6px;">新增分组</div>'</span> <span class="token">+</span>
<span class="token4">'<div style="margin-bottom: 6px;">'</span> <span class="token">+</span>
<span class="token4">'<input class="js-name-input" type="text" value="" placeholder="" style=" width: 166px;">'</span> <span class="token">+</span>
<span class="token4">'</div>'</span> <span class="token">+</span>
<span class="token4">'</div>'</span><span class="token1">,</span>
width<span class="token1">:</span> <span class="token6">250</span><span class="token1">,</span>
cancel<span class="token1">:</span> <span class="token6">true</span><span class="token1">,</span>
lock<span class="token1">:</span> <span class="token6">true</span><span class="token1">,</span>
ok<span class="token1">:</span> <span class="token2">function</span> <span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span>
var group_name <span class="token">=</span> $<span class="token1">(</span>this<span class="token1">.</span>DOM<span class="token1">.</span>content<span class="token1">)</span><span class="token1">.</span><span class="token3">find</span><span class="token1">(</span><span class="token4">'input'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">val</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span>
<span class="token2">if</span> <span class="token1">(</span> group_name <span class="token">==</span> <span class="token4">''</span> <span class="token1">)</span> <span class="token1">{</span>
Public<span class="token1">.</span><span class="token3">tips</span><span class="token1">(</span><span class="token1">{</span> content<span class="token1">:</span> <span class="token4">'请输入分组名称'</span><span class="token1">,</span> type<span class="token1">:</span> <span class="token6">1</span><span class="token1">}</span><span class="token1">)</span><span class="token1">;</span>
<span class="token2">return</span> <span class="token6">false</span><span class="token1">;</span>
<span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span>
$<span class="token1">.</span><span class="token3">post</span><span class="token1">(</span>SITE_URL <span class="token">+</span> <span class="token4">'?ctl=Seller_Album&met=addAlbum&typ=json'</span><span class="token1">,</span> <span class="token1">{</span>album_desc<span class="token1">:</span> group_name<span class="token1">}</span><span class="token1">,</span> <span class="token2">function</span><span class="token1">(</span>data<span class="token1">)</span> <span class="token1">{</span>
<span class="token2">if</span> <span class="token1">(</span> data<span class="token1">.</span>status <span class="token">==</span> <span class="token6">200</span> <span class="token1">)</span> <span class="token1">{</span>
Public<span class="token1">.</span><span class="token3">tips</span><span class="token1">(</span><span class="token1">{</span>content<span class="token1">:</span> data<span class="token1">.</span>msg<span class="token1">,</span> type<span class="token1">:</span> <span class="token6">3</span><span class="token1">}</span><span class="token1">)</span><span class="token1">;</span>
var $li <span class="token">=</span> $<span class="token1">(</span><span class="token4">'<li class="ui-tooltip" data-album-id="'</span> <span class="token">+</span> data<span class="token1">.</span>data<span class="token1">.</span>album_id <span class="token">+</span> <span class="token4">'" data-tooltip-title="'</span> <span class="token">+</span> data<span class="token1">.</span>data<span class="token1">.</span>album_desc <span class="token">+</span> <span class="token4">'" data-tooltip-placement="left">'</span> <span class="token">+</span>
<span class="token4">'<span class="category-name">'</span> <span class="token">+</span> data<span class="token1">.</span>data<span class="token1">.</span>album_desc <span class="token">+</span> <span class="token4">'</span>'</span> <span class="token">+</span>
<span class="token4">'<span class="category-num">0</span>'</span> <span class="token">+</span>
<span class="token4">'</li>'</span><span class="token1">)</span><span class="token1">;</span>
$li<span class="token1">.</span><span class="token3">on</span><span class="token1">(</span><span class="token4">'click'</span><span class="token1">,</span> <span class="token2">function</span><span class="token1">(</span><span class="token1">)</span><span class="token1">{</span>
<span class="token3">readAlbumImages</span><span class="token1">(</span><span class="token1">{</span>
album_id<span class="token1">:</span> $<span class="token1">(</span>this<span class="token1">)</span><span class="token1">.</span><span class="token3">data</span><span class="token1">(</span><span class="token4">'album-id'</span><span class="token1">)</span><span class="token1">,</span>
album_name<span class="token1">:</span> $<span class="token1">(</span>this<span class="token1">)</span><span class="token1">.</span><span class="token3">data</span><span class="token1">(</span><span class="token4">'tooltip-title'</span><span class="token1">)</span>
<span class="token1">}</span><span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span><span class="token1">)</span><span class="token1">;</span>
_page<span class="token1">.</span>$categoryList<span class="token1">.</span><span class="token3">append</span><span class="token1">(</span>$li<span class="token1">)</span><span class="token1">;</span>
<span class="token2">return</span> <span class="token6">false</span><span class="token1">;</span>
<span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span>
Public<span class="token1">.</span><span class="token3">tips</span><span class="token1">(</span><span class="token1">{</span>content<span class="token1">:</span> data<span class="token1">.</span>msg<span class="token1">,</span> type<span class="token1">:</span> <span class="token6">1</span><span class="token1">}</span><span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span>
<span class="token1">}</span><span class="token1">)</span>
<span class="token1">}</span>
<span class="token1">}</span>
<span class="token1">}</span><span class="token1">)</span>
<span class="token1">}</span><span class="token1">)</span><span class="token1">;</span>
```
```
删除图片:
```
<pre class="calibre14">```
_page<span class="token1">.</span>$bulkRemove<span class="token1">.</span><span class="token3">on</span><span class="token1">(</span><span class="token4">'click'</span><span class="token1">,</span> <span class="token2">function</span> <span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span>
var flag <span class="token">=</span> $<span class="token1">(</span>this<span class="token1">)</span><span class="token1">.</span><span class="token3">hasClass</span><span class="token1">(</span><span class="token4">'c-gray'</span><span class="token1">)</span><span class="token1">;</span>
<span class="token2">if</span> <span class="token1">(</span><span class="token">!</span>flag<span class="token1">)</span> <span class="token1">{</span>
var upload_id <span class="token">=</span> <span class="token6">0</span><span class="token1">,</span> upload_ids <span class="token">=</span> <span class="token1">[</span><span class="token1">]</span><span class="token1">,</span> imageItems <span class="token">=</span> <span class="token1">[</span><span class="token1">]</span><span class="token1">,</span>
album_id <span class="token">=</span> _page<span class="token1">.</span>$categoryList<span class="token1">.</span><span class="token3">find</span><span class="token1">(</span><span class="token4">'.active'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">data</span><span class="token1">(</span><span class="token4">'album-id'</span><span class="token1">)</span><span class="token1">,</span>
imageList <span class="token">=</span> $<span class="token1">(</span><span class="token4">'input[name="image-box"]:checked'</span><span class="token1">)</span><span class="token1">;</span>
<span class="token2">for</span> <span class="token1">(</span>var i <span class="token">=</span> <span class="token6">0</span><span class="token1">;</span> i <span class="token"><</span> imageList<span class="token1">.</span>length<span class="token1">;</span> i<span class="token">++</span><span class="token1">)</span> <span class="token1">{</span>
upload_id <span class="token">=</span> $<span class="token1">(</span>imageList<span class="token1">[</span>i<span class="token1">]</span><span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">data</span><span class="token1">(</span><span class="token4">'upload_id'</span><span class="token1">)</span><span class="token1">;</span>
imageItems<span class="token1">.</span><span class="token3">push</span><span class="token1">(</span>$<span class="token1">(</span>imageList<span class="token1">[</span>i<span class="token1">]</span><span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">.</span><span class="token3">parent</span><span class="token1">(</span><span class="token1">)</span><span class="token1">)</span><span class="token1">;</span>
upload_ids<span class="token1">.</span><span class="token3">push</span><span class="token1">(</span>upload_id<span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span>
<span class="token3">deleteImage</span><span class="token1">(</span><span class="token1">{</span>
upload_id<span class="token1">:</span> upload_ids<span class="token1">,</span>
thisImageItem<span class="token1">:</span> imageItems
<span class="token1">}</span><span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span>
<span class="token1">}</span><span class="token1">)</span>
```
```
上传图片:
```
<pre class="calibre15">```
_page<span class="token1">.</span>$uploadImage<span class="token1">.</span><span class="token3">on</span><span class="token1">(</span><span class="token4">'click'</span><span class="token1">,</span> <span class="token2">function</span><span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span>
<span class="token5">//获取当前相册id</span>
var album_id <span class="token">=</span> _page<span class="token1">.</span>$categoryList<span class="token1">.</span><span class="token3">find</span><span class="token1">(</span><span class="token4">'.active'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">data</span><span class="token1">(</span><span class="token4">'album-id'</span><span class="token1">)</span><span class="token1">;</span>
window<span class="token1">.</span>aloneImage <span class="token">=</span> $<span class="token1">.</span><span class="token3">dialog</span><span class="token1">(</span><span class="token1">{</span>
title<span class="token1">:</span> <span class="token4">'图片管理'</span><span class="token1">,</span>
content<span class="token1">:</span> <span class="token4">'url: '</span> <span class="token">+</span> SITE_URL <span class="token">+</span> <span class="token4">'?ctl=Upload&met=image&typ=e'</span><span class="token1">,</span>
data<span class="token1">:</span> <span class="token1">{</span> callback<span class="token1">:</span> getImageList<span class="token1">,</span> album_id<span class="token1">:</span> album_id <span class="token1">}</span><span class="token1">,</span>
<span class="token5">// height: 585,</span>
width<span class="token1">:</span> <span class="token6">900</span><span class="token1">,</span>
max<span class="token1">:</span> <span class="token">!</span><span class="token6">1</span><span class="token1">,</span>
min<span class="token1">:</span> <span class="token">!</span><span class="token6">1</span><span class="token1">,</span>
cache<span class="token1">:</span> <span class="token">!</span><span class="token6">1</span><span class="token1">,</span>
lock<span class="token1">:</span> <span class="token">!</span><span class="token6">0</span>
<span class="token1">}</span><span class="token1">)</span>
<span class="token1">}</span><span class="token1">)</span><span class="token1">;</span>
```
```
- 序言
- 系统要求
- 版本更新日志
- 远丰商城技术对接说明
- 开发指导
- 框架内容
- 基础
- 开发规范
- 目录结构
- 架构
- 架构总览
- 数据库
- 数据库连接
- 基本使用
- 缓存
- 配置
- 路由
- 数据字典
- ucenter
- shop
- paycenter
- ucenter_admin
- shop_admin
- paycenter_admin
- 通讯内容
- 商家中心
- 顶部导航栏
- 店铺信息栏
- 店铺及商品提示栏
- 交易提示栏
- 销售情况统计栏
- 单品销量排行栏
- 店铺运营推广栏
- 平台联系方式栏
- 订单物流
- 商品
- 商品列表
- 商品详情
- 商品发布与编辑
- 分销商品
- 关联版式
- 商品规格
- 图片空间
- 淘宝导入
- 订单流程
- 交易订单
- 订单退款/退货
- 促销
- 团购管理
- 加价购
- 限时折扣
- 满即送
- 代金券管理
- 分销
- 店铺
- 店铺设置
- 自销产品供应商
- 实体店铺
- 品牌申请
- 店铺信息
- 消费者保障服务
- 门店账号
- 分销商--产品供应商
- 分销明细
- 批发市场
- 售后服务
- 咨询管理
- 投诉管理
- 退款管理
- 退货管理
- 云方案架构
- 负载集群
- 云存储
- 接口
- Api接口说明
- 品牌
- 商品规格
- 商品类型
- 商品分类
- 商品
- 订单
- 商品/店铺收藏
- 足迹
- 退款及退货
- 商家店铺
- 会员
- 入驻协议
- 订单接口
- 商品接口
- 订单物流接口
- 商家中心接口
- 促销接口
- 快递鸟物流接口
- 代金券接口
- 首页版块
- 团购
- 平台红包
- 限时折扣接口
- 拼团接口
- wap首页模板
- 杂项
- 远程上传图片
- JS
- 银联支付
- 多语言
- 商品评分
- 图片加载
- 买家申请退款退货
- 商家退款退货
- 平台退款退货
- 添加发票
- 提交订单
- 确认订单
- 运费销售区域
- 获取会员地址
- 充值
- 导出XLS
- 商城系统集成
- 多语言实现
- 三级分销推广链接发展推广员
- app.ini.php
- 去分销
- 版本更新
- 物流支持
- 运营人员建议
- 业务逻辑
- 统计结算
- 客服消息
- 账号
- 三级分销
- IM
- 配置
- 平台帐号
- 活动数据表说明