| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943 | 
							- <!DOCTYPE html>
 
- <html>
 
- 	<head>
 
- 		<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>
 
- 		<link rel="stylesheet" type="text/css" href="../css/api.css" />
 
- 		<link rel="stylesheet" type="text/css" href="../css/star-rating-svg.css?v=1.2" />
 
- 		<link rel="stylesheet" type="text/css" href="../css/weui.min.css" />
 
- 		<link rel="stylesheet" type="text/css" href="../css/style.css" />
 
- 		<link rel="stylesheet" type="text/css" href="../css/swiper.min.css" />
 
- 		<style>
 
- 			.swiper-container {
 
-           width: 100%;
 
-           height: 100%;
 
-         }
 
-         .swiper-slide img{
 
-           width:100%;
 
-           height:100%;
 
-         }
 
-         .home-hotel-title {
 
-             font-size: 0.27rem;
 
-             overflow: hidden;
 
-             white-space: nowrap;
 
-             text-overflow: ellipsis;
 
-             color: #000;
 
-             font-weight: 700;
 
-         }
 
-         .home-hotel-list {
 
-             margin-bottom: 0.2rem;
 
-         }
 
-         .msg-list,.scan-barcode{
 
-           position:absolute;
 
-           /*width: 1rem;*/
 
-           text-align:center;
 
-         }
 
-         .home-top-left {
 
-             padding-top: 0.1rem;
 
-             float: left;
 
-             line-height: 0;
 
-         }
 
-         .home-hotel-right { /*width: 4.2rem;*/ }
 
-         .home-hotel-dsc {
 
-             font-size: 0.24rem;
 
-             line-height: 0.34rem;
 
-         }
 
-         .swiper-container-horizontal>.swiper-pagination-bullets, .swiper-pagination-custom, .swiper-pagination-fraction {
 
-             bottom: 0;
 
-         }
 
-         .swiper-pagination-bullet {
 
-             background: #fff;
 
-             opacity: .8;
 
-         }
 
-         .swiper-pagination-bullet-active {
 
-             background: #d9251c;
 
-         }
 
-         .home-nearby:before {
 
-             content: ' ';
 
-             position: absolute;
 
-             pointer-events: none;
 
-             box-sizing: border-box;
 
-             /*top: -50%;*/
 
-             left: -50%;
 
-             right: -50%;
 
-             bottom: 0;
 
-             -webkit-transform: scale(0.5);
 
-             transform: scale(0.5);
 
-             border-bottom: 1px solid #ddd;
 
-         }
 
-         .border-none{
 
-           text-align: center;
 
-           font-size: 0.28rem;
 
-           height: 8rem;
 
-         }
 
-         .border-none p{
 
-           color:#999999;
 
-         }
 
-         .border-none-img{
 
-             margin-top: 1.5rem;
 
-             width: 1.73rem;
 
-             height: auto;
 
-         }
 
-         .home-nearby .weui-cell {
 
-             padding: 16px 3px;
 
-         }
 
-         .home-nearby weui-cell__bd p {
 
-             font-size: 0.35rem;
 
-         }
 
-         .home-top-left {
 
-             width: 4.9rem;
 
-         }
 
-         .local-name {
 
-             width: 4.2rem;
 
-         }
 
-         .weui-cell__ft {
 
-             font-size: 0.25rem;
 
-         }
 
-         .home-hotel-left img {
 
-             height: auto;
 
-         }
 
-         .home-hotel-dsc {
 
-             -webkit-line-clamp: 1;
 
-         }
 
-         .hotel_credit {
 
-             font-size: 0.47rem;
 
-             position: absolute;
 
-             margin-top: -0.2rem;
 
-             color: #000000;
 
-             font-family: Medium;
 
-             font-weight: 500;
 
-         }
 
-         .hotel_credit:after {
 
-             position: absolute;
 
-             top: 0.45rem;
 
-             width: 100%;
 
-             height: 0.13rem;
 
-             content: "";
 
-             /*background: #ffdb26;*/
 
-             margin-left: -100%;
 
-             z-index: -1;
 
-         }
 
-         .tag-item {
 
-             position: relative;
 
-             margin: 1px 0.08rem;
 
-             padding: 0rem 0.1rem;
 
-             display: inline-block;
 
-             line-height: 1.5;
 
-             /* margin-left: 0; */
 
-             margin-right: 0;
 
-             font-size: 0.2rem;
 
-         }
 
