CRMEB/view/crmebN/app.js
2018-12-31 13:39:11 +08:00

55 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//app.js
var app = getApp();
// var wxh = require('../../utils/wxh.js');
App({
onLaunch: function () {
// 展示本地存储能力
var that = this;
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
that.getRoutineStyle();
},
globalData: {
routineStyle:'#ffffff',
uid: null,
openPages:'',
spid:0,
urlImages: '',
url: 'https://shop.crmeb.net/'
},
getRoutineStyle:function(){
var that = this;
wx.request({
url: that.globalData.url + '/routine/login/get_routine_style',
method: 'post',
dataType  : 'json',
success: function (res) {
that.globalData.routineStyle = res.data.data.routine_style;
that.setBarColor();
}
})
},
setBarColor:function(){
var that = this;
wx.setNavigationBarColor({
frontColor: '#000000',
backgroundColor: that.globalData.routineStyle,
})
},
setUserInfo : function(){
var that = this;
if (that.globalData.uid == null) {//是否存在用户信息,如果不存在跳转到首页
wx.showToast({
title: '用户信息获取失败',
icon: 'none',
duration: 1500,
})
setTimeout(function () {
wx.navigateTo({
url: '/pages/load/load',
})
}, 1500)
}
},
})