毕设-dev-first
This commit is contained in:
@ -12,12 +12,40 @@ Page({
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.fetchSupervisorInfo();
|
||||
onLoad() {
|
||||
const role = wx.getStorageSync('role')
|
||||
if (role === 'manager') {
|
||||
this.getManagerInfo();
|
||||
} else {
|
||||
this.fetchSupervisorInfo();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 请求后端接口,获取上级联系人信息
|
||||
*/
|
||||
|
||||
getManagerInfo() {
|
||||
const token = wx.getStorageSync('token')
|
||||
wx.request({
|
||||
url: baseUrl + '/userInfo/get/jwt',
|
||||
method: 'GET',
|
||||
header: {
|
||||
Authorization: token
|
||||
},
|
||||
success: res => {
|
||||
console.log('用户信息---->',res.data);
|
||||
if (res.data.code === 1) {
|
||||
let result = res.data.data
|
||||
this.setData({
|
||||
nickName: result.nickName,
|
||||
phoneNumber: result.phoneNumber
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
fetchSupervisorInfo() {
|
||||
const token = wx.getStorageSync('token');
|
||||
wx.request({
|
||||
|
@ -14,7 +14,7 @@
|
||||
</view>
|
||||
<image
|
||||
class="self-start image"
|
||||
src="./images/logo.png"
|
||||
src="/static/logo.jpg"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -5,7 +5,7 @@
|
||||
margin-left: 39.38rpx;
|
||||
}
|
||||
.page {
|
||||
padding: 43.13rpx 0 1346.25rpx;
|
||||
padding: 43.13rpx 0 0;
|
||||
background-image: linear-gradient(180deg, #ff8d1a -7.3%, #ffffff00 33.5%);
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
|
Reference in New Issue
Block a user