From eadd5784244d98dca21e5788440004432af8e803 Mon Sep 17 00:00:00 2001 From: kongdeqiang <123456> Date: 星期二, 12 九月 2023 15:45:20 +0800 Subject: [PATCH] 修改前端页面 --- src/components/page/IndexTest.vue | 33 +++++++++++++++++++++++++++++++-- 1 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/components/page/IndexTest.vue b/src/components/page/IndexTest.vue index e4fa7b8..79b94c5 100644 --- a/src/components/page/IndexTest.vue +++ b/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">--> @@ -136,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> -- Gitblit v1.9.1