88 lines
1.4 KiB
JavaScript
88 lines
1.4 KiB
JavaScript
// packageH/chitchat/personalProfile/personalProfile.js
|
|
var app = getApp();
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
id: "",
|
|
serviceData: {}
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function (options) {
|
|
this.setData({
|
|
id: options.id
|
|
});
|
|
this.getData();
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage: function () {
|
|
|
|
},
|
|
|
|
toChat() {
|
|
wx.navigateTo({
|
|
url: this.data.serviceData.mini_url
|
|
});
|
|
},
|
|
toHome() {
|
|
wx.reLaunch({
|
|
url: '/packageG/index/index'
|
|
});
|
|
},
|
|
getData() {
|
|
let urlStr = app.getNetAddresss("plugin.yun-chat.frontend.h5.employee.get-detail");
|
|
app._getNetWork({
|
|
url: urlStr,
|
|
data: {id: this.data.id},
|
|
success: (resdata) => {
|
|
let res = resdata.data;
|
|
if (res.result == 1) {
|
|
this.setData({
|
|
serviceData: res.data,
|
|
});
|
|
} else {
|
|
app.tips(res.msg);
|
|
}
|
|
},
|
|
fail: function (res) {
|
|
console.log(res);
|
|
},
|
|
});
|
|
},
|
|
}); |