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
a9812b84
Commit
a9812b84
authored
Feb 23, 2022
by
柳士祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微信客服发送卡片信息
parent
35a014cd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
2 deletions
+39
-2
src/pages/contact/index.vue
+12
-2
src/utils/pathToNavigation.js
+27
-0
No files found.
src/pages/contact/index.vue
View file @
a9812b84
...
...
@@ -4,7 +4,9 @@
<img
src=
"https://mayi-newshop.oss-cn-shanghai.aliyuncs.com/product/HCe2iRXHsP.png"
alt=
""
/>
</div>
<div
class=
"btn-wrap"
v-if=
"defaultContact == true"
>
<button
open-type=
"contact"
show-message-card
:session-from=
"sessionFrom"
>
<button
open-type=
"contact"
show-message-card
:send-message-title=
"wxConcatGoods.title"
:send-message-img=
"wxConcatGoods.img"
:send-message-path=
"wxConcatGoods.pathLink"
:session-from=
"sessionFrom"
>
<div
class=
"btn-main"
>
<div
class=
"main-img"
>
<img
src=
"../../../static/images/wx.png"
alt=
""
/>
...
...
@@ -31,6 +33,7 @@
<
script
>
import
{
getUserLocation
}
from
"../../utils/wxIndex.js"
;
import
{
getWxContact
}
from
"@/api/wxContact.js"
;
import
pathToNavigation
from
'@/utils/pathToNavigation'
const
app
=
getApp
();
const
{
log
}
=
app
;
...
...
@@ -39,10 +42,17 @@ export default {
return
{
sessionFrom
:
""
,
defaultContact
:
null
,
result
:
null
result
:
null
,
wxConcatGoods
:{}
};
},
onLoad
(
options
)
{
if
(
options
.
wxConcatGoods
){
let
wxConcatGoods
=
JSON
.
parse
(
options
.
wxConcatGoods
)
wxConcatGoods
[
'pathLink'
]
=
pathToNavigation
.
toPageUrl
(
pathToNavigation
.
getUrlofLink
(
wxConcatGoods
),
pathToNavigation
.
getUrlofQuery
(
wxConcatGoods
));
console
.
log
(
wxConcatGoods
,
'wxConcatGoods'
);
this
.
wxConcatGoods
=
wxConcatGoods
}
getUserLocation
().
then
((
res
)
=>
{
options
.
longitude
=
res
.
longitude
;
options
.
latitude
=
res
.
latitude
;
...
...
src/utils/pathToNavigation.js
0 → 100644
View file @
a9812b84
function
toPageUrl
(
backPath
,
backParams
=
""
)
{
return
`../index/main?from=themeLink&backpath=
${
encodeURIComponent
(
backPath
)}
¶ms=
${
encodeURIComponent
(
backParams
)}
`
;
}
function
getUrlofLink
(
data
)
{
return
data
.
pathLink
.
split
(
"?"
)[
0
];
}
function
getUrlofQuery
(
data
)
{
let
arr
=
data
.
pathLink
.
split
(
"?"
)
let
params
=
[];
arr
.
forEach
((
res
,
index
)
=>
{
if
(
index
>=
1
)
{
params
.
push
(
res
)
}
})
return
params
.
join
(
"?"
)
||
""
;
}
export
default
{
toPageUrl
,
getUrlofLink
,
getUrlofQuery
}
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