| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
- <meta name="format-detection" content="telephone=no">
- <title>U店在哪</title>
- <style>
- :root {
- --orange: #F58220;
- --orange-light: #FFF4E8;
- --red: #FF4D4F;
- --text: #333333;
- --text-secondary: #999999;
- --border: #EEEEEE;
- --bg: #FFFFFF;
- --safe-bottom: env(safe-area-inset-bottom, 0px);
- }
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
- html {
- font-size: 16px;
- -webkit-tap-highlight-color: transparent;
- overflow-x: hidden;
- }
- body {
- font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
- background: var(--bg);
- color: var(--text);
- padding-bottom: calc(88px + var(--safe-bottom));
- min-height: 100vh;
- overflow-x: hidden;
- }
- /* Header */
- .header {
- position: sticky;
- top: 0;
- z-index: 100;
- display: flex;
- align-items: center;
- justify-content: center;
- height: 44px;
- padding: 0 15px;
- background: var(--bg);
- border-bottom: 1px solid var(--border);
- }
- .header__back {
- position: absolute;
- left: 15px;
- width: 24px;
- height: 24px;
- display: flex;
- align-items: center;
- justify-content: center;
- color: var(--text);
- text-decoration: none;
- }
- .header__title {
- font-size: 17px;
- font-weight: 600;
- color: var(--text);
- }
- /* Hero carousel */
- .hero {
- position: relative;
- margin: 0 15px;
- margin-top: 10px;
- border-radius: 0 0 12px 12px;
- overflow: hidden;
- }
- .hero__track {
- display: flex;
- transition: transform 0.35s ease;
- }
- .hero__slide {
- flex: 0 0 100%;
- aspect-ratio: 16 / 10;
- background: #f0f0f0;
- }
- .hero__slide img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- display: block;
- vertical-align: middle;
- }
- .hero__dots {
- position: absolute;
- bottom: 12px;
- left: 0;
- right: 0;
- display: flex;
- justify-content: center;
- align-items: center;
- gap: 6px;
- }
- .hero__dot {
- width: 6px;
- height: 6px;
- border-radius: 3px;
- background: rgba(255, 255, 255, 0.45);
- transition: width 0.25s ease, background 0.25s ease;
- }
- .hero__dot.is-active {
- width: 16px;
- background: #fff;
- }
- /* Store block */
- .section {
- padding: 16px 15px 0;
- }
- .store-name {
- font-size: 20px;
- font-weight: 700;
- line-height: 1.35;
- margin-bottom: 12px;
- }
- .row {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 10px;
- }
- .rating-row {
- margin-bottom: 12px;
- }
- .stars {
- display: inline-flex;
- align-items: center;
- gap: 2px;
- }
- .star {
- width: 14px;
- height: 14px;
- color: var(--orange);
- }
- .rating-num {
- font-size: 14px;
- font-weight: 600;
- color: var(--orange);
- }
- .store-evaluate-row {
- display: none;
- flex-direction: row;
- flex-wrap: wrap;
- align-items: center;
- gap: 6px 6px;
- margin: 0 0 12px;
- padding: 0;
- font-size: 13px;
- line-height: 1.4;
- color: var(--text-secondary);
- }
- .store-evaluate-row.is-visible {
- display: flex;
- }
- .store-evaluate__item {
- white-space: nowrap;
- }
- .link-muted {
- display: inline-flex;
- align-items: center;
- gap: 2px;
- font-size: 13px;
- color: var(--text-secondary);
- text-decoration: none;
- }
- .chevron {
- width: 14px;
- height: 14px;
- opacity: 0.6;
- }
- .hours-row {
- /* margin-bottom: 16px; */
- align-items: flex-start;
- border-bottom:1px solid #eee;
- padding-bottom: 20px;
- }
- .hours-left {
- flex: 1;
- min-width: 0;
- }
- .status {
- font-size: 14px;
- color: var(--red);
- margin-right: 8px;
- }
- .status.is-open {
- color: var(--orange);
- }
- .hours-text {
- font-size: 14px;
- color: var(--text-secondary);
- }
- .divider {
- height: 8px;
- background: #F7F7F7;
- margin: 0;
- }
- /* Location */
- .loc-wrap {
- display: flex;
- padding: 16px 15px;
- gap: 12px;
- }
- .loc-main {
- flex: 1;
- min-width: 0;
- padding-right: 12px;
- }
- .addr {
- font-size: 15px;
- font-weight: 600;
- line-height: 1.45;
- margin-bottom: 10px;
- }
- .meta-line {
- display: flex;
- align-items: flex-start;
- gap: 6px;
- font-size: 13px;
- color: var(--text-secondary);
- line-height: 1.45;
- margin-top: 6px;
- }
- .meta-line svg,
- .meta-line img {
- flex-shrink: 0;
- margin-top: 2px;
- opacity: 0.75;
- display: block;
- }
- .loc-actions {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- gap: 18px;
- flex-shrink: 0;
- }
- .act-btn {
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 4px;
- background: none;
- border: none;
- padding: 0;
- cursor: pointer;
- font-size: 12px;
- color: var(--text);
- }
- .act-btn__icon {
- width: 44px;
- height: 44px;
- border-radius: 10px;
- background: #F5F5F5;
- display: flex;
- align-items: center;
- justify-content: center;
- color: var(--orange);
- }
- .act-btn__icon img {
- width: 22px;
- height: 22px;
- object-fit: contain;
- display: block;
- }
- /* businessStatus===99 时仅展示关店提示并隐藏 .share-content;底部 FAB 仍在 #shareBelowContentEl */
- .closed-rec-wrap {
- display: none;
- }
- .closed-rec-divider {
- height: 8px;
- background: #F7F7F7;
- margin: 0;
- }
- .closed-rec-title {
- padding: 8px 15px 12px;
- font-size: 16px;
- font-weight: 700;
- }
- .closed-rec-grid {
- display: grid;
- grid-template-columns: repeat(2, 1fr);
- gap: 10px;
- padding: 0 15px 20px;
- }
- #shareClosedRecEmpty {
- grid-column: 1 / -1;
- }
- .closed-rec-empty {
- padding: 12px;
- color: var(--text-secondary);
- font-size: 14px;
- }
- .closed-rec-card {
- min-width: 0;
- background: #fff;
- border-radius: 10px;
- overflow: hidden;
- box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
- }
- .closed-rec-card__img {
- aspect-ratio: 4 / 3;
- background: #eee;
- }
- .closed-rec-card__img img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- display: block;
- border-radius: 0;
- }
- .closed-rec-card__body {
- padding: 10px;
- }
- .closed-rec-card__top {
- display: flex;
- justify-content: space-between;
- align-items: baseline;
- gap: 8px;
- margin-bottom: 6px;
- }
- .closed-rec-card__name {
- font-size: 15px;
- font-weight: 700;
- flex: 1;
- min-width: 0;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .closed-rec-card__dist {
- font-size: 12px;
- color: var(--text-secondary);
- flex-shrink: 0;
- }
- .closed-rec-card__rating {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- gap: 4px 6px;
- }
- .closed-rec-card__rating .closed-rec-stars {
- display: inline-flex;
- align-items: center;
- gap: 2px;
- }
- .closed-rec-card__rating .closed-rec-star {
- display: block;
- flex-shrink: 0;
- }
- .closed-rec-card__rating .closed-rec-rating-num {
- font-size: 12px;
- font-weight: 600;
- color: var(--orange);
- }
- .closed-rec-meta {
- font-size: 12px;
- color: var(--text-secondary);
- }
- .closed-rec-card__footer {
- margin-top: 8px;
- font-size: 12px;
- color: var(--text-secondary);
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .share-none {
- display: none;
- text-align: center;
- padding: 28px 20px 16px;
- color: var(--text-muted);
- font-size: 15px;
- line-height: 1.5;
- }
- .share-none img {
- width: 240px;
- height: 240px;
- margin-bottom: 12px;
- display: inline-block;
- }
- .share-none p {
- margin: 0;
- padding:0 0 60px 0;
- color:#999;
- }
- /* FAB */
- .fab-wrap {
- position: fixed;
- left: 0;
- right: 0;
- bottom: 0;
- z-index: 200;
- padding: 12px 24px calc(12px + var(--safe-bottom));
- background: linear-gradient(to top, rgba(255, 255, 255, 0.98) 70%, transparent);
- pointer-events: none;
- }
- .fab-wrap .fab {
- pointer-events: auto;
- }
- .fab {
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 10px;
- width: 100%;
- max-width: 320px;
- margin: 0 auto;
- height: 48px;
- border: none;
- border-radius: 24px;
- background: var(--orange);
- color: #fff;
- font-size: 16px;
- font-weight: 600;
- box-shadow: 0 4px 16px rgba(245, 130, 32, 0.45);
- cursor: pointer;
- background:#F47D1F;
- }
- .fab__logo {
- width: 28px;
- height: 28px;
- flex-shrink: 0;
- }
- .home-indicator {
- height: 5px;
- background: #000;
- border-radius: 3px;
- width: 134px;
- margin: 8px auto 4px;
- opacity: 0.2;
- }
- /* 营销活动(getStoreCouponList.marketingList) */
- .marketing-section {
- padding: 4px 15px 20px;
- }
- .marketing-section__title {
- font-size: 16px;
- font-weight: 700;
- color: var(--text);
- margin: 0 0 12px;
- }
- .marketing-section__list {
- display: flex;
- flex-direction: column;
- gap: 12px;
- }
- .marketing-card {
- border-radius: 12px;
- overflow: hidden;
- background: #f0f0f0;
- box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
- }
- .marketing-card__media img,
- .marketing-card__media video {
- width: 100%;
- display: block;
- aspect-ratio: 16 / 9;
- object-fit: cover;
- vertical-align: middle;
- }
- .marketing-card__media video {
- background: #000;
- }
- .marketing-card--more {
- display: none;
- }
- .marketing-section.is-expanded .marketing-card--more {
- display: block;
- }
- .marketing-section__more {
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 4px;
- width: 100%;
- margin-top: 14px;
- padding: 8px 0;
- border: none;
- background: none;
- font-size: 14px;
- color: var(--text-secondary);
- cursor: pointer;
- -webkit-tap-highlight-color: transparent;
- }
- .marketing-section__more-chevron {
- width: 16px;
- height: 16px;
- flex-shrink: 0;
- transition: transform 0.2s ease;
- }
- .marketing-section.is-expanded .marketing-section__more-chevron {
- transform: rotate(180deg);
- }
- .marketing-section__empty {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding: 10px 0 8px;
- }
- .marketing-section__empty img {
- width: 200px;
- height: 200px;
- display: block;
- object-fit: contain;
- }
- .marketing-section__empty-label {
- margin: 12px 0 0;
- font-size: 14px;
- color: var(--text-secondary);
- text-align: center;
- }
- /* 演出安排 performance/list/query */
- .performance-section {
- padding: 8px 0 20px;
- border-top: 1px solid var(--border);
- margin-top: 4px;
- }
- .performance-section__title {
- font-size: 16px;
- font-weight: 700;
- color: var(--text);
- margin: 0 15px 12px;
- }
- .performance-strip {
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- gap: 12px;
- overflow-x: auto;
- overflow-y: hidden;
- padding: 0 15px 4px;
- -webkit-overflow-scrolling: touch;
- scrollbar-width: none;
- }
- .performance-strip::-webkit-scrollbar {
- display: none;
- }
- .performance-card {
- flex: 0 0 auto;
- display: flex;
- flex-direction: row;
- align-items: stretch;
- gap: 10px;
- width: 272px;
- min-width: 272px;
- padding: 0;
- background: #fff;
- border-radius: 12px;
- overflow: hidden;
- }
- .performance-card__poster {
- flex: 0 0 76px;
- width: 76px;
- min-height: 102px;
- background: #eee;
- align-self: stretch;
- }
- .performance-card__poster img {
- width: 100%;
- height: 100%;
- min-height: 102px;
- object-fit: cover;
- display: block;
- vertical-align: middle;
- }
- .performance-card__body {
- flex: 1;
- min-width: 0;
- display: flex;
- flex-direction: column;
- justify-content: center;
- gap: 4px;
- padding: 10px 12px 10px 0;
- }
- .performance-card__name {
- font-size: 15px;
- font-weight: 700;
- color: var(--text);
- line-height: 1.3;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .performance-card__meta {
- font-size: 12px;
- color: var(--text-secondary);
- line-height: 1.35;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- /* 人员阵容 queryStaffListByTitle */
- .staff-section {
- padding: 8px 0 24px;
- border-top: 1px solid var(--border);
- margin-top: 4px;
- }
- .staff-section__head {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 12px;
- padding: 0 15px;
- margin-bottom: 12px;
- }
- .staff-section__page-title {
- font-size: 16px;
- font-weight: 700;
- color: var(--text);
- margin: 0;
- flex: 1;
- min-width: 0;
- }
- .staff-section__all {
- flex-shrink: 0;
- display: inline-flex;
- align-items: center;
- gap: 2px;
- font-size: 13px;
- color: #151515;
- text-decoration: none;
- background: none;
- border: none;
- padding: 0;
- cursor: pointer;
- -webkit-tap-highlight-color: transparent;
- }
- .staff-section__all-chevron {
- width: 14px;
- height: 14px;
- opacity: 0.7;
- }
- .staff-group {
- margin-bottom: 20px;
- }
- .staff-group:last-child {
- margin-bottom: 0;
- }
- .staff-strip {
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- gap: 10px;
- overflow-x: auto;
- overflow-y: hidden;
- padding: 0 15px 4px;
- -webkit-overflow-scrolling: touch;
- scrollbar-width: none;
- }
- .staff-strip::-webkit-scrollbar {
- display: none;
- }
- .staff-card {
- flex: 0 0 112px;
- width: 112px;
- min-width: 112px;
- }
- .staff-card__img-wrap {
- position: relative;
- border-radius: 10px;
- overflow: hidden;
- background: #eee;
- aspect-ratio: 3 / 4;
- }
- .staff-card__img-wrap img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- display: block;
- vertical-align: middle;
- }
- .staff-card__likes {
- position: absolute;
- left: 0;
- right: 0;
- bottom: 0;
- padding: 6px 8px;
- font-size: 11px;
- color: #fff;
- line-height: 1.2;
- background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
- }
- .staff-card__name-row {
- display: flex;
- align-items: center;
- gap: 4px;
- margin-top: 8px;
- min-width: 0;
- }
- .staff-card__name {
- font-size: 14px;
- font-weight: 700;
- color: var(--text);
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- flex: 1;
- min-width: 0;
- }
- .staff-card__badge {
- flex-shrink: 0;
- font-size: 10px;
- font-weight: 600;
- color: #fff;
- background: #ff9d4d;
- padding: 2px 5px;
- border-radius: 3px;
- line-height: 1.2;
- white-space: nowrap;
- }
- .staff-card__meta {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- gap: 0 4px;
- margin-top: 4px;
- font-size: 12px;
- color: var(--text-secondary);
- line-height: 1.35;
- }
- .staff-card__position {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- max-width: 100%;
- }
- .staff-card__reviews {
- display: inline-flex;
- align-items: center;
- gap: 4px;
- }
- .staff-card__sep {
- color: #ddd;
- font-weight: 300;
- }
- </style>
- </head>
- <body>
- <div class="share-none" id="shareClosedBanner" aria-hidden="true">
- <img src="images/storeNone.png" alt="">
- <p>抱歉,商户已关闭,看看别的吧</p>
- </div>
- <div class="closed-rec-wrap" id="shareClosedRecommendWrap" aria-hidden="true">
- <div class="closed-rec-divider"></div>
- <h3 class="closed-rec-title">更多推荐</h3>
- <div class="closed-rec-grid" id="shareClosedRecList">
- <p id="shareClosedRecEmpty" class="closed-rec-empty" style="display:none;">暂无推荐</p>
- </div>
- </div>
- <div class="share-content" id="shareContentEl">
- <div class="hero" id="hero">
- <div class="hero__track" id="heroTrack">
- <div class="hero__slide"><img id="heroFallbackImg" src="images/hero.png" alt="店铺图"></div>
- </div>
- <div class="hero__dots" id="heroDots" aria-hidden="true"></div>
- </div>
- <!-- 数据由 getClientStoreDetail(id,userId,jingdu,weidu)填充,见 renderDetail -->
- <section class="section" id="mainSection">
- <p id="pageError" class="page-error" style="display:none;color:#ff4d4f;padding:12px 0;font-size:14px;"></p>
- <h2 class="store-name" id="storeName">加载中…</h2>
- <div class="row rating-row">
- <div class="row" style="flex:1; justify-content:flex-start;">
- <span class="stars" aria-label="5.0 分">
- <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>
- <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>
- <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>
- <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>
- <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>
- </span>
- <span class="rating-num" id="scoreAvg">—</span>
- <span id="commitCount" style="font-size: 14px;">0</span>
- </div>
- <!-- <a href="#" class="link-muted"><span id="commitCount">0</span>条评价
- <svg class="chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"/></svg>
- </a> -->
- </div>
- <div class="store-evaluate-row" id="storeEvaluateRow" aria-hidden="true">
- <span class="store-evaluate__item">酒水:<span id="storeEvaluateScoreOne">—</span></span>
- <span class="store-evaluate__item">氛围:<span id="storeEvaluateScoreTwo">—</span></span>
- <span class="store-evaluate__item">服务:<span id="storeEvaluateScoreThree">—</span></span>
- </div>
- <div class="row hours-row">
- <div class="hours-left">
- <span class="status" id="bizStatus">—</span>
- <span class="hours-text" id="hoursText">—</span>
- </div>
- <a href="#" class="link-muted">详情
- <svg class="chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"/></svg>
- </a>
- </div>
- </section>
- <div class="loc-wrap">
- <div class="loc-main">
- <p class="addr" id="storeAddr">—</p>
- <div class="meta-line" id="metaDistance" style="display:none;">
- <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>
- <span id="distanceText">—</span>
- </div>
- <div class="meta-line" id="metaSubway" style="display:none;">
- <img src="images/iconn.png" alt="" width="12" height="12" decoding="async">
- <span id="subwayText">—</span>
- </div>
- </div>
- <div class="loc-actions">
- <button type="button" class="act-btn" aria-label="导航">
- <span class="act-btn__icon">
- <img src="images/loc1.png" alt="" width="22" height="22" decoding="async">
- </span>
- 导航
- </button>
- <button type="button" class="act-btn" aria-label="电话">
- <span class="act-btn__icon">
- <img src="images/loc2.png" alt="" width="22" height="22" decoding="async">
- </span>
- 电话
- </button>
- </div>
- </div>
- <section class="marketing-section" id="shareMarketingSection" style="display:none;" aria-hidden="true">
- <h3 class="marketing-section__title">营销活动</h3>
- <div class="marketing-section__list" id="marketingListEl"></div>
- <button type="button" class="marketing-section__more" id="marketingMoreBtn" style="display:none;">
- <span id="marketingMoreText"></span>
- <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>
- </button>
- </section>
- <section class="performance-section" id="sharePerformanceSection" style="display:none;" aria-hidden="true">
- <h3 class="performance-section__title" id="performanceSectionTitle">演出安排(0)</h3>
- <div class="performance-strip" id="performanceStripEl"></div>
- </section>
- <section class="staff-section" id="shareStaffSection" style="display:none;" aria-hidden="true">
- <div class="staff-section__head">
- <h3 class="staff-section__page-title">人员阵容(<span id="staffSectionCountEl">0</span>)</h3>
- <button type="button" class="staff-section__all" id="staffSectionAllBtn" aria-label="查看全部">
- 查看全部
- <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>
- </button>
- </div>
- <div id="staffGroupsMount"></div>
- </section>
- </div>
- <div id="shareBelowContentEl">
- <div class="fab-wrap">
- <button type="button" class="fab" id="openApp">
- <img src="images/uBtn.png" alt="APP内打开" decoding="async">
- </button>
- <div class="home-indicator" aria-hidden="true"></div>
- </div>
- </div>
- <script>
- (function () {
- 'use strict';
- /**
- * 与 group_user sharePopup 复制链接时携带的 query 一致,例如:
- * ?id=436&storeId=436&userId=628&businessSection=3&lat=...&lon=...&jingdu=...&weidu=...&storeName=...&coverUrl=...&desc=...
- *
- * 进入页先 GET .../store/info/getOne?id=(与 shareDynamic.html 一致);data.businessStatus===99 时先展示关店区(#shareClosedBanner、#shareClosedRecommendWrap)。
- * 店铺头图/名称/评分/地址等(#mainSection、.loc-wrap):GET .../store/info/getClientStoreDetail?id=&userId=&jingdu=&weidu=
- * 经纬度:URL 可用 jingdu/weidu;若无则用 lon/lng、lat(与分享链一致)
- * 营销活动: GET .../store/info/getStoreCouponList?storeId= → data.marketingList
- * 演出安排: GET .../performance/list/query?storeId=&page=&size= → data.records, data.total(仅 URL businessSection=2 时展示与请求)
- * 人员阵容: GET .../storeStaffConfig/queryStaffListByTitle?storeId= → data[]
- *
- * 注意:用 file:// 打开本页时,浏览器可能因 CORS 拦截跨域请求。
- * 请用本地 HTTP 打开(如 VS Code Live Server、npx serve)或让后端为 H5 域名配置 Access-Control-Allow-Origin。
- */
- var API_BASE = 'https://test.ailien.shop/alienStore';
- /**
- * 关店(businessStatus=99)更多推荐:POST …/ai/multimodal-services/api/v1/search/global/store-recommend
- * 与 shareCheckInUndefined.html 一致;请求体 page、pageSize、storeId、userCity、userLat、userLng 可由 URL 覆盖。
- */
- var API_LIFE_AI_BASE = 'http://124.93.18.180:9100';
- var STORE_GLOBAL_RECOMMEND_PATH =
- '/ai/multimodal-services/api/v1/search/global/store-recommend';
- var DEFAULT_REC_USER_LAT = 38.925747;
- var DEFAULT_REC_USER_LNG = 121.662531;
- var DEFAULT_REC_USER_CITY = '大连市';
- /**
- * 与 group_user 一致:
- * - manifest:app-plus.distribute.android.schemes、ios.urltypes → shopro(即 shopro://)
- * - Android 包名:manifest 未写 packagename 时与 App.vue 升级配置 androidPackageName 一致(云打包以 HBuilderX 为准)
- */
- var APP_ANDROID_PACKAGE = 'com.alien.Udianzaizhe';
- var APP_IOS_URL_SCHEME = 'shopro://';
- /** businessSection 未传或其它值时的默认落地页(与 1 相同) */
- var APP_UNI_STORE_PATH = 'pages/ieisureEntertainment/eightTypeList/delicacyDetails';
- function showDownloadTip() {
- var msg = '请到应用商店下载';
- if (typeof uni !== 'undefined' && typeof uni.showToast === 'function') {
- uni.showToast({ title: msg, icon: 'none', duration: 2500 });
- } else {
- window.alert(msg);
- }
- }
- /** 详情页 onLoad 使用 storeId;分享链常为 id,补全 storeId 避免 App 内参数为空 */
- function buildAppOpenQueryString() {
- var raw = (location.search && location.search.charAt(0) === '?') ? location.search.slice(1) : (location.search || '');
- var params = new URLSearchParams(raw);
- var sid = params.get('storeId') || params.get('id') || '';
- if (sid && !params.get('storeId')) params.set('storeId', sid);
- var qs = params.toString();
- return qs ? ('?' + qs) : '';
- }
- /**
- * 按 URL 参数 businessSection 打开对应 App 页:
- * 1 → delicacyDetails,2 → barDetails,3 → lifeDetails
- */
- function getAppUniPathForBusinessSection() {
- var bs = String(q('businessSection') || '').trim();
- if (bs === '1') {
- return 'pages/ieisureEntertainment/eightTypeList/delicacyDetails';
- }
- if (bs === '2') {
- return 'pages/ieisureEntertainment/eightTypeList/barDetails';
- }
- if (bs === '3') {
- return 'pages/ieisureEntertainment/eightTypeList/lifeDetails';
- }
- return String(APP_UNI_STORE_PATH || 'pages/ieisureEntertainment/eightTypeList/delicacyDetails').replace(/^\//, '');
- }
- function buildAppDeepLink() {
- var path = getAppUniPathForBusinessSection().replace(/^\//, '');
- var s = buildAppOpenQueryString();
- var root = APP_IOS_URL_SCHEME.replace(/\/$/, '');
- if (!s) return root + '/' + path;
- return root + '/' + path + s;
- }
- function isWeChatInAppBrowser() {
- return /MicroMessenger/i.test(navigator.userAgent || '');
- }
- /** 部分 WebView 对 location.href 拦截,用 a 标签点击略稳 */
- function launchAppDeepLink(deepLink) {
-
- try {
- var a = document.createElement('a');
- a.href = deepLink;
- a.setAttribute('target', '_self');
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a);
- } catch (e1) {}
- try {
- window.location.href = deepLink;
- } catch (e2) {}
- }
- /**
- * 有 plus:检测 App 是否安装后 openURL;深链形如 shopro://{APP_UNI_STORE_PATH}?…
- * 系统浏览器:唤起 scheme;微信内常拦截 scheme,需「在浏览器打开」。
- */
- function tryOpenHBuilderApp() {
- var deepLink = buildAppDeepLink();
- if (typeof plus !== 'undefined' && plus.runtime) {
- var installed = null;
- try {
- if (typeof plus.runtime.isApplicationExist === 'function') {
- installed = plus.runtime.isApplicationExist({
- pname: APP_ANDROID_PACKAGE,
- action: APP_IOS_URL_SCHEME
- });
- }
- } catch (e) {
- console.warn(e);
- }
- if (installed === false) {
- showDownloadTip();
- return;
- }
- try {
- plus.runtime.openURL(deepLink);
- } catch (e2) {
- console.warn(e2);
- showDownloadTip();
- }
- return;
- }
- var t0 = Date.now();
- var done = false;
- function finish() {
- if (done) return;
- done = true;
- document.removeEventListener('visibilitychange', onVis);
- window.removeEventListener('pagehide', onHide);
- }
- function onVis() {
- if (document.visibilityState === 'hidden') finish();
- }
- function onHide() {
- finish();
- }
- document.addEventListener('visibilitychange', onVis);
- window.addEventListener('pagehide', onHide);
- if (isWeChatInAppBrowser()) {
- window.alert('若点击后无法打开 App:请先点右上角「···」,选择「在浏览器中打开」,再点「APP内打开」。');
- }
- try {
- launchAppDeepLink(deepLink);
- } catch (e3) {
- finish();
- showDownloadTip();
- return;
- }
- window.setTimeout(function () {
- if (done) return;
- if (document.visibilityState === 'visible' && Date.now() - t0 < 3500) {
- showDownloadTip();
- }
- finish();
- }, 2600);
- }
- function qs() {
- return new URLSearchParams(location.search || '');
- }
- function q(name) {
- var v = qs().get(name);
- return v == null ? '' : String(v);
- }
- function showErr(msg) {
- var el = document.getElementById('pageError');
- el.textContent = msg;
- el.style.display = 'block';
- }
- function getStoreId() {
- return q('id') || q('storeId');
- }
- function shouldShowPerformanceSection() {
- return String(q('businessSection') || '').trim() === '2';
- }
- function apiFetch(path) {
- return fetch(API_BASE + path, {
- method: 'GET',
- mode: 'cors',
- credentials: 'omit',
- headers: { Accept: 'application/json' }
- }).then(function (res) {
- if (!res.ok) throw new Error('HTTP ' + res.status);
- return res.json();
- });
- }
- /** 进入页先拉店铺概要;与 shareDynamic.html fetchGetDeleteFlagByIdIfId 相同路径与 id 参数 */
- function fetchStoreInfoGetOne(storeId) {
- if (!storeId) return Promise.resolve(null);
- var qs = new URLSearchParams();
- qs.set('id', String(storeId).trim());
- return apiFetch('/store/info/getOne?' + qs.toString()).catch(function (e) {
- console.warn('[store/info/getOne]', e);
- return null;
- });
- }
- function isGetOneBusinessStatus99(res) {
- if (!res || typeof res !== 'object') return false;
- var d = res.data;
- if (d && typeof d === 'object') {
- var bs = d.businessStatus;
- if (bs === 99 || bs === '99' || Number(bs) === 99) return true;
- }
- return false;
- }
- var MARKETING_PREVIEW_COUNT = 3;
- var closedMerchantFlag = false;
- var marketingListCache = [];
- /** 避免详情先返回时用空 cache 误展示「暂无活动」图 */
- var marketingCouponLoaded = false;
- var staffGroupsCache = [];
- var performanceListCache = { records: [], total: 0 };
- function isMp4VideoUrl(url) {
- if (!url || typeof url !== 'string') return false;
- var path = url.split(/[?#]/)[0].toLowerCase();
- return path.length >= 4 && path.slice(-4) === '.mp4';
- }
- function getMp4PlaybackUrl(url) {
- var u = String(url || '').trim();
- if (!u) return '';
- var q = u.indexOf('?');
- var h = u.indexOf('#');
- var cut = u.length;
- if (q >= 0) cut = Math.min(cut, q);
- if (h >= 0) cut = Math.min(cut, h);
- var base = u.slice(0, cut);
- if (/\.mp4$/i.test(base)) return base;
- return u;
- }
- function mp4UrlToJpgUrl(u) {
- var q = u.indexOf('?');
- var h = u.indexOf('#');
- var cut = u.length;
- if (q >= 0) cut = Math.min(cut, q);
- if (h >= 0) cut = Math.min(cut, h);
- var pathPart = u.slice(0, cut);
- var rest = u.slice(cut);
- if (!/\.mp4$/i.test(pathPart)) return '';
- return pathPart.slice(0, -4) + '.jpg' + rest;
- }
- function createMarketingMedia(url) {
- var wrap = document.createElement('div');
- wrap.className = 'marketing-card__media';
- var full = String(url == null ? '' : url).trim();
- if (!full) return wrap;
- if (isMp4VideoUrl(full)) {
- var playUrl = getMp4PlaybackUrl(full);
- var vid = document.createElement('video');
- vid.src = playUrl;
- vid.setAttribute('controls', '');
- vid.setAttribute('playsinline', '');
- vid.setAttribute('webkit-playsinline', '');
- vid.muted = true;
- vid.setAttribute('muted', '');
- vid.setAttribute('autoplay', '');
- vid.preload = 'auto';
- var poster = '';
- if (full.length > playUrl.length) poster = full;
- else poster = mp4UrlToJpgUrl(playUrl);
- if (poster) vid.setAttribute('poster', poster);
- vid.addEventListener('canplay', function onCap() {
- vid.removeEventListener('canplay', onCap);
- var p = vid.play();
- if (p && typeof p.catch === 'function') p.catch(function () {});
- });
- wrap.appendChild(vid);
- } else {
- var img = document.createElement('img');
- img.src = full;
- img.alt = '';
- img.decoding = 'async';
- wrap.appendChild(img);
- }
- return wrap;
- }
- function renderMarketingList(rawList) {
- marketingListCache = Array.isArray(rawList) ? rawList.slice() : [];
- var section = document.getElementById('shareMarketingSection');
- var listEl = document.getElementById('marketingListEl');
- var moreBtn = document.getElementById('marketingMoreBtn');
- var moreText = document.getElementById('marketingMoreText');
- if (!section || !listEl) return;
- listEl.innerHTML = '';
- section.classList.remove('is-expanded');
- if (moreBtn) {
- moreBtn.style.display = 'none';
- moreBtn.setAttribute('aria-expanded', 'false');
- }
- if (closedMerchantFlag) {
- section.style.display = 'none';
- section.setAttribute('aria-hidden', 'true');
- return;
- }
- var items = marketingListCache.filter(function (x) {
- return x && x.imgUrl && String(x.imgUrl).trim();
- }).filter(function (x) {
- var t = x.activityType;
- if (t == null || t === '') return true;
- return String(t).toUpperCase() === 'MARKETING';
- });
- items.sort(function (a, b) {
- var sa = Number(a.imgSort);
- var sb = Number(b.imgSort);
- if (isNaN(sa)) sa = 0;
- if (isNaN(sb)) sb = 0;
- return sa - sb;
- });
- if (!items.length) {
- if (!marketingCouponLoaded) {
- section.style.display = 'none';
- section.setAttribute('aria-hidden', 'true');
- return;
- }
- section.style.display = 'block';
- section.setAttribute('aria-hidden', 'false');
- var emptyWrap = document.createElement('div');
- emptyWrap.className = 'marketing-section__empty';
- emptyWrap.setAttribute('role', 'status');
- var emptyImg = document.createElement('img');
- emptyImg.src = 'images/empty.png';
- emptyImg.alt = '';
- emptyImg.decoding = 'async';
- var emptyLabel = document.createElement('p');
- emptyLabel.className = 'marketing-section__empty-label';
- emptyLabel.textContent = '暂无活动';
- emptyWrap.appendChild(emptyImg);
- emptyWrap.appendChild(emptyLabel);
- listEl.appendChild(emptyWrap);
- return;
- }
- section.style.display = 'block';
- section.setAttribute('aria-hidden', 'false');
- items.forEach(function (item, idx) {
- var card = document.createElement('article');
- card.className = 'marketing-card';
- if (idx >= MARKETING_PREVIEW_COUNT) card.classList.add('marketing-card--more');
- card.appendChild(createMarketingMedia(item.imgUrl));
- listEl.appendChild(card);
- });
- var extra = items.length - MARKETING_PREVIEW_COUNT;
- if (extra > 0 && moreBtn && moreText) {
- moreText.textContent = '查看剩余' + extra + '个活动';
- moreBtn.style.display = 'flex';
- }
- }
- function bindMarketingMore() {
- var section = document.getElementById('shareMarketingSection');
- var moreBtn = document.getElementById('marketingMoreBtn');
- if (!section || !moreBtn || moreBtn.dataset.bound) return;
- moreBtn.dataset.bound = '1';
- moreBtn.addEventListener('click', function () {
- section.classList.add('is-expanded');
- moreBtn.style.display = 'none';
- moreBtn.setAttribute('aria-expanded', 'true');
- });
- }
- function createStaffCardElement(staff) {
- var card = document.createElement('article');
- card.className = 'staff-card';
- var imgWrap = document.createElement('div');
- imgWrap.className = 'staff-card__img-wrap';
- var imgUrl = String(staff.staffImage || '').trim();
- if (imgUrl) {
- var img = document.createElement('img');
- img.src = imgUrl;
- img.alt = String(staff.name || '');
- img.decoding = 'async';
- img.loading = 'lazy';
- imgWrap.appendChild(img);
- }
- var likes = document.createElement('div');
- likes.className = 'staff-card__likes';
- var lc = staff.likeCount != null ? Number(staff.likeCount) : 0;
- if (isNaN(lc)) lc = 0;
- likes.textContent = lc + '人喜欢';
- imgWrap.appendChild(likes);
- var nameRow = document.createElement('div');
- nameRow.className = 'staff-card__name-row';
- var nameEl = document.createElement('span');
- nameEl.className = 'staff-card__name';
- nameEl.textContent = String(staff.name != null ? staff.name : '').trim() || '—';
- nameRow.appendChild(nameEl);
- var perf = staff.hasPerformanceToday;
- if (perf === true || perf === 1 || String(perf).toLowerCase() === 'true') {
- var badge = document.createElement('span');
- badge.className = 'staff-card__badge';
- badge.textContent = '今日演出';
- nameRow.appendChild(badge);
- }
- card.appendChild(imgWrap);
- card.appendChild(nameRow);
- var meta = document.createElement('div');
- meta.className = 'staff-card__meta';
- var pos = document.createElement('span');
- pos.className = 'staff-card__position';
- pos.textContent = String(staff.staffPosition || '').trim() || '\u00a0';
- meta.appendChild(pos);
- var pc = staff.positiveCommentsCount != null ? Number(staff.positiveCommentsCount) : 0;
- if (!isNaN(pc) && pc > 0) {
- var sep = document.createElement('span');
- sep.className = 'staff-card__sep';
- sep.textContent = '|';
- var rev = document.createElement('span');
- rev.className = 'staff-card__reviews';
- rev.textContent = '好评' + pc + '次';
- meta.appendChild(sep);
- meta.appendChild(rev);
- }
- card.appendChild(meta);
- return card;
- }
- function createPerformanceCardElement(row) {
- var card = document.createElement('article');
- card.className = 'performance-card';
- var posterWrap = document.createElement('div');
- posterWrap.className = 'performance-card__poster';
- var posterUrl = String(row.performancePoster || '').trim();
- if (posterUrl) {
- var img = document.createElement('img');
- img.src = posterUrl;
- img.alt = String(row.performanceName || '');
- img.decoding = 'async';
- img.loading = 'lazy';
- posterWrap.appendChild(img);
- }
- var body = document.createElement('div');
- body.className = 'performance-card__body';
- var nameEl = document.createElement('div');
- nameEl.className = 'performance-card__name';
- nameEl.textContent = String(row.performanceName != null ? row.performanceName : '').trim() || '—';
- body.appendChild(nameEl);
- var dr = String(row.dateRange || '').trim();
- if (dr) {
- var line1 = document.createElement('div');
- line1.className = 'performance-card__meta';
- line1.textContent = dr;
- body.appendChild(line1);
- }
- var si = String(row.scheduleInfo || '').trim();
- if (si) {
- var line2 = document.createElement('div');
- line2.className = 'performance-card__meta';
- line2.textContent = si;
- line2.title = si;
- body.appendChild(line2);
- }
- card.appendChild(posterWrap);
- card.appendChild(body);
- return card;
- }
- function renderPerformanceList() {
- var section = document.getElementById('sharePerformanceSection');
- var titleEl = document.getElementById('performanceSectionTitle');
- var strip = document.getElementById('performanceStripEl');
- if (!section || !titleEl || !strip) return;
- strip.innerHTML = '';
- if (!shouldShowPerformanceSection()) {
- section.style.display = 'none';
- section.setAttribute('aria-hidden', 'true');
- return;
- }
- if (closedMerchantFlag) {
- section.style.display = 'none';
- section.setAttribute('aria-hidden', 'true');
- return;
- }
- var records = performanceListCache.records;
- var total = performanceListCache.total;
- if (isNaN(total)) total = records.length;
- titleEl.textContent = '演出安排(' + total + ')';
- if (!records.length) {
- section.style.display = 'none';
- section.setAttribute('aria-hidden', 'true');
- return;
- }
- section.style.display = 'block';
- section.setAttribute('aria-hidden', 'false');
- records.forEach(function (row) {
- if (!row) return;
- strip.appendChild(createPerformanceCardElement(row));
- });
- }
- function renderStaffGroups(raw) {
- staffGroupsCache = Array.isArray(raw) ? raw.slice() : [];
- var section = document.getElementById('shareStaffSection');
- var mount = document.getElementById('staffGroupsMount');
- if (!section || !mount) return;
- var totalStaff = 0;
- staffGroupsCache.forEach(function (g) {
- if (g && Array.isArray(g.staffList)) totalStaff += g.staffList.length;
- });
- var countEl = document.getElementById('staffSectionCountEl');
- if (countEl) countEl.textContent = String(totalStaff);
- mount.innerHTML = '';
- if (closedMerchantFlag) {
- section.style.display = 'none';
- section.setAttribute('aria-hidden', 'true');
- return;
- }
- var groups = staffGroupsCache.filter(function (g) {
- return g && Array.isArray(g.staffList) && g.staffList.length;
- });
- if (!groups.length) {
- section.style.display = 'none';
- section.setAttribute('aria-hidden', 'true');
- return;
- }
- section.style.display = 'block';
- section.setAttribute('aria-hidden', 'false');
- groups.forEach(function (group) {
- var wrap = document.createElement('div');
- wrap.className = 'staff-group';
- if (group.titleId != null) wrap.dataset.titleId = String(group.titleId);
- var strip = document.createElement('div');
- strip.className = 'staff-strip';
- group.staffList.forEach(function (staff) {
- if (!staff) return;
- strip.appendChild(createStaffCardElement(staff));
- });
- wrap.appendChild(strip);
- mount.appendChild(wrap);
- });
- }
- function bindStaffSection() {
- var btn = document.getElementById('staffSectionAllBtn');
- if (!btn || btn.dataset.bound) return;
- btn.dataset.bound = '1';
- btn.addEventListener('click', function (e) {
- e.preventDefault();
- tryOpenHBuilderApp();
- });
- }
- function buildHeroSlides(urls) {
- var track = document.getElementById('heroTrack');
- var dotsWrap = document.getElementById('heroDots');
- track.innerHTML = '';
- dotsWrap.innerHTML = '';
- var list = (urls || []).filter(Boolean);
- if (!list.length) {
- var slide = document.createElement('div');
- slide.className = 'hero__slide';
- var img = document.createElement('img');
- img.src = 'images/hero.png';
- img.alt = '店铺';
- slide.appendChild(img);
- track.appendChild(slide);
- var dot = document.createElement('span');
- dot.className = 'hero__dot is-active';
- dotsWrap.appendChild(dot);
- return initHeroCarousel(1);
- }
- list.forEach(function (url, d) {
- var slide = document.createElement('div');
- slide.className = 'hero__slide';
- var img = document.createElement('img');
- img.src = url;
- img.alt = '店铺图';
- slide.appendChild(img);
- track.appendChild(slide);
- var dot = document.createElement('span');
- dot.className = 'hero__dot' + (d === 0 ? ' is-active' : '');
- dotsWrap.appendChild(dot);
- });
- initHeroCarousel(list.length);
- }
- var heroI = 0;
- var heroTimer = null;
- function initHeroCarousel(slides) {
- var track = document.getElementById('heroTrack');
- var dotsWrap = document.getElementById('heroDots');
- var dots = dotsWrap.querySelectorAll('.hero__dot');
- if (slides < 2) return;
- function go(n) {
- heroI = (n + slides) % slides;
- track.style.transform = 'translateX(' + (-heroI * 100) + '%)';
- dots.forEach(function (el, idx) {
- el.classList.toggle('is-active', idx === heroI);
- });
- }
- if (heroTimer) clearInterval(heroTimer);
- heroTimer = setInterval(function () { go(heroI + 1); }, 4000);
- var hero = document.getElementById('hero');
- var startX = 0;
- hero.addEventListener('touchstart', function (e) {
- startX = e.changedTouches[0].clientX;
- }, { passive: true });
- hero.addEventListener('touchend', function (e) {
- var dx = e.changedTouches[0].clientX - startX;
- if (Math.abs(dx) > 40) go(dx < 0 ? heroI + 1 : heroI - 1);
- }, { passive: true });
- }
- function timeToMinutes(t) {
- var parts = String(t || '').trim().split(':');
- var h = parseInt(parts[0], 10) || 0;
- var m = parseInt(parts[1], 10) || 0;
- return h * 60 + m;
- }
- function isTimeInRange(startTime, endTime) {
- var s = String(startTime || '').trim();
- var e = String(endTime || '').trim();
- if (s === '00:00' && e === '00:00') return true;
- if (s === '00:00' && e === '23:59') return true;
- var cur = new Date().getHours() * 60 + new Date().getMinutes();
- var sm = timeToMinutes(s);
- var em = timeToMinutes(e);
- if (em < sm) {
- return cur >= sm || cur <= em;
- }
- return cur >= sm && cur <= em;
- }
- function parseHolidayDate(str) {
- if (!str) return null;
- var d = new Date(String(str).trim().replace(/-/g, '/'));
- return isNaN(d.getTime()) ? null : d;
- }
- function isTodayInHolidayRange(holidayInfo) {
- if (!holidayInfo) return false;
- var hi = holidayInfo;
- if (typeof hi === 'string') {
- try {
- hi = JSON.parse(hi);
- } catch (err) {
- return false;
- }
- }
- var start = hi.startDate || hi.holidayStartDate || hi.beginDate || hi.start || hi.holidayStart;
- var end = hi.endDate || hi.holidayEndDate || hi.finishDate || hi.end || hi.holidayEnd;
- if (!start || !end) return false;
- var startD = parseHolidayDate(start);
- var endD = parseHolidayDate(end);
- if (!startD || !endD) return false;
- var today = new Date();
- today.setHours(0, 0, 0, 0);
- startD.setHours(0, 0, 0, 0);
- endD.setHours(0, 0, 0, 0);
- return today >= startD && today <= endD;
- }
- function findNormalBusinessInfo(list) {
- var wdJs = new Date().getDay();
- var i;
- var x;
- var w;
- for (i = 0; i < list.length; i++) {
- x = list[i];
- if (!x || x.holidayInfo) continue;
- w = x.weekDay != null ? x.weekDay : x.week;
- if (w === undefined || w === null) continue;
- if (Number(w) === wdJs) return x;
- }
- var wdMap = wdJs === 0 ? 7 : wdJs;
- for (i = 0; i < list.length; i++) {
- x = list[i];
- if (!x || x.holidayInfo) continue;
- w = x.weekDay != null ? x.weekDay : x.week;
- if (w === undefined || w === null) continue;
- if (Number(w) === wdMap) return x;
- }
- for (i = 0; i < list.length; i++) {
- x = list[i];
- if (x && !x.holidayInfo && (x.startTime || x.endTime)) return x;
- }
- return null;
- }
- /** 营业状态:暂停营业 | 商家暂未配置营业时间 | 休息中 | 营业中 xx:xx至xx:xx | 营业中 全天营业 */
- function computeBusinessStatusDisplay(d) {
- if (!d) return { text: '—', isOpen: false };
- if (Number(d.businessStatus) === 99) {
- return { text: '商户已关闭', isOpen: false };
- }
- if (Number(d.businessStatus) === 1) {
- return { text: '暂停营业', isOpen: false };
- }
- var list = d.storeBusinessInfoVos || d.storeBusinessInfos || [];
- if (!list.length) {
- return { text: '商家暂未配置营业时间', isOpen: false };
- }
- var holidayList = Array.isArray(d.holidayBusinessInfoList) && d.holidayBusinessInfoList.length
- ? d.holidayBusinessInfoList
- : list.filter(function (item) { return item && item.holidayInfo; });
- var todayHolidayItem = holidayList.find(function (item) {
- return isTodayInHolidayRange(item.holidayInfo);
- });
- var normal = d.normalBusinessInfo || d.normalBusinessInfoVo || findNormalBusinessInfo(list);
- var isOpen = false;
- var currentItem = null;
- if (todayHolidayItem) {
- isOpen = isTimeInRange(todayHolidayItem.startTime, todayHolidayItem.endTime);
- currentItem = todayHolidayItem;
- } else if (normal) {
- isOpen = isTimeInRange(normal.startTime, normal.endTime);
- currentItem = normal;
- }
- if (!currentItem) return { text: '休息中', isOpen: false };
- if (!isOpen) return { text: '休息中', isOpen: false };
- var st = String(currentItem.startTime || '').trim();
- var et = String(currentItem.endTime || '').trim();
- if (st === '00:00' && et === '00:00') return { text: '营业中 全天营业', isOpen: true };
- if (st === '00:00' && et === '23:59') return { text: '营业中 全天营业', isOpen: true };
- var needNextDay = timeToMinutes(et) < timeToMinutes(st);
- var suffix = (needNextDay ? '次日' : '') + et;
- return { text: ('营业中 ' + st + ' 至 ' + suffix).trim(), isOpen: true };
- }
- /**
- * 分项评分:可能在 storeEvaluate 对象内,或为 JSON 字符串;部分接口把字段放在详情根上。
- */
- function parseStoreEvaluateRaw(raw) {
- if (raw == null || raw === '') return null;
- if (typeof raw === 'string') {
- var t = raw.trim();
- if (!t) return null;
- try {
- raw = JSON.parse(t);
- } catch (e) {
- return null;
- }
- }
- if (Array.isArray(raw) && raw.length && raw[0] && typeof raw[0] === 'object') {
- raw = raw[0];
- }
- if (raw && typeof raw === 'object' && !Array.isArray(raw)) return raw;
- return null;
- }
- function getStoreEvaluateScores(d) {
- var ev = parseStoreEvaluateRaw(d.storeEvaluate)
- || parseStoreEvaluateRaw(d.evaluate)
- || parseStoreEvaluateRaw(d.evaluateInfo);
- function lane(key, snake) {
- var v;
- if (ev && ev[key] != null && ev[key] !== '') v = ev[key];
- else if (d[key] != null && d[key] !== '') v = d[key];
- else if (snake && d[snake] != null && d[snake] !== '') v = d[snake];
- else return null;
- var n = Number(v);
- return !isNaN(n) ? n : null;
- }
- return {
- scoreOne: lane('scoreOne', 'score_one'),
- scoreTwo: lane('scoreTwo', 'score_two'),
- scoreThree: lane('scoreThree', 'score_three')
- };
- }
- function fmtEvalScore(n) {
- return n != null && !isNaN(n) ? Number(n).toFixed(1) : null;
- }
- var CLOSED_REC_STAR_PATH =
- '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';
- function closedRecEscHtml(s) {
- return String(s == null ? '' : s)
- .replace(/&/g, '&')
- .replace(/</g, '<')
- .replace(/>/g, '>')
- .replace(/"/g, '"');
- }
- function closedRecStarsHtml(score) {
- var s = Number(score);
- if (isNaN(s)) s = 0;
- s = Math.max(0, Math.min(5, s));
- var rounded = Math.round(s);
- var parts = [];
- var i;
- for (i = 1; i <= 5; i++) {
- var fill = i <= rounded ? '#F58220' : '#E5E5E5';
- parts.push(
- '<svg class="closed-rec-star" width="11" height="11" viewBox="0 0 24 24" aria-hidden="true">' +
- '<path fill="' + fill + '" d="' + CLOSED_REC_STAR_PATH + '"/></svg>'
- );
- }
- return '<span class="closed-rec-stars">' + parts.join('') + '</span>';
- }
- function closedRecFormatDistance(item) {
- if (item.distance != null && item.distance !== '') {
- var km = Number(item.distance);
- if (!isNaN(km) && km >= 0) {
- return Math.round(km * 1000) + '米';
- }
- return String(item.distance).trim();
- }
- if (item.position != null && String(item.position).trim() !== '') {
- return String(item.position).trim();
- }
- if (item.dist != null && item.dist !== '') {
- var dn = Number(item.dist);
- if (!isNaN(dn)) {
- return dn >= 1 ? dn.toFixed(dn % 1 === 0 ? 0 : 1) + 'km' : Math.round(dn * 1000) + '米';
- }
- }
- return '';
- }
- function closedRecPickScore(item) {
- var x =
- item.scoreAvg != null ? Number(item.scoreAvg)
- : item.score != null ? Number(item.score)
- : item.rating != null ? Number(item.rating)
- : item.starScore != null ? Number(item.starScore)
- : NaN;
- return isNaN(x) ? null : x;
- }
- function closedRecPickReviewCount(item) {
- var n =
- item.commitCount != null ? Number(item.commitCount)
- : item.commentCount != null ? Number(item.commentCount)
- : item.reviewCount != null ? Number(item.reviewCount)
- : item.evaluateCount != null ? Number(item.evaluateCount)
- : NaN;
- return isNaN(n) ? 0 : Math.max(0, Math.floor(n));
- }
- function normalizeClosedStoreRecommendList(res) {
- if (!res || typeof res !== 'object') return [];
- var raw = res.data != null ? res.data : res.result;
- if (Array.isArray(raw)) return raw;
- if (raw && typeof raw === 'object') {
- if (Array.isArray(raw.list)) return raw.list;
- if (Array.isArray(raw.records)) return raw.records;
- if (Array.isArray(raw.rows)) return raw.rows;
- if (Array.isArray(raw.content)) return raw.content;
- if (Array.isArray(raw.stores)) return raw.stores;
- if (Array.isArray(raw.storeList)) return raw.storeList;
- if (Array.isArray(raw.storeVos)) return raw.storeVos;
- if (Array.isArray(raw.items)) return raw.items;
- }
- if (Array.isArray(res.list)) return res.list;
- if (Array.isArray(res.records)) return res.records;
- return [];
- }
- function fetchShareClosedStoreRecommend(storeIdStr) {
- var latRaw = (q('userLat') || q('latitude') || q('lat') || q('weidu')).trim();
- var lngRaw = (q('userLng') || q('longitude') || q('lon') || q('jingdu')).trim();
- var userLat =
- latRaw !== '' && !isNaN(Number(latRaw)) ? Number(latRaw) : DEFAULT_REC_USER_LAT;
- var userLng =
- lngRaw !== '' && !isNaN(Number(lngRaw)) ? Number(lngRaw) : DEFAULT_REC_USER_LNG;
- var page = parseInt(q('page') || '1', 10);
- var pageSize = parseInt(q('pageSize') || '10', 10);
- if (isNaN(page) || page < 1) page = 1;
- if (isNaN(pageSize) || pageSize < 1) pageSize = 10;
- var userCityRaw = (q('userCity') || q('city') || '').trim();
- var userCity = userCityRaw !== '' ? userCityRaw : DEFAULT_REC_USER_CITY;
- var body = {
- page: page,
- pageSize: pageSize,
- storeId: String(storeIdStr || ''),
- userCity: userCity,
- userLat: userLat,
- userLng: userLng
- };
- return fetch(API_LIFE_AI_BASE + STORE_GLOBAL_RECOMMEND_PATH, {
- method: 'POST',
- mode: 'cors',
- credentials: 'omit',
- headers: {
- Accept: 'application/json',
- 'Content-Type': 'application/json;charset=UTF-8'
- },
- body: JSON.stringify(body)
- }).then(function (res) {
- if (!res.ok) throw new Error('HTTP ' + res.status);
- return res.json();
- });
- }
- function renderShareClosedRecommended(list) {
- var wrap = document.getElementById('shareClosedRecList');
- var empty = document.getElementById('shareClosedRecEmpty');
- if (!wrap || !empty) return;
- wrap.querySelectorAll('.closed-rec-card').forEach(function (n) {
- n.remove();
- });
- if (!list || !list.length) {
- empty.style.display = 'block';
- return;
- }
- empty.style.display = 'none';
- list.forEach(function (item) {
- if (!item || typeof item !== 'object') return;
- var imgUrlField = item.imgUrl != null ? String(item.imgUrl).trim() : '';
- var home = item.homeImage != null ? String(item.homeImage).trim() : '';
- if (home && /\.mp4(\?|#|$)/i.test(home)) {
- var vf = item.videoFirstFrame != null ? String(item.videoFirstFrame).trim() : '';
- if (vf) home = vf;
- }
- var imgUrl =
- imgUrlField ||
- home ||
- (item.coverUrl != null ? String(item.coverUrl).trim() : '') ||
- (item.mainImage != null ? String(item.mainImage).trim() : '') ||
- (item.goodsImage != null ? String(item.goodsImage).trim() : '') ||
- (item.entranceImage != null ? String(item.entranceImage).trim() : '') ||
- (Array.isArray(item.goodsImageList) && item.goodsImageList[0]) ||
- (Array.isArray(item.imageList) && item.imageList[0]) ||
- (Array.isArray(item.storeAlbumUrlList) && item.storeAlbumUrlList[0]) ||
- '';
- var name = item.title != null && String(item.title).trim() !== ''
- ? String(item.title).replace(/\r?\n/g, ' ').replace(/\s+/g, ' ').trim()
- : (item.storeName || item.goodsName || item.secondGoodsTitle || item.name || '推荐');
- var dist = closedRecFormatDistance(item);
- var scoreVal = closedRecPickScore(item);
- var displayScore = scoreVal != null ? scoreVal.toFixed(1) : '—';
- var starScore = scoreVal != null ? scoreVal : 0;
- var rc = closedRecPickReviewCount(item);
- var reviewLabel = rc > 0 ? rc + '条评价' : '';
- var seller =
- item.userName != null && String(item.userName).trim() !== ''
- ? String(item.userName).trim()
- : (item.nickName != null && String(item.nickName).trim() !== ''
- ? String(item.nickName).trim()
- : '');
- var card = document.createElement('article');
- card.className = 'closed-rec-card';
- card.innerHTML =
- '<div class="closed-rec-card__img"><img class="closed-rec-card__cover" src="" alt="" decoding="async"></div>' +
- '<div class="closed-rec-card__body">' +
- '<div class="closed-rec-card__top">' +
- '<span class="closed-rec-card__name">' + closedRecEscHtml(name) + '</span>' +
- (dist ? '<span class="closed-rec-card__dist">' + closedRecEscHtml(dist) + '</span>' : '') +
- '</div>' +
- '<div class="closed-rec-card__rating">' +
- closedRecStarsHtml(starScore) +
- '<span class="closed-rec-rating-num">' + closedRecEscHtml(displayScore) + '</span>' +
- (reviewLabel ? '<span class="closed-rec-meta">' + closedRecEscHtml(reviewLabel) + '</span>' : '') +
- '</div>' +
- (seller ? '<div class="closed-rec-card__footer">' + closedRecEscHtml(seller) + '</div>' : '') +
- '</div>';
- var coverIm = card.querySelector('img.closed-rec-card__cover');
- if (coverIm) {
- coverIm.src = imgUrl;
- coverIm.onerror = function () {
- this.onerror = null;
- this.src = '';
- };
- }
- wrap.appendChild(card);
- });
- }
- function loadShareClosedRecommendations() {
- var sid = getStoreId();
- if (!sid) {
- renderShareClosedRecommended([]);
- return;
- }
- fetchShareClosedStoreRecommend(sid)
- .then(function (res) {
- var list = normalizeClosedStoreRecommendList(res);
- if (!list.length && res && res.msg) {
- console.warn('[store-recommend]', res.msg);
- }
- renderShareClosedRecommended(list);
- })
- .catch(function (e) {
- console.error(e);
- renderShareClosedRecommended([]);
- });
- }
- function applyShareIndexClosedMerchantUi(closed) {
- var wasClosed = closedMerchantFlag;
- closedMerchantFlag = closed;
- var banner = document.getElementById('shareClosedBanner');
- var contentEl = document.getElementById('shareContentEl');
- var belowEl = document.getElementById('shareBelowContentEl');
- var recWrap = document.getElementById('shareClosedRecommendWrap');
- if (banner) {
- banner.style.display = closed ? 'block' : 'none';
- banner.setAttribute('aria-hidden', closed ? 'false' : 'true');
- }
- if (contentEl) {
- contentEl.style.display = closed ? 'none' : '';
- contentEl.setAttribute('aria-hidden', closed ? 'true' : 'false');
- }
- if (belowEl) {
- belowEl.style.display = '';
- belowEl.setAttribute('aria-hidden', 'false');
- }
- if (recWrap) {
- if (closed) {
- recWrap.style.display = 'block';
- recWrap.setAttribute('aria-hidden', 'false');
- if (!wasClosed) {
- loadShareClosedRecommendations();
- }
- } else {
- recWrap.style.display = 'none';
- recWrap.setAttribute('aria-hidden', 'true');
- renderShareClosedRecommended([]);
- }
- }
- }
- function renderDetail(d) {
- if (!d) return;
- document.getElementById('storeName').textContent = d.storeName || '—';
- var score = d.scoreAvg != null ? Number(d.scoreAvg) : NaN;
- document.getElementById('scoreAvg').textContent = !isNaN(score) ? score.toFixed(1) : '—';
- document.getElementById('commitCount').textContent = d.commitCount != null ? String(d.commitCount)+'条' : '0';
- var evRow = document.getElementById('storeEvaluateRow');
- var evOne = document.getElementById('storeEvaluateScoreOne');
- var evTwo = document.getElementById('storeEvaluateScoreTwo');
- var evThree = document.getElementById('storeEvaluateScoreThree');
- if (evRow && evOne && evTwo && evThree) {
- evRow.classList.remove('is-visible');
- evRow.setAttribute('aria-hidden', 'true');
- var es = getStoreEvaluateScores(d);
- var a = fmtEvalScore(es.scoreOne);
- var b = fmtEvalScore(es.scoreTwo);
- var c = fmtEvalScore(es.scoreThree);
- if (a !== null || b !== null || c !== null) {
- evOne.textContent = a !== null ? a : '—';
- evTwo.textContent = b !== null ? b : '—';
- evThree.textContent = c !== null ? c : '—';
- evRow.classList.add('is-visible');
- evRow.setAttribute('aria-hidden', 'false');
- }
- }
- var bizDisp = computeBusinessStatusDisplay(d);
- var bizEl = document.getElementById('bizStatus');
- bizEl.textContent = bizDisp.text;
- bizEl.className = 'status' + (bizDisp.isOpen ? ' is-open' : '');
- document.getElementById('hoursText').textContent = '';
- document.getElementById('storeAddr').textContent = d.queryAddress || d.storeAddress || '—';
- if (d.distance != null) {
- document.getElementById('metaDistance').style.display = 'flex';
- document.getElementById('distanceText').textContent =
- '距您' + (Number(d.distance) > 1 ? d.distance + '千米' : Math.round(Number(d.distance) * 1000) + '米');
- }
- if (d.subwayName && d.distance2 != null) {
- document.getElementById('metaSubway').style.display = 'flex';
- document.getElementById('subwayText').textContent =
- '距' + d.subwayName + '步行' + (Number(d.distance2) >= 1000
- ? (Number(d.distance2) / 1000).toFixed(1) + 'km'
- : Math.round(Number(d.distance2)) + 'm');
- }
- var imgs = [];
- if (Array.isArray(d.storeAlbumUrlList) && d.storeAlbumUrlList.length) imgs = d.storeAlbumUrlList.slice();
- else if (d.entranceImage) imgs = [d.entranceImage];
- buildHeroSlides(imgs);
- var closedMerchant = Number(d.businessStatus) === 99;
- applyShareIndexClosedMerchantUi(closedMerchant);
- renderMarketingList(marketingListCache);
- renderPerformanceList();
- renderStaffGroups(staffGroupsCache);
- }
- function getLngForApi() {
- var v = q('jingdu');
- if (v) return v;
- return q('lon') || q('lng') || q('longitude');
- }
- function getLatForApi() {
- var v = q('weidu');
- if (v) return v;
- return q('lat') || q('latitude');
- }
- function mergeSearchAndHashParamsForRedirect() {
- var params = new URLSearchParams();
- function ingest(slice) {
- if (!slice) return;
- var p = new URLSearchParams(slice);
- p.forEach(function (val, key) {
- params.set(key, val);
- });
- }
- if (location.search && location.search.length > 1) {
- ingest(location.search.slice(1));
- }
- var hash = location.hash || '';
- var qi = hash.indexOf('?');
- if (qi >= 0) {
- ingest(hash.slice(qi + 1));
- }
- return params;
- }
- /** getClientStoreDetail 无承载数据时进 shareCheckInUndefined(businessStatus=99 与落地页约定一致) */
- function buildShareCheckInUndefinedRedirectHref() {
- var p = mergeSearchAndHashParamsForRedirect();
- p.set('businessStatus', '99');
- var sid = getStoreId();
- if (sid && !p.has('storeId')) {
- p.set('storeId', sid);
- }
- var j = getLngForApi();
- var w = getLatForApi();
- if (j && !p.has('userLng')) {
- p.set('userLng', j);
- }
- if (w && !p.has('userLat')) {
- p.set('userLat', w);
- }
- var qs = p.toString();
- return 'shareCheckInUndefined.html' + (qs ? ('?' + qs) : '?businessStatus=99');
- }
- function run() {
- var sid = getStoreId();
- var userId = q('userId');
- var jingdu = getLngForApi();
- var weidu = getLatForApi();
- if (!sid) {
- showErr('缺少店铺 id(请从 App 分享链接打开,URL 需带 id 或 storeId)');
- document.getElementById('storeName').textContent = '参数错误';
- return;
- }
- var detailPath = '/store/info/getClientStoreDetail?' +
- 'id=' + encodeURIComponent(sid) +
- '&userId=' + encodeURIComponent(userId) +
- '&jingdu=' + encodeURIComponent(jingdu) +
- '&weidu=' + encodeURIComponent(weidu);
- fetchStoreInfoGetOne(sid).then(function (getOneRes) {
- if (isGetOneBusinessStatus99(getOneRes)) {
- applyShareIndexClosedMerchantUi(true);
- }
- apiFetch(detailPath)
- .then(function (res) {
- var tip = res && res.msg != null ? String(res.msg).trim() : '';
- if (tip === '暂无承载数据') {
- if (closedMerchantFlag) {
- return;
- }
- window.location.replace(buildShareCheckInUndefinedRedirectHref());
- return;
- }
- if (res.code !== 200 || !res.data) {
- showErr(res.msg || '店铺详情加载失败');
- return;
- }
- renderDetail(res.data);
- })
- .catch(function (e) {
- console.error(e);
- showErr('店铺详情请求失败(若为 file:// 打开,请检查 CORS 或改用 http 访问本页)');
- });
- var couponPath = '/store/info/getStoreCouponList?storeId=' + encodeURIComponent(sid);
- marketingCouponLoaded = false;
- apiFetch(couponPath)
- .then(function (res) {
- marketingCouponLoaded = true;
- var list = (res && res.code === 200 && res.data && res.data.marketingList) || [];
- if (!Array.isArray(list)) list = [];
- renderMarketingList(list);
- })
- .catch(function (e) {
- marketingCouponLoaded = true;
- console.warn('[getStoreCouponList]', e);
- renderMarketingList([]);
- });
- if (shouldShowPerformanceSection()) {
- var perfPath = '/performance/list/query?storeId=' + encodeURIComponent(sid) + '&page=1&size=100';
- apiFetch(perfPath)
- .then(function (res) {
- var d = (res && res.code === 200 && res.data) || null;
- if (!d || typeof d !== 'object') {
- performanceListCache.records = [];
- performanceListCache.total = 0;
- } else {
- performanceListCache.records = Array.isArray(d.records) ? d.records.slice() : [];
- var pt = d.total;
- performanceListCache.total = pt != null && !isNaN(Number(pt))
- ? Number(pt)
- : performanceListCache.records.length;
- }
- renderPerformanceList();
- })
- .catch(function (e) {
- console.warn('[performance/list/query]', e);
- performanceListCache.records = [];
- performanceListCache.total = 0;
- renderPerformanceList();
- });
- } else {
- performanceListCache.records = [];
- performanceListCache.total = 0;
- renderPerformanceList();
- }
- var staffPath = '/storeStaffConfig/queryStaffListByTitle?storeId=' + encodeURIComponent(sid);
- apiFetch(staffPath)
- .then(function (res) {
- var arr = (res && res.code === 200 && res.data) || [];
- if (!Array.isArray(arr)) arr = [];
- renderStaffGroups(arr);
- })
- .catch(function (e) {
- console.warn('[queryStaffListByTitle]', e);
- renderStaffGroups([]);
- });
- });
- }
- function boot() {
- run();
- bindMarketingMore();
- bindStaffSection();
- var openBtn = document.getElementById('openApp');
- if (openBtn) {
- openBtn.addEventListener('click', function () {
- tryOpenHBuilderApp();
- });
- }
- }
- if (document.readyState === 'complete') {
- boot();
- } else {
- window.onload = boot;
- }
- })();
- </script>
- </body>
- </html>
|