-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfriends.html
170 lines (152 loc) · 5.85 KB
/
friends.html
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>nav</title>
<link href="css/icon-svg.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="less-css/public.css" />
<link href="css/personal.css" rel="stylesheet">
<script src="js/vue.js"></script>
<script src="js/fastclick.js"></script>
<script>
if ('addEventListener' in document) {
document.addEventListener('DOMContentLoaded', function() {
FastClick.attach(document.body);
}, false);
}
</script>
</head>
<body>
<div id="body-container"></div>
<div id="wrap" class="container-fluid">
<header id="header">
<button class="goback close glyphicon glyphicon-close" @click="close" ></button>
</header>
<div class="row clear_margin_right" id="_PERSONAL">
<div class="col-xs-12">
<h4 class="tx-nav">FRIENDS</h4>
<small class="tx-inform">朋友</small>
</div>
<div class="col-xs-12 _PERSONAL_CONTAINER">
<div class="user-image" v-bind:style="SRC_image"></div>
<p class="tx-inform">{{STR_name}}</p>
<ul class="user-infrom">
<li class="col-xs-4" @click="opengetMyMission">
<p class="tx-mulu margin_0">{{NUM_mission}}</p>
<p class="margin_0 tx-inform">发布任务</p>
</li>
<li class="col-xs-4" @click="opengetMyAppraise">
<p class="tx-mulu margin_0">{{NUM_appraise}}</p>
<p class="margin_0 tx-inform">评论</p>
</li>
<div style="clear: both"></div>
</ul>
<h4 class="tx-nav bottom-nav">HE FRIENDS</h4>
<small class="tx-inform">近期往来</small>
<div class="my-mission col-xs-12">
<div class="mission-content" v-for="item in Iappraise">
<div class="content-image" v-bind:style="{ backgroundImage : 'url(http://clevok.cn/other/renyi/img/user-image/'+ item.imgSrc +')' }"></div>
<p class="tx-inform">{{item.userName}}</p>
</div>
<!-- <div class="mission-content">
<div class="mission-more"></div>
</div>-->
</div>
</div>
</div>
</div>
<script src="js/renyi.js"></script>
<script src="js/ready-pubilc.js"></script>
<script>
new Vue({
el: '#header',
data: {
nav : false
},
methods : {
close : function () {
var w = plus.webview.currentWebview();//获取我这个窗口
plus.webview.close(w ,'slide-out-right' ,300);
}
}
});
var _PERSONAL = new Vue({
el: '#_PERSONAL',
data: {
NUM_mission : 0,
NUM_appraise : 0,
SRC_image : { backgroundImage : 'url(img/user-image/default.png)'},
STR_name : window.localStorage.getItem('friendName'),
Iappraise : []
},
methods : {
opengetMyMission : function () {
plus.nativeUI.toast( "无权限查看");
},
opengetMyAppraise : function () {
renyi.webView.create('_GETMYAPPRAISE', 'getMyAppraise.html', {
typeShow: 'slide-in-right',
timeOut: 1,
hideLeft: '0px',
duration: 300
})
}
}
});
var _WS = null;
if (window.plus) {
plusReady();
} else {
document.addEventListener("plusready", plusReady, false);
}
function plusReady() {
_WS = plus.webview.currentWebview();
_WS.setPullToRefresh({
support: true,
style: "circle",
height: "50px",
range: "200px",
contentdown: {
caption: "下拉刷新"
},
contentover: {
caption: "释放刷新"
},
contentrefresh: {
caption: "正在刷新..."
}
}, _PERSONAL_ajax);
}
function _PERSONAL_ajax() {
renyi.ajax({
url: 'http://120.27.38.110/other/renyi/userAct.php',
type: 'post',
data: {
type: 'getPerson',
userId: parseInt(window.localStorage.getItem('friendId'), 10)
},
success: function (data) {
var _JSONDATA = JSON.parse(data);
//头像,这里有bug,不过我懒得改了
_PERSONAL.SRC_image = { backgroundImage : 'url(http://clevok.cn/other/renyi/img/user-image/'+_JSONDATA['mission']['result'][0]['userImage']+')'};
//任务
_PERSONAL.NUM_mission = _JSONDATA['mission']['num'];
//window.localStorage.setItem('getMyMission', JSON.stringify( _JSONDATA['mission']['result']) );
//评论
_PERSONAL.NUM_appraise = _JSONDATA['appraise']['num'];
_PERSONAL.Iappraise = _JSONDATA['appraise']['result'];
window.localStorage.setItem('getMyAppraise', JSON.stringify( _JSONDATA['appraise']['result']) );
_WS.endPullToRefresh();//关闭下拉刷新
},
error: function (data) {
alert('数据请求失败' + data);
_WS.endPullToRefresh();//关闭下拉刷新
}
});
}
_PERSONAL_ajax();
</script>
</body>
</html>