Skip to content

Commit

Permalink
feat: body tab
Browse files Browse the repository at this point in the history
  • Loading branch information
zixuan1986 committed Aug 16, 2023
1 parent d9f3ac5 commit 26fc02d
Show file tree
Hide file tree
Showing 19 changed files with 183 additions and 53 deletions.
27 changes: 27 additions & 0 deletions src/assets/data/body_types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"value": "",
"label": "全部",
"client": ["std", "origin"]
},
{
"value": 1,
"label": "成男",
"client": ["std", "origin"]
},
{
"value": 2,
"label": "成女",
"client": ["std", "origin"]
},
{
"value": 5,
"label": "正太",
"client": ["std"]
},
{
"value": 6,
"label": "萝莉",
"client": ["std", "origin"]
}
]
8 changes: 8 additions & 0 deletions src/assets/data/menus.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
"status": true,
"isStd": true
},
{
"path": "/body",
"label": "体型数据",
"icon": "el-icon-download",
"key": "exterior",
"status": false,
"isStd": true
},
{
"path": "/homeland",
"label": "家园指南",
Expand Down
16 changes: 8 additions & 8 deletions src/components/face/tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
/>
</div>

<a href="/face/facedata" target="_blank">
<a :href="link.data" target="_blank">
<el-button type="primary" size="medium" icon="el-icon-c-scale-to-original" class="u-analysis">
数据解析
</el-button>
</a>
<a :href="publish_link" target="_blank">
<a :href="publish_link(link.key)" target="_blank">
<el-button type="primary" size="medium" class="u-btn" icon="el-icon-edit">发布</el-button>
</a>
</div>
Expand All @@ -50,7 +50,7 @@ import { publishLink } from "@jx3box/jx3box-common/js/utils";
import { __imgPath } from "@jx3box/jx3box-common/data/jx3box";
export default {
name: "tabs",
props: ["body_types", "active"],
props: ["body_types", "active", "link"],
data: function () {
return {
star: false,
Expand All @@ -61,9 +61,6 @@ export default {
};
},
computed: {
publish_link() {
return publishLink("face");
},
params() {
const _params = {};
if (this.active) _params.body_type = this.active;
Expand All @@ -85,6 +82,9 @@ export default {
getThumbnail: function (filename) {
return __imgPath + "image/face/" + filename + ".jpg";
},
publish_link(key) {
return publishLink(key);
},
},
watch: {
params: {
Expand Down Expand Up @@ -138,9 +138,9 @@ export default {
.m-face-filter {
flex-direction: column;
.u-filter {
.el-checkbox-button__inner {
.el-checkbox-button__inner {
&:hover {
background-color: @faceColor;
background-color: @faceColor;
}
}
&.is-checked {
Expand Down
3 changes: 3 additions & 0 deletions src/pages/adventure.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import "@jx3box/jx3box-common/css/element.css";
import "@jx3box/jx3box-common/css/normalize.css";
Vue.use(JX3BOX_UI);

import reporter from "@jx3box/jx3box-common/js/reporter";
reporter.install(Vue);

// 数据与路由
import router from "../router/adventure";
import store from "../store";
Expand Down
27 changes: 27 additions & 0 deletions src/pages/body.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Vue.config.productionTip = false;

// 第三方UI组件
import Vue from "vue";
import ElementUI from "element-ui";
Vue.use(ElementUI);

// 通用UI模块
import JX3BOX_UI from '@jx3box/jx3box-common-ui'
import "@jx3box/jx3box-common/css/element.css";
import "@jx3box/jx3box-common/css/normalize.css";
Vue.use(JX3BOX_UI);

import reporter from "@jx3box/jx3box-common/js/reporter";
reporter.install(Vue);

// 数据与路由
import router from "../router/body";
import store from "../store";

import App from "@/views/body/Body.vue";
new Vue({
router,
store,
render: h => h(App),
}).$mount("#app");

3 changes: 3 additions & 0 deletions src/pages/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import "@jx3box/jx3box-common/css/element.css";
import "@jx3box/jx3box-common/css/normalize.css";
Vue.use(JX3BOX_UI);

import reporter from "@jx3box/jx3box-common/js/reporter";
reporter.install(Vue);

// 数据与路由
import router from "@/router/book.js";
import store from "@/store/book";
Expand Down
3 changes: 3 additions & 0 deletions src/pages/exam.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Vue.use(JX3BOX_UI);
import hevueImgPreview from "hevue-img-preview";
Vue.use(hevueImgPreview);

import reporter from "@jx3box/jx3box-common/js/reporter";
reporter.install(Vue);

// 数据与路由
import router from "@/router/exam.js";
// import store from "@/store/index";
Expand Down
3 changes: 3 additions & 0 deletions src/pages/furniture.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import "@jx3box/jx3box-common/css/element.css";
import "@jx3box/jx3box-common/css/normalize.css";
Vue.use(JX3BOX_UI);

import reporter from "@jx3box/jx3box-common/js/reporter";
reporter.install(Vue);

// 数据与路由
import router from "../router/furniture";
import store from "../store";
Expand Down
2 changes: 2 additions & 0 deletions src/pages/homeland.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import "@jx3box/jx3box-common/css/element.css";
import "@jx3box/jx3box-common/css/normalize.css";
Vue.use(JX3BOX_UI);

import reporter from "@jx3box/jx3box-common/js/reporter";
reporter.install(Vue);

// 数据与路由
import router from "../router/homeland.js";
Expand Down
3 changes: 3 additions & 0 deletions src/pages/horse.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Vue.use(JX3BOX_UI);
import router from "../router/horse";
import store from "../store";

import reporter from "@jx3box/jx3box-common/js/reporter";
reporter.install(Vue);

import Pagination from "@/components/Pagination";
Vue.component("Pagination", Pagination);

Expand Down
3 changes: 3 additions & 0 deletions src/pages/pet.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import "@jx3box/jx3box-common/css/element.css";
import "@jx3box/jx3box-common/css/normalize.css";
Vue.use(JX3BOX_UI);

import reporter from "@jx3box/jx3box-common/js/reporter";
reporter.install(Vue);

// 数据与路由
import router from "../router/pet";
import store from "../store";
Expand Down
3 changes: 3 additions & 0 deletions src/pages/pvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import "@jx3box/jx3box-common/css/element.css";
import "@jx3box/jx3box-common/css/normalize.css";
Vue.use(JX3BOX_UI);

import reporter from "@jx3box/jx3box-common/js/reporter";
reporter.install(Vue);

// 数据与路由
import store from "@/store/pvg";
import router from "@/router/pvg";
Expand Down
3 changes: 3 additions & 0 deletions src/pages/reputation.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import "@jx3box/jx3box-common/css/element.css";
import "@jx3box/jx3box-common/css/normalize.css";
Vue.use(JX3BOX_UI);

import reporter from "@jx3box/jx3box-common/js/reporter";
reporter.install(Vue);

// 数据与路由
import router from "@/router/reputation.js";
import store from "@/store";
Expand Down
12 changes: 6 additions & 6 deletions src/router/body.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

const bodyList = () => import("../views/body/List.vue");
const bodySingle = () => import("../views/body/Single.vue");
const bodyData = () => import("../views/body/Parse.vue");
const List = () => import("@/views/body/List.vue");
const Single = () => import("@/views/body/Single.vue");
const Data = () => import("@/views/body/Parse.vue");

const routes = [
{ name: "bodyList", path: "/", component: bodyList },
{ name: "bodySingle", path: "/:id(\\d+)", component: bodySingle },
{ name: "bodyData", path: "/bodydata", component: bodyData },
{ name: "list", path: "/", component: List },
{ name: "single", path: "/:id(\\d+)", component: Single },
{ name: "bodydata", path: "/bodydata", component: Data },
];

const router = new VueRouter({
Expand Down
14 changes: 10 additions & 4 deletions src/views/body/Body.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div id="app" class="p-body">
<div id="app">
<Header></Header>
<Nav @statusChange="statusChange"></Nav>
<Main :class="navStatusClass" :withoutRight="true">
Expand All @@ -14,9 +14,15 @@ export default {
name: "Body",
components: { Nav },
data: function () {
return {};
return { navStatusClass: "is-regular" };
},
methods: {
statusChange(navStatusClass) {
this.navStatusClass = navStatusClass;
},
},
computed: {},
methods: {},
};
</script>
<style lang="less">
@import "~@/assets/css/app.less";
</style>
41 changes: 38 additions & 3 deletions src/views/body/List.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,48 @@
<template>
<div></div>
<div class="m-body-list">
<faceTabs
@change="handleTabChange"
:body_types="body_types"
:link="link"
:active="active"
@setActive="setActive"
/>
</div>
</template>
<script>
import faceTabs from "@/components/face/tabs";
import body_types from "@/assets/data/body_types.json";
export default {
name: "BodyList",
data: function () {
return {};
return {
body_types,
active: "",
list: [],
tabsData: {},
page: 1,
pageTotal: 1,
total: 0,
showAllList: false,
link: {
data: "/body/bodydata",
key: "body",
},
};
},
components: {
faceTabs,
},
computed: {},
methods: {},
methods: {
handleTabChange: function (data) {
this.page = 1;
this.tabsData = data;
},
setActive(val) {
this.active = val;
document.documentElement.scrollTop = 0;
},
},
};
</script>
2 changes: 1 addition & 1 deletion src/views/body/Single.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div></div>
<div class="">22222222222</div>
</template>
<script>
export default {
Expand Down
Loading

0 comments on commit 26fc02d

Please sign in to comment.