换ubuntu
This commit is contained in:
@@ -1,98 +1,98 @@
|
||||
// pages/classify/classify.js
|
||||
import { request } from "../../utils/bin"
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
type: [],
|
||||
list:[]
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function(options) {
|
||||
request({
|
||||
url: "Goods/goodsCategoryList",
|
||||
data: {
|
||||
parent_id: 2
|
||||
}
|
||||
}).then((res) => {
|
||||
// console.log(res)
|
||||
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
|
||||
})
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function() {
|
||||
|
||||
}
|
||||
// pages/classify/classify.js
|
||||
import { request } from "../../utils/bin"
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
type: [],
|
||||
list:[]
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function(options) {
|
||||
request({
|
||||
url: "Goods/goodsCategoryList",
|
||||
data: {
|
||||
parent_id: 2
|
||||
}
|
||||
}).then((res) => {
|
||||
// console.log(res)
|
||||
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
|
||||
})
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function() {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"list":"../components/classify/list/index",
|
||||
"navigation":"../components/classify/navigation/index"
|
||||
}
|
||||
{
|
||||
"usingComponents": {
|
||||
"list":"../components/classify/list/index",
|
||||
"navigation":"../components/classify/navigation/index"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
.box{
|
||||
width: 750rpx;
|
||||
display: flex;
|
||||
border-top: 1rpx solid #eaeaea;
|
||||
|
||||
|
||||
.box{
|
||||
width: 750rpx;
|
||||
display: flex;
|
||||
border-top: 1rpx solid #eaeaea;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<view class="box">
|
||||
<navigation bindselect="select" types="{{type}}"></navigation>
|
||||
<list list="{{list}}"></list>
|
||||
<view class="box">
|
||||
<navigation bindselect="select" types="{{type}}"></navigation>
|
||||
<list list="{{list}}"></list>
|
||||
</view>
|
||||
@@ -1 +1 @@
|
||||
.box{width:750rpx;display:flex;border-top:1rpx solid #eaeaea}
|
||||
.box{width:750rpx;display:flex;border-top:1rpx solid #eaeaea}
|
||||
|
||||
Reference in New Issue
Block a user