diff --git a/pages/index/index/index.js b/pages/index/index/index.js index c4d086d..4ab4fd1 100644 --- a/pages/index/index/index.js +++ b/pages/index/index/index.js @@ -74,6 +74,7 @@ Page({ }, async onShow() { + var th=this; await this.init_load(); //显示的时候要开启计时器 this.data.is_timer = 1; @@ -105,7 +106,7 @@ Page({ //---处理正在6个分类---- await getApp().request.promiseGet("/api/weshop/goodscategory/page", { - data: {store_id: os.stoid, pageSize: 6} + data: {store_id: os.stoid, pageSize: 6,is_show:1} }).then(res => { var gd_category=res.data.data.pageData; th.seData({gd_category:gd_category}); diff --git a/utils/util.js b/utils/util.js index 53568d6..85350e1 100644 --- a/utils/util.js +++ b/utils/util.js @@ -252,7 +252,7 @@ function check_mobile(phoneMobile){ function get_rand_item(arr){ if(!arr) return null; if(arr.length<=0) return null; - var ind=math.floor(math.random()*arr.length*10); + var ind=Math.floor(Math.random()*arr.length*10); return arr[ind]; }