|
@@ -7,7 +7,9 @@
|
|
|
<!-- 商品 -->
|
|
|
<view class="goods">
|
|
|
<view v-for="(item,index) in goodsList" :key="index" v-if="item&&item.list.length">
|
|
|
- <u-section :title="item.type.name" font-size="35" line-color="#01c9b2" sub-title="更多" @click="toGoods(item.type)"></u-section>
|
|
|
+ <u-section :title="item.type.name" font-size="35" line-color="#01c9b2" sub-title="更多" @click="toGoods(item.type)">
|
|
|
+ <view slot="right" style="color: #01c9b2;font-size: 30rpx;">更多<u-icon name="arrow-right"></u-icon></view>
|
|
|
+ </u-section>
|
|
|
<view class="goods-list">
|
|
|
<uni-coods :goldLimit="item.type.goldLimit" :list="item.list"></uni-coods>
|
|
|
</view>
|
|
@@ -45,7 +47,8 @@
|
|
|
},
|
|
|
computed: {
|
|
|
goodsListLength() {
|
|
|
- return this.goodsList.length
|
|
|
+ let len = this.goodsList.length
|
|
|
+ return len
|
|
|
}
|
|
|
},
|
|
|
onShow() {
|
|
@@ -61,6 +64,7 @@
|
|
|
// 下拉刷新
|
|
|
onPullDownRefresh() {
|
|
|
console.log('refresh')
|
|
|
+ this.noDataText = '正在加载...'
|
|
|
this.pageInit()
|
|
|
setTimeout(function () {
|
|
|
uni.stopPullDownRefresh()
|
|
@@ -83,6 +87,25 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 查询商品
|
|
|
+ getGoods(item,index){
|
|
|
+ getGoodsList({
|
|
|
+ pageNo:1,
|
|
|
+ pageSize:item.popularizeGoodsLimit,
|
|
|
+ goodsTypeNo:item.goodsTypeNo,
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res,'goodsList')
|
|
|
+ if(res.status == 200&&res.data.list&&res.data.list.length){
|
|
|
+ this.goodsList[index] = {
|
|
|
+ type: item,
|
|
|
+ list: res.data.list
|
|
|
+ }
|
|
|
+ this.goodsList.splice()
|
|
|
+ }else{
|
|
|
+ this.noDataText = '暂无商品'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 点击banner
|
|
|
clickBanner(index){
|
|
|
let row = this.imageTopList[index]
|
|
@@ -114,19 +137,6 @@
|
|
|
url:"/pages/goods/goods?goodsTypeNo="+ item.goodsTypeNo + "&goldLimit="+ item.goldLimit + "&name=" + item.name
|
|
|
})
|
|
|
},
|
|
|
- // 查询商品
|
|
|
- getGoods(item,index){
|
|
|
- getGoodsList({pageNo:1,pageSize:item.popularizeGoodsLimit,goodsTypeNo:item.goodsTypeNo}).then(res => {
|
|
|
- console.log(res,'goodsList')
|
|
|
- if(res.status == 200&&res.data.list&&res.data.list.length){
|
|
|
- this.goodsList[index] = {
|
|
|
- type: item,
|
|
|
- list: res.data.list
|
|
|
- }
|
|
|
- this.goodsList.splice()
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
</script>
|