pull/1/head
liudan 1 year ago
parent 342d426f09
commit 0a3f600cad
  1. 4
      common/config.js
  2. 2
      manifest.json
  3. 141
      pages/home/sign.vue
  4. 2
      unpackage/dist/build/h5/index.html
  5. 2
      unpackage/dist/build/h5/static/js/index.f4f81166.js
  6. 1
      unpackage/dist/build/h5/static/js/pages-home-sign.c3f84ca0.js
  7. 1
      unpackage/dist/build/h5/static/js/pages-home-sign.f92ad519.js
  8. 10
      vue.config.js

@ -1,2 +1,2 @@
export const $apiLinks = "https://qg.njrenzhou.cn/" // api 接口地址
export const baseUrl = "https://qg.njrenzhou.cn/"
export const $apiLinks = "https://qg2.njrenzhou.cn/" // api 接口地址
export const baseUrl = "https://qg2.njrenzhou.cn/"

@ -120,7 +120,7 @@
},
"title" : "商城",
"devServer" : {
"https" : true
"https" : false
},
"domain" : ""
},

@ -31,15 +31,15 @@ export default{
}
},
methods: {
// base64toBlob(base64, type = 'application/octet-stream') {
// const bstr = atob(base64);
// let n = bstr.length;
// const u8arr = new Uint8Array(n);
// while (n--) {
// u8arr[n] = bstr.charCodeAt(n);
// }
// return new Blob([u8arr], { type });
// },
base64toBlob(base64, type = 'application/octet-stream') {
const bstr = atob(base64);
let n = bstr.length;
const u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new Blob([u8arr], { type });
},
onClick(type) {
if(type == 'openSmooth') {
@ -51,43 +51,39 @@ export default{
success: (res) => {
//
console.log(res.isEmpty)
console.log(res)
let base64 = res.tempFilePath.split(',')[1]
// this.base64ToBlob({b64data: base64, contentType: 'image/png'}).then(res => {
// // blob
// console.log('blob', res)
// console.log(URL.createObjectURL(res))
// uni.uploadFile({
// url: this.baseUrl+'api/common/upload',
// filePath: URL.createObjectURL(res),
// name: 'file',
// header:{
// token:getToken()
// },
// formData: {
// },
// success: (res) => {
// console.log(res)
// // if(JSON.parse(res.data).code==1){
// // setTimeout(() => {
// // // this.finishImageList.push({url:JSON.parse(res.data).data.fullurl,path:JSON.parse(res.data).data.url})
// // // resolve(res.data)
// // console.log(res)
// // }, 1000)
// // }else{
// // uni.$u.toast(JSON.parse(res.data).msg)
// // resolve(res.data)
// // }
// },
// fail: (res) => {
// console.log(res,"rrr")
// }
// });
// // console.log(new File([blob],filename,{ type }))
// })
const base64String = res.tempFilePath.replace("data:image/png;base64,",'');
const blob = this.base64toBlob(base64String, 'image/jpg')
console.log(blob)
let path = URL.createObjectURL(blob);
console.log(path,"999")
uni.uploadFile({
url: this.baseUrl+'api/common/upload',
filePath: path,
name: 'file',
header:{
token:getToken()
},
formData: {
},
success: (res) => {
console.log(res)
// if(JSON.parse(res.data).code==1){
// setTimeout(() => {
// // this.finishImageList.push({url:JSON.parse(res.data).data.fullurl,path:JSON.parse(res.data).data.url})
// // resolve(res.data)
// console.log(res)
// }, 1000)
// }else{
// uni.$u.toast(JSON.parse(res.data).msg)
// resolve(res.data)
// }
},
fail: (res) => {
console.log(res,"rrr")
}
});
// this.saveSignPic()
}
})
@ -103,34 +99,33 @@ export default{
})
},
// URL.createObjectURLblobURL
base64ToBlob ({b64data = '', contentType = '', sliceSize = 512} = {}) {
return new Promise((resolve, reject) => {
// 使 atob()
let byteCharacters = atob(b64data);
let byteArrays = [];
for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
let slice = byteCharacters.slice(offset, offset + sliceSize);
let byteNumbers = [];
for (let i = 0; i < slice.length; i++) {
byteNumbers.push(slice.charCodeAt(i));
}
// 8 0
//
byteArrays.push(new Uint8Array(byteNumbers));
}
let result = new Blob(byteArrays, {
type: contentType
})
result = Object.assign(result,{
// jartto: URL.createObjectURL
preview: URL.createObjectURL(result),
name: `图片示例.png`
});
resolve(result)
})
}
// base64ToBlob ({b64data = '', contentType = '', sliceSize = 512} = {}) {
// return new Promise((resolve, reject) => {
// // 使 atob()
// let byteCharacters = atob(b64data);
// let byteArrays = [];
// for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
// let slice = byteCharacters.slice(offset, offset + sliceSize);
// let byteNumbers = [];
// for (let i = 0; i < slice.length; i++) {
// byteNumbers.push(slice.charCodeAt(i));
// }
// // 8 0
// //
// byteArrays.push(new Uint8Array(byteNumbers));
// }
// let result = new Blob(byteArrays, {
// type: contentType
// })
// result = Object.assign(result,{
// // jartto: URL.createObjectURL
// preview: URL.createObjectURL(result),
// name: `.png`
// });
// resolve(result)
// })
// }
}
}
</script>

@ -1,2 +1,2 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>商城</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.63b34199.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.0ec5b294.js></script><script src=/static/js/index.600c77d2.js></script></body></html>
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.63b34199.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.0ec5b294.js></script><script src=/static/js/index.f4f81166.js></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,10 +0,0 @@
module.exports = {
devServer: {
proxy: {
'/api': {
target: 'https://qg.njrenzhou.cn',
changeOrigin: true
}
}
}
}
Loading…
Cancel
Save