deming/components/shop/list/item.vue

84 lines
2.1 KiB
Vue
Raw Normal View History

2020-06-11 08:37:52 +00:00
<template>
2020-06-29 09:24:57 +00:00
<view class="item" @click="toDetailsPage">
2020-08-04 11:39:31 +00:00
<image :src="info.goods_image" mode="aspectFill" class="img"></image>
2020-06-11 08:37:52 +00:00
<view class="info">
2020-08-04 12:00:58 +00:00
<text class="title u-line-2">{{ info.goods_name }}</text>
2020-08-07 11:56:47 +00:00
<!-- <text class="jianjie u-line-1">{{ info.goods_advword }}</text> -->
2020-08-17 10:09:19 +00:00
<text class="price">{{ info.goods_price }}<text style="font-size:22rpx;color:#999;text-decoration:line-through;display: inline-block;margin-left:20rpx"> {{info.goods_marketprice}}</text></text>
2020-06-11 08:37:52 +00:00
</view>
</view>
</template>
<script>
export default {
2020-06-18 06:57:26 +00:00
name:"item",
props: {
info: Object
2020-06-29 00:47:37 +00:00
},
methods: {
2020-06-29 09:24:57 +00:00
toDetailsPage() {
2020-07-24 11:48:57 +00: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 10:38:14 +00:00
// type: 1,
2020-06-29 00:47:37 +00:00
}
2020-07-24 11:48:57 +00:00
})
2020-06-29 00:47:37 +00:00
}
},
2020-06-11 08:37:52 +00:00
}
</script>
<style lang="scss" scoped>
.item{
width: 330rpx;
2020-08-07 11:56:47 +00:00
height: 480rpx;
2020-07-23 06:56:20 +00:00
margin-bottom: 26rpx;
2020-06-11 08:37:52 +00:00
background-color: #f8f8f8;
2020-07-23 06:56:20 +00:00
border-radius: 10rpx 10rpx 0rpx 0rpx;
2020-06-11 08:37:52 +00:00
.img{
2020-07-23 06:56:20 +00:00
width: 330rpx;
2020-08-04 11:39:31 +00:00
height: 300rpx;
2020-07-23 06:56:20 +00:00
background: rgba(245,245,245,1);
border-radius: 10rpx 10rpx 0rpx 0rpx;
margin-bottom: 24rpx;
2020-06-11 08:37:52 +00:00
}
.info{
2020-06-18 06:57:26 +00:00
width: 320rpx;
2020-07-23 06:56:20 +00:00
padding: 0 12rpx 28rpx;
2020-06-11 08:37:52 +00:00
display: flex;
flex-direction: column;
justify-content: space-around;
.title{
2020-08-07 11:56:47 +00:00
margin-bottom: 16rpx;
font-size: 26rpx;
font-weight: 600;
2020-08-08 04:07:50 +00:00
height: 60rpx;
2020-08-07 11:56:47 +00:00
line-height: 30rpx;
2020-06-11 08:37:52 +00:00
color: #333;
}
.jianjie{
font-size: 26rpx;
color: #666;
2020-07-23 06:56:20 +00:00
margin-bottom: 20rpx;
2020-08-04 14:34:03 +00:00
line-height: 38rpx;
2020-06-11 08:37:52 +00:00
}
.price{
color: #FF3131;
font-size: 26rpx;
}
}
}
</style>