diff --git a/package.json b/package.json index dd3e35815..6ca44f5ec 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "update": "npm --registry https://registry.npmjs.org install @jx3box/jx3box-common-ui@latest @jx3box/jx3box-common@latest @jx3box/jx3box-facedat@latest @jx3box/jx3box-comment-ui@latest @jx3box/jx3box-data@latest @jx3box/jx3box-editor@latest @jx3box/jx3box-map@latest" }, "dependencies": { + "@antv/g2": "^4.1.20", "@jx3box/jx3box-comment-ui": "^1.8.8", "@jx3box/jx3box-common": "^8.2.18", "@jx3box/jx3box-common-ui": "^8.6.0", diff --git a/src/assets/css/exterior/list.less b/src/assets/css/exterior/list.less index 4f1ac0eae..1effa1111 100644 --- a/src/assets/css/exterior/list.less +++ b/src/assets/css/exterior/list.less @@ -1,14 +1,22 @@ +.m-main { + .pb(0); +} .p-main { - .pt(40px); .flex(); .pr(); transition: 0.3s all; + .ml(-10px); .u-back__status { .none(); } &.fewer { .m-left { max-width: 411px; + .m-more__list { + .u-more_col { + width: 100%; + } + } } .m-right { .pr(80px); @@ -38,10 +46,15 @@ } .m-right { .pr(80px); - max-width: 100%; .w(100%); + .pb(40px); + max-width: 100%; .m-info { .ml(0); + .m-info__scroll { + max-height: initial; + overflow: initial !important; + } } .m-action { .m-close { @@ -84,7 +97,9 @@ } .m-left { transition: 0.3s all; - max-width: 100%; + max-height: calc(100vh - @header-height - 80px); + padding: 40px 10px; + width: 100%; .m-list { box-shadow: 0px 0px 10px 0px rgba(218, 128, 41, 0.3); .r(10px); @@ -140,12 +155,15 @@ .mt(20px); .flex(); .flex(y); + .pointer(); background: rgba(255, 193, 134, 0.3); padding: 11px 13px; box-sizing: border-box; .u-img { .r(5px); .size(38px); + background-size: cover; + background-position: center; } .u-title { .ml(10px); @@ -157,6 +175,23 @@ } } } + .m-archive-pages { + .x(); + li { + background-color: white; + &:hover { + .color(#da8029); + } + &.active { + background-color: #da8029; + color: white; + } + } + .btn-prev, + .btn-next { + background-color: white; + } + } &:not(:first-child) { .mt(20px); } @@ -164,15 +199,20 @@ } } .m-right { + .mt(40px); max-width: 0; overflow: hidden; align-self: self-start; .pr(); .flex(); + .m-info__scroll { + max-height: calc(100vh - @header-height - 120px); + } .m-info { - .ml(40px); + .ml(30px); .r(30px); .pr(); + box-sizing: border-box; transition: 0.3s all; flex-grow: 1; padding: 40px; @@ -183,6 +223,7 @@ .m-body { .x(); .w(22px); + .mr(2px); .u-item { .dbi(); .color(#958b71); @@ -190,6 +231,7 @@ .mt(4px); .pr(); .z(1); + .pointer(); padding: 4px 2px; border: 1px solid #afa089; &.act { @@ -209,7 +251,6 @@ .m-preview { .w(158px); .h(248px); - .ml(2px); padding: 5px; box-sizing: border-box; background-image: url(../../img/exterior/exterior_border.svg); @@ -313,17 +354,20 @@ } .u-exterior { .db(); - .size(100% , 400px); + .w(100%); .mt(28px); } + .m-trend-chart { + .mt(40px); + } } &::after { content: ""; .db(); .pa(); .lt(0); - .rb(0); .z(0); + .size(100%,100%); .r(30px); } &.info-bg1 { @@ -360,8 +404,28 @@ .flex(o); .pointer(); .r(50%); + .pr(); + .m-img__pr { + .pr(); + .size(20px); + } .u-img { .size(20px); + .db(); + transition: 0.3s all; + &.u-img__hover { + .pa(); + .lt(50%); + transform: translateX(-50%) translateY(-50%); + opacity: 0; + } + } + .u-img__fill { + .pa(); + .lt(50%); + transform: translateX(-50%) translateY(-50%); + padding: 10px; + .r(50%); } &.u-close { background: var( @@ -382,6 +446,15 @@ .w(100%); .x(); } + .u-img__fill { + background: #ff4365; + opacity: 0; + } + &:hover { + .u-img__fill { + opacity: 1; + } + } } &.u-bag { background: #da8029; @@ -398,6 +471,11 @@ &:not(:first-child) { .mt(10px); } + &:hover { + .u-img.u-img__hover { + opacity: 1; + } + } } .m-quick { .mt(30px); @@ -507,4 +585,20 @@ } } } + .m-left, + .m-right .m-info__scroll { + overflow-y: scroll; + &::-webkit-scrollbar { + width: 0; + } + } +} +// 平板 +@media screen and (max-width: 1133px) { +} +// 手机 +@media screen and (max-width: 768px) { + .p-main .m-left .m-list .m-box .m-new__list .m-item { + margin: 0 auto; + } } diff --git a/src/assets/img/exterior/icon/mdi_heart_act.png b/src/assets/img/exterior/icon/mdi_heart_act.png new file mode 100644 index 000000000..bca8d5742 Binary files /dev/null and b/src/assets/img/exterior/icon/mdi_heart_act.png differ diff --git a/src/assets/img/exterior/icon/ri_dislike-fill.png b/src/assets/img/exterior/icon/ri_dislike-fill.png new file mode 100644 index 000000000..eb5dd7080 Binary files /dev/null and b/src/assets/img/exterior/icon/ri_dislike-fill.png differ diff --git a/src/pages/exterior.js b/src/pages/exterior.js index bfd495f7a..c61b15e23 100644 --- a/src/pages/exterior.js +++ b/src/pages/exterior.js @@ -16,7 +16,7 @@ reporter.install(Vue); // 数据与路由 import router from "../router/exterior"; -import store from "../store"; +import store from "../store/exterior"; import App from "@/views/exterior/index.vue"; new Vue({ diff --git a/src/service/exterior.js b/src/service/exterior.js index 7732bcc5d..853cf51fa 100644 --- a/src/service/exterior.js +++ b/src/service/exterior.js @@ -1,4 +1,4 @@ -import { $node } from "@jx3box/jx3box-common/js/https"; +import { $node, $cms } from "@jx3box/jx3box-common/js/https"; // 外观类型列表 function getExteriorsTypes() { @@ -6,8 +6,49 @@ function getExteriorsTypes() { } // 外观列表/搜索 -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, +}; diff --git a/src/store/exterior.js b/src/store/exterior.js new file mode 100644 index 000000000..6f6658697 --- /dev/null +++ b/src/store/exterior.js @@ -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); diff --git a/src/views/exterior/index.vue b/src/views/exterior/index.vue index cbc37efbe..b472a71ad 100644 --- a/src/views/exterior/index.vue +++ b/src/views/exterior/index.vue @@ -13,10 +13,13 @@