123456789101112131415161718192021222324252627282930313233343536 |
- <template>
- <view class="">
-
- </view>
- </template>
- <script>
- export default {
- data() {
- return {}
- },
- onLoad(option) {
- // const a = 'http://localhost:8084/gzh/?code=0513sQ000lWFRP1PH7000Df1YV03sQ0B&state=STATE#/pages/to_soap_tape/to_soap_tape?type=1'
- let wxcode = this.getUrlParam('code')
- if (wxcode) {
- const url = `http://soap.cliu.cc/#/pages/index/index?type=${option.type}&wxcode=${wxcode}`
- window.location.href = url
- }
- },
- methods: {
- //获取code值方法
- getUrlParam(name) {
- console.log(window.location, 'location');
- console.log(window.location.href, 'href');
- var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); //构造一个含有目标参数的正则表达式对象
- var r = window.location.search.substr(1).match(reg); //匹配目标参数
- if (r != null) return decodeURIComponent(r[2]);
- // return null; //返回参数值
- return ''; //返回参数值
- },
- }
- }
- </script>
- <style>
- </style>
|