Commit fe348df8 authored by 罗超's avatar 罗超

2

parent bede69b6
...@@ -235,7 +235,6 @@ ...@@ -235,7 +235,6 @@
}, },
async getColor(src, index, y) { async getColor(src, index, y) {
let res = await getImageColor('myCanvas', 'img' + index, src) let res = await getImageColor('myCanvas', 'img' + index, src)
// console.log(index, res)
let obj = {} let obj = {}
obj.formatres = `rgba(${res.r},${res.g},${res.b},0.01)` obj.formatres = `rgba(${res.r},${res.g},${res.b},0.01)`
obj.formatres1 = `rgba(${res.r},${res.g},${res.b},0.6)` obj.formatres1 = `rgba(${res.r},${res.g},${res.b},0.6)`
......
...@@ -299,10 +299,15 @@ export let getImageColor = async (canvasID, imgID, imgSrc) => { ...@@ -299,10 +299,15 @@ export let getImageColor = async (canvasID, imgID, imgSrc) => {
} }
// 网络图片转base64 // 网络图片转base64
export let netUrlTobase64= async (url,suc)=> { export let netUrlTobase64= async (url,suc)=> {
let toBase64Url="" let toBase64Url="";
let newUrl=url
let flag = url.indexOf('https')
if(flag==-1){
newUrl=url.replace(/http/,'https')
}
toBase64Url= await new Promise(resolve => { toBase64Url= await new Promise(resolve => {
uni.request({ uni.request({
url: url, url: newUrl,
method: 'GET', method: 'GET',
responseType: 'arraybuffer', responseType: 'arraybuffer',
success(res) { success(res) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment