Commit afe1774e by 高淑倩

add: 轮播图跳转

parent d9cc74e5
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// component/imageSwiper/imageSwiper.js // component/imageSwiper/imageSwiper.js
var app = getApp() var app = getApp()
const wxService = require('../../utils/wxService') const wxService = require('../../utils/wxService')
const utils = require('../../utils/util')
const envInfo = require('../../config/index').envInfo const envInfo = require('../../config/index').envInfo
Component({ Component({
...@@ -29,6 +30,31 @@ Component({ ...@@ -29,6 +30,31 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { 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() { // preview() {
// wx.previewImage({ // wx.previewImage({
// current: 'https://images.unsplash.com/photo-1551334787-21e6bd3ab135?w=640', // 当前显示图片的http链接 // current: 'https://images.unsplash.com/photo-1551334787-21e6bd3ab135?w=640', // 当前显示图片的http链接
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
> >
<block wx:for="{{imageData}}" wx:key="{{item}}"> <block wx:for="{{imageData}}" wx:key="{{item}}">
<swiper-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> </swiper-item>
</block> </block>
</swiper> </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