diff --git a/miniprogram/pages/my/personalData/personalData.js b/miniprogram/pages/my/personalData/personalData.js
index cd186cb..2c1f22b 100644
--- a/miniprogram/pages/my/personalData/personalData.js
+++ b/miniprogram/pages/my/personalData/personalData.js
@@ -1,9 +1,11 @@
let app = getApp()
import {
- userProfile
+ userProfile,
+ getUserInfoRq
} from "../../../api/user/user.js"
+
Page({
data: {
@@ -13,57 +15,42 @@ Page({
ifName: true,
DOMAIN_NAME: app.IMG_NAME,
park: [],
- parkindex: 0
+ parkindex: 0,
+ parkName: '',
+ customerName: ''
},
/**
* 生命周期函数--监听页面加载
*/
onShow(e) {
- var that = this
+ let _this = this;
+ let that = this
that.setData({
DOMAIN_NAME: app.img_Name
})
- app.AjaxRequest('get', {
- 'content-type': 'application/json'
- }, '/park/list', {}, function (res) {
- if (res.code == 0) {
- res.data.forEach(item => {
- let park = that.data.park
- park.push(item.parkName)
- that.setData({
- park
- })
- })
- that.setData({
- parkList: res.data
- })
- that.parkIdtype(res.data, wx.getStorageSync('parkId'))
- }
- })
that.getList()
+ //
+ let userId = wx.getStorageSync('userId');
+ if (userId) {
+ getUserInfoRq(userId).then(res => {
+ console.log('getUserInfoRq', res);
+ let userDetail = res.data;
+ _this.setData({
+ customerName: userDetail.customerName,
+ parkName: wx.getStorageSync('parkName')
+ })
+ })
+ } else {
+ app.getlogin()
+ return
+ }
},
- parkIdtype(list, id) {
- list.forEach((item, index) => {
- if (item.id == id) {
- this.setData({
- parkindex: index
- })
- }
- })
- },
-
- parkChange(e) {
- let that = this
- that.data.parkList.forEach(item => {
- if (that.data.park[e.detail.value] == item.parkName) {
- that.setData({
- parkindex: e.detail.value
- })
- wx.setStorageSync('parkId', item.id)
- wx.setStorageSync('parkName', item.parkName)
- }
+ // 跳转园区
+ jumpPark() {
+ wx.navigateTo({
+ url: '/pages/index/parkList/parkList',
})
},
diff --git a/miniprogram/pages/my/personalData/personalData.wxml b/miniprogram/pages/my/personalData/personalData.wxml
index 5523fe4..a56eba3 100644
--- a/miniprogram/pages/my/personalData/personalData.wxml
+++ b/miniprogram/pages/my/personalData/personalData.wxml
@@ -56,18 +56,16 @@
-->
-
+
园区
-
- {{park[parkindex]}}
-
+ {{parkName ? parkName : ''}}
企业
- {{memberInfo.customerName? memberInfo.customerName : ''}}
+ {{customerName? customerName : ''}}