Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
bb856523
Commit
bb856523
authored
Aug 28, 2020
by
张卓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新小程序码扫码进入小程序
parent
2a970119
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
src/api/index.js
+13
-0
src/pages/index/index.vue
+19
-0
No files found.
src/api/index.js
0 → 100644
View file @
bb856523
import
{
requestPOST
,
requestGET
}
from
"@/utils/request.js"
;
console
.
log
(
process
.
env
,
'-----------------config------'
)
// wx
export
default
{
//POST /shareSceneRecord/getShareSceneRecord/{sceneCode} 获取分享场景参数记录
getShareSceneRecord
(
options
)
{
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/shareSceneRecord/getShareSceneRecord/
${
options
}
`
,
{});
},
}
\ No newline at end of file
src/pages/index/index.vue
View file @
bb856523
...
...
@@ -7,6 +7,7 @@
<
script
>
import
spokesman
from
"@/api/spokesman.js"
;
import
shop
from
"@/api/shop.js"
;
import
indexApi
from
"@/api/index.js"
;
import
{
serialize
,
getQueryVariable
,
DFSImg
}
from
"@/utils/index"
;
export
default
{
data
()
{
...
...
@@ -132,6 +133,21 @@ export default {
this
.
page
=
options
.
backpath
;
this
.
params
+=
"&"
+
serialize
(
options
.
params
);
}
else
if
(
options
.
scene
)
{
// console.log()
if
(
options
.
scene
.
indexOf
(
'_'
)
==
-
1
){
//新二维码扫码进入
indexApi
.
getShareSceneRecord
(
options
.
scene
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
'200'
){
this
.
page
=
res
.
data
.
data
.
pageUri
;
let
paramsObj
=
JSON
.
parse
(
res
.
data
.
data
.
scene
);
let
params
=
''
;
for
(
let
i
in
paramsObj
){
params
+=
"&"
+
i
+
'='
+
paramsObj
[
i
]
}
this
.
params
+=
params
}
})
}
else
{
//来自扫码
// options 中的scene需要使用decodeURIComponent才能获取到生成二维码时传入的scene
var
scene
=
decodeURIComponent
(
options
.
scene
);
//参数二维码传递过来的参数
...
...
@@ -219,6 +235,9 @@ export default {
console
.
log
(
querys
,
"scene"
);
console
.
log
(
this
.
page
)
console
.
log
(
this
.
params
)
}
// var query = options.query.dentistId; // 参数二维码传递过来的场景参数
}
console
.
log
(
"url"
,
this
.
link
+
this
.
page
+
this
.
params
);
...
...
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