#
whycq
2023-10-13 7135efa509d1ae612322fead8be5947a1d782581
#
1个文件已修改
31 ■■■■ 已修改文件
pages/project/ps/home/home.vue 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/project/ps/home/home.vue
@@ -2,7 +2,7 @@
    <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>
@@ -29,7 +29,7 @@
                        name: 'pakin',
                        color: 'cyan',
                        cuIcon: 'pullup',
                        url: '/ps/pakin/pakin'
                        url: '/pakin/pakin'
                    },
                    {
                        title: '托盘解绑',
@@ -198,7 +198,8 @@
            };
        },
        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()
@@ -216,39 +217,39 @@
                }
            },
            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',
@@ -267,7 +268,7 @@
                                });
                            }, 1000);
                        } else if(res.status === 404) {
                            that.elements = that.elements2
                            _this.elements = _this.elements2
                            // uni.showToast({
                            //     title: '默认主页',
                            //     icon: "none",
@@ -283,7 +284,7 @@
                    },
                    fail(err) {
                        console.log(err);
                        that.elements = that.elements2
                        _this.elements = _this.elements2
                    }
                })
            },