wxapp-market 是基于微信小程序的營銷組件,用于快速開發(fā)營銷玩法類小程序項目頁面,包含大轉(zhuǎn)盤、刮刮樂、***、水果機、九宮格翻紙牌、搖一搖、手勢解鎖等多種營銷組件。
使用
1.拉取倉庫
git clone git@github.com:o2team/wxapp-market.git
2.組件文件
-
大轉(zhuǎn)盤 (Big wheel) : /components/wheel/
-
刮刮樂 (Scratch tickets) : /components/scratch/
-
*** (Slot machine) : /components/slotMachine/
-
水果機 (Fruit machine) : /components/fruitMachine/
-
九宮格翻紙牌 (Grid card) : /components/card/
-
搖一搖 (Shake) : /components/shake/
-
手勢解鎖 (Gesture lock) : /components/lock/
3.調(diào)用
以大轉(zhuǎn)盤組件為例
WXSS中引用樣式:
@import "../../components/wheel/wheel.wxss"
WXML中引用結(jié)構(gòu):
<import src="../../components/wheel/wheel.wxml"/>
JS中引用:
import Wheel from "../../components/wheel/wheel.js"
JS中實例調(diào)用:
new Wheel(this,{
areaNumber: 8, //抽獎間隔
speed: 16, //轉(zhuǎn)動速度
awardNumer: 2, //中獎區(qū)域從1開始
mode: 1, //1是指針旋轉(zhuǎn),2為轉(zhuǎn)盤旋轉(zhuǎn)
callback: (idx, award) => { //結(jié)束回調(diào), 參數(shù)對應宮格索引,對應獎項
}
})
|
運行效果:
大轉(zhuǎn)盤

     
|