function base64_encode (str) { // 编码,配合encodeURIComponent使用 var c1, c2, c3; var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var i = 0, len = str.length, strin = ''; while (i < len) { c1 = str.charC
微信小程序 canvas 自动适配 自动换行,保存图片分享到朋友圈 https://github.com/richard1015/News 微信IDE演示代码https://developers.weixin.qq.com/s/WCkpsTm97M7p function findBreakPoint(text, width, context) { var min = 0; var max = text.length - 1; while (min <= max) { var middle =