<template>
|
<view>
|
<view class="goodsData" style="margin-top: 30upx;">
|
<view class="goods-list" v-if="goodsData.length > 0">
|
<view class="goods-item" v-for="(itm, idx) in goodsData" @click="$util.goPages('/pages/ginfo/ginfo?id=' + itm.id)">
|
<image lazy-load class="goods-icon" :src="itm.icon" mode="widthFix"></image>
|
<view class="goods-title">{{itm.title}}</view>
|
<view class="goods-price">
|
<view>¥</view>
|
<view class="red">{{itm.vprice}}</view>
|
</view>
|
</view>
|
</view>
|
<view class="noData" v-else>
|
<image src="/static/imgs/noData.png" mode="" style="margin-top: 200upx;"></image>
|
<view class="">没有商品信息</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
goodsData: [],
|
catesId: 0,
|
is_hot: '',
|
pageIndex: 1,
|
pageSize: 200,
|
}
|
},
|
onLoad (op) {
|
this.catesId = op.catesId ? op.catesId : 0
|
this.is_hot = op.is_hot ? op.is_hot : ''
|
uni.setNavigationBarTitle({
|
title: op.title
|
})
|
this.catesGoods()
|
},
|
methods: {
|
//获取分类商品
|
catesGoods(){
|
this.$util.post('Goods/getCatesGoods', {catesId: this.catesId, is_hot: this.is_hot, pageIndex: this.pageIndex, pageSize: this.pageSize}).then(res => {
|
if(res.code == 1) {
|
this.goodsData = res.data.list
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style>
|
@import url(/static/css/search.css);
|
</style>
|