审查视图

html/index/index_f.html 19.3 KB
朱振飞 authored
1 2
<!DOCTYPE html>
<html lang="en">
朱振飞 authored
3
dl authored
4
<head>
朱振飞 authored
5 6 7 8 9 10 11 12 13 14 15 16 17 18
	<meta charset="UTF-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<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/weui.min.css">
	<link rel="stylesheet" href="../../assets/css/api.css" />
	<link rel="stylesheet" href="../../assets/css/swiper-3.4.2.min.css">
	<!--<link rel="stylesheet" href="http://at.alicdn.com/t/font_641470_jg64l6ijsg4lsor.css">-->
	<link rel="stylesheet" href="../../assets/css/my_f.css" />
	<link rel="stylesheet" href="../../assets/css/index.css">
	<link rel="stylesheet" href="../../assets/icon/iconfont.css">
	<style>
		header {
朱振飞 authored
19 20 21 22 23 24 25 26
            width: 100%;
            height: auto;
            font-size: 20px;
            /*background-color: #dbb25f;*/
        }

        .headers {
            background-color: #dbb25f;
dl authored
27
        }
朱振飞 authored
28 29 30 31 32

        .app_name {
            padding-right: 0.8rem;
            font-family: "fzjt";
            font-size: 20px;
dl authored
33
        }
dl authored
34
朱振飞 authored
35 36 37 38 39 40 41 42 43 44
        .triangle_border_up span {
            display: block;
            width: 0;
            height: 0;
            border-width: 0 5px 5px;
            border-style: solid;
            border-color: transparent transparent #fff; /*透明 透明  黄*/
            position: absolute;
            bottom: 0;
            right: 0.55rem;
dl authored
45 46
        }
朱振飞 authored
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
        .mold_index {
            position: absolute;
        }

        #container {
            width: 0;
            height: 0;
        }

        .index1 .icon-fenxiang-tianchong {
            color: #d8b25f;
        }

        .my_top {
            overflow: hidden;
        }

        .dot {
            position: absolute;
            height: 10px;
            width: 10px;
            background-color: #EE6449;
            border-radius: 50%;
            right: 0.44rem;
            top: 0.37rem;
            z-index: 100000;
dl authored
73
        }
朱振飞 authored
74 75 76 77 78 79 80 81 82

        .my_top_icon_box {
            background-color: #ddbb72;
            padding:0.2rem 0.5rem 0.2rem 0;
        }
		/*flex布局*/
		[v-cloak]{
			display: none;
		}
dl authored
83 84
    </style>
</head>
朱振飞 authored
85
dl authored
86
<body>
kerxins authored
87 88
	<!-- 背景充满 -->
	<div id="loadStart"></div>
朱振飞 authored
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
	<div id="app" v-cloak>
		<div id="container"></div>
		<header :class="index===0?'headers':''">
			<div class="index_header" v-if="index==0">
				<div class="index_left">
					<div class="index_left_img">
						<div class="iconfont icon-dizhi"></div>
					</div>
					<span @click.stop="goToCity">{{cityname?cityname:'定位中...'}}</span>
				</div>
				<span class="app_name">慈界医养</span>
				<div class="index_right" @click="show_menu">
					<img src="../../assets/image/plus.png" alt="" :class="[img_active?'img_transform':'img_transform1']">
				</div>
			</div>
			<div class="index1" v-else-if="index==1">
				<div class="index1_item index_on">
					<!--<div class="index1_item index_on">-->
					<div></div>
					<div class="iconfont icon-fenxiang-tianchong"></div>
				</div>
			</div>
			<div class="my_top_icon_box" v-else>
				<span class="iconfont icon-xiaoxi" @click="my_news"></span>
				<span class="dot" v-show="newList.length!=0"></span>
			</div>
			<div class="triangle_border_up" v-show="img_active">
				<span></span>
			</div>
		</header>
		<div class="warp">
			<div class="index_list" id="top">
朱振飞 authored
121 122 123
				<div class="index_item" v-cloak 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>
朱振飞 authored
124
				</div>
朱振飞 authored
125 126 127 128 129 130 131 132 133 134
				<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>
朱振飞 authored
135 136 137 138 139 140 141 142 143 144
				<div class="banner_box" @click="openStrict"><img src="../../assets/image/banner.png" alt=""></div>
				<div class="banner_nav_box">
					<div class="banner_item" v-cloak @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>
