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,7 +722,7 @@ Page({ | ||
| 722 | if (e.data.code == 0) { | 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 | th.setData({ | 726 | th.setData({ |
| 727 | def_pick_store:e.data.data.pageData[0], | 727 | def_pick_store:e.data.data.pageData[0], |
| 728 | sto_sele_name: e.data.data.pageData[0].pickup_name, | 728 | sto_sele_name: e.data.data.pageData[0].pickup_name, |
| @@ -905,7 +905,7 @@ Page({ | @@ -905,7 +905,7 @@ Page({ | ||
| 905 | only_pk: e.data.data.pageData | 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 | th.setData({ | 909 | th.setData({ |
| 910 | def_pick_store:e.data.data.pageData[0], | 910 | def_pick_store:e.data.data.pageData[0], |
| 911 | sto_sele_name: e.data.data.pageData[0].pickup_name, | 911 | sto_sele_name: e.data.data.pageData[0].pickup_name, |
| @@ -1149,7 +1149,7 @@ Page({ | @@ -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 | wx.getLocation({ | 1153 | wx.getLocation({ |
| 1154 | type: 'gcj02', | 1154 | type: 'gcj02', |
| 1155 | success: function(res) { | 1155 | success: function(res) { |
| @@ -1478,7 +1478,7 @@ Page({ | @@ -1478,7 +1478,7 @@ Page({ | ||
| 1478 | th.data.t_time = setInterval(function() { | 1478 | th.data.t_time = setInterval(function() { |
| 1479 | if (th.data.bconfig == null) false; | 1479 | if (th.data.bconfig == null) false; |
| 1480 | var e = th.data.bconfig; | 1480 | var e = th.data.bconfig; |
| 1481 | - if (e.is_sort_storage) { | 1481 | + if (e && e.is_sort_storage) { |
| 1482 | wx.getLocation({ | 1482 | wx.getLocation({ |
| 1483 | type: 'gcj02', | 1483 | type: 'gcj02', |
| 1484 | success: function(res) { | 1484 | success: function(res) { |
pages/goods/goodsInfo/goodsInfo.js
| @@ -2111,7 +2111,7 @@ Page({ | @@ -2111,7 +2111,7 @@ Page({ | ||
| 2111 | if (e.data.code == 0) { | 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 | th.setData({ | 2115 | th.setData({ |
| 2116 | def_pick_store:e.data.data.pageData[0], | 2116 | def_pick_store:e.data.data.pageData[0], |
| 2117 | sto_sele_name: e.data.data.pageData[0].pickup_name, | 2117 | sto_sele_name: e.data.data.pageData[0].pickup_name, |
| @@ -2300,7 +2300,7 @@ Page({ | @@ -2300,7 +2300,7 @@ Page({ | ||
| 2300 | only_pk: e.data.data.pageData | 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 | th.setData({ | 2304 | th.setData({ |
| 2305 | def_pick_store:e.data.data.pageData[0], | 2305 | def_pick_store:e.data.data.pageData[0], |
| 2306 | sto_sele_name: e.data.data.pageData[0].pickup_name, | 2306 | sto_sele_name: e.data.data.pageData[0].pickup_name, |
| @@ -4297,7 +4297,7 @@ Page({ | @@ -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 | wx.getLocation({ | 4301 | wx.getLocation({ |
| 4302 | type: 'gcj02', | 4302 | type: 'gcj02', |
| 4303 | success: function(res) { | 4303 | success: function(res) { |
| @@ -4638,7 +4638,7 @@ Page({ | @@ -4638,7 +4638,7 @@ Page({ | ||
| 4638 | var t_time = setInterval(function() { | 4638 | var t_time = setInterval(function() { |
| 4639 | if (th.data.bconfig == null) false; | 4639 | if (th.data.bconfig == null) false; |
| 4640 | var e = th.data.bconfig; | 4640 | var e = th.data.bconfig; |
| 4641 | - if (e.is_sort_storage) { | 4641 | + if (e && e.is_sort_storage) { |
| 4642 | wx.getLocation({ | 4642 | wx.getLocation({ |
| 4643 | type: 'gcj02', | 4643 | type: 'gcj02', |
| 4644 | success: function(res) { | 4644 | success: function(res) { |
pages/team/team_show/team_show.js
| @@ -976,7 +976,7 @@ Page({ | @@ -976,7 +976,7 @@ Page({ | ||
| 976 | return false; | 976 | return false; |
| 977 | } | 977 | } |
| 978 | 978 | ||
| 979 | - if (bconfig.is_sort_storage) { | 979 | + if ( bconfig && bconfig.is_sort_storage) { |
| 980 | wx.getLocation({ | 980 | wx.getLocation({ |
| 981 | type: 'gcj02', | 981 | type: 'gcj02', |
| 982 | success: function(res) { | 982 | success: function(res) { |
| @@ -1041,7 +1041,7 @@ Page({ | @@ -1041,7 +1041,7 @@ Page({ | ||
| 1041 | var t_time = setInterval(function() { | 1041 | var t_time = setInterval(function() { |
| 1042 | if (th.data.bconfig == null) false; | 1042 | if (th.data.bconfig == null) false; |
| 1043 | var e = th.data.bconfig; | 1043 | var e = th.data.bconfig; |
| 1044 | - if (e.is_sort_storage) { | 1044 | + if (e && e.is_sort_storage) { |
| 1045 | wx.getLocation({ | 1045 | wx.getLocation({ |
| 1046 | type: 'gcj02', | 1046 | type: 'gcj02', |
| 1047 | success: function(res) { | 1047 | success: function(res) { |
| @@ -1116,7 +1116,7 @@ Page({ | @@ -1116,7 +1116,7 @@ Page({ | ||
| 1116 | if (e.data.code == 0) { | 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 | th.setData({ | 1120 | th.setData({ |
| 1121 | def_pick_store:e.data.data.pageData[0], | 1121 | def_pick_store:e.data.data.pageData[0], |
| 1122 | sto_sele_name: e.data.data.pageData[0].pickup_name, | 1122 | sto_sele_name: e.data.data.pageData[0].pickup_name, |
| @@ -1296,7 +1296,7 @@ Page({ | @@ -1296,7 +1296,7 @@ Page({ | ||
| 1296 | only_pk: e.data.data.pageData | 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 | th.setData({ | 1300 | th.setData({ |
| 1301 | def_pick_store:e.data.data.pageData[0], | 1301 | def_pick_store:e.data.data.pageData[0], |
| 1302 | sto_sele_name: e.data.data.pageData[0].pickup_name, | 1302 | sto_sele_name: e.data.data.pageData[0].pickup_name, |