Commit 6992ccde by 前端

oss

1 parent 5e974d89
import http from '../request/http' import http from "../request/http";
module.exports = { module.exports = {
search(data) { search(data) {
return http.post({ return http.post({
method: 'scrm.api.carlife.weapp.homeSearch.search', method: "scrm.api.carlife.weapp.homeSearch.search",
pageSize: 10, pageSize: 10,
...data, ...data,
}) });
}, },
}
\ No newline at end of file \ No newline at end of file
getToken(data) {
return http.post({
method: "dj.api.mindworkplate.badge.getToken",
projectName: "mindworkplate",
sessionId: "2ae39c60-60c9-4096-901a-68da57068cd9",
});
},
};
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-08 11:28:48
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-04-08 13:47:00
* @FilePath: \gl_tape\mixin\click.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const recorderManager = uni.getRecorderManager();
export default {
data() {
return {
timer: null,
times: 0,
timeout: 10 * 60,
reaction: 10,
};
},
onShow() {
window.addEventListener("devicemotion", this.handleDeviceMotion);
},
onHide() {
window.removeEventListener("devicemotion", this.handleDeviceMotion);
},
created() {
recorderManager.start();
this.initTime();
document.addEventListener("visibilitychange", this.handleVisibilityChange);
},
methods: {
handleDeviceMotion(event) {
let acceleration = event.accelerationIncludingGravity;
let brightness =
Math.abs(acceleration.x) +
Math.abs(acceleration.y) +
Math.abs(acceleration.z);
if (brightness < 10) {
// 假设<10的值代表屏幕可能变暗了
console.log("屏幕可能熄灭了");
// 在这里执行你需要的操作
}
},
//监听点击事件
initTime() {
this.timer = setInterval(() => {
this.times++;
console.log(this.times);
if (this.times >= this.timeout) {
this.showToast();
}
if (this.times >= this.reaction + this.timeout) {
this.handleEnd();
}
}, 1000);
},
handleTouchStart() {
this.times = 0;
},
},
handleVisibilityChange() {
if (document.visibilityState === "hidden") {
// 屏幕被关闭
console.log("Screen closed");
}
},
beforeCreate() {
clearInterval(this.timer);
this.timer = null;
},
};
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!