kk.shi лет назад: 3
Родитель
Сommit
d0b32023f7
2 измененных файлов с 23 добавлено и 0 удалено
  1. 10 0
      api/activity.js
  2. 13 0
      pages/welfareMall/personal/personal.js

+ 10 - 0
api/activity.js

@@ -170,6 +170,16 @@ class activity extends request {
   }
 
   /**
+   * 获取用户信息
+   * @param {*} openId  
+   */
+  static async getUser(params) {
+    const res = await this.postRequest(`${this.BASE_URL}open/activity/get-user`, params)
+    return res.data
+   
+  }
+
+  /**
    * 设置手机缓存
    * @param {*} mobile 
    */

+ 13 - 0
pages/welfareMall/personal/personal.js

@@ -1,5 +1,6 @@
 // pages/welfareMall/personal/personal.js
 import WelfareMall from '../../../api/welfareMall'
+import activity from '../../../api/activity'
 import {getMobileCache, getPhoneNumber as getPhoneNumberSync} from '../../../utils/user'
 Page({
 
@@ -16,6 +17,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: async function (options) {
+    // await this.getUserPhone();
     this.setData({
       isLogin: getMobileCache() != '',
       mobileTop: getMobileCache(),
@@ -30,6 +32,17 @@ Page({
 
   },
 
+  /**
+   * 获取用户信息
+   */
+  getUserPhone: async function(){
+    await activity.getUser({
+      openId: activity.getOpenId(),
+      source:'FREE_MINI_APP',
+    });
+
+  },
+
   getCountNum: async function(){
   /**
    * 福利社