123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- // pages/tabber/home/index.js
- const api = require('../../utils/api');
- const app=getApp();
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- menuList:[
- {
- icon:'/image/home/wuliugailan@3x.png',
- tit:'物流概览',
- url:"/pages/logistics/index"
- },
- {
- icon:'/image/home/icon_qujianxiangqing@3x.png',
- tit:'柜前取送',
- url:"/pages/take/index"
- },
- {
- icon:'/image/home/icon_qianshou@3x.png',
- tit:'物流签收',
- url:"/pages/signFor/index"
- },
- {
- icon:'/image/home/icon_daishoudian@3x.png',
- tit:'代收点',
- url:"/pages/servicePoint/index"
- },
- {
- icon:'/image/home/icon_guiziguanli@3x.png',
- url:"/pages/cabinet/index",
- tit:'柜子管理'
- },
- {
- icon:'/image/home/icon_sousuoyundan@3x.png',
- url:"/pages/serah/index",
- tit:'搜索运单'
- },
- ],
- userinfo:"",
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- var that=this;
- app.api.useApi(app.globalData.baseAppUrl + "api/admin/UserInfo", {
- appid: wx.getAppBaseInfo().host.appId
- }, "post").then(function (res) {
- console.log(res);
- if (res.code == 200) {
- wx.showLoading({
- title: '请重新登录',
- })
- setTimeout(function () {
- wx.hideLoading();
-
- wx.reLaunch({
- url: '/pages/login/login',
- })
- }, 1000);
-
- } else {
- wx.hideLoading();
- wx.removeStorageSync('token')
- that.setdata({
- userinfo:res.message.data
- })
-
- }
- }).catch(function (err) {
-
- console.log(222);
- })
-
- },
- toUrl(e){
- let {url} = e.currentTarget.dataset
- wx.navigateTo({
- url,
- })
- },
- loginOut(){
- app.api.useApi(app.globalData.baseAppUrl + "api/admin/logout", {
- appid: wx.getAppBaseInfo().host.appId
- }, "post").then(function (res) {
- wx.showLoading({
- title: '退出中',
- })
- console.log(res);
- if (res.code != 200) {
-
- wx.showLoading({
- title: '失败请重试',
- })
- setTimeout(function () {
- wx.hideLoading();
- }, 1000);
- } else {
- wx.hideLoading();
- wx.removeStorageSync('token')
- wx.reLaunch({
- url: '/pages/login/login',
- })
- }
- }).catch(function (err) {
-
- console.log(222);
- })
-
-
- }
- })
|