123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- // pages/tabber/home/index.js
- const api = require('../../../utils/api');
- const app=getApp()
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- menuList:[
- {
- icon:'/image/home/icon_ruchangqianshou.png',
- tit:'入厂签收',
- url:"/pages/signIn/siginIn"
- },
- {
- icon:'/image/home/icon_fenjianluru.png',
- tit:'分拣录入',
- url:"/pages/sorting/choice/choice"
- },
- {
- icon:'/image/home/icon_zhijian.png',
- tit:'质检上挂',
- url:"/pages/control/choice/choice"
- },
- // {
- // icon:'/image/home//icon_yichang.png',
- // url:"/pages/error/yichang/index",
- // tit:'异常单'
- // },
- {
- icon:'/image/home/icon_yiwupandian.png',
- tit:'衣物盘点',
- url:'/pages/record/record'
- },
- ]
- },
- onPullDownRefresh:function(){
- this.index()
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.index()
- },
- index(){
- var that=this;
- api.useApi(app.globalData.baseAppUrl + "api/admin/sorting", {
-
- }, "get").then(function (res) {
- console.log(res);
- if (res.code != 200) {
- wx.showLoading({
- title: res.message.msg,
- })
- setTimeout(function () {
- wx.hideLoading();
- wx.removeStorageSync('token')
- wx.reLaunch({
- url: '/pages/login/login',
- })
- }, 2000);
-
- } else {
- wx.hideLoading();
- var data=res.message.data
- wx.setStorageSync('title', data.user.adminable.title)
- that.setData({
- userinfo: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", {
-
- }, "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);
- })
-
-
- }
- })
|