| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- const app = getApp();
- Component({
- /**
- * 组件的一些选项
- */
- options: {
- addGlobalClass: true,
- multipleSlots: true
- },
- /**
- * 组件的对外属性
- */
- properties: {
- bgColor: {
- type: String,
- default: ''
- },
- isCustom: {
- type: [Boolean, String],
- default: false
- },
- isBack: {
- type: [Boolean, String],
- default: false
- },
- canGoHome: {
- type: [Boolean, String],
- default: false
- },
- is5G: {
- type: [Boolean, String],
- default: false
- },
- bgImage: {
- type: String,
- default: ''
- },
- title:{
- type:String,
- default:''
- },
- isSystem:{
- type:[Boolean,String],
- default:false,
- },
- isQuery:{
- type:[Boolean,String],
- default:false,
- },
- isToScan:{
- type:[Boolean,String],
- default:false,
- }
- },
- /**
- * 组件的初始数据
- */
- data: {
- StatusBar: app.globalData.StatusBar,
- CustomBar: app.globalData.CustomBar,
- Custom: app.globalData.Custom,
- setName:'管理'
- },
- /**
- * 组件的方法列表
- */
- methods: {
- BackPage() {
- wx.navigateBack({
- delta: 1
- });
- },
- to5G() {
- wx.navigateTo({
- url: '/pages/device/device',
- })
- },
- toHome(){
- wx.switchTab({
- url: '/pages/index/index',
- })
- },
- toQuery(){
- wx.switchTab({
- url: '/pages/query/query',
- })
- },
- toScan(){
- //获取用户信息,判断userInfo是否过期
- let userInfo = wx.getStorageSync('userInfo');
- const {loginRole,ifOverFlow,status} = userInfo;
- app.globalData.tabarData = {loginRole, ifOverFlow, status, path:'find'};
- wx.switchTab({
- url: '/pages/workbench/workbench',
- })
- },
- systemBut(){
- var flag = this.data.flag;
- let token = wx.getStorageSync('token');
- if(!token){
- wx.navigateTo({
- url: '/pages/login/login',
- })
- return;
- }
- if(flag){
- this.setData({
- flag : false,
- setName:'管理'
- })
- this.triggerEvent('myevent',{flag:'N' })
- }else{
- this.setData({
- flag : true,
- setName:'保存'
- })
- this.triggerEvent('myevent',{flag:'Y'})
- }
- }
- }
- })
|