kongdeqiang
2023-09-22 1eccce45585b6ccd6bd3bc32aaa5ffc12a0f087f
src/components/page/IndexTest.vue
@@ -79,7 +79,7 @@
            </div>
          </div>
          <span slot="footer" class="dialog-footer">
            <el-button type="primary" @click="pay()">立 即 支 付</el-button>
            <el-button type="primary" @click="pay()" :loading="payNowFlag">立 即 支 付</el-button>
          </span>
        </el-dialog>
      </div>
@@ -95,6 +95,7 @@
            return {
                dialogVisible:false,
                payFlag:false,
                payNowFlag:false,
                outParkId:"",
                type:null,
                statisticData:{
@@ -120,10 +121,10 @@
            //支付宝
            this.type = 1
          }
          // if(this.type == null){
          //   this.$message.error("请用微信或支付宝扫描二维码")
          //   return;
          // }
          if(this.type == null){
            this.$message.error("请用微信或支付宝扫描二维码")
            return;
          }
            var url = window.location.href;
            var count = url.split('?').length-1;
@@ -131,12 +132,6 @@
              this.code = this.getCodeFromUrl(url)
              this.code2 = this.getCode2FromUrl(url)
              window.location.href = "http://hesuancj.cn/#/indexTest?code="+this.code+"&state=STATE&code2="+this.code2
            }
            console.log('this.code====',this.code)
            if(this.code != null && this.code != '') {
              this.dialogVisible = true
            }else {
              this.dialogVisible = false
            }
            var cs = url.split('?')[1];
            var cs_arr = cs.split('&');
@@ -147,6 +142,14 @@
            //this.outParkId = cs.code;
          this.code2 = cs.code2;
          this.code = cs.code;
          if(this.code2 == null || this.code2 == ''){
            window.location.href = "http://hesuancj.cn/#/indexTest?code2="+this.code
          }
          if(this.code != null && this.code != '') {
            this.dialogVisible = true
          }else {
            this.dialogVisible = false
          }
          this.$byutil.postData(this, this.$systemconfig.basePath + '/ffzf/outpark/findByBarrierCode', {code2:cs.code2}, res => {
            this.statisticData = res.data;
            this.outParkId = this.statisticData.id;
@@ -165,6 +168,7 @@
        methods: {
            pay(){
                this.payFlag = true;
                this.payNowFlag = true;
                if(this.status3==1){
                    this.$message({
                        message: '您有违章未处理,请先处理或联系停车场管理人员',
@@ -239,7 +243,6 @@
                  this.$byutil.postData(this, this.$systemconfig.basePath + '/ffzf/api/getOpenId', {id:this.outParkId,code:this.code}, res => {
                    if(res.code === 0){
                      var param = res.data;
                      alert(param)
                      // 点击支付时候调用
                      if (typeof WeixinJSBridge === 'undefined') {
                        if (document.addEventListener) {
@@ -285,7 +288,7 @@
                  appId: params.appId, // 公众号名称,由商户传入
                  timeStamp: params.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
                  nonceStr: params.nonceStr, // 支付签名随机串,不长于 32 位
                  package: params.prepay_id, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
                  package: params.package, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
                  signType: params.signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
                  paySign: params.paySign // 支付签名
                },