1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- var app=getApp();
- var stoptime=0;
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- wurl:'',
- share_user_id:'',
- clientype: app.globalData.clientype,
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.setData({
- share_user_id:options.share_user_id,
- clientype: app.globalData.clientype,
- wurl:app.globalData.webUrl+'applet.html#/networktool?share_user_id='+options.share_user_id+'&client_type=' + app.globalData.clientype+'&token='+app.globalData.token
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- stoptime=0;
- setTimeout(function(){
- stoptime=stoptime*1+1;
- },1000)
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- var timearr=app.globalData.timearr,flag=false;
- for(var i=0;i<timearr.length;i++){
- if(timearr[i].type=='smallnetool'){
- timearr[i].time=timearr[i].time*1+stoptime*1;
- flag=true;
- }
- }
- if(!flag){
- var obj={
- type:'smallnetool',
- time:stoptime
- };
- app.globalData.timearr.push(obj);
- }else{
- app.globalData.timearr=timearr;
- }
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- },
- /**
- * 用户点击右上角分享
- */
- // onShareAppMessage: function () {
- // return {
- // title: '我是'+app.globalData.sharename+",这是我的个人微网",
- // imageUrl:"../../img/weiw.png",
- // path: '/pages/microgrid/microgrid?share_user_id='+this.data.share_user_id
- // }
- // }
- })
|