2020-07-17 09:49:42 +08:00
|
|
|
|
<template>
|
2020-07-21 15:00:39 +08:00
|
|
|
|
<view class="item" @click="xuanzhongs">
|
|
|
|
|
<image :src="image"></image>
|
|
|
|
|
<view class="title u-line-1" >{{title}}</view>
|
2020-07-21 08:57:48 +08:00
|
|
|
|
<view class="info">
|
2020-07-21 15:00:39 +08:00
|
|
|
|
<text>{{price}}</text>
|
|
|
|
|
<text>销量:{{num}}</text>
|
2020-07-21 08:57:48 +08:00
|
|
|
|
</view>
|
2020-07-21 15:00:39 +08:00
|
|
|
|
<u-checkbox class="xuanzhong" active-color="#FF7A15" :name="sid" v-model="xuanzhong" @change="xuanzhongs">
|
|
|
|
|
</u-checkbox>
|
2020-07-21 08:57:48 +08:00
|
|
|
|
</view>
|
2020-07-17 09:49:42 +08:00
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
name:"shop-item",
|
|
|
|
|
data(){
|
|
|
|
|
return {
|
2020-07-21 17:03:59 +08:00
|
|
|
|
xuanzhong:false,
|
2020-07-21 15:00:39 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2020-08-08 16:53:44 +08:00
|
|
|
|
props:['image','title','price','num','sid','wxuanzhong'],
|
2020-07-21 15:00:39 +08:00
|
|
|
|
methods:{
|
|
|
|
|
xuanzhongs(){
|
|
|
|
|
this.xuanzhong = !this.xuanzhong
|
|
|
|
|
this.$emit("xuanzhong")
|
2020-07-17 09:49:42 +08:00
|
|
|
|
}
|
2020-08-08 16:53:44 +08:00
|
|
|
|
},
|
|
|
|
|
watch:{
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
created(){
|
|
|
|
|
this.xuanzhong = this.wxuanzhong
|
|
|
|
|
console.log(this.wxuanzhong)
|
2020-07-17 09:49:42 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-07-21 08:57:48 +08:00
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.item{
|
|
|
|
|
width: 214rpx;
|
2020-07-21 15:00:39 +08:00
|
|
|
|
// height: 297rpx;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
border-radius:10rpx 10rpx 0 0;
|
|
|
|
|
padding-bottom: 14rpx;
|
|
|
|
|
overflow: hidden;
|
2020-07-21 08:57:48 +08:00
|
|
|
|
position: relative;
|
|
|
|
|
>image{
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 207rpx;
|
|
|
|
|
}
|
|
|
|
|
.title{
|
|
|
|
|
width: 194rpx;
|
|
|
|
|
margin: 19rpx auto;
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
font-size: 26rpx;
|
|
|
|
|
color: #333;
|
|
|
|
|
}
|
|
|
|
|
.info{
|
|
|
|
|
display: flex;
|
|
|
|
|
padding: 0 10rpx;
|
|
|
|
|
align-items: flex-end;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
>text:first-child{
|
|
|
|
|
font-size: 26rpx;
|
|
|
|
|
color: #FF3131;
|
|
|
|
|
}
|
|
|
|
|
>text:last-child{
|
|
|
|
|
font-size: 20rpx;
|
|
|
|
|
color: #999;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-07-21 15:00:39 +08:00
|
|
|
|
.xuanzhong{
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 8rpx;
|
|
|
|
|
top: 8rpx;
|
|
|
|
|
}
|
2020-07-21 08:57:48 +08:00
|
|
|
|
}
|
|
|
|
|
</style>
|