Authored by htoooth

add productlist

phantomjs_cdnurl=http://npm.taobao.org/mirrors/phantomjs
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
\ No newline at end of file
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
registry=http://npm.yohops.com
... ...
<template>
<div class="footer">
<TextEllipsis :text="text" class="desc" :isLimitHeight="isLimitHeight" :height="68">
<TextEllipsis :text="text" class="desc" :isLimitHeight="isLimitHeight" :height="75">
<template slot="more"><span>...</span><span class="link" @click="onClick">展开</span></template>
<span slot="after" v-if="!isLimitHeight" @click="isLimitHeight=true"></span>
</TextEllipsis>
... ... @@ -16,12 +16,12 @@
<script>
import Products from './products'
import Products from './products';
export default {
name: 'DescFooter',
components: {
Products
Products,
},
data() {
return {
... ... @@ -31,6 +31,7 @@ export default {
},
methods: {
onClick() {
console.log('展开');
this.isLimitHeight = false;
}
},
... ... @@ -62,7 +63,6 @@ export default {
display: inline-block;
width: 290px;
height: 100px;
background-color: white;
margin-top: 36px;
}
... ...
... ... @@ -33,7 +33,6 @@
import {Slide} from 'cube-ui';
import AvatarHeader from './avatar-header';
import DescFooter from './desc-footer';
import Test from './test'
const img = require('statics/image/showorder/test.png')
... ... @@ -43,8 +42,7 @@ export default {
AvatarHeader,
DescFooter,
Slide,
SlideItem: Slide.Item,
Test
SlideItem: Slide.Item
},
data() {
return {
... ...
<template>
<div class="product-wrapper">
<img :src="url" alt="" srcset="">
<div class="product-wrapper" @click="onclick">
<img class="image-cls" :src="url" alt="" srcset="">
<div class="price">{{price}}</div>
</div>
</template>
... ... @@ -9,10 +9,10 @@
export default {
name: 'ProductItem',
props: {
pid:{
pid: {
type: String,
default() {
return '1212'
return '1212';
}
},
url: {
... ... @@ -27,8 +27,13 @@ export default {
return '¥121314';
}
}
}
}
},
methods: {
onclick() {
console.log('click product')
}
},
};
</script>
<style lang="scss" scoped>
... ... @@ -39,6 +44,11 @@ export default {
height: 100px;
}
.image-cls {
width: 100px;
height: 100px;
}
.price {
width: 100%;
height: 28px;
... ... @@ -47,7 +57,7 @@ export default {
position: absolute;
bottom: 0;
text-align: center;
background: rgba(0,0,0,0.50);
background: rgba(0, 0, 0, 0.5);
color: white;
}
... ...
<template>
<div class="products-wrapper">
<ProductItem class="item" v-for="i in 3"></ProductItem>
</div>
<Scroll class="product-list-wrapper" direction="horizontal" :options="scrollOpts">
<ul class="list-wrapper">
<ProductItem v-for="item in 3" class="list-item"></ProductItem>
</ul>
</Scroll>
</template>
<script>
import ProductItem from './product-item'
import {Scroll} from 'cube-ui';
import ProductItem from './product-item';
export default {
name: 'Products',
props: {
list: {
type: Array,
default() {
return [];
name: 'Test',
data() {
return {
scrollOpts: {
click: false
}
}
};
},
components: {
Scroll,
ProductItem
}
}
};
</script>
<style lang="scss" scoped>
.products-wrapper {
overflow: scroll;
.product-list-wrapper {
width: 290px;
height: 100px;
overflow: hidden;
/deep/ .cube-scroll-content {
display: inline-block;
}
}
.item {
.list-wrapper {
padding: 0 10px;
line-height: 60px;
white-space: nowrap;
}
.list-item {
display: inline-block;
margin-right: 20px;
}
</style>
... ...
export default [{
path: '/order/:id',
name: 'order',
... ...
... ... @@ -53,6 +53,7 @@ export default {
probeType: 3,
click: true,
directionLockThreshold: 0,
stopPropagation: true
}
};
},
... ...