接入我的足迹
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
const SpuHistoryApi = {
|
||||
// 删除商品浏览记录
|
||||
deleteBrowseHistory: (spuIds) => {
|
||||
return request({
|
||||
url: '/app-api/product/browse-history/delete',
|
||||
method: 'DELETE',
|
||||
data: { spuIds },
|
||||
});
|
||||
},
|
||||
// 清空商品浏览记录
|
||||
cleanBrowseHistory: () => {
|
||||
return request({
|
||||
url: '/app-api/product/browse-history/clean',
|
||||
method: 'DELETE',
|
||||
});
|
||||
},
|
||||
// 获得商品浏览记录分页
|
||||
getBrowseHistoryPage: (data) => {
|
||||
return request({
|
||||
url: '/app-api/product/browse-history/page',
|
||||
method: 'GET',
|
||||
data
|
||||
});
|
||||
},
|
||||
// 获得商品浏览记录数量
|
||||
getBrowseHistoryCount: () => {
|
||||
return request({
|
||||
url: '/app-api/product/browse-history/get-count',
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
};
|
||||
export default SpuHistoryApi;
|
||||
@@ -74,12 +74,12 @@ const VIDEO_SUFFIX_LIST = ['.avi', '.mp4']
|
||||
* @return {{src: string, type: 'video' | 'image' }[]} 转换后的链接列表
|
||||
*/
|
||||
export function formatGoodsSwiper(urlList) {
|
||||
return urlList.filter(url => url).map((url, key) => {
|
||||
return urlList?.filter(url => url).map((url, key) => {
|
||||
const isVideo = VIDEO_SUFFIX_LIST.some(suffix => url.includes(suffix));
|
||||
const type = isVideo ? 'video' : 'image'
|
||||
const src = $url.cdn(url);
|
||||
return { type, src }
|
||||
});
|
||||
}) || [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user