shareIndex.html 87 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
  6. <meta name="format-detection" content="telephone=no">
  7. <title>U店在哪</title>
  8. <style>
  9. :root {
  10. --orange: #F58220;
  11. --orange-light: #FFF4E8;
  12. --red: #FF4D4F;
  13. --text: #333333;
  14. --text-secondary: #999999;
  15. --border: #EEEEEE;
  16. --bg: #FFFFFF;
  17. --safe-bottom: env(safe-area-inset-bottom, 0px);
  18. }
  19. * {
  20. margin: 0;
  21. padding: 0;
  22. box-sizing: border-box;
  23. }
  24. html {
  25. font-size: 16px;
  26. -webkit-tap-highlight-color: transparent;
  27. overflow-x: hidden;
  28. }
  29. body {
  30. font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  31. background: var(--bg);
  32. color: var(--text);
  33. padding-bottom: calc(88px + var(--safe-bottom));
  34. min-height: 100vh;
  35. overflow-x: hidden;
  36. }
  37. /* Header */
  38. .header {
  39. position: sticky;
  40. top: 0;
  41. z-index: 100;
  42. display: flex;
  43. align-items: center;
  44. justify-content: center;
  45. height: 44px;
  46. padding: 0 15px;
  47. background: var(--bg);
  48. border-bottom: 1px solid var(--border);
  49. }
  50. .header__back {
  51. position: absolute;
  52. left: 15px;
  53. width: 24px;
  54. height: 24px;
  55. display: flex;
  56. align-items: center;
  57. justify-content: center;
  58. color: var(--text);
  59. text-decoration: none;
  60. }
  61. .header__title {
  62. font-size: 17px;
  63. font-weight: 600;
  64. color: var(--text);
  65. }
  66. /* Hero carousel */
  67. .hero {
  68. position: relative;
  69. margin: 0 15px;
  70. margin-top: 10px;
  71. border-radius: 0 0 12px 12px;
  72. overflow: hidden;
  73. }
  74. .hero__track {
  75. display: flex;
  76. transition: transform 0.35s ease;
  77. }
  78. .hero__slide {
  79. flex: 0 0 100%;
  80. aspect-ratio: 16 / 10;
  81. background: #f0f0f0;
  82. }
  83. .hero__slide img {
  84. width: 100%;
  85. height: 100%;
  86. object-fit: cover;
  87. display: block;
  88. vertical-align: middle;
  89. }
  90. .hero__dots {
  91. position: absolute;
  92. bottom: 12px;
  93. left: 0;
  94. right: 0;
  95. display: flex;
  96. justify-content: center;
  97. align-items: center;
  98. gap: 6px;
  99. }
  100. .hero__dot {
  101. width: 6px;
  102. height: 6px;
  103. border-radius: 3px;
  104. background: rgba(255, 255, 255, 0.45);
  105. transition: width 0.25s ease, background 0.25s ease;
  106. }
  107. .hero__dot.is-active {
  108. width: 16px;
  109. background: #fff;
  110. }
  111. /* Store block */
  112. .section {
  113. padding: 16px 15px 0;
  114. }
  115. .store-name {
  116. font-size: 20px;
  117. font-weight: 700;
  118. line-height: 1.35;
  119. margin-bottom: 12px;
  120. }
  121. .row {
  122. display: flex;
  123. align-items: center;
  124. justify-content: space-between;
  125. gap: 10px;
  126. }
  127. .rating-row {
  128. margin-bottom: 12px;
  129. }
  130. .stars {
  131. display: inline-flex;
  132. align-items: center;
  133. gap: 2px;
  134. }
  135. .star {
  136. width: 14px;
  137. height: 14px;
  138. color: var(--orange);
  139. }
  140. .rating-num {
  141. font-size: 14px;
  142. font-weight: 600;
  143. color: var(--orange);
  144. }
  145. .store-evaluate-row {
  146. display: none;
  147. flex-direction: row;
  148. flex-wrap: wrap;
  149. align-items: center;
  150. gap: 6px 6px;
  151. margin: 0 0 12px;
  152. padding: 0;
  153. font-size: 13px;
  154. line-height: 1.4;
  155. color: var(--text-secondary);
  156. }
  157. .store-evaluate-row.is-visible {
  158. display: flex;
  159. }
  160. .store-evaluate__item {
  161. white-space: nowrap;
  162. }
  163. .link-muted {
  164. display: inline-flex;
  165. align-items: center;
  166. gap: 2px;
  167. font-size: 13px;
  168. color: var(--text-secondary);
  169. text-decoration: none;
  170. }
  171. .chevron {
  172. width: 14px;
  173. height: 14px;
  174. opacity: 0.6;
  175. }
  176. .hours-row {
  177. /* margin-bottom: 16px; */
  178. align-items: flex-start;
  179. border-bottom:1px solid #eee;
  180. padding-bottom: 20px;
  181. }
  182. .hours-left {
  183. flex: 1;
  184. min-width: 0;
  185. }
  186. .status {
  187. font-size: 14px;
  188. color: var(--red);
  189. margin-right: 8px;
  190. }
  191. .status.is-open {
  192. color: var(--orange);
  193. }
  194. .hours-text {
  195. font-size: 14px;
  196. color: var(--text-secondary);
  197. }
  198. .divider {
  199. height: 8px;
  200. background: #F7F7F7;
  201. margin: 0;
  202. }
  203. /* Location */
  204. .loc-wrap {
  205. display: flex;
  206. padding: 16px 15px;
  207. gap: 12px;
  208. }
  209. .loc-main {
  210. flex: 1;
  211. min-width: 0;
  212. padding-right: 12px;
  213. }
  214. .addr {
  215. font-size: 15px;
  216. font-weight: 600;
  217. line-height: 1.45;
  218. margin-bottom: 10px;
  219. }
  220. .meta-line {
  221. display: flex;
  222. align-items: flex-start;
  223. gap: 6px;
  224. font-size: 13px;
  225. color: var(--text-secondary);
  226. line-height: 1.45;
  227. margin-top: 6px;
  228. }
  229. .meta-line svg,
  230. .meta-line img {
  231. flex-shrink: 0;
  232. margin-top: 2px;
  233. opacity: 0.75;
  234. display: block;
  235. }
  236. .loc-actions {
  237. display: flex;
  238. flex-direction: row;
  239. align-items: center;
  240. justify-content: center;
  241. gap: 18px;
  242. flex-shrink: 0;
  243. }
  244. .act-btn {
  245. display: flex;
  246. flex-direction: column;
  247. align-items: center;
  248. gap: 4px;
  249. background: none;
  250. border: none;
  251. padding: 0;
  252. cursor: pointer;
  253. font-size: 12px;
  254. color: var(--text);
  255. }
  256. .act-btn__icon {
  257. width: 44px;
  258. height: 44px;
  259. border-radius: 10px;
  260. background: #F5F5F5;
  261. display: flex;
  262. align-items: center;
  263. justify-content: center;
  264. color: var(--orange);
  265. }
  266. .act-btn__icon img {
  267. width: 22px;
  268. height: 22px;
  269. object-fit: contain;
  270. display: block;
  271. }
  272. /* businessStatus===99 时仅展示关店提示并隐藏 .share-content;底部 FAB 仍在 #shareBelowContentEl */
  273. .closed-rec-wrap {
  274. display: none;
  275. }
  276. .closed-rec-divider {
  277. height: 8px;
  278. background: #F7F7F7;
  279. margin: 0;
  280. }
  281. .closed-rec-title {
  282. padding: 8px 15px 12px;
  283. font-size: 16px;
  284. font-weight: 700;
  285. }
  286. .closed-rec-grid {
  287. display: grid;
  288. grid-template-columns: repeat(2, 1fr);
  289. gap: 10px;
  290. padding: 0 15px 20px;
  291. }
  292. #shareClosedRecEmpty {
  293. grid-column: 1 / -1;
  294. }
  295. .closed-rec-empty {
  296. padding: 12px;
  297. color: var(--text-secondary);
  298. font-size: 14px;
  299. }
  300. .closed-rec-card {
  301. min-width: 0;
  302. background: #fff;
  303. border-radius: 10px;
  304. overflow: hidden;
  305. box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  306. }
  307. .closed-rec-card__img {
  308. aspect-ratio: 4 / 3;
  309. background: #eee;
  310. }
  311. .closed-rec-card__img img {
  312. width: 100%;
  313. height: 100%;
  314. object-fit: cover;
  315. display: block;
  316. border-radius: 0;
  317. }
  318. .closed-rec-card__body {
  319. padding: 10px;
  320. }
  321. .closed-rec-card__top {
  322. display: flex;
  323. justify-content: space-between;
  324. align-items: baseline;
  325. gap: 8px;
  326. margin-bottom: 6px;
  327. }
  328. .closed-rec-card__name {
  329. font-size: 15px;
  330. font-weight: 700;
  331. flex: 1;
  332. min-width: 0;
  333. overflow: hidden;
  334. text-overflow: ellipsis;
  335. white-space: nowrap;
  336. }
  337. .closed-rec-card__dist {
  338. font-size: 12px;
  339. color: var(--text-secondary);
  340. flex-shrink: 0;
  341. }
  342. .closed-rec-card__rating {
  343. display: flex;
  344. align-items: center;
  345. flex-wrap: wrap;
  346. gap: 4px 6px;
  347. }
  348. .closed-rec-card__rating .closed-rec-stars {
  349. display: inline-flex;
  350. align-items: center;
  351. gap: 2px;
  352. }
  353. .closed-rec-card__rating .closed-rec-star {
  354. display: block;
  355. flex-shrink: 0;
  356. }
  357. .closed-rec-card__rating .closed-rec-rating-num {
  358. font-size: 12px;
  359. font-weight: 600;
  360. color: var(--orange);
  361. }
  362. .closed-rec-meta {
  363. font-size: 12px;
  364. color: var(--text-secondary);
  365. }
  366. .closed-rec-card__footer {
  367. margin-top: 8px;
  368. font-size: 12px;
  369. color: var(--text-secondary);
  370. overflow: hidden;
  371. text-overflow: ellipsis;
  372. white-space: nowrap;
  373. }
  374. .share-none {
  375. display: none;
  376. text-align: center;
  377. padding: 28px 20px 16px;
  378. color: var(--text-muted);
  379. font-size: 15px;
  380. line-height: 1.5;
  381. }
  382. .share-none img {
  383. width: 240px;
  384. height: 240px;
  385. margin-bottom: 12px;
  386. display: inline-block;
  387. }
  388. .share-none p {
  389. margin: 0;
  390. padding:0 0 60px 0;
  391. color:#999;
  392. }
  393. /* FAB */
  394. .fab-wrap {
  395. position: fixed;
  396. left: 0;
  397. right: 0;
  398. bottom: 0;
  399. z-index: 200;
  400. padding: 12px 24px calc(12px + var(--safe-bottom));
  401. background: linear-gradient(to top, rgba(255, 255, 255, 0.98) 70%, transparent);
  402. pointer-events: none;
  403. }
  404. #fabDock,
  405. .fab-dock__slot,
  406. #fabDock .fab,
  407. .fab-wx-hit {
  408. pointer-events: auto;
  409. }
  410. #fabDock {
  411. display: block;
  412. }
  413. .fab-dock__slot {
  414. position: relative;
  415. width: 100%;
  416. max-width: 320px;
  417. height: 48px;
  418. margin: 0 auto;
  419. -webkit-tap-highlight-color: transparent;
  420. }
  421. #openApp {
  422. position: relative;
  423. z-index: 1;
  424. touch-action: manipulation;
  425. }
  426. #openApp img {
  427. pointer-events: none;
  428. }
  429. .fab-wx-hit {
  430. display: none;
  431. position: absolute;
  432. left: 0;
  433. right: 0;
  434. top: 0;
  435. height: 48px;
  436. z-index: 3;
  437. }
  438. #fabDock.wx-open-enabled .fab-wx-hit {
  439. display: block;
  440. }
  441. #launch-btn {
  442. display: block;
  443. width: 100%;
  444. height: 48px;
  445. min-height: 48px;
  446. }
  447. #openAppToast {
  448. display: none;
  449. position: fixed;
  450. left: 16px;
  451. right: 16px;
  452. bottom: calc(72px + var(--safe-bottom));
  453. z-index: 10001;
  454. padding: 10px 14px;
  455. font-size: 13px;
  456. line-height: 1.45;
  457. color: #fff;
  458. text-align: center;
  459. background: rgba(0, 0, 0, 0.78);
  460. border-radius: 8px;
  461. pointer-events: none;
  462. word-break: break-all;
  463. }
  464. .fab {
  465. display: flex;
  466. align-items: center;
  467. justify-content: center;
  468. gap: 10px;
  469. width: 100%;
  470. max-width: 320px;
  471. margin: 0 auto;
  472. height: 48px;
  473. border: none;
  474. border-radius: 24px;
  475. background: var(--orange);
  476. color: #fff;
  477. font-size: 16px;
  478. font-weight: 600;
  479. box-shadow: 0 4px 16px rgba(245, 130, 32, 0.45);
  480. cursor: pointer;
  481. background:#F47D1F;
  482. }
  483. .fab__logo {
  484. width: 28px;
  485. height: 28px;
  486. flex-shrink: 0;
  487. }
  488. .home-indicator {
  489. height: 5px;
  490. background: #000;
  491. border-radius: 3px;
  492. width: 134px;
  493. margin: 8px auto 4px;
  494. opacity: 0.2;
  495. }
  496. /* 营销活动(getStoreCouponList.marketingList) */
  497. .marketing-section {
  498. padding: 4px 15px 20px;
  499. }
  500. .marketing-section__title {
  501. font-size: 16px;
  502. font-weight: 700;
  503. color: var(--text);
  504. margin: 0 0 12px;
  505. }
  506. .marketing-section__list {
  507. display: flex;
  508. flex-direction: column;
  509. gap: 12px;
  510. }
  511. .marketing-card {
  512. border-radius: 12px;
  513. overflow: hidden;
  514. background: #f0f0f0;
  515. box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  516. }
  517. .marketing-card__media img,
  518. .marketing-card__media video {
  519. width: 100%;
  520. display: block;
  521. aspect-ratio: 16 / 9;
  522. object-fit: cover;
  523. vertical-align: middle;
  524. }
  525. .marketing-card__media video {
  526. background: #000;
  527. }
  528. .marketing-card--more {
  529. display: none;
  530. }
  531. .marketing-section.is-expanded .marketing-card--more {
  532. display: block;
  533. }
  534. .marketing-section__more {
  535. display: flex;
  536. align-items: center;
  537. justify-content: center;
  538. gap: 4px;
  539. width: 100%;
  540. margin-top: 14px;
  541. padding: 8px 0;
  542. border: none;
  543. background: none;
  544. font-size: 14px;
  545. color: var(--text-secondary);
  546. cursor: pointer;
  547. -webkit-tap-highlight-color: transparent;
  548. }
  549. .marketing-section__more-chevron {
  550. width: 16px;
  551. height: 16px;
  552. flex-shrink: 0;
  553. transition: transform 0.2s ease;
  554. }
  555. .marketing-section.is-expanded .marketing-section__more-chevron {
  556. transform: rotate(180deg);
  557. }
  558. .marketing-section__empty {
  559. display: flex;
  560. flex-direction: column;
  561. justify-content: center;
  562. align-items: center;
  563. padding: 10px 0 8px;
  564. }
  565. .marketing-section__empty img {
  566. width: 200px;
  567. height: 200px;
  568. display: block;
  569. object-fit: contain;
  570. }
  571. .marketing-section__empty-label {
  572. margin: 12px 0 0;
  573. font-size: 14px;
  574. color: var(--text-secondary);
  575. text-align: center;
  576. }
  577. /* 演出安排 performance/list/query */
  578. .performance-section {
  579. padding: 8px 0 20px;
  580. border-top: 1px solid var(--border);
  581. margin-top: 4px;
  582. }
  583. .performance-section__title {
  584. font-size: 16px;
  585. font-weight: 700;
  586. color: var(--text);
  587. margin: 0 15px 12px;
  588. }
  589. .performance-strip {
  590. display: flex;
  591. flex-direction: row;
  592. flex-wrap: nowrap;
  593. gap: 12px;
  594. overflow-x: auto;
  595. overflow-y: hidden;
  596. padding: 0 15px 4px;
  597. -webkit-overflow-scrolling: touch;
  598. scrollbar-width: none;
  599. }
  600. .performance-strip::-webkit-scrollbar {
  601. display: none;
  602. }
  603. .performance-card {
  604. flex: 0 0 auto;
  605. display: flex;
  606. flex-direction: row;
  607. align-items: stretch;
  608. gap: 10px;
  609. width: 272px;
  610. min-width: 272px;
  611. padding: 0;
  612. background: #fff;
  613. border-radius: 12px;
  614. overflow: hidden;
  615. }
  616. .performance-card__poster {
  617. flex: 0 0 76px;
  618. width: 76px;
  619. min-height: 102px;
  620. background: #eee;
  621. align-self: stretch;
  622. }
  623. .performance-card__poster img {
  624. width: 100%;
  625. height: 100%;
  626. min-height: 102px;
  627. object-fit: cover;
  628. display: block;
  629. vertical-align: middle;
  630. }
  631. .performance-card__body {
  632. flex: 1;
  633. min-width: 0;
  634. display: flex;
  635. flex-direction: column;
  636. justify-content: center;
  637. gap: 4px;
  638. padding: 10px 12px 10px 0;
  639. }
  640. .performance-card__name {
  641. font-size: 15px;
  642. font-weight: 700;
  643. color: var(--text);
  644. line-height: 1.3;
  645. overflow: hidden;
  646. text-overflow: ellipsis;
  647. display: -webkit-box;
  648. -webkit-line-clamp: 2;
  649. -webkit-box-orient: vertical;
  650. }
  651. .performance-card__meta {
  652. font-size: 12px;
  653. color: var(--text-secondary);
  654. line-height: 1.35;
  655. overflow: hidden;
  656. text-overflow: ellipsis;
  657. white-space: nowrap;
  658. }
  659. /* 人员阵容 queryStaffListByTitle */
  660. .staff-section {
  661. padding: 8px 0 24px;
  662. border-top: 1px solid var(--border);
  663. margin-top: 4px;
  664. }
  665. .staff-section__head {
  666. display: flex;
  667. align-items: center;
  668. justify-content: space-between;
  669. gap: 12px;
  670. padding: 0 15px;
  671. margin-bottom: 12px;
  672. }
  673. .staff-section__page-title {
  674. font-size: 16px;
  675. font-weight: 700;
  676. color: var(--text);
  677. margin: 0;
  678. flex: 1;
  679. min-width: 0;
  680. }
  681. .staff-section__all {
  682. flex-shrink: 0;
  683. display: inline-flex;
  684. align-items: center;
  685. gap: 2px;
  686. font-size: 13px;
  687. color: #151515;
  688. text-decoration: none;
  689. background: none;
  690. border: none;
  691. padding: 0;
  692. cursor: pointer;
  693. -webkit-tap-highlight-color: transparent;
  694. }
  695. .staff-section__all-chevron {
  696. width: 14px;
  697. height: 14px;
  698. opacity: 0.7;
  699. }
  700. .staff-group {
  701. margin-bottom: 20px;
  702. }
  703. .staff-group:last-child {
  704. margin-bottom: 0;
  705. }
  706. .staff-strip {
  707. display: flex;
  708. flex-direction: row;
  709. flex-wrap: nowrap;
  710. gap: 10px;
  711. overflow-x: auto;
  712. overflow-y: hidden;
  713. padding: 0 15px 4px;
  714. -webkit-overflow-scrolling: touch;
  715. scrollbar-width: none;
  716. }
  717. .staff-strip::-webkit-scrollbar {
  718. display: none;
  719. }
  720. .staff-card {
  721. flex: 0 0 112px;
  722. width: 112px;
  723. min-width: 112px;
  724. }
  725. .staff-card__img-wrap {
  726. position: relative;
  727. border-radius: 10px;
  728. overflow: hidden;
  729. background: #eee;
  730. aspect-ratio: 3 / 4;
  731. }
  732. .staff-card__img-wrap img {
  733. width: 100%;
  734. height: 100%;
  735. object-fit: cover;
  736. display: block;
  737. vertical-align: middle;
  738. }
  739. .staff-card__likes {
  740. position: absolute;
  741. left: 0;
  742. right: 0;
  743. bottom: 0;
  744. padding: 6px 8px;
  745. font-size: 11px;
  746. color: #fff;
  747. line-height: 1.2;
  748. background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
  749. }
  750. .staff-card__name-row {
  751. display: flex;
  752. align-items: center;
  753. gap: 4px;
  754. margin-top: 8px;
  755. min-width: 0;
  756. }
  757. .staff-card__name {
  758. font-size: 14px;
  759. font-weight: 700;
  760. color: var(--text);
  761. overflow: hidden;
  762. text-overflow: ellipsis;
  763. white-space: nowrap;
  764. flex: 1;
  765. min-width: 0;
  766. }
  767. .staff-card__badge {
  768. flex-shrink: 0;
  769. font-size: 10px;
  770. font-weight: 600;
  771. color: #fff;
  772. background: #ff9d4d;
  773. padding: 2px 5px;
  774. border-radius: 3px;
  775. line-height: 1.2;
  776. white-space: nowrap;
  777. }
  778. .staff-card__meta {
  779. display: flex;
  780. align-items: center;
  781. flex-wrap: wrap;
  782. gap: 0 4px;
  783. margin-top: 4px;
  784. font-size: 12px;
  785. color: var(--text-secondary);
  786. line-height: 1.35;
  787. }
  788. .staff-card__position {
  789. overflow: hidden;
  790. text-overflow: ellipsis;
  791. white-space: nowrap;
  792. max-width: 100%;
  793. }
  794. .staff-card__reviews {
  795. display: inline-flex;
  796. align-items: center;
  797. gap: 4px;
  798. }
  799. .staff-card__sep {
  800. color: #ddd;
  801. font-weight: 300;
  802. }
  803. </style>
  804. </head>
  805. <body>
  806. <div class="share-none" id="shareClosedBanner" aria-hidden="true">
  807. <img src="images/storeNone.png" alt="">
  808. <p>抱歉,商户已关闭,看看别的吧</p>
  809. </div>
  810. <div class="closed-rec-wrap" id="shareClosedRecommendWrap" aria-hidden="true">
  811. <div class="closed-rec-divider"></div>
  812. <h3 class="closed-rec-title">更多推荐</h3>
  813. <div class="closed-rec-grid" id="shareClosedRecList">
  814. <p id="shareClosedRecEmpty" class="closed-rec-empty" style="display:none;">暂无推荐</p>
  815. </div>
  816. </div>
  817. <div class="share-content" id="shareContentEl">
  818. <div class="hero" id="hero">
  819. <div class="hero__track" id="heroTrack">
  820. <div class="hero__slide"><img id="heroFallbackImg" src="images/hero.png" alt="店铺图"></div>
  821. </div>
  822. <div class="hero__dots" id="heroDots" aria-hidden="true"></div>
  823. </div>
  824. <!-- 数据由 getClientStoreDetail(id,userId,jingdu,weidu)填充,见 renderDetail -->
  825. <section class="section" id="mainSection">
  826. <p id="pageError" class="page-error" style="display:none;color:#ff4d4f;padding:12px 0;font-size:14px;"></p>
  827. <h2 class="store-name" id="storeName">加载中…</h2>
  828. <div class="row rating-row">
  829. <div class="row" style="flex:1; justify-content:flex-start;">
  830. <span class="stars" aria-label="5.0 分">
  831. <svg class="star" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>
  832. <svg class="star" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>
  833. <svg class="star" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>
  834. <svg class="star" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>
  835. <svg class="star" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>
  836. </span>
  837. <span class="rating-num" id="scoreAvg">—</span>
  838. <span id="commitCount" style="font-size: 14px;">0</span>
  839. </div>
  840. <!-- <a href="#" class="link-muted"><span id="commitCount">0</span>条评价
  841. <svg class="chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"/></svg>
  842. </a> -->
  843. </div>
  844. <div class="store-evaluate-row" id="storeEvaluateRow" aria-hidden="true">
  845. <span class="store-evaluate__item">酒水:<span id="storeEvaluateScoreOne">—</span></span>
  846. <span class="store-evaluate__item">氛围:<span id="storeEvaluateScoreTwo">—</span></span>
  847. <span class="store-evaluate__item">服务:<span id="storeEvaluateScoreThree">—</span></span>
  848. </div>
  849. <div class="row hours-row">
  850. <div class="hours-left">
  851. <span class="status" id="bizStatus">—</span>
  852. <span class="hours-text" id="hoursText">—</span>
  853. </div>
  854. <a href="#" class="link-muted">详情
  855. <svg class="chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"/></svg>
  856. </a>
  857. </div>
  858. </section>
  859. <div class="loc-wrap">
  860. <div class="loc-main">
  861. <p class="addr" id="storeAddr">—</p>
  862. <div class="meta-line" id="metaDistance" style="display:none;">
  863. <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#999" stroke-width="2"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>
  864. <span id="distanceText">—</span>
  865. </div>
  866. <div class="meta-line" id="metaSubway" style="display:none;">
  867. <img src="images/iconn.png" alt="" width="12" height="12" decoding="async">
  868. <span id="subwayText">—</span>
  869. </div>
  870. </div>
  871. <div class="loc-actions">
  872. <button type="button" class="act-btn" aria-label="导航">
  873. <span class="act-btn__icon">
  874. <img src="images/loc1.png" alt="" width="22" height="22" decoding="async">
  875. </span>
  876. 导航
  877. </button>
  878. <button type="button" class="act-btn" aria-label="电话">
  879. <span class="act-btn__icon">
  880. <img src="images/loc2.png" alt="" width="22" height="22" decoding="async">
  881. </span>
  882. 电话
  883. </button>
  884. </div>
  885. </div>
  886. <section class="marketing-section" id="shareMarketingSection" style="display:none;" aria-hidden="true">
  887. <h3 class="marketing-section__title">营销活动</h3>
  888. <div class="marketing-section__list" id="marketingListEl"></div>
  889. <button type="button" class="marketing-section__more" id="marketingMoreBtn" style="display:none;">
  890. <span id="marketingMoreText"></span>
  891. <svg class="marketing-section__more-chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>
  892. </button>
  893. </section>
  894. <section class="performance-section" id="sharePerformanceSection" style="display:none;" aria-hidden="true">
  895. <h3 class="performance-section__title" id="performanceSectionTitle">演出安排(0)</h3>
  896. <div class="performance-strip" id="performanceStripEl"></div>
  897. </section>
  898. <section class="staff-section" id="shareStaffSection" style="display:none;" aria-hidden="true">
  899. <div class="staff-section__head">
  900. <h3 class="staff-section__page-title">人员阵容(<span id="staffSectionCountEl">0</span>)</h3>
  901. <button type="button" class="staff-section__all" id="staffSectionAllBtn" aria-label="查看全部">
  902. 查看全部
  903. <svg class="staff-section__all-chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><polyline points="9 6 15 12 9 18"/></svg>
  904. </button>
  905. </div>
  906. <div id="staffGroupsMount"></div>
  907. </section>
  908. </div>
  909. <pre id="wxDebugBar" style="display:none;position:fixed;left:8px;right:8px;top:8px;z-index:9999;max-height:40vh;overflow:auto;margin:0;padding:8px;font-size:11px;line-height:1.35;background:rgba(0,0,0,.82);color:#0f0;white-space:pre-wrap;word-break:break-all;border-radius:6px;pointer-events:none;"></pre>
  910. <div id="openAppToast" role="status" aria-live="polite"></div>
  911. <div id="fabDock" class="fab-wrap">
  912. <div class="fab-dock__slot">
  913. <button type="button" class="fab" id="openApp">
  914. <img src="images/uBtn.png" alt="APP内打开" decoding="async">
  915. </button>
  916. <div id="fabWxHit" class="fab-wx-hit" aria-hidden="true">
  917. <wx-open-launch-app id="launch-btn" appid="wx5598889b28511717">
  918. <script type="text/wxtag-template">
  919. <style>
  920. .wx-open-app-btn {
  921. display: block;
  922. width: 100%;
  923. height: 48px;
  924. margin: 0;
  925. padding: 0;
  926. border: none;
  927. background: transparent;
  928. }
  929. .wx-open-app-btn img {
  930. display: block;
  931. width: 100%;
  932. height: 48px;
  933. object-fit: contain;
  934. }
  935. </style>
  936. <button class="wx-open-app-btn" aria-label="APP内打开">
  937. <img src="https://test.ailien.shop/h5/HBuilderProjects/images/uBtn.png" alt="APP内打开" />
  938. </button>
  939. </script>
  940. </wx-open-launch-app>
  941. </div>
  942. </div>
  943. <div class="home-indicator" aria-hidden="true"></div>
  944. </div>
  945. <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
  946. <script>
  947. (function () {
  948. 'use strict';
  949. /**
  950. * 与 group_user sharePopup 复制链接时携带的 query 一致,例如:
  951. * ?id=436&storeId=436&userId=628&businessSection=3&lat=...&lon=...&jingdu=...&weidu=...&storeName=...&coverUrl=...&desc=...
  952. *
  953. * 进入页先 GET .../store/info/getOne?id=(与 shareDynamic.html 一致);data.businessStatus===99 时先展示关店区(#shareClosedBanner、#shareClosedRecommendWrap)。
  954. * 关店时点「APP内打开」:深链为 shopro://pages/index/login?…(与 group_user pages/index/login),不再进八区详情。
  955. * 店铺头图/名称/评分/地址等(#mainSection、.loc-wrap):GET .../store/info/getClientStoreDetail?id=&userId=&jingdu=&weidu=
  956. * 经纬度:URL 可用 jingdu/weidu;若无则用 lon/lng、lat(与分享链一致)
  957. * 营销活动: GET .../store/info/getStoreCouponList?storeId= → data.marketingList
  958. * 演出安排: GET .../performance/list/query?storeId=&page=&size= → data.records, data.total(仅 URL businessSection=2 时展示与请求)
  959. * 人员阵容: GET .../storeStaffConfig/queryStaffListByTitle?storeId= → data[]
  960. *
  961. * 注意:用 file:// 打开本页时,浏览器可能因 CORS 拦截跨域请求。
  962. * 请用本地 HTTP 打开(如 VS Code Live Server、npx serve)或让后端为 H5 域名配置 Access-Control-Allow-Origin。
  963. */
  964. var API_BASE = 'https://test.ailien.shop/alienStore';
  965. /** wx-open-launch-app 的 appid(开放平台移动应用;若与公众号不同,只改这里和标签 appid) */
  966. var WECHAT_OPEN_APP_ID = 'wx5598889b28511717';
  967. /** 可选:强制 wx.config 使用的公众号 appId;默认用 getWxConfig 返回的 data.appId */
  968. var WECHAT_MP_APP_ID = '';
  969. /**
  970. * 进入页 GET {API_BASE}/wx/getWxConfig?url={当前页完整 URL,含 ? 参数,不含 #}
  971. * 微信校验签名与 location.href.split('#')[0] 必须一致,不能只签 shareIndex.html 无参数
  972. * 可用 ?wxSignPath= 或 ?wxSignUrl= 覆盖。
  973. */
  974. var WECHAT_GET_WX_CONFIG_PATH = '/wx/getWxConfig';
  975. var H5_PAGE_BASE_FALLBACK = 'https://test.ailien.shop/h5/HBuilderProjects/';
  976. /** 本地 file:// 预览时传给 getWxConfig 的默认 url(无 query) */
  977. var WX_GET_CONFIG_SIGN_URL = 'https://test.ailien.shop/h5/HBuilderProjects/shareIndex.html';
  978. /** wx.config 已成功(开放标签可展示);与「用户已成功唤起 App」不是同一回事 */
  979. var weChatJssdkConfigured = false;
  980. var wxConfigSignRetriedBaseUrl = false;
  981. var wxSignUrlFullBeforeStrip = '';
  982. var wxDebugLastStatus = '';
  983. function isWxDebugOn() {
  984. return String(q('wxDebug') || '') === '1';
  985. }
  986. function stringifyWxDebugPayload(obj) {
  987. try {
  988. return JSON.stringify(obj, null, 2);
  989. } catch (eJson) {
  990. return String(obj && obj.errMsg ? obj.errMsg : obj);
  991. }
  992. }
  993. /** ?wxDebug=1 时弹窗 + 页内条展示完整 errMsg(微信 debug 弹窗有时信息不全) */
  994. function reportWxDebug(stage, payload, extraLines) {
  995. var lines = ['【' + stage + '】'];
  996. if (extraLines && extraLines.length) {
  997. for (var i = 0; i < extraLines.length; i++) lines.push(extraLines[i]);
  998. }
  999. if (payload != null) {
  1000. lines.push(stringifyWxDebugPayload(payload));
  1001. }
  1002. var text = lines.join('\n');
  1003. wxDebugLastStatus = text;
  1004. console.log('[wxDebug]', text);
  1005. if (!isWxDebugOn()) return;
  1006. var bar = document.getElementById('wxDebugBar');
  1007. if (bar) {
  1008. bar.style.display = 'block';
  1009. bar.textContent = text;
  1010. }
  1011. if (isWeChatInAppBrowser()) {
  1012. window.alert(text.slice(0, 900));
  1013. }
  1014. }
  1015. /**
  1016. * 关店(businessStatus=99)更多推荐:POST …/ai/multimodal-services/api/v1/search/global/store-recommend
  1017. * 与 shareCheckInUndefined.html 一致;请求体 page、pageSize、storeId、userCity、userLat、userLng 可由 URL 覆盖。
  1018. */
  1019. var API_LIFE_AI_BASE = 'http://183.252.196.135:9100';
  1020. var STORE_GLOBAL_RECOMMEND_PATH =
  1021. '/ai/multimodal-services/api/v1/search/global/store-recommend';
  1022. var DEFAULT_REC_USER_LAT = 38.925747;
  1023. var DEFAULT_REC_USER_LNG = 121.662531;
  1024. var DEFAULT_REC_USER_CITY = '大连市';
  1025. /**
  1026. * 与 group_user 一致:
  1027. * - manifest:app-plus.distribute.android.schemes、ios.urltypes → shopro(即 shopro://)
  1028. * - Android 包名:manifest 未写 packagename 时与 App.vue 升级配置 androidPackageName 一致(云打包以 HBuilderX 为准)
  1029. */
  1030. var APP_ANDROID_PACKAGE = 'com.alien.Udianzaina';
  1031. var APP_IOS_URL_SCHEME = 'shopro://';
  1032. /** businessSection 未传或其它值时的默认落地页(与 1 相同) */
  1033. var APP_UNI_STORE_PATH = 'pages/ieisureEntertainment/eightTypeList/delicacyDetails';
  1034. function showDownloadTip() {
  1035. var msg = '请到应用商店下载';
  1036. if (typeof uni !== 'undefined' && typeof uni.showToast === 'function') {
  1037. uni.showToast({ title: msg, icon: 'none', duration: 2500 });
  1038. } else {
  1039. window.alert(msg);
  1040. }
  1041. }
  1042. function showFabToast(msg, ms) {
  1043. var tip = String(msg || '').trim();
  1044. if (!tip) return;
  1045. var el = document.getElementById('openAppToast');
  1046. if (el) {
  1047. el.textContent = tip;
  1048. el.style.display = 'block';
  1049. if (showFabToast._timer) clearTimeout(showFabToast._timer);
  1050. showFabToast._timer = setTimeout(function () {
  1051. el.style.display = 'none';
  1052. }, ms || 3200);
  1053. }
  1054. console.log('[openApp]', tip);
  1055. }
  1056. function showAppOpenFailTip(msg) {
  1057. var tip =
  1058. msg ||
  1059. '未能打开 App,请确认已安装最新版「U店在哪」;微信内请使用页面底部按钮打开。';
  1060. showFabToast(tip, 4000);
  1061. if (typeof uni !== 'undefined' && typeof uni.showToast === 'function') {
  1062. uni.showToast({ title: tip, icon: 'none', duration: 2800 });
  1063. } else if (isWeChatInAppBrowser() && isWxDebugOn()) {
  1064. window.alert(tip);
  1065. }
  1066. }
  1067. /** 与公众平台「JS接口安全域名」一致;分享页实际打开的 host 必须在此列表中 */
  1068. var WECHAT_JS_SAFE_HOSTS = ['uat.ailien.shop', 'test.ailien.shop'];
  1069. function checkWxJsSafeDomainHint() {
  1070. var host = String(location.hostname || '').toLowerCase();
  1071. if (!host || host === 'localhost' || host === '127.0.0.1') return '';
  1072. if (WECHAT_JS_SAFE_HOSTS.indexOf(host) >= 0) return '';
  1073. return (
  1074. '当前页面域名为「' +
  1075. host +
  1076. '」,未在 WECHAT_JS_SAFE_HOSTS 中;请在公众号后台「JS接口安全域名」添加该域名(不含 https:// 与路径)。'
  1077. );
  1078. }
  1079. /** 详情页 onLoad 使用 storeId;分享链常为 id,补全 storeId 避免 App 内参数为空 */
  1080. function buildAppOpenQueryString() {
  1081. var raw = (location.search && location.search.charAt(0) === '?') ? location.search.slice(1) : (location.search || '');
  1082. var params = new URLSearchParams(raw);
  1083. var sid = params.get('storeId') || params.get('id') || '';
  1084. if (sid && !params.get('storeId')) params.set('storeId', sid);
  1085. var qs = params.toString();
  1086. return qs ? ('?' + qs) : '';
  1087. }
  1088. /**
  1089. * 按 URL 参数 businessSection 打开对应 App 页:
  1090. * 1 → delicacyDetails,2 → barDetails,3 → lifeDetails
  1091. * 关店 businessStatus=99 时进 pages/index/login(见 isClosedMerchantForAppOpen)。
  1092. */
  1093. function getAppUniPathForBusinessSection() {
  1094. if (isClosedMerchantForAppOpen()) {
  1095. return 'pages/index/login';
  1096. }
  1097. var bs = String(q('businessSection') || '').trim();
  1098. if (bs === '1') {
  1099. return 'pages/ieisureEntertainment/eightTypeList/delicacyDetails';
  1100. }
  1101. if (bs === '2') {
  1102. return 'pages/ieisureEntertainment/eightTypeList/barDetails';
  1103. }
  1104. if (bs === '3') {
  1105. return 'pages/ieisureEntertainment/eightTypeList/lifeDetails';
  1106. }
  1107. return String(APP_UNI_STORE_PATH || 'pages/ieisureEntertainment/eightTypeList/delicacyDetails').replace(/^\//, '');
  1108. }
  1109. function buildAppDeepLink() {
  1110. var path = getAppUniPathForBusinessSection().replace(/^\//, '');
  1111. var s = buildAppOpenQueryString();
  1112. var root = APP_IOS_URL_SCHEME.replace(/\/$/, '');
  1113. if (!s) return root + '/' + path;
  1114. return root + '/' + path + s;
  1115. }
  1116. function isWeChatInAppBrowser() {
  1117. return /MicroMessenger/i.test(navigator.userAgent || '');
  1118. }
  1119. function getWeChatJssdkSignRequestUrl() {
  1120. var custom = String(q('wxSignPath') || q('wxSignUrl') || '').trim();
  1121. if (!custom) return '';
  1122. if (/^https?:\/\//i.test(custom)) return custom;
  1123. return API_BASE.replace(/\/$/, '') + (custom.charAt(0) === '/' ? custom : '/' + custom);
  1124. }
  1125. /** 微信 JSSDK 参与签名的 url:完整链(含 ?),不含 # */
  1126. function getWxSignUrlFull() {
  1127. var forced = String(q('wxSignUrl') || '').trim();
  1128. if (forced) return forced.split('#')[0];
  1129. if (location.origin && /^https?:/i.test(location.origin)) {
  1130. return (
  1131. location.origin +
  1132. (location.pathname || '/h5/HBuilderProjects/shareIndex.html') +
  1133. (location.search || '')
  1134. );
  1135. }
  1136. var href = String(location.href || '').split('#')[0];
  1137. if (href && href.indexOf('file:') !== 0) return href;
  1138. return WX_GET_CONFIG_SIGN_URL;
  1139. }
  1140. /** 无 query 的页面地址(后端若只签该地址,须配合 syncBrowserUrlForWxSign) */
  1141. function getWxSignUrlBase() {
  1142. if (location.origin && /^https?:/i.test(location.origin)) {
  1143. return location.origin + (location.pathname || '/h5/HBuilderProjects/shareIndex.html');
  1144. }
  1145. return WX_GET_CONFIG_SIGN_URL;
  1146. }
  1147. function getWxConfigSignUrl() {
  1148. if (String(q('wxSignBaseOnly') || '') === '1') return getWxSignUrlBase();
  1149. return getWxSignUrlFull();
  1150. }
  1151. /**
  1152. * 微信校验签名用的是地址栏当前 url(不含#)。
  1153. * 若后端只签了无参地址,须先把地址栏 sync 成与签名 url 一致再 wx.config。
  1154. */
  1155. function syncBrowserUrlForWxSign(signUrl) {
  1156. var target = String(signUrl || '').split('#')[0];
  1157. if (!target) return;
  1158. var hash = location.hash || '';
  1159. var current = String(location.href || '').split('#')[0];
  1160. if (current !== target) {
  1161. history.replaceState(history.state, document.title, target + hash);
  1162. }
  1163. }
  1164. /** 唤起 App 的 extinfo:保留完整分享链 */
  1165. function getPageUrlForWxSign() {
  1166. return getWxSignUrlFull();
  1167. }
  1168. function buildWxGetConfigRequestUrl(signPageUrl) {
  1169. var base = API_BASE.replace(/\/$/, '');
  1170. return (
  1171. base +
  1172. WECHAT_GET_WX_CONFIG_PATH +
  1173. '?url=' +
  1174. encodeURIComponent(signPageUrl || getWxConfigSignUrl())
  1175. );
  1176. }
  1177. /**
  1178. * 微信开放标签 extinfo:优先传当前 H5 分享链(与 App 解析分享 URL 一致);
  1179. * 超长时再传 path+query JSON,最后才用 shopro://。
  1180. */
  1181. function buildWeChatLaunchExtinfo() {
  1182. var pageUrl = getPageUrlForWxSign();
  1183. if (pageUrl && pageUrl.length <= 1024) return pageUrl;
  1184. var path = getAppUniPathForBusinessSection().replace(/^\//, '');
  1185. var qs = buildAppOpenQueryString().replace(/^\?/, '');
  1186. try {
  1187. var pack = JSON.stringify({
  1188. path: path,
  1189. query: qs,
  1190. h5: pageUrl
  1191. });
  1192. if (pack.length <= 1024) return pack;
  1193. } catch (eJson) {}
  1194. var deep = buildAppDeepLink();
  1195. if (deep && deep.length <= 1024) return deep;
  1196. return pageUrl ? pageUrl.slice(0, 1024) : deep.slice(0, 1024);
  1197. }
  1198. function absH5AssetUrl(rel) {
  1199. rel = String(rel || '').replace(/^\//, '');
  1200. var origin = location.origin;
  1201. if (origin && origin !== 'null' && /^https?:/i.test(origin)) {
  1202. var dir = location.pathname.replace(/[^/]*$/, '');
  1203. return origin + dir + rel;
  1204. }
  1205. return H5_PAGE_BASE_FALLBACK + rel;
  1206. }
  1207. function resolveWxConfigAppIdFromSignData(d) {
  1208. if (!d || typeof d !== 'object') return '';
  1209. var mp =
  1210. d.mpAppId ||
  1211. d.mpAppid ||
  1212. d.officialAppId ||
  1213. d.officialAccountAppId ||
  1214. d.gzhAppId ||
  1215. d.serviceAppId;
  1216. if (mp != null && String(mp).trim() !== '') return String(mp).trim();
  1217. var fromQuery = String(q('wxMpAppId') || WECHAT_MP_APP_ID || '').trim();
  1218. if (fromQuery) return fromQuery;
  1219. var raw = d.appId || d.appid || d.wxAppId;
  1220. if (raw == null || String(raw).trim() === '') return '';
  1221. return String(raw).trim();
  1222. }
  1223. function normalizeWxJssdkSignPayload(res, signUrlUsed) {
  1224. if (!res || typeof res !== 'object') return null;
  1225. var d = res.data != null && typeof res.data === 'object' ? res.data : res;
  1226. if (!d || typeof d !== 'object') return null;
  1227. var appId = resolveWxConfigAppIdFromSignData(d);
  1228. var timestamp = d.timestamp != null ? d.timestamp : d.timeStamp;
  1229. var nonceStr = d.nonceStr || d.noncestr || d.nonce;
  1230. var signature = d.signature || d.sign;
  1231. if (!appId || timestamp == null || !nonceStr || !signature) return null;
  1232. var signedUrl =
  1233. d.signUrl != null && String(d.signUrl).trim() !== ''
  1234. ? String(d.signUrl).trim().split('#')[0]
  1235. : signUrlUsed != null && String(signUrlUsed).trim() !== ''
  1236. ? String(signUrlUsed).trim().split('#')[0]
  1237. : '';
  1238. return {
  1239. appId: String(appId),
  1240. timestamp: Number(timestamp),
  1241. nonceStr: String(nonceStr),
  1242. signature: String(signature),
  1243. signUrl: signedUrl
  1244. };
  1245. }
  1246. function getWxErrMsg(err) {
  1247. if (!err) return '';
  1248. if (err.errMsg) return String(err.errMsg);
  1249. if (typeof err === 'string') return err;
  1250. try {
  1251. return JSON.stringify(err);
  1252. } catch (e) {
  1253. return String(err);
  1254. }
  1255. }
  1256. function formatWxConfigErrorTip(err, signPageUrl) {
  1257. var errMsg = getWxErrMsg(err);
  1258. var tip = '微信 JSSDK 配置失败';
  1259. if (/require\s*subscribe/i.test(errMsg)) {
  1260. return (
  1261. tip +
  1262. ':' +
  1263. errMsg +
  1264. '。测试号须用当前微信号在 mp.weixin.qq.com/debug.cgi 关注后再打开本页。'
  1265. );
  1266. }
  1267. if (/invalid signature/i.test(errMsg)) {
  1268. var signUrl = signPageUrl || getWxSignUrlFull();
  1269. var pageNow = String(location.href || '').split('#')[0];
  1270. return (
  1271. tip +
  1272. ':签名无效。请让后端用与地址栏完全相同的 url 参与签名(不含#)。当前地址栏:' +
  1273. pageNow +
  1274. ';本次请求签名 url:' +
  1275. signUrl
  1276. );
  1277. }
  1278. if (/invalid appid/i.test(errMsg)) {
  1279. return tip + ':appId 无效,请使用已认证服务号的公众号 AppID。';
  1280. }
  1281. if (/invalid url/i.test(errMsg)) {
  1282. return tip + ':域名未在公众号 JS 接口安全域名中,或未在开放平台绑定域名与移动应用。';
  1283. }
  1284. if (errMsg) return tip + ':' + errMsg;
  1285. return tip + ',开放标签不可用。';
  1286. }
  1287. function fetchWeChatJssdkSign(signPageUrl) {
  1288. signPageUrl = signPageUrl || getWxConfigSignUrl();
  1289. var urls = [];
  1290. var custom = getWeChatJssdkSignRequestUrl();
  1291. if (custom) {
  1292. var sep0 = custom.indexOf('?') >= 0 ? '&' : '?';
  1293. urls.push(custom + sep0 + 'url=' + encodeURIComponent(signPageUrl));
  1294. } else {
  1295. urls.push(buildWxGetConfigRequestUrl(signPageUrl));
  1296. }
  1297. function tryUrl(idx) {
  1298. if (idx >= urls.length) return Promise.resolve(null);
  1299. return fetch(urls[idx], {
  1300. method: 'GET',
  1301. mode: 'cors',
  1302. credentials: 'omit',
  1303. headers: { Accept: 'application/json' }
  1304. })
  1305. .then(function (r) {
  1306. if (!r.ok) throw new Error('HTTP ' + r.status);
  1307. return r.json();
  1308. })
  1309. .then(function (res) {
  1310. if (res && res.code != null) {
  1311. var c = Number(res.code);
  1312. if (c !== 200 && c !== 0 && res.success !== true) {
  1313. throw new Error(res.msg || 'sign rejected');
  1314. }
  1315. }
  1316. var pack = normalizeWxJssdkSignPayload(res, signPageUrl);
  1317. if (!pack) throw new Error('empty sign payload');
  1318. return pack;
  1319. })
  1320. .catch(function () {
  1321. return tryUrl(idx + 1);
  1322. });
  1323. }
  1324. return tryUrl(0);
  1325. }
  1326. function applyWxConfig(sign, signPageUrl) {
  1327. var urlForWx =
  1328. sign.signUrl && String(sign.signUrl).trim() !== ''
  1329. ? String(sign.signUrl).trim()
  1330. : signPageUrl;
  1331. syncBrowserUrlForWxSign(urlForWx);
  1332. console.log('[wx.config] appId=', sign.appId, 'signUrl=', urlForWx, 'page=', location.href.split('#')[0]);
  1333. return new Promise(function (resolve) {
  1334. wx.config({
  1335. debug: String(q('wxDebug') || '') === '1',
  1336. appId: sign.appId,
  1337. timestamp: sign.timestamp,
  1338. nonceStr: sign.nonceStr,
  1339. signature: sign.signature,
  1340. jsApiList: ['checkJsApi'],
  1341. openTagList: ['wx-open-launch-app']
  1342. });
  1343. wx.ready(function () {
  1344. weChatJssdkConfigured = true;
  1345. reportWxDebug('wx.ready / config:ok', { errMsg: 'config:ok' }, [
  1346. 'appId(config)=' + sign.appId,
  1347. 'openTag appid=' + WECHAT_OPEN_APP_ID,
  1348. 'signUrl=' + urlForWx,
  1349. 'page=' + location.href.split('#')[0],
  1350. '开放标签层=' + (isWeChatInAppBrowser() ? '已启用' : '非微信')
  1351. ]);
  1352. if (wxSignUrlFullBeforeStrip) {
  1353. var restore = wxSignUrlFullBeforeStrip + (location.hash || '');
  1354. history.replaceState(history.state, document.title, restore);
  1355. wxSignUrlFullBeforeStrip = '';
  1356. }
  1357. var tag = document.getElementById('launch-btn');
  1358. if (tag) {
  1359. try {
  1360. tag.setAttribute('extinfo', buildWeChatLaunchExtinfo());
  1361. } catch (eReady) {}
  1362. }
  1363. updateFabOpenLayer();
  1364. setTimeout(updateFabOpenLayer, 300);
  1365. setTimeout(updateFabOpenLayer, 1000);
  1366. resolve(true);
  1367. });
  1368. wx.error(function (err) {
  1369. var errMsg = getWxErrMsg(err);
  1370. console.warn('[wx.config]', err, 'signUrl=', urlForWx);
  1371. reportWxDebug('wx.error / config:fail', err, [
  1372. '完整 errMsg=' + errMsg,
  1373. 'appId(config)=' + sign.appId,
  1374. 'signUrl=' + urlForWx,
  1375. 'page=' + location.href.split('#')[0]
  1376. ]);
  1377. var baseUrl = getWxSignUrlBase();
  1378. var fullUrl = getWxSignUrlFull();
  1379. if (
  1380. !/invalid signature/i.test(errMsg) ||
  1381. wxConfigSignRetriedBaseUrl ||
  1382. baseUrl === fullUrl ||
  1383. urlForWx === baseUrl
  1384. ) {
  1385. weChatJssdkConfigured = false;
  1386. updateFabOpenLayer();
  1387. showAppOpenFailTip(formatWxConfigErrorTip(err, urlForWx));
  1388. resolve(false);
  1389. return;
  1390. }
  1391. wxConfigSignRetriedBaseUrl = true;
  1392. wxSignUrlFullBeforeStrip = fullUrl;
  1393. console.warn('[wx.config] retry with base url (no query):', baseUrl);
  1394. fetchWeChatJssdkSign(baseUrl)
  1395. .then(function (sign2) {
  1396. if (!sign2) {
  1397. weChatJssdkConfigured = false;
  1398. updateFabOpenLayer();
  1399. showAppOpenFailTip(formatWxConfigErrorTip(err, urlForWx));
  1400. resolve(false);
  1401. return;
  1402. }
  1403. applyWxConfig(sign2, baseUrl).then(resolve);
  1404. })
  1405. .catch(function () {
  1406. weChatJssdkConfigured = false;
  1407. updateFabOpenLayer();
  1408. showAppOpenFailTip(formatWxConfigErrorTip(err, urlForWx));
  1409. resolve(false);
  1410. });
  1411. });
  1412. });
  1413. }
  1414. function isWxOpenLaunchTagReady() {
  1415. var tag = document.getElementById('launch-btn');
  1416. if (!tag) return false;
  1417. if ((tag.offsetHeight || 0) >= 40 && (tag.offsetWidth || 0) >= 100) return true;
  1418. try {
  1419. if (tag.shadowRoot) {
  1420. var inner = tag.shadowRoot.querySelector('button');
  1421. if (inner && (inner.offsetHeight || 0) >= 40) return true;
  1422. }
  1423. } catch (eSh) {}
  1424. return false;
  1425. }
  1426. function tryTriggerWxOpenLaunchApp() {
  1427. var tag = document.getElementById('launch-btn');
  1428. if (!tag) return false;
  1429. try {
  1430. if (tag.shadowRoot) {
  1431. var inner = tag.shadowRoot.querySelector('button');
  1432. if (inner && typeof inner.click === 'function') {
  1433. inner.click();
  1434. return true;
  1435. }
  1436. }
  1437. if (typeof tag.click === 'function') {
  1438. tag.click();
  1439. return true;
  1440. }
  1441. } catch (eWx) {
  1442. console.warn('[wx-open-launch-app] trigger', eWx);
  1443. }
  1444. return false;
  1445. }
  1446. /**
  1447. * 仅当开放标签在真机已渲染出可点区域时,才用透明层盖住 #openApp;
  1448. * 否则保持 #openApp 可点,避免「点了没反应」。
  1449. */
  1450. function updateFabOpenLayer() {
  1451. var dock = document.getElementById('fabDock');
  1452. var hit = document.getElementById('fabWxHit');
  1453. var useWx =
  1454. isWeChatInAppBrowser() && weChatJssdkConfigured && isWxOpenLaunchTagReady();
  1455. if (dock) {
  1456. if (useWx) dock.classList.add('wx-open-enabled');
  1457. else dock.classList.remove('wx-open-enabled');
  1458. }
  1459. if (hit) hit.setAttribute('aria-hidden', useWx ? 'false' : 'true');
  1460. }
  1461. var openAppFabClickLock = 0;
  1462. function handleOpenAppFabClick() {
  1463. var now = Date.now();
  1464. if (now - openAppFabClickLock < 500) return;
  1465. openAppFabClickLock = now;
  1466. tryOpenHBuilderApp();
  1467. }
  1468. function bindOpenAppFabClick() {
  1469. var slot = document.querySelector('.fab-dock__slot');
  1470. var btn = document.getElementById('openApp');
  1471. function onFabActivate(e) {
  1472. if (e && e.cancelable) e.preventDefault();
  1473. handleOpenAppFabClick();
  1474. }
  1475. if (btn) {
  1476. btn.addEventListener('click', onFabActivate);
  1477. }
  1478. if (slot) {
  1479. slot.addEventListener(
  1480. 'touchend',
  1481. function (e) {
  1482. if (e.cancelable) e.preventDefault();
  1483. onFabActivate(e);
  1484. },
  1485. false
  1486. );
  1487. }
  1488. }
  1489. function bindWeChatLaunchTagEvents() {
  1490. var tag = document.getElementById('launch-btn');
  1491. if (!tag) return;
  1492. try {
  1493. tag.setAttribute('extinfo', buildWeChatLaunchExtinfo());
  1494. } catch (eExt) {}
  1495. tag.addEventListener('launch', function (e) {
  1496. console.log('[wx-open-launch-app] launch ok', e && e.detail);
  1497. reportWxDebug('wx-open-launch-app launch', e && e.detail ? e.detail : { errMsg: 'launch:ok' }, [
  1498. 'extinfo=' + (tag.getAttribute('extinfo') || '').slice(0, 200)
  1499. ]);
  1500. });
  1501. tag.addEventListener('error', function (e) {
  1502. var detail = e && e.detail;
  1503. console.warn('[wx-open-launch-app]', detail);
  1504. reportWxDebug('wx-open-launch-app error', detail, [
  1505. 'openTag appid=' + WECHAT_OPEN_APP_ID,
  1506. '完整 errMsg=' +
  1507. (detail && detail.errMsg
  1508. ? String(detail.errMsg)
  1509. : detail && detail.errmsg
  1510. ? String(detail.errmsg)
  1511. : '(无)')
  1512. ]);
  1513. weChatJssdkConfigured = false;
  1514. updateFabOpenLayer();
  1515. var errMsg =
  1516. detail && detail.errMsg
  1517. ? String(detail.errMsg)
  1518. : detail && detail.errmsg
  1519. ? String(detail.errmsg)
  1520. : '';
  1521. if (/launch:fail/i.test(errMsg)) {
  1522. showAppOpenFailTip(
  1523. '微信未能唤起 App(' +
  1524. errMsg +
  1525. ')。请确认已安装 App,且移动应用已与公众号关联。'
  1526. );
  1527. } else {
  1528. showAppOpenFailTip();
  1529. }
  1530. });
  1531. }
  1532. /**
  1533. * 进入页即 GET /wx/getWxConfig(任意浏览器都会请求,便于联调);
  1534. * 仅微信内且签名成功后再 wx.config + 展示开放标签按钮。
  1535. */
  1536. function initWeChatOpenLaunchApp() {
  1537. var inWx = isWeChatInAppBrowser();
  1538. wxConfigSignRetriedBaseUrl = false;
  1539. var signPageUrl = getWxConfigSignUrl();
  1540. var reqUrl = buildWxGetConfigRequestUrl(signPageUrl);
  1541. if (inWx) {
  1542. var domainHint = checkWxJsSafeDomainHint();
  1543. if (domainHint) {
  1544. console.warn('[wx]', domainHint);
  1545. showAppOpenFailTip(domainHint);
  1546. }
  1547. }
  1548. console.log('[wx] GET', reqUrl);
  1549. return fetchWeChatJssdkSign(signPageUrl)
  1550. .then(function (sign) {
  1551. if (!inWx) {
  1552. if (!sign) {
  1553. console.warn('[wx] getWxConfig empty (non-wechat preview)');
  1554. }
  1555. return false;
  1556. }
  1557. if (typeof wx === 'undefined') {
  1558. console.warn('[wx] jweixin not loaded');
  1559. return false;
  1560. }
  1561. bindWeChatLaunchTagEvents();
  1562. if (!sign) {
  1563. console.warn('[wx] GET ' + WECHAT_GET_WX_CONFIG_PATH + ' — empty or invalid sign payload');
  1564. showAppOpenFailTip(
  1565. '微信 JSSDK:getWxConfig 未返回可用的 appId/timestamp/nonceStr/signature。'
  1566. );
  1567. return false;
  1568. }
  1569. return applyWxConfig(sign, signPageUrl);
  1570. })
  1571. .catch(function (e) {
  1572. console.warn('[wx] init failed', e);
  1573. return false;
  1574. });
  1575. }
  1576. function isCustomAppSchemeUrl(url) {
  1577. var s = String(url || '').trim();
  1578. if (!s) return false;
  1579. if (/^https?:/i.test(s)) return false;
  1580. return /^[a-z][a-z0-9+.-]*:/i.test(s);
  1581. }
  1582. function launchAppDeepLink(deepLink) {
  1583. deepLink = String(deepLink || '').trim();
  1584. if (!deepLink) return;
  1585. if (isCustomAppSchemeUrl(deepLink)) {
  1586. var anchor = document.getElementById('appDeepLinkAnchor');
  1587. if (!anchor) {
  1588. anchor = document.createElement('a');
  1589. anchor.id = 'appDeepLinkAnchor';
  1590. anchor.setAttribute('aria-hidden', 'true');
  1591. anchor.style.cssText =
  1592. 'position:fixed;left:-9999px;top:0;width:1px;height:1px;opacity:0;pointer-events:none;';
  1593. document.body.appendChild(anchor);
  1594. }
  1595. anchor.setAttribute('href', deepLink);
  1596. anchor.click();
  1597. return;
  1598. }
  1599. try {
  1600. window.location.href = deepLink;
  1601. } catch (eHref) {}
  1602. }
  1603. /**
  1604. * 有 plus:检测 App 是否安装后 openURL;深链形如 shopro://{APP_UNI_STORE_PATH}?…
  1605. * 系统浏览器:scheme 唤起;微信内优先 wx-open-launch-app,失败再 scheme(不再弹「在浏览器中打开」)。
  1606. */
  1607. function tryOpenHBuilderApp() {
  1608. var inWx = isWeChatInAppBrowser();
  1609. showFabToast('正在尝试打开 U店在哪…');
  1610. if (inWx && !weChatJssdkConfigured) {
  1611. showAppOpenFailTip(
  1612. '微信 JSSDK 未就绪:请先关注测试号并确保 wx.config 成功。链接可加 wxDebug=1 查看 config 报错。'
  1613. );
  1614. launchAppDeepLink(buildAppDeepLink());
  1615. return;
  1616. }
  1617. if (inWx && weChatJssdkConfigured) {
  1618. if (isWxOpenLaunchTagReady()) {
  1619. tryTriggerWxOpenLaunchApp();
  1620. } else {
  1621. showFabToast('开放标签未加载,正在尝试深链唤起…');
  1622. }
  1623. }
  1624. var deepLink = buildAppDeepLink();
  1625. if (typeof plus !== 'undefined' && plus.runtime) {
  1626. var installed = null;
  1627. try {
  1628. if (typeof plus.runtime.isApplicationExist === 'function') {
  1629. installed = plus.runtime.isApplicationExist({
  1630. pname: APP_ANDROID_PACKAGE,
  1631. action: APP_IOS_URL_SCHEME
  1632. });
  1633. }
  1634. } catch (e) {
  1635. console.warn(e);
  1636. }
  1637. try {
  1638. plus.runtime.openURL(deepLink);
  1639. } catch (e2) {
  1640. console.warn(e2);
  1641. if (installed === false) {
  1642. showDownloadTip();
  1643. } else if (!inWx) {
  1644. showAppOpenFailTip();
  1645. }
  1646. }
  1647. return;
  1648. }
  1649. var done = false;
  1650. function finish() {
  1651. if (done) return;
  1652. done = true;
  1653. document.removeEventListener('visibilitychange', onVis);
  1654. window.removeEventListener('pagehide', onHide);
  1655. }
  1656. function onVis() {
  1657. if (document.visibilityState === 'hidden') finish();
  1658. }
  1659. function onHide() {
  1660. finish();
  1661. }
  1662. document.addEventListener('visibilitychange', onVis);
  1663. window.addEventListener('pagehide', onHide);
  1664. try {
  1665. launchAppDeepLink(deepLink);
  1666. } catch (e3) {
  1667. finish();
  1668. if (!inWx) showAppOpenFailTip();
  1669. return;
  1670. }
  1671. /**
  1672. * 微信内 scheme 常被拦截且页面仍 visible,原 2.6s 后 showDownloadTip 会误报「请到应用商店下载」。
  1673. * 与 shareDynamic 一致:超时仅收尾,不弹下载提示。
  1674. */
  1675. window.setTimeout(function () {
  1676. finish();
  1677. }, 3200);
  1678. }
  1679. function qs() {
  1680. return new URLSearchParams(location.search || '');
  1681. }
  1682. function q(name) {
  1683. var v = qs().get(name);
  1684. return v == null ? '' : String(v);
  1685. }
  1686. function showErr(msg) {
  1687. var el = document.getElementById('pageError');
  1688. el.textContent = msg;
  1689. el.style.display = 'block';
  1690. }
  1691. function getStoreId() {
  1692. return q('id') || q('storeId');
  1693. }
  1694. function shouldShowPerformanceSection() {
  1695. return String(q('businessSection') || '').trim() === '2';
  1696. }
  1697. function apiFetch(path) {
  1698. return fetch(API_BASE + path, {
  1699. method: 'GET',
  1700. mode: 'cors',
  1701. credentials: 'omit',
  1702. headers: { Accept: 'application/json' }
  1703. }).then(function (res) {
  1704. if (!res.ok) throw new Error('HTTP ' + res.status);
  1705. return res.json();
  1706. });
  1707. }
  1708. /** 进入页先拉店铺概要;与 shareDynamic.html fetchGetDeleteFlagByIdIfId 相同路径与 id 参数 */
  1709. function fetchStoreInfoGetOne(storeId) {
  1710. if (!storeId) return Promise.resolve(null);
  1711. var qs = new URLSearchParams();
  1712. qs.set('id', String(storeId).trim());
  1713. return apiFetch('/store/info/getOne?' + qs.toString()).catch(function (e) {
  1714. console.warn('[store/info/getOne]', e);
  1715. return null;
  1716. });
  1717. }
  1718. function isGetOneBusinessStatus99(res) {
  1719. if (!res || typeof res !== 'object') return false;
  1720. var d = res.data;
  1721. if (d && typeof d === 'object') {
  1722. var bs = d.businessStatus;
  1723. if (bs === 99 || bs === '99' || Number(bs) === 99) return true;
  1724. }
  1725. return false;
  1726. }
  1727. var MARKETING_PREVIEW_COUNT = 3;
  1728. var closedMerchantFlag = false;
  1729. /** 关店 businessStatus=99:getOne 已置 closedMerchantFlag,或 URL 带 businessStatus=99;唤起 App 时进登录页 */
  1730. function isClosedMerchantForAppOpen() {
  1731. if (closedMerchantFlag) return true;
  1732. var bs = String(q('businessStatus') || '').trim();
  1733. if (bs === '99' || Number(bs) === 99) return true;
  1734. return false;
  1735. }
  1736. var marketingListCache = [];
  1737. /** 避免详情先返回时用空 cache 误展示「暂无活动」图 */
  1738. var marketingCouponLoaded = false;
  1739. var staffGroupsCache = [];
  1740. var performanceListCache = { records: [], total: 0 };
  1741. function isMp4VideoUrl(url) {
  1742. if (!url || typeof url !== 'string') return false;
  1743. var path = url.split(/[?#]/)[0].toLowerCase();
  1744. return path.length >= 4 && path.slice(-4) === '.mp4';
  1745. }
  1746. function getMp4PlaybackUrl(url) {
  1747. var u = String(url || '').trim();
  1748. if (!u) return '';
  1749. var q = u.indexOf('?');
  1750. var h = u.indexOf('#');
  1751. var cut = u.length;
  1752. if (q >= 0) cut = Math.min(cut, q);
  1753. if (h >= 0) cut = Math.min(cut, h);
  1754. var base = u.slice(0, cut);
  1755. if (/\.mp4$/i.test(base)) return base;
  1756. return u;
  1757. }
  1758. function mp4UrlToJpgUrl(u) {
  1759. var q = u.indexOf('?');
  1760. var h = u.indexOf('#');
  1761. var cut = u.length;
  1762. if (q >= 0) cut = Math.min(cut, q);
  1763. if (h >= 0) cut = Math.min(cut, h);
  1764. var pathPart = u.slice(0, cut);
  1765. var rest = u.slice(cut);
  1766. if (!/\.mp4$/i.test(pathPart)) return '';
  1767. return pathPart.slice(0, -4) + '.jpg' + rest;
  1768. }
  1769. function createMarketingMedia(url) {
  1770. var wrap = document.createElement('div');
  1771. wrap.className = 'marketing-card__media';
  1772. var full = String(url == null ? '' : url).trim();
  1773. if (!full) return wrap;
  1774. if (isMp4VideoUrl(full)) {
  1775. var playUrl = getMp4PlaybackUrl(full);
  1776. var vid = document.createElement('video');
  1777. vid.src = playUrl;
  1778. vid.setAttribute('controls', '');
  1779. vid.setAttribute('playsinline', '');
  1780. vid.setAttribute('webkit-playsinline', '');
  1781. vid.muted = true;
  1782. vid.setAttribute('muted', '');
  1783. vid.setAttribute('autoplay', '');
  1784. vid.preload = 'auto';
  1785. var poster = '';
  1786. if (full.length > playUrl.length) poster = full;
  1787. else poster = mp4UrlToJpgUrl(playUrl);
  1788. if (poster) vid.setAttribute('poster', poster);
  1789. vid.addEventListener('canplay', function onCap() {
  1790. vid.removeEventListener('canplay', onCap);
  1791. var p = vid.play();
  1792. if (p && typeof p.catch === 'function') p.catch(function () {});
  1793. });
  1794. wrap.appendChild(vid);
  1795. } else {
  1796. var img = document.createElement('img');
  1797. img.src = full;
  1798. img.alt = '';
  1799. img.decoding = 'async';
  1800. wrap.appendChild(img);
  1801. }
  1802. return wrap;
  1803. }
  1804. function renderMarketingList(rawList) {
  1805. marketingListCache = Array.isArray(rawList) ? rawList.slice() : [];
  1806. var section = document.getElementById('shareMarketingSection');
  1807. var listEl = document.getElementById('marketingListEl');
  1808. var moreBtn = document.getElementById('marketingMoreBtn');
  1809. var moreText = document.getElementById('marketingMoreText');
  1810. if (!section || !listEl) return;
  1811. listEl.innerHTML = '';
  1812. section.classList.remove('is-expanded');
  1813. if (moreBtn) {
  1814. moreBtn.style.display = 'none';
  1815. moreBtn.setAttribute('aria-expanded', 'false');
  1816. }
  1817. if (closedMerchantFlag) {
  1818. section.style.display = 'none';
  1819. section.setAttribute('aria-hidden', 'true');
  1820. return;
  1821. }
  1822. var items = marketingListCache.filter(function (x) {
  1823. return x && x.imgUrl && String(x.imgUrl).trim();
  1824. }).filter(function (x) {
  1825. var t = x.activityType;
  1826. if (t == null || t === '') return true;
  1827. return String(t).toUpperCase() === 'MARKETING';
  1828. });
  1829. items.sort(function (a, b) {
  1830. var sa = Number(a.imgSort);
  1831. var sb = Number(b.imgSort);
  1832. if (isNaN(sa)) sa = 0;
  1833. if (isNaN(sb)) sb = 0;
  1834. return sa - sb;
  1835. });
  1836. if (!items.length) {
  1837. if (!marketingCouponLoaded) {
  1838. section.style.display = 'none';
  1839. section.setAttribute('aria-hidden', 'true');
  1840. return;
  1841. }
  1842. section.style.display = 'block';
  1843. section.setAttribute('aria-hidden', 'false');
  1844. var emptyWrap = document.createElement('div');
  1845. emptyWrap.className = 'marketing-section__empty';
  1846. emptyWrap.setAttribute('role', 'status');
  1847. var emptyImg = document.createElement('img');
  1848. emptyImg.src = 'images/empty.png';
  1849. emptyImg.alt = '';
  1850. emptyImg.decoding = 'async';
  1851. var emptyLabel = document.createElement('p');
  1852. emptyLabel.className = 'marketing-section__empty-label';
  1853. emptyLabel.textContent = '暂无活动';
  1854. emptyWrap.appendChild(emptyImg);
  1855. emptyWrap.appendChild(emptyLabel);
  1856. listEl.appendChild(emptyWrap);
  1857. return;
  1858. }
  1859. section.style.display = 'block';
  1860. section.setAttribute('aria-hidden', 'false');
  1861. items.forEach(function (item, idx) {
  1862. var card = document.createElement('article');
  1863. card.className = 'marketing-card';
  1864. if (idx >= MARKETING_PREVIEW_COUNT) card.classList.add('marketing-card--more');
  1865. card.appendChild(createMarketingMedia(item.imgUrl));
  1866. listEl.appendChild(card);
  1867. });
  1868. var extra = items.length - MARKETING_PREVIEW_COUNT;
  1869. if (extra > 0 && moreBtn && moreText) {
  1870. moreText.textContent = '查看剩余' + extra + '个活动';
  1871. moreBtn.style.display = 'flex';
  1872. }
  1873. }
  1874. function bindMarketingMore() {
  1875. var section = document.getElementById('shareMarketingSection');
  1876. var moreBtn = document.getElementById('marketingMoreBtn');
  1877. if (!section || !moreBtn || moreBtn.dataset.bound) return;
  1878. moreBtn.dataset.bound = '1';
  1879. moreBtn.addEventListener('click', function () {
  1880. section.classList.add('is-expanded');
  1881. moreBtn.style.display = 'none';
  1882. moreBtn.setAttribute('aria-expanded', 'true');
  1883. });
  1884. }
  1885. function createStaffCardElement(staff) {
  1886. var card = document.createElement('article');
  1887. card.className = 'staff-card';
  1888. var imgWrap = document.createElement('div');
  1889. imgWrap.className = 'staff-card__img-wrap';
  1890. var imgUrl = String(staff.staffImage || '').trim();
  1891. if (imgUrl) {
  1892. var img = document.createElement('img');
  1893. img.src = imgUrl;
  1894. img.alt = String(staff.name || '');
  1895. img.decoding = 'async';
  1896. img.loading = 'lazy';
  1897. imgWrap.appendChild(img);
  1898. }
  1899. var likes = document.createElement('div');
  1900. likes.className = 'staff-card__likes';
  1901. var lc = staff.likeCount != null ? Number(staff.likeCount) : 0;
  1902. if (isNaN(lc)) lc = 0;
  1903. likes.textContent = lc + '人喜欢';
  1904. imgWrap.appendChild(likes);
  1905. var nameRow = document.createElement('div');
  1906. nameRow.className = 'staff-card__name-row';
  1907. var nameEl = document.createElement('span');
  1908. nameEl.className = 'staff-card__name';
  1909. nameEl.textContent = String(staff.name != null ? staff.name : '').trim() || '—';
  1910. nameRow.appendChild(nameEl);
  1911. var perf = staff.hasPerformanceToday;
  1912. if (perf === true || perf === 1 || String(perf).toLowerCase() === 'true') {
  1913. var badge = document.createElement('span');
  1914. badge.className = 'staff-card__badge';
  1915. badge.textContent = '今日演出';
  1916. nameRow.appendChild(badge);
  1917. }
  1918. card.appendChild(imgWrap);
  1919. card.appendChild(nameRow);
  1920. var meta = document.createElement('div');
  1921. meta.className = 'staff-card__meta';
  1922. var pos = document.createElement('span');
  1923. pos.className = 'staff-card__position';
  1924. pos.textContent = String(staff.staffPosition || '').trim() || '\u00a0';
  1925. meta.appendChild(pos);
  1926. var pc = staff.positiveCommentsCount != null ? Number(staff.positiveCommentsCount) : 0;
  1927. if (!isNaN(pc) && pc > 0) {
  1928. var sep = document.createElement('span');
  1929. sep.className = 'staff-card__sep';
  1930. sep.textContent = '|';
  1931. var rev = document.createElement('span');
  1932. rev.className = 'staff-card__reviews';
  1933. rev.textContent = '好评' + pc + '次';
  1934. meta.appendChild(sep);
  1935. meta.appendChild(rev);
  1936. }
  1937. card.appendChild(meta);
  1938. return card;
  1939. }
  1940. function createPerformanceCardElement(row) {
  1941. var card = document.createElement('article');
  1942. card.className = 'performance-card';
  1943. var posterWrap = document.createElement('div');
  1944. posterWrap.className = 'performance-card__poster';
  1945. var posterUrl = String(row.performancePoster || '').trim();
  1946. if (posterUrl) {
  1947. var img = document.createElement('img');
  1948. img.src = posterUrl;
  1949. img.alt = String(row.performanceName || '');
  1950. img.decoding = 'async';
  1951. img.loading = 'lazy';
  1952. posterWrap.appendChild(img);
  1953. }
  1954. var body = document.createElement('div');
  1955. body.className = 'performance-card__body';
  1956. var nameEl = document.createElement('div');
  1957. nameEl.className = 'performance-card__name';
  1958. nameEl.textContent = String(row.performanceName != null ? row.performanceName : '').trim() || '—';
  1959. body.appendChild(nameEl);
  1960. var dr = String(row.dateRange || '').trim();
  1961. if (dr) {
  1962. var line1 = document.createElement('div');
  1963. line1.className = 'performance-card__meta';
  1964. line1.textContent = dr;
  1965. body.appendChild(line1);
  1966. }
  1967. var si = String(row.scheduleInfo || '').trim();
  1968. if (si) {
  1969. var line2 = document.createElement('div');
  1970. line2.className = 'performance-card__meta';
  1971. line2.textContent = si;
  1972. line2.title = si;
  1973. body.appendChild(line2);
  1974. }
  1975. card.appendChild(posterWrap);
  1976. card.appendChild(body);
  1977. return card;
  1978. }
  1979. function renderPerformanceList() {
  1980. var section = document.getElementById('sharePerformanceSection');
  1981. var titleEl = document.getElementById('performanceSectionTitle');
  1982. var strip = document.getElementById('performanceStripEl');
  1983. if (!section || !titleEl || !strip) return;
  1984. strip.innerHTML = '';
  1985. if (!shouldShowPerformanceSection()) {
  1986. section.style.display = 'none';
  1987. section.setAttribute('aria-hidden', 'true');
  1988. return;
  1989. }
  1990. if (closedMerchantFlag) {
  1991. section.style.display = 'none';
  1992. section.setAttribute('aria-hidden', 'true');
  1993. return;
  1994. }
  1995. var records = performanceListCache.records;
  1996. var total = performanceListCache.total;
  1997. if (isNaN(total)) total = records.length;
  1998. titleEl.textContent = '演出安排(' + total + ')';
  1999. if (!records.length) {
  2000. section.style.display = 'none';
  2001. section.setAttribute('aria-hidden', 'true');
  2002. return;
  2003. }
  2004. section.style.display = 'block';
  2005. section.setAttribute('aria-hidden', 'false');
  2006. records.forEach(function (row) {
  2007. if (!row) return;
  2008. strip.appendChild(createPerformanceCardElement(row));
  2009. });
  2010. }
  2011. function renderStaffGroups(raw) {
  2012. staffGroupsCache = Array.isArray(raw) ? raw.slice() : [];
  2013. var section = document.getElementById('shareStaffSection');
  2014. var mount = document.getElementById('staffGroupsMount');
  2015. if (!section || !mount) return;
  2016. var totalStaff = 0;
  2017. staffGroupsCache.forEach(function (g) {
  2018. if (g && Array.isArray(g.staffList)) totalStaff += g.staffList.length;
  2019. });
  2020. var countEl = document.getElementById('staffSectionCountEl');
  2021. if (countEl) countEl.textContent = String(totalStaff);
  2022. mount.innerHTML = '';
  2023. if (closedMerchantFlag) {
  2024. section.style.display = 'none';
  2025. section.setAttribute('aria-hidden', 'true');
  2026. return;
  2027. }
  2028. var groups = staffGroupsCache.filter(function (g) {
  2029. return g && Array.isArray(g.staffList) && g.staffList.length;
  2030. });
  2031. if (!groups.length) {
  2032. section.style.display = 'none';
  2033. section.setAttribute('aria-hidden', 'true');
  2034. return;
  2035. }
  2036. section.style.display = 'block';
  2037. section.setAttribute('aria-hidden', 'false');
  2038. groups.forEach(function (group) {
  2039. var wrap = document.createElement('div');
  2040. wrap.className = 'staff-group';
  2041. if (group.titleId != null) wrap.dataset.titleId = String(group.titleId);
  2042. var strip = document.createElement('div');
  2043. strip.className = 'staff-strip';
  2044. group.staffList.forEach(function (staff) {
  2045. if (!staff) return;
  2046. strip.appendChild(createStaffCardElement(staff));
  2047. });
  2048. wrap.appendChild(strip);
  2049. mount.appendChild(wrap);
  2050. });
  2051. }
  2052. function bindStaffSection() {
  2053. var btn = document.getElementById('staffSectionAllBtn');
  2054. if (!btn || btn.dataset.bound) return;
  2055. btn.dataset.bound = '1';
  2056. btn.addEventListener('click', function (e) {
  2057. e.preventDefault();
  2058. tryOpenHBuilderApp();
  2059. });
  2060. }
  2061. function buildHeroSlides(urls) {
  2062. var track = document.getElementById('heroTrack');
  2063. var dotsWrap = document.getElementById('heroDots');
  2064. track.innerHTML = '';
  2065. dotsWrap.innerHTML = '';
  2066. var list = (urls || []).filter(Boolean);
  2067. if (!list.length) {
  2068. var slide = document.createElement('div');
  2069. slide.className = 'hero__slide';
  2070. var img = document.createElement('img');
  2071. img.src = 'images/hero.png';
  2072. img.alt = '店铺';
  2073. slide.appendChild(img);
  2074. track.appendChild(slide);
  2075. var dot = document.createElement('span');
  2076. dot.className = 'hero__dot is-active';
  2077. dotsWrap.appendChild(dot);
  2078. return initHeroCarousel(1);
  2079. }
  2080. list.forEach(function (url, d) {
  2081. var slide = document.createElement('div');
  2082. slide.className = 'hero__slide';
  2083. var img = document.createElement('img');
  2084. img.src = url;
  2085. img.alt = '店铺图';
  2086. slide.appendChild(img);
  2087. track.appendChild(slide);
  2088. var dot = document.createElement('span');
  2089. dot.className = 'hero__dot' + (d === 0 ? ' is-active' : '');
  2090. dotsWrap.appendChild(dot);
  2091. });
  2092. initHeroCarousel(list.length);
  2093. }
  2094. var heroI = 0;
  2095. var heroTimer = null;
  2096. function initHeroCarousel(slides) {
  2097. var track = document.getElementById('heroTrack');
  2098. var dotsWrap = document.getElementById('heroDots');
  2099. var dots = dotsWrap.querySelectorAll('.hero__dot');
  2100. if (slides < 2) return;
  2101. function go(n) {
  2102. heroI = (n + slides) % slides;
  2103. track.style.transform = 'translateX(' + (-heroI * 100) + '%)';
  2104. dots.forEach(function (el, idx) {
  2105. el.classList.toggle('is-active', idx === heroI);
  2106. });
  2107. }
  2108. if (heroTimer) clearInterval(heroTimer);
  2109. heroTimer = setInterval(function () { go(heroI + 1); }, 4000);
  2110. var hero = document.getElementById('hero');
  2111. var startX = 0;
  2112. hero.addEventListener('touchstart', function (e) {
  2113. startX = e.changedTouches[0].clientX;
  2114. }, { passive: true });
  2115. hero.addEventListener('touchend', function (e) {
  2116. var dx = e.changedTouches[0].clientX - startX;
  2117. if (Math.abs(dx) > 40) go(dx < 0 ? heroI + 1 : heroI - 1);
  2118. }, { passive: true });
  2119. }
  2120. function timeToMinutes(t) {
  2121. var parts = String(t || '').trim().split(':');
  2122. var h = parseInt(parts[0], 10) || 0;
  2123. var m = parseInt(parts[1], 10) || 0;
  2124. return h * 60 + m;
  2125. }
  2126. function isTimeInRange(startTime, endTime) {
  2127. var s = String(startTime || '').trim();
  2128. var e = String(endTime || '').trim();
  2129. if (s === '00:00' && e === '00:00') return true;
  2130. if (s === '00:00' && e === '23:59') return true;
  2131. var cur = new Date().getHours() * 60 + new Date().getMinutes();
  2132. var sm = timeToMinutes(s);
  2133. var em = timeToMinutes(e);
  2134. if (em < sm) {
  2135. return cur >= sm || cur <= em;
  2136. }
  2137. return cur >= sm && cur <= em;
  2138. }
  2139. function parseHolidayDate(str) {
  2140. if (!str) return null;
  2141. var d = new Date(String(str).trim().replace(/-/g, '/'));
  2142. return isNaN(d.getTime()) ? null : d;
  2143. }
  2144. function isTodayInHolidayRange(holidayInfo) {
  2145. if (!holidayInfo) return false;
  2146. var hi = holidayInfo;
  2147. if (typeof hi === 'string') {
  2148. try {
  2149. hi = JSON.parse(hi);
  2150. } catch (err) {
  2151. return false;
  2152. }
  2153. }
  2154. var start = hi.startDate || hi.holidayStartDate || hi.beginDate || hi.start || hi.holidayStart;
  2155. var end = hi.endDate || hi.holidayEndDate || hi.finishDate || hi.end || hi.holidayEnd;
  2156. if (!start || !end) return false;
  2157. var startD = parseHolidayDate(start);
  2158. var endD = parseHolidayDate(end);
  2159. if (!startD || !endD) return false;
  2160. var today = new Date();
  2161. today.setHours(0, 0, 0, 0);
  2162. startD.setHours(0, 0, 0, 0);
  2163. endD.setHours(0, 0, 0, 0);
  2164. return today >= startD && today <= endD;
  2165. }
  2166. function findNormalBusinessInfo(list) {
  2167. var wdJs = new Date().getDay();
  2168. var i;
  2169. var x;
  2170. var w;
  2171. for (i = 0; i < list.length; i++) {
  2172. x = list[i];
  2173. if (!x || x.holidayInfo) continue;
  2174. w = x.weekDay != null ? x.weekDay : x.week;
  2175. if (w === undefined || w === null) continue;
  2176. if (Number(w) === wdJs) return x;
  2177. }
  2178. var wdMap = wdJs === 0 ? 7 : wdJs;
  2179. for (i = 0; i < list.length; i++) {
  2180. x = list[i];
  2181. if (!x || x.holidayInfo) continue;
  2182. w = x.weekDay != null ? x.weekDay : x.week;
  2183. if (w === undefined || w === null) continue;
  2184. if (Number(w) === wdMap) return x;
  2185. }
  2186. for (i = 0; i < list.length; i++) {
  2187. x = list[i];
  2188. if (x && !x.holidayInfo && (x.startTime || x.endTime)) return x;
  2189. }
  2190. return null;
  2191. }
  2192. /** 营业状态:暂停营业 | 商家暂未配置营业时间 | 休息中 | 营业中 xx:xx至xx:xx | 营业中 全天营业 */
  2193. function computeBusinessStatusDisplay(d) {
  2194. if (!d) return { text: '—', isOpen: false };
  2195. if (Number(d.businessStatus) === 99) {
  2196. return { text: '商户已关闭', isOpen: false };
  2197. }
  2198. if (Number(d.businessStatus) === 1) {
  2199. return { text: '暂停营业', isOpen: false };
  2200. }
  2201. var list = d.storeBusinessInfoVos || d.storeBusinessInfos || [];
  2202. if (!list.length) {
  2203. return { text: '商家暂未配置营业时间', isOpen: false };
  2204. }
  2205. var holidayList = Array.isArray(d.holidayBusinessInfoList) && d.holidayBusinessInfoList.length
  2206. ? d.holidayBusinessInfoList
  2207. : list.filter(function (item) { return item && item.holidayInfo; });
  2208. var todayHolidayItem = holidayList.find(function (item) {
  2209. return isTodayInHolidayRange(item.holidayInfo);
  2210. });
  2211. var normal = d.normalBusinessInfo || d.normalBusinessInfoVo || findNormalBusinessInfo(list);
  2212. var isOpen = false;
  2213. var currentItem = null;
  2214. if (todayHolidayItem) {
  2215. isOpen = isTimeInRange(todayHolidayItem.startTime, todayHolidayItem.endTime);
  2216. currentItem = todayHolidayItem;
  2217. } else if (normal) {
  2218. isOpen = isTimeInRange(normal.startTime, normal.endTime);
  2219. currentItem = normal;
  2220. }
  2221. if (!currentItem) return { text: '休息中', isOpen: false };
  2222. if (!isOpen) return { text: '休息中', isOpen: false };
  2223. var st = String(currentItem.startTime || '').trim();
  2224. var et = String(currentItem.endTime || '').trim();
  2225. if (st === '00:00' && et === '00:00') return { text: '营业中 全天营业', isOpen: true };
  2226. if (st === '00:00' && et === '23:59') return { text: '营业中 全天营业', isOpen: true };
  2227. var needNextDay = timeToMinutes(et) < timeToMinutes(st);
  2228. var suffix = (needNextDay ? '次日' : '') + et;
  2229. return { text: ('营业中 ' + st + ' 至 ' + suffix).trim(), isOpen: true };
  2230. }
  2231. /**
  2232. * 分项评分:可能在 storeEvaluate 对象内,或为 JSON 字符串;部分接口把字段放在详情根上。
  2233. */
  2234. function parseStoreEvaluateRaw(raw) {
  2235. if (raw == null || raw === '') return null;
  2236. if (typeof raw === 'string') {
  2237. var t = raw.trim();
  2238. if (!t) return null;
  2239. try {
  2240. raw = JSON.parse(t);
  2241. } catch (e) {
  2242. return null;
  2243. }
  2244. }
  2245. if (Array.isArray(raw) && raw.length && raw[0] && typeof raw[0] === 'object') {
  2246. raw = raw[0];
  2247. }
  2248. if (raw && typeof raw === 'object' && !Array.isArray(raw)) return raw;
  2249. return null;
  2250. }
  2251. function getStoreEvaluateScores(d) {
  2252. var ev = parseStoreEvaluateRaw(d.storeEvaluate)
  2253. || parseStoreEvaluateRaw(d.evaluate)
  2254. || parseStoreEvaluateRaw(d.evaluateInfo);
  2255. function lane(key, snake) {
  2256. var v;
  2257. if (ev && ev[key] != null && ev[key] !== '') v = ev[key];
  2258. else if (d[key] != null && d[key] !== '') v = d[key];
  2259. else if (snake && d[snake] != null && d[snake] !== '') v = d[snake];
  2260. else return null;
  2261. var n = Number(v);
  2262. return !isNaN(n) ? n : null;
  2263. }
  2264. return {
  2265. scoreOne: lane('scoreOne', 'score_one'),
  2266. scoreTwo: lane('scoreTwo', 'score_two'),
  2267. scoreThree: lane('scoreThree', 'score_three')
  2268. };
  2269. }
  2270. function fmtEvalScore(n) {
  2271. return n != null && !isNaN(n) ? Number(n).toFixed(1) : null;
  2272. }
  2273. var CLOSED_REC_STAR_PATH =
  2274. 'M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z';
  2275. function closedRecEscHtml(s) {
  2276. return String(s == null ? '' : s)
  2277. .replace(/&/g, '&amp;')
  2278. .replace(/</g, '&lt;')
  2279. .replace(/>/g, '&gt;')
  2280. .replace(/"/g, '&quot;');
  2281. }
  2282. function closedRecStarsHtml(score) {
  2283. var s = Number(score);
  2284. if (isNaN(s)) s = 0;
  2285. s = Math.max(0, Math.min(5, s));
  2286. var rounded = Math.round(s);
  2287. var parts = [];
  2288. var i;
  2289. for (i = 1; i <= 5; i++) {
  2290. var fill = i <= rounded ? '#F58220' : '#E5E5E5';
  2291. parts.push(
  2292. '<svg class="closed-rec-star" width="11" height="11" viewBox="0 0 24 24" aria-hidden="true">' +
  2293. '<path fill="' + fill + '" d="' + CLOSED_REC_STAR_PATH + '"/></svg>'
  2294. );
  2295. }
  2296. return '<span class="closed-rec-stars">' + parts.join('') + '</span>';
  2297. }
  2298. function closedRecFormatDistance(item) {
  2299. if (item.distance != null && item.distance !== '') {
  2300. var km = Number(item.distance);
  2301. if (!isNaN(km) && km >= 0) {
  2302. return Math.round(km * 1000) + '米';
  2303. }
  2304. return String(item.distance).trim();
  2305. }
  2306. if (item.position != null && String(item.position).trim() !== '') {
  2307. return String(item.position).trim();
  2308. }
  2309. if (item.dist != null && item.dist !== '') {
  2310. var dn = Number(item.dist);
  2311. if (!isNaN(dn)) {
  2312. return dn >= 1 ? dn.toFixed(dn % 1 === 0 ? 0 : 1) + 'km' : Math.round(dn * 1000) + '米';
  2313. }
  2314. }
  2315. return '';
  2316. }
  2317. function closedRecPickScore(item) {
  2318. var x =
  2319. item.scoreAvg != null ? Number(item.scoreAvg)
  2320. : item.score != null ? Number(item.score)
  2321. : item.rating != null ? Number(item.rating)
  2322. : item.starScore != null ? Number(item.starScore)
  2323. : NaN;
  2324. return isNaN(x) ? null : x;
  2325. }
  2326. function closedRecPickReviewCount(item) {
  2327. var n =
  2328. item.commitCount != null ? Number(item.commitCount)
  2329. : item.commentCount != null ? Number(item.commentCount)
  2330. : item.reviewCount != null ? Number(item.reviewCount)
  2331. : item.evaluateCount != null ? Number(item.evaluateCount)
  2332. : NaN;
  2333. return isNaN(n) ? 0 : Math.max(0, Math.floor(n));
  2334. }
  2335. function normalizeClosedStoreRecommendList(res) {
  2336. if (!res || typeof res !== 'object') return [];
  2337. var raw = res.data != null ? res.data : res.result;
  2338. if (Array.isArray(raw)) return raw;
  2339. if (raw && typeof raw === 'object') {
  2340. if (Array.isArray(raw.list)) return raw.list;
  2341. if (Array.isArray(raw.records)) return raw.records;
  2342. if (Array.isArray(raw.rows)) return raw.rows;
  2343. if (Array.isArray(raw.content)) return raw.content;
  2344. if (Array.isArray(raw.stores)) return raw.stores;
  2345. if (Array.isArray(raw.storeList)) return raw.storeList;
  2346. if (Array.isArray(raw.storeVos)) return raw.storeVos;
  2347. if (Array.isArray(raw.items)) return raw.items;
  2348. }
  2349. if (Array.isArray(res.list)) return res.list;
  2350. if (Array.isArray(res.records)) return res.records;
  2351. return [];
  2352. }
  2353. function fetchShareClosedStoreRecommend(storeIdStr) {
  2354. var latRaw = (q('userLat') || q('latitude') || q('lat') || q('weidu')).trim();
  2355. var lngRaw = (q('userLng') || q('longitude') || q('lon') || q('jingdu')).trim();
  2356. var userLat =
  2357. latRaw !== '' && !isNaN(Number(latRaw)) ? Number(latRaw) : DEFAULT_REC_USER_LAT;
  2358. var userLng =
  2359. lngRaw !== '' && !isNaN(Number(lngRaw)) ? Number(lngRaw) : DEFAULT_REC_USER_LNG;
  2360. var page = parseInt(q('page') || '1', 10);
  2361. var pageSize = parseInt(q('pageSize') || '10', 10);
  2362. if (isNaN(page) || page < 1) page = 1;
  2363. if (isNaN(pageSize) || pageSize < 1) pageSize = 10;
  2364. var userCityRaw = (q('userCity') || q('city') || '').trim();
  2365. var userCity = userCityRaw !== '' ? userCityRaw : DEFAULT_REC_USER_CITY;
  2366. var body = {
  2367. page: page,
  2368. pageSize: pageSize,
  2369. storeId: String(storeIdStr || ''),
  2370. userCity: userCity,
  2371. userLat: userLat,
  2372. userLng: userLng
  2373. };
  2374. return fetch(API_LIFE_AI_BASE + STORE_GLOBAL_RECOMMEND_PATH, {
  2375. method: 'POST',
  2376. mode: 'cors',
  2377. credentials: 'omit',
  2378. headers: {
  2379. Accept: 'application/json',
  2380. 'Content-Type': 'application/json;charset=UTF-8'
  2381. },
  2382. body: JSON.stringify(body)
  2383. }).then(function (res) {
  2384. if (!res.ok) throw new Error('HTTP ' + res.status);
  2385. return res.json();
  2386. });
  2387. }
  2388. function renderShareClosedRecommended(list) {
  2389. var wrap = document.getElementById('shareClosedRecList');
  2390. var empty = document.getElementById('shareClosedRecEmpty');
  2391. if (!wrap || !empty) return;
  2392. wrap.querySelectorAll('.closed-rec-card').forEach(function (n) {
  2393. n.remove();
  2394. });
  2395. if (!list || !list.length) {
  2396. empty.style.display = 'block';
  2397. return;
  2398. }
  2399. empty.style.display = 'none';
  2400. list.forEach(function (item) {
  2401. if (!item || typeof item !== 'object') return;
  2402. var imgUrlField = item.imgUrl != null ? String(item.imgUrl).trim() : '';
  2403. var home = item.homeImage != null ? String(item.homeImage).trim() : '';
  2404. if (home && /\.mp4(\?|#|$)/i.test(home)) {
  2405. var vf = item.videoFirstFrame != null ? String(item.videoFirstFrame).trim() : '';
  2406. if (vf) home = vf;
  2407. }
  2408. var imgUrl =
  2409. imgUrlField ||
  2410. home ||
  2411. (item.coverUrl != null ? String(item.coverUrl).trim() : '') ||
  2412. (item.mainImage != null ? String(item.mainImage).trim() : '') ||
  2413. (item.goodsImage != null ? String(item.goodsImage).trim() : '') ||
  2414. (item.entranceImage != null ? String(item.entranceImage).trim() : '') ||
  2415. (Array.isArray(item.goodsImageList) && item.goodsImageList[0]) ||
  2416. (Array.isArray(item.imageList) && item.imageList[0]) ||
  2417. (Array.isArray(item.storeAlbumUrlList) && item.storeAlbumUrlList[0]) ||
  2418. '';
  2419. var name = item.title != null && String(item.title).trim() !== ''
  2420. ? String(item.title).replace(/\r?\n/g, ' ').replace(/\s+/g, ' ').trim()
  2421. : (item.storeName || item.goodsName || item.secondGoodsTitle || item.name || '推荐');
  2422. var dist = closedRecFormatDistance(item);
  2423. var scoreVal = closedRecPickScore(item);
  2424. var displayScore = scoreVal != null ? scoreVal.toFixed(1) : '—';
  2425. var starScore = scoreVal != null ? scoreVal : 0;
  2426. var rc = closedRecPickReviewCount(item);
  2427. var reviewLabel = rc > 0 ? rc + '条评价' : '';
  2428. var seller =
  2429. item.userName != null && String(item.userName).trim() !== ''
  2430. ? String(item.userName).trim()
  2431. : (item.nickName != null && String(item.nickName).trim() !== ''
  2432. ? String(item.nickName).trim()
  2433. : '');
  2434. var card = document.createElement('article');
  2435. card.className = 'closed-rec-card';
  2436. card.innerHTML =
  2437. '<div class="closed-rec-card__img"><img class="closed-rec-card__cover" src="" alt="" decoding="async"></div>' +
  2438. '<div class="closed-rec-card__body">' +
  2439. '<div class="closed-rec-card__top">' +
  2440. '<span class="closed-rec-card__name">' + closedRecEscHtml(name) + '</span>' +
  2441. (dist ? '<span class="closed-rec-card__dist">' + closedRecEscHtml(dist) + '</span>' : '') +
  2442. '</div>' +
  2443. '<div class="closed-rec-card__rating">' +
  2444. closedRecStarsHtml(starScore) +
  2445. '<span class="closed-rec-rating-num">' + closedRecEscHtml(displayScore) + '</span>' +
  2446. (reviewLabel ? '<span class="closed-rec-meta">' + closedRecEscHtml(reviewLabel) + '</span>' : '') +
  2447. '</div>' +
  2448. (seller ? '<div class="closed-rec-card__footer">' + closedRecEscHtml(seller) + '</div>' : '') +
  2449. '</div>';
  2450. var coverIm = card.querySelector('img.closed-rec-card__cover');
  2451. if (coverIm) {
  2452. coverIm.src = imgUrl;
  2453. coverIm.onerror = function () {
  2454. this.onerror = null;
  2455. this.src = '';
  2456. };
  2457. }
  2458. wrap.appendChild(card);
  2459. });
  2460. }
  2461. function loadShareClosedRecommendations() {
  2462. var sid = getStoreId();
  2463. if (!sid) {
  2464. renderShareClosedRecommended([]);
  2465. return;
  2466. }
  2467. fetchShareClosedStoreRecommend(sid)
  2468. .then(function (res) {
  2469. var list = normalizeClosedStoreRecommendList(res);
  2470. if (!list.length && res && res.msg) {
  2471. console.warn('[store-recommend]', res.msg);
  2472. }
  2473. renderShareClosedRecommended(list);
  2474. })
  2475. .catch(function (e) {
  2476. console.error(e);
  2477. renderShareClosedRecommended([]);
  2478. });
  2479. }
  2480. function applyShareIndexClosedMerchantUi(closed) {
  2481. var wasClosed = closedMerchantFlag;
  2482. closedMerchantFlag = closed;
  2483. var banner = document.getElementById('shareClosedBanner');
  2484. var contentEl = document.getElementById('shareContentEl');
  2485. var belowEl = document.getElementById('shareBelowContentEl');
  2486. var recWrap = document.getElementById('shareClosedRecommendWrap');
  2487. if (banner) {
  2488. banner.style.display = closed ? 'block' : 'none';
  2489. banner.setAttribute('aria-hidden', closed ? 'false' : 'true');
  2490. }
  2491. if (contentEl) {
  2492. contentEl.style.display = closed ? 'none' : '';
  2493. contentEl.setAttribute('aria-hidden', closed ? 'true' : 'false');
  2494. }
  2495. if (belowEl) {
  2496. belowEl.style.display = '';
  2497. belowEl.setAttribute('aria-hidden', 'false');
  2498. }
  2499. if (recWrap) {
  2500. if (closed) {
  2501. recWrap.style.display = 'block';
  2502. recWrap.setAttribute('aria-hidden', 'false');
  2503. if (!wasClosed) {
  2504. loadShareClosedRecommendations();
  2505. }
  2506. } else {
  2507. recWrap.style.display = 'none';
  2508. recWrap.setAttribute('aria-hidden', 'true');
  2509. renderShareClosedRecommended([]);
  2510. }
  2511. }
  2512. }
  2513. function renderDetail(d) {
  2514. if (!d) return;
  2515. document.getElementById('storeName').textContent = d.storeName || '—';
  2516. var score = d.scoreAvg != null ? Number(d.scoreAvg) : NaN;
  2517. document.getElementById('scoreAvg').textContent = !isNaN(score) ? score.toFixed(1) : '—';
  2518. document.getElementById('commitCount').textContent = d.commitCount != null ? String(d.commitCount)+'条' : '0';
  2519. var evRow = document.getElementById('storeEvaluateRow');
  2520. var evOne = document.getElementById('storeEvaluateScoreOne');
  2521. var evTwo = document.getElementById('storeEvaluateScoreTwo');
  2522. var evThree = document.getElementById('storeEvaluateScoreThree');
  2523. if (evRow && evOne && evTwo && evThree) {
  2524. evRow.classList.remove('is-visible');
  2525. evRow.setAttribute('aria-hidden', 'true');
  2526. var es = getStoreEvaluateScores(d);
  2527. var a = fmtEvalScore(es.scoreOne);
  2528. var b = fmtEvalScore(es.scoreTwo);
  2529. var c = fmtEvalScore(es.scoreThree);
  2530. if (a !== null || b !== null || c !== null) {
  2531. evOne.textContent = a !== null ? a : '—';
  2532. evTwo.textContent = b !== null ? b : '—';
  2533. evThree.textContent = c !== null ? c : '—';
  2534. evRow.classList.add('is-visible');
  2535. evRow.setAttribute('aria-hidden', 'false');
  2536. }
  2537. }
  2538. var bizDisp = computeBusinessStatusDisplay(d);
  2539. var bizEl = document.getElementById('bizStatus');
  2540. bizEl.textContent = bizDisp.text;
  2541. bizEl.className = 'status' + (bizDisp.isOpen ? ' is-open' : '');
  2542. document.getElementById('hoursText').textContent = '';
  2543. document.getElementById('storeAddr').textContent = d.queryAddress || d.storeAddress || '—';
  2544. if (d.distance != null) {
  2545. document.getElementById('metaDistance').style.display = 'flex';
  2546. document.getElementById('distanceText').textContent =
  2547. '距您' + (Number(d.distance) > 1 ? d.distance + '千米' : Math.round(Number(d.distance) * 1000) + '米');
  2548. }
  2549. if (d.subwayName && d.distance2 != null) {
  2550. document.getElementById('metaSubway').style.display = 'flex';
  2551. document.getElementById('subwayText').textContent =
  2552. '距' + d.subwayName + '步行' + (Number(d.distance2) >= 1000
  2553. ? (Number(d.distance2) / 1000).toFixed(1) + 'km'
  2554. : Math.round(Number(d.distance2)) + 'm');
  2555. }
  2556. var imgs = [];
  2557. if (Array.isArray(d.storeAlbumUrlList) && d.storeAlbumUrlList.length) imgs = d.storeAlbumUrlList.slice();
  2558. else if (d.entranceImage) imgs = [d.entranceImage];
  2559. buildHeroSlides(imgs);
  2560. var closedMerchant = Number(d.businessStatus) === 99;
  2561. applyShareIndexClosedMerchantUi(closedMerchant);
  2562. renderMarketingList(marketingListCache);
  2563. renderPerformanceList();
  2564. renderStaffGroups(staffGroupsCache);
  2565. }
  2566. function getLngForApi() {
  2567. var v = q('jingdu');
  2568. if (v) return v;
  2569. return q('lon') || q('lng') || q('longitude');
  2570. }
  2571. function getLatForApi() {
  2572. var v = q('weidu');
  2573. if (v) return v;
  2574. return q('lat') || q('latitude');
  2575. }
  2576. function mergeSearchAndHashParamsForRedirect() {
  2577. var params = new URLSearchParams();
  2578. function ingest(slice) {
  2579. if (!slice) return;
  2580. var p = new URLSearchParams(slice);
  2581. p.forEach(function (val, key) {
  2582. params.set(key, val);
  2583. });
  2584. }
  2585. if (location.search && location.search.length > 1) {
  2586. ingest(location.search.slice(1));
  2587. }
  2588. var hash = location.hash || '';
  2589. var qi = hash.indexOf('?');
  2590. if (qi >= 0) {
  2591. ingest(hash.slice(qi + 1));
  2592. }
  2593. return params;
  2594. }
  2595. /** getClientStoreDetail 无承载数据时进 shareCheckInUndefined(businessStatus=99 与落地页约定一致) */
  2596. function buildShareCheckInUndefinedRedirectHref() {
  2597. var p = mergeSearchAndHashParamsForRedirect();
  2598. p.set('businessStatus', '99');
  2599. var sid = getStoreId();
  2600. if (sid && !p.has('storeId')) {
  2601. p.set('storeId', sid);
  2602. }
  2603. var j = getLngForApi();
  2604. var w = getLatForApi();
  2605. if (j && !p.has('userLng')) {
  2606. p.set('userLng', j);
  2607. }
  2608. if (w && !p.has('userLat')) {
  2609. p.set('userLat', w);
  2610. }
  2611. var qs = p.toString();
  2612. return 'shareCheckInUndefined.html' + (qs ? ('?' + qs) : '?businessStatus=99');
  2613. }
  2614. function run() {
  2615. var sid = getStoreId();
  2616. var userId = q('userId');
  2617. var jingdu = getLngForApi();
  2618. var weidu = getLatForApi();
  2619. if (!sid) {
  2620. showErr('缺少店铺 id(请从 App 分享链接打开,URL 需带 id 或 storeId)');
  2621. document.getElementById('storeName').textContent = '参数错误';
  2622. return;
  2623. }
  2624. var detailPath = '/store/info/getClientStoreDetail?' +
  2625. 'id=' + encodeURIComponent(sid) +
  2626. '&userId=' + encodeURIComponent(userId) +
  2627. '&jingdu=' + encodeURIComponent(jingdu) +
  2628. '&weidu=' + encodeURIComponent(weidu);
  2629. fetchStoreInfoGetOne(sid).then(function (getOneRes) {
  2630. if (isGetOneBusinessStatus99(getOneRes)) {
  2631. applyShareIndexClosedMerchantUi(true);
  2632. }
  2633. apiFetch(detailPath)
  2634. .then(function (res) {
  2635. var tip = res && res.msg != null ? String(res.msg).trim() : '';
  2636. if (tip === '暂无承载数据') {
  2637. if (closedMerchantFlag) {
  2638. return;
  2639. }
  2640. window.location.replace(buildShareCheckInUndefinedRedirectHref());
  2641. return;
  2642. }
  2643. if (res.code !== 200 || !res.data) {
  2644. showErr(res.msg || '店铺详情加载失败');
  2645. return;
  2646. }
  2647. renderDetail(res.data);
  2648. })
  2649. .catch(function (e) {
  2650. console.error(e);
  2651. showErr('店铺详情请求失败(若为 file:// 打开,请检查 CORS 或改用 http 访问本页)');
  2652. });
  2653. var couponPath = '/store/info/getStoreCouponList?storeId=' + encodeURIComponent(sid);
  2654. marketingCouponLoaded = false;
  2655. apiFetch(couponPath)
  2656. .then(function (res) {
  2657. marketingCouponLoaded = true;
  2658. var list = (res && res.code === 200 && res.data && res.data.marketingList) || [];
  2659. if (!Array.isArray(list)) list = [];
  2660. renderMarketingList(list);
  2661. })
  2662. .catch(function (e) {
  2663. marketingCouponLoaded = true;
  2664. console.warn('[getStoreCouponList]', e);
  2665. renderMarketingList([]);
  2666. });
  2667. if (shouldShowPerformanceSection()) {
  2668. var perfPath = '/performance/list/query?storeId=' + encodeURIComponent(sid) + '&page=1&size=100';
  2669. apiFetch(perfPath)
  2670. .then(function (res) {
  2671. var d = (res && res.code === 200 && res.data) || null;
  2672. if (!d || typeof d !== 'object') {
  2673. performanceListCache.records = [];
  2674. performanceListCache.total = 0;
  2675. } else {
  2676. performanceListCache.records = Array.isArray(d.records) ? d.records.slice() : [];
  2677. var pt = d.total;
  2678. performanceListCache.total = pt != null && !isNaN(Number(pt))
  2679. ? Number(pt)
  2680. : performanceListCache.records.length;
  2681. }
  2682. renderPerformanceList();
  2683. })
  2684. .catch(function (e) {
  2685. console.warn('[performance/list/query]', e);
  2686. performanceListCache.records = [];
  2687. performanceListCache.total = 0;
  2688. renderPerformanceList();
  2689. });
  2690. } else {
  2691. performanceListCache.records = [];
  2692. performanceListCache.total = 0;
  2693. renderPerformanceList();
  2694. }
  2695. var staffPath = '/storeStaffConfig/queryStaffListByTitle?storeId=' + encodeURIComponent(sid);
  2696. apiFetch(staffPath)
  2697. .then(function (res) {
  2698. var arr = (res && res.code === 200 && res.data) || [];
  2699. if (!Array.isArray(arr)) arr = [];
  2700. renderStaffGroups(arr);
  2701. })
  2702. .catch(function (e) {
  2703. console.warn('[queryStaffListByTitle]', e);
  2704. renderStaffGroups([]);
  2705. });
  2706. });
  2707. }
  2708. function boot() {
  2709. run();
  2710. bindMarketingMore();
  2711. bindStaffSection();
  2712. var launchTag = document.getElementById('launch-btn');
  2713. if (launchTag && WECHAT_OPEN_APP_ID) {
  2714. launchTag.setAttribute('appid', WECHAT_OPEN_APP_ID);
  2715. }
  2716. bindOpenAppFabClick();
  2717. updateFabOpenLayer();
  2718. if (isWxDebugOn()) {
  2719. reportWxDebug('page load', { errMsg: 'wxDebug=1 已开启' }, [
  2720. 'UA=' + (navigator.userAgent || '').slice(0, 120),
  2721. 'page=' + location.href.split('#')[0]
  2722. ]);
  2723. }
  2724. initWeChatOpenLaunchApp();
  2725. }
  2726. if (document.readyState === 'complete') {
  2727. boot();
  2728. } else {
  2729. window.onload = boot;
  2730. }
  2731. })();
  2732. </script>
  2733. </body>
  2734. </html>