// pages/company/company.js import DomainService from '../../utils/api/domainApi'; import utils from '../../utils/util' const app = getApp(); Page({ /** * 页面的初始数据 */ data: { bean: {}, //详情 showPageLoading: true }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { var id = options.id if (id) { this.getDetail(id) } else { wx.navigateBack() } }, getDetail(id) { var _self = this DomainService.doGetKeyEnterprise({ id: id }) .then(res => { if (res.guDongList && res.guDongList.length > 0) { res.guDongList.forEach(item => { item.surname = item.name.substr(0, 1) }) } if (res) { res.content = utils.formatHtml(res.content) _self.setData({ bean: res }) } }, err => { wx.showToast({ icon: 'none', title: '网络错误(company)', }) }) }, callPhone() { var _self = this if (_self.data.bean.lianXi.phone) { wx.makePhoneCall({ phoneNumber: _self.data.bean.lianXi.phone, }) } } })