my_f.html
9.5 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
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<script src="../../assets/js/fontsize.js"></script>
<link rel="stylesheet" href="../../assets/css/api.css"/>
<link rel="stylesheet" href="../../assets/css/my_f.css"/>
<link rel="stylesheet" href="../../assets/icon/iconfont.css">
<title></title>
</head>
<body>
<div id="loadStart"></div>
<div id="app" v-cloak>
<header class="" id="header">
<div class="my_top">
<div class="my_header_boxs" @click="my_detail">
<div class="my_header_box">
<img :src="user_type.avatar?user_type.avatar:'../../assets/image/default_img.png'" alt="">
</div>
<span :class="['my_vip',user_type.is_vip==1?'vip_show':'no_vip']">V</span>
</div>
<div class="my_name">{{user_type.name}}</div>
</div>
</header>
<div class="my_count">
<div class="my_count_item" @click="my_balance(user_type.balance)">
<div class="my_price">{{user_type.balance?user_type.balance:0.00}}元</div>
<div>账户余额</div>
</div>
<div class="my_count_item" @click="my_consumption">
<div class="my_price">{{user_type.count?user_type.count:0}}张</div>
<div>消费金额</div>
</div>
</div>
<div class="my_item_box">
<div class="my_item" @click="goPay">
<img src="../../assets/image/my0.png" alt="">
<span>我的订单</span>
</div>
<div class="my_item" @click="go_hearth">
<img src="../../assets/image/my1.png" alt="">
<span>健康档案</span>
</div>
<div class="my_item border_2" @click="my_power">
<img src="../../assets/image/my2.png" alt="">
<span>我的权益</span>
</div>
<div class="my_item border_1" @click="question">
<img src="../../assets/image/my3.png" alt="">
<span>常见问题</span>
</div>
<div class="my_item border_1 " @click="friend">
<img src="../../assets/image/my4.png" alt="">
<span>邀请好友</span>
<span class="my_money">领取高额消费金额</span>
</div>
<div class="my_item border_1 border_2" @click="set">
<img src="../../assets/image/my5.png" alt="">
<span>设置</span>
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript" src="../../assets/js/api.js"></script>
<script type="text/javascript" src="../../assets/js/public.js"></script>
<script type="text/javascript" src="../../assets/js/fastclick.js"></script>
<script>
new FastClick(document.body);
</script>
<script type="text/javascript" src="../../assets/js/vue.min.js"></script>
<script type="text/javascript" src="../../assets/js/axios.min.js"></script>
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
<script>
var app = new Vue({
el: '#app',
data: {
isLogin: true,
// user_info: [],
user_type: [],
avatar_default: '../../assets/image/mblogo_03.png',
default_name: '',
marginTop: '',
newList: [],
type: 0
},
created: function () {
apiready = function () {
app.type = api.pageParam.type ? api.pageParam.type : 0;
// app.getUserinfo();
if (getToken()) {
app.getUserIndexInfo()
app.getNews();
}
api.addEventListener({
name: 'changeInfo'
}, function (ret, err) {
app.getUserIndexInfo();
});
api.addEventListener({
name: 'login'
}, function (ret, err) {
app.getUserIndexInfo();
});
api.addEventListener({
name: 'pay_success'
}, function (ret, err) {
app.getUserIndexInfo();
});
api.addEventListener({
name: 'add_success'
}, function (ret, err) {
app.getUserIndexInfo();
});
}
},
methods: {
// 个人资料
my_detail: function () {
if (app.user_type == '') {
toastMsg('未登录')
} else {
openView('my_detail', 'my/my_detail', '个人资料', 'my_detail', false, {rid: 0, type: 0})
}
},
// 设置
set: function () {
openView('my_set', 'my/my_set', '设置', 'my_set', false, false, false)
},
// 常见问题
question: function () {
if (app.user_type == '') {
toastMsg('未登录')
} else {
openView('my_que', 'my/my_que', '常见问题', 'my_que', false, false, false)
}
},
// 邀友有赚
friend: function () {
if (app.user_type == '') {
toastMsg('未登录')
} else {
openView('my_invite', 'my/my_invite', '邀请好友', 'my_invite', false, {invite_type: 0})
}
},
// 我的订单
goPay: function () {
if (app.user_type == '') {
toastMsg('未登录')
} else {
openView('my_orderlist', 'my/my_orderlist', '我的订单', 'my_orderlist', false, false, false);
}
},
// 我的消息
my_news: function () {
if (app.user_type == '') {
toastMsg('未登录')
} else {
openView('my_news', 'my/my_news', '消息通知', 'my_news', false, {new_type: 0})
}
},
// 有无消息判断
getNews: function () {
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
getRequest('post', 'user/index/getUserMessageList', null, header).then(function (res) {
if (res.data.code == 1) {
app.newList = res.data.data.unread;
} else {
toastMsg(res.data.msg)
}
loadEnd();
})
},
// 我的账号
my_balance: function () {
if (app.user_type == '') {
toastMsg('未登录')
} else {
openView('my_balance', 'my/my_balance', '我的账号', 'my_balance', false, false, false)
}
},
// 我的消费金
my_consumption: function () {
if (app.user_type == '') {
toastMsg('未登录')
} else {
openView('my_consumption', 'my/my_consumption', '我的消费金', 'my_consumption', false, false, false)
}
},
// 我的权益
my_power: function () {
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
if (app.user_type == '') {
toastMsg('未登录')
} else {
getRequest('post', 'user/index/myRights', null, header).then(function (res) {
if (res.data.code == 1) {
openView('my_benefit', 'my/my_benefit', '我的权益', 'my_benefit', false, false, false)
} else {
toastMsg(res.data.msg);
}
});
}
},
// 健康档案
go_hearth: function () {
if (app.user_type == '') {
toastMsg('未登录')
} else {
api.openFrame({
name: 'my_health',
url: './my_health.html',
// bounces: true,
rect: {
x: 0,
y: 0,
w: 'auto',
h: 'auto',
},
pageParam: {
rid: 0,
type: 0
}
});
}
},
// 获取个人信息
getUserIndexInfo: function () {
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
getRequest('post', 'user/index/getUserIndexInfo', null, header).then(function (res) {
// alert(JSON.stringify(res));
if (res.data.code == 1) {
app.user_type = res.data.data;
loadEnd();
} else {
}
});
}
}
})
</script>