var t = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/helpers/defineProperty")), a = wx.createInnerAudioContext(), e = wx.createInnerAudioContext(), n = wx.createInnerAudioContext(), i = getApp(), o = (wx.getRecorderManager(),
wx.createInnerAudioContext(), wx.getBackgroundAudioManager()), r = require("../../7185FA06F07B7AAF17E3920148AC0746.js");
Page({
data: {
StatusBar: i.globalData.StatusBar,
CustomBar: i.globalData.CustomBar,
recordingTimeqwe: "蚊虫去无踪",
sao_time: "",
time: "",
num: 0,
qnum: 0,
isStart: !1,
nowItem: "",
animationData1: "",
animationData2: "",
animationStatus: !1
},
bindViewTap: function() {
wx.navigateTo({
url: "../logs/logs"
});
},
onLoad: function() {
this.sao(), a.src = "https://res.wx.qq.com/voice/getvoice?mediaid=MzIxMzczNDY2N18xMDAwMDEwODE=",
e.src = "https://res.wx.qq.com/voice/getvoice?mediaid=MzIxMzczNDY2N18xMDAwMDEwODI=",
n.src = "https://res.wx.qq.com/voice/getvoice?mediaid=MzIxMzczNDY2N18xMDAwMDEwODQ=";
},
sao: function() {
var t = this, a = 0, e = setInterval(function() {
var e = "蚊虫扫描中·········".substring(0, a);
a++, t.setData({
recordingTimeqwe: e
}), e.length == "蚊虫扫描中·········".length && (t.setData({
recordingTimeqwe: ""
}), a = 0);
}, 200);
this.setData({
sao_time: e
});
},
showModal: function(t) {
wx.vibrateShort(), this.setData({
modalName: t.currentTarget.dataset.target
});
},
hideModal: function(t) {
wx.vibrateShort(), this.setData({
modalName: null
});
},
openRecording: function(t) {
var i = t.currentTarget.dataset.item;
wx.vibrateShort();
var o = this;
if (o.data.isStart && o.data.nowItem == i) wx.showToast({
title: "正在驱蚊中···",
icon: "none",
duration: 1e3
}); else {
var r = "";
a.stop(), e.stop(), n.stop(), 1 == i && (r = "低频", a.play(), a.onEnded(function() {
a.play(), o.wenNum();
})), 2 == i && (r = "中频", e.play(), e.onEnded(function() {
e.play(), o.wenNum();
})), 3 == i && (r = "高频", n.play(), n.onEnded(function() {
n.play(), o.wenNum();
})), clearInterval(o.data.sao_time), clearInterval(o.data.time), o.recodeClick();
var s = 0, c = r + "驱蚊中···", u = setInterval(function() {
var t = c.substring(0, s);
s++, o.setData({
recordingTimeqwe: t
}), t.length == c.length && (o.setData({
recordingTimeqwe: ""
}), s = 0);
}, 100);
o.setData({
time: u,
isStart: !0,
nowItem: i
});
}
},
onShareTimeline: function() {
return console.log("分享到朋友圈"), {
title: "灭蚊器→我已消灭" + this.data.qnum + "只蚊子",
path: "/pages/index/index",
query: {
key: ""
},
imageUrl: "../../images/wenzi.jpeg"
};
},
onShareAppMessage: function() {
return wx.vibrateShort(), {
title: "灭蚊器→我已消灭" + this.data.qnum + "只蚊子",
imageUrl: "../../images/wenzi.jpeg",
path: "/pages/index/index"
};
},
shutRecording: function(t) {
console.log("停止驱蚊"), wx.vibrateShort();
this.setData({
isStart: !1
}), clearInterval(this.data.time), clearInterval(this.data.sao_time), this.sao(),
this.recodeEnd(), a.stop(), e.stop(), n.stop();
},
recordingAndPlaying: function(t) {
console.log("播放中" + t);
var a = this;
a.wenNum(), o.src = t, o.title = "暂无", o.singer = "暂无", o.coverImgUrl = "", o.onEnded(function() {
console.log("播放结束"), a.recordingAndPlaying(t);
});
},
wenNum: function(t) {
console.log("驱赶蚊虫数");
var a = r.hour(new Date());
console.log(a);
var e = [ 0, 0, 0, 0, 0, 1, 0, 0, 2, 2, 3, 1, 1, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 3, 2, 0, 0, 0 ], n = e[Math.round(Math.random() * (e.length - 1))];
i.globalData.allNum += n, this.setData({
qnum: i.globalData.allNum
});
},
animationFun: function(a) {
if (this.data.animationStatus) {
var e = wx.createAnimation({
duration: 1e3
});
e.opacity(0).scale(2, 2).step(), this.setData((0, t.default)({}, "".concat(a), e.export()));
}
},
animationEnd: function(a) {
var e = wx.createAnimation({
duration: 0
});
e.opacity(1).scale(1, 1).step(), this.setData((0, t.default)({}, "".concat(a), e.export()));
},
recodeEnd: function() {
var t = wx.createAnimation({
duration: 0
});
t.opacity(1).scale(1, 1).step();
var a = wx.createAnimation({
duration: 0
});
a.opacity(1).scale(1, 1).step(), this.setData({
animationData1: t.export(),
animationData2: a.export(),
animationStatus: !1
});
},
recodeClick: function() {
var t = this;
this.setData({
animationStatus: !0
}), this.animationFun("animationData1"), setTimeout(function() {
t.animationFun("animationData2");
}, 500), setTimeout(function() {
t.animationRest();
}, 1e3);
},
animationRest: function() {
var t = this;
this.animationEnd("animationData1"), setTimeout(function() {
t.animationEnd("animationData2");
}, 500), setTimeout(function() {
t.data.animationStatus && t.recodeClick();
}, 100);
}
});
没有合适的资源?快使用搜索试试~ 我知道了~
【小程序源码】灭蚊器娱乐小游戏多种频率选择

共24个文件
js:7个
wxss:4个
json:4个

1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 80 浏览量
2022-07-06
21:09:58
上传
评论
收藏 1.18MB RAR 举报
温馨提示
这是一种娱乐性的灭蚊器小程序 通过超声波驱赶蚊子,通过蚊子的天敌的频率达到驱赶蚊子 当然啦这种模式至于能不能有效的驱赶蚊子小编就不知道了 不过用来当作娱乐还是可以的,至于真的驱蚊这个大家可以试验一下哈哈 支持低,中,高三种频率 安装方法: 使用微信开发者工具导入源码 然后上传提交审核就可以了 下面是小编的测试演示图:
资源推荐
资源详情
资源评论



















收起资源包目录







































共 24 条
- 1
资源评论


hl199626
- 粉丝: 9
- 资源: 78
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


安全验证
文档复制为VIP权益,开通VIP直接复制
