game-banner3d
v0.0.12
Published
``` npm install game-banner3d ```
Downloads
2
Readme
game-banner3d
组件
安装
npm install game-banner3d
使用
- json
{
"usingComponents": {
"banner3d": "game-banner3d/banner3d"
}
}
- js
Page({
data: {
imgs: [
{ src: "https://img.alicdn.com/imgextra/i1/555657275/O1CN01W8hdKk23c0Eu6SK0M_!!555657275.png", title: "LoveLight系列", title2: "下滑展开内容", desc: "唤醒有情人眼中的璀璨光芒,以古驰七夕情人节Lovelight系列表达爱意。", logo: "https://img.alicdn.com/imgextra/i2/1080040467/O1CN01L40M3y1FJvpQA3YFd_!!1080040467.png" },
{ src: "https://img.alicdn.com/imgextra/i2/555657275/O1CN01fhS9FJ23c0EsuvcsQ_!!555657275.png" },
{ src: "https://img.alicdn.com/imgextra/i3/1080040467/O1CN017PmaYZ1FJvoyet5Bm_!!1080040467.jpg" },
{ src: "https://img.alicdn.com/imgextra/i4/1080040467/O1CN01c8lqz41FJvnKS0gWz_!!1080040467.png" },
]
},
onCallback(item) {
// 卡片点击回调
// {isTouchBtn:是否点击到箭头按钮,item:对应imgs元素,rect:位置信息}
console.log("点击回调:", item)
},
onSwiperCallback(item) {
console.error("滑动回调:", item);
},
onOpenCallback(item) {
console.log("放大完成回掉:", item)
this.comRef.hideFun();
},
onHideCallback() {
console.log("隐藏了")
// 还原
this.comRef.resetFun();
},
onRef(ref) {
this.comRef = ref;
}
})
- xaml
<banner3d imgs="{{imgs}}" height="{{1000}}" onCallback="onCallback" onSwiperCallback="onSwiperCallback" onOpenCallback="onOpenCallback" onHideCallback="onHideCallback" onRef="onRef" />