0.0.6 • Published 3 years ago

game-wheel v0.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

game-wheel

转盘抽奖

安装
npm install game-wheel
使用
  • json
{
    "usingComponents": {
        "game-wheel": "game-wheel/index"
    }
}
  • js
Page({
  data: {
    wheelData: {
      rotTimes: 1,//抽奖次数
      rootStyle: "",
      bgImg: "https://img.alicdn.com/imgextra/i2/1080040467/O1CN01LBPD1z1FJvZ4flfAV_!!1080040467.png",
      btnImg: "https://img.alicdn.com/imgextra/i1/1080040467/O1CN01aMztV01FJvZ2WXlsd_!!1080040467.png",
      btnStyle: "",
      prizeList: [
        {
          name: '汤臣倍健Yep',
          img: 'https://gw.alipayobjects.com/zos/rmsportal/nIQUKeYBbJWliGJVhVmx.png'
        }, {
          name: '请继续发光吧',
          img: 'https://gw.alipayobjects.com/zos/rmsportal/HkrVjjjuxZPUMCUbPazb.png'
        }, {
          name: 'GALAXY',
          img: 'https://gw.alipayobjects.com/zos/rmsportal/cDctUxwBLPCszQHRapYV.png'
        }, {
          name: '无门槛优惠券',
          img: 'https://gw.alipayobjects.com/zos/rmsportal/FAmIWZAWpUwlRFKqQDLz.png'
        }
      ],
    },
  },
  onLoad() {
  },
  onWheelRef(ref) {
    this.wheelRef = ref;
  },
  onWheelStart() {
    console.log("点击")
    this.setData({
      [`wheelData.rotTimes`]: this.data.wheelData.rotTimes + 1
    }, () => {
      this.wheelRef.start("汤臣倍健Yep");
    })
  },
  onFinish(obj) {
    console.log("finish:", obj)
  },
});
  • xaml
  <game-wheel componentData="{{wheelData}}" onRef="onWheelRef" onStart="onWheelStart" onFinish="onFinish" />
0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago