Commit 8f5ef5cf by zhouzy
2 parents 2b3624a6 2665ebff
...@@ -21,6 +21,25 @@ img { ...@@ -21,6 +21,25 @@ img {
vertical-align: top; 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 { .text-center {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -37,4 +56,8 @@ img { ...@@ -37,4 +56,8 @@ img {
position: absolute; position: absolute;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
}
.sticky {
position: static;
} }
\ No newline at end of file \ 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 \ 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 \ 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> <template>
<van-list <div :class="['scroll-view', ScrollViewclass]">
v-model="loading" <van-list
:finished="finished" v-model="loading"
finished-text="到底啦!!" :finished="finished"
@load="onLoad" finished-text="到底啦!!"
offset="100" @load="onLoad"
:immediate-check="false" offset="100"
> :immediate-check="false"
<slot></slot> >
</van-list> <slot></slot>
</van-list>
</div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
...@@ -20,17 +22,21 @@ export default { ...@@ -20,17 +22,21 @@ export default {
finished: false, finished: false,
} }
}, },
props: ['ScrollViewclass'],
mounted () { mounted () {
}, },
methods: { methods: {
onLoad () { onLoad () {
this.loading = false console.log(123)
this.finished = true this.$emit('ReachBottom')
this.$emit('ReachBottom', null)
}, },
} }
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.scroll-view {
overflow-y: scroll;
box-sizing: border-box;
}
</style> </style>
\ No newline at end of file \ 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 \ No newline at end of file
<template> <template>
<div class="tab"> <div :class="[{'sticky':sticky}]">
<template v-for="(i,index) in data"> <van-tabs
<div v-model="tabIndex"
@click="change(index)" color="#5850ff"
:class="['item' ,'text-center', {'active':index == tabIndex}]" title-inactive-color="#BBB"
:key="index" title-active-color="#2c2c2c"
>{{i}}</div> @click="click"
</template> :key="updata"
<div :class="['line',`type-${tabIndex}`]"></div> >
<template v-for="(i,index) in data">
<van-tab
:title="i"
:key="index"
></van-tab>
</template>
</van-tabs>
</div> </div>
</template> </template>
...@@ -15,22 +22,38 @@ ...@@ -15,22 +22,38 @@
export default { export default {
name: 'Tab', name: 'Tab',
props: { props: {
data: { list: {
type: Array, type: Array,
default: () => { default: () => {
return [] return []
} }
} },
sticky: Boolean,
index: {
type: Number,
default: 0
},
updata: null
}, },
data () { data () {
return { 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 () { mounted () {
}, },
methods: { methods: {
change (tabIndex) { click (tabIndex) {
this.tabIndex = tabIndex this.tabIndex = tabIndex
this.$emit('change', tabIndex) this.$emit('change', tabIndex)
} }
...@@ -38,40 +61,19 @@ export default { ...@@ -38,40 +61,19 @@ export default {
} }
</script> </script>
<style scoped lang='scss'> <style lang='scss'>
.tab { .sticky {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 2; z-index: 99;
display: grid; }
grid-template-columns: repeat(2, 1fr); .van-tabs__wrap {
background-color: #fff; height: 50px !important;
height: 44px; }
.item { .van-tab__text {
color: #a9a9a9; transition: all 0.25s;
font-size: 14px; }
transition: all 0.5s; .van-tab--active {
} font-size: 16px !important;
.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%;
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -9,9 +9,85 @@ ...@@ -9,9 +9,85 @@
// 按需全局引入 vant组件 // 按需全局引入 vant组件
import { import {
Button, Button,
Dialog List,
Cell,
Tabbar,
TabbarItem,
NavBar,
Search,
ActionSheet,
CellGroup,
Image as VanImage,
Tag,
Field,
Stepper,
Divider,
Step,
Steps,
NoticeBar,
RadioGroup,
Radio,
Uploader,
Tab,
Tabs,
DropdownMenu,
DropdownItem,
Grid,
GridItem,
Popup,
Calendar,
Cascader,
Checkbox,
CheckboxGroup,
Notify,
Icon,
Empty,
PullRefresh,
Picker,
Dialog,
ShareSheet,
Overlay,
loading
} from 'vant' } from 'vant'
export const components = [ export const components = [
Button, Button,
Dialog List,
] Cell,
Tabbar,
TabbarItem,
NavBar,
Search,
ActionSheet,
CellGroup,
VanImage,
Tag,
Field,
Stepper,
Divider,
Step,
Steps,
NoticeBar,
RadioGroup,
Radio,
Uploader,
Tab,
Tabs,
DropdownMenu,
DropdownItem,
Grid,
GridItem,
Popup,
Calendar,
Cascader,
Checkbox,
CheckboxGroup,
Notify,
Icon,
Empty,
PullRefresh,
Picker,
Dialog,
ShareSheet,
Overlay,
loading
]
\ No newline at end of file \ No newline at end of file
...@@ -7,7 +7,8 @@ const pages = { ...@@ -7,7 +7,8 @@ const pages = {
attractCustomer: [{ attractCustomer: [{
name: 'index', name: 'index',
meta: { meta: {
title: '渠道货吗' title: '渠道活码',
backgroundColor: '#F7F7F7'
} }
}] }]
} }
......
<template> <template>
<div> <div class="layout">
渠道活码 <div class="search sticky">
<search />
</div>
<scroll-view
class="content"
@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">张三、C李四、小陈总、飞天小猪、海的小心心、陈五、金七</div>
</div>
<div class="remark">
备注:{{i.remark || '- -'}}
</div>
<div class="img-box"></div>
</div>
</template>
</scroll-view>
</div> </div>
</template> </template>
...@@ -9,14 +36,64 @@ export default { ...@@ -9,14 +36,64 @@ export default {
name: '', name: '',
data () { data () {
return { return {
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
onReachBottom () {
this.$refs.scrollView.loading = false
this.$refs.scrollView.finished = true
}
} }
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.layout {
.search {
top: 0;
z-index: 2;
background-color: #fff;
}
.content {
padding: 16px;
height: calc(100vh - 50px);
.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;
font-size: 12px;
.share {
position: absolute;
right: 0;
top: 0;
}
.title {
width: 224px;
color: #333333;
font-size: 16px;
font-weight: 500;
margin-bottom: 8px;
}
.name-list {
display: flex;
margin-bottom: 8px;
.label {
color: #666666;
width: 60px;
flex-shrink: 0;
}
}
.remark,
.name-list {
color: #999999;
}
}
}
}
</style> </style>
\ 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!