123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- var App=getApp();
- var utils=require("../../utils/http")
- var stoptime=0;
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- webUrl:'',
- clientype: App.globalData.clientype
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- var that=this;
- wx.showLoading({
- title: '加载中',
- })
- this.setData({
- clientype: App.globalData.clientype,
- webUrl:App.globalData.webUrl+'applet.html#/housestyle?token='+App.globalData.token + '&client_type=' + App.globalData.clientype+"&share_user_id="+App.globalData.personMsg.id+'&type=1',
- })
-
- wx.hideLoading()
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- // if(app.globalData.use_id!=this.data.share_user_id){
- // wx.hideHomeButton();
- // }
- 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=='housestyle'){
- timearr[i].time=timearr[i].time*1+stoptime*1;
- flag=true;
- }
- }
- if(!flag){
- var obj={
- type:'housestyle',
- time:stoptime
- };
- App.globalData.timearr.push(obj);
- }else{
- App.globalData.timearr=timearr;
- }
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- },
- addshare:function(){
- var that=this;
- utils.$post({
- url: App.globalData.webUrl + 'api/tool/tool_share',
- header: {
- 'Authorization':'bearer '+App.globalData.token
- },
- data:{
- type:'styleTest'// 装修风格/styleTest 老房翻新/likeTest
- },
- success: function (res) {
-
- }
- })
- },
- /**
- * 用户点击右上角分享
- */
- // onShareAppMessage: function () {
- // var that=this;
- // this.addshare()
- // return {
- // title: '装修风格测一测', // 默认是小程序的名称(可以写slogan等)
- // path: '/pages/beforetest/beforetest?type=housestyle'+"&share_user_id="+that.data.share_user_id, // 默认是当前页面,必须是以‘/’开头的完整路径
- // imageUrl: 'https://o.nczyzs.com/xcx/styletool.jpg', //自定义图片路径,图片长宽比是 5:4
- // }
- // }
- })
|