Skip to content

Commit

Permalink
fix:价格-我的关注 feedback/2446
Browse files Browse the repository at this point in the history
  • Loading branch information
fifthThirteen committed Jul 28, 2024
1 parent 2ee1549 commit ae25084
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
20 changes: 10 additions & 10 deletions src/service/price.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import axios from "axios";
import { $cms, $next } from "@jx3box/jx3box-common/js/https";
import { __spider2 } from "@jx3box/jx3box-common/data/jx3box.json"
import { __spider2 } from "@jx3box/jx3box-common/data/jx3box.json";

const $spider = axios.create({
baseURL: __spider2,
})
});

// 获取金价数据
function getGoldPriceData() {
Expand All @@ -14,15 +14,15 @@ function getGoldPriceData() {
// 获取系统关注的物品信息
function getSystemGoodsData(params) {
return $cms().get("api/cms/pvx/item/group", {
params
})
params,
});
}

// 获取服务器物价
function getServerPriceData(params) {
return $next().get("api/item-price/list", {
params
})
params,
});
}

// 获取用户信息
Expand All @@ -36,8 +36,8 @@ function getMyFollowList() {
}

// 设置我关注的清单
function setMyFollowList(params) {
return $cms().post("api/cms/user/my/meta?key=follow_inventory", params);
function setMyFollowList(data) {
return $cms().post("api/cms/user/my/meta?key=follow_inventory", data);
}

// 获取清单详情
Expand All @@ -52,5 +52,5 @@ export {
getUserInfo,
getMyFollowList,
setMyFollowList,
getMyGoodsDetail
}
getMyGoodsDetail,
};
10 changes: 7 additions & 3 deletions src/views/price/goods/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ export default {
this.loading = true;
getMyFollowList().then((res) => {
if (res.data.data) {
this.myFollowData = res.data.data.split(",").map((item) => +item);
this.myFollowData = res.data.data
.split(",")
.map((item) => +item)
.filter((item) => !!item);
} else {
this.myFollowData = [];
}
Expand Down Expand Up @@ -161,6 +164,7 @@ export default {
this.showMyGoods = true;
},
setMyFollowList(val) {
// 此处接口不支持不传,传空后前端过滤id为0的数据
setMyFollowList({ val }).then((res) => {
this.showMyGoods = false;
this.$message.success("设置成功");
Expand All @@ -173,7 +177,7 @@ export default {
this.getMyFollowGoodsPrice();
},
},
mounted () {
mounted() {
if (User.isLogin() && this.client === "std") {
getUserInfo().then((res) => {
this.server = res.data?.data?.jx3_server || "梦江南";
Expand All @@ -187,7 +191,7 @@ export default {
this.getMyFollowList();
}
}
}
},
};
</script>
<style lang="less">
Expand Down
6 changes: 5 additions & 1 deletion src/views/price/overview/goods.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ export default {
this.loading = true;
getMyFollowList().then((res) => {
if (res.data.data) {
this.myFollowData = res.data.data.split(",").map((item) => +item);
this.myFollowData = res.data.data
.split(",")
.map((item) => +item)
.filter((item) => !!item);
} else {
this.myFollowData = [];
}
Expand Down Expand Up @@ -133,6 +136,7 @@ export default {
}
},
setMyFollowList(val) {
// 此处接口不支持不传,传空后前端过滤id为0的数据
setMyFollowList({ val }).then((res) => {
this.showMyGoods = false;
this.$message.success("设置成功");
Expand Down

0 comments on commit ae25084

Please sign in to comment.