Commit b9848769a5fc14b7a2aafce33d8b313d56a6d062
1 parent
62d5a19f
脚本出错的bug优化
Showing
3 changed files
with
12 additions
and
12 deletions
packageA/pages/prom_list/prom_list.js
... | ... | @@ -722,7 +722,7 @@ Page({ |
722 | 722 | if (e.data.code == 0) { |
723 | 723 | |
724 | 724 | //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店 |
725 | - if(dd.lat && !th.data.def_pick_store && th.data.bconfig.is_sort_storage){ | |
725 | + if(dd.lat && !th.data.def_pick_store && th.data.bconfig && th.data.bconfig.is_sort_storage){ | |
726 | 726 | th.setData({ |
727 | 727 | def_pick_store:e.data.data.pageData[0], |
728 | 728 | sto_sele_name: e.data.data.pageData[0].pickup_name, |
... | ... | @@ -905,7 +905,7 @@ Page({ |
905 | 905 | only_pk: e.data.data.pageData |
906 | 906 | }); |
907 | 907 | //-----如果没有默认门店,要取第一个门店作为默认店------ |
908 | - if (!th.data.def_pick_store && th.data.bconfig.is_sort_storage) { | |
908 | + if (!th.data.def_pick_store && th.data.bconfig && th.data.bconfig.is_sort_storage) { | |
909 | 909 | th.setData({ |
910 | 910 | def_pick_store:e.data.data.pageData[0], |
911 | 911 | sto_sele_name: e.data.data.pageData[0].pickup_name, |
... | ... | @@ -1149,7 +1149,7 @@ Page({ |
1149 | 1149 | } |
1150 | 1150 | |
1151 | 1151 | |
1152 | - if (bconfig.is_sort_storage) { | |
1152 | + if (bconfig && bconfig.is_sort_storage) { | |
1153 | 1153 | wx.getLocation({ |
1154 | 1154 | type: 'gcj02', |
1155 | 1155 | success: function(res) { |
... | ... | @@ -1478,7 +1478,7 @@ Page({ |
1478 | 1478 | th.data.t_time = setInterval(function() { |
1479 | 1479 | if (th.data.bconfig == null) false; |
1480 | 1480 | var e = th.data.bconfig; |
1481 | - if (e.is_sort_storage) { | |
1481 | + if (e && e.is_sort_storage) { | |
1482 | 1482 | wx.getLocation({ |
1483 | 1483 | type: 'gcj02', |
1484 | 1484 | success: function(res) { | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -2111,7 +2111,7 @@ Page({ |
2111 | 2111 | if (e.data.code == 0) { |
2112 | 2112 | |
2113 | 2113 | //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店 |
2114 | - if(dd.lat && (!th.data.def_pick_store || JSON.stringify(th.data.def_pick_store)=='{}') && th.data.bconfig.is_sort_storage){ | |
2114 | + if(dd.lat && (!th.data.def_pick_store || JSON.stringify(th.data.def_pick_store)=='{}') && th.data.bconfig && th.data.bconfig.is_sort_storage){ | |
2115 | 2115 | th.setData({ |
2116 | 2116 | def_pick_store:e.data.data.pageData[0], |
2117 | 2117 | sto_sele_name: e.data.data.pageData[0].pickup_name, |
... | ... | @@ -2300,7 +2300,7 @@ Page({ |
2300 | 2300 | only_pk: e.data.data.pageData |
2301 | 2301 | }); |
2302 | 2302 | //-----如果没有默认门店,要取第一个门店作为默认店------ |
2303 | - if (!th.data.def_pick_store && th.data.bconfig.is_sort_storage) { | |
2303 | + if (!th.data.def_pick_store && th.data.bconfig && th.data.bconfig.is_sort_storage) { | |
2304 | 2304 | th.setData({ |
2305 | 2305 | def_pick_store:e.data.data.pageData[0], |
2306 | 2306 | sto_sele_name: e.data.data.pageData[0].pickup_name, |
... | ... | @@ -4297,7 +4297,7 @@ Page({ |
4297 | 4297 | } |
4298 | 4298 | |
4299 | 4299 | |
4300 | - if (bconfig.is_sort_storage) { | |
4300 | + if (bconfig && bconfig.is_sort_storage) { | |
4301 | 4301 | wx.getLocation({ |
4302 | 4302 | type: 'gcj02', |
4303 | 4303 | success: function(res) { |
... | ... | @@ -4638,7 +4638,7 @@ Page({ |
4638 | 4638 | var t_time = setInterval(function() { |
4639 | 4639 | if (th.data.bconfig == null) false; |
4640 | 4640 | var e = th.data.bconfig; |
4641 | - if (e.is_sort_storage) { | |
4641 | + if (e && e.is_sort_storage) { | |
4642 | 4642 | wx.getLocation({ |
4643 | 4643 | type: 'gcj02', |
4644 | 4644 | success: function(res) { | ... | ... |
pages/team/team_show/team_show.js
... | ... | @@ -976,7 +976,7 @@ Page({ |
976 | 976 | return false; |
977 | 977 | } |
978 | 978 | |
979 | - if (bconfig.is_sort_storage) { | |
979 | + if ( bconfig && bconfig.is_sort_storage) { | |
980 | 980 | wx.getLocation({ |
981 | 981 | type: 'gcj02', |
982 | 982 | success: function(res) { |
... | ... | @@ -1041,7 +1041,7 @@ Page({ |
1041 | 1041 | var t_time = setInterval(function() { |
1042 | 1042 | if (th.data.bconfig == null) false; |
1043 | 1043 | var e = th.data.bconfig; |
1044 | - if (e.is_sort_storage) { | |
1044 | + if (e && e.is_sort_storage) { | |
1045 | 1045 | wx.getLocation({ |
1046 | 1046 | type: 'gcj02', |
1047 | 1047 | success: function(res) { |
... | ... | @@ -1116,7 +1116,7 @@ Page({ |
1116 | 1116 | if (e.data.code == 0) { |
1117 | 1117 | |
1118 | 1118 | //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店 |
1119 | - if(dd.lat && !th.data.def_pick_store && th.data.bconfig.is_sort_storage){ | |
1119 | + if(dd.lat && !th.data.def_pick_store && th.data.bconfig && th.data.bconfig.is_sort_storage){ | |
1120 | 1120 | th.setData({ |
1121 | 1121 | def_pick_store:e.data.data.pageData[0], |
1122 | 1122 | sto_sele_name: e.data.data.pageData[0].pickup_name, |
... | ... | @@ -1296,7 +1296,7 @@ Page({ |
1296 | 1296 | only_pk: e.data.data.pageData |
1297 | 1297 | }); |
1298 | 1298 | //-----如果没有默认门店,要取第一个门店作为默认店------ |
1299 | - if (!th.data.def_pick_store && th.data.bconfig.is_sort_storage) { | |
1299 | + if (!th.data.def_pick_store && th.data.bconfig && th.data.bconfig.is_sort_storage) { | |
1300 | 1300 | th.setData({ |
1301 | 1301 | def_pick_store:e.data.data.pageData[0], |
1302 | 1302 | sto_sele_name: e.data.data.pageData[0].pickup_name, | ... | ... |