移动端店铺收藏问题

master
chc 2023-05-15 14:34:54 +08:00
parent 5e5d5b904b
commit 6717721725
2 changed files with 19 additions and 2 deletions

View File

@ -202,6 +202,22 @@ export function getGoodsCollection(params, type) {
}); });
} }
/**
* 获取商品收藏
* @param params
* @returns {AxiosPromise}
*/
export function getStoreCollection(params, type) {
return http.request({
url: `/member/storeCollection/${type}`,
method: Method.GET,
needToken: true,
loading: false,
message: false,
params,
});
}
/** /**
* 收藏商品 * 收藏商品
* @returns {AxiosPromise} * @returns {AxiosPromise}

View File

@ -64,6 +64,7 @@
<script> <script>
import { import {
getGoodsCollection, getGoodsCollection,
getStoreCollection,
deleteGoodsCollection, deleteGoodsCollection,
deleteStoreCollection, deleteStoreCollection,
} from "@/api/members.js"; } from "@/api/members.js";
@ -154,7 +155,7 @@
* 点击店铺左侧取消收藏 * 点击店铺左侧取消收藏
*/ */
clickStoreSwiperAction(val) { clickStoreSwiperAction(val) {
deleteStoreCollection(val.storeId).then((res) => { deleteStoreCollection(val.id).then((res) => {
if (res.statusCode == 200) { if (res.statusCode == 200) {
this.storeList = []; this.storeList = [];
this.getStoreList(); this.getStoreList();
@ -224,7 +225,7 @@
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
}); });
getGoodsCollection(this.navList[1].params, "store").then((res) => { getStoreCollection(this.navList[1].params, "STORE").then((res) => {
if (this.$store.state.isShowToast){ uni.hideLoading() }; if (this.$store.state.isShowToast){ uni.hideLoading() };
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
if (res.data.success) { if (res.data.success) {