分类完善
This commit is contained in:
@@ -6,7 +6,8 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
type: []
|
||||
type: [],
|
||||
list:[]
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -23,11 +24,29 @@ Page({
|
||||
this.setData({
|
||||
type: res.data.result
|
||||
})
|
||||
this.select({detail:{id:res.data.result[0].id}})
|
||||
console.log(this.data.type, 150)
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
select(a){
|
||||
// console.log(a)
|
||||
// a.detail.id
|
||||
request({
|
||||
url:'Goods/goodsList',
|
||||
urldata:{
|
||||
id:a.detail.id,
|
||||
sort:'shop_price',
|
||||
sort_asc:'desc',
|
||||
p:0
|
||||
}
|
||||
}).then((res)=>{
|
||||
console.log(res)
|
||||
this.setData({
|
||||
list:res.data.result.goods_list
|
||||
})
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<view class="box">
|
||||
<navigation types="{{type}}"></navigation>
|
||||
<list ></list>
|
||||
<navigation bindselect="select" types="{{type}}"></navigation>
|
||||
<list list="{{list}}"></list>
|
||||
</view>
|
||||
Reference in New Issue
Block a user