| | |
| | | <view> |
| | | <scroll-view scroll-y class="page"> |
| | | <view class="nav-list"> |
| | | <navigator hover-class='none' :url="'/pages/project' + item.url" class="nav-li" navigateTo |
| | | <navigator hover-class='none' :url="'/pages/project/ps' + item.url" class="nav-li" navigateTo |
| | | :class="'bg-'+item.color" :style="[{animation: 'show ' + ((index+1)*0.2+1) + 's 1'}]" |
| | | v-for="(item,index) in elements" :key="index"> |
| | | <view class="nav-title">{{item.title}}</view> |
| | |
| | | name: 'pakin', |
| | | color: 'cyan', |
| | | cuIcon: 'pullup', |
| | | url: '/ps/pakin/pakin' |
| | | url: '/pakin/pakin' |
| | | }, |
| | | { |
| | | title: '托盘解绑', |
| | |
| | | }; |
| | | }, |
| | | onShow() { |
| | | this.baseUrl = uni.getStorageSync('baseUrl'); |
| | | let network = uni.getStorageSync('Network') |
| | | this.baseUrl = `http://${network[0].ip}:${network[0].port}/${network[0].address}` |
| | | this.token = uni.getStorageSync('token'); |
| | | this.getAuth() |
| | | this.backGroundRepeat() |
| | |
| | | } |
| | | }, |
| | | getAuth() { |
| | | let that = this |
| | | let _this = this |
| | | uni.request({ |
| | | url: that.baseUrl + '/menu/pda/auth', |
| | | url: `${_this.baseUrl}/menu/pda/auth`, |
| | | data: {}, |
| | | header: { 'token': uni.getStorageSync('token') }, |
| | | method: 'POST', |
| | | success(res) { |
| | | console.log(res); |
| | | if (res.statusCode === 404) { |
| | | that.elements = that.elements2 |
| | | _this.elements = _this.elements2 |
| | | return |
| | | } |
| | | res = res.data |
| | | that.elements = [] |
| | | _this.elements = [] |
| | | if (res.code === 200) { |
| | | if (res.data == undefined || res.data == null || res.data == "") { |
| | | that.elements = that.elements2 |
| | | _this.elements = _this.elements2 |
| | | return |
| | | } |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | if (res.data.length < 0) { |
| | | break; |
| | | } |
| | | that.getIcon(res.data[i].title) |
| | | that.elements.unshift({ |
| | | _this.getIcon(res.data[i].title) |
| | | _this.elements.unshift({ |
| | | title: res.data[i].name, |
| | | name: res.data[i].title, |
| | | color: that.colorList[i], |
| | | cuIcon: that.icon, |
| | | color: _this.colorList[i], |
| | | cuIcon: _this.icon, |
| | | url: res.data[i].action |
| | | }) |
| | | } |
| | | that.elements.push({ |
| | | _this.elements.push({ |
| | | title: '退出登录', |
| | | name: 'logOut', |
| | | color: 'grey', |
| | |
| | | }); |
| | | }, 1000); |
| | | } else if(res.status === 404) { |
| | | that.elements = that.elements2 |
| | | _this.elements = _this.elements2 |
| | | // uni.showToast({ |
| | | // title: '默认主页', |
| | | // icon: "none", |
| | |
| | | }, |
| | | fail(err) { |
| | | console.log(err); |
| | | that.elements = that.elements2 |
| | | _this.elements = _this.elements2 |
| | | } |
| | | }) |
| | | }, |