朱振飞 authored
145 146
					</div>
				</div>
朱振飞 authored
147
				<div class="swiper_title fixed_top" v-show="top_show">
朱振飞 authored
148
					<span></span>
朱振飞 authored
149 150
					<span class="swiper_title_content"> <img src="../../assets/image/part4_03.jpg" alt=""><span>严选推介</span><img src="../../assets/image/part4_05.jpg"
						 alt=""></span>
朱振飞 authored
151 152
					<span class="change_slide">换一批<span class="iconfont icon-xunhuan101"></span></span>
				</div>
朱振飞 authored
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
				<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>
									<!--&lt;!&ndash;<img src="../../assets/image/logo200.png" alt="">&ndash;&gt;-->
									<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>
朱振飞 authored
174
										</div>
朱振飞 authored
175
										<div class="swiper_item_money">¥{{i.price}}</div>
朱振飞 authored
176 177 178 179 180
									</div>
								</div>
							</div>
						</div>
					</div>
朱振飞 authored
181
					<div class="mold_index" v-show="img_active" @touchstart="hideMenu"></div>
朱振飞 authored
182 183
				</div>
			</div>
朱振飞 authored
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
		</div>

		<footer>
			<div class="footer_item" :class="{footer_item_active:index==0}" @click="changeTab(0)">
				<i class="iconfont icon-yuanjiaojuxingkaobei"></i>
				<span>严选</span>
			</div>
			<div class="footer_item" :class="{footer_item_active:index==1}" @click="changeTab(1)">
				<i class="iconfont icon-xingzhuang"></i>
				<span>投资</span>
			</div>
			<div class="footer_item" :class="{footer_item_active:index==2}" @click="changeTab(2)">
				<i class="iconfont icon-wo"></i>
				<span>我的</span>
			</div>
			<div class="mold_index" v-show="img_active" @click="hideMenu"></div>
		</footer>
	</div>
dl authored
202 203 204
</body>
</html>
<script type="text/javascript" src="../../assets/js/api.js"></script>
dl authored
205
<script type="text/javascript" src="../../assets/js/swiper-3.4.2.min.js"></script>
朱振飞 authored
206
<script type="text/javascript" src="../../assets/js/weui.min.js"></script>
dl authored
207 208
<script type="text/javascript" src="../../assets/js/public.js"></script>
<script type="text/javascript" src="../../assets/js/fastclick.js"></script>
朱振飞 authored
209 210
<script type="text/javascript" src = 'https://webapi.amap.com/maps?v=1.4.4&test=true&key=ef53760bd959a4df08b7d4587280e642&&plugin=AMap.ToolBar,AMap.IndoorMap'></script>
dl authored
211
<script>
朱振飞 authored
212
	new FastClick(document.body);
dl authored
213 214
</script>
<script type="text/javascript" src="../../assets/js/vue.min.js"></script>
朱振飞 authored
215
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
dl authored
216 217
<script type="text/javascript" src="../../assets/js/axios.min.js"></script>
<script>
朱振飞 authored
218 219 220 221 222 223 224 225 226 227 228 229
	new Swiper('.swiper-container', {
		observer: true,
		observeParents: true,
		slidesPerView: 1,
		// autoplayDisableOnInteraction: false,
		loop: true,
		navigation: {
			nextEl: '.change_slide',
		},
		autoHeight: false,
		speed: 1500,
	});
