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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
42 deletions
+69
-42
src/pages/toMini/index.vue
+69
-42
No files found.
src/pages/toMini/index.vue
View file @
fff4d058
<
template
>
<
template
>
<div
class=
"text"
>
<div
class=
"text"
v-if=
"pageType == 0"
>
<div
v-if=
"loadFlag
<
=
1
"
>
正在跳转到其他小程序...
</div>
<div
v-if=
"loadFlag
<
=
1
"
>
正在跳转到其他小程序...
</div>
<div
v-else
class=
"toMini"
@
click=
"toMini"
>
点击跳转到其他小程序
</div>
<div
v-else
class=
"toMini"
@
click=
"toMini"
>
点击跳转到其他小程序
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
loadFlag
:
0
,
loadFlag
:
0
,
options
:
""
,
options
:
""
,
}
pageType
:
0
,
// 0默认 1打开地图
}
,
}
onLoad
(
options
){
},
this
.
options
=
options
;
onLoad
(
options
)
{
console
.
log
(
"onLoad"
,
this
.
loadFlag
)
this
.
options
=
options
;
this
.
toMini
();
console
.
log
(
"onLoad"
,
this
.
loadFlag
,
this
.
options
)
},
if
(
this
.
options
&&
this
.
options
.
type
==
1
)
{
onShow
(){
this
.
pageType
=
1
;
this
.
loadFlag
++
;
this
.
openLocation
()
;
console
.
log
(
"onShow"
,
this
.
loadFlag
)
}
else
{
this
.
toMini
();
this
.
toMini
();
}
},
onShow
()
{
this
.
loadFlag
++
;
console
.
log
(
"onShow"
,
this
.
loadFlag
)
this
.
toMini
();
if
(
this
.
pageType
==
1
)
{
wx
.
navigateBack
();
}
},
methods
:
{
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
)
}
})
},
},
methods
:
{
toMini
()
{
toMini
(){
let
_this
=
this
;
let
_this
=
this
;
wx
.
navigateToMiniProgram
({
wx
.
navigateToMiniProgram
({
appId
:
_this
.
options
.
weappAppId
,
appId
:
_this
.
options
.
weappAppId
,
path
:
decodeURIComponent
(
_this
.
options
.
weappPage
),
path
:
decodeURIComponent
(
_this
.
options
.
weappPage
),
// envVersion: 'release',
// envVersion: 'release',
extraData
:
_this
.
options
.
extraData
&&
JSON
.
parse
(
_this
.
options
.
extraData
),
extraData
:
_this
.
options
.
extraData
&&
JSON
.
parse
(
_this
.
options
.
extraData
),
success
(
res
)
{
success
(
res
)
{
console
.
log
(
res
,
'--------打开成功'
)
console
.
log
(
res
,
'--------打开成功'
)
// 打开成功
// 打开成功
},
},
complete
(
res
)
{
complete
(
res
){
console
.
log
(
res
,
'------------------38'
)
console
.
log
(
res
,
'------------------38'
)
if
(
res
.
errMsg
==
'navigateToMiniProgram:fail cancel'
)
{
if
(
res
.
errMsg
==
'navigateToMiniProgram:fail cancel'
)
{
// 点击了取消
// 点击了取消
_this
.
loadFlag
++
;
_this
.
loadFlag
++
;
}
else
if
(
res
.
errMsg
==
'navigateToMiniProgram:ok'
)
{
}
else
if
(
res
.
errMsg
==
'navigateToMiniProgram:ok'
)
{
// 点击了跳转
// 点击了跳转
wx
.
navigateBack
();
wx
.
navigateBack
();
}
}
}
}
)
}
}
}
)
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.text
{
.text
{
text-align
:
center
;
text-align
:
center
;
margin-top
:
30px
;
margin-top
:
30px
;
font-size
:
16px
;
font-size
:
16px
;
color
:
#333
;
color
:
#333
;
}
}
.toMini
{
.toMini
{
width
:
60%
;
width
:
60%
;
margin
:
0
auto
;
margin
:
0
auto
;
margin-top
:
40vh
;
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