deming/pageB/components/sdetails/tloos.vue
2020-07-06 10:25:54 +08:00

187 lines
5.2 KiB
Vue

<template>
<view>
<view class="tloos">
<view class="navs">
<image></image>
店铺
</view>
<view class="navs" style="margin-right:30rpx">
<image></image>
客服
</view>
<view class="button" style="background:rgba(253,211,96,0.6);">试穿试送</view>
<view class="button" style="background:rgba(253,211,96,1);" @click="buy(2)">加入购物车</view>
<view class="button" style="background:rgba(255,120,15,1);" @click="buy(1)">立即购买</view>
<u-toast ref="uToast" />
</view>
<u-popup v-model="show" mode="bottom">
<view class="popup">
<view class="head">
<image class="image"></image>
<view class="info">
<text class="u-line-2">套装新款小个子春季时尚韩版短袖衬
衫套装新款小个子春季时尚韩版...套装新款小个子春季时尚韩版短袖衬衫套装新款小个子春季时尚韩版...</text>
<text>¥99</text>
</view>
</view>
<view class="guige">
<view class="title">
选择尺码
</view>
<view class="item">
<text>均码</text>
<text class="xuanzhong">S</text>
<text>M</text>
</view>
</view>
<view class="num">
<text>购买数量</text>
<u-number-box v-model="value" @change="valChange"></u-number-box>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
name:"tloos",
props: ['id'],
data(){
return {
show:true,
value:1
}
},
methods: {
//添加购物车
addCart() {
this.$u.api.addCart({
goods_id: this.id,
quantity: 1,
}).then(res => {
this.$refs.uToast.show({
title: res.message,
type: res.errCode == 0 ? 'success' : 'warning',
})
})
},
buy(type){
this.show = true
},
valChange(e) {
console.log('当前值为: ' + e.value)
}
},
}
</script>
<style lang="scss" scoped>
.tloos{
background-color: #fff;
display: flex;
position: fixed;
height: 98rpx;
width: 100%;
bottom:0;
border-top: 1rpx solid #ececec;
z-index: 1000000;
.navs{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 24rpx;
color: #666;
flex-shrink: 0;
margin-left: 30rpx;
>image{
width: 35rpx;
height: 35rpx;
margin-bottom: 15rpx;
}
}
.button{
width: 100%;
height: 100%;
line-height: 98rpx;
text-align: center;
color: #fff;
}
}
.popup{
padding: 30rpx;
padding-bottom: 180rpx;
.head{
display: flex;
margin-bottom: 30rpx;
.image{
width: 195rpx;
height: 195rpx;
border-radius: 10rpx;
flex-shrink: 0;
}
.info{
display: flex;
padding: 21rpx 0;
justify-content: space-between;
margin-left: 27rpx;
flex-direction: column;
>text:first-child{
font-size: 28rpx;
color: #333;
}
>text:last-child{
font-size: 30rpx;
color: #ff3131;
}
}
}
.guige{
margin-top: 30rpx;
padding-bottom: 30rpx;
border-bottom: #ececec solid 2rpx;
.title{
font-size: 28rpx;
color: #333;
margin-bottom: 29rpx;
}
.item{
display: flex;
flex-wrap: wrap;
>text{
min-width: 120rpx;
height: 60rpx;
background-color: #ececec;
color: #999;
text-align: center;
line-height: 60rpx;
box-sizing: border-box;
border-radius: 6rpx;
margin-right: 26rpx;
}
.xuanzhong{
border: #ff780f 1rpx solid;
color: #FF780F;
background-color: #FFF1E6;
}
}
}
.num{
height: 84rpx;
display: flex;
border-bottom: #ececec solid 2rpx;
justify-content: space-between;
align-items: center;
>text{
font-size: 26rpx;
color: #666;
}
}
}
</style>