朱振飞 authored
230 231 232 233 234 235 236 237 238 239 240 241
	var app = new Vue({
		el: "#app",
		data: {
			index: 0,
			headerH: '',
			footerH: '',
			getlng: '',
			getlat: '',
			cityindex: '',
			map: {},
			newList: [],
			img_active: false,
朱振飞 authored
242 243 244 245 246 247 248
			mySwiper: {},
			scroll_top: '',
			top_show: false,
			cat_data: [],
			index_data: [],
			show_data: [],
			img_default: '../../assets/image/logo200.png',
朱振飞 authored
249
			cityname: '天津',
朱振飞 authored
250
			rongYunToken: '',
朱振飞 authored
251
			userId: '',
朱振飞 authored
252
			user_info: []
朱振飞 authored
253 254
		},
		created: function () {
朱振飞 authored
255 256 257 258 259 260
		    var cityName = localStorage.getItem('cityName')
		    if(cityName){
		        this.cityname = cityName
            }else{
		        this.get_city()
            }
朱振飞 authored
261
			this.cat(); //首页导航
朱振飞 authored
262 263 264
			this.indexList(); //第三栏
			this.show(); //严选推荐
			// 底部轮播图
kerxins authored
265
            loadEnd()
朱振飞 authored
266 267
		},
		mounted: function () {
朱振飞 authored
268 269
			window.addEventListener('scroll', this.handleScroll)
		},
朱振飞 authored
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
		methods: {
			// 我的消息
			my_news: function () {
				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();
				})
			},
			// 定位当前城市
朱振飞 authored
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
            get_city: function() {
                var app = this ;
                map = new AMap.Map('container', {});
                map.plugin('AMap.Geolocation', function() {
                    var geolocation = new AMap.Geolocation({
                        // 是否使用高精度定位,默认:true
                        enableHighAccuracy: true,
                        // 设置定位超时时间,默认:无穷大
                        timeout: 10000
                    });
                    geolocation.getCurrentPosition();
                    AMap.event.addListener(geolocation, 'complete', onComplete)
                    AMap.event.addListener(geolocation, 'error', onError)
                    function onComplete(data) {
                        // app.cityname = data.addressComponent.province;
                        console.log(app.cityname);
                        app.lng = data.position.lng;
                        app.lat = data.position.lat;
                        app.street = data.addressComponent.street;
                        // console.log(app.lng);
                        // console.log(app.lat);
                        //
                        // // 获取附近地址
                        // app.map = new AMap.Map('container', {});
                        // AMap.service(["AMap.PlaceSearch"], function() {
                        //     var placeSearch = new AMap.PlaceSearch({
                        //         pageSize: 10, // 每页10条
                        //         pageIndex: 1, // 获取第一页
                        //         city: app.cityname // 指定城市名(如果你获取不到城市名称,这个参数也可以不传,注释掉)
                        //     });
                        //
                        //     // 第一个参数是关键字,这里传入的空表示不需要根据关键字过滤
                        //     // 第二个参数是经纬度,数组类型
                        //     // 第三个参数是半径,周边的范围
                        //     // 第四个参数为回调函数
                        //
                        //     placeSearch.searchNearBy(app.cityname, [app.lng, app.lat], 1000, function(status, result) {
                        //
                        //         console.log(JSON.stringify(status))
                        //         if(result.info === 'OK') {
                        //             var locationList = result.poiList.pois; // 周边地标建筑列表
                        //             console.log(locationList)
                        //             app.nearList = locationList          // 生成地址列表html
                        //             //				          createLocationHtml(locationList);
                        //         } else {
                        //             console.log('获取位置信息失败!');
                        //         }
                        //     });
                        // });
                    }
朱振飞 authored
343
朱振飞 authored
344 345 346 347 348 349 350
                    function onError(erro) {
                        console.log(erro)
                        // 定位出错
                        toastMsg('请开启定位功能')
                    }
                })
            },
朱振飞 authored
351 352 353 354 355 356 357

			// 切换底部导航
			changeTab: function (res) {
				//跳转页面
			},
			// 切换当前城市
			goToCity: function () {
朱振飞 authored
358
			    var app = this
朱振飞 authored
359 360 361
				if (app.cityname == '') {
					toastMsg('定位中')
				} else {
朱振飞 authored
362 363 364 365 366 367 368 369 370
			        localStorage.setItem('cityName',app.cityname);
			        window.location.href = '../index/city_f.html';
					// api.openWin({
					// 	name: 'city_win',
					// 	url: '',
					// 	pageParam: {
					// 		cityname: app.cityname
					// 	}
					// });
朱振飞 authored
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394
				}
			},
			// 显示快捷菜单
			show_menu: function () {
				if (app.img_active == false) {
					app.img_active = true
				} else {
					app.img_active = false
				}
			},
			// 隐藏快捷菜单
			hideMenu: function () {
				app.img_active = !app.img_active;
				api.sendEvent({
					name: 'show_menu',
					extra: {
						img_active: app.img_active
					}
				});
			},

			//首页的数据
			// 隐藏菜单
			hideMenu: function () {
朱振飞 authored
395 396 397
				app.img_active = !app.img_active;
			},
			// 严选推荐定位
朱振飞 authored
398
			handleScroll: function () {
朱振飞 authored
399 400
				var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
				var offsetTop = document.querySelector('#main').offsetTop;
朱振飞 authored
401 402
				console.log(scrollTop, offsetTop)
				if (scrollTop > offsetTop) {
朱振飞 authored
403 404 405 406 407 408
					app.top_show = true
				} else {
					app.top_show = false
				}
			},
			// 严选推荐定位
朱振飞 authored
409
			destroyed: function () {
朱振飞 authored
410 411 412
				window.removeEventListener('scroll', this.handleScroll)
			},
			// 打开投资
朱振飞 authored
413
			openStrict: function () {
kerxins authored
414
				window.location.href = '../strict/strict_f.html'
朱振飞 authored
415 416
			},
			// 打开订单
朱振飞 authored
417
			openOrder: function () {
朱振飞 authored
418
				app.img_active = false;
kerxins authored
419
				openView('my_orderlist', '../my/my_orderlist', '我的订单', 'my_orderlist', false, false, false);
朱振飞 authored
420 421 422 423 424 425 426 427
				api.sendEvent({
					name: 'hide_menu',
					extra: {
						img_active: false
					}
				});
			},
			// 打开健康档案
朱振飞 authored
428
			openHealth: function () {
朱振飞 authored
429
				app.img_active = false;
kerxins authored
430
				openWin({
朱振飞 authored
431
					name: 'my_health_w',
kerxins authored
432
					url: '../my/my_health.html',
朱振飞 authored
433 434 435 436 437 438
					pageParam: {
						rid: 0
					}
				});
			},
			// 打开客服
朱振飞 authored
439
			openSever: function () {
朱振飞 authored
440 441 442 443 444
				app.img_active = false;
				app.getRongYunToken();

			},
			// 获取客服token
朱振飞 authored
445
			getRongYunToken: function () {
朱振飞 authored
446 447 448 449
				var header = {
					"XX-Device-Type": getDevice(),
					'XX-Token': getToken()
				};
朱振飞 authored
450 451
				getRequest('post', 'portal/RongYun/index', null, header).then(function (res) {
					if (res.data.code == 1) {
朱振飞 authored
452 453 454 455 456 457 458
						app.rongYunToken = res.data.data.token;
						app.userId = res.data.data.userId;
						// app.rongyunInit();
					} else {}
				})
			},
			// 轮播图跳转详情
朱振飞 authored
459
			care: function (id, care_name) {
朱振飞 authored
460 461 462 463 464 465 466 467 468 469 470
			    window.location.href = 'care_f.html';
                localStorage.setItem('id',id);
                localStorage.setItem('care_name',care_name);
				// api.openWin({
				// 	name: 'care_w',
				// 	url: './care_w.html',
				// 	pageParam: {
				// 		id: id,
				// 		care_name: care_name
				// 	}
				// })
朱振飞 authored
471
			},
朱振飞 authored
472
			getUserIndexInfo: function () {
朱振飞 authored
473 474 475 476
				var header = {
					"XX-Device-Type": getDevice(),
					'XX-Token': getToken()
				};
朱振飞 authored
477
				getRequest('post', 'user/index/getUserIndexInfo', null, header).then(function (res) {
朱振飞 authored
478
					// alert(JSON.stringify(res))
朱振飞 authored
479
					if (res.data.code == 1) {
朱振飞 authored
480 481 482 483 484
						app.user_info = res.data.data;
					} else {}
				})
			},
			// 获取分类图标
朱振飞 authored
485 486 487
			cat: function () {
				getRequest('post', 'portal/index/cat', null, null).then(function (res) {
					if (res.data.code == 1) {
朱振飞 authored
488 489 490 491 492 493
						app.cat_data = res.data.data;
						// loadEnd();
					} else {}
				})
			},
			// 跳转分类列表
朱振飞 authored
494 495
			openItem: function (id, name) {
				switch (id) {
朱振飞 authored
496 497
					case 1:
						url = 'nursing_f'
朱振飞 authored
498 499 500 501
						// openView('nursing_f', 'index/nursing_f', name, 'nursing_f', false, {
						// 	cid: id,
						// 	cityname: app.cityname
						// });
朱振飞 authored
502 503 504
						break;
					case 2:
						url = 'disease_f'
朱振飞 authored
505 506 507 508
						// openView('disease_f', 'index/disease_f', name, 'disease_f', false, {
						// 	cid: id,
						// 	cityname: app.cityname
						// });
朱振飞 authored
509 510 511
						break;
					case 3:
						url = 'disease_f'
朱振飞 authored
512 513 514 515
						// openView('disease_f', 'index/disease_f', name, 'disease_f', false, {
						// 	cid: id,
						// 	cityname: app.cityname
						// });
朱振飞 authored
516 517 518
						break;
					case 4:
						url = 'examination_f'
朱振飞 authored
519 520 521 522
						// openView('examination_f', 'index/examination_f', name, 'examination_f', false, {
						// 	cid: id,
						// 	cityname: app.cityname
						// });
朱振飞 authored
523 524
						break;
					case 5:
朱振飞 authored
525
						url = 'doc_home_f'
朱振飞 authored
526 527 528
						break;
					case 6:
						url = 'disease_f'
朱振飞 authored
529 530 531 532
						// openView('disease_f', 'index/disease_f', name, 'disease_f', false, {
						// 	cid: id,
						// 	cityname: app.cityname
						// });
朱振飞 authored
533 534 535
						break;
					case 7:
						url = 'examination_f'
朱振飞 authored
536 537 538 539
						// openView('examination_f', 'index/examination_f', name, 'examination_f', false, {
						// 	cid: id,
						// 	cityname: app.cityname
						// });
朱振飞 authored
540 541 542
						break;
					case 8:
						url = 'examination_f'
朱振飞 authored
543 544 545 546
						// openView('examination_f', 'index/examination_f', name, 'examination_f', false, {
						// 	cid: id,
						// 	cityname: app.cityname
						// });
朱振飞 authored
547 548 549
						break;
					case 9:
						url = 'examination_f'
朱振飞 authored
550 551 552 553 554 555 556 557
						// api.openWin({
						// 	name: 'Insurance_w',
						// 	url: './Insurance_w.html',
						// 	pageParam: {
						// 		cid: id,
						// 		cityname: app.cityname
						// 	}
						// });
朱振飞 authored
558 559
						break;
					case 10:
朱振飞 authored
560
						url = 'tral_f'
朱振飞 authored
561 562 563 564 565 566 567 568
						// api.openWin({
						// 	name: 'tral_w',
						// 	url: './tral_w.html',
						// 	pageParam: {
						// 		cid: id,
						// 		cityname: app.cityname
						// 	}
						// }); 
朱振飞 authored
569 570 571 572 573
						break;
						// default:
						//     openView('nursing_f', 'index/nursing_f', name, 'nursing_f', false, {cid: id});
						//     return;
				}
朱振飞 authored
574 575 576 577
				localStorage.setItem('cid', id)
				localStorage.setItem('cityName', app.cityname)
				localStorage.setItem('winTitle', name)
				window.location.href = url + '.html'
朱振飞 authored
578 579
			},
			// 获取第三栏列表
朱振飞 authored
580 581 582
			indexList: function () {
				getRequest('post', 'portal/index/index', null, null).then(function (res) {
					if (res.data.code == 1) {
朱振飞 authored
583 584
						app.index_data = res.data.data;
					} else {}
朱振飞 authored
585
朱振飞 authored
586 587 588
				})
			},
			// 获取严选推荐列表
朱振飞 authored
589 590
			show: function () {
				getRequest('POST', 'portal/index/show', null, null).then(function (res) {
朱振飞 authored
591
					// alert(JSON.stringify(res));
朱振飞 authored
592
					if (res.data.code == 1) {
朱振飞 authored
593 594 595 596 597
						app.show_data = res.data.data
					} else {}
				})
			},
			//底部菜单跳转
朱振飞 authored
598 599
			changeTab(index) {
				var url = index == 0 ? 'index_f.html' : index == 1 ? '../strict/strict_f.html' : '../my/my_f.html'
朱振飞 authored
600 601 602
				window.location.href = url
			}
朱振飞 authored
603 604
		}
	})
dl authored
605
</script>