-         .tag-item:first-child {
 
-             margin-left: 0;
 
-         }
 
-         .tag-item:after {
 
-             position: absolute;
 
-             box-sizing: border-box;
 
-             content: ' ';
 
-             pointer-events: none;
 
-             top: -50%;
 
-             right: -50%;
 
-             bottom: -50%;
 
-             left: -50%;
 
-             border: 1px solid #222;
 
-             -webkit-transform: scale(0.5);
 
-             transform: scale(0.5);
 
-             border-radius: 0.08rem;
 
-         }
 
-     </style>
 
- 		<script>
 
- 			(function(window) {
 
- 				var winW = document.documentElement.clientWidth || document.body.clientWidth;
 
- 				if (winW > 750) {
 
- 					winW = 750;
 
- 				}
 
- 				document.documentElement.style.fontSize = winW / 7.5 + "px";
 
- 				window.onresize = function() {
 
- 					var winW = document.documentElement.clientWidth || document.body.clientWidth;
 
- 					document.body.clientWidth;
 
- 					if (winW > 750) {
 
- 						winW = 750;
 
- 					}
 
- 					document.documentElement.style.fontSize = winW / 7.5 + "px";
 
- 				}
 
- 			}(window));
 
- 		</script>
 
- 	</head>
 
- 	<body>
 
- 		<div class="topbar"></div>
 
- 		<section>
 
- 			<div style="position: fixed;width: 6.9rem;margin-left: -1px;z-index: 2;background: #fff;">
 
- 				<div class="home-top" style="padding: 0.1rem 0;">
 
- 					<div class="home-top-left"><img id="set-local" class="home-top-local" src="../image/home_local.png" /> <span class="local-name"> 正在搜索您附近的酒店</span></div>
 
- 					<div class="home-top-right" style="margin-top: -0.05rem;">
 
- 						<div class="scan-barcode" style="right: 1rem;"><img class="home-top-local" src="../image/home_scan.png" />
 
- 							<p>扫一扫</p>
 
- 						</div>
 
- 						<div class="msg-list" style="right: 0.2rem;"><img class="home-top-local" src="../image/home_msg.png" />
 
- 							<p>消息</p><span class="msg-total mask-hidden" style="position: absolute;top: 0;">0</span>
 
- 						</div>
 
- 					</div>
 
- 				</div>
 
- 				<div class="home-search" style="margin-bottom: 0.2rem;"><img src="../image/search.png"> 搜索您入住的酒店</div>
 
- 			</div>
 
- 			<div class="h10" style="height: 1.6rem;"></div>
 
- 			<div class="home-ads" style="border-radius: 0.1rem;">
 
- 				<div class="swiper-container" style="border-radius: 0.1rem;">
 
- 					<div class="swiper-wrapper">
 
- 					</div>
 
- 					<div class="swiper-pagination"></div>
 
- 				</div>
 
- 			</div>
 
- 			<div class="home-nearby">
 
- 				<div class="weui-cell" style="padding-bottom: 0;">
 
- 					<div class="weui-cell__bd">
 
- 						<p style="color: #000;font-weight: 700;font-size: 0.33rem;">附近酒店</p>
 
- 					</div>
 
- 					<div class="weui-cell__ft">在此找到您入住的酒店</div>
 
- 				</div>
 
- 			</div>
 
- 		</section>
 
- 		<section>
 
- 			<div id="hotel-list">
 
- 				<div class="home-hotel-list">
 
- 				</div>
 
- 			</div>
 
- 		</section>
 
- 		<section class="border-none mask-hidden">
 
- 			<img src="../image/no_lon.png" class="border-none-img" />
 
- 			<p>定位失败<br>请在手机上打开位置信息<br>或直接搜索当前入住的酒店</p>
 
- 		</section>
 
- 		<div class="h50"></div>
 
- 		<div class="back-top mask-hidden" id="fix1"></div>
 
- 	</body>
 
- 	<script type="text/javascript" src="../script/api.js"></script>
 
- 	<script type="text/javascript" src="../script/swiper.min.js"></script>
 
- 	<script type="text/javascript" src="../script/jquery.min.js"></script>
 
- 	<script type="text/javascript" src="../script/jquery.tap.js"></script>
 
- 	<script type="text/javascript" src="../script/imagesloaded.pkgd.min.js"></script>
 
