分类完善

This commit is contained in:
2019-12-19 17:22:23 +08:00
parent 0c0acf2540
commit edc8983853
9 changed files with 158 additions and 123 deletions

View File

@@ -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
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

View File

@@ -1,4 +1,4 @@
<view class="box">
<navigation types="{{type}}"></navigation>
<list ></list>
<navigation bindselect="select" types="{{type}}"></navigation>
<list list="{{list}}"></list>
</view>