请问一下,我需要在一个主表单界面内,点击新增录入等按钮,分别弹出不同界面来,这样会需要多个表单,我理解是需要在这个项目下,再多建几个表单吧,这样相互引用更方便;
而不是去另建项目,再创建需要的,其他类的表单吧;
你说的对,再新建几个窗体即可。
不知道你这个问题是否已经解决, 如果还没有解决的话:
解决方式:
// pages/setInter/index.js
Page({
/**
* 页面的初始数据
*/
data: {
myInterv: '', // 定时器
cont: 0 // 数据
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
const self = this
self.interval(() => {
self.setData({
cont: self.data.cont + 1
})
console.error(self.data.cont)
}, 1000)
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () { // 后台运行清除定时器
const self = this
self.clearTimeInterval(self)
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () { // 关闭清除定时器
const self = this
self.clearTimeInterval(self)
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
interval (func, wait) { // 定时器
const self = this
var myInterv = setInterval(func, wait)
self.setData({
myInterv: myInterv
})
},
clearTimeInterval (self) { // 清除定时器
var myInterv = self.data.myInterv
clearInterval(myInterv)
}
})