Browse Source

我的页面添加接口请求数据

master
chenxuhui 7 years ago
parent
commit
7737d2289f
1 changed files with 22 additions and 2 deletions
  1. +22
    -2
      pages/my/my.js

+ 22
- 2
pages/my/my.js View File

@ -1,6 +1,9 @@
// pages/my/my.js // pages/my/my.js
Page({
var app = getApp();
var network = require("../../utils/net.js");
var timechage = require("../../utils/dateTimeUtil.js");
Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
@ -15,7 +18,24 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
var that = this;
// 获取用户信息
var method = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/AccountRpc/GetWeiUserInfo';
var params = [
app.globalData.appID,
app.globalData.openID,
];
network.transfer_request(method, params, function (res) {
//res就是我们请求接口返回的数据
that.setData({
meName: res.result.Bind_Name,
mePhone: res.result.Phone,
avatarUrl: res.result.HeadImgUrl
})
})
}, },
/** /**


Loading…
Cancel
Save