Houjie
2025-04-18 ae3855638dba0c927236c1a1b1a85d5b048c40e2
提交
已修改16个文件
2120 ■■■■ 文件已修改
api/api.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/router/index.js 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/router/modules/routes.js 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/service/config.service.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/util/work.js 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest.json 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/TaskManager/TaskManagerList.vue 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/common/helloWorld.vue 304 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/device/device.vue 278 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/index.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/login/login.vue 619 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/spare/spare.vue 275 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
plugin/uni-simple-router/helpers/urlQuery.js 332 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
store/index.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/api.js
@@ -6,7 +6,7 @@
      * 登录
      */
    login(params) {
        return http.post('/sys/mLogin',params)
        return http.post('/sys/login',params)
    },
    /**
      * 手机号码登录
common/router/index.js
@@ -1,49 +1,58 @@
import modules from './modules'
import Vue from 'vue'
import Router from '@/plugin/uni-simple-router/index.js'
import {ACCESS_TOKEN} from '@/common/util/constants.js'
import {isOAuth2AppEnv} from '@/common/util/util.js'
import {
    ACCESS_TOKEN
} from '@/common/util/constants.js'
import {
    isOAuth2AppEnv
} from '@/common/util/util.js'
Vue.use(Router)
//初始化
const router = new Router({
    encodeURI:true,
    routes: [...modules]//路由表
    encodeURI: true,
    routes: [...modules] //路由表
});
const whiteList = ['/pages/login/login','/pages/login/loginOauth2']
const whiteList = ['/pages/login/login', '/pages/login/loginOauth2']
//全局路由前置守卫
router.beforeEach((to, from, next) => {
    if(to.path == '/oauth2-app/login'){
    if (to.path == '/oauth2-app/login') {
        let temp = location.href;
        location.href = temp.replace('/oauth2-app/login','/pages/login/loginOauth2')
        location.href = temp.replace('/oauth2-app/login', '/pages/login/loginOauth2')
        return;
    }
    let token=uni.getStorageSync(ACCESS_TOKEN);
    if(token){
         if (to.path === '/pages/login/login' || to.path === '/pages/login/loginOauth2') {
             if(from.path ==='/pages/index/index'){
                 return;
             }else{
                 next()
             }
    let token = uni.getStorageSync(ACCESS_TOKEN);
    if (token) {
        if (to.path === '/pages/login/login' || to.path === '/pages/login/loginOauth2') {
            if (from.path === '/pages/index/index') {
                return;
            } else {
                next()
            }
        }
        next()
    }else{
    } else {
        if (whiteList.indexOf(to.path) !== -1) {
          // 在免登录白名单,如果进入的页面是login页面并且当前是OAuth2app环境,就进入OAuth2登录页面
          if (to.path === '/pages/login/login' && isOAuth2AppEnv()) {
            next({path: '/pages/login/loginOauth2'})
          } else {
            // 在免登录白名单,直接进入
            next()
          }
        }else{
            // 在免登录白名单,如果进入的页面是login页面并且当前是OAuth2app环境,就进入OAuth2登录页面
            if (to.path === '/pages/login/login' && isOAuth2AppEnv()) {
                next({
                    path: '/pages/login/loginOauth2'
                })
            } else {
                // 在免登录白名单,直接进入
                next()
            }
        } else {
            // 如果当前是在OAuth2APP环境,就跳转到OAuth2登录页面
            let path = isOAuth2AppEnv() ? '/pages/login/loginOauth2' : '/pages/login/login';
            next({ path: path })
            next({
                path: path
            })
        }
    }
    }
})
// 全局路由后置守卫
router.afterEach((to, from) => {
common/router/modules/routes.js
@@ -39,6 +39,8 @@
            title: '设备',
        },
    },
    {
        //注意:path必须跟pages.json中的地址对应,最前面别忘了加'/'哦
      path: '/pages/spare/spare',
@@ -132,13 +134,37 @@
        },
    },
    {
        path: '/pages/device/deviceDeils/deviceDeils',
        name: 'deviceDeils',
        meta: {
            title: '设备详情',
        },
    },
    {
        path: '/pages/device/deviceWebDeils/deviceWebDeils',
        name: 'deviceWebDeils',
        meta: {
            title: '设备详情',
        },
    },
    {
        path: '/pages/TaskManager/TaskManagerList',
        name: 'TaskManagerList',
        meta: {
            title: '任务管理',
            title: '已办',
        },
    },
    {
        path: '/pages/ToDoList/ToDoList',
        name: 'ToDoList',
        meta: {
            title: '待办',
        },
    },
    {
        path: '/pages/annotation/annotationDetail',
        name: 'annotationDetail',
        meta: {
common/service/config.service.js
@@ -1,11 +1,11 @@
let BASE_URL = 'https://192.168.1.118:9988/jeecg-boot'
let BASE_URL = '/jeecg-boot'
if (process.env.NODE_ENV == 'development') {
    
    BASE_URL = 'https://192.168.1.118:9988/jeecg-boot' // 开发环境
    BASE_URL = '/jeecg-boot' // 开发环境
} else {
    BASE_URL = 'https://192.168.1.118:9988/jeecg-boot' // 生产环境
    BASE_URL = '/jeecg-boot' // 生产环境
}
let staticDomainURL = BASE_URL+ '/sys/common/static';
common/util/work.js
@@ -7,12 +7,26 @@
export const us = {
  data:[
    {
      title:"任务管理",
      title:"待办",
      icon:icon_prefix+"wait_work.png",
      description:"待办已办事项",
      description:"待办事项",
      useCount:1000,
      page:'ToDoList'
    },
    {
      title:"已办",
      icon:icon_prefix+"wait_work.png",
      description:"已办事项",
      useCount:1000,
      page:'TaskManagerList'
    }
    },
    {
         title:"扫一扫",
         icon:icon_prefix+"icon_sacan.png",
         description:"扫码",
         useCount:10000,
          page:'spare'
       }
    // ,{
 //      title:"已办",
 //      icon:icon_prefix+"yiban.png",
@@ -86,24 +100,25 @@
      useCount:10000,
      page:'helloWorld'
    },{
      title:"周检",
      title:"周保",
      icon:icon_prefix+"toupiao.png",
      description:"设备周检",
      useCount:10000,
      page:'helloWorld'
    },{
      title:"二保",
      icon:icon_prefix+"renwu.png",
      description:"设备二保",
      useCount:10000,
      page:'helloWorld'
    },{
      title:"三保",
      icon:icon_prefix+"wendang.png",
      description:"设备三保",
      description:"设备周保",
      useCount:10000,
      page:'helloWorld'
    }
    // ,{
 //      title:"二保",
 //      icon:icon_prefix+"renwu.png",
 //      description:"设备二保",
 //      useCount:10000,
    //   page:'helloWorld'
 //    },{
 //      title:"三保",
 //      icon:icon_prefix+"wendang.png",
 //      description:"设备三保",
 //      useCount:10000,
    //   page:'helloWorld'
 //    }
    // ,{
 //      title:"合同",
 //      icon:icon_prefix+"hetong.png",
@@ -134,9 +149,9 @@
export const ws = {
  data:[
    {
      title:"保养",
      title:"报修",
      icon:icon_prefix+"xinwen.png",
      description:"设备保养",
      description:"设备报修",
      useCount:10000,
      page:'helloWorld'
    },{
main.js
@@ -31,8 +31,6 @@
import home from './pages/home/home.vue'
Vue.component('home',home)
import spare from './pages/spare/spare.vue'
Vue.component('spare',spare)
import device from './pages/device/device.vue'
Vue.component('device',device)
manifest.json
@@ -6,10 +6,11 @@
    "versionCode" : 1,
    "transformPx" : false,
    "app-plus" : {
        /* 5+App特有相关 */// "ssl": {
        //     "cert": "./cert.crt",
        //     "key": "./cert.key"
        // },
        /* 5+App特有相关 *///
        // "ssl": {
        //           "cert": "./cert.crt",
        //           "key": "./cert.key"
        //       },
        "modules" : {
            "Maps" : {},
            "Push" : {}
@@ -77,18 +78,24 @@
            }
        }
    },
    "h5" : {
        "title" : "设备管理",
        "domain" : "myhjdc.cn",
        "router" : {
            "mode" : "history",
            "base" : ""
            "mode" : "hash",
            "base" : "/h5"
        },
        "devServer" : {
            "port" : "",
            "https" : false
        },
            "port" : "3000",
            "https" : true,
                    "proxy": {
                            /**配置服务器路径**/
                            "/jeecg-boot": {
                                "target": "https://192.168.1.94:9999",// 目标服务器
                                "changeOrigin": true
                            }
                        }
                        },
        "optimization" : {
            "treeShaking" : {
                "enable" : false
@@ -96,3 +103,5 @@
        }
    }
}
/**配置服务器路径**/// 目标服务器
pages.json
@@ -179,6 +179,27 @@
                    "bounce": "none" //删除此项: mescroll-body支持iOS回弹
                }
            }
        },
        {
            "path" : "pages/device/deviceDeils/deviceDeils",
            "style" :
            {
                "navigationBarTitleText" : ""
            }
        },
        {
            "path" : "pages/device/deviceWebDeils/deviceWebDeils",
            "style" :
            {
                "navigationBarTitleText" : "设备详情"
            }
        },
        {
            "path" : "pages/ToDoList/ToDoList",
            "style" :
            {
                "navigationBarTitleText" : ""
            }
        }
