Commit 74e95069 by 李伟康

修改样式

1 parent 9a0d5500
...@@ -97,7 +97,6 @@ img { ...@@ -97,7 +97,6 @@ img {
.van-dropdown-menu__title { .van-dropdown-menu__title {
color: #545454 !important; color: #545454 !important;
font-size: 16px; font-size: 16px;
&::after { &::after {
display: none; display: none;
} }
...@@ -107,10 +106,12 @@ img { ...@@ -107,10 +106,12 @@ img {
.attachment { .attachment {
.van-dropdown-menu__bar { .van-dropdown-menu__bar {
.van-dropdown-menu__title { .van-dropdown-menu__title {
color: #5F5F5F !important; color: #5F5F5F !important;
font-size: 12px; font-size: 12px;
} }
.van-dropdown-menu__title--active {
color: var(--themeColor) !important;
}
} }
} }
\ No newline at end of file \ No newline at end of file
.sprite-icon { background-image: url(../images/sprite.png);background-size: 102px 64px;} .sprite-icon { background-image: url(../images/sprite.png);background-size: 105px 86px;}
.icon-down { width: 12px; height: 12px; background-position: -84px -28px;} .icon-down { width: 12px; height: 12px; background-position: 0px -74px;}
.icon-gift-del { width: 18px; height: 18px; background-position: -84px 0px;} .icon-gift-del { width: 18px; height: 18px; background-position: -84px -30px;}
.icon-menu { width: 22px; height: 20px; background-position: 0px -44px;} .icon-menu { width: 22px; height: 20px; background-position: 0px -44px;}
.icon-PYQ { width: 21px; height: 20px; background-position: -32px -44px;} .icon-PYQ { width: 21px; height: 20px; background-position: -84px 0px;}
.icon-pdf { width: 32px; height: 34px; background-position: 0px 0px;} .icon-pdf { width: 32px; height: 34px; background-position: 0px 0px;}
.icon-link { width: 32px; height: 32px; background-position: -42px 0px;} .icon-link { width: 32px; height: 32px; background-position: -42px 0px;}
.icon-eye { width: 13px; height: 8px; background-position: -84px -50px;}
.icon-send { width: 10px; height: 10px; background-position: -63px -44px;}
\ No newline at end of file \ No newline at end of file
.icon-eye { width: 13px; height: 8px; background-position: -22px -74px;}
.icon-send { width: 10px; height: 10px; background-position: -64px -44px;}
.icon-menu-active { width: 22px; height: 20px; background-position: -32px -44px;}
\ No newline at end of file \ No newline at end of file

8.3 KB | W: | H:

9.32 KB | W: | H:

src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
<template> <template>
<van-dropdown-menu class="dropdown-menu"> <van-dropdown-menu class="dropdown-menu">
<van-dropdown-item ref="menu" teleport="body"> <van-dropdown-item
ref="menu"
teleport="body"
>
<template #title> <template #title>
<div class="sprite-icon icon-menu-active"></div>
<div class="sprite-icon icon-menu"></div> <div class="sprite-icon icon-menu"></div>
</template> </template>
<menu-checkbox /> <menu-checkbox
:single="single"
@confirm="confirm"
:title="title"
/>
</van-dropdown-item> </van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</template> </template>
...@@ -15,16 +23,22 @@ export default { ...@@ -15,16 +23,22 @@ export default {
components: { MenuCheckbox }, components: { MenuCheckbox },
name: 'DropdownMenu', name: 'DropdownMenu',
props: { props: {
single: Boolean,
title: String
}, },
data () { data () {
return { return {
test: false,
} }
}, },
mounted () { }, mounted () {
},
methods: { methods: {
close () { close () {
this.$refs.menu.toggle() // this.$refs.menu.toggle()
},
confirm (e) {
this.$emit('confirm', e)
} }
} }
...@@ -36,6 +50,20 @@ export default { ...@@ -36,6 +50,20 @@ export default {
/deep/.van-dropdown-menu__bar { /deep/.van-dropdown-menu__bar {
width: 44px; width: 44px;
height: 44px !important; height: 44px !important;
.sprite-icon{
transition: all .25s;
}
.icon-menu-active {
display: none;
}
.van-dropdown-menu__title--active {
.icon-menu-active {
display: block;
}
.icon-menu {
display: none;
}
}
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<div class="menu-checkbox"> <div class="menu-checkbox">
<div class="menu-box"> <div class="menu-box">
<div class="menu-title">业务类型:</div> <div class="menu-title">{{title}}:</div>
<div class="menu-grid"> <div class="menu-grid">
<template v-for="(i,index) in list"> <template v-for="(i,index) in list">
<div <div
class="item text-center" :class="['item text-center',{'active':i.active}]"
:key="index" :key="index"
@click="choose(i)" @click="choose(i,index)"
> {{i.text}}</div> > {{i.text}}</div>
</template> </template>
</div> </div>
</div> </div>
<div class="menu-btn-box"> <div class="menu-btn-box">
<van-button <template v-if="showReset">
block <van-button
round block
@click="close" round
> @click="reset"
取消 >
</van-button> 重置
</van-button>
</template>
<template v-else>
<van-button
block
round
@click="close"
>
取消
</van-button>
</template>
<van-button <van-button
block block
round round
...@@ -35,8 +46,13 @@ ...@@ -35,8 +46,13 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
export default { export default {
name: 'MenuCheckbox', name: 'MenuCheckbox',
props: {
single: Boolean,
title: String
},
data () { data () {
return { return {
showReset: false,
list: [ list: [
{ {
text: '全部', text: '全部',
...@@ -44,20 +60,27 @@ export default { ...@@ -44,20 +60,27 @@ export default {
active: true active: true
}, },
{ {
text: '好借好还', text: '真滴C',
value: '2' value: 2,
active: false
}, },
{ {
text: '社交恐惧', text: '咦哦啊',
value: '3' value: 3,
active: false
}, },
{ {
text: '随时随地发', text: '两段蛙跳',
value: '4' value: 4,
active: false
}, },
{ {
text: '天很反感', text: '葫芦给',
value: '6' value: 5,
active: false
} }
] ]
} }
...@@ -65,7 +88,47 @@ export default { ...@@ -65,7 +88,47 @@ export default {
mounted () { mounted () {
}, },
methods: { methods: {
choose (e, index) {
let { list, single, showReset } = this
if (single || !e.value) {
list.map(i => i.active = false)
list[index].active = true
} else {
if (list[0].active) list[0].active = false
list[index].active = !e.active
this.check()
}
if (!showReset) this.showReset = true
},
check () {
let { list, single } = this
if (!single) {
try {
list.map(e => { if (e.active) throw false })
} catch (error) {
return
}
}
this.reset()
},
reset () {
let { list } = this
list.map(i => i.active = false)
list[0].active = true
this.showReset = false
},
confirm () { confirm () {
let { list } = this
let chooseList = []
try {
list.map(e => {
if (!e.value && e.active) throw e
if (e.active) chooseList.push(e)
})
} catch (e) {
chooseList = []
}
this.$emit('confirm', chooseList)
this.close() this.close()
}, },
close () { close () {
...@@ -86,7 +149,7 @@ export default { ...@@ -86,7 +149,7 @@ export default {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 16px; gap: 16px;
padding: 12px 23px; padding: 12px 0 12px 23px;
.item { .item {
height: 26px; height: 26px;
border-radius: 4px; border-radius: 4px;
...@@ -94,6 +157,7 @@ export default { ...@@ -94,6 +157,7 @@ export default {
padding: 0 12px; padding: 0 12px;
color: #666; color: #666;
font-size: 14px; font-size: 14px;
transition: all .25s;
} }
.active { .active {
border-color: var(--themeColor); border-color: var(--themeColor);
......
...@@ -21,7 +21,11 @@ ...@@ -21,7 +21,11 @@
</van-dropdown-menu> </van-dropdown-menu>
</template> </template>
<template v-if="showMenu"> <template v-if="showMenu">
<dropdown-menu></dropdown-menu> <dropdown-menu
@confirm="onEmit($event,'menuSelect')"
:single="single"
:title="title"
></dropdown-menu>
</template> </template>
</div> </div>
</template> </template>
...@@ -49,10 +53,13 @@ export default { ...@@ -49,10 +53,13 @@ export default {
default: 30 default: 30
}, },
showMenu: Boolean, showMenu: Boolean,
option:{ option: {
type:Array, type: Array,
default:() => [] default: () => []
} },
single: Boolean,
title: String
}, },
data () { data () {
return { return {
......
...@@ -43,7 +43,7 @@ fetchConfig(!isMock).then(res => { ...@@ -43,7 +43,7 @@ fetchConfig(!isMock).then(res => {
// 设置 js中可以访问 $cdn // 设置 js中可以访问 $cdn
Vue.use(cfg) Vue.use(cfg)
window.$fetchConfig = res window.$fetchConfig = res
if (res.vconsole) new VConsole() // if (res.vconsole) new VConsole()
/**登录过期 重新登录 */ /**登录过期 重新登录 */
window.reLogin = () => { window.reLogin = () => {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
> >
</tab> </tab>
<dropdown-menu class="menu"></dropdown-menu> <dropdown-menu class="menu" title="业务类型"></dropdown-menu>
</div> </div>
<search-box <search-box
@search="search" @search="search"
......
...@@ -5,20 +5,23 @@ ...@@ -5,20 +5,23 @@
:keyword="keyword" :keyword="keyword"
:showDropdown="false" :showDropdown="false"
showMenu showMenu
single
placeholder="输入关键词" placeholder="输入关键词"
@menuSelect="menuSelect"
title="素材组"
></search-box> ></search-box>
<van-dropdown-menu <van-dropdown-menu
active-color="#3975C6" active-color="#3975C6"
class="tab-menu" class="tab-menu attachment"
> >
<van-dropdown-item ref="menu"> <van-dropdown-item ref="menu">
<template #title> <template #title>
<div class="menu-title flex"> <div class="menu-title flex">
全部 {{businessText}}
<div class="sprite-icon icon-down"></div> <div class="sprite-icon icon-down"></div>
</div> </div>
</template> </template>
<menu-checkbox /> <menu-checkbox @confirm="confirm" title="业务类型" />
</van-dropdown-item> </van-dropdown-item>
<van-dropdown-item <van-dropdown-item
:options="option" :options="option"
...@@ -72,12 +75,28 @@ export default { ...@@ -72,12 +75,28 @@ export default {
flag: true, flag: true,
list: new Array(10).fill('121'), list: new Array(10).fill('121'),
total: 0, total: 0,
pageNum: 1 pageNum: 1,
businessText: '全部'
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
confirm (chooseList) {
console.log(chooseList)
if (chooseList.length) {
let text = []
chooseList.map(e => {
text.push(e.text)
})
this.businessText = `${text.join(',').substring(0, 5)}...`
} else {
this.businessText = '全部'
}
},
menuSelect(e){
console.log(e)
},
search (e) { search (e) {
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!