- 	<script type="text/javascript" src="../script/jquery.star-rating-svg.js"></script>
 
- 	<script type="text/javascript">
 
- 		var _myalias = '';
 
- 		var _minid = '';
 
- 		var _lon = '0';
 
- 		var _lat = '0';
 
- 		var _page = '1';
 
- 		var _isload = false;
 
- 		var _isrefurbish = false;
 
- 		var _adv_type = '0';
 
- 		var _adv_goods_id = '0';
 
- 		var _adv_store_id = '0';
 
- 		var _adv_article_id = '0';
 
- 		var _webinkeyid = '0';
 
- 		var _webinstoreid = '0';
 
- 		apiready = function() {
 
- 			_webinkeyid = api.pageParam.keyid;
 
- 			_webinstoreid = api.pageParam.storeid;
 
- 			_adv_type = api.pageParam.advtype;
 
- 			_adv_goods_id = api.pageParam.advgoodsid;
 
- 			_adv_store_id = api.pageParam.advstoreid;
 
- 			_adv_article_id = api.pageParam.advarticleid;
 
- 			get_adv();
 
- 			getRouteData();
 
- 			webtoappinit();
 
- 			_myalias = "member" + $api.getStorage("memberid");
 
- 			jpushInit();
 
- 			var storage = hasPermission('storage');
 
- 			if (!storage || !storage[0] || !storage[0].granted) {
 
- 				reqPermission('storage')
 
- 			}
 
- 			var hass = hasPermission('location');
 
- 			if (!hass || !hass[0] || !hass[0].granted) {
 
- 				reqPermission('location');
 
- 			}
 
- 			//滑动到底部
 
- 			api.addEventListener({
 
- 				name: 'scrolltobottom'
 
- 			}, function(ret, err) {
 
- 				getAddress();
 
- 			});
 
- 			//应用从后台回到前台事件
 
- 			api.addEventListener({
 
- 				name: 'resume'
 
- 			}, function(ret, err) {
 
- 				_isload = false;
 
- 				_minid = '';
 
- 				_isrefurbish = true;
 
- 				getAddress();
 
- 				getmsgtotal();
 
- 			});
 
- 			//应用每次显示
 
- 			api.addEventListener({
 
- 				name: 'viewappear'
 
- 			}, function(ret, err) {
 
- 				getAddress();
 
- 				getmsgtotal();
 
- 			});
 
- 			setTimeout(function() {
 
- 				goto_adv();
 
- 			}, 800);
 
- 		};
 
- 		$(".msg-list").on("tap", function() {
 
- 			api.openWin({
 
- 				name: 'msglist',
 
- 				url: './home/msglist.html',
 
- 				bounces: false,
 
- 				pageParam: {
 
- 					xx: ''
 
- 				}
 
- 			});
 
- 			return false;
 
- 		})
 
- 		$("#hotel-list").on("tap", ".home-hotel-list", function() {
 
- 			var _keyid = $(this).attr("keyid");
 
- 			api.openWin({
 
- 				name: 'hoteldtl',
 
- 				url: './home/hoteldtl.html',
 
- 				bounces: false,
 
- 				pageParam: {
 
- 					keyid: _keyid
 
- 				}
 
- 			});
 
- 			return false;
 
- 		})
 
