Commit 7547ce91 by 高淑倩

add:轮播图&&图片导航跳转

parent fbd1c04d
......@@ -102,7 +102,7 @@ Component({
urls: [`${app.globalData.imageUrl}/${currentClickType.link.url}`] // 需要预览的图片http链接列表
})
} else if (curItemType.link.type == 4) {
wxService.router(`/${currentClickType}`)
wxService.router(`${currentClickType}`)
} else if (curItemType.link.type == 5) {
if (currentClickType == 1) {
wxService.openCard()
......@@ -113,13 +113,11 @@ Component({
wxService.router(`/${currentClickType}`)
} else if (curItemType.link.type == 7) {
// 集点详情
console.log('pointPath', currentClickType)
wxService.router(`${currentClickType}`)
}
} else if (curItemType.row) {
let rowObj = JSON.parse(curItemType.row)
let currentClickRow = app.globalData.commonFunc.getLinkRow(rowObj.type, rowObj)
console.log('bacccccccccc', currentClickRow)
if (rowObj.type == 1) { }
else if (rowObj.type == 2) { }
......
......@@ -36,50 +36,76 @@ Component({
* 组件的方法列表
*/
methods: {
preview(e) {
const { appid, path, link, item } = e.currentTarget.dataset
preview(event) {
const ev = event.currentTarget.dataset;
console.log('ev', ev)
let curItemType = ev.item
// 获取当前帐号信息
const userInfo = wx.getStorageSync('_baseUserInfo')
let currentClickType = app.globalData.commonFunc.getLink(item.link.type, item)
if (link.type == 1) {
// 触发父组件更新页面 外部小程序
this.setData({
isAuthorization: false
})
return false
} else if (!userInfo) {
this.setData({
isAuthorization: true
})
return false
} else if (userInfo && userInfo.member && !userInfo.member.mobile) {
wxService.openCard()
return false
}
// link row
if (curItemType.link) {
let currentClickType = app.globalData.commonFunc.getLink(curItemType.link.type, curItemType)
if (curItemType.link.type == 1) {
// 触发父组件更新页面 外部小程序
this.setData({
isAuthorization: false
})
return false
} else if (!userInfo) {
this.setData({
isAuthorization: true
})
return false
} else if (userInfo && userInfo.member && !userInfo.member.mobile) {
wxService.openCard()
return false
}
if (link.type == 2) {
// 触发父组件更新页面
wxService.nextTick(() => {
this.triggerEvent('updatePage', { pageId: currentClickType.url })
})
} else if (link.type == 3) {
// 预览
wx.previewImage({
current: `${app.globalData.imageUrl}/${currentClickType.imageUrl}`, // 当前显示图片的http链接
urls: [`${app.globalData.imageUrl}/${currentClickType.link.url}`] // 需要预览的图片http链接列表
})
} else if (link.type == 4) {
wxService.router(`${currentClickType}`)
} else if (link.type == 5) {
if (currentClickType == 1) {
// wxService.openCardList()
wxService.openCard()
} else if (currentClickType == 2) {
wxService.openCard()
}
} else if(link.type == 6){
wxService.router(`${currentClickType}`)
}
if (curItemType.link.type == 2) {
// 触发父组件更新页面
wxService.nextTick(() => {
this.triggerEvent('updatePage', { pageId: currentClickType.url })
})
} else if (curItemType.link.type == 3) {
// 预览
wx.previewImage({
current: `${app.globalData.imageUrl}/${currentClickType.imageUrl}`, // 当前显示图片的http链接
urls: [`${app.globalData.imageUrl}/${currentClickType.link.url}`] // 需要预览的图片http链接列表
})
} else if (curItemType.link.type == 4) {
wxService.router(`${currentClickType}`)
} else if (curItemType.link.type == 5) {
if (currentClickType == 1) {
wxService.openCard()
} else if (currentClickType == 2) {
wxService.openCard()
}
} else if (curItemType.link.type == 6) {
wxService.router(`/${currentClickType}`)
} else if (curItemType.link.type == 7) {
// 集点详情
wxService.router(`${currentClickType}`)
}
} else if (curItemType.row) {
let rowObj = JSON.parse(curItemType.row)
let currentClickRow = app.globalData.commonFunc.getLinkRow(rowObj.type, rowObj)
if (rowObj.type == 1) { }
else if (rowObj.type == 2) { }
else if (rowObj.type == 3) { }
else if (rowObj.type == 4) { }
else if (rowObj.type == 5) { }
else if (rowObj.type == 6) { }
else if (rowObj.type == 7) { }
else if (rowObj.type == 8) {
// 商品
wxService.router(`/pages/productDetail/productDetail?productId=${currentClickRow}`)
}
else if (rowObj.type == 9) {
// 分类
wxService.router(`/subPackage/page/pages/categoryPro/categoryPro?${currentClickRow}`)
}
}
}
}
})
......@@ -42,19 +42,16 @@ Component({
imageheight: imageSize.imageHeight
})
},
preview(e) {
const ev = e.currentTarget.dataset
let curItemType = ev.item
console.log('ev', curItemType)
const { memberActivateStatus } = wx.getStorageSync('_baseUserInfo')
preview(event) {
const ev = event.currentTarget.dataset;
let curItemType = ev.item
// 获取当前帐号信息
const accountInfo = utils.getAccountInfo()
const userInfo = wx.getStorageSync('_baseUserInfo')
console.log('222222222', curItemType)
// link row
if (curItemType.link) {
let currentClickType = app.globalData.commonFunc.getLink(curItemType.link.type, curItemType)
if (curItemType.link.type == 1) {
if (curItemType.link) {
let currentClickType = app.globalData.commonFunc.getLink(curItemType.link.type, curItemType)
if (curItemType.link.type == 1) {
// 触发父组件更新页面 外部小程序
this.setData({
isAuthorization: false
......@@ -82,7 +79,7 @@ Component({
urls: [`${app.globalData.imageUrl}/${currentClickType.link.url}`] // 需要预览的图片http链接列表
})
} else if (curItemType.link.type == 4) {
wxService.router(`/${currentClickType}`)
wxService.router(`${currentClickType}`)
} else if (curItemType.link.type == 5) {
if (currentClickType == 1) {
wxService.openCard()
......@@ -93,14 +90,13 @@ Component({
wxService.router(`/${currentClickType}`)
} else if (curItemType.link.type == 7) {
// 集点详情
console.log('pointPath', currentClickType)
wxService.router(`${currentClickType}`)
}
} else if (curItemType.row) {
let rowObj = JSON.parse(curItemType.row)
} else if (curItemType.row) {
let rowObj = JSON.parse(curItemType.row)
let currentClickRow = app.globalData.commonFunc.getLinkRow(rowObj.type, rowObj)
if (rowObj.type == 1) { }
if (rowObj.type == 1) { }
else if (rowObj.type == 2) { }
else if (rowObj.type == 3) { }
else if (rowObj.type == 4) { }
......@@ -115,63 +111,7 @@ Component({
// 分类
wxService.router(`/subPackage/page/pages/categoryPro/categoryPro?${currentClickRow}`)
}
}
// 2019.06.14
// let currentClickType = app.globalData.commonFunc.getLink(item.link.type, item)
// if (link.type == 1) {
// // 触发父组件更新页面 外部小程序
// this.setData({
// isAuthorization: false
// })
// return false
// } else if (!userInfo) {
// // userInfo 不存在 授权弹框
// this.setData({
// isAuthorization: true
// })
// return false
// }
// if (link.type == 2) {
// // 触发父组件更新页面
// wxService.nextTick(() => {
// this.triggerEvent('updatePage', { pageId: currentClickType.url })
// })
// } else if (link.type == 3) {
// // 预览
// wx.previewImage({
// current: `${app.globalData.imageUrl}/${currentClickType.imageUrl}`, // 当前显示图片的http链接
// urls: [`${app.globalData.imageUrl}/${currentClickType.link.url}`] // 需要预览的图片http链接列表
// })
// } else if (link.type == 4) {
// wxService.router(`${currentClickType}`)
// } else if (link.type == 5) {
// if (currentClickType == 1) {
// wxService.openCard()
// } else if (currentClickType == 2) {
// // wxService.openCard()
// if (userInfo && userInfo.member && userInfo.member.mobile && !userInfo.memberActivateStatus) {
// // 手机号存在 但未激活 跳转激活领卡页面 老用户
// this.setData({
// isAuthorizationActiveText: '新激活领卡',
// isAuthorization: true,
// isAuthorizationType: 3
// }, () => {
// return false
// })
// } else {
// wxService.openCard()
// }
// }
// } else if(link.type == 6){
// wxService.router(`${currentClickType}`)
// } else if(link.type == 7){
// // 集点详情
// let pointPath = currentClickType && currentClickType.split('?')[0]
// let pointIdParams = currentClickType && currentClickType.split('?')[1]
// let pointId = pointIdParams.split('=')[1]
// wxService.router(`${pointPath}`).search({ id: pointId })
// }
}
},
activeTocard(e) {
if (e.detail) {
......
......@@ -82,7 +82,7 @@ Component({
urls: [`${app.globalData.imageUrl}/${currentClickType.link.url}`] // 需要预览的图片http链接列表
})
} else if (curItemType.link.type == 4) {
wxService.router(`/${currentClickType}`)
wxService.router(`${currentClickType}`)
} else if (curItemType.link.type == 5) {
if (currentClickType == 1) {
wxService.openCard()
......@@ -93,13 +93,11 @@ Component({
wxService.router(`/${currentClickType}`)
} else if (curItemType.link.type == 7) {
// 集点详情
console.log('pointPath', currentClickType)
wxService.router(`${currentClickType}`)
}
} else if (curItemType.row) {
let rowObj = JSON.parse(curItemType.row)
let currentClickRow = app.globalData.commonFunc.getLinkRow(rowObj.type, rowObj)
console.log('bacccccccccc', currentClickRow)
if (rowObj.type == 1) { }
else if (rowObj.type == 2) { }
......@@ -117,9 +115,6 @@ Component({
wxService.router(`/subPackage/page/pages/categoryPro/categoryPro?${currentClickRow}`)
}
}
},
switchTab(event) {
var cur = event.detail.current
......
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