|
|
@@ -402,21 +402,20 @@ Page({
|
|
|
let _this = this
|
|
|
//加载分类列表
|
|
|
var params = {
|
|
|
- url: "/category/categoryInfo",
|
|
|
+ url: "/category/listCategoryForUser",
|
|
|
method: "GET",
|
|
|
data: {
|
|
|
shopId: shopId,
|
|
|
- current:1,
|
|
|
- size:99999
|
|
|
+ channelId:wx.getStorageSync('channelId')||3
|
|
|
},
|
|
|
callBack: function (res) {
|
|
|
console.log(res);
|
|
|
let categoryName = ''
|
|
|
- res.records.forEach(e => {
|
|
|
+ res.forEach(e => {
|
|
|
categoryName = e.categoryName.split('>')
|
|
|
e.categoryName = categoryName[0]
|
|
|
})
|
|
|
- let newRes = _this.splitList(res.records)
|
|
|
+ let newRes = _this.splitList(res)
|
|
|
let categoryList = newRes.splice(0,2)
|
|
|
if(categoryList.length == 2){
|
|
|
categoryList = categoryList[0].concat(categoryList[1])
|
|
|
@@ -443,20 +442,6 @@ Page({
|
|
|
let index = e.currentTarget.dataset.index + this.data.currentTop
|
|
|
let pic = e.currentTarget.dataset.pic
|
|
|
let categories = e.currentTarget.dataset.categories
|
|
|
- // if(!hassecond) return
|
|
|
- // if (categories == null || categories.length < 1) {
|
|
|
- // wx.navigateTo({
|
|
|
- // url: `/pages/sub-category/sub-category?categoryId=${categoryId}&shopId=${this.data.shop_id}`,
|
|
|
- // })
|
|
|
- // } else {
|
|
|
- // getApp().globalData.categoryId = categoryId
|
|
|
- // getApp().globalData.index = index
|
|
|
- // getApp().globalData.pic = pic
|
|
|
- // wx.navigateTo({
|
|
|
- // url: '/pages/category/category'
|
|
|
- // })
|
|
|
- // }
|
|
|
- // eventBus.emit('categoryId', categoryId);
|
|
|
wx.setStorageSync('categoryId', categoryId)
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/category1/category'
|