- 		$(".scan-barcode").on("tap", function() {
 
- 			var has = hasPermission('camera');
 
- 			if (!has || !has[0] || !has[0].granted) {
 
- 				api.confirm({
 
- 					title: '提醒',
 
- 					msg: "没有获得 相机 权限\n是否前往设置?",
 
- 					buttons: ['去设置', '取消']
 
- 				}, function(ret, err) {
 
- 					var index = ret.buttonIndex;
 
- 					if (index == 1) {
 
- 						reqPermission('camera');
 
- 					} else {
 
- 						api.toast({
 
- 							msg: '获取相机权限失败...'
 
- 						});
 
- 					}
 
- 				});
 
- 				return false;
 
- 			}
 
- 			var FNScanner = api.require('FNScanner');
 
- 			FNScanner.open({
 
- 				autorotation: true
 
- 			}, function(ret, err) {
 
- 				toast_loding_show();
 
- 				if (ret) {
 
- 					// alert(JSON.stringify(ret));
 
- 					if (ret.eventType == "success") {
 
- 						if (ret.content.indexOf("?store_id=") > -1) {
 
- 							var _store_id = ret.content.split("?")[1];
 
- 							_store_id = _store_id.split("&")[0];
 
- 							_store_id = _store_id.replace("store_id=", "");
 
- 							// alert(_store_id);
 
- 							if (ret.content.indexOf("goods_id=") > -1) {
 
- 								var _goods_id = ret.content.split("?")[1];
 
- 								_goods_id = _goods_id.split("&")[1];
 
- 								_goods_id = _goods_id.replace("goods_id=", "");
 
- 								// alert(_goods_id);
 
- 								api.openWin({
 
- 									name: 'showgoods',
 
- 									url: './home/showgoods.html',
 
- 									bounces: false,
 
- 									pageParam: {
 
- 										storeid: _store_id,
 
- 										keyid: _goods_id
 
- 									}
 
- 								});
 
- 							} else {
 
- 								//
 
- 								api.openWin({
 
- 									name: 'hoteldtl',
 
- 									url: './home/hoteldtl.html',
 
- 									bounces: false,
 
- 									pageParam: {
 
- 										keyid: _store_id
 
- 									}
 
- 								});
 
- 							}
 
- 						} else {
 
- 							$api.rmStorage("qr_data");
 
- 							$api.setStorage("qr_data", ret.content);
 
- 							$.ajax({
 
- 								url: siteurl + 'api/Payment/get_order_info',
 
- 								data: {
 
- 									member_id: $api.getStorage("memberid"),
 
- 									qr_data: ret.content
 
- 								},
 
- 								headers: {
 
- 									"X-TOKEN": $api.getStorage("accesstoken")
 
- 								},
 
- 								dataType: 'json',
 
- 								type: 'post',
 
- 								success: function(datas) {
 
- 									if (datas.code === 1) {
 
- 										api.openWin({
 
- 											name: 'venderdtl',
 
- 											url: './home/vender.html',
 
- 											bounces: false,
 
- 											pageParam: {
 
- 												keyid: datas.data.order_sn
 
- 											}
 
- 										});
 
- 										return false;
 
- 									} else {
 
- 										api.toast({
 
- 											msg: datas.msg,
 
- 											duration: 2000,
 
- 											location: 'bottom'
 
- 										});
 
- 									}
 
- 								},
 
- 								error: function() {
 
- 									api.toast({
 
- 										msg: '扫码失败'
 
- 									})
 
- 								}
 
- 							})
 
- 						}
 
- 					}
 
- 				} else {
 
- 					api.toast({
 
- 						msg: "扫码失败"
 
- 					})
 
- 				}
 
- 				toast_loding_hide();
 
- 			});
 
- 			return false;
 
- 		})
 
- 		function getRouteData() {
 
- 			$.ajax({
 
- 				url: siteurl + 'v1/entry/adv',
 
- 				data: {},
 
- 				headers: {
 
- 					"X-TOKEN": $api.getStorage("accesstoken")
 
- 				},
 
- 				dataType: 'json',
 
- 				type: 'post',
 
- 				success: function(datas) {
 
- 					if (datas.result) {
 
- 						$.each(datas.data, function(index, item) {
 
- 							if (item.adv_enabled == 1) {
 
- 								if (item.adv_target.type == 'store') {
 
- 									$(".swiper-wrapper").append('<div class="swiper-slide" type="store" keyid="' + item.adv_target.store_id +
 
- 										'"><img src="' + siteurl + "uploads/home/adv/" + item.adv_code + '"/></div>');
 
- 								} else if (item.adv_target.type == 'goods') {
 
- 									$(".swiper-wrapper").append('<div class="swiper-slide" type="goods" keyid="' + item.adv_target.goods_id +
 
- 										'" xkeyid="' + item.adv_target.store_id + '"><img src="' + siteurl + "uploads/home/adv/" + item.adv_code +
 
- 										'"/></div>');
 
- 								} else if (item.adv_target.type == 'article') {
 
- 									$(".swiper-wrapper").append('<div class="swiper-slide" type="article" keyid="' + item.adv_target.article_id +
 
- 										'"><img src="' + siteurl + "uploads/home/adv/" + item.adv_code + '"/></div>');
 
- 								} else {
 
- 									$(".swiper-wrapper").append('<div class="swiper-slide" type="0" keyid="0"><img src="' + siteurl +
 
- 										"uploads/home/adv/" + item.adv_code + '"/></div>');
 
- 								}
 
- 							} else {
 
- 								$(".swiper-wrapper").append('<div class="swiper-slide" type="0" keyid="0"><img src="' + siteurl +
 
- 									"uploads/home/adv/" + item.adv_code + '"/></div>');
 
- 							}
 
- 						});
 
- 						var swiper = new Swiper('.swiper-container', {
 
- 							allowSlidePrev: true,
 
- 							autoplay: {
 
- 								delay: 5000,
 
- 								disableOnInteraction: false
 
- 							},
 
- 							loop: true,
 
- 							pagination: {
 
- 								el: '.swiper-pagination',
 
- 							},
 
- 							on: {
 
- 								transitionEnd: function() {
 
- 									var tempSlideWidth = $(".swiper-slide").width();
 
- 									$(".swiper-slide").css("width", tempSlideWidth);
 
- 									$(".swiper-slide-active").css("width", (tempSlideWidth + 1));
 
- 								}
 
- 							}
 
- 						});
 
- 					} else {
 
- 						errcode(datas, datas.code);
 
- 					}
 
- 				}
 
- 			});
 
- 			function_name();
 
- 		}
 
