- 小程序Camera组件调用摄像头持续自动拍照上传,

部分手机无法按照预期自动拍照(华为手机尤其明显),

而且2~3分钟后手机发烫,电量耗费严重。


- 所有手机自动拍照上传,得到后台响应后再继续拍第二张进行上传


-

arwxAPI.taskSequence()

.then(() => arwxAPI.uploadFile({

url: app.globalData.origin + '/ar-service/api/v1/info/upload',

filePath: url,

name: 'file',

header: {

"Content-Type": "multipart/form-data"

},

formData: {

'openId': openID,

'latitude': this.data.userPoint.lat === undefined ? '' : this.data.userPoint.lat,

'longitude': this.data.userPoint.lng === undefined ? '' : this.data.userPoint.lng

}

}))

.then(res => {

//将获取的结果置入

let resultJson = JSON.parse(res.data);

if (resultJson.payload != null && resultJson.payload.infos.length > 0) {

let resultList = [];

for (let num = 0; num < resultJson.payload.infos.length; num++) {

let item = resultJson.payload.infos[num];

let isSame = this.data.resultList.some((val, key) => {

return val.itemId == item.arCode

});

if (!isSame) {

resultList.push({

itemId: item.arCode,

itemIcon: item.iconPath,

itemName: item.title,

content: item.info,

video: item.videoUrl,

dealerList: [{

name: resultJson.payload.dealerName,

addr: resultJson.payload.dealerAddr,

distance: '距离' + resultJson.payload.dealerLength + '公里',

phone: resultJson.payload.dealerTel,

isFavor: false

},

{

name: resultJson.payload.fdName,

addr: resultJson.payload.fdAddr,

distance: '距离' + resultJson.payload.fdLength + '公里',

phone: resultJson.payload.fdTel,

isFavor: true

}

]

});

//弹出扫描结果页面

this.setData({

resultLogo: resultList[0].itemIcon

});


this.setData({

resultscan: true,

scanSuccess: true,

});


this.resultRingAnimation();

}

}


setTimeout(() => {

this.setData({

resultscan: false

});

}, 3500);

let newResultList = this.data.resultList.concat(resultList);

this.setData({

resultList: newResultList.reverse()

});

}


展开全部
收起
0回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部