:-: 圖片空間
文件路徑:shop/controllers/Seller/AlbumCtl.php;
初始化:
function initPage() {
_page.$imageList.empty(), _page.$pagination.empty();
$.post(SITE_URL + '?ctl=Seller_Album&met=listImage&typ=json&firstRow=' + _page.firstRow + '&totalRows=' + _page.totalRows, {
page: _page.page,
rows: _page.rows,
param: _page.param,
firstRow: _page.firstRow,
totalRows: _page.totalRows,
}, function (data) {console.info(123);
if (data.status == 200) {
var data = data.data,
itmes = data.items;
if (itmes.length > 0) {
_page.$pagination.parent().show(), loadingPagination(data), loadingImageList(itmes);
} else {
_page.$imageList.append('<div class="no_account"><img src="' + BASE_URL + '/shop/static/default/images/ico_none.png"><p>暫無符合條件的數據記錄</p></div>');
}
} else {
alert('讀取數據失敗');
}
if(_page.firstPreview) {
initCategory();
}
})
}
生成圖片列表:
$imageItem = $('<div class="image-item" data-album_id="' + itmes[i].album_id + '" data-upload_id="' + itmes[i].upload_id + '">' +
'<div class="image-box" style="background-image:url(' + itmes[i].upload_path + ');"></div>' +
'</div>');
$imageTitle = $('<div class="image-title"><label><input name="image-box" type="checkbox"><span>' + itmes[i].upload_name + '</span></label></div>');
$imageOpt = $('<div class="image-opt"></div>');
$rename = $('<a href="javascript:;">改名</a>');
$link = $('<a href="javascript:;" name="imageUrl" data-imageurl="' + itmes[i].upload_path + '">鏈接</a>');
$assignGroup = $('<a href="javascript:;">分組</a>');
$delete = $('<a href="javascript:;">刪除</a>');
改名:
$rename.on('click', function() {
$.dialog({
content: '<div class="ui-popover-inner" style="min-width: auto; width: 180px;">' +
'<div style="margin-bottom: 6px;">修改名稱</div>' +
'<div style="margin-bottom: 6px;">' +
'<input class="js-name-input" type="text" value="' + $(this).parent().prev().find('span').html() + '" placeholder="" style=" width: 166px;">' +
'</div>' +
'</div>',
title: '改名',
width: 250,
cancel: true,
data: { upload_id: $(this).parent().parent().data('upload_id'), upload_name: $(this).parent().prev().find('span').html(), _thisSpan: $(this).parent().prev().find('span') },
ok: function () {
var _thisSpan = this.data._thisSpan,
upload_id = this.data.upload_id,
upload_name = this.DOM.wrap.find('.js-name-input').val();
if (upload_name && upload_name != this.data.upload_name) {
$.post(SITE_URL + '?ctl=Seller_Album&met=edit&typ=json', { upload_id: upload_id, upload_name: upload_name }, function (data) {
if (data.status == 200) {
_thisSpan.html(data.data.upload_name);
}
})
} else {
alert('請輸入名稱');
return false;
}
}
})
});
分組:
$assignGroup.on('click', function () {
var thisImageItem = $(this).parent().parent(),
upload_id = $(this).parent().parent().data('upload_id');
assignGroup({
thisImageItem: thisImageItem,
upload_id: upload_id
});
});
刪除:
$delete.on('click', function () {
var thisImageItem = $(this).parent().parent(),
upload_id = $(this).parent().parent().data('upload_id');
deleteImage({
thisImageItem: thisImageItem,
upload_id: upload_id
});
});
獲取分組數據:
function initCategory() {
$.post(SITE_URL + '?ctl=Seller_Album&met=getAlbumList&typ=json', {}, function (data) {
if (data.status == 200) {
var items = data.data.items;
for (var i = 0; i < items.length; i++) {
_page.$categoryList.append(' <li class="ui-tooltip ' + ( i == 0 ? 'active' : '') + '" data-album-id="' + items[i].album_id + '" data-tooltip-title="' + items[i].album_desc + '" data-tooltip-placement="left">' +
'<span class="category-name">' + items[i].album_desc + '</span>' +
'<span class="category-num">' + items[i].image_num + '</span>' +
'</li>')
}
} else {
alert('服務器響應失敗');
}
if(_page.firstPreview) {
_page.firstPreview = false;
initEvent();
}
})
}
新增分組:
_page.$addAlbum.on('click', function (e) {
$.dialog({
title: '新增分組',
content: '<div class="ui-popover-inner" style="min-width: auto; width: 180px;">' +
'<div style="margin-bottom: 6px;">新增分組</div>' +
'<div style="margin-bottom: 6px;">' +
'<input class="js-name-input" type="text" value="" placeholder="" style=" width: 166px;">' +
'</div>' +
'</div>',
width: 250,
cancel: true,
lock: true,
ok: function () {
var group_name = $(this.DOM.content).find('input').val();
if ( group_name == '' ) {
Public.tips({ content: '請輸入分組名稱', type: 1});
return false;
} else {
$.post(SITE_URL + '?ctl=Seller_Album&met=addAlbum&typ=json', {album_desc: group_name}, function(data) {
if ( data.status == 200 ) {
Public.tips({content: data.msg, type: 3});
var $li = $('<li class="ui-tooltip" data-album-id="' + data.data.album_id + '" data-tooltip-title="' + data.data.album_desc + '" data-tooltip-placement="left">' +
'<span class="category-name">' + data.data.album_desc + '</span>' +
'<span class="category-num">0</span>' +
'</li>');
$li.on('click', function(){
readAlbumImages({
album_id: $(this).data('album-id'),
album_name: $(this).data('tooltip-title')
});
});
_page.$categoryList.append($li);
return false;
} else {
Public.tips({content: data.msg, type: 1});
}
})
}
}
})
});
刪除圖片:
_page.$bulkRemove.on('click', function () {
var flag = $(this).hasClass('c-gray');
if (!flag) {
var upload_id = 0, upload_ids = [], imageItems = [],
album_id = _page.$categoryList.find('.active').data('album-id'),
imageList = $('input[name="image-box"]:checked');
for (var i = 0; i < imageList.length; i++) {
upload_id = $(imageList[i]).parent().parent().parent().data('upload_id');
imageItems.push($(imageList[i]).parent().parent().parent());
upload_ids.push(upload_id);
}
deleteImage({
upload_id: upload_ids,
thisImageItem: imageItems
});
}
})
上傳圖片:
_page.$uploadImage.on('click', function() {
//獲取當前相冊id
var album_id = _page.$categoryList.find('.active').data('album-id');
window.aloneImage = $.dialog({
title: '圖片管理',
content: 'url: ' + SITE_URL + '?ctl=Upload&met=image&typ=e',
data: { callback: getImageList, album_id: album_id },
// height: 585,
width: 900,
max: !1,
min: !1,
cache: !1,
lock: !0
})
});
- 序言
- 系統要求
- 版本更新日志
- 遠豐商城技術對接說明
- 開發指導
- 系統架構
- 負載集群
- 云存儲
- 框架內容
- 基礎
- 開發規范
- 目錄結構
- 架構
- 架構總覽
- 數據庫
- 數據庫連接
- 基本使用
- 緩存
- 配置
- 路由
- 數據字典
- ucenter
- shop
- paycenter
- ucenter_admin
- shop_admin
- paycenter_admin
- shop1
- shop2
- shop3
- 通訊內容
- 商家中心
- 頂部導航欄
- 店鋪信息欄
- 店鋪及商品提示欄
- 交易提示欄
- 銷售情況統計欄
- 集群架構圖
- 單品銷量排行欄
- 店鋪運營推廣欄
- 平臺聯系方式欄
- 訂單物流
- 商品
- 商品列表
- 商品詳情
- 商品發布與編輯
- 分銷商品
- 關聯版式
- 商品規格
- 圖片空間
- 淘寶導入
- 訂單流程
- 交易訂單
- 訂單退款/退貨
- 促銷
- 團購管理
- 加價購
- 限時折扣
- 滿即送
- 代金券管理
- 分銷
- 店鋪
- 店鋪設置
- 自銷產品供應商
- 實體店鋪
- 品牌申請
- 店鋪信息
- 消費者保障服務
- 門店賬號
- 分銷商--產品供應商
- 分銷明細
- 批發市場
- 商家微信公眾號
- 售后服務
- 咨詢管理
- 投訴管理
- 退款管理
- 退貨管理
- 雜項
- 遠程上傳圖片
- 接口(廢棄,參考最外層接口項)
- 接口說明
- 品牌
- 商品規格
- 商品類型
- 商品分類
- 商品
- 訂單
- 商品/店鋪收藏
- 足跡
- 退款及退貨
- 商家店鋪
- 會員
- 入駐協議
- 訂單接口
- 商品接口
- 訂單物流接口
- 商家中心接口
- 促銷接口
- 快遞鳥物流接口
- 代金券接口
- 首頁版塊
- 團購
- 平臺紅包
- 限時折扣接口
- 拼團接口
- wap首頁模板
- JS
- 銀聯支付
- 多語言
- 商品評分
- 圖片加載
- 買家申請退款退貨
- 商家退款退貨
- 平臺退款退貨
- 添加發票
- 提交訂單
- 確認訂單
- 運費銷售區域
- 獲取會員地址
- 充值
- 導出XLS
- 商城系統集成
- 多語言實現
- 三級分銷推廣鏈接發展推廣員
- app.ini.php
- 去分銷
- 版本更新
- 物流支持
- 運營人員建議
- 業務邏輯
- 統計結算
- 客服消息
- 賬號
- 三級分銷
- IM
- 配置
- 平臺帳號
- 活動數據表說明
- 接口
- 數據庫中間鍵
- MyCat的優勢
- 概念說明
- Mycat的下載及安裝
- 參數配置案列
- Mycat讀寫分離
- 基本命令
- 常見錯誤