Commit afe1774e by 高淑倩

add: 轮播图跳转

parent d9cc74e5
......@@ -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链接
......
......@@ -7,7 +7,7 @@
>
<block wx:for="{{imageData}}" wx:key="{{item}}">
<swiper-item>
<image src="http://testimg3.bigaka.com{{item.imageUrl}}" bindtap='preview' class="slide-image" />
<image src="http://testimg3.bigaka.com{{item.imageUrl}}" data-appid="{{item.link.appid}}" data-path="{{item.link.url}}" bindtap='preview' class="slide-image" />
</swiper-item>
</block>
</swiper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment