This commit is contained in:
2023-11-23 22:29:13 +08:00
parent 715859c63f
commit 882419768f
39 changed files with 2190 additions and 199 deletions
-1
View File
@@ -5,7 +5,6 @@ a{
}
img{
text-align: center;
margin:0px auto;
}
body, html {
width: 100%;
+24
View File
@@ -1,3 +1,5 @@
import { reject } from "lodash";
/**
* 自定义公共函数
*/
@@ -78,5 +80,27 @@ myfn.convertCurrency = function(money) {
}
return chineseStr;
}
/**
* 网络路径转base64
* @param {Object} url
*/
myfn.urlTobase64 = function(url) {
return new Promise((reso, reject) => {
uni.request({
url: url,
method: 'GET',
responseType: 'arraybuffer',
success: async res => {
let base64 = uni.arrayBufferToBase64(res.data); //把arraybuffer转成base64
reso(base64)
},
fail() {
reject()
}
});
})
}
export default myfn;