import http from '../../base/httputil' const app = getApp() Page({ /** * 组件的初始数据 */ data: { host: app.globalData.host, enterpriseList: [], enterpriseCode:'' }, onLoad() { this.list(null) }, // 搜索结果跳页 bindViewSearchEnd() { // wx.navigateTo({ // url: '../search/search' // }) }, // 企业详细页 bindViewDetails(e) { let busEnterpriseId = e.currentTarget.dataset.enterpriseid wx.navigateTo({ url: '../details/details?busEnterpriseId='+busEnterpriseId }) }, searchEnterprise(e) { var obj = new Object() obj.businessName = e.detail.value this.list(obj) }, bindViewSearchCode(){ let that=this wx.scanCode({ onlyFromCamera: true, success: (res) => { that.setData({ //['details.code']:res.result, enterpriseCode:res.result }) var obj = new Object() obj.enterpriseCode = that.data.enterpriseCode that.list(obj) }, fail: (res) => { // wx.showToast({ // title: '扫描失败请重试', // icon:'none' // }) } }) }, list(data) { http.post("/system/AppEnterpriseController/getInitEnterpriseList", data, this.getQiyeEnterpriseListSuccess) }, getQiyeEnterpriseListSuccess(res) { this.setData({ enterpriseList: res.rows }) } })