- 		function set_height() {
 
- 			api.execScript({
 
- 				name: 'index',
 
- 				script: 'set_height();'
 
- 			})
 
- 		}
 
- 		function getmsgtotal() {
 
- 			$.ajax({
 
- 				url: siteurl + 'v2/shop/msg_count',
 
- 				data: {
 
- 					member_id: $api.getStorage("memberid")
 
- 				},
 
- 				headers: {
 
- 					"X-TOKEN": $api.getStorage("accesstoken")
 
- 				},
 
- 				dataType: 'json',
 
- 				type: 'post',
 
- 				success: function(datas) {
 
- 					if (datas.result) {
 
- 						if (datas.data.total > 0) {
 
- 							$(".msg-total").text(datas.data.total);
 
- 							$(".msg-total").removeClass('mask-hidden');
 
- 						} else {
 
- 							$(".msg-total").addClass('mask-hidden');
 
- 						}
 
- 					} else {
 
- 						if (datas.code == 2000) {} else {
 
- 							errcode(datas, datas.code);
 
- 						}
 
- 					}
 
- 				}
 
- 			});
 
- 		}
 
- 		function get_advx() {
 
- 			api.execScript({
 
- 				name: 'index',
 
- 				script: 'get_adv();'
 
- 			})
 
- 		}
 
- 		function goto_adv() {
 
- 			// body...
 
- 			switch (_adv_type) {
 
- 				case 'goods':
 
- 					console.log(_adv_goods_id, _adv_store_id)
 
- 					to_goods_id(_adv_goods_id, _adv_store_id)
 
- 					break;
 
- 				case 'store':
 
- 					console.log(_adv_store_id);
 
- 					to_store_id(_adv_store_id);
 
- 					break;
 
- 				case 'article':
 
- 					console.log(_adv_article_id);
 
- 					to_article_id(_adv_article_id);
 
- 					break;
 
- 			}
 
- 		}
 
- 		function get_adv() {
 
- 			$.ajax({
 
- 				url: siteurl + 'v1/entry/poster',
 
- 				data: {},
 
- 				headers: {
 
- 					"X-TOKEN": $api.getStorage("accesstoken")
 
- 				},
 
- 				dataType: 'json',
 
- 				type: 'post',
 
- 				success: function(datas) {
 
- 					if (datas.result) {
 
- 						if (datas.data.enable == 1) {
 
- 							switch (datas.data.target.type) {
 
- 								case 'point':
 
- 									if ($api.getStorage("accesstoken")) {
 
- 										gallery_adv(siteurl + 'uploads/home/adv/' + datas.data.images, 'to_point');
 
- 									} else {
 
- 										gallery_adv(siteurl + 'uploads/home/adv/' + datas.data.images, 'to_login');
 
- 									}
 
- 									break;
 
- 								case 'goods':
 
- 									gallery_adv(siteurl + 'uploads/home/adv/' + datas.data.images, 'to_goods_id', datas.data.target.goods_id,
 
- 										datas.data.target.store_id);
 
- 									break;
 
- 								case 'store':
 
- 									gallery_adv(siteurl + 'uploads/home/adv/' + datas.data.images, 'to_store_id', datas.data.target.store_id);
 
- 									break;
 
- 								case 'article':
 
- 									gallery_adv(siteurl + 'uploads/home/adv/' + datas.data.images, 'to_article_id', datas.data.target.article_id);
 
- 									break;
 
- 							}
 
- 						}
 
- 					} else {
 
- 						errcode(datas, datas.code);
 
- 					}
 
- 					set_height();
 
- 				}
 
- 			})
 
- 		}
 
