generated from JX3BOX/jx3box-vue-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
540 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,54 @@ | ||
import { $node } from "@jx3box/jx3box-common/js/https"; | ||
import { $node, $cms } from "@jx3box/jx3box-common/js/https"; | ||
|
||
// 外观类型列表 | ||
function getExteriorsTypes() { | ||
return $node().get(`/api/node/v2/exterior/types`); | ||
} | ||
|
||
// 外观列表/搜索 | ||
function getExteriorsList() { | ||
return $node().get(`/api/node/v2/exterior/list`); | ||
function getExteriorsList(params) { | ||
return $node().get(`/api/node/v2/exterior/list`, { | ||
params, | ||
}); | ||
} | ||
|
||
export { getExteriorsTypes, getExteriorsList }; | ||
// 外观详情 | ||
function getExteriorsDetail(id) { | ||
return $node().get(`/api/node/v2/exterior/${id}`); | ||
} | ||
|
||
// 外观价格趋势 | ||
function getExteriorsPriceTrending(params) { | ||
return $node().get(`/api/node/v2/exterior/price-trending`, { | ||
params, | ||
}); | ||
} | ||
|
||
// 用户入库外观 | ||
function entWarehouse(params) { | ||
return $cms().post(`/api/cms/pvx/exterior/user/store`, { | ||
params, | ||
}); | ||
} | ||
|
||
// 用户查看自己关注的外观列表 | ||
function exteriorUserStar(params) { | ||
return $cms().get(`/api/cms/pvx/exterior/user/star`, { | ||
params, | ||
}); | ||
} | ||
|
||
// 用户获取/关注/取消收藏外观 | ||
function userStarExterior(type, id, params) { | ||
return $cms()[type](`/api/cms/pvx/exterior/user/star/${id}`, params); | ||
} | ||
|
||
export { | ||
getExteriorsTypes, | ||
getExteriorsList, | ||
getExteriorsDetail, | ||
getExteriorsPriceTrending, | ||
entWarehouse, | ||
exteriorUserStar, | ||
userStarExterior, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Vue from "vue"; | ||
import Vuex from "vuex"; | ||
import { exteriorUserStar } from "@/service/exterior"; | ||
|
||
Vue.use(Vuex); | ||
|
||
let store = { | ||
state: { | ||
client: location.href.includes("origin") ? "origin" : "std", | ||
userStarExteriorList: [], | ||
}, | ||
mutations: { | ||
toState(state, data) { | ||
Object.keys(data).forEach((item) => { | ||
state[item] = data[item]; | ||
}); | ||
}, | ||
toExteriorList(state, data) { | ||
state.userStarExteriorList = data; | ||
}, | ||
}, | ||
|
||
actions: { | ||
getExteriorUserStar(ctx) { | ||
exteriorUserStar().then((res) => { | ||
ctx.commit("toExteriorList", res.data.data); | ||
}); | ||
}, | ||
}, | ||
}; | ||
|
||
export default new Vuex.Store(store); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.