d_index.js
2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
var comfun = require('../../comjs/comfun.js');
Page({
data:{
blocks:[1,2,3],
banners:[
// {
// imgurl:'http://qn.colorcun.com/a.jpeg',
// info:'你愿意跟我做朋友吗'
// },
{
imgurl:'http://qn.colorcun.com/b.png',
info:'我在认真听讲,不要打扰我'
},
{
imgurl:'http://qn.colorcun.com/c.png',
info:'我听见背后有人说我帅'
}
],
midlist:[
{
icon:'/pages/image/mid-team.svg',
title:'组队',
path:'../team/team'
},
{
icon:'/pages/image/mid-front.svg',
title:'榜单',
path:'../rank/rank'
},
{
icon:'/pages/image/mid-say.svg',
title:'话题',
path:''
},
{
icon:'/pages/image/mid-act.svg',
title:'活动',
path:''
}
],
isshow:false,
menuright:20,
menubottom:650,
team:true,
sort:true,
home:false,
pets:[1,2,3,4,5,6]
},
onLoad:function(){
comfun.setBarTitle('社区')
},
onShow:function(){
},
record:function(){
},
menushow:function(){
this.setData({
isshow:!this.data.isshow
})
},
menumove:function(e){
console.log(e)
var pagex=e.touches[0].clientX;
var pagey=e.touches[0].clientY;
var system=wx.getStorageSync('system')
console.log(system)
var screenwidth=system.windowWidth;
var screenheight=system.windowHeight;
var ratio=750/screenwidth;
if(pagex<300/ratio){
pagex=300/ratio
}
if(pagey<240/ratio){
pagey=240/ratio
}
this.setData({
menuright:Math.round((screenwidth-pagex)*ratio)>=20 ? Math.round((screenwidth-pagex)*ratio) : 20,
menubottom:Math.round((screenheight-pagey)*ratio)<240 ? 240 : Math.round((screenheight-pagey)*ratio)
})
},
team:function(){
this.setData({
team:false,
sort:true,
home:true
})
},
sort:function(){
this.setData({
team:true,
sort:false,
home:true
})
},
home:function(){
this.setData({
team:true,
sort:true,
home:false
})
},
teamdetail:function(){
wx.navigateTo({
url:'../team/t_detail'
})
}
})