gov_propagandize/pages/company/company.js

58 lines
1.4 KiB
JavaScript
Raw Normal View History

2025-01-17 18:01:48 +08:00
// pages/company/company.js
2025-01-20 17:19:30 +08:00
import DomainService from '../../utils/api/domainApi';
import utils from '../../utils/util'
const app = getApp();
2025-01-17 18:01:48 +08:00
Page({
2025-01-20 17:19:30 +08:00
/**
* 页面的初始数据
*/
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,
})
}
}
2025-01-17 18:01:48 +08:00
})