|
|
@@ -6,7 +6,7 @@
|
|
|
/></router-link>
|
|
|
|
|
|
<div class="content">
|
|
|
- <div class="tabs">
|
|
|
+ <!-- <div class="tabs">
|
|
|
<div
|
|
|
class="tab"
|
|
|
:class="{ active: active === item }"
|
|
|
@@ -17,7 +17,16 @@
|
|
|
{{ item }}
|
|
|
<div class="slip" :class="{ active: item === active }"></div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
+
|
|
|
+ <el-tabs v-model="activeName" class="menus" @tab-click="change">
|
|
|
+ <el-tab-pane
|
|
|
+ v-for="(item, index) in menus"
|
|
|
+ :key="index"
|
|
|
+ :label="item.label"
|
|
|
+ :name="item.value"
|
|
|
+ ></el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
<div class="btn-list" v-if="isLogin">
|
|
|
<el-dropdown @command="onCommand" style="margin-left: 20px">
|
|
|
<span class="el-dropdown-link">
|
|
|
@@ -35,7 +44,9 @@
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
</div>
|
|
|
- <div v-else class="login" @click="show = true">[登录]</div>
|
|
|
+ <!-- <div v-else class="login" @click="show = true">[登录]</div> -->
|
|
|
+ <el-button v-else class="login" plain @click="show = true">[登录]</el-button>
|
|
|
+
|
|
|
<!-- <div class="login login1">中文</div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -47,11 +58,39 @@ import LoginInfo from '../components/LoginInfo.vue';
|
|
|
import { mapState, mapMutations } from 'vuex';
|
|
|
export default {
|
|
|
components: { LoginInfo },
|
|
|
+ watch: {
|
|
|
+ $route() {
|
|
|
+ this.getActive();
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
tabs: ['铸造者', '收藏探索', '数字盲盒', '我的NFT', '了解更多'],
|
|
|
active: '',
|
|
|
- show: false
|
|
|
+ show: false,
|
|
|
+ activeName: '',
|
|
|
+ menus: [
|
|
|
+ {
|
|
|
+ label: '铸造者',
|
|
|
+ value: '/casting'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '收藏探索',
|
|
|
+ value: '/collection'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '数字盲盒',
|
|
|
+ value: '/collection?type=BLIND_BOX'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '我的NFT',
|
|
|
+ value: '/my'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '了解更多',
|
|
|
+ value: 'wait'
|
|
|
+ }
|
|
|
+ ]
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -69,6 +108,7 @@ export default {
|
|
|
this.$EventBus.$on('login', () => {
|
|
|
this.show = true;
|
|
|
});
|
|
|
+ this.getActive();
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations(['updateUserInfo']),
|
|
|
@@ -111,28 +151,143 @@ export default {
|
|
|
this.$router.push('/authentication');
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ getActive() {
|
|
|
+ let menus = [...this.menus];
|
|
|
+ menus.forEach(item => {
|
|
|
+ let _route = this.parsePath(item.value);
|
|
|
+ if (this.$route.path == _route.path && Object.keys(_route.query).length === 0) {
|
|
|
+ this.activeName = item.value;
|
|
|
+ } else if (this.$route.path == _route.path) {
|
|
|
+ Object.keys(_route.query).forEach(key => {
|
|
|
+ if (_route.query[key] === this.$route.query[key]) {
|
|
|
+ this.activeName = item.value;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ change(info) {
|
|
|
+ if (info.paneName !== 'wait') {
|
|
|
+ this.$router.push(info.paneName);
|
|
|
+ } else {
|
|
|
+ this.wait();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ parsePath(path = '') {
|
|
|
+ let hash = '';
|
|
|
+ let query = {};
|
|
|
+
|
|
|
+ let hashIndex = path.indexOf('#');
|
|
|
+ if (hashIndex >= 0) {
|
|
|
+ hash = path.slice(hashIndex);
|
|
|
+ path = path.slice(0, hashIndex);
|
|
|
+ }
|
|
|
+
|
|
|
+ let queryIndex = path.indexOf('?');
|
|
|
+ if (queryIndex >= 0) {
|
|
|
+ query = this.parseQuery(path.slice(queryIndex + 1));
|
|
|
+ path = path.slice(0, queryIndex);
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ path,
|
|
|
+ query,
|
|
|
+ hash
|
|
|
+ };
|
|
|
+ },
|
|
|
+ parseQuery(query) {
|
|
|
+ const res = {};
|
|
|
+
|
|
|
+ query = query.trim().replace(/^(\?|#|&)/, '');
|
|
|
+
|
|
|
+ if (!query) {
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ query.split('&').forEach(param => {
|
|
|
+ const parts = param.replace(/\+/g, ' ').split('=');
|
|
|
+ const key = decode(parts.shift());
|
|
|
+ const val = parts.length > 0 ? decode(parts.join('=')) : null;
|
|
|
+
|
|
|
+ if (res[key] === undefined) {
|
|
|
+ res[key] = val;
|
|
|
+ } else if (Array.isArray(res[key])) {
|
|
|
+ res[key].push(val);
|
|
|
+ } else {
|
|
|
+ res[key] = [res[key], val];
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ function decode(str = '') {
|
|
|
+ try {
|
|
|
+ return decodeURIComponent(str);
|
|
|
+ } catch (err) {
|
|
|
+ if (process.env.NODE_ENV !== 'production') {
|
|
|
+ // warn(false, `Error decoding "${str}". Leaving it intact.`)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return str;
|
|
|
+ }
|
|
|
+
|
|
|
+ return res;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
-/deep/ .el-dropdown-menu__item {
|
|
|
- font-weight: bold;
|
|
|
- text-align: center;
|
|
|
+/deep/.btn-list {
|
|
|
+ .el-dropdown-menu__item {
|
|
|
+ font-weight: bold;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .el-tabs__nav-scroll {
|
|
|
+ padding-left: 13px;
|
|
|
+ }
|
|
|
+ .el-tabs__item {
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 14px;
|
|
|
+ width: 300px;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/deep/.menus {
|
|
|
+ padding: 15px 25px 0;
|
|
|
+ .el-tabs__item {
|
|
|
+ padding: 0 25px;
|
|
|
+ color: #939599;
|
|
|
+ font-size: 18px;
|
|
|
+ &.is-active {
|
|
|
+ color: #fff;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-tabs__nav-wrap {
|
|
|
+ &::after {
|
|
|
+ background-color: transparent;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .el-tabs__active-bar {
|
|
|
+ background-color: transparent;
|
|
|
+ &::after {
|
|
|
+ content: '';
|
|
|
+ position: absolute;
|
|
|
+ left: 30%;
|
|
|
+ right: 30%;
|
|
|
+ background-color: #fff;
|
|
|
+ top: 0;
|
|
|
+ bottom: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
.border {
|
|
|
margin: 6px 16px;
|
|
|
height: 1px;
|
|
|
background: #f2f3f5;
|
|
|
}
|
|
|
-/deep/ .el-tabs__nav-scroll {
|
|
|
- padding-left: 13px;
|
|
|
-}
|
|
|
-/deep/ .el-tabs__item {
|
|
|
- font-weight: bold;
|
|
|
- font-size: 14px;
|
|
|
- width: 300px;
|
|
|
-}
|
|
|
+
|
|
|
.container {
|
|
|
height: 90px;
|
|
|
background: #0f1111;
|
|
|
@@ -195,14 +350,18 @@ export default {
|
|
|
|
|
|
.login {
|
|
|
width: 83px;
|
|
|
- height: 30px;
|
|
|
- border-radius: 4px;
|
|
|
- border: 1px solid;
|
|
|
- // border-image: linear-gradient(135deg, rgba(0, 255, 203, 1), rgba(0, 110, 255, 1)) 1 1;
|
|
|
- line-height: 30px;
|
|
|
- text-align: center;
|
|
|
color: @prim;
|
|
|
font-size: 16px;
|
|
|
+ margin: 0 30px;
|
|
|
+ height: 30px;
|
|
|
+ line-height: 0px;
|
|
|
+ background-color: transparent;
|
|
|
+ .line(@radius:4px);
|
|
|
+ border-width: 0;
|
|
|
+ /deep/span {
|
|
|
+ position: relative;
|
|
|
+ z-index: 3;
|
|
|
+ }
|
|
|
// .line();
|
|
|
}
|
|
|
}
|