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
9a4c683a
Commit
9a4c683a
authored
Oct 14, 2022
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多主题新增扫一扫
parent
65016047
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
1 deletions
+46
-1
src/main.js
+3
-1
src/utils/mayi.js
+43
-0
src/utils/themeModule.js
+0
-0
No files found.
src/main.js
View file @
9a4c683a
...
@@ -19,7 +19,8 @@ import {
...
@@ -19,7 +19,8 @@ import {
$themeAddToCard
,
$themeAddToCard
,
$themeArticleLike
,
$themeArticleLike
,
getCoupon
,
getCoupon
,
themeMemberCardClick
themeMemberCardClick
,
themeScanningCodeClick
}
from
"@/utils/mayi"
;
}
from
"@/utils/mayi"
;
// import { $themeToLink, $themeAddToCard, $themeArticleLike } from "@/utils/mayi";
// import { $themeToLink, $themeAddToCard, $themeArticleLike } from "@/utils/mayi";
import
"@/utils/themeModule"
;
import
"@/utils/themeModule"
;
...
@@ -72,6 +73,7 @@ global.themeToLinkInit({
...
@@ -72,6 +73,7 @@ global.themeToLinkInit({
wx
,
wx
,
getCoupon
,
getCoupon
,
themeMemberCardClick
,
themeMemberCardClick
,
themeScanningCodeClick
,
requireFun
:
{
requireFun
:
{
createdUserJWT
:
createdUserJWTApi
,
createdUserJWT
:
createdUserJWTApi
,
getBcakUrl
:
getBcakUrlApi
getBcakUrl
:
getBcakUrlApi
...
...
src/utils/mayi.js
View file @
9a4c683a
...
@@ -358,3 +358,45 @@ export function themeMemberCardClick(item) {
...
@@ -358,3 +358,45 @@ export function themeMemberCardClick(item) {
}
}
});
});
};
};
// 扫码
export
function
themeScanningCodeClick
()
{
let
app
=
getApp
()
let
{
$themeToLink
}
=
app
;
console
.
log
(
"themeScanningCodeClick"
)
wx
.
scanCode
({
success
(
res
)
{
console
.
log
(
res
,
'-----scanCode-success'
)
let
{
scanType
,
path
,
result
}
=
res
;
if
(
scanType
==
'WX_CODE'
)
{
// 微信二维码
$themeToLink
({
type
:
1.1
,
link
:
path
[
0
]
==
'/'
?
path
:
`/
${
path
}
`
});
}
else
if
(
scanType
==
'QR_CODE'
)
{
// 二维码
// http链接或h5链接
// type 1h5页面 1.1小程序页面 1.2http链接
if
(
result
.
startsWith
(
'http'
)
||
result
.
startsWith
(
'/'
))
{
// 链接跳转
$themeToLink
({
type
:
result
.
startsWith
(
'http'
)?
1.2
:
1
,
link
:
result
})
}
else
{
// 跳转搜索页
$themeToLink
({
type
:
1
,
link
:
'/contentSearch/contentSearch?placeHolderText='
+
result
})
}
}
},
fail
(
res
)
{
console
.
log
(
res
,
'-----scanCode-fail'
)
},
complete
(
res
)
{
console
.
log
(
res
,
'-----scanCode-complete'
)
},
});
}
\ No newline at end of file
src/utils/themeModule.js
View file @
9a4c683a
This diff is collapsed.
Click to expand it.
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