- 		function getRouteHotelData() {
 
- 			if (_lon == '0') {
 
- 				$(".border-none").removeClass("mask-hidden");
 
- 				return false;
 
- 			} else {
 
- 				$(".border-none").addClass("mask-hidden");
 
- 			}
 
- 			if (_isload) {
 
- 				return false;
 
- 			}
 
- 			console.log(_page,_minid);
 
- 			$.ajax({
 
- 				url: siteurl + 'v2/entry/storeList',
 
- 				data: {
 
- 					page: _page,
 
- 					page_size:'8',
 
- 					minid: _minid,
 
- 					lon: _lon,
 
- 					lat: _lat
 
- 				},
 
- 				headers: {
 
- 					"X-TOKEN": $api.getStorage("accesstoken")
 
- 				},
 
- 				dataType: 'json',
 
- 				type: 'post',
 
- 				success: function(datas) {
 
- 					if (datas.result) {
 
- 						var i = 0;
 
- 						if (datas.data.store_list.length > 0) {
 
- 							var html = '<div class="h20"></div>';
 
- 							$.each(datas.data.store_list, function(index, item) {
 
- 								var _tags_0 = item.store_summary.split(' ');
 
- 								_tags_0 = jQuery.grep(_tags_0, function(a) {
 
- 									return a !== '';
 
- 								});
 
- 								html += '<div class="home-hotel-list" keyid="' + item.store_id +
 
- 									'"><div class="home-hotel-left"><img src="' + siteurl + 'uploads/home/store/' + item.store_id + '/' +
 
- 									item.store_banner + '"/></div>';
 
- 								html += '<div class="home-hotel-right"><div class="home-hotel-title">' + item.store_name + '</div>';
 
- 								html += '<div class="home-hotel-dtl"><ul><li style="width:40%"><div class="hotel_credit my-rating' + i +
 
- 									'">' + intToFloat(item.store_servicecredit) + '</div></li>';
 
- 								html += '<li style="text-align:center;"> 月访客' + item.store_visitor + '</li><li style="float:right;"> ' +
 
- 									item.distance + '</li>';
 
- 								html += '</ul></div>';
 
- 								html += '<div class="home-hotel-dsc">';
 
- 								$.each(_tags_0, function(index, tag) {
 
- 									if (index < 3) {
 
- 										html += '<span class="tag-item">' + tag + '</span>';
 
- 									}
 
- 								})
 
- 								html += '</div></div></div>';
 
- 								i++;
 
- 							});
 
- 							if (_page == 1) {
 
- 								$("#hotel-list").html(html);
 
- 								$(".border-none").addClass("mask-hidden");
 
- 								$("#hotel-list").removeClass("mask-hidden");
 
- 							} else {
 
- 								$("#hotel-list").append(html);
 
- 							}
 
- 							_page++;
 
- 						} else {
 
- 							if (_page == 1) {
 
- 								$(".border-none").removeClass("mask-hidden");
 
- 								$("#hotel-list").addClass("mask-hidden");
 
- 							}
 
- 							_isload = true;
 
- 						}
 
- 					} else {
 
- 						errcode(datas, datas.code);
 
- 					}
 
- 					function_name();
 
- 				}
 
- 			});
 
- 		}
 
- 		$(".home-search").on("tap", function() {
 
- 			api.openWin({
 
- 				name: 'hotelsearch',
 
- 				url: './home/hotelsearch.html',
 
- 				bounces: false,
 
- 				pageParam: {
 
- 					lon: _lon,
 
- 					lat: _lat
 
- 				}
 
- 			});
 
- 			return false;
 
- 		})
 