pages/TaskManager/TaskManagerList.vue
@@ -2,7 +2,7 @@
    <view class="container">
        <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask">
            <block slot="backText">返回</block>
            <block slot="content">任务管理</block>
            <block slot="content">已办</block>
        </cu-custom>
        <view style="width: 100%;">
@@ -35,101 +35,51 @@
        </view>
        <view class="container">
            <uni-badge absolute="rightTop" :offset="[-30, 15]" :text="msg1Count" type="error" />
            <uni-badge absolute="rightTop" :offset="[-270, 15]" :text="msg2Count" type="error" />
            <view class="solid-bottom">
                <scroll-view scroll-x class="nav text-center ">
                    <view class="flex text-center justify-around">
                        <view class="cu-item" :class="item.value==TabCur?'text-blue cur':''"
                            v-for="(item,index) in tabs" :key="index" @tap="tabSelect" :data-id="item.value">
                            {{item.title}}
                        </view>
                    </view>
                </scroll-view>
            </view>
            <mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="top" @down="downCallback" @up="upCallback">
                <!-- 列表信息开始 -->
                <view class="content">
                    <uni-card margin="10px" spacing="1px" v-for="(item,index) in msgList" :key="index"
                        @click="onClickProductionTask(item)">
                        <view class="flex">
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">任务名称:</view>
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">流程名称:</view>
                            <view class="flex-sub bg-white padding-xs margin-xs   text-bold  radius text-right">
                                {{item.partName}}
                            </view>
                        </view>
                        <view class="flex">
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">任务类型:</view>
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">流程描述:</view>
                            <view class="flex-sub bg-white padding-xs margin-xs     radius text-right">
                                {{item.taskType}}
                            </view>
                        </view>
                        <view class="flex">
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">优先级:</view>
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">流程发起人:</view>
                            <view class="flex-sub bg-white padding-xs margin-xs   text-blue   radius text-right">
                                {{item.priority}}
                            </view>
                        </view>
                        <view class="flex">
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">责任人:</view>
                            <view class="flex-sub bg-white padding-xs margin-xs   text-blue   radius text-right">
                                {{item.ssignee}}
                            </view>
                        </view>
                        
                        <view class="flex">
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">任务描述:</view>
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">任务名称:</view>
                            <view class="flex-sub bg-white padding-xs margin-xs     radius text-right">
                                {{item.taskDesc}}
                            </view>
                        </view>
                        <view class="flex">
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">完成时间:</view>
                            <view class="flex-sub bg-white padding-xs margin-xs     radius text-right">
                                {{item.dueaDate}}
                            </view>
                        </view>
                        <view class="flex">
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">状态:</view>
                            <view
                                class="flex-sub bg-white padding-xs margin-xs  text-bold text-green   radius text-right"
                                v-if="item.status == '1'">
                                待处理
                            </view>
                            <view
                                class="flex-sub bg-white padding-xs margin-xs  text-bold text-green   radius text-right"
                                v-if="item.status == '3'">
                                已完成
                            </view>
                        </view>
                    </uni-card>
                </view>
            </mescroll-uni>
        </view>
    </view>
