Commit 84fcbb76 by liwk

commit

1 parent 5db1b23d
......@@ -21,6 +21,25 @@ img {
vertical-align: top;
}
.flex {
display: flex;
align-items: center;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-two-line {
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.text-center {
display: flex;
align-items: center;
......@@ -37,4 +56,8 @@ img {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.sticky {
position: static;
}
\ No newline at end of file
.sprite-icon { background-image: url(../images/sprite.png);background-size: 170px 170px;}
.icon-coupon { width: 80px; height: 80px; background-position: 0px 0px;}
.icon-discount { width: 80px; height: 80px; background-position: -90px 0px;}
.icon-exchange { width: 80px; height: 80px; background-position: 0px -90px;}
\ No newline at end of file
.sprite-icon { background-image: url(../images/sprite.png);background-size: 10px 10px;}
.icon-attract-customer-share { width: 10px; height: 10px; background-position: 0px 0px;}
\ No newline at end of file

21.8 KB | W: | H:

427 Bytes | 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>
<van-list
v-model="loading"
:finished="finished"
finished-text="到底啦!!"
@load="onLoad"
offset="100"
:immediate-check="false"
>
<slot></slot>
</van-list>
<div :class="['scroll-view', ScrollViewclass]">
<van-list
v-model="loading"
:finished="finished"
finished-text="到底啦!!"
@load="onLoad"
offset="100"
:immediate-check="false"
>
<slot></slot>
</van-list>
</div>
</template>
<script type='text/ecmascript-6'>
......@@ -20,17 +22,20 @@ export default {
finished: false,
}
},
props: ['ScrollViewclass'],
mounted () {
},
methods: {
onLoad () {
this.loading = false
this.finished = true
this.$emit('ReachBottom', null)
this.$emit('ReachBottom')
},
}
}
</script>
<style scoped lang='scss'>
.scroll-view {
overflow-y: scroll;
box-sizing: border-box;
}
</style>
\ No newline at end of file
<template>
<div class="search">
<van-search
v-model="value"
:placeholder="placeholder"
@search="onSearch"
/>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'Search',
props: {
keyword: {
type: String,
default: ''
},
placeholder: {
type: String,
default: '请输入内容搜索'
}
},
data () {
return {
value: this.keyword
}
},
mounted () {
},
methods: {
onSearch (e) {
this.$emit('search', e)
}
}
}
</script>
<style scoped lang='scss'>
.van-search {
padding: 9px 16px;
height: 50px;
background: #fff;
.van-search__content {
background-color: #fff;
border: 1px solid #cdd1d4;
border-radius: 16px;
}
.van-cell {
padding: 5px 16px 5px 0;
}
}
</style>
\ No newline at end of file
<template>
<div class="tab">
<template v-for="(i,index) in data">
<div
@click="change(index)"
:class="['item' ,'text-center', {'active':index == tabIndex}]"
:key="index"
>{{i}}</div>
</template>
<div :class="['line',`type-${tabIndex}`]"></div>
<div :class="[{'sticky':sticky}]">
<van-tabs
v-model="tabIndex"
color="#5850ff"
title-inactive-color="#BBB"
title-active-color="#2c2c2c"
@click="click"
:key="updata"
>
<template v-for="(i,index) in data">
<van-tab
:title="i"
:key="index"
></van-tab>
</template>
</van-tabs>
</div>
</template>
......@@ -15,22 +22,38 @@
export default {
name: 'Tab',
props: {
data: {
list: {
type: Array,
default: () => {
return []
}
}
},
sticky: Boolean,
index: {
type: Number,
default: 0
},
updata: null
},
data () {
return {
tabIndex: 0
tabIndex: this.index,
data: this.list
}
},
watch: {
'index' (n) {
this.tabIndex = n
},
'updata' (n) {
this.data = this.list
this.tabIndex = this.index
}
},
mounted () {
},
methods: {
change (tabIndex) {
click (tabIndex) {
this.tabIndex = tabIndex
this.$emit('change', tabIndex)
}
......@@ -38,40 +61,19 @@ export default {
}
</script>
<style scoped lang='scss'>
.tab {
<style lang='scss'>
.sticky {
position: sticky;
top: 0;
z-index: 2;
display: grid;
grid-template-columns: repeat(2, 1fr);
background-color: #fff;
height: 44px;
.item {
color: #a9a9a9;
font-size: 14px;
transition: all 0.5s;
}
.active {
font-size: 16px;
color: #2c2c2c;
font-weight: 500;
}
.line {
position: absolute;
bottom: 0;
background: #5850ff;
border-radius: 2px;
height: 3px;
width: 40px;
transform: translateX(-50%);
transition: all 0.25s;
}
.type-0 {
left: 25%;
}
.type-1 {
left: 75%;
}
z-index: 99;
}
.van-tabs__wrap {
height: 50px !important;
}
.van-tab__text {
transition: all 0.25s;
}
.van-tab--active {
font-size: 16px !important;
}
</style>
\ No newline at end of file
......@@ -9,9 +9,13 @@
// 按需全局引入 vant组件
import {
Button,
Dialog
Dialog,
Search,
List,
} from 'vant'
export const components = [
Button,
Dialog
]
Dialog,
Search,
List
]
\ No newline at end of file
......@@ -5,7 +5,8 @@ const pages = {
attractCustomer: [{
name: 'index',
meta: {
title: '渠道货吗'
title: '渠道活码',
backgroundColor: '#F7F7F7'
}
}]
}
......
<template>
<div>
渠道活码
<div class="layout">
<div class="search sticky">
<search />
</div>
<div class="content">
<scroll-view
class="list-box"
@ReachBottom="onReachBottom"
ref="scrollView"
>
<template v-for="(i,index) in 10">
<div
class="box"
:key="index"
>
<div class="share">
<div class="sprite-icon icon-attract-customer-share"></div>
</div>
<div class="title text-hide">渠道活码名称大概到这个位置…</div>
<div class="name-list">
<div class="label"></div>
<div class="value"></div>
</div>
<div class="remark">
备注:{{i.remark || ''}}
</div>
</div>
</template>
</scroll-view>
</div>
</div>
</template>
......@@ -14,9 +42,39 @@ export default {
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.layout {
.search {
top: 0;
z-index: 2;
background-color: #fff;
}
.content {
padding: 16px;
.box {
background: #ffffff;
box-shadow: 0px 4px 8px 0px rgba(224, 224, 224, 0.5);
border-radius: 4px;
padding: 16px 10px;
margin-bottom: 10px;
position: relative;
.share {
position: absolute;
right: 0;
top: 0;
}
.title {
width: 224px;
color: #333333;
font-size: 16px;
font-weight: 500;
}
}
}
}
</style>
\ 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!