819527061@qq.com
2023-09-12 7a6d66c564108c297d922a20e696ae2c0edcc5af
src/components/page/IndexTest.vue
@@ -34,7 +34,7 @@
                            <!--<el-input v-model="statisticData.code" readonly></el-input>-->
                        </el-form-item>
                        <el-form-item class="weizhang-footer-box" style="display: flex;justify-content: center;margin-top: 4.498vh" label-width="0" v-show="showFlag">
                            <el-button class="jiaofei-btn" type="primary" @click="pay()" :loading="payFlag">去缴费</el-button>
                            <el-button class="jiaofei-btn" type="primary" @click="getCode()" :loading="payFlag">去缴费</el-button>
                        </el-form-item>
                    </el-form>
<!--                    <el-form label-width="100px" label-position="left">-->
@@ -107,13 +107,10 @@
                    return;
                }
                this.$byutil.postData(this, this.$systemconfig.basePath + '/ffzf/api/park', {id:this.outParkId}, res => {
                    this.$message({
                        message: '2秒后自动跳转到支付页面,防止内外网数据同步延迟,请稍等',
                        type: 'success',
                        duration:2000,
                    });
                  setTimeout(function(){window.location.href = res.msg;},2000);
                    this.showFlag = false;
                  if(res.code === 0){
                    window.location.href = res.msg
                    this.showFlag = false
                  }
                })
            },
            noCarOut(){
@@ -139,7 +136,36 @@
                }
            },
        }
            GetQueryString(name) {
              var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
              var r = window.location.search.substr(1).match(reg);
              if (r != null) return unescape(r[2]); return null;
            },
            getCode(){
              var code = this.GetQueryString('code');
              var code2 = this.GetQueryString('code2');
              alert(code,'code=====')
              if(code==null||code==""){
                var url = encodeURIComponent("hesuancj.cn");
                window.location.href ="https://open.weixin.qq.com/connect/oauth2/authorize?" +
                    "appid=wxcb0e4256748b327c&redirect_uri="+url+"&response_type=code" +
                   // "&scope=snsapi_userinfo&state=STATE#wechat_redirect";
                    "&scope=SCOPE&state=STATE#wechat_redirect";
              }else{
                $.ajax({
                  type : "POST", //提交方式
                  url : this.$systemconfig.basePath + '/ffzf/test/getCode',//路径
                  data : {
                    "code" : code
                  },
                  success : function(result) {//返回数据根据结果进行相应的处理
                  }
                });
             }
            }
      }
    }
</script>