From c9b20e22f3b6a10d934ba0d119f519ce466f6fd6 Mon Sep 17 00:00:00 2001 From: season Date: Tue, 17 Dec 2019 12:18:17 +0800 Subject: [PATCH] 分类默认显示没有设置的时候,默认为0优化 --- pages/goods/categoryList/categoryList.js | 4 ++++ 1 file changed, 4 insertions(+), 0 deletions(-) diff --git a/pages/goods/categoryList/categoryList.js b/pages/goods/categoryList/categoryList.js index 89c9478..c91436d 100644 --- a/pages/goods/categoryList/categoryList.js +++ b/pages/goods/categoryList/categoryList.js @@ -90,6 +90,10 @@ Page({ var switch_list_data = data.switch_list; var switch_list = JSON.parse(switch_list_data); var is_newsgoodstype = switch_list.is_newsgoodstype; + if (is_newsgoodstype==undefined) + { + is_newsgoodstype=0; + } that.setData({ is_used_share :is_newsgoodstype}); if (e.categoryset.indexOf("," + 1 + ",") != -1) { that.setData({ is_show_pl: 1 }); } if (e.categoryset.indexOf("," + 3 + ",") != -1) { that.setData({ is_show_pp: 1 }); } -- libgit2 0.21.4