Commit e11668af authored by Damon's avatar Damon

perf: 异步优化

parent 80a643c8
;(function() { ;(function() {
let NODE_ENV = 'prod' // dev:开发环境 | test:测试环境 | prod:生产环境 let NODE_ENV = 'prod' // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null let ENV_VAR = null
let VERSION_NUMBER = '1.4.5' //版本号 let VERSION_NUMBER = '1.4.6' //版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频 //小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
if (NODE_ENV === 'dev') { if (NODE_ENV === 'dev') {
......
...@@ -10,7 +10,7 @@ const UNI_APP = { ...@@ -10,7 +10,7 @@ const UNI_APP = {
qn_base_url: 'https://qn-static.banshouhui.com/self-support/', qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'https://qn-static.banshouhui.com', qn_asset_url: 'https://qn-static.banshouhui.com',
argoDebugMode: 0, argoDebugMode: 0,
version: 'v1.3.9' version: 'v1.4.6'
} }
module.exports = UNI_APP; module.exports = UNI_APP;
...@@ -18,7 +18,7 @@ export default { ...@@ -18,7 +18,7 @@ export default {
mobile: that.vuex_user.mobile mobile: that.vuex_user.mobile
} }
delete log.files delete log.files
RUN('upload_photo', log) RUN('upload_photo_success', log)
}, },
onProgressUpdate: res => { onProgressUpdate: res => {
//console.log("上传进度返回:",res); //console.log("上传进度返回:",res);
...@@ -31,8 +31,8 @@ export default { ...@@ -31,8 +31,8 @@ export default {
console.log("err", err) console.log("err", err)
err.mobile = that.vuex_user.mobile err.mobile = that.vuex_user.mobile
err.files = uploadTask if(!err.key) err.files = uploadTask
ERROR('upload_photo', err) ERROR('upload_photo_error', err)
if (err.errMsg && err.errMsg.indexOf('fail file not found') !== -1) { // 在任务中删除不存在的图片 if (err.errMsg && err.errMsg.indexOf('fail file not found') !== -1) { // 在任务中删除不存在的图片
const newTask = uploadTask.filter(v => v.key !== err.key) const newTask = uploadTask.filter(v => v.key !== err.key)
......
...@@ -1151,7 +1151,8 @@ export default { ...@@ -1151,7 +1151,8 @@ export default {
const order = { const order = {
orderNumber: this.orderNumber, orderNumber: this.orderNumber,
fieldsName: this.photoItem.fieldsName, fieldsName: this.photoItem.fieldsName,
fieldsTitle: this.photoItem.fieldsTitle fieldsTitle: this.photoItem.fieldsTitle,
uploadType: 'camera'
} }
const value = await this.saveToTask(files, order) const value = await this.saveToTask(files, order)
this.$refs[ this.$refs[
...@@ -1173,7 +1174,8 @@ export default { ...@@ -1173,7 +1174,8 @@ export default {
const order = { const order = {
orderNumber: this.orderNumber, orderNumber: this.orderNumber,
fieldsName: this.photoItem.fieldsName, fieldsName: this.photoItem.fieldsName,
fieldsTitle: this.photoItem.fieldsTitle fieldsTitle: this.photoItem.fieldsTitle,
uploadType: 'album'
} }
const value = await this.chooseImg(options, order) const value = await this.chooseImg(options, order)
self.$refs[ self.$refs[
......
...@@ -104,6 +104,10 @@ ...@@ -104,6 +104,10 @@
if (e && e.classifyId) { if (e && e.classifyId) {
this.classifyId = e.classifyId this.classifyId = e.classifyId
} }
if (e && e.orderNumber) {
this.orderNumber = e.orderNumber
}
// this.getListData() // this.getListData()
this.getListDataNew() this.getListDataNew()
this.getWatermark() this.getWatermark()
...@@ -254,7 +258,13 @@ ...@@ -254,7 +258,13 @@
// 真实地址key // 真实地址key
let saveList = this.currentItemDate.key let saveList = this.currentItemDate.key
const files = img.map(v => v.path) const files = img.map(v => v.path)
const value = await this.saveToTask(files) const order = {
orderNumber: this.orderNumber,
fieldsName: this.currentItemDate.fieldsName,
fieldsTitle: this.currentItemDate.fieldsTitle,
uploadType: 'camera'
}
const value = await this.saveToTask(files, order)
value.forEach(item =>{ value.forEach(item =>{
// 文件key添加保存数组中 // 文件key添加保存数组中
saveList.push(item.key) saveList.push(item.key)
......
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