✨ 我的收藏:接入完成
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
const FavoriteApi = {
|
||||
// 获得商品收藏分页
|
||||
getFavoritePage: (data) => {
|
||||
return request({
|
||||
url: '/app-api/product/favorite/page',
|
||||
method: 'GET',
|
||||
params: data
|
||||
});
|
||||
},
|
||||
// 取消商品收藏
|
||||
deleteFavorite: (spuId) => {
|
||||
return request({
|
||||
url: '/app-api/product/favorite/delete',
|
||||
method: 'DELETE',
|
||||
data: {
|
||||
spuId
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default FavoriteApi;
|
||||
@@ -26,7 +26,7 @@
|
||||
:style="[{ color: priceColor }]"
|
||||
v-if="price && Number(price) > 0"
|
||||
>
|
||||
¥{{ price }}
|
||||
¥{{ fen2yuan(price) }}
|
||||
</view>
|
||||
<view v-if="score && Number(price) > 0">+</view>
|
||||
<view class="price-text ss-flex ss-col-center" v-if="score">
|
||||
@@ -54,6 +54,7 @@
|
||||
<script setup>
|
||||
import sheep from '@/sheep';
|
||||
import { computed } from 'vue';
|
||||
import { fen2yuan } from '@/sheep/hooks/useGoods';
|
||||
/**
|
||||
* 订单卡片
|
||||
*
|
||||
|
||||
@@ -99,4 +99,17 @@ export function handleTree(data, id = 'id', parentId = 'parentId', children = 'c
|
||||
return father[parentId] === rootId;
|
||||
});
|
||||
return treeData !== '' ? treeData : data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置分页对象
|
||||
*
|
||||
* TODO 芋艿:需要处理其它页面
|
||||
*
|
||||
* @param pagination 分页对象
|
||||
*/
|
||||
export function resetPagination(pagination) {
|
||||
pagination.list = [];
|
||||
pagination.total = 0;
|
||||
pagination.pageNo = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user