12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- var sceneReadyBehavior = require('../behavior-scene/scene-ready');
- const app = getApp();
- var url = app.globalData.url;
- Page({
- data: {
- ar_1image:url+"targets/ar_1.png",
- fanhui:url+"fanhui.png",
- paizhao:url+"paizhao.png"
- }
- ,
- behaviors: [sceneReadyBehavior],
- handleChangeMarkerImg: function() {
- wx.chooseMedia({
- count: 1,
- sizeType: ['compressed'],
- mediaType: ['image'],
- sourceType: ['album'],
- success: res => {
- const fp = res.tempFiles[0].tempFilePath;
- this.setData({markerImg: fp});
- },
- fail: err => {
- console.error('[xr-demo]chooseImage failed', err);
- }
- });
- },
- handlestr: function({detail}) {
- this.setData({loadedSaoMiao: true});
- },
- onClickBack() {
- wx.navigateBack()
- },
-
- //touch start 手指触摸开始
- handleTouchStart: function(e) {
- this.startTime = e.timeStamp;
- console.log(" startTime = " + e.timeStamp);
- console.log(" 手指触摸开始 " , e);
- console.log(" this " , this);
- },
- //touch end 手指触摸结束
- handleTouchEnd: function(e) {
- this.endTime = e.timeStamp;
- console.log(" endTime = " + e.timeStamp);
- console.log(" 手指触摸结束 ", e);
- //判断是点击还是长按 点击不做任何事件,长按 触发结束录像
- if (this.endTime - this.startTime > 350) {
- //长按操作 调用结束录像方法
- this.setData({recordState: 2});
- }
- },
- /**
- * 点击按钮 - 拍照
- */
- handleClick: function(e) {
- console.log("endTime - startTime = " + (this.endTime - this.startTime));
- if (this.endTime - this.startTime < 350) {
- console.log("点击123");
- //调用拍照方法
- //this.capture();
- this.setData({captureState: this.startTime});
- }
- },
- /**
- * 长按按钮 - 录像
- */
- handleLongPress: function(e) {
- console.log("endTime - startTime = " + (this.endTime - this.startTime));
- console.log("长按");
- // 长按方法触发,调用开始录像方法
- this.setData({recordState: 1});
- }
- });
|