Commit 8085327b by 李伟康

feat(components): 新增 SelectComponent 和 TypeTabComponent 样式 V2 支持

- 为 `SelectComponent` 添加 `styleV2` 和 `disabled` 属性,支持新样式及禁用状态
- 为 `TypeTabComponent` 添加 `styleV2` 属性,实现两种不同样式的 tab 切换组件
- 调整了部分图标的背景位置,更新 sprite.png 文件
- 在 pages.json 中新增 equity 工具页面路径配置
1 parent 073c3bb9

2.87 MB | W: | H:

2.87 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
<template> <template>
<view class="select-box"> <view :class="['select-box',{styleV2:styleV2}]">
<view <view
class="select" class="select"
@click.stop="isSelect = !isSelect" @click.stop="showPop"
> >
{{selectList[selectIndex].label}} {{selectList[selectIndex].label}}
<view class="sprite-icon icon-arrow-bottom"></view> <template v-if="!disabled">
<view class="sprite-icon icon-arrow-bottom"></view>
</template>
</view> </view>
<view <view
class="pop-box" class="pop-box"
...@@ -29,6 +31,14 @@ export default { ...@@ -29,6 +31,14 @@ export default {
labelKey: { labelKey: {
type: String, type: String,
default: 'label' default: 'label'
},
styleV2: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
} }
}, },
name: '', name: '',
...@@ -49,6 +59,10 @@ export default { ...@@ -49,6 +59,10 @@ export default {
this.isSelect = false this.isSelect = false
this.$emit('chooseType', { item, index }) this.$emit('chooseType', { item, index })
}, },
showPop () {
if (this.disabled) return
this.isSelect = !this.isSelect
}
} }
} }
</script> </script>
...@@ -96,4 +110,19 @@ export default { ...@@ -96,4 +110,19 @@ export default {
} }
} }
} }
.styleV2 {
.select {
height: 80rpx;
background: #3b73ff1a;
color: #333333;
font-size: 28rpx;
transition: all 0.15s;
}
.pop-box {
font-size: 28rpx;
.type-item {
height: toRpx(80);
}
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<view class="type-tab"> <view class="type-tab">
<view class="type-box"> <template v-if="!styleV2">
<view <view class="type-box">
class="tab-item"
v-for="(i, index) in typeList"
:key="index"
@click="tabClick(index)"
>
<view <view
:class="['sprite-icon',tabClass(index)]" class="tab-item"
:style="{ v-for="(i, index) in typeList"
:key="index"
@click="tabClick(index)"
>
<view
:class="['sprite-icon',tabClass(index)]"
:style="{
left:blockLeft left:blockLeft
}" }"
></view> ></view>
<view
class="text"
:class="[tabIndex == index ? `active` : '']"
>
{{ i[nameKey] }}
</view>
</view>
</view>
<view class="mask-box"></view>
</template>
<template v-else>
<view class="type-box-v2">
<view <view
class="text" :class="['tab-item',{active:tabIndex == index}]"
:class="[tabIndex == index ? `active` : '']" v-for="(i, index) in typeList"
:key="index"
@click="tabClick(index)"
> >
{{ i[nameKey] }} <template v-if="index == 0">
<view class="sprite-icon icon-first-right"></view>
</template>
<template v-else>
<view class="sprite-icon icon-second-left"></view>
<view class="sprite-icon icon-second-right"></view>
</template>
<view class="text">
{{ i[nameKey] }}
</view>
</view> </view>
</view> </view>
</view> </template>
<view class="mask-box"></view>
</view> </view>
</template> </template>
...@@ -36,6 +59,10 @@ export default { ...@@ -36,6 +59,10 @@ export default {
nameKey: { nameKey: {
type: String, type: String,
default: 'tabName' default: 'tabName'
},
styleV2: {
type: Boolean,
default: true
} }
}, },
name: '', name: '',
...@@ -63,8 +90,9 @@ export default { ...@@ -63,8 +90,9 @@ export default {
return className return className
}, },
tabClick (index) { tabClick (index) {
if(this.tabIndex == index) return
this.$emit('update:tabIndex', index) this.$emit('update:tabIndex', index)
this.$emit('tabClick',index) this.$emit('tabClick', index)
} }
} }
} }
...@@ -128,5 +156,73 @@ export default { ...@@ -128,5 +156,73 @@ export default {
border-radius: toRpx(48); border-radius: toRpx(48);
overflow: hidden; overflow: hidden;
} }
.type-box-v2 {
position: relative;
display: flex;
width: 100%;
background-color: #eef4fe;
height: toRpx(96);
line-height: toRpx(96);
border-radius: toRpx(48) toRpx(48) 0 0;
z-index: 0;
flex-wrap: nowrap;
overflow-x: auto;
gap: 0 toRpx(80);
.tab-item {
padding: 0 toRpx(40);
flex-shrink: 0;
position: relative;
&:first-of-type{
padding-left: toRpx(80);
}
.text {
color: #292d33;
font-size: toRpx(32);
position: relative;
z-index: 2;
}
.sprite-icon {
position: absolute;
display: none;
}
}
.active {
background: #fff;
&:last-of-type {
.icon-second-right {
// display: none;
}
}
.text {
color: #3b73ff;
font-weight: 500;
transition: all 0.15s;
position: relative;
&::after {
width: toRpx(40);
height: toRpx(6);
border-radius: toRpx(4);
background: #3b73ff;
position: absolute;
content: '';
left: 50%;
transform: translateX(-50%);
bottom: toRpx(12);
}
}
.sprite-icon {
display: block;
}
.icon-first-right {
right: toMinusRpx(100);
}
.icon-second-left {
left: toMinusRpx(100);
}
.icon-second-right {
right: toMinusRpx(100);
}
}
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -238,6 +238,12 @@ ...@@ -238,6 +238,12 @@
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
{
"path": "pages/equity/tool/index",
"style": {
"navigationStyle": "custom"
}
} }
], ],
"globalStyle": { "globalStyle": {
...@@ -253,4 +259,4 @@ ...@@ -253,4 +259,4 @@
"rpxCalcBaseDeviceWidth": 375, "rpxCalcBaseDeviceWidth": 375,
"rpxCalcIncludeWidth": 750 "rpxCalcIncludeWidth": 750
} }
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!