kongdeqiang
2026-02-24 8613999daac6a42bef5694f43c78d0988251137e
feat: 更新缴费bug
3个文件已修改
92 ■■■■ 已修改文件
src/components/page/IndexXTYH.vue 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/state.js 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/IndexXTYH.vue
@@ -228,6 +228,8 @@
    }
  },
  created(){
    //39服务器用的是code2字段,183服务器用的是code字段,这样就可以达到183访问的时候重新跳转到39服务器页面
    this.$message = Message; // 挂载全局Message,避免重复引入
    this.code = ''
    this.code2 = ''
@@ -254,36 +256,28 @@
      return;
    }
    var url = decodeURIComponent(window.location.href);
    const getUrlParams=(url) => {
      const params = {};
      const queryIndex = url.indexOf('?');
      if (queryIndex === -1) return params;
      const query = url.slice(queryIndex + 1);
      query.split('&').forEach(item => {
        const [key, val] = item.split('=');
        if (key) params[key] = val || '';
      });
      return params;
    }
    const params = getUrlParams(url);
    this.code = params.code || '';
    this.code2 = params.code2 || '';
    // 优化跳转逻辑(避免重复跳转)
    if (Object.keys(params).length > 2 && params.code && params.code2) {
      // 仅当参数完整时跳转(避免无限循环)
      window.location.href = `http://hesuancj.cn/#/index2?code=${encodeURIComponent(params.code)}&state=STATE&code2=${encodeURIComponent(params.code2)}`;
    var url = window.location.href;
    url = decodeURIComponent(url)
    var count = url.split('?').length-1;
    if(count >1){  //获取用户信息后跳回来本页面
      let data = this.getCodeFromUrl(url)
      window.location.href = `http://hesuancj.cn/#/index2?code=${encodeURIComponent(data.code)}&state=STATE&code2=${encodeURIComponent(data.code2)}`
      return;
    }
    var cs = url.split('?')[1];
    var cs_arr = cs.split('&');
    var cs={};
    for(var i=0;i<cs_arr.length;i++){
      cs[cs_arr[i].split('=')[0]] = cs_arr[i].split('=')[1]
    }
    this.code2 = cs.code2;
    this.code = cs.code;
    //初始化跳转 39 服务器
    if(this.code2 == null || this.code2 == ''){
      window.location.href = `http://hesuancj.cn/#/index2?code2=${params.code || ''}`;
      //window.location.href = "http://60.0.121.40:8889/#/IndexXTYH39?code2="+cs.code   //测试用的
      window.location.href = "http://hesuancj.cn/#/index2?code2="+cs.code  //正式
      return;
    }
    if(this.code != null && this.code != '') {
      this.dialogVisible = true  //立即支付弹框
    }else {
src/main.js
@@ -77,7 +77,7 @@
Vue.prototype.$systemconfig = {
// 服务端路径
    basePath: 'http://183.196.93.178:8089',
    // basePath:'http://192.168.0.40:8089'
    // basePath:'http://127.0.0.1:8089'
}
Vue.prototype.$byutil = byUtils
Vue.prototype.$stringUtil = StringUtil
src/store/state.js
@@ -61,18 +61,18 @@
                    parentId: 2,
                    indexUrl: "barrierOpenLog"
                },
                {
                    icon: 'el-icon-document',
                    name: '月票车规则管理',
                    parentId: 2,
                    indexUrl: "whiteListRule"
                },
                {
                    icon: 'el-icon-document',
                    name: '缴费日志管理',
                    parentId: 2,
                    indexUrl: "paymentLog"
                },
                // {
                //     icon: 'el-icon-document',
                //     name: '月票车规则管理',
                //     parentId: 2,
                //     indexUrl: "whiteListRule"
                // },
                // {
                //     icon: 'el-icon-document',
                //     name: '缴费日志管理',
                //     parentId: 2,
                //     indexUrl: "paymentLog"
                // },
                {
                  icon: 'el-icon-document',
                  name: '白名单管理',
@@ -183,18 +183,18 @@
                    parentId: 2,
                    indexUrl: "enterParkCar"
                },
                {
                    icon: 'el-icon-document',
                    name: '月票车规则管理',
                    parentId: 2,
                    indexUrl: "whiteListRule"
                },
                {
                    icon: 'el-icon-document',
                    name: '缴费日志管理',
                    parentId: 2,
                    indexUrl: "paymentLog"
                },
                // {
                //     icon: 'el-icon-document',
                //     name: '月票车规则管理',
                //     parentId: 2,
                //     indexUrl: "whiteListRule"
                // },
                // {
                //     icon: 'el-icon-document',
                //     name: '缴费日志管理',
                //     parentId: 2,
                //     indexUrl: "paymentLog"
                // },
                {
                    icon: 'el-icon-document',
                    name: '手动抬杆记录',