- 		$(".swiper-wrapper").on("tap", ".swiper-slide", function() {
 
- 			var _type = $(this).attr("type");
 
- 			var _keyid = $(this).attr("keyid");
 
- 			if (_type == 'store') {
 
- 				to_store_id(_keyid);
 
- 			} else if (_type == 'goods') {
 
- 				var _sid = $(this).attr("xkeyid");
 
- 				to_goods_id(_keyid, _sid);
 
- 			} else if (_type == 'article') {
 
- 				to_article_id(_keyid);
 
- 			} else {
 
- 				api.toast({
 
- 					msg: '暂无活动'
 
- 				})
 
- 			}
 
- 			return false;
 
- 		})
 
- 		function intToFloat(val) {
 
- 			return new Number(val).toFixed(1);
 
- 		}
 
- 		function to_login() {
 
- 			// body...
 
- 			api.openWin({
 
- 				name: 'login',
 
- 				url: 'widget://login.html',
 
- 				bounces: false,
 
- 				pageParam: {
 
- 					keyid: true
 
- 				}
 
- 			})
 
- 			$('.weui-gallery').hide();
 
- 			return false;
 
- 		}
 
- 		function to_point() {
 
- 			// body...
 
- 			api.openWin({
 
- 				name: 'points',
 
- 				url: './my/points.html',
 
- 				bounces: false
 
- 			});
 
- 			$('.weui-gallery').hide();
 
- 			return false;
 
- 		}
 
- 		function to_article_id(_to_article_id) {
 
- 			// body...
 
- 			api.openWin({
 
- 				name: 'finddetails',
 
- 				url: './find/finddetails.html',
 
- 				bounces: false,
 
- 				pageParam: {
 
- 					keyid: _to_article_id
 
- 				}
 
- 			});
 
- 			$('.weui-gallery').hide();
 
- 			return false;
 
- 		}
 
- 		function to_goods_id(_to_goods_id, _to_storeid) {
 
- 			// body...
 
- 			api.openWin({
 
- 				name: 'showgoods',
 
- 				url: './home/showgoods.html',
 
- 				bounces: false,
 
- 				pageParam: {
 
- 					keyid: _to_goods_id,
 
- 					storeid: _to_storeid
 
- 				}
 
- 			});
 
- 			$('.weui-gallery').hide();
 
- 			return false;
 
- 		}
 
- 		function to_store_id(_to_storeid) {
 
- 			// body...
 
- 			api.openWin({
 
- 				name: 'hoteldtl',
 
- 				url: './home/hoteldtl.html',
 
- 				bounces: false,
 
- 				pageParam: {
 
- 					keyid: _to_storeid
 
- 				}
 
- 			});
 
- 			$('.weui-gallery').hide();
 
- 			return false;
 
- 		}
 
- 		$("#set-local").on("tap", function() {
 
- 			$(this).attr("src", "../image/home_local2.png");
 
- 			var _that = $(this);
 
- 			setTimeout(function() {
 
- 				_that.attr("src", "../image/home_local.png");
 
- 			}, 800);
 
- 			api.toast({
 
- 				msg: '正在获取当前位置...'
 
- 			});
 
- 			getAddress();
 
- 		})
 
- 		function getAddress() {
 
- 			var has = hasPermission('location');
 
- 			if (!has || !has[0] || !has[0].granted) {
 
- 				reqPermission('location');
 
- 				$(".border-none").removeClass("mask-hidden");
 
- 				return false;
 
- 			} else {
 
- 				var aMap = api.require('aMap');
 
- 				if (api.systemType == 'ios') {
 
- 					aMap.hide();
 
- 					aMap.open({
 
- 						rect: {
 
- 							x: 0,
 
- 							y: 0,
 
- 							w: 0,
 
- 							h: 0
 
- 						},
 
- 						showUserLocation: true,
 
- 						zoomLevel: 11,
 
- 						center: {
 
- 							lon: 116.4021310000,
 
- 							lat: 39.9994480000
 
- 						},
 
- 						fixedOn: api.frameName,
 
- 						fixed: true
 
- 					}, function(ret, err) {})
 
- 				}
 
- 				aMap.getLocation(function(ret, err) {
 
- 					if (ret.status) {
 
- 						_lon = ret.lon;
 
- 						_lat = ret.lat;
 
- 						getRouteHotelData();
 
- 						aMap.getNameFromCoords({
 
- 							lon: ret.lon,
 
- 							lat: ret.lat
 
- 						}, function(ret, err) {
 
- 							if (ret.status) {
 
- 								aMap.close();
 
- 								$(".local-name").text(ret.city + ret.township + ret.street + ret.number);
 
- 							}
 
- 						});
 
- 					} else {
 
- 						$(".local-name").text(JSON.stringify(err));
 
- 					}
 
- 				});
 
- 			}
 
- 		}
 
