Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
afe1774e
Commit
afe1774e
authored
Jun 04, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 轮播图跳转
parent
d9cc74e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletions
+27
-1
imageSwiper.js
src/component/imageSwiper/imageSwiper.js
+26
-0
imageSwiper.wxml
src/component/imageSwiper/imageSwiper.wxml
+1
-1
No files found.
src/component/imageSwiper/imageSwiper.js
View file @
afe1774e
...
...
@@ -2,6 +2,7 @@
// component/imageSwiper/imageSwiper.js
var
app
=
getApp
()
const
wxService
=
require
(
'../../utils/wxService'
)
const
utils
=
require
(
'../../utils/util'
)
const
envInfo
=
require
(
'../../config/index'
).
envInfo
Component
({
...
...
@@ -29,6 +30,31 @@ Component({
* 组件的方法列表
*/
methods
:
{
preview
(
e
)
{
const
{
appid
,
path
}
=
e
.
currentTarget
.
dataset
// 获取当前帐号信息
const
accountInfo
=
utils
.
getAccountInfo
()
// 是当前小程序 直接跳转
if
(
accountInfo
.
miniProgram
.
appId
==
appid
){
wxService
.
router
(
`
${
path
}
`
)
}
else
{
// 跳转其他小程序
wx
.
navigateToMiniProgram
({
appId
:
appid
,
path
:
`
${
path
}
`
,
success
:
e
=>
{
console
.
log
(
e
)
},
fail
:
e
=>
{
console
.
log
(
e
)
},
complete
:
e
=>
{
console
.
log
(
e
)
},
})
}
}
// preview() {
// wx.previewImage({
// current: 'https://images.unsplash.com/photo-1551334787-21e6bd3ab135?w=640', // 当前显示图片的http链接
...
...
src/component/imageSwiper/imageSwiper.wxml
View file @
afe1774e
...
...
@@ -7,7 +7,7 @@
>
<block wx:for="{{imageData}}" wx:key="{{item}}">
<swiper-item>
<image src="http://testimg3.bigaka.com{{item.imageU
rl}}" bindtap='preview' class="slide-image" />
<image src="http://testimg3.bigaka.com{{item.imageUrl}}" data-appid="{{item.link.appid}}" data-path="{{item.link.u
rl}}" bindtap='preview' class="slide-image" />
</swiper-item>
</block>
</swiper>
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