From e715fc1777604320eccebd627bdaa6278155367c Mon Sep 17 00:00:00 2001 From: xianghenggang Date: Tue, 26 Dec 2017 16:56:21 +0800 Subject: [PATCH] =?UTF-8?q?vip=E7=8A=B6=E6=80=81=E5=80=BC=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=9A=82=E5=81=9C=E3=80=81=E5=81=9C=E6=AD=A2=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- littleApp_child/pages/Setting/Setting.js | 31 +++++++++++++++++++++++- littleApp_child/pages/vipService/vipService.js | 2 ++ littleApp_child/pages/vipService/vipService.wxml | 3 +++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/littleApp_child/pages/Setting/Setting.js b/littleApp_child/pages/Setting/Setting.js index 402f88a..236a4d0 100644 --- a/littleApp_child/pages/Setting/Setting.js +++ b/littleApp_child/pages/Setting/Setting.js @@ -24,7 +24,8 @@ Page({ }, onLoad: function (option) { - this.setData({ userData: getApp().globalData.userInfo}) + + this.getUserInfo() }, onShow:function(){ var self=this @@ -38,6 +39,34 @@ Page({ }) } }, + // 获取用户信息 + getUserInfo(userId) { + networkUtil.showLoading() + var self = this + var param = { 'token': app.globalData.token } + if (getApp().globalData.tourist == true) { + param.type = 2 + } + networkUtil._get(api.userInfo + app.globalData.currentId, param, function (res) { + console.log('获取用户信息', res) + + self.setUserInfo(res.data.data) + + }, function (res) { + networkUtil.showErrorToast(res.errormsg) + }) + }, + // 设置UI 用户信息 + setUserInfo(data) { + var self = this + app.globalData.days = data.days + app.globalData.userInfo = data + self.setData({ + userData: data, + tourist: getApp().globalData.tourist + }) + + }, selectPhoto(){ var that = this wx.showActionSheet({ diff --git a/littleApp_child/pages/vipService/vipService.js b/littleApp_child/pages/vipService/vipService.js index 32d4995..a45df09 100644 --- a/littleApp_child/pages/vipService/vipService.js +++ b/littleApp_child/pages/vipService/vipService.js @@ -3,6 +3,8 @@ var networkUtil = require('../../utils/network_util.js') var api = require('../../utils/apiFile.js') +// 事件监听 +var event = require('../../utils/event.js') // 获取应用实例 var app = getApp() Page({ diff --git a/littleApp_child/pages/vipService/vipService.wxml b/littleApp_child/pages/vipService/vipService.wxml index ea6aa95..130c53f 100644 --- a/littleApp_child/pages/vipService/vipService.wxml +++ b/littleApp_child/pages/vipService/vipService.wxml @@ -35,7 +35,10 @@ ¥{{item.price}} 已开通 + 已过期 + 已暂停 开通 + 开通 {{item.desc}} -- 1.8.3.1