onWeekShow: function () {
var that = this;
wx.request({
url: 'https://api.ilovelook.cn/api/kolshop/dabing/coms/list',
data: {
code: 'dabing'
},
method: 'GET',
header: {
'content-type': 'application/json'
},
success: function (res) {
var temp = res.data;
var result = []
for (var i in temp) {
if (temp[i].component_type === 6) {
result = temp[i].goodslist.sku;
}
}
that.setData({
'weekLists': result
})
},
fail: function () {
console.log("接口调用出错")
}
})
}
// // Export the Underscore object for **Node.js**, with
// // backwards-compatibility for the old `require()` API. If we're in
// // the browser, add `_` as a global object.
// if (typeof exports !== 'undefined') {
// if (typeof module !== 'undefined' && module.exports) {
// exports = module.exports = _;
// }
// exports._ = _;
// } else {
// root._ = _;
// }
module.exports = _;
// // AMD registration happens at the end for compatibility with AMD loaders
// // that may not enforce next-turn semantics on modules. Even though general
// // practice for AMD registration is to be anonymous, underscore registers
// // as a named module because, like jQuery, it is a base library that is
// // popular enough to be bundled in a third party lib, but not be part of
// // an AMD load request. Those cases could generate an error when an
// // anonymous define() is called outside of a loader request.
// if (typeof define === 'function' && define.amd) {
// define('underscore', [], function() {
// return _;
// });
// }
使用
var _ = require('../../utils/underscore.modifyied.js');