let network = uni.getStorageSync('Network') let baseUrl = `http://${network[0].ip}:${network[0].port}/${network[0].address}` async function addMat(matnr) { let that = this,item = {}; var ress = await uni.request({ url: `${baseUrl}/mat/auth`, header: {'token': uni.getStorageSync('token')}, data: {matnr: matnr}, }).then((result)=> { let mat = result.data.data item = mat console.log(mat); // item['detl'] = [ // {key: '商品码',value: mat.matnr}, // {key: '商品名称',value: mat.maktx}, // {key: '规格',value: mat.specs}, // {key: '批号',value: '',type: 'input'}, // {key: '数量',value: 0,type: 'number-box',valText: 'val-num'}, // ] },(res)=>{ console.log(res); }) return item } module.exports = { addMat: addMat, }