123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- // pages/person/person.js
- const app = getApp();
- const getReq = require('./../../config.js').getReq;
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- userInfo:{
- nickName:'',
- avatarUrl:''
- },
- bonus_rate:[],
- bonus_list_show:false,
- login_count:1
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
-
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
-
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- const count = this.data.login_count;
- if (!app.globalData.userInfo && count <= 2) {
- this.setData({
- login_count: this.data.login_count+1
- })
- wx.navigateTo({
- url: '/pages/login/login'
- });
- return;
- }
- if (!app.globalData.userInfo && count > 2) {
- this.setData({
- login_count: 1
- })
- wx.switchTab({
- url: '/pages/index/index'
- });
- return;
- }
-
- const userInfo = app.globalData.userInfo || null;
- const nickName = userInfo.nickName || '';
- const avatarUrl = userInfo.avatarUrl || '';
- let self = this
- getReq({
- act: 'cart',
- op: 'rate_money'
- }, function (res) {
- if (res.code == 200) {
- self.setData({
- userInfo: { nickName, avatarUrl },
- bonus_rate: res.datas.bonus_rate
- })
- }
- })
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
-
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
-
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
-
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
-
- },
- bonus_list(){
- this.setData({
- bonus_list_show: !this.data.bonus_list_show
- })
- },
- skip_help(){
- wx.navigateTo({
- url: '/pages/webView/webView?url=https://passport.lrlz.com/hfive/feed_back/question_answer.html'
- })
- },
- skip_all_order(){
- wx.navigateTo({
- url: '/pages/order_tabs/orderTabs'
- })
- },
- refund(){
- wx.showToast({
- title: '客官!请在APP中完成退款申请',
- icon: 'none',
- duration: 2000
- })
- }
- })
|