From 2e9b88640251c59b22cb43b1a8705e999278c39c Mon Sep 17 00:00:00 2001 From: pxskm4tvn <2836285168@qq.com> Date: Thu, 10 Oct 2024 01:02:59 +0800 Subject: [PATCH] ADD file via upload --- third.js | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 third.js diff --git a/third.js b/third.js new file mode 100644 index 0000000..79d1e0d --- /dev/null +++ b/third.js @@ -0,0 +1,99 @@ +// pages/shouye/shouye.js +// var app = getApp() +var Paths = ['曾恬灵','龙思怡', '杨光正 ', '张嘉威', '李玲', '程方磊','陈佳慧','张定坚','吴世胜','黄益民','刘燕玲','赵金改']; +var Index = 0; +Page({ + + /** + * 页面的初始数据 + */ + data: { + Path:Paths[0], + title:'开始', + isRunning:false, + userInfo:{}, + }, + change:function(e){ + let Index = Math.ceil(Math.random()*5)//运用random随机数自动随机生成index的下标 + this.setData( { + Path:Paths[Index] + } + ) + }, + guess:function(e){ + let isRunning = this.data.isRunning; + if(!isRunning){ + this.setData( { + title:'停', + isRunning:true + } ); + this.timer=setInterval((function(){ + this.change() + }).bind(this),50 ); + } + else{ this.setData( + { + title:'开始', //按钮上的字变为StART + isRunning:false + } + ); + this.timer&&clearInterval(this.timer); + } + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file