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

     
|