hoteldtl.html 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <title></title>
  8. <link rel="stylesheet" type="text/css" href="../../css/api.css" />
  9. <link rel="stylesheet" type="text/css" href="../../css/swiper.min.css" />
  10. <link rel="stylesheet" type="text/css" href="../../css/weui.min.css" />
  11. <link rel="stylesheet" type="text/css" href="../../css/star-rating-svg.css?v=1.2" />
  12. <link rel="stylesheet" type="text/css" href="../../css/iconfont.css" />
  13. <link rel="stylesheet" type="text/css" href="../../css/style.css?v=1.2" />
  14. <style>
  15. .feed-item{
  16. width: 99%;
  17. border-bottom:1px solid #e8e8e8;
  18. position:relative;
  19. padding-top: 0.2rem;
  20. }
  21. .feed-item ul{
  22. width:100%;
  23. clear: both;
  24. }
  25. .fl {
  26. float:left;
  27. }
  28. .feed-item-right{
  29. padding-left: 0.2rem;
  30. }
  31. .feed-item-titel{
  32. font-size: 0.24rem;
  33. color: #999;
  34. padding: 0.2rem 0;
  35. }
  36. .user-head{
  37. width: 0.7rem;
  38. height: 0.7rem;
  39. border-radius:50%;
  40. }
  41. .feed-img{
  42. float: left;
  43. width: 1.2rem;
  44. height: 1.2rem;
  45. padding-right: 0.3rem;
  46. }
  47. .my-rating{
  48. position:absolute;
  49. right: 0;
  50. top: 0.2rem;
  51. }
  52. .my-rating .jq-star {
  53. width: 0.3rem !important;
  54. height: 0.3rem !important;
  55. }
  56. .hotel-top{
  57. width:100%;
  58. height: 4.03rem;
  59. background: url('../../image/881649.jpg') ;
  60. background-repeat:no-repeat;
  61. background-size:100% 100%;
  62. position: relative;
  63. }
  64. .hotel-top-line{
  65. width:100%
  66. }
  67. .weui-tab.tabh {
  68. /* height:4.64rem; */
  69. height:3.04rem;
  70. }
  71. .hotel-title{
  72. font-size: 0.38rem;
  73. height: 1rem;
  74. line-height: 1rem;
  75. font-weight: 500;
  76. color: #000;
  77. }
  78. .hotel-title span{
  79. float:right;
  80. font-size: 0.2rem;
  81. }
  82. .hotel-title span img {
  83. width: 0.38rem;
  84. }
  85. .hotel-goods{
  86. width:100%;
  87. height: 1rem;
  88. /* border-top:1px solid #e8e8e8; */
  89. border-bottom:1px solid #e8e8e8;
  90. position:relative;
  91. }
  92. .hotel-goods li{
  93. width:25%;
  94. float:left;
  95. height: 1rem;
  96. line-height: 1rem;
  97. text-align:center;
  98. }
  99. #store_description{
  100. width: 100%;
  101. overflow: hidden;
  102. display: -webkit-box;
  103. -webkit-line-clamp: 2;
  104. -webkit-box-orient: vertical;
  105. word-break: break-all;
  106. font-size: 0.26rem;
  107. color: #606266;
  108. }
  109. #store_descriptionx img {
  110. width: 100%;
  111. }
  112. .hotel-goods-active{
  113. color: #d9251c;
  114. }
  115. .goods-tag span{
  116. margin-right: 0.17rem;
  117. padding: 0.01rem 0.1rem;
  118. margin-top: 0.2rem;
  119. }
  120. .goods-title {
  121. height: auto;
  122. overflow : hidden;
  123. text-overflow: ellipsis;
  124. display: -webkit-box;
  125. -webkit-line-clamp: 2;
  126. -webkit-box-orient: vertical;
  127. }
  128. .goods-price, .goods-tag, .goods-title {
  129. margin-top: 0.2rem;
  130. }
  131. .category-item{
  132. width:100%;
  133. min-height: 0rem;
  134. height:auto;
  135. background:#ffffff;
  136. position:absolute;
  137. top: 1.01rem;
  138. z-index:999;
  139. border-bottom:1px solid #e8e8e8;
  140. padding: 0.1em;
  141. box-sizing:border-box;
  142. }
  143. .category-list{
  144. padding:3px;
  145. width:25%;
  146. float:left;
  147. box-sizing:border-box;
  148. }
  149. .sort-img,.sort-img2{
  150. width:18px;
  151. vertical-align:middle;
  152. }
  153. .category-list-span{
  154. border:1px solid #e8e8e8;
  155. width:90%;
  156. border-radius:3px;
  157. text-align:center;
  158. padding-top:6px;
  159. padding-bottom:6px;
  160. padding-left:3px;
  161. padding-right:3px;
  162. }
  163. .cate-active{
  164. color:#D9251C;
  165. border:1px solid #D9251C;
  166. }
  167. .share-item{
  168. position:fixed;
  169. left:0px;right:0px;
  170. bottom:0px;
  171. height: 3.9rem;
  172. background:#f2f2f2;
  173. border-top:1px solid #E8E8E8;
  174. z-index:9999;
  175. }
  176. .share-item-tips{
  177. height: 0.28rem;
  178. line-height: 0.28rem;
  179. width:100%;
  180. text-align:center;
  181. font-size: 0.28rem;
  182. padding: 0.38rem 0;
  183. }
  184. .share-item-cent{
  185. height: 1.8rem;
  186. width: 100%;
  187. }
  188. .share-item-cent li{
  189. width:33.3%;
  190. text-align:center;
  191. float:left;
  192. font-size: 0.28rem;
  193. }
  194. .share-item-cent img{
  195. width: 0.9rem;
  196. }
  197. .share-item-cancel{
  198. height: 0.98rem;
  199. line-height: 0.98rem;
  200. width:100%;
  201. text-align:center;
  202. background:#ffffff;
  203. font-size: 0.28rem;
  204. }
  205. .business-time{
  206. width:100%;
  207. padding: 0 0.32rem;
  208. box-sizing:border-box;
  209. }
  210. .padl {
  211. padding-left: 0.13rem;
  212. }
  213. .tag-item{
  214. float: left;
  215. line-height: normal;
  216. font:inherit;
  217. padding:0.01rem 0.1rem;
  218. background: #ffffff;
  219. color: #d9251c;
  220. font-size:0.24rem;
  221. font-weight: normal;
  222. text-align: center;
  223. position: relative;
  224. }
  225. .tag-item:after {
  226. content: ' ';
  227. position: absolute;
  228. pointer-events: none;
  229. box-sizing: border-box;
  230. -webkit-border-radius: 0.1rem;
  231. -moz-border-radius: 0.1rem;
  232. border-radius: 0.1rem;
  233. top: -50%;
  234. left: -50%;
  235. right: -50%;
  236. bottom: -55%;
  237. -webkit-transform: scale(0.5);
  238. transform: scale(0.5);
  239. border: 1px solid #d9251c;
  240. }
  241. .iconfont {
  242. color: #ffffff;
  243. }
  244. .weui-mask {
  245. position: fixed;
  246. z-index: 1000;
  247. top: 0;
  248. right: 0;
  249. left: 0;
  250. bottom: 0;
  251. background: rgba(0, 0, 0, .6);
  252. }
  253. .weui-mask_transparent{
  254. position: fixed;
  255. z-index: 1000;
  256. top: 0;
  257. right: 0;
  258. left: 0;
  259. bottom: 0;
  260. }
  261. .swiper-container-horizontal>.swiper-pagination-bullets, .swiper-pagination-custom, .swiper-pagination-fraction {
  262. bottom: 0;
  263. }
  264. .swiper-pagination-bullet {
  265. background: #fff;
  266. opacity: .8;
  267. }
  268. .swiper-pagination-bullet-active {
  269. background: #d9251c;
  270. }
  271. .weui-bar__item_on span {
  272. color: #d9251c;
  273. border-bottom: 0.2em solid;
  274. padding-bottom: 0.2rem;
  275. }
  276. .weui-navbar__item {
  277. padding: 0.1rem 0;
  278. font-size: 0.28rem;
  279. padding-bottom: 0;
  280. }
  281. .placeholder {
  282. text-align: center;
  283. padding: 0.3rem 0;
  284. line-height: 0;
  285. }
  286. .placeholder img {
  287. padding-bottom: 0.3rem;
  288. }
  289. .placeholder p {
  290. font-size: 0.26rem;
  291. }
  292. .weui-cell:before {
  293. left: 0;
  294. }
  295. .weui-cell {
  296. padding: 0.16rem 0;
  297. font-size: 0.3rem;
  298. }
  299. .weui-navbar__item.weui-bar__item_on {
  300. background-color: #ffffff;
  301. }
  302. .fixed_top {
  303. background-color: #fff;
  304. padding-bottom: 0.2rem;
  305. }
  306. .weui-gallery {
  307. z-index: 10000;
  308. }
  309. .weui-navbar__item:after {
  310. border-right: 0;
  311. }
  312. #store_phone a, #store_phone a:hover {
  313. color: #d9251c;
  314. }
  315. .footerbtn {
  316. position: fixed;
  317. bottom: 20px;
  318. z-index: 999;
  319. }
  320. .fixed_top .hotel-top-search, .fixed_top .hotel-top-back {
  321. background-color: rgba(0, 0, 0, 0.5);
  322. }
  323. .swiper-container {
  324. width: 100% !important;
  325. height: 4.03rem;
  326. z-index: 99;
  327. transform:translate3d(0,0,0);
  328. overflow:hidden;
  329. }
  330. .swiper-container-free-mode > .swiper-wrapper {
  331. -webkit-transition-timing-function: linear; /*之前是ease-out*/
  332. -moz-transition-timing-function: linear;
  333. -ms-transition-timing-function: linear;
  334. -o-transition-timing-function: linear;
  335. transition-timing-function: linear;
  336. margin: 0 auto;
  337. transform:translate3d(0,0,0)
  338. }
  339. .swiper-container {
  340. width: 100%;
  341. height: 100%;
  342. transform:translate3d(0,0,0);
  343. overflow:hidden;
  344. }
  345. .swiper-slide img{
  346. width:100%;
  347. height:100%;
  348. transform:translate3d(0,0,0)
  349. }
  350. .bg-full {
  351. background-size: cover !important;
  352. -webkit-background-size: cover !important;
  353. -o-background-size: cover !important;
  354. background-position: center 0;
  355. background-repeat: no-repeat !important;
  356. height: auto;
  357. width: 100% !important;
  358. }
  359. .ft{
  360. position: fixed;
  361. left: 0;
  362. right: 0;
  363. top:10px;
  364. z-index: 999;
  365. transform: translateZ(0);-webkit-transform: translateZ(0);
  366. /* background-color: #fff; */
  367. }
  368. .swiperType{
  369. height: 2rem;
  370. box-sizing: border-box;
  371. width: 100%;
  372. padding-top: 0.2rem;
  373. }
  374. .swiperType .flex-box-v{
  375. width: 20%;
  376. text-align: center;
  377. font-size: 0.26rem;
  378. height: 1.6rem;
  379. }
  380. .swiperType .flex-box-v img{
  381. width: 1.04rem;
  382. height: 1.04rem;
  383. margin-bottom: 0.1rem;
  384. }
  385. .dian{
  386. margin-top:0.2rem;
  387. }
  388. .dian div{
  389. width: 23px;
  390. height: 3px;
  391. border-radius: 3px;
  392. /* margin: 0 2px; */
  393. background-color: #C7C7C7;
  394. }
  395. .activeD{
  396. background-color: #d9251c !important;
  397. }
  398. .back-top{
  399. bottom: 1.4rem;
  400. }
  401. </style>
  402. <script>
  403. (function(w, d, m) {
  404. function r() {
  405. var t = 100,
  406. o = 750,
  407. e = d.documentElement.clientWidth || w.innerWidth,
  408. n = m.max(m.min(e, 480), 320),
  409. h = 50;
  410. 320 >= n && (h = m.floor(n / o * t * .99)),
  411. n > 320 && 362 >= n && (h = m.floor(n / o * t * 1)),
  412. n > 362 && 375 >= n && (h = m.floor(n / o * t * 1)),
  413. n > 375 && (h = m.floor(n / o * t * .97)),
  414. d.querySelector("html").style.fontSize = (e / 7.5) + "px"
  415. };
  416. r();
  417. w.onresize = function() {
  418. r()
  419. }
  420. })(window, document, Math);
  421. </script>
  422. </head>
  423. <body>
  424. <div class="topbar"></div>
  425. <section class="ft" style="padding: 0;padding-bottom: 0.2rem;" id="ft">
  426. <div class="hotel-top-line">
  427. <ul class="flex-box flex-v-ce">
  428. <li style="width: 0.61rem;padding-left: 0.04rem;" class="back-btn">
  429. <div class="hotel-top-back"><span class="iconfont">&#xe61e;</span></div>
  430. </li>
  431. <li class="flex-1" style="padding: 0 0.1rem;">
  432. <div class="hotel-top-search"><img src="../../image/search_2.png" /> 搜索商品</div>
  433. </li>
  434. <li style="width: 0.61rem;padding-right: 0.04rem;">
  435. <div class="hotel-top-back" id="share-btn" style="float:right;"><span class="iconfont">&#xe648;</span></div>
  436. </li>
  437. </ul>
  438. </div>
  439. </section>
  440. <div class="hotel-top" id="div_top">
  441. <div class="swiper-container">
  442. <div class="swiper-wrapper swipers">
  443. </div>
  444. <div class="swiper-pagination"></div>
  445. </div>
  446. </div>
  447. <section class="hotel-item">
  448. <div class="hotel-title font-rem11">
  449. <h id="store_name">乐辰酒店</h> <span onclick="chkfavorite()"><img id="favorite" src="../../image/goods_buy_favorite.png"></span>
  450. </div>
  451. <div id="store_description"></div>
  452. </section>
  453. <div class="h10"></div>
  454. <div class="weui-tab tabh" style="padding: 0;">
  455. <div class="weui-navbar">
  456. <div class="weui-navbar__item weui-bar__item_on" href="#tab1">
  457. <span>服务项目</span>
  458. </div>
  459. <div class="weui-navbar__item" href="#tab2">
  460. <span>评价</span>
  461. </div>
  462. <div class="weui-navbar__item" href="#tab3">
  463. <span>酒店信息</span>
  464. </div>
  465. </div>
  466. <div class="weui-tab__panel" style="overflow:hidden">
  467. <div id="tab1" class="weui_tab_bd_item weui_tab_bd_item_active">
  468. <div class="swiperType">
  469. <div class="swiper-wrapper">
  470. <!-- <div class="swiper-slide flex-box flex-d-wrap" style="height:100%"><div class="flex-box-v flex-center-center spItme" gcid="796"> <img src="https://www.qzaiwang.com/uploads/home/common/category-pic-796.jpg?v=1605087693"/> <span>圈在有礼</span> </div></div> -->
  471. <!-- <div class="swiper-slide flex-box flex-d-wrap" style="height:100%"><div class="flex-box-v flex-center-center spItme" gcid="796"> <img src="https://www.qzaiwang.com/uploads/home/common/category-pic-796.jpg?v=1605087693"/> <span>圈在有礼</span> </div></div> -->
  472. </div>
  473. <div class="dian flex-box flex-center-center">
  474. <div class="activeD"></div>
  475. </div>
  476. </div>
  477. </div>
  478. <div id="tab2" class="weui_tab_bd_item feed-list" page="1" style="padding-top: 0.2rem; padding:0 0.32rem;"></div>
  479. <div id="tab3" class="weui_tab_bd_item" style="padding: 0 0.32rem;">
  480. <div style="background:#ffffff;width:100%;padding-bottom: 1.2rem;">
  481. <section style="padding: 0;">
  482. <div class="hotel-title">
  483. <h id="store_namex" style="font-size: 0.3rem;color: #606266;">商家信息</h>
  484. </div>
  485. <div id="store_descriptionx"></div>
  486. <div class="h10"></div>
  487. <div class="weui-cells">
  488. <div class="weui-cell">
  489. <div class="weui-cell__bd">
  490. <p>酒店地址</p>
  491. </div>
  492. <div class="weui-cell__ft" id="store_address"></div>
  493. </div>
  494. <div class="weui-cell">
  495. <div class="weui-cell__bd">
  496. <p>联系酒店</p>
  497. </div>
  498. <div class="weui-cell__ft" id="store_phone"></div>
  499. </div>
  500. </div>
  501. <div class="h20"></div>
  502. </section>
  503. </div>
  504. <div class="footerbtn">
  505. <div class="m-bottom" feedback="false" style="width:6.86rem;border-radius: 0.15rem;">您的入住意见反馈(反馈送圈币)</div>
  506. </div>
  507. </div>
  508. </div>
  509. </div>
  510. <div class="hotel-goods">
  511. <ul>
  512. <li class="gsort hotel-goods-active goods-all" tag="praise">综合</li>
  513. <li class="gsort goods-new" tag="goods_commonid">上新<img class="sort-img" src="../../image/sort.png" /></li>
  514. <li class="gsort goods-sprice" tag="goods_price">价格<img class="sort-img" src="../../image/sort.png" /></li>
  515. <li id="category-btn" tag="gc_id_1">分类<img class="sort-img2" src="../../image/sort_down2.png" /></li>
  516. </ul>
  517. <div id="category-item" class="category-item mask-hidden"></div>
  518. </div>
  519. <section>
  520. <div class="h10"></div>
  521. <div class="goods-list" page="1"></div>
  522. </section>
  523. <div class="h50"></div>
  524. <div class="share-item mask-hidden">
  525. <div>
  526. <div class="share-item-tips">分享至</div>
  527. <div class="share-item-cent">
  528. <ul>
  529. <li class="share-item-friend"><img src="../../image/share_friend.png" />
  530. <p>微信好友</p>
  531. </li>
  532. <li class="share-item-cale"><img src="../../image/share_cale.png" />
  533. <p>微信朋友圈</p>
  534. </li>
  535. <li class="share-item-qq"><img src="../../image/share_qq.png" />
  536. <p>QQ</p>
  537. </li>
  538. </ul>
  539. </div>
  540. <div class="share-item-cancel">取消</div>
  541. </div>
  542. </div>
  543. <div class="back-top mask-hidden" id="fix1"></div>
  544. </body>
  545. <script type="text/javascript" src="../../script/api.js"></script>
  546. <script type="text/javascript" src="../../script/swiper.min.js"></script>
  547. <script type="text/javascript" src="../../script/jquery.min.js"></script>
  548. <script type="text/javascript" src="../../script/imagesloaded.pkgd.min.js"></script>
  549. <script type="text/javascript" src="../../script/jquery.tap.js"></script>
  550. <script type="text/javascript" src="../../script/jquery.star-rating-svg.js"></script>
  551. <script type="text/javascript">
  552. var _storeid = '';
  553. var _cateid = '';
  554. var _sort = "id";
  555. var _minsort = '';
  556. var _desc = "";
  557. var _shareimg = '';
  558. var _description = '';
  559. var _title = '';
  560. var _shareurl = '';
  561. var _page = '1';
  562. var _data_toggle = "#tab1";
  563. var imgUrl = "";
  564. var height_s="3.04rem";
  565. var isLoad=true;
  566. apiready = function() {
  567. _storeid = api.pageParam.keyid;
  568. $api.fixTabBar($api.byId('footerbtn'))
  569. $api.fixIos7Bar($api.byId('ft'));
  570. $(".goods-list").attr("page", "1");
  571. setIosTopBar();
  572. getstoreCategory();
  573. getRouteData(_storeid);
  574. getRouteGoodsData();
  575. getstorefeedbackList();
  576. api.addEventListener({
  577. name: 'scrolltobottom',
  578. extra: {
  579. threshold: 200
  580. }
  581. }, function(ret, err) {
  582. if (_data_toggle == "#tab1") {
  583. if(isLoad){
  584. getRouteGoodsData();
  585. }
  586. }
  587. if (_data_toggle == "#tab2") {
  588. getstorefeedbackList();
  589. }
  590. });
  591. };
  592. $(function() {
  593. $('.weui-navbar__item').on('click', function() {
  594. $(this).addClass('weui-bar__item_on').siblings('.weui-bar__item_on').removeClass('weui-bar__item_on');
  595. $(".weui-tab__panel .weui_tab_bd_item_active").removeClass('weui_tab_bd_item_active');
  596. _data_toggle = jQuery(this).attr("href");
  597. $(_data_toggle).addClass("weui_tab_bd_item_active");
  598. if (_data_toggle == "#tab1") {
  599. console.log("123")
  600. $(".hotel-goods").show();
  601. $(".goods-list").fadeIn('1500');
  602. $(".weui-tab").css("height", height_s);
  603. } else {
  604. $(".hotel-goods").fadeOut('1500');
  605. $(".goods-list").fadeOut('1500');
  606. $(".weui-tab").css("height", "auto");
  607. }
  608. if (_data_toggle == "#tab2") {
  609. $("#tab2").attr('page', '1');
  610. }
  611. });
  612. $(window).scroll(function() {
  613. if ($(window).scrollTop() >= 200) {
  614. $(".ft").addClass("fixed_top");
  615. } else {
  616. $(".ft").removeClass("fixed_top");
  617. }
  618. });
  619. $('img').error(function() {
  620. $(this).attr('src', '/image/logo2.png');
  621. })
  622. });
  623. function getRouteData(_storeid) {
  624. $.ajax({
  625. url: siteurl + 'v1/store/info',
  626. data: {
  627. store_id: _storeid
  628. },
  629. headers: {
  630. "X-TOKEN": $api.getStorage("accesstoken")
  631. },
  632. dataType: 'json',
  633. type: 'post',
  634. success: function(datas) {
  635. if (datas.result) {
  636. var img = siteurl + "uploads/home/store/" + datas.data.store_id + "/" + datas.data.store_banner;
  637. $("#store_name").html(datas.data.store_name);
  638. $("#store_description").html(datas.data.store_summary);
  639. $(".hotel-top").css("background-image", "url(" + siteurl + "uploads/home/store/" + datas.data.store_id + "/" +
  640. datas.data.store_banner + ")");
  641. _shareimg = siteurl + "uploads/home/store/" + datas.data.store_id + "/" + datas.data.store_logo;
  642. _title = datas.data.store_name;
  643. _shareurl = siteurl + 'v1/view/market.html';
  644. datas.data.has_collected ? $("#favorite").attr("src", "../../image/favorite_hl.png") : $("#favorite").attr(
  645. "src", "../../image/goods_buy_favorite.png");
  646. $(".m-bottom").attr("feedback", datas.data.can_feedback);
  647. $(".weui-tab.tabh .weui-navbar__item:nth-child(2)").append(datas.data.feedback_count);
  648. $("#store_descriptionx").html(datas.data.store_description);
  649. $("#store_address").html(datas.data.store_address);
  650. if (datas.data.store_phone) {
  651. $("#store_phone").html('<a href="tel:' + datas.data.store_phone + '">' + datas.data.store_phone + '</a>');
  652. } else {
  653. $("#store_phone").html('<a style="color: rgba(0,0,0,.5);">暂无</a>');
  654. }
  655. if (datas.data.store_slide.length > 1) {
  656. imgUrl = datas.data.store_slide[0];
  657. } else {
  658. imgUrl = siteurl + "uploads/home/store/" + datas.data.store_id + "/" + datas.data.store_banner;
  659. }
  660. if (datas.data.store_slide.length > 0) {
  661. $.each(datas.data.store_slide, function(index, item) {
  662. if (item.indexOf('jpg') != -1) {
  663. $(".swipers").append('<div class="swiper-slide" type="0" keyid="0"><img src="' + item +'"/></div>');
  664. }
  665. })
  666. }
  667. var swiper = new Swiper('.swiper-container', {
  668. allowSlidePrev: true,
  669. autoplay: {
  670. disableOnInteraction: false
  671. },
  672. loop: true,
  673. pagination: {
  674. el: '.swiper-pagination',
  675. },
  676. });
  677. } else {
  678. errcode(datas, datas.code);
  679. }
  680. function_name();
  681. }
  682. });
  683. }
  684. function chkfavorite() {
  685. $("#favorite").removeAttr("style", "");
  686. $.ajax({
  687. url: siteurl + 'v1/favorites/collect',
  688. data: {
  689. type: 'store',
  690. fav_id: _storeid
  691. },
  692. headers: {
  693. "X-TOKEN": $api.getStorage("accesstoken")
  694. },
  695. dataType: 'json',
  696. type: 'post',
  697. success: function(datas) {
  698. $("#favorite").css("animation", "bounceOut 2s");
  699. if (datas.result) {
  700. datas.data.action == 'add' ? $("#favorite").attr("src", "../../image/favorite_hl.png") : $("#favorite").attr(
  701. "src", "../../image/goods_buy_favorite.png");
  702. var _msg = datas.data.action == 'add' ? "收藏成功" : "取消收藏";
  703. // console.log(_msg);
  704. api.toast({
  705. msg: _msg
  706. });
  707. } else {
  708. errcode(datas, datas.code);
  709. }
  710. }
  711. });
  712. }
  713. function group(array, subGroupLength) {
  714. let index = 0;
  715. let newArray = [];
  716. while (index < array.length) {
  717. newArray.push(array.slice(index, index += subGroupLength));
  718. }
  719. return newArray;
  720. };
  721. function getstoreCategory() {
  722. $.ajax({
  723. url: siteurl + 'v1/entry/storeCategory',
  724. data: {
  725. type: 'store',
  726. store_id: _storeid
  727. },
  728. headers: {
  729. "X-TOKEN": $api.getStorage("accesstoken")
  730. },
  731. dataType: 'json',
  732. type: 'post',
  733. success: function(datas) {
  734. if (datas.result) {
  735. var _html = "";
  736. var data = group(datas.data.category_list, 10);
  737. if(datas.data.category_list.length>5){
  738. height_s='4.64rem';
  739. $(".swiperType").css("height",'3.6rem');
  740. $(".weui-tab.tabh").css("height",'4.64rem');
  741. }
  742. data.forEach((itme,index) => {
  743. if(index!=0){
  744. $(".dian").append(`<div></div>`)
  745. }
  746. _html = `<div class="swiper-slide flex-box flex-d-wrap" style="height:100%">`;
  747. itme.forEach(item2 => {
  748. _html +=`<div class="flex-box-v flex-center-center spItme" gcid="${item2.gc_id}">
  749. <img src="${item2.pic}"/>
  750. <span>${item2.gc_name}</span>
  751. </div>`
  752. })
  753. _html += `</div>`;
  754. $(".swiperType .swiper-wrapper").append(_html)
  755. })
  756. var swiper = new Swiper('.swiperType', {
  757. fade: {crossFade: true},
  758. pagination: {
  759. el: '.paginationType',
  760. },
  761. on: {
  762. slideChangeTransitionEnd: function(){
  763. $(".dian div").removeClass("activeD");
  764. $(".dian div").eq(this.activeIndex).addClass("activeD")
  765. },
  766. },
  767. });
  768. // var _html = '<div class="weui-flex">';
  769. // for (var i = 0; i < 10; i++) {
  770. // if (i == 5 && !xx[i]) {
  771. // _html += '</div>';
  772. // break;
  773. // }
  774. // if (i == 5) {
  775. // _html += '</div><div class="weui-flex">';
  776. // $(".weui-tab").css("height", "4.7rem");
  777. // }
  778. // if (xx[i]) {
  779. // _html += '<div class="weui-flex__item"><div class="placeholder" gcid="' + xx[i].gc_id +'"><img style="height: 1rem;" src="' + xx[i].pic + '" /><p>' + xx[i].gc_name + '</p></div></div>';
  780. // } else {
  781. // _html += '<div class="weui-flex__item"><div class="placeholder"></div></div>';
  782. // }
  783. // }
  784. } else {
  785. errcode(datas, datas.code);
  786. }
  787. function_name();
  788. }
  789. });
  790. }
  791. $(".hotel-top-search").on("tap", function() {
  792. api.openWin({
  793. name: 'goodssearch',
  794. url: './goodssearch.html',
  795. bounces: false,
  796. pageParam: {
  797. storeid: _storeid
  798. }
  799. });
  800. return false;
  801. })
  802. $(".hotel-itemx").on("tap", function() {
  803. //var _storeid=$(this).attr("keyid");
  804. api.openWin({
  805. name: 'showhotel',
  806. url: './showhotel.html',
  807. bounces: false,
  808. useWKWebView: true,
  809. pageParam: {
  810. keyid: _storeid
  811. }
  812. });
  813. return false;
  814. })
  815. $("#tab1").on("tap", ".spItme", function() {
  816. var _gcid = $(this).attr("gcid");
  817. var _categoryname = $(this).children("span").html();
  818. if (!_gcid) {
  819. return false;
  820. }
  821. api.openWin({
  822. name: 'storecategory',
  823. url: './storecategory.html',
  824. bounces: false,
  825. pageParam: {
  826. keyid: _gcid,
  827. storeid: _storeid,
  828. categoryname: _categoryname
  829. }
  830. });
  831. return false;
  832. })
  833. function openImg(_this) {
  834. var imgs = $(_this).data('imgs').split(',');
  835. var index = $(_this).data('index');
  836. var imageBrowser = api.require('imageBrowser');
  837. imageBrowser.openImages({
  838. imageUrls: imgs,
  839. activeIndex: index
  840. });
  841. }
  842. $(".goods-list").on("tap", ".goods-list-item", function() {
  843. var _goodsid = $(this).attr("keyid");
  844. var _spot = $(this).attr("spot");
  845. api.openWin({
  846. name: 'showgoods',
  847. url: './showgoods.html',
  848. bounces: false,
  849. useWKWebView: true,
  850. pageParam: {
  851. keyid: _goodsid,
  852. storeid: _storeid,
  853. spot: _spot
  854. }
  855. });
  856. return false;
  857. })
  858. function getRouteGoodsData() {
  859. isLoad=false;
  860. _page = $(".goods-list").attr("page");
  861. if (_page == 0) {
  862. return false;
  863. }
  864. var _xdata = {
  865. store_id: _storeid,
  866. page: _page,
  867. praise: _desc,
  868. page_size: '20',
  869. };
  870. var _data_type = $(".hotel-goods-active").attr("tag");
  871. if (_data_type == 'praise') {
  872. _xdata = {
  873. store_id: _storeid,
  874. page: _page,
  875. praise: _desc,
  876. page_size: '20',
  877. };
  878. } else if (_data_type == 'goods_commonid') {
  879. _xdata = {
  880. store_id: _storeid,
  881. page: _page,
  882. goods_commonid: _desc,
  883. page_size: '20',
  884. };
  885. } else if (_data_type == 'goods_price') {
  886. _xdata = {
  887. store_id: _storeid,
  888. page: _page,
  889. goods_price: _desc,
  890. page_size: '20',
  891. };
  892. } else {
  893. var catid = $("#category-item .cate-active").parent(".category-list").attr("catid");
  894. if (catid == 'all') {
  895. _xdata = {
  896. store_id: _storeid,
  897. page: _page,
  898. page_size: '20',
  899. };
  900. } else {
  901. _xdata = {
  902. store_id: _storeid,
  903. page: _page,
  904. gc_id_1: catid,
  905. page_size: '20',
  906. };
  907. }
  908. }
  909. $(".goods-list").attr("page", "0");
  910. $.ajax({
  911. url: siteurl + 'v2/entry/storeGoods', //'v2/entry/storeGoods'
  912. data: _xdata,
  913. headers: {
  914. "X-TOKEN": $api.getStorage("accesstoken")
  915. },
  916. dataType: 'json',
  917. type: 'post',
  918. success: function(datas) {
  919. if (datas.result) {
  920. var html = '';
  921. if (datas.data.goods_list.length > 0) {
  922. var j = 0;
  923. $.each(datas.data.goods_list, function(index, item) {
  924. var _advarr = item.goods_advword.split("\n");
  925. var _taghtml = '';
  926. var _tagcolor = ['#006699', '#d9251c', '#e8e8e8'];
  927. if (_advarr.length > 0) {
  928. for (var i = 0; i < _advarr.length; i++) {
  929. if (_advarr[i]) {
  930. _taghtml += '<span class="tag-item" style="">' + _advarr[i] + '</span>';
  931. }
  932. }
  933. }
  934. j++;
  935. html = '';
  936. if (j % 2 == 0) {
  937. html += '<div class="goods-list-item padl" ';
  938. } else {
  939. html += '<div class="goods-list-item" ';
  940. }
  941. html += 'keyid="' + item.goods_commonid + '" spot="' + item.spot + '" goods_li="' + j + '"><ul>';
  942. html += '<li><img src="' + siteurl + "uploads/home/store/goods/" + item.goods_image.substr(0, item.goods_image
  943. .indexOf("\_")) + "/" + item.goods_image + '" class="goods-image"/></li>';
  944. html += '<li class="goods-title font-rem11">' + item.goods_name + '</li>';
  945. html += '<li class="goods-price">¥' + item.goods_price + ' <span class="line-through">' + item.goods_marketprice +
  946. '</span></li>';
  947. html += '<li class="goods-tag" style="margin-top: 0;">' + _taghtml + '</li>';
  948. html += '</ul></div>';
  949. if (j % 2 == 0) {
  950. html += '<div class="h10"></div>';
  951. }
  952. if (_page == 1 && index == 0) {
  953. $(".goods-list").html(html);
  954. } else {
  955. $(".goods-list").append(html);
  956. }
  957. });
  958. _page++;
  959. $(".goods-list").attr("page", _page);
  960. isLoad=true;
  961. } else {
  962. html = '<div class="data-null">暂时没有更多商品</div>';
  963. $(".goods-list").attr("page", '0');
  964. if (_page == 1) {
  965. $(".goods-list").html(html);
  966. } else {
  967. $(".goods-list").append(html);
  968. }
  969. isLoad=true;
  970. }
  971. } else {
  972. errcode(datas, datas.code)
  973. }
  974. function_name();
  975. }
  976. });
  977. }
  978. function getCategoryData() {
  979. $.ajax({
  980. url: siteurl + 'v1/entry/storeCategory',
  981. data: {
  982. store_id: _storeid
  983. },
  984. headers: {
  985. "X-TOKEN": $api.getStorage("accesstoken")
  986. },
  987. dataType: 'json',
  988. type: 'post',
  989. success: function(datas) {
  990. if (datas.result) {
  991. var html = '';
  992. $("#category-item").empty();
  993. $("#category-item").append(
  994. '<div class="category-list" catid="all"><span class="category-list-span">全部</span></div>');
  995. $.each(datas.data.category_list, function(index, item) {
  996. html = '<div class="category-list" catid="' + item.gc_id + '"><span class="category-list-span">' + item.gc_name +
  997. '</span></div>';
  998. $("#category-item").append(html);
  999. });
  1000. } else {
  1001. errcode(datas, datas.code);
  1002. }
  1003. function_name();
  1004. }
  1005. });
  1006. }
  1007. function getstorefeedbackList() {
  1008. _pagex = $("#tab2").attr('page');
  1009. if (_pagex == 0) {
  1010. return false;
  1011. }
  1012. $.ajax({
  1013. url: siteurl + 'v1/store/feedbackList',
  1014. data: {
  1015. store_id: _storeid,
  1016. page: _pagex
  1017. },
  1018. headers: {
  1019. "X-TOKEN": $api.getStorage("accesstoken")
  1020. },
  1021. dataType: 'json',
  1022. type: 'post',
  1023. success: function(datas) {
  1024. if (datas.result) {
  1025. if (datas.data.feedback_list.length > 0) {
  1026. $.each(datas.data.feedback_list, function(index, item) {
  1027. var _html = '';
  1028. if (item.img_list) {
  1029. var _imglist = item.img_list;
  1030. } else {
  1031. var _imglist = '';
  1032. }
  1033. _html += '<div class="feed-item"><ul>';
  1034. _html += '<li class="fl" style="width: 0.7rem;"><img src="' + item.member_avatar +
  1035. '" class="user-head"/></li>';
  1036. _html += '<li class="feed-item-right fl">' + item.member_truename + '<p class="feed-item-titel">' + item.add_time +
  1037. '</p></li>';
  1038. _html += '<li><div class="my-rating my-rating' + index + '"></div></li></ul>';
  1039. _html += '<ul><li>' + item.content + '</li></ul><ul style="margin-top: 0.25rem;"><li>';
  1040. if (_imglist.length > 0) {
  1041. for (var i = 0; i < _imglist.length; i++) {
  1042. _html += '<img onclick="openImg(this)" data-index="' + i + '" data-imgs="' + _imglist + '" src="' +
  1043. _imglist[i] + '" style="width: 1.2rem;height: 1.2rem;margin-right: 0.3rem;"/>';
  1044. }
  1045. }
  1046. _html += '</li></ul><div class="h50"></div></div>';
  1047. if (_pagex == 1 && index == 0) {
  1048. $("#tab2").html(_html);
  1049. } else {
  1050. $("#tab2").append(_html);
  1051. }
  1052. $(".my-rating" + index).starRating({
  1053. starSize: 17,
  1054. initialRating: item.satisfaction,
  1055. readOnly: true,
  1056. starShape: 'rounded',
  1057. emptyColor: 'lightgray',
  1058. hoverColor: 'salmon',
  1059. activeColor: '#d9251c',
  1060. useGradient: false,
  1061. callback: function(currentRating, $el) {
  1062. // make a server call here #d9251c
  1063. }
  1064. });
  1065. })
  1066. _pagex++;
  1067. $("#tab2").attr('page', _pagex);
  1068. } else {
  1069. $("#tab2").attr('page', '0');
  1070. if (_pagex == 1) {
  1071. $("#tab2").html('<div class="data-null">暂时没有更多评价</div>');
  1072. } else {
  1073. $("#tab2").append('<div class="data-null">暂时没有更多评价</div>');
  1074. }
  1075. }
  1076. } else {
  1077. errcode(datas, datas.code);
  1078. }
  1079. function_name();
  1080. }
  1081. });
  1082. }
  1083. $("#category-btn").on("tap", function() {
  1084. $(".gsort").removeClass("hotel-goods-active");
  1085. $(".gsort").find("img").attr("src", "../../image/sort.png");
  1086. getCategoryData();
  1087. if (!$(".category-item").hasClass("mask-hidden")) {
  1088. $(".category-item").addClass("mask-hidden");
  1089. $("#category-btn").removeClass("hotel-goods-active");
  1090. $(this).find("img").attr("src", "../../image/sort.png");
  1091. $("#category-btn img").attr("src", "../../image/sort_down2.png");
  1092. } else {
  1093. $(".category-item").removeClass("mask-hidden");
  1094. $("#category-btn").addClass("hotel-goods-active");
  1095. $(this).find("img").attr("src", "../../image/sort_up.png");
  1096. $("#category-btn img").attr("src", "../../image/sort_down2_up.png");
  1097. }
  1098. return false;
  1099. })
  1100. function hiddenCate() {
  1101. $(".category-item").addClass("mask-hidden");
  1102. $("#category-btn").removeClass("hotel-goods-active");
  1103. $("#category-btn").find("img").attr("src", "../../image/sort.png");
  1104. $("#category-btn img").attr("src", "../../image/sort_down2.png");
  1105. }
  1106. function shorNewGoods() {
  1107. _minsort = '';
  1108. $(".goods-list").empty();
  1109. $(".goods-list").attr("page", '1');
  1110. getRouteGoodsData();
  1111. }
  1112. ///
  1113. $(".category-item").on("tap", ".category-list", function() {
  1114. $(this).find("span").addClass("cate-active");
  1115. hiddenCate();
  1116. _cateid = $(this).attr("catid");
  1117. _minsort = '';
  1118. shorNewGoods();
  1119. setTimeout(function() {
  1120. $(".category-item").addClass("mask-hidden");
  1121. }, 300);
  1122. return false;
  1123. })
  1124. ///
  1125. $(".goods-all").on("tap", function() {
  1126. hiddenCate();
  1127. _sort = $(this).attr("tag");
  1128. $(".gsort").removeClass("hotel-goods-active");
  1129. $(this).addClass("hotel-goods-active");
  1130. $(".gsort").find("img").attr("src", "../../image/sort.png");
  1131. _desc = "";
  1132. shorNewGoods();
  1133. return false;
  1134. })
  1135. ////
  1136. $(".goods-new").on("tap", function() {
  1137. hiddenCate();
  1138. _sort = $(this).attr("tag");
  1139. $(".gsort").removeClass("hotel-goods-active");
  1140. $(this).addClass("hotel-goods-active");
  1141. $(".goods-sprice").find("img").attr("src", "../../image/sort.png");
  1142. $(this).find("img").attr("src", $(this).find("img").attr("src") == "../../image/sort_down.png" ? "../../image/sort_up.png" : "../../image/sort_down.png");
  1143. if ($(this).find("img").attr("src") == "../../image/sort_up.png") {
  1144. _desc = "desc";
  1145. } else {
  1146. _desc = "asc";
  1147. }
  1148. // ../../image/sort_down.png
  1149. shorNewGoods();
  1150. return false;
  1151. })
  1152. $(".goods-sprice").on("tap", function() {
  1153. hiddenCate();
  1154. _sort = $(this).attr("tag");
  1155. $(".gsort").removeClass("hotel-goods-active");
  1156. $(this).addClass("hotel-goods-active");
  1157. $(".goods-new").find("img").attr("src", "../../image/sort.png");
  1158. $(this).find("img").attr("src", $(this).find("img").attr("src") == "../../image/sort_down.png" ? "../../image/sort_up.png" : "../../image/sort_down.png");
  1159. if ($(this).find("img").attr("src") == "../../image/sort_up.png") {
  1160. _desc = "asc";
  1161. } else {
  1162. _desc = "desc";
  1163. }
  1164. shorNewGoods();
  1165. return false;
  1166. })
  1167. $(".share-item-cancel").on("tap", function() {
  1168. $(".share-item").slideUp(500, function() {});
  1169. $(".weui-mask").remove();
  1170. _show = false;
  1171. return false;
  1172. })
  1173. $(".share-item-friend").on("tap", function() {
  1174. var wx = api.require('wx');
  1175. api.download({
  1176. url: imgUrl,
  1177. // savePath: 'fs://test.rar',
  1178. report: false,
  1179. cache: true,
  1180. allowResume: true
  1181. }, function(ret, err) {
  1182. var str = ret.savePath.slice(-3);
  1183. var str2 = "";
  1184. if (str == 'png') {
  1185. str2 = ret.savePath;
  1186. } else {
  1187. str2 = "widget://image/logo3.png";
  1188. }
  1189. if (ret.state == 1) {
  1190. wx.shareProgram({
  1191. scene: 'session',
  1192. description: _description,
  1193. title: _title,
  1194. thumb: str2,
  1195. webpageUrl: _shareurl,
  1196. userName: 'gh_344fb21bce0f',
  1197. path: 'pages/index/hotel?id=' + _storeid + '&isfx=true',
  1198. }, function(ret, err) {
  1199. if (ret.status) {
  1200. api.toast({
  1201. msg: '分享成功!'
  1202. });
  1203. setPoint();
  1204. } else {
  1205. if (err.code == 2) {
  1206. api.toast({
  1207. msg: '用户取消'
  1208. });
  1209. } else if (err.code == 3) {
  1210. api.toast({
  1211. msg: '发送失败'
  1212. });
  1213. } else if (err.code == 4) {
  1214. api.toast({
  1215. msg: '授权拒绝'
  1216. });
  1217. } else {
  1218. api.toast({
  1219. msg: '发送失败!'
  1220. });
  1221. }
  1222. }
  1223. });
  1224. }
  1225. })
  1226. $(".share-item").slideUp(500, function() {});
  1227. $(".weui-mask").remove();
  1228. _show = false;
  1229. return false;
  1230. })
  1231. $(".share-item-cale").on("tap", function() {
  1232. var wx = api.require('wx');
  1233. wx.shareWebpage({
  1234. scene: 'timeline',
  1235. title: _title,
  1236. description: _description,
  1237. thumb: 'widget://image/logo2.png', //'widget://share' + _storeid + '.png',
  1238. contentUrl: _shareurl
  1239. }, function(ret, err) {
  1240. if (ret.status) {
  1241. api.toast({
  1242. msg: '分享成功!'
  1243. });
  1244. setPoint();
  1245. } else {}
  1246. });
  1247. $(".share-item").slideUp(500, function() {});
  1248. $(".weui-mask").remove();
  1249. _show = false;
  1250. return false;
  1251. })
  1252. $(".share-item-qq").on("tap", function() {
  1253. var qq = api.require('QQPlus');
  1254. qq.shareNews({
  1255. url: _shareurl,
  1256. title: _title,
  1257. description: _description,
  1258. imgUrl: _shareimg
  1259. }, function(ret, err) {
  1260. if (ret.status) {
  1261. api.toast({
  1262. msg: '分享成功!'
  1263. });
  1264. setPoint();
  1265. }
  1266. });
  1267. $(".share-item").slideUp(500, function() {});
  1268. $(".weui-mask").remove();
  1269. _show = false;
  1270. return false;
  1271. })
  1272. var _show = false;
  1273. $("#share-btn").on("tap", function() {
  1274. if (_show == false) {
  1275. $(".share-item").slideDown(500, function() {});
  1276. $("body").append('<div class="weui-mask"></div>');
  1277. _show = true;
  1278. } else {
  1279. $(".share-item").slideUp(500, function() {});
  1280. _show = false;
  1281. }
  1282. return false;
  1283. })
  1284. function setPoint() {
  1285. $.ajax({
  1286. url: siteurl + 'v1/member/point',
  1287. data: {
  1288. memberid: $api.getStorage("memberid"),
  1289. stage: 'share'
  1290. },
  1291. headers: {
  1292. "X-TOKEN": $api.getStorage("accesstoken")
  1293. },
  1294. dataType: 'json',
  1295. type: 'post',
  1296. success: function(datas) {
  1297. if (datas.result) {
  1298. //
  1299. } else {
  1300. errcode(datas, datas.code);
  1301. }
  1302. }
  1303. });
  1304. }
  1305. $(".m-bottom").on("tap", function() {
  1306. if ($(".m-bottom").attr("feedback") == 1) {
  1307. api.openWin({
  1308. name: 'feedback',
  1309. url: './feedback.html',
  1310. bounces: false,
  1311. pageParam: {
  1312. keyid: _storeid
  1313. }
  1314. })
  1315. } else {
  1316. api.toast({
  1317. msg: '入住客人才可以反馈'
  1318. });
  1319. }
  1320. return false;
  1321. })
  1322. $(".back-top").on("tap", function() {
  1323. $('html , body').animate({
  1324. scrollTop: 0
  1325. }, 'slow');
  1326. return false;
  1327. });
  1328. $.fn.fixedDiv = function(actCls) {
  1329. var that = $(this),
  1330. offsetTop = that.offset().top,
  1331. scrollTop;
  1332. function fix() {
  1333. scrollTop = $(document).scrollTop();
  1334. if (scrollTop > offsetTop) {
  1335. that.removeClass(actCls);
  1336. } else {
  1337. that.addClass(actCls);
  1338. }
  1339. }
  1340. fix();
  1341. $(window).scroll(fix);
  1342. }
  1343. $('#fix1').fixedDiv('mask-hidden')
  1344. </script>
  1345. </html>