|
@@ -99,6 +99,7 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
...mapMutations(["toggleSnapNow", "decreaseSnapCount"]),
|
|
...mapMutations(["toggleSnapNow", "decreaseSnapCount"]),
|
|
async openCamera() {
|
|
async openCamera() {
|
|
|
|
+ const _openStartTime = Date.now();
|
|
const video = this.$refs.video;
|
|
const video = this.$refs.video;
|
|
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
|
|
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
|
|
try {
|
|
try {
|
|
@@ -117,6 +118,13 @@ export default {
|
|
try {
|
|
try {
|
|
await video.play();
|
|
await video.play();
|
|
this.disableSnap = false;
|
|
this.disableSnap = false;
|
|
|
|
+ const _openEndTime = Date.now();
|
|
|
|
+ window._hmt.push([
|
|
|
|
+ "_trackEvent",
|
|
|
|
+ "摄像头框",
|
|
|
|
+ "摄像头打开耗时",
|
|
|
|
+ Math.floor((_openEndTime - _openStartTime) / 1000) + "秒",
|
|
|
|
+ ]);
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.log("摄像头没有正常启用", error);
|
|
console.log("摄像头没有正常启用", error);
|
|
this.$Message.error({
|
|
this.$Message.error({
|