Coder Social home page Coder Social logo

Comments (12)

buuing avatar buuing commented on May 14, 2024

稍等我看一下

from lucky-canvas.

lisf-ksk avatar lisf-ksk commented on May 14, 2024

稍等我看一下

你好 t.$refs.LuckyWheel.stop(2 * Math.random() >> 0) 我把这个8改成2 就可以了
但是我现在不知道该怎么把后台数据传递给prizes

from lucky-canvas.

buuing avatar buuing commented on May 14, 2024

哦哦哦, 那个 Math.random() * 8 >> 0是我在获取0~7的随机索引值, 因为你传递了不存在的奖品, 所以他无法停下来

from lucky-canvas.

buuing avatar buuing commented on May 14, 2024

后台给了你什么样的数据呢?

from lucky-canvas.

lisf-ksk avatar lisf-ksk commented on May 14, 2024

后台给了你什么样的数据呢?

后台我自己做的 json格式 但我有点看不懂这些参数。"083c": function (t, e, i) {
t.exports = i.p + "img/0.efbe4dff.png"
}
不知道该怎么传递数据给prizes[] 然后进行遍历

from lucky-canvas.

buuing avatar buuing commented on May 14, 2024

后台我自己做的 json格式 但我有点看不懂这些参数。"083c": function (t, e, i) {
t.exports = i.p + "img/0.efbe4dff.png"
}
不知道该怎么传递数据给prizes[] 然后进行遍历

首先, 你这个数据我也看不懂, 但你说后台是你自己做的, 那么你或许可以传递一个良好的json格式来解决该问题?
其次, 我不建议大转盘只放置小于等于两个奖品, 因为canvas绘制无法绘制大于等于180度的弧度...

from lucky-canvas.

buuing avatar buuing commented on May 14, 2024

如果无法处理后台数据的话, 那你也可以直接在data里面把prizes写死, 比如:

      prizes: [
        {
          fonts: [{ text: '你的奖品文字' }],
          imgs: [{ src: '你的图片地址' }],
          background: '颜色',
        },
        {
          fonts: [{ text: '你的奖品文字' }],
          imgs: [{ src: '你的图片地址' }],
          background: '颜色',
        },
      ],

from lucky-canvas.

lisf-ksk avatar lisf-ksk commented on May 14, 2024

后台我自己做的 json格式 但我有点看不懂这些参数。"083c": function (t, e, i) {
t.exports = i.p + "img/0.efbe4dff.png"
}
不知道该怎么传递数据给prizes[] 然后进行遍历

首先, 你这个数据我也看不懂, 但你说后台是你自己做的, 那么你或许可以传递一个良好的json格式来解决该问题?
其次, 我不建议大转盘只放置小于等于两个奖品, 因为canvas绘制无法绘制大于等于180度的弧度...

因为我的需求是 7种奖品共21个抽21次,当一个奖品抽完之后 数量为0时 我就需要重新渲染prizes里面的数据,就会减少一中奖品 所以会出现只剩2个奖品的情况,请问你的插件我修改一些代码后 可以实现这个功能吗?

from lucky-canvas.

lisf-ksk avatar lisf-ksk commented on May 14, 2024

如果无法处理后台数据的话, 那你也可以直接在data里面把prizes写死, 比如:

      prizes: [
        {
          fonts: [{ text: '你的奖品文字' }],
          imgs: [{ src: '你的图片地址' }],
          background: '颜色',
        },
        {
          fonts: [{ text: '你的奖品文字' }],
          imgs: [{ src: '你的图片地址' }],
          background: '颜色',
        },
      ],

这一点我担心使用的人不小心刷新了页面 然后,数据重新加载了,因为我的这个奖品时有数量要求的 ,抽中一次数量减-1 数量为0时移出奖品池。

from lucky-canvas.

buuing avatar buuing commented on May 14, 2024

哦哦, 你这个功能什么时候提测, 我优化一下代码, 预计明天会更新新版本

from lucky-canvas.

lisf-ksk avatar lisf-ksk commented on May 14, 2024

哦哦, 你这个功能什么时候提测, 我优化一下代码, 预计明天会更新新版本
好的 可以等到明天使用 麻烦您了.

from lucky-canvas.

buuing avatar buuing commented on May 14, 2024

最新版v3.1.7已修复不能绘制超过180度的扇形的问题

from lucky-canvas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.