123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <template name="floors">
- <view>
- <view class="floors-content clearfix">
- <view class="tui-block__box tui-mtop__20" v-for="(floor,index) in list" :key="index">
- <view class="tui-group-name" >
- <view>
- <text class="tui-sub__desc tui-color__pink">{{ floor.topic }}</text>
- </view>
- <view class="tui-more__box" @click="handleFloor(floor)">
- <text>更多</text>
- <text class="iconfont icon-xiangyou"></text>
- </view>
- </view>
- <scroll-view scroll-x>
- <view class="tui-goods__list">
- <view class="tui-goods__item" @click="productDetail(pros.productId)" v-for="pros in floor.products">
- <view class="tui-goods__imgbox">
- <image :src="pros.mainImage" mode="" class="tui-goods__img"></image>
- </view>
- <view class="tui-goods__namebox">
- <text>{{ pros.name }}</text>
- </view>
- <view class="tui-pri__box">
- <view class="tui-sale-pri" v-if="hasLogin">
- ¥{{ pros.price | NumFormat }}
- </view>
- <view v-else class="tui-no-price">
- <view class="p-stars">
- <!-- <text class="p-no">¥</text> -->
- <uni-grader
- :grade="pros.priceGrade"
- :margin="14"
- ></uni-grader>
- </view>
- </view>
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import { mapState, mapMutations } from 'vuex'
- import uniGrader from '@/components/uni-grade/uni-grade.vue'
- export default{
- name:'floors',
- components: {
- uniGrader
- },
- props:{
- list:{
- type:Array
- }
- },
- filters: {
- NumFormat: function(text) {
- //处理金额
- return Number(text).toFixed(2)
- }
- },
- data() {
- return{
- }
- },
- created(){
- },
- computed: {
- ...mapState(['hasLogin'])
- },
- methods:{
- handleFloor(floor){
- this.$api.navigateTo(`/pages/goods/good-floor?id=${floor.id}`)
- },
- productDetail(productId) {
- // 跳转商品详情
- this.$api.navigateTo(`/pages/goods/product?id=${productId}`)
- },
- }
- }
- </script>
- <style lang="scss">
- .floors-content{
- width: 100%;
- height: auto;
- box-sizing: border-box;
- background: #FFFFFF;
- .tui-block__box {
- width: 100%;
- padding: 0 25rpx 25rpx;
- box-sizing: border-box;
- background-color: #ffffff;
- border-radius: 20rpx;
- overflow: hidden;
- }
- .tui-mtop__20 {
- margin-top: 20rpx;
- }
- .tui-group-name {
- width: 100%;
- line-height: 50rpx;
- font-weight: bold;
- text-align: center;
- padding: 24rpx 0 0 0;
- display: flex;
- align-items: center;
- justify-content: space-between;
- color: #333;
- }
- .tui-sub__desc {
- color: #333;
- font-size: 36rpx;
- font-weight: 400;
- }
- .tui-more__box {
- display: flex;
- align-items: center;
- font-weight: 400;
- color: #999;
- line-height: 50rpx;
- .iconfont{
- font-size: 28rpx;
- margin-left: 10rpx;
- }
- }
- .tui-more__box text{
- font-size: 24rpx;
- }
- .tui-goods__list {
- display: flex;
- align-items: center;
- }
- .tui-goods__item {
- background-color: #fff;
- width: 210rpx;
- height: 390rpx;
- border-radius: 6rpx;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- flex-shrink: 0;
- margin-right: 18rpx;
- }
- .tui-goods__imgbox {
- width: 210rpx;
- height: 210rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- box-sizing: border-box;
- border-radius: 8rpx;
- }
-
- .tui-goods__img {
- width: 210rpx;
- height: 210rpx;
- display: block;
- border-radius: 8rpx;
- }
-
- .tui-goods__namebox{
- width: 210rpx;
- height: 80rpx;
- margin-top: 16rpx;
- line-height: 40rpx;
- text-overflow: ellipsis;
- display: -webkit-box;
- word-break: break-all;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- overflow: hidden;
- font-size: 26rpx;
- color: #333333;
- }
-
- .tui-pri__box {
- width: 210rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- }
-
- .tui-sale-pri {
- width: 210rpx;
- display: flex;
- align-items: flex-end;
- padding: 10rpx 0 8rpx;
- box-sizing: border-box;
- font-size: 28rpx;
- line-height: 40rpx;
- color: #EE2727;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- text-align: left;
- }
- .tui-no-price {
- width: 210rpx;
- height: 40rpx;
- line-height: 40rpx;
- display: flex;
- box-sizing: border-box;
- .p-no {
- line-height: 40rpx;
- font-size: $font-size-28;
- color: $text-color;
- display: inline-block;
- float: left;
- }
- .p-stars {
- float: left;
- }
- }
- .tui-size-sm {
- font-size: 24rpx;
- line-height: 24rpx;
- transform: scale(0.8);
- transform-origin: 0 50%;
- }
-
- .tui-original__pri {
- font-size: 24rpx;
- line-height: 24rpx;
- color: #999999;
- transform-origin: center 10%;
- transform: scale(0.8);
- display: flex;
- align-items: center;
- justify-content: center;
- text-decoration: line-through;
- }
-
- }
- </style>
|