index_f.html
15.9 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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width"/>
<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title></title>
<script src="../../assets/js/fontsize.js"></script>
<link rel="stylesheet" href="../../assets/css/swiper-3.4.2.min.css">
<link rel="stylesheet" href="../../assets/css/api.css"/>
<link rel="stylesheet" href="../../assets/css/index.css">
<link rel="stylesheet" href="../../assets/icon/iconfont.css">
<style>
body, html {
/*background-color: #efefef;*/
height: 100%;
}
.banner_box {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 0.1rem;
}
.swiper-slide {
width: 100% !important;
}
.swiper_list {
width: 100%;
}
</style>
</head>
<body>
<div id="loadStart"></div>
<div id="app" v-cloak>
<div class="index_list" id="top">
<div class="index_item" v-for="(item,index) in cat_data" @click="openItem(item.id,item.name)">
<div class="index_img"><img :src="item.img?item.img:img_default" alt=""></div>
<div>{{item.name}}</div>
</div>
<div class="menus" v-show="img_active">
<div class="menus_item" @click="openOrder"><span class="iconfont icon-dingdan"></span><span>我的订单</span>
</div>
<div class="menus_item" @click="openHealth"><span class="iconfont icon-kongxin"></span><span>健康档案</span>
</div>
<div class="menus_item" @click="openSever"><span class="iconfont icon-kefu"></span><span>客服服务</span></div>
<div class="menus_item" @click="openStrict"><span class="iconfont icon-icon"></span><span>认购权益</span></div>
<!--<div class="menus_item" @click="openQrc"><span class="iconfont icon-saoyisao"></span><span>扫一扫</span></div>-->
</div>
</div>
<div class="banner_box" @click="openStrict"><img src="../../assets/image/banner.png" alt=""></div>
<div class="banner_nav_box">
<div class="banner_item" @click="care(item.goods_id,item.title)" v-for="(item,index) in index_data">
<div class="banner_item_left">
<span class="banner_item_title">{{item.title}}</span>
<span class="banner_item_content">{{item.describe}}</span>
</div>
<div class="banner_item_img">
<img :src="item.img?item.img:img_default" alt="">
</div>
</div>
</div>
<div class="swiper_title fixed_top" v-show="top_show">
<span></span>
<span class="swiper_title_content"> <img src="../../assets/image/part4_03.jpg" alt=""><span>严选推介</span><img
src="../../assets/image/part4_05.jpg" alt=""></span>
<span class="change_slide">换一批<span class="iconfont icon-xunhuan101"></span></span>
</div>
<div class="swiper_box">
<div class="swiper_title" :class="{fixed_top:top_show}" id="main" v-show="!top_show">
<span></span>
<span class="swiper_title_content"> <img src="../../assets/image/part4_03.jpg" alt=""><span>严选推介</span><img
src="../../assets/image/part4_05.jpg" alt=""></span>
<span class="change_slide">换一批<span class="iconfont icon-xunhuan101"></span></span>
</div>
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide" v-for="(item,index) in show_data">
<div class="swiper_item" @click="care(i.goods_id,i.title)" v-for="(i,item_index) in item">
<div class="swiper_item_img"><img :src="i.img" alt=""></div>
<!--<!–<img src="../../assets/image/logo200.png" alt="">–>-->
<div class="swiper_item_right">
<div class="swiper_item_title">{{i.title}}</div>
<div class="swiper_item_content">{{i.describe}}</div>
<div class="swiper_item_type">
<div class="swiper_item_type1" v-for="(j,item2_index) in i.icon">
<div class="icon_img"><img :src="j.url" alt=""></div>
<span>{{j.text}}</span>
</div>
</div>
<div class="swiper_item_money">¥{{i.price}}</div>
</div>
</div>
</div>
</div>
</div>
<div class="mold_index" v-show="img_active" @touchstart="hideMenu"></div>
</div>
</div>
</body>
</html>
<script type="text/javascript" src="../../assets/js/api.js"></script>
<script type="text/javascript" src="../../assets/js/swiper-3.4.2.min.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>
var app = new Vue({
el: '#app',
data: {
img_active: false,
mySwiper: {},
scroll_top: '',
top_show: false,
cat_data: [],
index_data: [],
show_data: [],
img_default: '../../assets/image/logo200.png',
cityname: '',
rongYunToken: '',
userId: '',
user_info: []
},
created: function () {
apiready = function () {
app.cat();//首页导航
app.index();//第三栏
app.show();//严选推荐
app.cityname = api.pageParam.cityname;
// 获取个人信息
if (getToken() && getToken() != 'undefined') {
app.getUserIndexInfo()
}
app.img_active = false;//进入
api.setFrameAttr({
name: api.frameName,
bounces: true
});
app.scroll_top = $api.byId('top').scrollHeight;
if (app.scroll_top == 0) {
app.top_show = true;
} else {
app.top_show = false;
}
api.addEventListener({
name: 'show_menu'
}, function (ret, err) {
app.img_active = ret.value.img_active;
api.setFrameAttr({
name: 'index_f',
bounces: false
});
});
// 底部轮播图
app.mySwiper = new Swiper('.swiper-container', {
observer: true,
observeParents: true,
slidesPerView: 1,
// autoplayDisableOnInteraction: false,
loop: true,
navigation: {
nextEl: '.change_slide',
},
autoHeight: true,
speed: 1500,
});
};
},
mounted: function () {
window.addEventListener('scroll', this.handleScroll)
},
methods: {
// 隐藏菜单
hideMenu: function () {
app.img_active = !app.img_active;
api.sendEvent({
name: 'hide_menu',
extra: {
img_active: app.img_active
}
});
},
// 严选推荐定位
handleScroll: function () {
var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
var offsetTop = document.querySelector('#main').offsetTop;
if (scrollTop > offsetTop) {
app.top_show = true
} else {
app.top_show = false
}
},
// 严选推荐定位
destroyed: function () {
window.removeEventListener('scroll', this.handleScroll)
},
// 打开投资
openStrict: function () {
app.img_active = false;
api.setFrameGroupIndex({
name: 'index_fm',
index: 1
})
},
// 打开订单
openOrder: function () {
app.img_active = false;
openView('my_orderlist', 'my/my_orderlist', '我的订单', 'my_orderlist', false, false, false);
api.sendEvent({
name: 'hide_menu',
extra: {
img_active: false
}
});
},
// 打开健康档案
openHealth: function () {
app.img_active = false;
api.openWin({
name: 'my_health_w',
url: '../my/my_health_w.html',
pageParam: {
rid: 0
}
});
api.sendEvent({
name: 'hide_menu',
extra: {
img_active: false
}
});
},
// 打开客服
openSever: function () {
app.img_active = false;
app.getRongYunToken();
},
// 获取客服token
getRongYunToken: function () {
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
getRequest('post', 'portal/RongYun/index', null, header).then(function (res) {
if (res.data.code == 1) {
app.rongYunToken = res.data.data.token;
app.userId = res.data.data.userId;
// app.rongyunInit();
} else {
}
})
},
// 轮播图跳转详情
care: function (id, care_name) {
api.openWin({
name: 'care_w',
url: './care_w.html',
pageParam: {
id: id,
care_name: care_name
}
})
},
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_info = res.data.data;
} else {
}
})
},
// 获取分类图标
cat: function () {
getRequest('post', 'portal/index/cat', null, null).then(function (res) {
if (res.data.code == 1) {
app.cat_data = res.data.data;
// loadEnd();
} else {
}
})
},
// 跳转分类列表
openItem: function (id, name) {
switch (id) {
case 1:
openView('nursing_f', 'index/nursing_f', name, 'nursing_f', false, {
cid: id,
cityname: app.cityname
});
break;
case 2 :
openView('disease_f', 'index/disease_f', name, 'disease_f', false, {
cid: id,
cityname: app.cityname
});
break;
case 3:
openView('disease_f', 'index/disease_f', name, 'disease_f', false, {
cid: id,
cityname: app.cityname
});
break;
case 4:
openView('examination_f', 'index/examination_f', name, 'examination_f', false, {
cid: id,
cityname: app.cityname
});
break;
case 5:
api.openWin({
name: 'doc_home_w',
url: './doc_home_w.html',
pageParam: {
cid: id,
cityname: app.cityname
}
});
break;
case 6:
openView('disease_f', 'index/disease_f', name, 'disease_f', false, {
cid: id,
cityname: app.cityname
});
break;
case 7:
openView('examination_f', 'index/examination_f', name, 'examination_f', false, {
cid: id,
cityname: app.cityname
});
break;
case 8:
openView('examination_f', 'index/examination_f', name, 'examination_f', false, {
cid: id,
cityname: app.cityname
});
break;
case 9:
api.openWin({
name: 'Insurance_w',
url: './Insurance_w.html',
pageParam: {
cid: id,
cityname: app.cityname
}
});
break;
case 10:
api.openWin({
name: 'tral_w',
url: './tral_w.html',
pageParam: {
cid: id,
cityname: app.cityname
}
});
break;
// default:
// openView('nursing_f', 'index/nursing_f', name, 'nursing_f', false, {cid: id});
// return;
}
},
// 获取第三栏列表
index: function () {
getRequest('post', 'portal/index/index', null, null).then(function (res) {
if (res.data.code == 1) {
app.index_data = res.data.data;
} else {
}
setTimeout(function () {
api.hideProgress();
}, 2000)
})
},
// 获取严选推荐列表
show: function () {
getRequest('POST', 'portal/index/show', null, null).then(function (res) {
// alert(JSON.stringify(res));
if (res.data.code == 1) {
app.show_data = res.data.data
} else {
}
})
}
}
})
</script>