Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
group-buy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
group-buy-ui
Commits
e40abb5a
Commit
e40abb5a
authored
Sep 25, 2021
by
beisir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:getScheme 修改
parent
2ce78d9f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
9 deletions
+37
-9
utils.service.js
src/service/utils.service.js
+34
-5
module.js
src/store/module.js
+3
-4
No files found.
src/service/utils.service.js
View file @
e40abb5a
...
...
@@ -2,7 +2,7 @@ import { isAndroid, isIOS, isXyqb } from './validation.service';
import
Bridge
from
'
@qg/js-bridge
'
;
const
jsBridge
=
new
Bridge
();
import
Vue
from
'
vue
'
;
// import qs from 'qs
';
import
config
from
'
@/config
'
;
export
const
EventBus
=
new
Vue
();
/**
* 替换邮箱字符
...
...
@@ -365,7 +365,36 @@ export function setAppTitleColor(bgcolor = '#fff') {
});
}
// export function paramsParentheses(urlPath) {
// console.log(qs);
// // urlPath
// }
export
function
getQueryParams
(
key
)
{
var
search
=
window
.
location
.
search
;
var
regExp
=
new
RegExp
(
'
[
\\
?
\\
&]([^
\\
?
\\
&]+)=([^
\\
?
\\
&]+)
'
,
'
ig
'
);
var
queryStringList
=
{};
var
parttern
;
while
((
parttern
=
regExp
.
exec
(
search
)))
{
if
(
!
queryStringList
[
parttern
[
1
].
toLowerCase
()])
{
queryStringList
[
parttern
[
1
].
toLowerCase
()]
=
parttern
[
2
];
}
}
//返回指定键的值
if
(
key
)
{
return
queryStringList
[
key
.
toLowerCase
()]
||
''
;
}
//返回所有查询参数
return
queryStringList
;
}
export
function
paramsParentheses
()
{
let
paramsObj
=
getQueryParams
();
let
tempString
=
''
;
// !h=0$activityId=39"
for
(
let
key
in
paramsObj
)
{
let
option
=
`
${
key
}
=
${
paramsObj
[
key
]}
`
;
tempString
+=
`$
${
option
}
`
;
}
if
(
tempString
.
length
)
{
tempString
=
`
${
config
.
localHost
}
!`
+
tempString
.
slice
(
1
);
}
return
tempString
;
}
src/store/module.js
View file @
e40abb5a
import
*
as
types
from
'
./type
'
;
import
groupBuy
from
'
@/api/groupBuy
'
;
import
{
isWxMp
}
from
'
@/service/validation.service
'
;
//
import { paramsParentheses } from '@/service/utils.service';
import
{
paramsParentheses
}
from
'
@/service/utils.service
'
;
const
state
=
{
header
:
true
,
title
:
'
支付中心
'
,
...
...
@@ -95,6 +95,7 @@ const mutations = {
if
(
bool
)
{
// 需要取反
// 如果非app webview并且非小程序webview,直接拦截提示,到小程序操作
// paramsParentheses(window.location.href);
pointer
.
$dialog
({
message
:
'
请在微信小程序中参与此活动哦~
'
,
showCancelButton
:
false
,
...
...
@@ -102,15 +103,13 @@ const mutations = {
onConfirm
:
()
=>
{
// todo 跳转到小程序
let
getScheme
=
async
function
()
{
// 'https://group-buy-test1.liangkebang.net/groupBuy/list?h=0&activityId=39'//
const
[
res
]
=
await
groupBuy
.
getScheme
({
miniUrl
:
'
pages/product/goodDetail
'
,
// params: `url=${window.location.href}`
params
:
`
url=
${
'
https://group-buy-test1.liangkebang.net/groupBuy/list&h=0&activityId=39
'
}
`
params
:
`
from=groupBuy&url=
${
paramsParentheses
()
}
`
});
const
url
=
res
;
window
.
location
.
href
=
url
;
// todo 需要验证
// 'https://group-buy-test1.liangkebang.net/groupBuy/list?h=0&activityId=39'
};
getScheme
();
getScheme
=
null
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment