本文实例为大家分享了微信小程序画布圆形进度条展示的具体代码,供大家参考,具体内容如下
效果图:
代码:
wxml
<!--pages/test/test.wxml--> <canvas style="width: 300px; height: 200px;" canvas-id="canvasid"></canvas>
js
// pages/test/test.js var context = new wx.createCanvasContext('canvasid', this); var strat_num = 1, end_num = 20; var sAngle = 1.5 * Math.PI, eAngle = 0; Page({ onReady: function () { this.canvas() }, canvas:function(){ var that=this; if (strat_num <= end_num){ console.log('strat_num:', strat_num) eAngle = strat_num * 2 * Math.PI / end_num + 1.5 * Math.PI; setTimeout(function () { context.setStrokeStyle("#00ff00") context.setLineWidth(2) context.fillText(strat_num * 5 <= 100"_blank" href="//www.jb51.net/Special/900.htm">《微信小程序开发教程》小编为大家精心整理的,希望喜欢。以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。