- 		function jpushInit() {
 
- 			jpush = api.require('ajpush');
 
- 			initJPush();
 
- 			api.addEventListener({
 
- 				name: 'noticeclicked'
 
- 			}, function(ret, err) { //ios noticeclicked
 
- 				var _value = ret.value.replace(/\\/g, "");
 
- 				var obj = eval('(' + _value + ')');
 
- 				if (obj.jump == "urge") {
 
- 					api.openWin({
 
- 						name: 'msglist',
 
- 						url: './home/msglist.html',
 
- 						bounces: false
 
- 					});
 
- 				}
 
- 				if (obj.jump == "article") {
 
- 					api.openWin({
 
- 						name: 'finddetails',
 
- 						url: './find/finddetails.html',
 
- 						bounces: false,
 
- 						pageParam: {
 
- 							keyid: obj.keyid
 
- 						}
 
- 					});
 
- 				}
 
- 			})
 
- 			api.addEventListener({
 
- 				name: 'pause'
 
- 			}, function(ret, err) {
 
- 				onPause(); //监听应用进入后台,通知jpush暂停事件
 
- 			})
 
- 			api.addEventListener({
 
- 				name: 'resume'
 
- 			}, function(ret, err) {
 
- 				onResume(); //监听应用恢复到前台,通知jpush恢复事件
 
- 			})
 
- 			jpush.setListener(function(ret, err) {
 
- 				if (ret) {
 
- 					notify(ret.content, ret.extra);
 
- 				}
 
- 			});
 
- 		}
 
- 		/////
 
- 		function initJPush() {
 
- 			jpush.init(function(ret, err) {
 
- 				if (ret && ret.status) {
 
- 					bindAliasAndTags();
 
- 				} else {
 
- 					api.toast({
 
- 						msg: '操作失败!'
 
- 					});
 
- 				}
 
- 			});
 
- 		}
 
- 		//统计-app恢复
 
- 		function onResume() {
 
- 			jpush.onResume();
 
- 		}
 
- 		//统计-app暂停
 
- 		function onPause() {
 
- 			jpush.onPause();
 
- 		}
 
- 		function bindAliasAndTags() {
 
- 			var param = {
 
- 				alias: _myalias,
 
- 				tags: ['tag1', 'qdduser']
 
- 			};
 
- 			jpush.bindAliasAndTags(param, function(ret) {
 
- 				var statusCode = ret.statusCode;
 
- 				// alert(JSON.stringify(ret));
 
- 			});
 
- 		}
 
- 		function notify(content, extras) {
 
- 			getmsgtotal();
 
- 			api.notification({
 
- 				vibrate: [100, 500, 200, 500, 300, 500],
 
- 				sound: 'widget://res/horse.ogg',
 
- 				notify: {
 
- 					title: '您有一条新的消息...',
 
- 					content: content,
 
- 					extra: extras,
 
- 					updateCurrent: false
 
- 				}
 
- 			}, function(ret, err) {});
 
- 		}
 
- 		function webtoappinit() {
 
- 			if (_webinkeyid) {
 
- 				to_goods_id(_webinkeyid, _webinstoreid);
 
- 				return false;
 
- 			}
 
- 			if (_webinstoreid) {
 
- 				to_store_id(_webinstoreid);
 
- 				return false;
 
- 			}
 
- 		}
 
- 		$(".back-top").on("tap", function() {
 
- 			$('html , body').animate({
 
- 				scrollTop: 0
 
- 			}, 'slow');
 
- 			return false;
 
- 		});
 
- 		$.fn.fixedDiv = function(actCls) {
 
- 			var that = $(this),
 
- 				offsetTop = that.offset().top,
 
- 				scrollTop;
 
- 			function fix() {
 
- 				scrollTop = $(document).scrollTop();
 
- 				if (scrollTop > offsetTop) {
 
- 					that.removeClass(actCls);
 
- 				} else {
 
- 					that.addClass(actCls);
 
- 				}
 
- 			}
 
- 			fix();
 
- 			$(window).scroll(fix);
 
- 		}
 
- 		$('#fix1').fixedDiv('mask-hidden')
 
- 	</script>
 
- </html>
 
 
  |