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
fff4d058
Commit
fff4d058
authored
Jun 26, 2023
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
兼容
parent
446dc856
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
17 deletions
+44
-17
src/pages/toMini/index.vue
+44
-17
No files found.
src/pages/toMini/index.vue
View file @
fff4d058
<
template
>
<div
class=
"text"
>
<div
v-if=
"loadFlag
<
=
1
"
>
正在跳转到其他小程序...
</div>
<div
class=
"text"
v-if=
"pageType == 0"
>
<div
v-if=
"loadFlag
<
=
1
"
>
正在跳转到其他小程序...
</div>
<div
v-else
class=
"toMini"
@
click=
"toMini"
>
点击跳转到其他小程序
</div>
</div>
</
template
>
<
script
>
export
default
{
data
()
{
export
default
{
data
()
{
return
{
loadFlag
:
0
,
options
:
""
,
pageType
:
0
,
// 0默认 1打开地图
}
},
onLoad
(
options
)
{
onLoad
(
options
)
{
this
.
options
=
options
;
console
.
log
(
"onLoad"
,
this
.
loadFlag
)
console
.
log
(
"onLoad"
,
this
.
loadFlag
,
this
.
options
)
if
(
this
.
options
&&
this
.
options
.
type
==
1
)
{
this
.
pageType
=
1
;
this
.
openLocation
();
}
else
{
this
.
toMini
();
}
},
onShow
()
{
this
.
loadFlag
++
;
console
.
log
(
"onShow"
,
this
.
loadFlag
)
onShow
()
{
this
.
loadFlag
++
;
console
.
log
(
"onShow"
,
this
.
loadFlag
)
this
.
toMini
();
if
(
this
.
pageType
==
1
)
{
wx
.
navigateBack
();
}
},
methods
:
{
toMini
(){
openLocation
()
{
wx
.
openLocation
({
latitude
:
this
.
options
.
latitude
-
0
,
longitude
:
this
.
options
.
longitude
-
0
,
address
:
this
.
options
.
address
,
scale
:
18
,
success
(
res
)
{
console
.
log
(
"success"
,
res
)
},
fail
(
res
)
{
console
.
log
(
"fail"
,
res
)
},
complete
(
res
)
{
console
.
log
(
"complete"
,
res
)
}
})
},
toMini
()
{
let
_this
=
this
;
wx
.
navigateToMiniProgram
({
appId
:
_this
.
options
.
weappAppId
,
...
...
@@ -32,14 +58,14 @@
// envVersion: 'release',
extraData
:
_this
.
options
.
extraData
&&
JSON
.
parse
(
_this
.
options
.
extraData
),
success
(
res
)
{
console
.
log
(
res
,
'--------打开成功'
)
console
.
log
(
res
,
'--------打开成功'
)
// 打开成功
},
complete
(
res
)
{
console
.
log
(
res
,
'------------------38'
)
complete
(
res
)
{
console
.
log
(
res
,
'------------------38'
)
if
(
res
.
errMsg
==
'navigateToMiniProgram:fail cancel'
)
{
// 点击了取消
_this
.
loadFlag
++
;
_this
.
loadFlag
++
;
}
else
if
(
res
.
errMsg
==
'navigateToMiniProgram:ok'
)
{
// 点击了跳转
wx
.
navigateBack
();
...
...
@@ -48,17 +74,18 @@
})
}
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.text
{
.text
{
text-align
:
center
;
margin-top
:
30px
;
font-size
:
16px
;
color
:
#333
;
}
.toMini
{
.toMini
{
width
:
60%
;
margin
:
0
auto
;
margin-top
:
40vh
;
...
...
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