comment 7.2

This commit is contained in:
2020-07-24 19:48:57 +08:00
parent 4196f545fd
commit dd71a0f32a
23 changed files with 1630 additions and 350 deletions

View File

@@ -1,25 +1,21 @@
<template>
<view class="list">
<view class="top">
商品推荐
</view>
<view class="top">商品推荐</view>
<view>
<u-tabs-swiper ref="uTabs" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="60" ></u-tabs-swiper>
</view>
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}">
<swiper-item class="swiper-item" v-for="(_, index) in classifyList" :key="index">
<!-- <scroll-view scroll-y style="height: 800rpx;width: 100%;"> -->
<view class="goods-item">
<item v-for="item in goodsList" :key="item.goods_id" :info="item"></item>
</view>
<u-empty text="暂无商品" mode="list" color="#000" v-if="!goodsList.length"></u-empty>
<!-- </scroll-view> -->
<view class="goods-item">
<item v-for="item in goodsList" :key="item.goods_id" :info="item"></item>
</view>
<u-empty text="暂无商品" mode="list" color="#000" v-if="!goodsList.length"></u-empty>
</swiper-item>
</swiper>
<!-- 加载更多 -->
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20"></u-loadmore>
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20"></u-loadmore>
<!-- <loadmore ref="loadmore" @callback="getGoodsRecommend" bgColor="#FFF" :page="page"></loadmore> -->
</view>
</view>
</template>
<script>
import item from "./item";
@@ -124,29 +120,17 @@ export default {
</script>
<style lang="scss" scoped>
.list{
.top{
background-color: #ffffff;
padding: 30rpx {
top: 0;
};
.top {
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
text-align: center;
color: #333;
}
// .label{
// display: flex;
// color: #999;
// flex-wrap: wrap;
// >text{
// margin-right: 34rpx;
// margin-bottom: 10rpx;
// }
// }
// .item{
// display: flex;
// flex-wrap: wrap;
// justify-content: space-between;
// margin-top: 20rpx;
// }
.goods-item {
display: flex;
flex-wrap: wrap;

View File

@@ -16,20 +16,27 @@ export default {
},
methods: {
toDetailsPage() {
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.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,
type: 1,
}
})
})
}
},
}