deming/components/shop/list/item.vue

84 lines
1.9 KiB
Vue
Raw Normal View History

2020-06-11 16:37:52 +08:00
<template>
2020-06-29 17:24:57 +08:00
<view class="item" @click="toDetailsPage">
2020-08-04 19:39:31 +08:00
<image :src="info.goods_image" mode="aspectFill" class="img"></image>
2020-06-11 16:37:52 +08:00
<view class="info">
2020-08-04 20:00:58 +08:00
<text class="title u-line-2">{{ info.goods_name }}</text>
2020-08-07 19:56:47 +08:00
<!-- <text class="jianjie u-line-1">{{ info.goods_advword }}</text> -->
2020-07-23 14:56:20 +08:00
<text class="price">{{ info.goods_price }}</text>
2020-06-11 16:37:52 +08:00
</view>
</view>
</template>
<script>
export default {
2020-06-18 14:57:26 +08:00
name:"item",
props: {
info: Object
2020-06-29 08:47:37 +08:00
},
methods: {
2020-06-29 17:24:57 +08:00
toDetailsPage() {
2020-07-24 19:48:57 +08:00
// this.$u.api.getGoodsDetails({ id: this.info.goods_id }).then(res => {
// if (res.errCode == 0) {
// const goods = {
// goods: res.data,
// type: 1,
// }
// this.$store.commit('setGoodsDetails', goods);
// this.$store.commit('setGoodsId', this.info.goods_id);
// this.$u.route({
// url: 'pageB/sdetails/index',
// })
// // console.log(this.goodsInfo.mobile_body);
// }
// })
this.$u.route({
url: 'pageB/sdetails/index',
params: {
id: this.info.goods_id,
2020-08-12 18:38:14 +08:00
// type: 1,
2020-06-29 08:47:37 +08:00
}
2020-07-24 19:48:57 +08:00
})
2020-06-29 08:47:37 +08:00
}
},
2020-06-11 16:37:52 +08:00
}
</script>
<style lang="scss" scoped>
.item{
width: 330rpx;
2020-08-07 19:56:47 +08:00
height: 480rpx;
2020-07-23 14:56:20 +08:00
margin-bottom: 26rpx;
2020-06-11 16:37:52 +08:00
background-color: #f8f8f8;
2020-07-23 14:56:20 +08:00
border-radius: 10rpx 10rpx 0rpx 0rpx;
2020-06-11 16:37:52 +08:00
.img{
2020-07-23 14:56:20 +08:00
width: 330rpx;
2020-08-04 19:39:31 +08:00
height: 300rpx;
2020-07-23 14:56:20 +08:00
background: rgba(245,245,245,1);
border-radius: 10rpx 10rpx 0rpx 0rpx;
margin-bottom: 24rpx;
2020-06-11 16:37:52 +08:00
}
.info{
2020-06-18 14:57:26 +08:00
width: 320rpx;
2020-07-23 14:56:20 +08:00
padding: 0 12rpx 28rpx;
2020-06-11 16:37:52 +08:00
display: flex;
flex-direction: column;
justify-content: space-around;
.title{
2020-08-07 19:56:47 +08:00
margin-bottom: 16rpx;
font-size: 26rpx;
font-weight: 600;
2020-08-08 12:07:50 +08:00
height: 60rpx;
2020-08-07 19:56:47 +08:00
line-height: 30rpx;
2020-06-11 16:37:52 +08:00
color: #333;
}
.jianjie{
font-size: 26rpx;
color: #666;
2020-07-23 14:56:20 +08:00
margin-bottom: 20rpx;
2020-08-04 22:34:03 +08:00
line-height: 38rpx;
2020-06-11 16:37:52 +08:00
}
.price{
color: #FF3131;
font-size: 26rpx;
}
}
}
</style>