低版本手淘和H5页面报错如下,导致宝贝无法加载
CallMethod error Cannot read property ‘shopGetItem’ of undefined/TypeError: Cannot read property ‘shopGetItem’ of undefined
原版本代码是这么写的
my.tb.shopGetItem({
"sellerId":sellerId,
"isAuto":true,
"itemIds":"",
"pageSize":goods_number,
"catId":mds.moduleData.category_2,
"sort":mds.moduleData.sort_2,
"keyWord":mds.moduleData.keyword_2,
"startPrice":startPrice,
"endPrice":endPrice,
}).then(resp => {
修改成下面的即可
const TB = this.props.data.modUtils
TB.my || (TB.my = my || {} )
TB.my.tb.shopGetItem({
"sellerId":sellerId,
"isAuto":true,
"itemIds":"",
"pageSize":mds.moduleData.goods_number?mds.moduleData.goods_number:4,
"catId":mds.moduleData.category,
"sort":mds.moduleData.sort,
"keyWord":mds.moduleData.keyword,
"startPrice":startPrice,
"endPrice":endPrice,
}).then(resp => {