main
liudan 1 year ago
parent 25ed58f3d4
commit afdbbee042
  1. 9
      pages/index/components/sh-hot-goods.vue
  2. 1
      pages/index/index.vue

@ -76,7 +76,7 @@ export default {
data() { data() {
return { return {
listParams: { listParams: {
page: 1 page: 1,
}, // }, //
lastPage: 1, // lastPage: 1, //
total: 0, // total: 0, //
@ -100,6 +100,12 @@ export default {
detail: { detail: {
type: Object, type: Object,
default: () => {} default: () => {}
},
per_page:{
type:Number,
default:()=>{
return 10
}
} }
}, },
created() { created() {
@ -155,6 +161,7 @@ export default {
// //
getGoodsList() { getGoodsList() {
let that = this; let that = this;
this.listParams.per_page = this.per_page
that.$http('goods.lists', this.listParams).then(res => { that.$http('goods.lists', this.listParams).then(res => {
if (res.code === 1) { if (res.code === 1) {
this.lastPage = res.data.last_page; this.lastPage = res.data.last_page;

@ -53,6 +53,7 @@
<!-- 推荐商品 --> <!-- 推荐商品 -->
<sh-hot-goods <sh-hot-goods
:per_page="100"
v-if="item.type === 'goods-list' || item.type === 'goods-group'" v-if="item.type === 'goods-list' || item.type === 'goods-group'"
:detail="item.content" :detail="item.content"
></sh-hot-goods> ></sh-hot-goods>

Loading…
Cancel
Save