</template>
<script>
    const tabs = [{
        title: '待办',
        value: 0
    }, {
        title: '已办',
        value: 1
    }];
    import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
    export default {
        mixins: [MescrollMixin], // 使用mixin
        data() {
            return {
                TabCur: 0,
                type: 'top',
                scrollLeft:0,
                formData: {
@@ -137,13 +87,11 @@
                    partNumNameModel: ''
                },
                NavBarColor: this.NavBarColor,
                tabs,
                current: 0,
                colorIndex: 0,
                activeColor: '#5277A6',
                url: {
    
                    stallList: "/mom/partTakeRollingDetail/list"
                    stallList: "/assign/flow/finishedList"
                },
                upOption: {
@@ -212,35 +160,7 @@
            //     })
            // },
            tabSelect(e) {
                this.TabCur = e.currentTarget.dataset.id;
                this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
                this.msgList = [] // 先置空列表,显示加载进度
                this.mescroll.resetUpScroll() // 再刷新列表数据
            },
            ListTouchStart(e) {
                this.listTouchStart = e.touches[0].pageX
            },
            // ListTouch计算方向
            ListTouchMove(e) {
                this.listTouchDirection = e.touches[0].pageX - this.listTouchStart > 0 ? 'right' : 'left'
            },
            // ListTouch计算滚动
            ListTouchEnd(e) {
                if (this.listTouchDirection == 'left') {
                    this.modalName = e.currentTarget.dataset.target
                } else {
                    this.modalName = null
                }
                this.listTouchDirection = null
            },
            search() {
                this.$refs.popup.open();
            },
pages/common/helloWorld.vue
@@ -1,72 +1,262 @@
<template>
    <view>
        <scroll-view :scroll-y="modalName==null" class="page" :class="modalName!=null?'show':''">
            <cu-custom bgColor="bg-black" :isBack="true">
                <block slot="content">helloWorld</block>
            </cu-custom>
            <view class="padding flex flex-direction">
                <app-select label=" 类    型:" v-model="type" placeholder="请选择类型" :dict="plan_type" space ></app-select>
            </view>
            <view class="padding flex flex-direction">
              <my-date label="开始时间:" v-model="beginTime" placeholder="请选择开始时间" required fields="minute"></my-date>
            </view>
            <view class="padding flex flex-direction">
              <uni-calendar :showMonth="true" :selected="selected" />
            </view>
            <view class="padding flex flex-direction">
              <my-image-upload />
            </view>
        </scroll-view>
    </view>
    <view class="container">
        <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask">
            <block slot="backText">返回</block>
            <!-- <cu-custom :bgColor="NavBarColor" backRouterName="index">
            <block slot="right">
                <view @tap="$debounce(BackPage)">
                    <view class="cuIcon-back back">返回</view>
                </view>
            </block> -->
            <block slot="content">设备详情</block>
        </cu-custom>
        <view class="container">
            <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext">
                <uni-group top="1">
                    <uni-forms-item name="num" label="设备图片:">
                        <image style="height: 100px; width: 300px;"
                            :src="formData.equipmentImagel?formData.equipmentImage:'/static/zhanwei.png'"></image>
                    </uni-forms-item>
                    <uni-forms-item required name="num" label="设备编号:">
                        <uni-easyinput v-model="formData.equipmentCode" :disabled="true" />
                    </uni-forms-item>
                    <uni-forms-item name="remark" label="设备名称:">
                        <uni-easyinput v-model="formData.equipmentName" :disabled="true" />
                    </uni-forms-item>
                    <uni-forms-item name="remark" label="设备型号:">
                        <uni-easyinput v-model="formData.equipmentModel" :disabled="true" />
                    </uni-forms-item>
                    <uni-forms-item name="outNum" label="设备规格:">
                        <uni-easyinput v-model="formData.equipmentSpecification" :disabled="true" />
                    </uni-forms-item>
                    <view class="text-gray margin-bottom-lg">—————————— 基本信息 ——————————</view>
                    <uni-forms-item name="taskCode" label="设备分类:">
                        <uni-easyinput :disabled="true" v-model="formData.equipmentCategory" />
                    </uni-forms-item>
                    <uni-forms-item name="endLocation" label="出厂日期:">
                        <uni-easyinput :disabled="true" v-model="formData.leaveFactoryDate" />
                    </uni-forms-item>
                    <uni-forms-item name="endLocation" label="验收日期:">
                        <uni-easyinput :disabled="true" v-model="formData.acceptanceCheckDate" />
                    </uni-forms-item>
                    <uni-forms-item name="endLocation" label="安装位置:">
                        <uni-easyinput :disabled="true" v-model="formData.installationPosition" />
                    </uni-forms-item>
                    <uni-forms-item name="endLocation" label="资产状态:">
                        <uni-easyinput :disabled="true" v-model="formData.assetStatus" />
                    </uni-forms-item>
                    <uni-forms-item name="endLocation" label="设备管理员:">
                        <uni-easyinput :disabled="true" v-model="formData.equipmentManager" />
                    </uni-forms-item>
                </uni-group>
            </uni-forms>
        </view>
    </view>
</template>
<script>
    const plan_type = [{text:'日常记录',value:'1'},{text:'本周工作',value:'2'},{text:'下周计划',value:'3'}];
    import appSelect from '@/components/my-componets/appSelect.vue'
    import myImageUpload from '@/components/my-componets/my-image-upload.vue'
    import myDate from '@/components/my-componets/my-date.vue'
    import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
    export default {
        name: 'helloWorld',
        props:{
            cur:String,
        },
        watch: {
            cur: {
                immediate: true,
                handler:function(val,oldVal){
                    console.log('cur',val,oldVal)
                },
            },
        },
        components:{
            appSelect,myImageUpload,myDate
         },
        mixins: [MescrollMixin], // 使用mixin
        data() {
            return {
                modalName: null,
                item:{msg:'退出成功'},
                plan_type,
                type:"1",
                selected:[],
                beginTime:''
                formData: {},
                NavBarColor: this.NavBarColor,
                url: {
                    stallList: "/eam/equipment/queryById"
                },
                id: '',
                upOption: {
                    page: {
                        num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
                        size: 10 // 每页数据的数量
                    },
                    noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
                    empty: {
                        tip: '~ 暂无数据 ~', // 提示
                    },
                    loading: '',
                    text: '全部',
                    isShowNoMore: false,
                    textNoMore: '我是有底线的 >_<'
                },
                styles: {
                    color: '#2979FF',
                    borderColor: '#2979FF'
                },
                msg1Count: 0,
                msg2Count: 0,
                msg1Title: ""
            }
        },
        computed: {
            top() {
                return this.CustomBar * 2 + 160
            },
            style() {
                var StatusBar = this.StatusBar;
                var CustomBar = this.CustomBar;
                var CustomBar = this.CustomBar;
                var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
                return style
            },
        },
        onLoad(options) {
            console.log(options)
            // 先尝试用正常方式获取
            let equipmentId = options.equipmentId;
            if (!equipmentId) {
                // 手动解析URL参数
                const url = window.location.href;
                console.log(url);
                const index = url.indexOf('?');
                if (index > -1) {
                    const query = url.substring(index + 1);
                    const pairs = query.split('&');
                    pairs.forEach(pair => {
                        const [key, value] = pair.split('=');
                        if (key === 'equipmentId') {
                            equipmentId = decodeURIComponent(value);
                        }
                    });
                }
            }
            },
        //     if (equipmentId) {
        //         this.upCallback();
        //     } else {
        //         console.log('无法获取设备ID');
        //     }
        // },
        // onLoad(options) {
        //     this.id = options.equipmentId || '';
        //     if (!this.id) {
        //         uni.showModal({
        //             title: '提示',
        //             content: "错误不存在",
        //             showCancel: false
        //         });
        //     } else {
        //         this.upCallback();
        //     }
        // },
        created() {
            // this.upCallback();
        },
        methods: {
        }
            BackPage() {
                // 重写返回按钮逻辑,返回到首页
                uni.switchTab({
                    url: '/pages/index/index' // 这里是首页的路径,根据实际情况修改
                });
            },
            upCallback() {
                console.log("id", this.id)
                this.$http.get(this.url.stallList, {
                    params: {
                        pageNo: 999,
                        pageSize: 1,
                        order: 'asc',
                        column: 'createTime',
                        id: this.id
                    },
                }).then(res => {
                    this.announcement1 = res.data.result
                    console.log("url", res)
                    //设置列表数据
                    if (res.data.success) {
                        console.log("res", res.data.result.equipmentCode)
                        this.formData = this.announcement1
                    }
                }).catch(() => {
                    //联网失败, 结束加载
                })
            },
            /* 检索 */
            getSera(res) {
                this.msgList = [];
                if (keyword == 0) {
                    this.$http.get(this.url.stallList, {
                        params: {
                            pageNo: 1,
                            pageSize: 999,
                            order: "desc",
                            column: "createTime",
                            equipmentCode: res
                        }
                    }).then(res => {
                        //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
                        this.announcement1 = res.data.result.records
                        this.mescroll.endSuccess(this.announcement1.length);
                        console.log("url", res)
                        //设置列表数据
                        if (res.data.success) {
                            console.log("res", res.data)
                            this.msg1Count = res.data.result.total
                            this.msg1Title = "通知(" + res.data.result.total + ")";
                            for (let annItem of this.announcement1) {
                                this.msgList.push(annItem)
                            }
                        }
                        if (page.num == 1) {
                            this.msgList = []; //如果是第一页需手动制空列表
                            this.msgList = this.msgList.concat(this.announcement1); //追加新数据
                        }
                    }).catch(() => {
                        //联网失败, 结束加载
                        this.mescroll.endErr();
                    })
                }
            },
            mescrollInit(mescroll) {
                console.log('mescrollInit')
                this.mescroll = mescroll;
            },
        },
    }
</script>
<style>
</style>
    .is-hover {
        color: rgba(255, 255, 255, 0.6);
        background-color: #55aaff;
        border-color: #55aaff;
    }
    .content {
        margin-top: 5px;
    }
    .content scroll-view {
        scrollIndicator: "none"
    }
    .popupView {
        margin-top: 85px;
        height: auto;
    }
</style>
pages/device/device.vue
@@ -15,61 +15,49 @@
                    <uni-card margin="10px" spacing="1px" v-for="(item,index) in msgList" :key="index"
                        @click="onClickProductionTask(item)">
                        <view class="flex">
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">设备编号:</view>
                            <view
                                class="flex-sub bg-white padding-xs margin-xs   text-bold   text-blue radius text-right">
                                {{item.equipmentCode}}
                            </view>
                        </view>
                        <view class="flex">
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">设备名称:</view>
                            <view class="flex-sub bg-white padding-xs margin-xs   text-bold  radius text-right">
                                {{item.partName}}
                            </view>
                        </view>
                        <view class="flex">
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">设备类型:</view>
                            <view class="flex-sub bg-white padding-xs margin-xs     radius text-right">
                                {{item.partType}}
                                {{item.equipmentName}}
                            </view>
                        </view>
                        <view class="flex">
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">位置::</view>
                            <view class="flex-sub bg-white padding-xs margin-xs   text-blue   radius text-right">
                                {{item.location}}
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">维修状态::</view>
                            <view class="flex-sub bg-white padding-xs margin-xs   text-orange   radius text-right">
                                {{item.assetStatus_dictText}}
                            </view>
                        </view>
                        <view class="flex">
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">制造商::</view>
                            <view class="flex-sub bg-white padding-xs margin-xs   text-blue   radius text-right">
                                {{item.manufacturer}}
                        <!-- <view class="flex">
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">保养状态::</view>
                            <view class="flex-sub bg-white padding-xs margin-xs   text-orange   radius text-right">
                                {{item.maintenanceStatus_dictText}}
                            </view>
                        </view>
                        <view class="flex">
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">型号:</view>
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">使用车间:</view>
                            <view class="flex-sub bg-white padding-xs margin-xs     radius text-right">
                                {{item.model}}
                                {{item.orgId_dictText}}
                            </view>
                        </view>
                        <view class="flex">
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">负责人:</view>
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">设备管理员:</view>
                            <view class="flex-sub bg-white padding-xs margin-xs     radius text-right">
                                {{item.assignee}}
                                {{item.equipmentManager_dictText}}
                            </view>
                        </view>
                        <view class="flex">
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">备注:</view>
                            <view class="flex-sub bg-white padding-xs margin-xs     radius text-right">
                                {{item.remark}}
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">设备分类:</view>
                            <view class="flex-sub bg-white padding-xs margin-xs  text-bold    radius text-right">
                                {{item.equipmentCategory_dictText}}
                            </view>
                        </view>
                        <view class="flex">
                            <view class="flex-sub text-light bg-white padding-xs margin-xs radius">状态:</view>
                            <view
                                class="flex-sub bg-white padding-xs margin-xs  text-bold text-green   radius text-right"
                                v-if="item.status == '1'">
                                待处理
                            </view>
                            <view
                                class="flex-sub bg-white padding-xs margin-xs  text-bold text-green   radius text-right"
                                v-if="item.status == '3'">
                                已完成
                            </view>
                        </view>
                        </view> -->
                    </uni-card>
                </view>
@@ -93,7 +81,7 @@
                NavBarColor: this.NavBarColor,
                url: {
                    stallList: "/mom/partTakeRollingDetail/list"
                    stallList: "/eam/equipment/list"
                },
                upOption: {
@@ -114,16 +102,7 @@
                    color: '#2979FF',
                    borderColor: '#2979FF'
                },
                msgList: [{
                    partName: "设备A",
                    partType: "服务器",
                    location: "机房",
                    manufacturer: "灵秀",
                    model: "ModelX",
                    assignee: "张三",
                    remark: "演示",
                    status: 1
                }], //列表数据
                msgList: [], //列表数据
                announcement1: [],
                msg1Count: 0,
                msg2Count: 0,
@@ -163,101 +142,51 @@
             * @param {Object} item
             * 详情页面
             */
            // onClickProductionTask(item) {
            //     let keyword = this.TabCur
            //     uni.navigateTo({
            //     url: '/pages/mes/om/workSheetOpToolingBorrowDeils/workSheetOpToolingBorrowDeils?keyword=' + keyword
            //     })
            onClickProductionTask(item) {
                uni.navigateTo({
                    url: '/pages/device/deviceDeils/deviceDeils?item=' + encodeURIComponent(JSON.stringify(item))
                })
            },
            upCallback(page) {
                this.$http.get(this.url.stallList, {
                    params: {
                        pageNo: page.num,
                        pageSize: page.size,
                        order: 'asc',
                        column: 'createTime',
            // },
                    },
                }).then(res => {
                    this.announcement1 = res.data.result.records
                    this.mescroll.endSuccess(this.announcement1.length);
                    console.log("url", res)
                    //设置列表数据
                    if (res.data.success) {
                        console.log("res", res.data)
                        this.msg1Count = res.data.result.total
                        this.msg1Title = "通知(" + res.data.result.total + ")";
                        for (let annItem of this.announcement1) {
                            this.msgList.push(annItem)
                        }
                    }
                    if (page.num == 1) {
                        this.msgList = []; //如果是第一页需手动制空列表
                        this.msgList = this.msgList.concat(this.announcement1); //追加新数据
                    }
            // upCallback(page) {
            //     let keyword = this.TabCur
            //     if (keyword == 0) {
            //         this.$http.get(this.url.stallList, {
            //             params: {
            //                 pageNo: page.num,
            //                 pageSize: page.size,
            //                 order: 'asc',
            //                 column: 'createTime',
            //                 status: 1
            //             },
            //         }).then(res => {
            //             this.announcement1 = res.data.result.records
            //             this.mescroll.endSuccess(this.announcement1.length);
            //             console.log("url", res)
            //             //设置列表数据
            //             if (res.data.success) {
            //                 console.log("res", res.data)
            //                 this.msg1Count = res.data.result.total
            //                 this.msg1Title = "通知(" + res.data.result.total + ")";
            //                 for (let annItem of this.announcement1) {
            //                     this.msgList.push(annItem)
            //                 }
            //             }
            //             if (page.num == 1) {
            //                 this.msgList = []; //如果是第一页需手动制空列表
            //                 this.msgList = this.msgList.concat(this.announcement1); //追加新数据
            //             }
            //         }).catch(() => {
            //             //联网失败, 结束加载
            //             this.mescroll.endErr();
            //         })
            //     } else if (keyword == 1) {
            //         this.$http.get(this.url.stallList, {
            //             params: {
            //                 pageNo: page.num,
            //                 pageSize: page.size,
            //                 order: 'desc',
            //                 status: 3,
            //                 column: 'createTime'
            //             },
            //         }).then(res => {
            //             this.announcement1 = res.data.result.records
            //             this.mescroll.endSuccess(this.announcement1.length);
            //             console.log("url", res)
            //             //设置列表数据
            //             if (res.data.success) {
            //                 console.log("res", res.data)
            //                 this.msg2Count = res.data.result.total
            //                 this.msg1Title = "通知(" + res.data.result.total + ")";
            //                 for (let annItem of this.announcement1) {
            //                     this.msgList.push(annItem)
            //                 }
            //             }
            //             if (page.num == 1) {
            //                 this.msgList = []; //如果是第一页需手动制空列表
            //                 this.msgList = this.msgList.concat(this.announcement1); //追加新数据
            //             }
            //         }).catch(() => {
            //             //联网失败, 结束加载
            //             this.mescroll.endErr();
            //         })
            //     }
            // },
                }).catch(() => {
                    //联网失败, 结束加载
                    this.mescroll.endErr();
                })
            },
            /* 检索 */
            getSera(res) {
                this.$refs.popup.close();
                let keyword = this.TabCur
                this.msgList = [];
                if (keyword == 0) {
                    this.$http.get(this.url.stallList, {
                        params: {
@@ -265,9 +194,7 @@
                            pageSize: 999,
                            order: "desc",
                            column: "createTime",
                            num: '*' + this.formData.num + '*',
                            partNumNameModel: '*' + this.formData.partNumNameModel + '*',
                            status: 'published'
                            equipmentCode: res
                        }
                    }).then(res => {
                        //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
@@ -293,89 +220,8 @@
                        //联网失败, 结束加载
                        this.mescroll.endErr();
                    })
                } else if (keyword == 1) {
                    this.$http.get(this.url.stallList, {
                        params: {
                            pageNo: 1,
                            pageSize: 999,
                            order: "desc",
                            column: "createTime",
                            status: 'training',
                            num: '*' + this.formData.num + '*',
                            partNumNameModel: '*' + this.formData.partNumNameModel + '*'
                        }
                    }).then(res => {
                        //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
                        this.announcement1 = res.data.result.records
                        this.mescroll.endSuccess(this.announcement1.length);
                        console.log("url", res)
                        //设置列表数据
                        if (res.data.success) {
                            console.log("res", res.data)
                            this.msg1Count = res.data.result.total
                            this.msg2Title = "通知(" + res.data.result.total + ")";
                            for (let annItem of this.announcement1) {
                                this.msgList.push(annItem)
                            }
                        }
                        if (page.num == 1) {
                            this.msgList = []; //如果是第一页需手动制空列表
                            this.msgList = this.msgList.concat(this.announcement1); //追加新数据
                        }
                    }).catch(() => {
                        //联网失败, 结束加载
                        this.mescroll.endErr();
                    })
                } else if (keyword == 2) {
                    this.$http.get(this.url.stallList, {
                        params: {
                            pageNo: 1,
                            pageSize: 999,
                            order: "desc",
                            column: "createTime",
                            status: 'completed',
                            num: '*' + this.formData.num + '*',
                            partNumNameModel: '*' + this.formData.partNumNameModel + '*'
                        }
                    }).then(res => {
                        //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
                        this.announcement1 = res.data.result.records
                        this.mescroll.endSuccess(this.announcement1.length);
                        console.log("url", res)
                        //设置列表数据
                        if (res.data.success) {
                            console.log("res", res.data)
                            this.msg3Count = res.data.result.total
                            this.msg1Title = "通知(" + res.data.result.total + ")";
                            for (let annItem of this.announcement1) {
                                this.msgList.push(annItem)
                            }
                        }
                        if (page.num == 1) {
                            this.msgList = []; //如果是第一页需手动制空列表
                            this.msgList = this.msgList.concat(this.announcement1); //追加新数据
                        }
                    }).catch(() => {
                        //联网失败, 结束加载
                        this.mescroll.endErr();
                    })
                }
            },
            mescrollInit(mescroll) {
                console.log('mescrollInit')
pages/index/index.vue
@@ -3,7 +3,7 @@
        <home :cur="PageCur" v-if="PageCur=='home'" :key="commponent1Key"></home>
        <people v-if="PageCur=='people'" :key="commponent2Key"></people>
        <device v-if="PageCur=='device'" :key="commponent3Key"></device>
        <spare v-if="PageCur=='spare'" :key="commponent4Key"></spare>
        <!-- <spare v-if="PageCur=='spare'" :key="commponent4Key"></spare> -->
        <view class="cu-bar tabbar bg-white shadow foot">
            <view :class="PageCur=='home'?'action text-green':'action text-gray'" @click="NavChange" data-cur="home">
                <view class='cuIcon-homefill'></view>首页
@@ -11,9 +11,9 @@
            <view :class="PageCur=='device'?'action text-green':'action text-gray'" @click="NavChange" data-cur="device">
                <view class='cuIcon-apps'></view>设备
            </view>
            <view :class="PageCur=='spare'?'action text-green':'action text-gray'" @click="NavChange" data-cur="spare">
            <!-- <view :class="PageCur=='spare'?'action text-green':'action text-gray'" @click="NavChange" data-cur="spare">
                <view class='cuIcon-scan'></view>扫一扫
            </view>
            </view> -->
            <view :class="PageCur=='people'?'action text-green':'action text-gray'" @click="NavChange"
                data-cur="people">
                <view class='cuIcon-people'></view>我的
@@ -30,8 +30,8 @@
                PageCur: 'home',
                commponent1Key: 0,
                commponent2Key: 0,
                commponent3Key: 0,
                commponent4Key: 0
                commponent3Key: 0
            }
        },
@@ -40,7 +40,6 @@
                ++this.commponent1Key
                ++this.commponent2Key
                ++this.commponent3Key
                ++this.commponent4Key
        },
        methods: {
            NavChange: function(e) {
pages/login/login.vue
@@ -1,306 +1,343 @@
  <template>
    <view class="zai-box">
        <scroll-view scroll-y class="page">
            <view class="text-center" :style="[{animation: 'show ' + 0.4+ 's 1'}]">
                <image src="/static/logo-lx.png" mode='aspectFit' class="zai-logo "></image>
                <view class="zai-title text-shadow ">设备管理 </view>
            </view>
            <view class="box padding-lr-xl login-paddingtop" :style="[{animation: 'show ' + 0.6+ 's 1'}]">
                <block v-if="loginWay==1">
                    <view class="cu-form-group margin-top  shadow-warp" :class="[shape=='round'?'round':'']">
                        <view class="title"><text class="cuIcon-people margin-right-xs"></text>账号:</view>
                        <input placeholder="请输入账号" name="input" v-model="userName"></input>
                    </view>
                    <view class="cu-form-group margin-top shadow-warp" :class="[shape=='round'?'round':'']">
                        <view class="title"><text class="cuIcon-lock margin-right-xs"></text>密码:</view>
                        <input class="uni-input" placeholder="请输入密码" :password="!showPassword" v-model="password" />
                        <view class="action text-lg">
                            <text :class="[showPassword ? 'cuIcon-attention' : 'cuIcon-attentionforbid']" @click="changePassword"></text>
                        </view>
                    </view>
                    <view class="padding text-center margin-top">
                        <button class="cu-btn bg-blue lg margin-right shadow" :loading="loading" :class="[shape=='round'?'round':'']"
                            @tap="onLogin"><text space="emsp">{{loading ? "登录中...":" 登录 "}}</text>
                        </button>
                        <!-- <button class="cu-btn line-blue lg margin-left shadow" :loading="loading" :class="[shape=='round'?'round':'']"
      <view class="zai-box">
          <scroll-view scroll-y class="page">
              <view class="text-center" :style="[{animation: 'show ' + 0.4+ 's 1'}]">
                  <image src="/static/logo-lx.png" mode='aspectFit' class="zai-logo "></image>
                  <view class="zai-title text-shadow ">设备管理 </view>
              </view>
              <view class="box padding-lr-xl login-paddingtop" :style="[{animation: 'show ' + 0.6+ 's 1'}]">
                  <block v-if="loginWay==1">
                      <view class="cu-form-group margin-top  shadow-warp" :class="[shape=='round'?'round':'']">
                          <view class="title"><text class="cuIcon-people margin-right-xs"></text>账号:</view>
                          <input placeholder="请输入账号" name="input" v-model="userName"></input>
                      </view>
                      <view class="cu-form-group margin-top shadow-warp" :class="[shape=='round'?'round':'']">
                          <view class="title"><text class="cuIcon-lock margin-right-xs"></text>密码:</view>
                          <input class="uni-input" placeholder="请输入密码" :password="!showPassword" v-model="password" />
                          <view class="action text-lg">
                              <text :class="[showPassword ? 'cuIcon-attention' : 'cuIcon-attentionforbid']"
                                  @click="changePassword"></text>
                          </view>
                      </view>
                      <view class="padding text-center margin-top">
                          <button class="cu-btn bg-blue lg margin-right shadow" :loading="loading"
                              :class="[shape=='round'?'round':'']" @tap="onLogin"><text
                                  space="emsp">{{loading ? "登录中...":" 登录 "}}</text>
                          </button>
                          <!-- <button class="cu-btn line-blue lg margin-left shadow" :loading="loading" :class="[shape=='round'?'round':'']"
                            @tap="loginWay=3-loginWay">短信登录
                        </button> -->
                    </view>
                </block>
                <block v-else>
                    <view class="cu-form-group margin-top  shadow-warp" :class="[shape=='round'?'round':'']">
                        <view class="title"><text class="cuIcon-mobile margin-right-xs"></text>手机号:</view>
                        <input placeholder="请输入手机号" type="number" maxlength="11" v-model="phoneNo"></input>
                    </view>
                    <view class="cu-form-group margin-top shadow-warp" :class="[shape=='round'?'round':'']">
                        <view class="title"><text class="cuIcon-lock margin-right-xs"></text>验证码:</view>
                        <input class="uni-input" placeholder="请输入验证码" v-model="smsCode"/>
                        <view class="action">
                            <button class="cu-btn line-blue sm" :disabled="!isSendSMSEnable" @click="onSMSSend"> {{ getSendBtnText }}</button>
                        </view>
                    </view>
                    <view class="padding text-center margin-top">
                        <button class="cu-btn bg-blue lg margin-right shadow" :loading="loading" :class="[shape=='round'?'round':'']"
                            @tap="onSMSLogin"><text space="emsp">{{loading ? "登录中...":" 登录 "}}</text>
                        </button>
                        <button class="cu-btn line-blue lg margin-left shadow" :loading="loading" :class="[shape=='round'?'round':'']"
                            @tap="loginWay=1">账户登录
                        </button>
                    </view>
                </block>
                <!-- #ifdef APP-PLUS -->
                <view class="padding flex flex-direction  text-center">
                    当前版本:{{version}}
                </view>
                <!-- #endif -->
            </view>
        </scroll-view>
        <!-- 登录加载弹窗 -->
        <view class="cu-load load-modal" v-if="loading">
            <!-- <view class="cuIcon-emojifill text-orange"></view> -->
            <image src="/static/logo-lx.png" mode="aspectFit" class="round"></image>
            <view class="gray-text">登录中...</view>
        </view>
    </view>
                      </view>
                  </block>
                  <block v-else>
                      <view class="cu-form-group margin-top  shadow-warp" :class="[shape=='round'?'round':'']">
                          <view class="title"><text class="cuIcon-mobile margin-right-xs"></text>手机号:</view>
                          <input placeholder="请输入手机号" type="number" maxlength="11" v-model="phoneNo"></input>
                      </view>
                      <view class="cu-form-group margin-top shadow-warp" :class="[shape=='round'?'round':'']">
                          <view class="title"><text class="cuIcon-lock margin-right-xs"></text>验证码:</view>
                          <input class="uni-input" placeholder="请输入验证码" v-model="smsCode" />
                          <view class="action">
                              <button class="cu-btn line-blue sm" :disabled="!isSendSMSEnable" @click="onSMSSend">
                                  {{ getSendBtnText }}</button>
                          </view>
                      </view>
                      <view class="padding text-center margin-top">
                          <button class="cu-btn bg-blue lg margin-right shadow" :loading="loading"
                              :class="[shape=='round'?'round':'']" @tap="onSMSLogin"><text
                                  space="emsp">{{loading ? "登录中...":" 登录 "}}</text>
                          </button>
                          <button class="cu-btn line-blue lg margin-left shadow" :loading="loading"
                              :class="[shape=='round'?'round':'']" @tap="loginWay=1">账户登录
                          </button>
                      </view>
                  </block>
</template>
<script>
    import { ACCESS_TOKEN,USER_NAME,USER_INFO } from "@/common/util/constants"
    import { mapActions } from "vuex"
    import configService from '@/common/service/config.service.js';
    export default {
        data() {
            return {
                shape:'',//round 圆形
                loading: false,
                userName: 'admin',
                password: '123456',
                phoneNo: '',
                smsCode: '',
                showPassword: false, //是否显示明文
                loginWay: 1, //1: 账密,2:验证码
                smsCountDown: 0,
                smsCountInterval: null,
                toggleDelay: false,
                version:'',
                //第三方登录相关信息
                thirdType:"",
                thirdLoginInfo:"",
                thirdLoginState:false,
                bindingPhoneModal:false,
                thirdUserUuid:'',
                url: {
                    bindingThirdPhone: '/sys/thirdLogin/bindingThirdPhone'
                }
            };
        },
        onLoad:function(){
            // #ifdef APP-PLUS
            var that=this
            plus.runtime.getProperty( plus.runtime.appid, function ( wgtinfo ) {
                that.version=wgtinfo.version
            });
            // #endif
        },
        computed: {
              isSendSMSEnable() {
                return this.smsCountDown <= 0 && this.phoneNo.length > 4;
              },
              getSendBtnText() {
                if (this.smsCountDown > 0) {
                  return this.smsCountDown + '秒后发送';
                } else {
                  return '发送验证码';
                }
              },
              canSMSLogin() {
                return this.userName.length > 4 && this.smsCode.length > 4;
              },
              canPwdLogin() {
                return this.userName.length > 4 && this.password.length > 4;
              },
        },
        methods: {
             ...mapActions([ "mLogin","PhoneLogin","ThirdLogin" ]),
            onLogin: function (){
                    if(!this.userName || this.userName.length==0){
                      this.$tip.toast('请填写用户名');
                      return;
                    }
                    if(!this.password || this.password.length==0){
                       this.$tip.toast('请填写密码');
                      return;
                    }
                    let loginParams = {
                      username:this.userName,
                      password:this.password
                    }
                    this.loading=true;
                    this.mLogin(loginParams).then((res) => {
                      this.loading=false;
                      if(res.data.success){
                         // #ifdef APP-PLUS
                          this.saveClientId()
                         // #endif
                         // #ifndef APP-PLUS
                          this.$tip.success('登录成功!')
                          this.$Router.replaceAll({name:'index'})
                         // #endif
                        }else{
                          this.$tip.alert(res.data.message);
                        }
                    }).catch((err) => {
                      let msg = err.data.message || "请求出现错误,请稍后再试"
                      this.loading=false;
                      this.$tip.alert(msg);
                    }).finally(()=>{
                      this.loading=false;
                })
            },
            saveClientId(){
                var info = plus.push.getClientInfo();
                var cid = info.clientid;
                this.$http.get("/sys/user/saveClientId",{params:{clientId:cid}}).then(res=>{
                    console.log("res::saveClientId>",res)
                    this.$tip.success('登录成功!')
                    this.$Router.replaceAll({name:'index'})
                })
            },
            changePassword() {
                this.showPassword = !this.showPassword;
            },
            onSMSSend() {
                let smsParams = {};
                smsParams.mobile=this.phoneNo;
                smsParams.smsmode="0";
                let checkPhone = new RegExp(/^[1]([3-9])[0-9]{9}$/);
                if(!smsParams.mobile || smsParams.mobile.length==0){
                    this.$tip.toast('请输入手机号');
                    return false
                }
                if(!checkPhone.test(smsParams.mobile)){
                    this.$tip.toast('请输入正确的手机号');
                    return false
                }
                this.$http.post("/sys/sms",smsParams).then(res=>{
                  if(res.data.success){
                    this.smsCountDown = 60;
                    this.startSMSTimer();
                  }else{
                    this.smsCountDown = 0;
                    this.$tip.toast(res.data.message);
                  }
                });
              },
            startSMSTimer() {
                this.smsCountInterval = setInterval(() => {
                  this.smsCountDown--;
                  if (this.smsCountDown <= 0) {
                    clearInterval(this.smsCountInterval);
                  }
                }, 1000);
            },
            onSMSLogin() {
                let checkPhone = new RegExp(/^[1]([3-9])[0-9]{9}$/);
                if(!this.phoneNo || this.phoneNo.length==0){
                  this.$tip.toast('请填写手机号');
                  return;
                }
                if(!checkPhone.test(this.phoneNo)){
                    this.$tip.toast('请输入正确的手机号');
                    return false
                }
                if(!this.smsCode || this.smsCode.length==0){
                  this.$tip.toast('请填短信验证码');
                  return;
                }
                let loginParams = {
                  mobile:this.phoneNo,
                  captcha:this.smsCode
                };
                this.PhoneLogin(loginParams).then((res) => {
                  console.log("res====》",res)
                  if(res.data.success){
                    this.$tip.success('登录成功!')
                    this.$Router.replaceAll({name:'index'})
                  }else{
                    this.$tip.error(res.data.message);
                  }
                }).catch((err) => {
                  let msg = ((err.response || {}).data || {}).message || err.data.message || "请求出现错误,请稍后再试"
                  this.$tip.error(msg);
                });
            },
            loginSuccess() {
              // 登陆成功,重定向到主页
              this.$Router.replace({name:'index'})
            },
            requestFailed(err) {
              this.$message.warning("登录失败")
            },
        },
        beforeDestroy() {
            if (this.smsCountInterval) {
                clearInterval(this.smsCountInterval);
            }
        },
    }
</script>
                  <!-- #ifdef APP-PLUS -->
                  <view class="padding flex flex-direction  text-center">
                      当前版本:{{version}}
                  </view>
                  <!-- #endif -->
<style>
    .login-paddingtop {
        padding-top: 100upx;
    }
              </view>
          </scroll-view>
          <!-- 登录加载弹窗 -->
          <view class="cu-load load-modal" v-if="loading">
              <!-- <view class="cuIcon-emojifill text-orange"></view> -->
              <image src="/static/logo-lx.png" mode="aspectFit" class="round"></image>
              <view class="gray-text">登录中...</view>
          </view>
      </view>
    .zai-box {
        padding: 0 20upx;
        padding-top: 100upx;
        position: relative;
    }
  </template>
    .zai-logo {
        width: 200upx;
        height: 150px;
    }
  <script>
      import {
          ACCESS_TOKEN,
          USER_NAME,
          USER_INFO
      } from "@/common/util/constants"
      import {
          mapActions
      } from "vuex"
      import configService from '@/common/service/config.service.js';
    .zai-title {
       font-size: 58upx;
       color: #000000;
       text-align: center;
    }
      export default {
          data() {
              return {
                  shape: '', //round 圆形
                  loading: false,
                  userName: 'admin',
                  password: '123456',
                  phoneNo: '',
                  smsCode: '',
                  showPassword: false, //是否显示明文
                  loginWay: 1, //1: 账密,2:验证码
                  smsCountDown: 0,
                  smsCountInterval: null,
                  toggleDelay: false,
                  version: '',
                  //第三方登录相关信息
                  thirdType: "",
                  thirdLoginInfo: "",
                  thirdLoginState: false,
                  bindingPhoneModal: false,
                  thirdUserUuid: '',
                  id: '',
                  url: {
                      bindingThirdPhone: '/sys/thirdLogin/bindingThirdPhone'
                  }
              };
          },
          onLoad: function(options) {
              this.id = options.id;
              // #ifdef APP-PLUS
              var that = this
              plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
                  that.version = wgtinfo.version
              });
              // #endif
          },
          computed: {
              isSendSMSEnable() {
                  return this.smsCountDown <= 0 && this.phoneNo.length > 4;
              },
              getSendBtnText() {
                  if (this.smsCountDown > 0) {
                      return this.smsCountDown + '秒后发送';
                  } else {
                      return '发送验证码';
                  }
              },
              canSMSLogin() {
                  return this.userName.length > 4 && this.smsCode.length > 4;
              },
              canPwdLogin() {
                  return this.userName.length > 4 && this.password.length > 4;
              },
          },
          methods: {
              ...mapActions(["mLogin", "PhoneLogin", "ThirdLogin"]),
              onLogin: function() {
                  if (!this.userName || this.userName.length == 0) {
                      this.$tip.toast('请填写用户名');
                      return;
                  }
                  if (!this.password || this.password.length == 0) {
                      this.$tip.toast('请填写密码');
                      return;
                  }
                  let loginParams = {
                      username: this.userName,
                      password: this.password
                  }
                  this.loading = true;
                  this.mLogin(loginParams).then((res) => {
                      this.loading = false;
                      if (res.data.success) {
                          // #ifdef APP-PLUS
                          this.saveClientId()
                          // #endif
                          // #ifndef APP-PLUS
                          this.$tip.success('登录成功!')
                          this.$Router.replaceAll({
                              name: 'index'
                          })
                          // if (this.id) {
                          //     uni.navigateTo({
                          //         url: `/pages/device/deviceWebDeils/deviceWebDeils?equipmentId=${this.id}`
                          //     });
    .input-placeholder, .zai-input {
        color: #94afce;
    }
                          // } else {
                          //     this.$tip.success('登录成功!')
                          //     this.$Router.replaceAll({
                          //         name: 'index'
                          //     })
                          // }
    .zai-label {
        padding: 60upx 0;
        text-align: center;
        font-size: 30upx;
        color: #a7b6d0;
    }
    .zai-btn {
        background: #ff65a3;
        color: #fff;
        border: 0;
        border-radius: 100upx;
        font-size: 36upx;
    }
                          // #endif
                      } else {
                          this.$tip.alert(res.data.message);
                      }
                  }).catch((err) => {
                      let msg = err.data.message || "请求出现错误,请稍后再试"
                      this.loading = false;
                      this.$tip.alert(msg);
                  }).finally(() => {
                      this.loading = false;
                  })
              },
              saveClientId() {
                  var info = plus.push.getClientInfo();
                  var cid = info.clientid;
                  this.$http.get("/sys/user/saveClientId", {
                      params: {
                          clientId: cid
                      }
                  }).then(res => {
                      console.log("res::saveClientId>", res)
                      this.$tip.success('登录成功!')
                      this.$Router.replaceAll({
                          name: 'index'
                      })
                  })
              },
              changePassword() {
                  this.showPassword = !this.showPassword;
              },
              onSMSSend() {
                  let smsParams = {};
                  smsParams.mobile = this.phoneNo;
                  smsParams.smsmode = "0";
                  let checkPhone = new RegExp(/^[1]([3-9])[0-9]{9}$/);
                  if (!smsParams.mobile || smsParams.mobile.length == 0) {
                      this.$tip.toast('请输入手机号');
                      return false
                  }
                  if (!checkPhone.test(smsParams.mobile)) {
                      this.$tip.toast('请输入正确的手机号');
                      return false
                  }
                  this.$http.post("/sys/sms", smsParams).then(res => {
                      if (res.data.success) {
                          this.smsCountDown = 60;
                          this.startSMSTimer();
                      } else {
                          this.smsCountDown = 0;
                          this.$tip.toast(res.data.message);
                      }
                  });
              },
              startSMSTimer() {
                  this.smsCountInterval = setInterval(() => {
                      this.smsCountDown--;
                      if (this.smsCountDown <= 0) {
                          clearInterval(this.smsCountInterval);
                      }
                  }, 1000);
              },
              onSMSLogin() {
                  let checkPhone = new RegExp(/^[1]([3-9])[0-9]{9}$/);
    .zai-btn:after {
        border: 0;
    }
                  if (!this.phoneNo || this.phoneNo.length == 0) {
                      this.$tip.toast('请填写手机号');
                      return;
                  }
                  if (!checkPhone.test(this.phoneNo)) {
                      this.$tip.toast('请输入正确的手机号');
                      return false
                  }
                  if (!this.smsCode || this.smsCode.length == 0) {
                      this.$tip.toast('请填短信验证码');
                      return;
                  }
                  let loginParams = {
                      mobile: this.phoneNo,
                      captcha: this.smsCode
                  };
                  this.PhoneLogin(loginParams).then((res) => {
                      console.log("res====》", res)
                      if (res.data.success) {
                          this.$tip.success('登录成功!')
                          this.$Router.replaceAll({
                              name: 'index'
                          })
                      } else {
                          this.$tip.error(res.data.message);
                      }
                  }).catch((err) => {
                      let msg = ((err.response || {}).data || {}).message || err.data.message || "请求出现错误,请稍后再试"
                      this.$tip.error(msg);
                  });
              },
              loginSuccess() {
                  // 登陆成功,重定向到主页
                  this.$Router.replace({
                      name: 'index'
                  })
              },
              requestFailed(err) {
                  this.$message.warning("登录失败")
              },
          },
          beforeDestroy() {
              if (this.smsCountInterval) {
                  clearInterval(this.smsCountInterval);
              }
          },
      }
  </script>
    /*按钮点击效果*/
    .zai-btn.button-hover {
        transform: translate(1upx, 1upx);
    }
  <style>
      .login-paddingtop {
          padding-top: 100upx;
      }
</style>
      .zai-box {
          padding: 0 20upx;
          padding-top: 100upx;
          position: relative;
      }
      .zai-logo {
          width: 200upx;
          height: 150px;
      }
      .zai-title {
          font-size: 58upx;
          color: #000000;
          text-align: center;
      }
      .input-placeholder,
      .zai-input {
          color: #94afce;
      }
      .zai-label {
          padding: 60upx 0;
          text-align: center;
          font-size: 30upx;
          color: #a7b6d0;
      }
      .zai-btn {
          background: #ff65a3;
          color: #fff;
          border: 0;
          border-radius: 100upx;
          font-size: 36upx;
      }
      .zai-btn:after {
          border: 0;
      }
      /*按钮点击效果*/
      .zai-btn.button-hover {
          transform: translate(1upx, 1upx);
      }
  </style>
pages/spare/spare.vue
@@ -1,182 +1,145 @@
<template>
    <view class="container">
        <button class="scan" @click="openQrcode">点击扫码</button>
        <view class="reader-box" v-if="isScaning">
            <view class="reader" id="reader"></view>
    <view>
        <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="index">
            <block slot="backText">返回</block>
            <block slot="content">扫一扫</block>
        </cu-custom>
        <view class="scanCode">
            <mumu-get-qrcode :continue="true" @success='qrcodeSucess' @error="qrcodeError"
                :definition="true"></mumu-get-qrcode>
        </view>
        <view>扫码内容:{{scanVal}}</view>
    </view>
</template>
<script>
    import {
        Html5Qrcode
    } from "html5-qrcode";
    import mumuGetQrcode from '@/uni_modules/mumu-getQrcode/components/mumu-getQrcode/mumu-getQrcode.vue';
    export default {
        name: 'spare',
        watch: {
            cur: {
                immediate: true,
                handler() {
                    console.log('watch', this.cur)
                },
            },
        components: {
            mumuGetQrcode // 注册
        },
        name: 'spare',
        data() {
            return {
                html5QrCode: null,
                isScaning: false,
                cameraId: null,
                scanVal: ''
            }
                NavBarColor: this.NavBarColor,
                hasNavigated: false // 标记是否已经跳转
            };
        },
        methods: {
        // mounted() {
        //     window.addEventListener('hashchange', this.handleHashChange);
        //     // 初始解析 hash
        //     this.handleHashChange();
        // },
        // beforeDestroy() {
        //     window.removeEventListener('hashchange', this.handleHashChange);
        // },
            isValidURL(url) {
                const pattern = new RegExp('^(https?:\\/\\/)?' + // protocol
                    '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
                    '((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
                    '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
                    '(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
                    '(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
                return !!pattern.test(url);
            },
            checkURL() {
                const url = this.scanVal;
                if (this.isValidURL(url)) {
                    uni.openURL({
                        url: url
                    })
                } else {
                    uni.showToast({
                        title: 'url地址错误,请重试',
                        icon: 'none',
                        duration: 2000
                    });
                }
            },
        openQrcode() {
            this.isScaning = true;
            Html5Qrcode.getCameras().then((devices) => {
                if (devices && devices.length) {
                    if (devices.length > 1) {
                        this.cameraId = devices[1].id;
                    } else {
                        this.cameraId = devices[0].id;
                    }
                    this.html5QrCode = new Html5Qrcode('reader');
                    this.startInit();
                }
            });
        },
        startInit() {
            const that = this;
            this.html5QrCode.start(
                    this.cameraId, // retreived in the previous step.
                    // {
                    //     facingMode: "environment" //  environment后置摄像头 user前置摄像头
                    // },
                    {
                        fps: 10, // sets the framerate to 10 frame per second
                        qrbox: 250 // sets only 250 X 250 region of viewfinder to
        methods: {
            // handleHashChange() {
            //     if (this.hasNavigated) {
            //         console.log('Already navigated, skipping hash change handling');
            //         return;
            //     }
            //     const hash = window.location.hash;
            //     console.log('Hash changed:', hash); // 添加日志
            //     if (!hash || hash.length === 0) {
            //         console.warn('Hash is empty or undefined');
            //         return;
            //     }
            //     const params = new URLSearchParams(hash.split('?')[1]);
            //     const equipmentId = params.get('equipmentId');
            //     console.log('Parsed equipmentId:', equipmentId); // 添加日志
            //     if (equipmentId) {
            //         this.navigateToDeviceDetails(equipmentId);
            //     } else {
            //         console.warn('No equipmentId found in hash');
            //     }
            // },
            navigateToDeviceDetails(equipmentId) {
                this.hasNavigated = true; // 标记已经跳转
                uni.navigateTo({
                    url: `/pages/device/deviceWebDeils/deviceWebDeils?equipmentId=${encodeURIComponent(equipmentId)}`,
                    success: () => {
                        console.log('Navigated to device details');
                    },
                    qrCodeMessage => {
                    fail: (err) => {
                        console.error('Navigation failed:', err);
                    }
                });
            },
            qrcodeSucess(data) { // 扫码成功
                setTimeout(() => {
                    let equipmentId;
                    try {
                        // 兼容性处理:优先使用URL和URLSearchParams,如果不可用则使用字符串解析
                        if ('URL' in window && 'URLSearchParams' in window) {
                            const url = new URL(data);
                            const params = new URLSearchParams(url.hash.slice(1).split('?')[1]);
                            equipmentId = params.get('equipmentId');
                        } else {
                            // 字符串解析方式
                            const hashIndex = data.indexOf('#');
                            if (hashIndex !== -1) {
                                const hashPart = data.substring(hashIndex + 1);
                                const paramIndex = hashPart.indexOf('?');
                                if (paramIndex !== -1) {
                                    const paramStr = hashPart.substring(paramIndex + 1);
                                    const pairs = paramStr.split('&');
                                    for (let pair of pairs) {
                                        const [key, value] = pair.split('=');
                                        if (key === 'equipmentId') {
                                            equipmentId = value;
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                        if (equipmentId) {
                            // 登录成功且获取到equipmentId,跳转到设备详情页面
                            this.navigateToDeviceDetails(equipmentId);
                        } else {
                            uni.showModal({
                                title: '提示',
                                content: "二维码中未找到有效的equipmentId",
                                showCancel: false
                            });
                        }
                    } catch (error) {
                        uni.showModal({
                            title: 'success',
                            content: JSON.stringify(qrCodeMessage),
                            title: '错误',
                            content: "解析URL出错,请检查二维码内容",
                            showCancel: false
                        });
                        // do something when code is read. For example:
                        if (qrCodeMessage) {
                            //成功扫出码qrCodeMessage为扫码内容
                            //扫码成功记得关掉摄像
                            that.action(qrCodeMessage) //对二维码逻辑处理
                            that.stopScan(); //关闭扫码功能
                        }
                    },
                    errorMessage => {
                        console.log('errorMessage', errorMessage);
                        if (errorMessage.includes('NotFoundException')) {
                            uni.showToast({
                                title: '未找到二维码,请重新对准',
                                icon: 'none',
                                duration: 2000
                            });
                        } else {
                            uni.showToast({
                                title: '扫码失败,请重试',
                                icon: 'none',
                                duration: 2000
                            });
                        }
                    }
                )
                .catch((err) => {
                    // 扫码错误信息
                    let message = "";
                    if (typeof err == "string") {
                        message = "识别失败";
                    } else {
                        if (err.name == "NotAllowedError") {
                            message = "您需要授予相机访问权限!";
                        }
                        if (err.name == "NotFoundError") {
                            message = "这个设备上没有摄像头!";
                        }
                        if (err.name == "NotSupportedError") {
                            message =
                                "摄像头访问只支持在安全的上下文中,如https或localhost!";
                        }
                        if (err.name == "NotReadableError") {
                            message = "相机被占用!";
                        }
                        if (err.name == "OverconstrainedError") {
                            message = "安装摄像头不合适!";
                        }
                        if (err.name == "StreamApiNotSupportedError") {
                            message = "此浏览器不支持流API!";
                        }
                }, 200); // 增加100毫秒的延迟
            },
            qrcodeError(err) { // 扫码失败
                uni.showModal({
                    title: '摄像头授权失败',
                    content: '摄像头授权失败,请检测当前浏览器是否有摄像头权限。',
                    success: () => {
                        uni.navigateBack({}); // 返回到上一页
                    }
                    uni.showToast({
                        title: message,
                        icon: 'none',
                        duration: 2000
                    });
                });
        },
        action(val) {
            this.scanVal = val;
            const url = this.scanVal;
            this.checkURL(url)
            // plus.runtime.openURL(this.scanVal, function(res) {
            //     console.log(res);
            // });
        },
        stopScan() {
            console.log('停止扫码')
            this.isScaning = false;
            if (this.html5QrCode) {
                this.html5QrCode.stop()
                    .then((ignore) => {
                        console.log("停止扫码", ignore);
                    })
                    .catch((err) => {
                        console.log(err);
                        showToast("停止扫码失败");
                    });
            }
        },
    }
    }
        }
    };
</script>
<style>
    .container {
    .scanCode {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 99;
        height: 100%;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.7);
    }
    .reader-box {
plugin/uni-simple-router/helpers/urlQuery.js
@@ -1,157 +1,205 @@
import { Global } from './config';
import { warn, err } from './warn';
import {
    Global
} from './config';
import {
    warn,
    err
} from './warn';
const nodeURL = require('query-string');
class ParseQuery {
    get queryName() {
        return nodeURL;
    }
    get queryName() {
        return nodeURL;
    }
    /**
     * 判断当前这个对象是否为深度对象
     * @param {Object} obj
     */
    isDepthObject(obj) {
        const str = JSON.stringify(obj);
        return str.match(/}/g).length > 1;
    }
    /**
     * 判断当前这个对象是否为深度对象
     * @param {Object} obj
     */
    isDepthObject(obj) {
        const str = JSON.stringify(obj);
        return str.match(/}/g).length > 1;
    }
    /**
     * 从URL中提取查询字符串
     * @param {String} url
     */
    extract(url) {
        return nodeURL.extract(url);
    }
    /**
     * 从URL中提取查询字符串
     * @param {String} url
     */
    extract(url) {
        return nodeURL.extract(url);
    }
    /**
     * 把一个 key=value&key1=value 的字符串转成对象
     * @param {string} strQuery key=value&key1=value 类型的字符串
     */
    parse(strQuery) {
        return nodeURL.parse(strQuery);
    }
    /**
     * 把一个 key=value&key1=value 的字符串转成对象
     * @param {string} strQuery key=value&key1=value 类型的字符串
     */
    parse(strQuery) {
        return nodeURL.parse(strQuery);
    }
    /**
     * 把一个对象转成 key=value&key1=value 类型的字符串
     * @param {Object} ObjQuery 符合js标注的对象
     * @param {Boolean} intact 是否在转成的字符串前添加?号
     */
    stringify(ObjQuery, intact = true) {
        const strQuery = nodeURL.stringify(ObjQuery);
        if (intact) {
            return `?${strQuery}`;
        }
        return strQuery;
    }
    /**
     * 把一个对象转成 key=value&key1=value 类型的字符串
     * @param {Object} ObjQuery 符合js标注的对象
     * @param {Boolean} intact 是否在转成的字符串前添加?号
     */
    stringify(ObjQuery, intact = true) {
        const strQuery = nodeURL.stringify(ObjQuery);
        if (intact) {
            return `?${strQuery}`;
        }
        return strQuery;
    }
    /**
     * 把一个对象或者 key=value&key1=value 类型的数据加密成 query=encodeURIComponent(value)
     * @param {Object|String} query 符合js标注的对象 或者 key=value&key1=value 字符串
     * @param {Boolean} intact 是否在转成的字符串前添加?号
     */
    encode(query, intact = true) {
        let [strQuery, formatQuery] = ['', ''];
        if (query == null) {
            warn('加密参数没有传递,你知道?', true);
            return '';
        }
        if (query.constructor === String) { // 字符串 尝试 转成 对象
            strQuery = JSON.stringify(this.parse(query));
        } else if (query.constructor === Object) { // 直接转成字符串对象即可
            if (Object.keys(query).length === 0) {
                warn('当前参数不满足加密规范!');
                return '';
            }
            strQuery = JSON.stringify(query);
        }
        if (intact) {
            formatQuery = '?';
        }
        formatQuery += `query=${encodeURIComponent(strQuery)}`;
        return formatQuery;
    }
    /**
     * 把一个对象或者 key=value&key1=value 类型的数据加密成 query=encodeURIComponent(value)
     * @param {Object|String} query 符合js标注的对象 或者 key=value&key1=value 字符串
     * @param {Boolean} intact 是否在转成的字符串前添加?号
     */
    encode(query, intact = true) {
        let [strQuery, formatQuery] = ['', ''];
        if (query == null) {
            warn('加密参数没有传递,你知道?', true);
            return '';
        }
        if (query.constructor === String) { // 字符串 尝试 转成 对象
            strQuery = JSON.stringify(this.parse(query));
        } else if (query.constructor === Object) { // 直接转成字符串对象即可
            if (Object.keys(query).length === 0) {
                warn('当前参数不满足加密规范!');
                return '';
            }
            strQuery = JSON.stringify(query);
        }
        if (intact) {
            formatQuery = '?';
        }
        formatQuery += `query=${encodeURIComponent(strQuery)}`;
        return formatQuery;
    }
    /**
     * 把一个已经加密好的字符串 query=encodeURIComponent(value) 解密成 对象
     * @param {string} strQuery  已经加密好的字符串 query=encodeURIComponent(value)
     */
    decode(strQuery) {
        if (strQuery == null) {
            warn('解密参数没有传递,你知道?', true);
            return {};
        }
        let jsonQuery = strQuery;
        if (strQuery.constructor === Object) { // 如果是对象 看能不能满足要求
            jsonQuery = strQuery.query;
            if (jsonQuery == null) {
                warn('当前解密参数不满足编码规则');
                return {};
            }
            jsonQuery = `query=${jsonQuery}`;
        }
        let decode = {};
        // query 长这个样  query=encodeURIComponent(value)
        const decodeStr = decodeURIComponent(jsonQuery);
        const { query } = this.parse(decodeStr); // 转成 json 获取到正真的json字符串
        if (query == null) {
            warn('当前解密参数不满足编码规则');
        } else {
            try {
                decode = JSON.parse(query);
            } catch (error) {
                warn('当前解密参数不满足编码规则');
            }
        }
        return decode;
    }
    /**
     * 把一个已经加密好的字符串 query=encodeURIComponent(value) 解密成 对象
     * @param {string} strQuery  已经加密好的字符串 query=encodeURIComponent(value)
     */
    decode(strQuery) {
        if (strQuery == null) {
            warn('解密参数没有传递,你知道?', true);
            return {};
        }
        let jsonQuery = strQuery;
        if (strQuery.constructor === Object) { // 如果是对象 看能不能满足要求
            jsonQuery = strQuery.query;
            if (jsonQuery == null) {
                warn('当前解密参数不满足编码规则');
                return {};
            }
            jsonQuery = `query=${jsonQuery}`;
        }
        let decode = {};
        // query 长这个样  query=encodeURIComponent(value)
        const decodeStr = decodeURIComponent(jsonQuery);
        const {
            query
        } = this.parse(decodeStr); // 转成 json 获取到正真的json字符串
        if (query == null) {
            warn('当前解密参数不满足编码规则');
        } else {
            try {
                decode = JSON.parse(query);
            } catch (error) {
                warn('当前解密参数不满足编码规则');
            }
        }
        return decode;
    }
    queryGet(query) {
        const {
            encodeURI
        } = Global.Router.CONFIG; // 获取到路由配置
        let [decode, historyObj, strQuery] = [query, query, ''];
        switch (encodeURI) {
            case true: { // 加密模式
                decode = this.decode(query);
                strQuery = this.encode(decode); { //-> 代码 这是修改的内容 添加我们自定义处理
                    if (strQuery === '' && query) {
                        //-> junjie
                        //-| 需要注意 ,我们的是自定义对象 , 是不包含 query 的,
                        //-| 按照我们自己的规则解析
                        let newstrQuery = Object.keys(query).map(key => key.concat("=").concat(query[key])).join(
                            "&")
                        if (newstrQuery) {
                            strQuery = "?" + newstrQuery;
                        }
                    }
                }
                historyObj = {
                    query: encodeURIComponent(JSON.stringify(decode)),
                };
                break;
            }
            case false: { // 不加密模式
                strQuery = this.stringify(query);
                break;
            }
            default: {
                err('未知参数模式,请检查 \'encodeURI\'', true);
            }
        }
    queryGet(query) {
        const { encodeURI } = Global.Router.CONFIG; // 获取到路由配置
        let [decode, historyObj, strQuery] = [query, query, ''];
        switch (encodeURI) {
        case true: { // 加密模式
            decode = this.decode(query);
            strQuery = this.encode(decode);
            historyObj = {
                query: encodeURIComponent(JSON.stringify(decode)),
            };
            break;
        }
        case false: { // 不加密模式
            strQuery = this.stringify(query);
            break;
        }
        default: {
            err('未知参数模式,请检查 \'encodeURI\'', true);
        }
        }
        return { strQuery, historyObj, decode };
    }
        return {
            strQuery,
            historyObj,
            decode
        };
    }
    // queryGet(query) {
    //     const { encodeURI } = Global.Router.CONFIG; // 获取到路由配置
    //     let [decode, historyObj, strQuery] = [query, query, ''];
    //     switch (encodeURI) {
    //     case true: { // 加密模式
    //         decode = this.decode(query);
    //         strQuery = this.encode(decode);
    //         historyObj = {
    //             query: encodeURIComponent(JSON.stringify(decode)),
    //         };
    //         break;
    //     }
    //     case false: { // 不加密模式
    //         strQuery = this.stringify(query);
    //         break;
    //     }
    //     default: {
    //         err('未知参数模式,请检查 \'encodeURI\'', true);
    //     }
    //     }
    //     return { strQuery, historyObj, decode };
    // }
    /**
     * 对需要传递的参数进行加密解密
     * @param {Object|String} query get为false 必须为 Object 类型
     * @param {String} get 是取值 还是通过api传值
     */
    transfer(query = {}) {
        const { encodeURI } = Global.Router.CONFIG; // 获取到路由配置
        switch (encodeURI) {
        case true: {
            // 加密模式
            return this.encode(query, false);
        }
        case false: {
            // 不加密模式
            return this.stringify(query);
        }
        default: {
            err('未知参数模式,请检查 \'encodeURI\' ', true);
        }
        }
    }
    /**
     * 对需要传递的参数进行加密解密
     * @param {Object|String} query get为false 必须为 Object 类型
     * @param {String} get 是取值 还是通过api传值
     */
    transfer(query = {}) {
        const {
            encodeURI
        } = Global.Router.CONFIG; // 获取到路由配置
        switch (encodeURI) {
            case true: {
                // 加密模式
                return this.encode(query, false);
            }
            case false: {
                // 不加密模式
                return this.stringify(query);
            }
            default: {
                err('未知参数模式,请检查 \'encodeURI\' ', true);
            }
        }
    }
}
export default ParseQuery;
export default ParseQuery;
store/index.js
@@ -37,6 +37,7 @@
            const result = response.data.result
            const userInfo = result.userInfo
            uni.setStorageSync(ACCESS_TOKEN,result.token);
            uni.setStorageSync("isLogin",true);
            uni.setStorageSync(USER_INFO,userInfo);
            commit('SET_TOKEN', result.token)
            commit('SET_AVATAR', userInfo.avatar)