| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309 |
- <template>
- <div class="parameter-settings">
- <!-- 顶部二级菜单 -->
- <div class="sub-tabs">
- <div
- v-for="tab in subTabs"
- :key="tab.value"
- :class="['sub-tab-item', { active: activeSubTab === tab.value }]"
- @click="activeSubTab = tab.value"
- >
- {{ tab.label }}
- </div>
- </div>
- <!-- 内容区域 -->
- <div class="content-body">
- <!-- 搜索栏编辑区 -->
- <div v-if="activeSubTab === 'search'" class="search-editor">
- <!-- 实时预览区 (参照图1) -->
- <div class="preview-section">
- <div class="preview-title">实时预览</div>
- <div class="live-preview-box">
- <div class="search-bar-mockup">
- <!-- 左侧标题 -->
- <div class="mockup-left">
- <div class="main-title" :style="{ color: form.themeColor }">{{ form.mainTitle }}</div>
- <div class="sub-title">{{ form.subTitle }}</div>
- </div>
- <!-- 中间搜索框 -->
- <div class="mockup-center" :style="{ '--theme-color': form.themeColor }">
- <div class="search-input-wrapper" :style="{ borderColor: form.themeColor }">
- <div class="placeholder-scroll">
- <transition-group name="list-scroll" tag="div" class="scroll-container">
- <div v-for="(text, index) in searchPlaceholderList" :key="text" v-show="index === currentPlaceholderIndex" class="scroll-item">
- {{ text }}
- </div>
- </transition-group>
- </div>
- <div class="search-btn" :style="{ backgroundColor: form.themeColor }">搜 索</div>
- </div>
- <div class="hot-words">
- <span v-for="item in form.hotWordsList" :key="item.name" class="hot-word">{{ item.name }}</span>
- </div>
- </div>
- <!-- 右侧功能按钮 (可配置) -->
- <div class="mockup-right">
- <div class="cart-btn" :style="{ borderColor: form.themeColor, color: form.themeColor }">
- <img v-if="form.rightBtnIcon" :src="form.rightBtnIcon" style="width: 16px; height: 16px; margin-right: 4px; object-fit: contain" />
- <span v-if="form.rightBtnText">{{ form.rightBtnText }}</span>
- <span v-else-if="!form.rightBtnIcon">购物车</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 配置项表单 -->
- <div class="settings-section">
- <el-form :model="form" label-width="120px" label-position="left">
- <el-form-item label="主标题:">
- <el-input v-model="form.mainTitle" placeholder="如:优易企业购" class="settings-input" />
- </el-form-item>
- <el-form-item label="副标题:">
- <el-input v-model="form.subTitle" placeholder="如:省钱 · 省心 · 省时间" class="settings-input" />
- </el-form-item>
- <el-form-item label="搜索框文字:">
- <el-input v-model="form.placeholderText" placeholder="支持输入多个,请用英文逗号(,)隔开实现上下滚动效果" class="settings-input" />
- </el-form-item>
- <el-form-item label="搜索热词:">
- <div class="hot-words-config">
- <div v-for="(item, index) in form.hotWordsList" :key="index" class="hot-word-row">
- <el-input v-model="item.name" placeholder="热词名称" class="hot-word-input-name" />
- <el-input v-model="item.link" placeholder="跳转地址" class="hot-word-input-link" />
- <el-button type="danger" icon="Delete" circle plain size="small" @click="removeHotWord(index)" />
- </div>
- <el-button type="primary" icon="Plus" link @click="addHotWord" class="add-hotword-btn">添加热词</el-button>
- </div>
- </el-form-item>
- <el-form-item label="按钮图标:">
- <div class="upload-placeholder-square" @click="triggerUpload('rightBtnIcon')">
- <img v-if="form.rightBtnIcon" :src="form.rightBtnIcon" class="form-preview-img-square" style="width: 24px; height: 24px" />
- <el-icon v-else class="upload-icon"><Plus /></el-icon>
- </div>
- <div class="field-tip">建议尺寸: 32*32, 格式: PNG/SVG</div>
- </el-form-item>
- <el-form-item label="按钮文字:">
- <el-input v-model="form.rightBtnText" placeholder="如:购物车" maxlength="6" show-word-limit class="settings-input" />
- </el-form-item>
- <el-form-item label="跳转地址:">
- <el-input v-model="form.rightBtnLink" placeholder="请输入跳转地址" class="settings-input" />
- </el-form-item>
- <el-form-item label="主题色:">
- <div class="color-picker-wrap">
- <el-color-picker v-model="form.themeColor" />
- <span class="color-val">{{ form.themeColor }}</span>
- </div>
- </el-form-item>
- </el-form>
- </div>
- </div>
- <!-- 广告图编辑区 -->
- <div v-else-if="activeSubTab === 'carousel'" class="carousel-editor">
- <!-- 模块一:左侧广告设置 -->
- <div class="editor-section">
- <div class="section-header">
- <span class="section-title">模块一:左侧广告设置</span>
- <span class="section-desc">尺寸要求:790 * 460,支持上传本地图片并设置跳转链接</span>
- </div>
- <div class="left-ad-container">
- <div
- class="left-ad-preview-wrapper"
- :class="{ expanded: leftAdHover }"
- @mouseenter="leftAdHover = true"
- @mouseleave="leftAdHover = false"
- >
- <img v-if="form.leftAdImage" :src="form.leftAdImage" class="left-ad-img" alt="左侧广告" />
- <div v-else class="left-ad-empty" @click="triggerUpload('leftAd')">
- <el-icon :size="40"><Plus /></el-icon>
- <p>点击上传广告图</p>
- </div>
- <div class="ad-actions" v-show="leftAdHover && form.leftAdImage">
- <el-button type="primary" icon="Edit" circle @click="triggerUpload('leftAd')" title="更换图片" />
- <el-button type="danger" icon="Delete" circle @click="handleDeleteLeftAd" title="删除图片" />
- </div>
- </div>
- <div class="left-ad-settings" v-if="form.leftAdImage">
- <el-form label-width="90px" label-position="left">
- <el-form-item label="跳转地址:">
- <el-input v-model="form.leftAdLink" placeholder="请输入以 http:// 或 https:// 开头的地址" class="settings-input-ad" />
- </el-form-item>
- </el-form>
- <div class="left-ad-tip">
- <el-icon><InfoFilled /></el-icon>
- <span>鼠标悬停查看全图预览效果,点击在新窗口打开</span>
- </div>
- </div>
- </div>
- </div>
- <!-- 模块二:轮播图管理 -->
- <div class="editor-section">
- <div class="section-header">
- <span class="section-title">模块二:轮播图设置</span>
- <span class="section-desc">尺寸要求:552 * 190,支持拖拽排序与实时状态切换</span>
- </div>
- <!-- 实时预览区 -->
- <div class="carousel-preview-box">
- <div class="preview-mockup">
- <el-carousel height="190px" trigger="click" indicator-position="inside" arrow="never">
- <el-carousel-item v-for="item in activeCarouselList" :key="item.id">
- <div class="carousel-slide">
- <img :src="item.image" alt="轮播图" />
- </div>
- </el-carousel-item>
- <div v-if="activeCarouselList.length === 0" class="carousel-empty">
- <el-icon :size="40"><Picture /></el-icon>
- <p>暂无启用的轮播图预览</p>
- </div>
- </el-carousel>
- </div>
- </div>
- <!-- 列表管理区 -->
- <div class="carousel-list-box">
- <div class="list-toolbar">
- <el-button type="primary" icon="Plus" @click="handleAddCarousel" class="btn-add-carousel">新增轮播图</el-button>
- <span class="drag-tip">提示:列表支持状态切换及拖拽排序管理</span>
- </div>
- <el-table :data="carouselList" style="width: 100%" row-key="id" border header-cell-class-name="table-header-custom">
- <el-table-column label="排序" width="70" align="center">
- <template #default="scope">
- <div class="rank-box">
- <el-icon v-if="scope.$index > 0" class="rank-icon" @click="moveRow(scope.$index, -1)"><CaretTop /></el-icon>
- <el-icon v-if="scope.$index < carouselList.length - 1" class="rank-icon" @click="moveRow(scope.$index, 1)"
- ><CaretBottom
- /></el-icon>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="序号" type="index" width="60" align="center" />
- <el-table-column label="图片" width="180">
- <template #default="scope">
- <el-image :src="scope.row.image" :preview-src-list="[scope.row.image]" fit="cover" class="table-img" preview-teleported />
- </template>
- </el-table-column>
- <el-table-column prop="link" label="跳转地址" show-overflow-tooltip />
- <el-table-column label="打开方式" width="120" align="center">
- <template #default="scope">
- <el-tag :type="scope.row.target === '_blank' ? 'success' : 'info'" size="small">
- {{ scope.row.target === '_blank' ? '新窗口' : '当前窗口' }}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column label="状态" width="100" align="center">
- <template #default="scope">
- <el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" active-color="#13ce66" />
- </template>
- </el-table-column>
- <el-table-column label="操作" width="150" align="center">
- <template #default="scope">
- <el-button link type="primary" @click="handleEditCarousel(scope.row)">修改</el-button>
- <el-button link type="danger" @click="handleRemoveCarousel(scope.$index)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </div>
- <!-- 快捷入口编辑区 -->
- <div v-else-if="activeSubTab === 'quick-entry'" class="quick-entry-editor">
- <div class="preview-section">
- <div class="preview-title">快捷入口实时预览 (尺寸: 230 * 167)</div>
- <div class="quick-entry-preview-outer">
- <!-- 仿真预览模块 (230*167) -->
- <div class="qe-mockup-card">
- <div class="qe-card-header">
- <span class="qe-card-title">{{ quickEntrySettings.moduleName }}</span>
- <el-icon class="qe-header-arrow"><ArrowRight /></el-icon>
- </div>
- <div class="qe-grid-container">
- <div class="qe-grid-wrapper" :style="{ transform: `translateX(-${qePageIndex * 198}px)` }">
- <!-- 网格页 -->
- <div v-for="pageIdx in qePageCount" :key="pageIdx" class="qe-grid-page">
- <div v-for="(item, idx) in getPageItems(pageIdx - 1)" :key="idx" class="qe-item">
- <div class="qe-icon-wrap">
- <img v-if="item.icon" :src="item.icon" class="qe-icon-img" />
- <el-icon v-else class="qe-icon-placeholder"><Menu /></el-icon>
- <div v-if="item.tag" class="qe-tag-bubble">{{ item.tag }}</div>
- </div>
- <span class="qe-name">{{ item.name }}</span>
- </div>
- </div>
- </div>
- <!-- 左右翻页按钮 (仅在多于8项时显示) -->
- <div v-if="quickEntryList.length > 8" class="qe-nav-btns">
- <div v-if="qePageIndex > 0" class="qe-nav-btn prev" @click="qePageIndex--">
- <el-icon><ArrowLeft /></el-icon>
- </div>
- <div v-if="qePageIndex < qePageCount - 1" class="qe-nav-btn next" @click="qePageIndex++">
- <el-icon><ArrowRight /></el-icon>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 列表设置 -->
- <div class="editor-section">
- <div class="section-header">
- <span class="section-title">模块基础配置</span>
- </div>
- <div class="config-form-inline">
- <el-form :inline="true" :model="quickEntrySettings" label-width="100px">
- <el-form-item label="模块名称:">
- <el-input v-model="quickEntrySettings.moduleName" placeholder="如:企业工作台" />
- </el-form-item>
- <el-form-item label="跳转地址:">
- <el-input v-model="quickEntrySettings.jumpLink" placeholder="标题点击跳转地址" style="width: 300px" />
- </el-form-item>
- </el-form>
- </div>
- <div class="section-header m-t-20">
- <span class="section-title">入口项管理列表</span>
- </div>
- <div class="list-toolbar">
- <div class="drag-tip">提示:一页显示8个,超过8个将自动启用预览区右滑功能</div>
- <el-button type="primary" icon="Plus" @click="handleAddQuickEntry">新增入口</el-button>
- </div>
- <el-table :data="quickEntryList" border style="width: 100%" header-cell-class-name="table-header-custom">
- <el-table-column label="排序" width="80" align="center">
- <template #default="{ $index }">
- <div class="rank-box">
- <el-icon v-if="$index > 0" class="rank-icon" @click="moveQE($index, -1)"><CaretTop /></el-icon>
- <el-icon v-if="$index < quickEntryList.length - 1" class="rank-icon" @click="moveQE($index, 1)"><CaretBottom /></el-icon>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="图标" width="100" align="center">
- <template #default="{ row }">
- <div class="table-icon-cell">
- <img v-if="row.icon" :src="row.icon" style="width: 24px; height: 24px" />
- <el-icon v-else style="font-size: 20px; color: #ccc"><Menu /></el-icon>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="name" label="名称" width="150" />
- <el-table-column label="标签" width="120" align="center">
- <template #default="{ row }">
- <el-tag v-if="row.tag" type="danger" size="small" effect="plain">{{ row.tag }}</el-tag>
- <span v-else>-</span>
- </template>
- </el-table-column>
- <el-table-column prop="link" label="跳转地址" show-overflow-tooltip />
- <el-table-column label="状态" width="100" align="center">
- <template #default="{ row }">
- <el-switch v-model="row.status" :active-value="1" :inactive-value="0" />
- </template>
- </el-table-column>
- <el-table-column label="操作" width="150" fixed="right" align="center">
- <template #default="{ row, $index }">
- <el-button type="primary" link @click="handleEditQuickEntry(row, $index)">编辑</el-button>
- <el-button type="danger" link @click="handleDeleteQuickEntry($index)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <!-- 分类设置编辑区 -->
- <div v-else-if="activeSubTab === 'category'" class="category-editor">
- <!-- 模块一:实时预览 (高度还原图1、2) -->
- <div class="editor-section">
- <div class="section-header">
- <span class="section-title">分类实时预览</span>
- <span class="section-desc">尺寸要求:280 * 398,悬停可查看右滑面板效果 (图1、图2)</span>
- </div>
- <div class="category-preview-container">
- <!-- 图1: 分类菜单 -->
- <div class="category-menu-mockup">
- <div v-for="item in categoryList.filter((c) => c.status === 1).slice(0, 10)" :key="item.id" class="menu-item">
- <div class="menu-icon">
- <img v-if="item.icon" :src="item.icon" alt="" />
- <el-icon v-else><Menu /></el-icon>
- </div>
- <div class="menu-name">{{ item.name }}</div>
- <!-- 图2: 悬停右滑面板 - CSS 控制显示 -->
- <div class="category-panel-mockup">
- <div class="panel-header-line"></div>
- <div class="panel-content">
- <!-- 顶部标签栏 -->
- <div class="panel-tabs">
- <span v-for="tag in item.tags" :key="tag.name" class="panel-tab-item">{{ tag.name }}</span>
- </div>
- <!-- 品牌位 (图3) - 绝对定位至右上角 -->
- <div class="brand-box">
- <div class="brand-main-title">
- {{ item.panelData.mainTitle }}<span class="brand-strong">{{ item.panelData.subTitle }}</span>
- </div>
- <div class="brand-notes">
- <template v-for="(note, nIdx) in item.panelData.notes" :key="nIdx">
- <span class="note-item">{{ note.name }}</span>
- <span v-if="nIdx < item.panelData.notes.length - 1" class="note-sep">|</span>
- </template>
- </div>
- </div>
- <div class="panel-body">
- <!-- 左侧分类列表 -->
- <div class="panel-main">
- <div v-for="group in item.panelData.groups" :key="group.title" class="category-group">
- <div class="group-title">{{ group.title }}</div>
- <div class="group-items">
- <span v-for="sub in group.items" :key="sub" class="group-item">{{ sub }}</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 模块二:列表设置 -->
- <div class="editor-section">
- <div class="section-header">
- <span class="section-title">分类列表设置</span>
- <span class="section-desc">管理首页分类菜单的显示内容、图标、标签及关联分类</span>
- </div>
- <div class="list-toolbar">
- <div class="theme-color-setting-pro">
- <span class="label">主题色:</span>
- <el-color-picker v-model="categoryThemeColor" />
- <span class="value">{{ categoryThemeColor }}</span>
- </div>
- <el-button type="primary" icon="Plus" @click="handleAddCategory">新增分类</el-button>
- </div>
- <el-table :data="categoryList" border style="width: 100%" header-cell-class-name="table-header-custom">
- <el-table-column label="排序" width="70" align="center">
- <template #default="scope">
- <div class="rank-box">
- <el-icon v-if="scope.$index > 0" class="rank-icon" @click="moveCategory(scope.$index, -1)"><CaretTop /></el-icon>
- <el-icon v-if="scope.$index < categoryList.length - 1" class="rank-icon" @click="moveCategory(scope.$index, 1)"
- ><CaretBottom
- /></el-icon>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="菜单名称" prop="name" min-width="200" show-overflow-tooltip />
- <el-table-column label="图标" width="80" align="center">
- <template #default="scope">
- <el-image v-if="scope.row.icon" :src="scope.row.icon" fit="contain" class="table-icon-preview" />
- <span v-else class="text-gray">-</span>
- </template>
- </el-table-column>
- <el-table-column label="同步分类" prop="syncCategory" width="120" />
- <el-table-column label="标签" min-width="180">
- <template #default="scope">
- <div class="tag-wrap">
- <el-tag v-for="tag in scope.row.tags" :key="tag.name" size="small" class="m-r-5">{{ tag.name }}</el-tag>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="状态" width="100" align="center">
- <template #default="scope">
- <el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" active-color="#13ce66" />
- </template>
- </el-table-column>
- <el-table-column label="操作" width="150" align="center" fixed="right">
- <template #default="scope">
- <el-button link type="primary" @click="handleEditCategory(scope.row)">编辑</el-button>
- <el-button link type="danger" @click="handleRemoveCategory(scope.$index)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <!-- 头部分类编辑区 -->
- <div v-else-if="activeSubTab === 'headerCategory'" class="header-category-editor">
- <!-- 实时预览区 (1350*60) -->
- <div class="preview-section">
- <div class="preview-title">头部分类实时预览</div>
- <div class="header-preview-outer">
- <div class="header-preview-box">
- <!-- 左侧箭头 -->
- <div v-show="showLeftArrow" class="nav-arrow left-arrow" @click="scrollHeaderNav('left')">
- <el-icon><ArrowLeft /></el-icon>
- </div>
- <div class="header-nav-scroll" ref="headerNavScrollRef" @scroll="updateNavArrows">
- <div class="header-nav-list">
- <div v-for="item in headerCategoryList.filter((i) => i.status === 1)" :key="item.id" class="header-nav-item">
- <div class="item-icon">
- <img v-if="item.icon" :src="item.icon" alt="" />
- <el-icon v-else :style="{ color: headerThemeColor }"><Menu /></el-icon>
- </div>
- <span class="item-text" :style="{ '--hover-color': headerThemeColor }">{{ item.title }}</span>
- </div>
- </div>
- </div>
- <!-- 右侧箭头 -->
- <div v-show="showRightArrow" class="nav-arrow right-arrow" @click="scrollHeaderNav('right')">
- <el-icon><ArrowRight /></el-icon>
- </div>
- </div>
- </div>
- <div class="preview-desc">尺寸要求:1350 * 60,导航项横向排列,支持图标与主题色联动</div>
- </div>
- <!-- 列表设置 -->
- <div class="editor-section">
- <div class="section-header">
- <span class="section-title">分类列表设置管理</span>
- </div>
- <div class="list-toolbar">
- <div class="theme-color-setting-pro">
- <span class="label">主题色设置:</span>
- <el-color-picker v-model="headerThemeColor" />
- <span class="value">{{ headerThemeColor }}</span>
- </div>
- <el-button type="primary" icon="Plus" @click="handleAddHeaderCategory">新增分类</el-button>
- </div>
- <el-table :data="headerCategoryList" border style="width: 100%" header-cell-class-name="table-header-custom">
- <el-table-column label="排序" width="80" align="center">
- <template #default="{ $index }">
- <div class="rank-box">
- <el-icon v-if="$index > 0" class="rank-icon" @click="moveHeader($index, -1)"><CaretTop /></el-icon>
- <el-icon v-if="$index < headerCategoryList.length - 1" class="rank-icon" @click="moveHeader($index, 1)"><CaretBottom /></el-icon>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="title" label="分类标题名称" min-width="150" />
- <el-table-column label="图标" width="100" align="center">
- <template #default="{ row }">
- <img v-if="row.icon" :src="row.icon" class="table-icon-preview" style="width: 22px; height: 22px" />
- <span v-else>-</span>
- </template>
- </el-table-column>
- <el-table-column prop="link" label="跳转地址" show-overflow-tooltip />
- <el-table-column label="打开方式" width="120" align="center">
- <template #default="{ row }">
- <el-tag :type="row.openMode === 'new' ? 'success' : 'info'" size="small">
- {{ row.openMode === 'new' ? '新窗口' : '当前页' }}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column label="状态" width="100" align="center">
- <template #default="{ row }">
- <el-switch v-model="row.status" :active-value="1" :inactive-value="0" active-color="#13ce66" />
- </template>
- </el-table-column>
- <el-table-column label="操作" width="150" fixed="right" align="center">
- <template #default="{ row, $index }">
- <el-button type="primary" link @click="handleEditHeaderCategory(row, $index)">编辑</el-button>
- <el-button type="danger" link @click="handleDeleteHeaderCategory($index)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <!-- 广告模块编辑区 -->
- <div v-else-if="activeSubTab === 'ad-module'" class="ad-module-editor">
- <div class="preview-section">
- <div class="preview-title">广告模块实时预览</div>
- <div class="ad-preview-grid">
- <!-- 广告一: 企业购x百亿补贴 (484*190) -->
- <div class="ad-item ad-subsidy" :style="{ width: '484px', height: '190px' }">
- <div class="ad-header">
- <div class="ad-title-main" :style="getAdTitleStyle(0, 'main')">{{ getAdTitleText(0, 'main') }}</div>
- <div class="ad-title-sub" :style="getAdTitleStyle(0, 'sub')">{{ getAdTitleText(0, 'sub') }}</div>
- </div>
- <div class="ad-products-subsidy">
- <div v-for="item in adModules[0].items" :key="item.id" class="product-item">
- <div class="product-img"><img :src="item.image" alt="" /></div>
- <div class="product-price">¥{{ item.price }}</div>
- </div>
- </div>
- <div class="ad-hover-mask">
- <el-button type="primary" size="small" @click="handleEditAd(0)">设置</el-button>
- </div>
- </div>
- <!-- 广告二: 企采榜单 (253*196) -->
- <div class="ad-item ad-ranking" :style="{ width: '253px', height: '196px' }">
- <div class="ad-header">
- <div class="ad-title-main" :style="getAdTitleStyle(1, 'main')">{{ getAdTitleText(1, 'main') }}</div>
- <div class="ad-title-sub" :style="getAdTitleStyle(1, 'sub')">{{ getAdTitleText(1, 'sub') }}</div>
- </div>
- <div class="ad-products-ranking">
- <div v-for="item in adModules[1].items" :key="item.id" class="ranking-item">
- <div class="ranking-badge">{{ item.tag || '排行榜' }} ></div>
- <div class="product-img"><img :src="item.image" alt="" /></div>
- <div class="ranking-footer">已售{{ item.sales }}件</div>
- </div>
- </div>
- <div class="ad-hover-mask">
- <el-button type="primary" size="small" @click="handleEditAd(1)">设置</el-button>
- </div>
- </div>
- <!-- 广告三: 品牌好店 (253*196) -->
- <div class="ad-item ad-brand" :style="{ width: '253px', height: '196px' }">
- <div class="ad-header">
- <div class="ad-title-main" :style="getAdTitleStyle(2, 'main')">{{ getAdTitleText(2, 'main') }}</div>
- <div class="ad-title-sub" :style="getAdTitleStyle(2, 'sub')">{{ getAdTitleText(2, 'sub') }}</div>
- </div>
- <div class="ad-brands-content">
- <div v-for="item in adModules[2].items" :key="item.id" class="brand-item">
- <div class="brand-logo"><img :src="item.image" alt="" /></div>
- <div class="brand-name">{{ item.tagLink || item.name }}</div>
- <div class="brand-tag-btn">{{ item.tag || '品质保障' }}</div>
- </div>
- </div>
- <div class="ad-hover-mask">
- <el-button type="primary" size="small" @click="handleEditAd(2)">设置</el-button>
- </div>
- </div>
- <!-- 广告四: 企业精选 (253*196) -->
- <div class="ad-item ad-selection" :style="{ width: '253px', height: '196px' }">
- <div class="ad-header">
- <div class="ad-title-main" :style="getAdTitleStyle(3, 'main')">{{ getAdTitleText(3, 'main') }}</div>
- <div class="ad-title-sub" :style="getAdTitleStyle(3, 'sub')">{{ getAdTitleText(3, 'sub') }}</div>
- </div>
- <div class="ad-products-selection">
- <div v-for="item in adModules[3].items" :key="item.id" class="selection-item">
- <div class="product-img"><img :src="item.image" alt="" /></div>
- <div class="product-price-row">
- <span class="p-unit">¥</span>
- <span class="p-val">{{ item.price }}</span>
- </div>
- </div>
- </div>
- <div class="ad-hover-mask">
- <el-button type="primary" size="small" @click="handleEditAd(3)">设置</el-button>
- </div>
- </div>
- <!-- 广告五: 企业购x京东新品 (253*196) -->
- <div class="ad-item ad-new" :style="{ width: '253px', height: '196px' }">
- <div class="ad-header">
- <div class="ad-title-main" :style="getAdTitleStyle(4, 'main')">{{ getAdTitleText(4, 'main') }}</div>
- <div class="ad-title-sub" :style="getAdTitleStyle(4, 'sub')">{{ getAdTitleText(4, 'sub') }}</div>
- </div>
- <div class="ad-products-selection">
- <div v-for="item in adModules[4].items" :key="item.id" class="selection-item">
- <div class="product-img"><img :src="item.image" alt="" /></div>
- <div class="product-price-row center">
- <span class="p-unit">¥</span>
- <span class="p-val">{{ item.price }}</span>
- </div>
- </div>
- </div>
- <div class="ad-hover-mask">
- <el-button type="primary" size="small" @click="handleEditAd(4)">设置</el-button>
- </div>
- </div>
- </div>
- <div class="preview-desc">提示:支持 5 个独立广告模块配置,悬停模块显示“设置”按钮进行内容管理</div>
- </div>
- </div>
- <!-- 场景方案编辑区 -->
- <!-- 场景方案编辑区 -->
- <div v-else-if="activeSubTab === 'scenario'" class="scenario-editor-container">
- <!-- 实时预览区 -->
- <div class="preview-section-standard">
- <div class="section-title-standard">场景方案实时预览</div>
- <div class="scenario-preview-outer">
- <div class="scenario-preview-box-clean" :style="{ '--s-theme-color': scenarioSettings.themeColor }">
- <!-- 左侧标题区 -->
- <div class="scenario-header-left">
- <div class="s-title-group">
- <span class="s-main-title">{{ scenarioSettings.mainTitle }}</span>
- <span class="s-sub-title-inline">{{ scenarioSettings.subTitle }}</span>
- </div>
- <div class="s-btn-wrap">
- <div class="s-btn-premium">
- {{ scenarioSettings.btnText }}
- <el-icon class="m-l-5"><CaretRight /></el-icon>
- </div>
- </div>
- </div>
- <!-- 右侧方案卡片 -->
- <div class="scenario-cards-wrap">
- <div
- v-for="(item, idx) in scenarioList"
- :key="item.id"
- class="scenario-card-premium"
- :class="{ 'hidden-card-fourth': idx === 3 }"
- :style="{ backgroundColor: hexToRgba(item.bgColor, item.opacity) }"
- >
- <div class="card-top-header">
- <div class="card-titles-group">
- <span class="card-main-title" :style="{ color: item.titleColor }">{{ item.title }}</span>
- <span class="card-sub-title" :style="{ color: item.subTitleColor }">{{ item.subTitle }}</span>
- </div>
- <div class="card-arrow-icon" :style="{ backgroundColor: item.titleColor }">
- <el-icon><ArrowRight /></el-icon>
- </div>
- </div>
- <div class="card-image-content">
- <img :src="item.image || defaultPlaceholder" alt="" />
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="preview-tip">尺寸要求:1600 * 158,支持响应式隐藏及主题色联动</div>
- </div>
- <!-- 全局配置 -->
- <div class="config-section-standard">
- <div class="section-title-standard">场景解决方案全局设置</div>
- <div class="settings-form-standard">
- <el-form :model="scenarioSettings" label-width="120px" label-position="left">
- <el-form-item label="场景主标题:">
- <el-input v-model="scenarioSettings.mainTitle" placeholder="请输入主标题" style="width: 400px" />
- </el-form-item>
- <el-form-item label="场景副标题:">
- <el-input v-model="scenarioSettings.subTitle" placeholder="请输入副标题" style="width: 400px" />
- </el-form-item>
- <el-form-item label="按钮文字:">
- <el-input v-model="scenarioSettings.btnText" placeholder="请输入按钮文字" style="width: 400px" />
- </el-form-item>
- <el-form-item label="跳转链接:">
- <el-input v-model="scenarioSettings.jumpLink" placeholder="请输入跳转地址" style="width: 400px" />
- </el-form-item>
- <el-form-item label="主题背景色:">
- <div class="theme-color-setting-pro">
- <el-color-picker v-model="scenarioSettings.themeColor" />
- <span class="value">{{ scenarioSettings.themeColor }}</span>
- </div>
- </el-form-item>
- </el-form>
- </div>
- </div>
- <!-- 列表管理 -->
- <div class="config-section-standard">
- <div class="section-title-standard">方案卡片设置管理</div>
- <el-table :data="scenarioList" border style="width: 100%" header-cell-class-name="table-header-custom" class="standard-table">
- <el-table-column label="排序" width="80" align="center">
- <template #default="{ $index }">
- <div class="rank-action-btns">
- <el-icon v-if="$index > 0" class="rank-btn-mini" @click="moveScenario($index, -1)"><ArrowUp /></el-icon>
- <el-icon v-if="$index < scenarioList.length - 1" class="rank-btn-mini" @click="moveScenario($index, 1)"><ArrowDown /></el-icon>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="分类方案名称" min-width="250">
- <template #default="{ row }">
- <div class="flex-column">
- <span :style="{ color: row.titleColor, fontSize: '14px', fontWeight: 'bold' }">{{ row.title }}</span>
- <span class="text-gray" style="font-size: 12px; margin-top: 4px">{{ row.subTitle }}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="图标/封面图" width="200" align="center">
- <template #default="{ row }">
- <el-image :src="row.image" fit="cover" style="width: 160px; height: 48px; border-radius: 4px" />
- </template>
- </el-table-column>
- <el-table-column prop="link" label="跳转链接" min-width="300" show-overflow-tooltip />
- <el-table-column label="操作" width="120" align="center" fixed="right">
- <template #default="{ row, $index }">
- <el-button type="primary" link @click="handleEditScenario(row, $index)">编辑内容</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <!-- 推荐设置编辑区 -->
- <div v-else-if="activeSubTab === 'recommend'" class="recommend-editor-container">
- <!-- 实时预览区 -->
- <div class="preview-section-standard">
- <div class="section-title-standard">为你推荐实时预览</div>
- <div class="recommend-preview-outer">
- <div class="recommend-preview-container">
- <!-- 左侧箭头 -->
- <div v-if="recShowLeft" class="recommend-nav-btn prev" @click="scrollRecommend('left')">
- <el-icon><CaretLeft /></el-icon>
- </div>
- <div
- ref="recommendScrollRef"
- class="recommend-preview-box"
- :style="{ '--r-theme-color': recommendThemeColor }"
- @scroll="updateRecArrows"
- >
- <div
- v-for="item in activeRecommendList"
- :key="item.id"
- :class="['recommend-item', { active: recommendActiveId === item.id }]"
- @click="recommendActiveId = item.id"
- >
- <div class="recommend-icon">
- <img :src="item.icon || defaultPlaceholder" alt="" />
- </div>
- <div class="recommend-text">
- <div class="r-main-title" :style="{ color: recommendActiveId === item.id ? recommendThemeColor : '#333' }">{{ item.name }}</div>
- <div
- class="r-sub-title"
- :style="{
- color: recommendActiveId === item.id ? recommendThemeColor : '#999',
- opacity: recommendActiveId === item.id ? 0.8 : 1
- }"
- >
- {{ item.subTitle }}
- </div>
- </div>
- </div>
- </div>
- <!-- 右侧箭头 -->
- <div v-if="recShowRight" class="recommend-nav-btn next" @click="scrollRecommend('right')">
- <el-icon><CaretRight /></el-icon>
- </div>
- </div>
- </div>
- <div class="preview-desc">尺寸要求:1600 * 88,分类图标 32 * 32,支持响应式平滑滚动及选中态色值联动</div>
- </div>
- <!-- 配置表单区域 -->
- <div class="config-section-standard">
- <div class="section-title-standard">为你推荐配置设置</div>
- <el-form label-width="120px" inline class="m-b-20">
- <el-form-item label="主题选中色调:">
- <div class="theme-color-setting-pro">
- <el-color-picker v-model="recommendThemeColor" />
- <span class="value">{{ recommendThemeColor }}</span>
- </div>
- </el-form-item>
- <el-form-item label="商品列表主题色:">
- <div class="theme-color-setting-pro">
- <el-color-picker v-model="recommendProductThemeColor" />
- <span class="value">{{ recommendProductThemeColor }}</span>
- </div>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" icon="Plus" @click="handleAddRecommend">新增推荐分类</el-button>
- </el-form-item>
- </el-form>
- <el-table :data="recommendList" border style="width: 100%" header-cell-class-name="table-header-custom" class="standard-table">
- <el-table-column label="位置" width="80" align="center">
- <template #default="{ $index }">
- <div class="rank-action-btns">
- <el-icon v-if="$index > 0" class="rank-btn-mini" @click="moveRecommend($index, -1)"><ArrowUp /></el-icon>
- <el-icon v-if="$index < recommendList.length - 1" class="rank-btn-mini" @click="moveRecommend($index, 1)"><ArrowDown /></el-icon>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="分类名称" min-width="120">
- <template #default="{ row }">
- <span style="font-weight: bold; color: #333">{{ row.name }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="subTitle" label="副标题" min-width="150" />
- <el-table-column label="图标" width="100" align="center">
- <template #default="{ row }">
- <div class="table-icon-preview">
- <img :src="row.icon || defaultPlaceholder" class="row-icon" />
- </div>
- </template>
- </el-table-column>
- <el-table-column label="数据类型" width="120" align="center">
- <template #default="{ row }">
- <el-tag :type="row.type === 'category' ? 'success' : 'warning'">
- {{ row.type === 'category' ? '分类映射' : '商品自选' }}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column label="关联类目/商品数" min-width="180">
- <template #default="{ row }">
- <div v-if="row.type === 'category'" class="text-gray">{{ row.categoryLabel || '未设置' }}</div>
- <div v-else class="text-gray">已选 {{ row.selectedProducts?.length || 0 }} 个商品</div>
- </template>
- </el-table-column>
- <el-table-column label="启用状态" width="100" align="center">
- <template #default="{ row }">
- <el-switch v-model="row.status" :active-value="1" :inactive-value="0" active-color="#13ce66" />
- </template>
- </el-table-column>
- <el-table-column label="操作" width="220" align="center" fixed="right">
- <template #default="{ row, $index }">
- <el-button type="primary" link @click="handleEditRecommend(row, $index)">编辑</el-button>
- <el-button v-if="row.type === 'select'" type="primary" link @click="openRecommendProductSelect($index)">选商品</el-button>
- <el-button type="danger" link @click="handleDeleteRecommend($index)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </div>
- <!-- 广告模块设置弹窗 -->
- <el-dialog
- v-model="adDialogVisible"
- :title="`设置广告模块 - ${adModules[currentAdIdx]?.title}`"
- width="1050px"
- custom-class="ad-setup-dialog"
- destroy-on-close
- >
- <el-form :model="adForm" label-width="100px" class="dialog-form-inner">
- <el-form-item label="模块标题:">
- <div class="theme-color-setting-pro">
- <el-input v-model="adForm.title" placeholder="请输入主标题" style="width: 300px" />
- <el-color-picker v-model="adForm.titleColor" />
- <span class="value">{{ adForm.titleColor }}</span>
- </div>
- </el-form-item>
- <el-form-item label="副标题:">
- <div class="theme-color-setting-pro">
- <el-input v-model="adForm.subTitle" placeholder="请输入副标题" style="width: 300px" />
- <el-color-picker v-model="adForm.titleColor" />
- <span class="value">{{ adForm.titleColor }}</span>
- </div>
- </el-form-item>
- <div class="config-subtitle">商品/品牌列表 (固定 {{ adForm.items.length }} 项)</div>
- <el-table :data="adForm.items" border style="width: 100%" class="m-t-10">
- <el-table-column label="位置" width="60" align="center">
- <template #default="scope">{{ scope.$index + 1 }}</template>
- </el-table-column>
- <el-table-column label="图片" width="100" align="center">
- <template #default="{ row }">
- <img :src="row.image" style="width: 50px; height: 50px; object-fit: contain" />
- </template>
- </el-table-column>
- <!-- 通用商品信息列 (百亿补贴、企采精选、京东新品) -->
- <el-table-column v-if="currentAdIdx === 0 || currentAdIdx === 3 || currentAdIdx === 4" label="商品信息" min-width="180">
- <template #default="{ row }">
- <div class="table-info-cell">
- <div class="info-name">{{ row.name || '未选择' }}</div>
- <div class="info-price">价格:¥{{ row.price }}</div>
- <div class="info-id">ID: {{ row.id || '-' }}</div>
- </div>
- </template>
- </el-table-column>
- <!-- 企采榜单 专属列 -->
- <template v-if="currentAdIdx === 1">
- <el-table-column label="商品信息" min-width="150">
- <template #default="{ row }">
- <div class="info-name">{{ row.name || '未选择' }}</div>
- <div class="info-id">ID: {{ row.id || '-' }}</div>
- </template>
- </el-table-column>
- <el-table-column label="排行标签" width="220">
- <template #default="{ row }">
- <el-input v-model="row.tag" placeholder="标签文字" size="small" class="m-b-5" />
- <el-input v-model="row.tagLink" placeholder="跳转链接" size="small" />
- </template>
- </el-table-column>
- <el-table-column label="销量数据" width="130">
- <template #default="{ row }">
- <el-input v-model="row.sales" placeholder="销量" size="small">
- <template #prepend>已售</template>
- </el-input>
- </template>
- </el-table-column>
- </template>
- <!-- 品牌好店 专属列 -->
- <template v-if="currentAdIdx === 2">
- <el-table-column label="品牌名称" min-width="180">
- <template #default="{ row }">
- <div class="brand-name-display">{{ row.name || '未选择' }}</div>
- <div class="info-id m-t-5">ID: {{ row.id || '-' }}</div>
- </template>
- </el-table-column>
- <el-table-column label="品牌标签" width="300">
- <template #default="{ row }">
- <div class="flex-column gap-10">
- <el-input v-model="row.tag" placeholder="标签文字 (如: 品质保障)" />
- <el-input v-model="row.tagLink" placeholder="描述文字 (控制预览品牌名称)" />
- </div>
- </template>
- </el-table-column>
- </template>
- <el-table-column label="操作" width="110" align="center" fixed="right">
- <template #default="scope">
- <el-button type="primary" link @click="openProductSelect(scope.$index)">
- <el-icon class="m-r-5"><Edit /></el-icon>
- {{ scope.row?.id ? '修改' : '选择' }}
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-form>
- <template #footer>
- <el-button @click="adDialogVisible = false">取消</el-button>
- <el-button type="primary" @click="submitAdForm">保存设置</el-button>
- </template>
- </el-dialog>
- <!-- 选择商品/品牌抽屉 (加宽版) -->
- <el-drawer v-model="selectDialogVisible" :title="currentAdIdx === 2 ? '选择品牌' : '选择商品'" size="850px" append-to-body>
- <div class="select-dialog-content">
- <el-input
- v-model="selectSearchQuery"
- :placeholder="currentAdIdx === 2 ? '输入品牌名称搜索' : '输入商品名称或ID搜索'"
- prefix-icon="Search"
- clearable
- style="margin-bottom: 20px"
- @input="selectCurrentPage = 1"
- />
- <div class="select-list">
- <div
- v-for="item in pagedSelectList"
- :key="item.id"
- class="select-item-row"
- :class="{ active: selectedTempId === item.id }"
- @click="selectedTempId = item.id"
- >
- <img :src="item.image" class="select-item-img" />
- <div class="select-item-info">
- <div class="select-item-name">{{ item.name }}</div>
- <div v-if="currentAdIdx !== 2" class="select-item-price">¥{{ item.price }}</div>
- <div class="select-item-id">ID: {{ item.id }}</div>
- </div>
- <el-radio v-model="selectedTempId" :label="item.id"><span></span></el-radio>
- </div>
- </div>
- <!-- 分页组件 -->
- <div class="select-pagination">
- <el-pagination
- v-model:current-page="selectCurrentPage"
- v-model:page-size="selectPageSize"
- :total="filteredSelectList.length"
- :page-sizes="[8, 12, 20, 50]"
- layout="total, sizes, prev, pager, next, jumper"
- background
- />
- </div>
- </div>
- <template #footer>
- <div style="flex: auto; text-align: right; padding: 20px">
- <el-button @click="selectDialogVisible = false">取消</el-button>
- <el-button type="primary" @click="confirmSelect">确定选择</el-button>
- </div>
- </template>
- </el-drawer>
- <!-- 轮播图编辑弹窗 -->
- <el-dialog v-model="dialogVisible" :title="dialogType === 'add' ? '新增轮播图' : '修改轮播图'" width="800px" destroy-on-close>
- <el-form :model="carouselForm" label-width="100px" class="dialog-form-inner">
- <el-form-item label="轮播图片:">
- <div class="upload-placeholder" @click="triggerUpload('carousel')">
- <img v-if="carouselForm.image" :src="carouselForm.image" class="form-preview-img" />
- <el-icon v-else class="upload-icon"><Plus /></el-icon>
- </div>
- <div class="upload-tip">推荐尺寸:552 * 190,支持上传本地图片</div>
- </el-form-item>
- <el-form-item label="跳转地址:">
- <el-input v-model="carouselForm.link" placeholder="请输入以 http:// 或 https:// 开头的地址" />
- </el-form-item>
- <el-form-item label="打开方式:">
- <el-radio-group v-model="carouselForm.target">
- <el-radio label="_self">当前窗口</el-radio>
- <el-radio label="_blank">新窗口</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="启用状态:">
- <el-switch v-model="carouselForm.status" :active-value="1" :inactive-value="0" active-color="#13ce66" />
- </el-form-item>
- </el-form>
- <template #footer>
- <el-button @click="dialogVisible = false">取消</el-button>
- <el-button type="primary" @click="submitCarouselForm">确定</el-button>
- </template>
- </el-dialog>
- <!-- 分类设置编辑弹窗 -->
- <el-dialog v-model="categoryDialogVisible" :title="categoryDialogType === 'add' ? '新增分类' : '修改分类'" width="900px" destroy-on-close>
- <el-form :model="categoryForm" label-width="100px" class="dialog-form-inner">
- <el-tabs type="border-card">
- <el-tab-pane label="基础设置">
- <el-form-item label="菜单名称:">
- <el-input v-model="categoryForm.name" placeholder="如:办公电脑 / 办公打印 / 电脑组件" />
- </el-form-item>
- <el-form-item label="图标:">
- <div class="upload-placeholder-square" @click="triggerUpload('categoryIcon')">
- <img v-if="categoryForm.icon" :src="categoryForm.icon" class="form-preview-img-square" />
- <el-icon v-else class="upload-icon"><Plus /></el-icon>
- </div>
- <div class="upload-tip">推荐尺寸:16 * 16,支持上传透明背景 PNG</div>
- </el-form-item>
- <el-form-item label="同步分类:">
- <el-select
- v-model="categoryForm.syncCategory"
- placeholder="请选择或输入关联的一级分类"
- style="width: 100%"
- filterable
- allow-create
- default-first-option
- >
- <el-option v-for="opt in syncCategoryOptions" :key="opt" :label="opt" :value="opt" />
- </el-select>
- </el-form-item>
- <el-form-item label="标签设置:">
- <div class="notes-config-list">
- <div v-for="(tag, index) in categoryForm.tags" :key="index" class="note-config-row">
- <el-input v-model="tag.name" placeholder="标签名称" style="width: 120px" />
- <el-input v-model="tag.link" placeholder="跳转地址" style="flex: 1" />
- <el-button type="danger" icon="Delete" circle plain size="small" @click="removeCategoryTag(index)" />
- </div>
- <el-button type="primary" icon="Plus" link @click="addCategoryTag">添加标签</el-button>
- </div>
- <div class="field-tip">用于在右滑面板顶部显示的业务标签,支持配置独立跳转地址</div>
- </el-form-item>
- <el-form-item label="启用状态:">
- <el-switch v-model="categoryForm.status" :active-value="1" :inactive-value="0" active-color="#13ce66" />
- </el-form-item>
- </el-tab-pane>
- <el-tab-pane label="右滑面板配置">
- <div class="panel-config-section">
- <div class="config-subtitle">品牌位设置 (图3)</div>
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="主标题:">
- <el-input v-model="categoryForm.panelData.mainTitle" placeholder="如:京东" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="副标题:">
- <el-input v-model="categoryForm.panelData.subTitle" placeholder="如:3C数码" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-form-item label="便签列表:">
- <div class="notes-config-list">
- <div v-for="(note, index) in categoryForm.panelData.notes" :key="index" class="note-config-row">
- <el-input v-model="note.name" placeholder="便签名称" style="width: 120px" />
- <el-input v-model="note.link" placeholder="跳转地址" style="flex: 1" />
- <el-button type="danger" icon="Delete" circle plain size="small" @click="removePanelNote(index)" />
- </div>
- <el-button type="primary" icon="Plus" link @click="addPanelNote">添加便签</el-button>
- </div>
- </el-form-item>
- </div>
- <div class="panel-config-section m-t-20">
- <div class="config-subtitle">分类分组设置</div>
- <div class="field-tip">目前支持在代码中静态配置,弹窗界面待进一步完善。</div>
- </div>
- </el-tab-pane>
- </el-tabs>
- </el-form>
- <template #footer>
- <el-button @click="categoryDialogVisible = false">取消</el-button>
- <el-button type="primary" @click="submitCategoryForm">确定保存</el-button>
- </template>
- </el-dialog>
- <!-- 头部分类编辑弹窗 -->
- <el-dialog v-model="headerDialogVisible" :title="headerEditIndex > -1 ? '编辑头部分类' : '新增头部分类'" width="600px" destroy-on-close>
- <el-form :model="headerForm" label-width="100px" class="dialog-form-inner">
- <el-form-item label="分类名称:">
- <el-input v-model="headerForm.title" placeholder="如:公共采购" />
- </el-form-item>
- <el-form-item label="分类图标:">
- <div class="upload-placeholder-square" @click="triggerUpload('headerIcon')">
- <img v-if="headerForm.icon" :src="headerForm.icon" class="form-preview-img-square" style="width: 20px; height: 20px" />
- <el-icon v-else class="upload-icon"><Plus /></el-icon>
- </div>
- <div class="upload-tip">建议尺寸:20*20,透明背景 PNG</div>
- </el-form-item>
- <el-form-item label="跳转地址:">
- <el-input v-model="headerForm.link" placeholder="请输入跳转链接" />
- </el-form-item>
- <el-form-item label="打开方式:">
- <el-radio-group v-model="headerForm.openMode">
- <el-radio label="current">当前页</el-radio>
- <el-radio label="new">新窗口</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="启用状态:">
- <el-switch v-model="headerForm.status" :active-value="1" :inactive-value="0" active-color="#13ce66" />
- </el-form-item>
- </el-form>
- <template #footer>
- <el-button @click="headerDialogVisible = false">取消</el-button>
- <el-button type="primary" @click="submitHeaderForm">确定保存</el-button>
- </template>
- </el-dialog>
- <!-- 场景方案编辑弹窗 -->
- <!-- 已选商品管理抽屉 (占据 45% 屏幕) -->
- <el-drawer
- v-model="selectedProductDialogVisible"
- :title="`已选商品管理 - ${recommendList[currentRecommendIndex]?.name}`"
- size="45%"
- direction="rtl"
- custom-class="selected-products-drawer"
- destroy-on-close
- >
- <div class="drawer-content-wrapper">
- <div class="selected-products-header">
- <div class="left-actions">
- <el-button type="primary" icon="Plus" @click="openProductDrawer">添加商品</el-button>
- <el-button
- type="danger"
- plain
- icon="Delete"
- :disabled="!recommendList[currentRecommendIndex]?.selectedProducts?.length"
- @click="batchRemoveSelectedProducts"
- >批量移除</el-button
- >
- </div>
- <div class="right-info">
- 共 <span class="count">{{ recommendList[currentRecommendIndex]?.selectedProducts?.length || 0 }}</span> 个商品
- </div>
- </div>
- <el-table
- ref="selectedProductsTableRef"
- :data="pagedSelectedProducts"
- border
- height="calc(100vh - 280px)"
- style="width: 100%"
- header-cell-class-name="table-header-custom"
- class="standard-table"
- >
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="商品图片" width="100" align="center">
- <template #default="{ row }">
- <el-image :src="row.image" style="width: 50px; height: 50px; border-radius: 4px; border: 1px solid #f0f0f0" fit="contain" />
- </template>
- </el-table-column>
- <el-table-column prop="name" label="商品名称" min-width="250" show-overflow-tooltip />
- <el-table-column prop="id" label="商品ID" width="120" align="center" />
- <el-table-column label="单价" width="120" align="center">
- <template #default="{ row }">
- <span class="price-text">¥{{ row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="100" align="center" fixed="right">
- <template #default="{ $index }">
- <el-button type="danger" link @click="removeSelectedProduct($index)">移除</el-button>
- </template>
- </el-table-column>
- <template #empty>
- <div class="empty-placeholder">
- <el-empty description="暂未添加任何商品" :image-size="160">
- <el-button type="primary" size="large" @click="openProductDrawer">去添加商品</el-button>
- </el-empty>
- </div>
- </template>
- </el-table>
- <div class="drawer-pagination">
- <el-pagination
- v-model:current-page="selectedCurrentPage"
- v-model:page-size="selectedPageSize"
- :total="recommendList[currentRecommendIndex]?.selectedProducts?.length || 0"
- :page-sizes="[10, 20, 50, 100]"
- layout="total, sizes, prev, pager, next, jumper"
- background
- />
- </div>
- </div>
- <template #footer>
- <div class="drawer-footer-actions">
- <el-button @click="selectedProductDialogVisible = false">取消</el-button>
- <el-button type="primary" @click="submitSelectedProducts">确定保存</el-button>
- </div>
- </template>
- </el-drawer>
- <!-- 商品多选选择抽屉 (占据 1/3 屏幕) -->
- <el-drawer
- v-model="productSelectionDrawerVisible"
- title="从商品库选择商品"
- size="45%"
- direction="rtl"
- destroy-on-close
- custom-class="product-selection-drawer"
- >
- <div class="drawer-content-wrapper">
- <div class="drawer-search-bar">
- <el-input v-model="selectSearchQuery" placeholder="输入商品名称或ID搜索" prefix-icon="Search" clearable @input="selectCurrentPage = 1" />
- </div>
- <div class="drawer-stat-bar">
- <el-icon class="info-icon"><InfoFilled /></el-icon>
- <span
- >已勾选 <span class="highlight">{{ drawerSelection.length }}</span> 个商品</span
- >
- </div>
- <el-table
- ref="drawerTableRef"
- :data="pagedSelectList"
- border
- height="calc(100vh - 280px)"
- style="width: 100%"
- row-key="id"
- @selection-change="handleDrawerSelectionChange"
- >
- <el-table-column type="selection" width="50" align="center" :reserve-selection="true" />
- <el-table-column label="商品信息" min-width="200">
- <template #default="{ row }">
- <div class="drawer-product-info">
- <el-image :src="row.image" class="mini-img" fit="contain" />
- <div class="detail">
- <div class="name">{{ row.name }}</div>
- <div class="id">ID: {{ row.id }}</div>
- <div class="price">¥{{ row.price }}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <div class="drawer-pagination">
- <el-pagination
- v-model:current-page="selectCurrentPage"
- v-model:page-size="selectPageSize"
- :total="filteredSelectList.length"
- :page-sizes="[10, 20, 50, 100]"
- layout="total, sizes, prev, pager, next, jumper"
- background
- />
- </div>
- </div>
- <template #footer>
- <div class="drawer-footer-actions">
- <el-button @click="productSelectionDrawerVisible = false">取消</el-button>
- <el-button type="primary" :disabled="!drawerSelection.length" @click="confirmDrawerSelection"
- >确认添加 ({{ drawerSelection.length }})</el-button
- >
- </div>
- </template>
- </el-drawer>
- <el-dialog v-model="scenarioDialogVisible" title="编辑场景方案卡片" width="600px" destroy-on-close>
- <el-form :model="scenarioForm" label-width="100px" class="dialog-form-inner">
- <el-form-item label="主标题:">
- <div class="flex-center gap-10">
- <el-input v-model="scenarioForm.title" style="width: 200px" />
- <div class="theme-color-setting-pro">
- <el-color-picker v-model="scenarioForm.titleColor" />
- <span class="value">{{ scenarioForm.titleColor }}</span>
- </div>
- </div>
- </el-form-item>
- <el-form-item label="副标题:">
- <div class="flex-center gap-10">
- <el-input v-model="scenarioForm.subTitle" style="width: 200px" />
- <div class="theme-color-setting-pro">
- <el-color-picker v-model="scenarioForm.subTitleColor" />
- <span class="value">{{ scenarioForm.subTitleColor }}</span>
- </div>
- </div>
- </el-form-item>
- <el-form-item label="卡片背景:">
- <div class="flex-center gap-10">
- <div class="theme-color-setting-pro">
- <el-color-picker v-model="scenarioForm.bgColor" />
- <span class="value">{{ scenarioForm.bgColor }}</span>
- </div>
- <span class="text-gray m-l-10">不透明度:</span>
- <el-slider v-model="scenarioForm.opacity" :min="0" :max="1" :step="0.05" style="width: 120px" />
- <span class="value m-l-5">{{ Math.round(scenarioForm.opacity * 100) }}%</span>
- </div>
- </el-form-item>
- <el-form-item label="封面图片:">
- <div class="upload-placeholder-square" style="width: 272px; height: 80px" @click="triggerUpload('scenarioImg')">
- <img v-if="scenarioForm.image" :src="scenarioForm.image" style="width: 100%; height: 100%; object-fit: cover" />
- <el-icon v-else class="upload-icon"><Plus /></el-icon>
- </div>
- <div class="upload-tip">建议尺寸:272 * 80</div>
- </el-form-item>
- <el-form-item label="跳转链接:">
- <el-input v-model="scenarioForm.link" placeholder="请输入跳转地址" />
- </el-form-item>
- </el-form>
- <template #footer>
- <el-button @click="scenarioDialogVisible = false">取消</el-button>
- <el-button type="primary" @click="submitScenarioForm">保存修改</el-button>
- </template>
- </el-dialog>
- <!-- 推荐设置编辑弹窗 -->
- <el-dialog v-model="recommendDialogVisible" :title="recommendEditIndex > -1 ? '修改推荐分类' : '新增推荐分类'" width="600px" destroy-on-close>
- <el-form :model="recommendForm" label-width="110px" class="dialog-form-inner">
- <el-form-item label="主标题:">
- <el-input v-model="recommendForm.name" placeholder="请输入分类名称" maxlength="6" show-word-limit />
- </el-form-item>
- <el-form-item label="副标题:">
- <el-input v-model="recommendForm.subTitle" placeholder="请输入副标题" maxlength="12" show-word-limit />
- </el-form-item>
- <el-form-item label="分类图标:">
- <div class="upload-placeholder-square" style="width: 64px; height: 64px" @click="triggerUpload('recommendIcon')">
- <img v-if="recommendForm.icon" :src="recommendForm.icon" style="width: 100%; height: 100%; object-fit: contain" />
- <el-icon v-else class="upload-icon"><Plus /></el-icon>
- </div>
- <div class="upload-tip">建议尺寸:32 * 32,透明背景 PNG</div>
- </el-form-item>
- <el-form-item label="数据类型:">
- <el-radio-group v-model="recommendForm.type">
- <el-radio label="select">商品自选</el-radio>
- <el-radio label="category">分类映射</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item v-if="recommendForm.type === 'category'" label="映射分类:">
- <el-cascader
- v-model="recommendForm.categoryValue"
- :options="mockCategoryOptions"
- :props="{ checkStrictly: true, expandTrigger: 'hover' }"
- placeholder="请选择一级/二级/三级分类"
- style="width: 100%"
- filterable
- clearable
- @change="handleRecommendCategoryChange"
- />
- <div class="field-tip">选择后,该页签将自动抓取对应分类下的最新商品</div>
- </el-form-item>
- <el-form-item label="启用状态:">
- <el-switch v-model="recommendForm.status" :active-value="1" :inactive-value="0" active-color="#13ce66" />
- </el-form-item>
- </el-form>
- <template #footer>
- <el-button @click="recommendDialogVisible = false">取消</el-button>
- <el-button type="primary" @click="submitRecommendForm">保存设置</el-button>
- </template>
- </el-dialog>
- <!-- 快捷入口编辑弹窗 -->
- <el-dialog
- v-model="quickEntryDialogVisible"
- :title="quickEntryDialogType === 'add' ? '新增快捷入口' : '编辑快捷入口'"
- width="600px"
- append-to-body
- destroy-on-close
- >
- <el-form :model="quickEntryForm" label-width="100px" class="dialog-form-inner">
- <el-form-item label="入口名称:">
- <el-input v-model="quickEntryForm.name" placeholder="请输入入口名称(建议4-5个字)" maxlength="6" show-word-limit />
- </el-form-item>
- <el-form-item label="图标:">
- <div class="upload-placeholder-square" @click="triggerUpload('quickEntryIcon')">
- <img v-if="quickEntryForm.icon" :src="quickEntryForm.icon" class="form-preview-img-square" style="width: 24px; height: 24px" />
- <el-icon v-else class="upload-icon"><Plus /></el-icon>
- </div>
- <div class="upload-tip">建议尺寸: 48*48, 格式: PNG/SVG</div>
- </el-form-item>
- <el-form-item label="标签文字:">
- <el-input v-model="quickEntryForm.tag" placeholder="如:返100" maxlength="4" style="width: 200px" />
- <div class="field-tip">显示在图标右上角的红色气泡,留空则不显示</div>
- </el-form-item>
- <el-form-item label="跳转地址:">
- <el-input v-model="quickEntryForm.link" placeholder="请输入跳转地址" />
- </el-form-item>
- <el-form-item label="启用状态:">
- <el-switch v-model="quickEntryForm.status" :active-value="1" :inactive-value="0" />
- </el-form-item>
- </el-form>
- <template #footer>
- <el-button @click="quickEntryDialogVisible = false">取消</el-button>
- <el-button type="primary" @click="submitQuickEntryForm">确定</el-button>
- </template>
- </el-dialog>
- <!-- 底部固定操作栏 -->
- <div class="footer-actions">
- <el-button type="primary" class="btn-confirm" @click="handleMainSave">保存当前页配置</el-button>
- </div>
- <!-- 隐藏的文件选择框 -->
- <input type="file" ref="fileInput" style="display: none" accept="image/*" @change="onFileChange" />
- </div>
- </template>
- <script lang="ts" setup>
- import { ref, reactive, computed, watch, onMounted, onUnmounted, nextTick } from 'vue';
- import { ElMessage, ElMessageBox } from 'element-plus';
- import {
- listSearchConfig,
- getSearchConfig,
- delSearchConfig,
- addSearchConfig,
- updateSearchConfig,
- getCurrentSearchConfig
- } from '@/api/enterprisePurchase/searchConfig';
- import { SearchConfigVO, SearchConfigQuery, SearchConfigForm } from '@/api/enterprisePurchase/searchConfig/types';
- import { listAdLeft, getAdLeft, delAdLeft, addAdLeft, updateAdLeft, getCurrentAdLeft } from '@/api/enterprisePurchase/adLeft';
- import { AdLeftVO, AdLeftQuery, AdLeftForm } from '@/api/enterprisePurchase/adLeft/types';
- import { listCarousel, getCarousel, delCarousel, addCarousel, updateCarousel } from '@/api/enterprisePurchase/carousel';
- import { CarouselVO, CarouselQuery, CarouselForm } from '@/api/enterprisePurchase/carousel/types';
- import { listCategoryMain, getCategoryMain, delCategoryMain, addCategoryMain, updateCategoryMain } from '@/api/enterprisePurchase/categoryMain';
- import { CategoryMainVO, CategoryMainQuery, CategoryMainForm } from '@/api/enterprisePurchase/categoryMain/types';
- import { listScenarioCards, getScenarioCards, delScenarioCards, addScenarioCards, updateScenarioCards } from '@/api/enterprisePurchase/scenarioCards';
- import { ScenarioCardsVO, ScenarioCardsQuery, ScenarioCardsForm } from '@/api/enterprisePurchase/scenarioCards/types';
- import { listScenarioGlobalSettings, addScenarioGlobalSettings, updateScenarioGlobalSettings } from '@/api/enterprisePurchase/scenarioGlobalSettings';
- import { ScenarioGlobalSettingsForm } from '@/api/enterprisePurchase/scenarioGlobalSettings/types';
- import { listQuickEntryModule, addQuickEntryModule, updateQuickEntryModule } from '@/api/enterprisePurchase/quickEntryModule';
- import { QuickEntryModuleVO, QuickEntryModuleQuery, QuickEntryModuleForm } from '@/api/enterprisePurchase/quickEntryModule/types';
- import {
- listQuickEntryItems,
- getQuickEntryItems,
- delQuickEntryItems,
- addQuickEntryItems,
- updateQuickEntryItems
- } from '@/api/enterprisePurchase/quickEntryItems';
- import { QuickEntryItemsVO, QuickEntryItemsQuery, QuickEntryItemsForm } from '@/api/enterprisePurchase/quickEntryItems/types';
- import {
- listHeaderCategory,
- getHeaderCategory,
- delHeaderCategory,
- addHeaderCategory,
- updateHeaderCategory
- } from '@/api/enterprisePurchase/headerCategory';
- import { HeaderCategoryVO, HeaderCategoryQuery, HeaderCategoryForm } from '@/api/enterprisePurchase/headerCategory/types';
- import {
- ShoppingCart,
- Plus,
- Edit,
- Delete,
- Picture,
- CaretTop,
- CaretBottom,
- Menu,
- ArrowLeft,
- ArrowRight,
- Search,
- InfoFilled,
- ArrowUp,
- ArrowDown
- } from '@element-plus/icons-vue';
- const defaultPlaceholder =
- 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHJlY3Qgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIGZpbGw9IiNmMmYyZjIiLz48dGV4dCB4PSI1MCUiIHk9IjUwJSIgZG9taW5hbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZm9udC1zaXplPSIxMiIgZmlsbD0iI2JmYmZiZiI+5pys5peg5Zu+54mHPC90ZXh0Pjwvc3ZnPg==';
- // 基础导航状态
- const activeSubTab = ref('search');
- const subTabs = [
- { label: '搜索栏', value: 'search' },
- { label: '广告图', value: 'carousel' },
- { label: '分类设置', value: 'category' },
- { label: '头部分类', value: 'headerCategory' },
- { label: '广告模块', value: 'ad-module' },
- { label: '快捷入口', value: 'quick-entry' },
- { label: '场景方案', value: 'scenario' },
- { label: '推荐设置', value: 'recommend' }
- ];
- // 首页核心配置表单 (搜索栏与基本设置)
- const form = reactive({
- id: null,
- mainTitle: '',
- subTitle: '',
- placeholderText: '',
- hotWordsList: [{ name: '', link: '' }],
- themeColor: '',
- rightBtnIcon: '',
- rightBtnText: '',
- rightBtnLink: '',
- leftAdImage: '',
- leftAdLink: ''
- });
- // 左侧广告配置ID(单例)
- const leftAdId = ref<string | number>('');
- // 保存配置
- const handleMainSave = async () => {
- try {
- let res;
- if (activeSubTab.value == 'search') {
- // 构建提交数据,过滤空的热词
- const submitData = {
- ...form,
- hotWordList: form.hotWordsList.filter((item) => item.name && item.name.trim() !== '')
- };
- // 无ID则新增
- res = await addSearchConfig(submitData);
- if (res.code === 200) {
- ElMessage.success('配置保存成功');
- // 如果是新增,保存返回的ID
- if (!form.id && res.data) {
- form.id = res.data.id;
- }
- // 重新获取最新配置
- await getCurrentSearch();
- } else {
- ElMessage.error(res.msg || '保存失败');
- }
- } else if (activeSubTab.value == 'carousel') {
- saveLeftAdConfig();
- } else if (activeSubTab.value == 'scenario') {
- saveScenarioGlobalSettings();
- } else if (activeSubTab.value == 'quick-entry') {
- saveQuickEntryModule();
- }
- } catch (error) {
- console.error('保存配置失败:', error);
- ElMessage.error('保存配置失败');
- }
- };
- // 获取当前配置
- const getCurrentAdLeftBtn = async () => {
- try {
- const res = await getCurrentAdLeft();
- if (res.code === 200 && res.data) {
- // 回显数据到表单
- form.id = res.data.id || null;
- form.leftAdImage = res.data.imageUrl || '';
- form.leftAdLink = res.data.link || '';
- }
- } catch (error) {
- console.error('获取配置失败:', error);
- ElMessage.error('获取配置失败');
- }
- };
- // 获取当前配置
- const getCurrentSearch = async () => {
- try {
- const res = await getCurrentSearchConfig();
- if (res.code === 200 && res.data) {
- // 回显数据到表单
- form.id = res.data.id || null;
- form.mainTitle = res.data.mainTitle || '';
- form.subTitle = res.data.subTitle || '';
- form.placeholderText = res.data.placeholderText || '';
- form.themeColor = res.data.themeColor || '';
- form.rightBtnIcon = res.data.rightBtnIcon || '';
- form.rightBtnText = res.data.rightBtnText || '';
- form.rightBtnLink = res.data.rightBtnLink || '';
- form.leftAdImage = res.data.leftAdImage || '';
- form.leftAdLink = res.data.leftAdLink || '';
- // 处理热词列表
- if (res.data.hotWordList && Array.isArray(res.data.hotWordList)) {
- form.hotWordsList =
- res.data.hotWordList.length > 0
- ? res.data.hotWordList.map((item) => ({
- name: item.name || '',
- link: item.link || ''
- }))
- : [{ name: '', link: '' }];
- } else {
- form.hotWordsList = [{ name: '', link: '' }];
- }
- }
- } catch (error) {
- console.error('获取配置失败:', error);
- ElMessage.error('获取配置失败');
- }
- };
- const handleMainReset = () => {
- ElMessageBox.confirm('确定要重置当前页面的所有修改吗?', '提示', {
- confirmButtonText: '确定重置',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- ElMessage.info('已还原至初始状态');
- });
- };
- // 搜索栏逻辑
- const currentPlaceholderIndex = ref(0);
- let timer = null;
- const searchPlaceholderList = computed(() => {
- return form.placeholderText
- .split(',')
- .map((t) => t.trim())
- .filter((t) => t !== '');
- });
- const addHotWord = () => {
- form.hotWordsList.push({ name: '', link: '' });
- };
- const removeHotWord = (index) => {
- form.hotWordsList.splice(index, 1);
- };
- const startPlaceholderScroll = () => {
- if (timer) clearInterval(timer);
- if (searchPlaceholderList.value.length <= 1) return;
- timer = setInterval(() => {
- currentPlaceholderIndex.value = (currentPlaceholderIndex.value + 1) % searchPlaceholderList.value.length;
- }, 3000);
- };
- // 广告图模块逻辑
- const leftAdHover = ref(false);
- const carouselList = ref<CarouselVO[]>([]);
- // 获取轮播图列表
- const getCarouselList = async () => {
- try {
- const res = await listCarousel();
- if (res.code === 200 && res.rows) {
- carouselList.value = res.rows.map((item: CarouselVO) => ({
- ...item,
- image: item.imageUrl || ''
- }));
- }
- } catch (error) {
- console.error('获取轮播图列表失败:', error);
- ElMessage.error('获取轮播图列表失败');
- }
- };
- const activeCarouselList = computed(() => {
- return carouselList.value.filter((item) => item.status === 1);
- });
- // 轮播图弹窗逻辑
- const dialogVisible = ref(false);
- const dialogType = ref('add'); // add | edit
- const currentEditIndex = ref(-1);
- const carouselForm = reactive({
- image: '',
- link: '',
- target: '_self',
- status: 1
- });
- const handleAddCarousel = () => {
- dialogType.value = 'add';
- carouselForm.image = '';
- carouselForm.link = '';
- carouselForm.target = '_self';
- carouselForm.status = 1;
- dialogVisible.value = true;
- };
- const handleEditCarousel = (row) => {
- dialogType.value = 'edit';
- currentEditIndex.value = carouselList.value.findIndex((item) => item.id === row.id);
- carouselForm.image = row.image;
- carouselForm.link = row.link;
- carouselForm.target = row.target;
- carouselForm.status = row.status;
- dialogVisible.value = true;
- };
- const submitCarouselForm = async () => {
- if (!carouselForm.image) {
- return ElMessage.warning('请先上传轮播图片');
- }
- const data: CarouselForm = {
- imageUrl: carouselForm.image,
- link: carouselForm.link,
- target: carouselForm.target,
- status: carouselForm.status,
- sortOrder: carouselList.value.length
- };
- try {
- if (dialogType.value === 'add') {
- const res = await addCarousel(data);
- if (res.code === 200) {
- ElMessage.success('新增成功');
- dialogVisible.value = false;
- getCarouselList();
- } else {
- ElMessage.error(res.msg || '新增失败');
- }
- } else {
- const id = carouselList.value[currentEditIndex.value]?.id;
- const res = await updateCarousel({ ...data, id });
- if (res.code === 200) {
- ElMessage.success('修改成功');
- dialogVisible.value = false;
- getCarouselList();
- } else {
- ElMessage.error(res.msg || '修改失败');
- }
- }
- } catch (error) {
- console.error('操作失败:', error);
- ElMessage.error('操作失败');
- }
- };
- const handleRemoveCarousel = async (index: number) => {
- const item = carouselList.value[index];
- try {
- await ElMessageBox.confirm('确定要删除该轮播图吗?', '提示', { type: 'warning' });
- const res = await delCarousel(item.id);
- if (res.code === 200) {
- ElMessage.success('删除成功');
- getCarouselList();
- } else {
- ElMessage.error(res.msg || '删除失败');
- }
- } catch (error) {
- if (error !== 'cancel') {
- console.error('删除失败:', error);
- ElMessage.error('删除失败');
- }
- }
- };
- const moveRow = async (index: number, direction: number) => {
- const newIndex = index + direction;
- if (newIndex < 0 || newIndex >= carouselList.value.length) return;
- const item = carouselList.value.splice(index, 1)[0];
- carouselList.value.splice(newIndex, 0, item);
- // 同步排序到后端
- try {
- const start = Math.min(index, newIndex);
- const end = Math.max(index, newIndex);
- for (let i = start; i <= end; i++) {
- const row = carouselList.value[i];
- await updateCarousel({
- id: row.id,
- imageUrl: row.image || row.imageUrl,
- link: row.link,
- target: row.target,
- status: row.status,
- sortOrder: i
- });
- }
- } catch (error) {
- console.error('排序更新失败:', error);
- ElMessage.error('排序更新失败');
- }
- };
- // 颜色转换工具:Hex 转 RGBA
- const hexToRgba = (hex, opacity) => {
- if (!hex) return `rgba(255, 255, 255, ${opacity})`;
- let r = parseInt(hex.slice(1, 3), 16);
- let g = parseInt(hex.slice(3, 5), 16);
- let b = parseInt(hex.slice(5, 7), 16);
- return `rgba(${r}, ${g}, ${b}, ${opacity})`;
- };
- const handleSelectSearch = () => {
- // 模拟搜索过滤,computed 会自动处理
- };
- // 文件上传相关
- const fileInput = ref(null);
- const uploadTarget = ref(''); // 'leftAd' | 'carousel' | 'categoryIcon' | 'headerIcon'
- const triggerUpload = (target) => {
- uploadTarget.value = target;
- fileInput.value.click();
- };
- const onFileChange = (e) => {
- const file = e.target.files[0];
- if (!file) return;
- const reader = new FileReader();
- reader.onload = (event) => {
- const base64 = event.target.result;
- if (uploadTarget.value === 'leftAd') {
- form.leftAdImage = base64;
- } else if (uploadTarget.value === 'carousel') {
- carouselForm.image = base64;
- } else if (uploadTarget.value === 'rightBtnIcon') {
- form.rightBtnIcon = base64;
- } else if (uploadTarget.value === 'categoryIcon') {
- categoryForm.icon = base64;
- } else if (uploadTarget.value === 'headerIcon') {
- headerForm.icon = base64;
- } else if (uploadTarget.value === 'scenarioImg') {
- scenarioForm.image = base64;
- } else if (uploadTarget.value === 'quickEntryIcon') {
- quickEntryForm.icon = base64;
- } else if (uploadTarget.value === 'recommendIcon') {
- recommendForm.icon = base64;
- }
- ElMessage.success('图片上传成功');
- e.target.value = '';
- };
- reader.readAsDataURL(file);
- };
- // ==================== 左侧广告单例配置 ====================
- // 获取左侧广告配置
- const fetchLeftAdConfig = async () => {
- try {
- const res = await listAdLeft({ pageNum: 1, pageSize: 1 });
- if (res.code === 200 && res.rows && res.rows.length > 0) {
- const adData = res.rows[0];
- leftAdId.value = adData.id;
- form.leftAdImage = adData.imageUrl || '';
- form.leftAdLink = adData.link || '';
- }
- } catch (error) {
- console.error('获取左侧广告配置失败:', error);
- }
- };
- // 保存左侧广告配置
- const saveLeftAdConfig = async () => {
- try {
- if (!form.leftAdImage) {
- ElMessage.warning('请先上传广告图片');
- return;
- }
- const submitData: AdLeftForm = {
- id: leftAdId.value || undefined,
- imageUrl: form.leftAdImage,
- link: form.leftAdLink,
- status: 1 // 默认启用
- };
- let res;
- if (leftAdId.value) {
- // 有ID则更新
- res = await updateAdLeft(submitData);
- } else {
- // 无ID则新增
- res = await addAdLeft(submitData);
- }
- if (res.code === 200) {
- ElMessage.success('左侧广告保存成功');
- // 如果是新增,保存返回的ID
- if (!leftAdId.value && res.data) {
- leftAdId.value = res.data.id;
- }
- // 重新获取最新配置
- await fetchLeftAdConfig();
- } else {
- ElMessage.error(res.msg || '保存失败');
- }
- } catch (error) {
- console.error('保存左侧广告失败:', error);
- ElMessage.error('保存左侧广告失败');
- }
- };
- // 删除左侧广告
- const handleDeleteLeftAd = () => {
- ElMessageBox.confirm('确定要删除左侧广告吗?', '提示', {
- confirmButtonText: '确定删除',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(async () => {
- try {
- if (leftAdId.value) {
- const res = await delAdLeft(leftAdId.value);
- if (res.code === 200) {
- ElMessage.success('删除成功');
- // 清空表单数据
- leftAdId.value = '';
- form.leftAdImage = '';
- form.leftAdLink = '';
- } else {
- ElMessage.error(res.msg || '删除失败');
- }
- } else {
- // 如果没有ID,直接清空表单
- form.leftAdImage = '';
- form.leftAdLink = '';
- ElMessage.success('已清除');
- }
- } catch (error) {
- console.error('删除左侧广告失败:', error);
- ElMessage.error('删除失败');
- }
- })
- .catch(() => {
- // 用户取消操作
- });
- };
- // 分类设置模块逻辑
- const categoryThemeColor = ref('#e60012');
- const syncCategoryOptions = ['办公电脑', '办公设备', '办公家电', '文具耗材', '日用百货', '工业品', '食品饮料', '车载用品', '运动户外'];
- const categoryList = ref<CategoryMainVO[]>([]);
- // 获取分类列表
- const getCategoryList = async () => {
- try {
- const res = await listCategoryMain();
- if (res.code === 200 && res.rows) {
- categoryList.value = res.rows.map((item: CategoryMainVO) => {
- let extra = { tags: [] as any[], notes: [] as any[], groups: [] as any[] };
- try {
- if ((item as any).remark) {
- extra = JSON.parse((item as any).remark);
- }
- } catch (e) {
- /* remark JSON 解析失败使用默认值 */
- }
- return {
- ...item,
- tags: extra.tags || [],
- panelData: {
- mainTitle: (item as any).panelMainTitle || '',
- subTitle: (item as any).panelSubTitle || '',
- notes: extra.notes || [],
- groups: extra.groups || []
- }
- };
- });
- }
- } catch (error) {
- console.error('获取分类列表失败:', error);
- ElMessage.error('获取分类列表失败');
- }
- };
- const addCategoryTag = () => {
- categoryForm.tags.push({ name: '', link: '' });
- };
- const removeCategoryTag = (index) => {
- categoryForm.tags.splice(index, 1);
- };
- const categoryDialogVisible = ref(false);
- const categoryDialogType = ref('add');
- const categoryForm = reactive({
- id: null,
- name: '',
- icon: '',
- syncCategory: '',
- tags: [],
- status: 1,
- panelData: {
- mainTitle: '',
- subTitle: '',
- notes: [],
- groups: []
- }
- });
- const handleAddCategory = () => {
- categoryDialogType.value = 'add';
- Object.assign(categoryForm, {
- id: null,
- name: '',
- icon: '',
- syncCategory: '',
- tags: [],
- status: 1,
- panelData: { mainTitle: '', subTitle: '', notes: [], groups: [] }
- });
- categoryDialogVisible.value = true;
- };
- const handleEditCategory = (row) => {
- categoryDialogType.value = 'edit';
- Object.assign(categoryForm, JSON.parse(JSON.stringify(row)));
- categoryDialogVisible.value = true;
- };
- const submitCategoryForm = async () => {
- if (!categoryForm.name) return ElMessage.warning('请输入菜单名称');
- const data: CategoryMainForm = {
- name: categoryForm.name,
- icon: categoryForm.icon,
- syncCategory: categoryForm.syncCategory,
- status: categoryForm.status,
- panelMainTitle: categoryForm.panelData.mainTitle,
- panelSubTitle: categoryForm.panelData.subTitle,
- remark: JSON.stringify({
- tags: categoryForm.tags,
- notes: categoryForm.panelData.notes,
- groups: categoryForm.panelData.groups
- })
- };
- try {
- if (categoryDialogType.value === 'add') {
- const res = await addCategoryMain(data);
- if (res.code === 200) {
- ElMessage.success('新增成功');
- categoryDialogVisible.value = false;
- getCategoryList();
- } else {
- ElMessage.error(res.msg || '新增失败');
- }
- } else {
- const id = categoryForm.id;
- const res = await updateCategoryMain({ ...data, id });
- if (res.code === 200) {
- ElMessage.success('修改成功');
- categoryDialogVisible.value = false;
- getCategoryList();
- } else {
- ElMessage.error(res.msg || '修改失败');
- }
- }
- } catch (error) {
- console.error('操作失败:', error);
- ElMessage.error('操作失败');
- }
- };
- // 场景方案模块逻辑
- const scenarioSettings = reactive({
- id: null as string | number | null,
- mainTitle: '场景解决方案',
- subTitle: '一站全买齐',
- btnText: '进入全场景',
- jumpLink: '',
- themeColor: '#66e0a3'
- });
- // 获取场景全局设置
- const getScenarioGlobalSettingsList = async () => {
- try {
- const res = await listScenarioGlobalSettings();
- if (res.code === 200 && res.rows && res.rows.length > 0) {
- const data = res.rows[0];
- scenarioSettings.id = data.id;
- scenarioSettings.mainTitle = data.mainTitle || '';
- scenarioSettings.subTitle = data.subTitle || '';
- scenarioSettings.btnText = data.btnText || '';
- scenarioSettings.jumpLink = data.jumpLink || '';
- scenarioSettings.themeColor = data.themeColor || '#66e0a3';
- }
- } catch (error) {
- console.error('获取场景全局设置失败:', error);
- ElMessage.error('获取场景全局设置失败');
- }
- };
- // 保存场景全局设置
- const saveScenarioGlobalSettings = async () => {
- const data: ScenarioGlobalSettingsForm = {
- mainTitle: scenarioSettings.mainTitle,
- subTitle: scenarioSettings.subTitle,
- btnText: scenarioSettings.btnText,
- jumpLink: scenarioSettings.jumpLink,
- themeColor: scenarioSettings.themeColor
- };
- try {
- let res;
- if (scenarioSettings.id) {
- res = await updateScenarioGlobalSettings({ ...data, id: scenarioSettings.id });
- } else {
- res = await addScenarioGlobalSettings(data);
- if (res.code === 200 && res.data) {
- scenarioSettings.id = res.data.id;
- }
- }
- if (res.code === 200) {
- ElMessage.success('场景全局设置保存成功');
- } else {
- ElMessage.error(res.msg || '保存失败');
- }
- } catch (error) {
- console.error('保存场景全局设置失败:', error);
- ElMessage.error('保存失败');
- }
- };
- const scenarioList = ref<ScenarioCardsVO[]>([]);
- // 获取场景卡片列表
- const getScenarioList = async () => {
- try {
- const res = await listScenarioCards();
- if (res.code === 200 && res.rows) {
- scenarioList.value = res.rows.map((item: ScenarioCardsVO) => {
- let extra = { subTitleColor: '#333333', bgColor: '#ffffff', opacity: 1 };
- try {
- if ((item as any).remark) {
- extra = { ...extra, ...JSON.parse((item as any).remark) };
- }
- } catch (e) {
- /* remark JSON 解析失败使用默认值 */
- }
- return {
- ...item,
- image: (item as any).imageUrl || '',
- link: (item as any).jumpLink || '',
- subTitleColor: extra.subTitleColor,
- bgColor: extra.bgColor,
- opacity: extra.opacity
- };
- });
- }
- } catch (error) {
- console.error('获取场景卡片列表失败:', error);
- ElMessage.error('获取场景卡片列表失败');
- }
- };
- const scenarioDialogVisible = ref(false);
- const scenarioEditIndex = ref(-1);
- const scenarioForm = reactive({
- title: '',
- titleColor: '#008b4e',
- subTitle: '',
- subTitleColor: '#333333',
- image: '',
- link: '',
- bgColor: '#ffffff',
- opacity: 1
- });
- const handleEditScenario = (row, index) => {
- scenarioEditIndex.value = index;
- Object.assign(scenarioForm, JSON.parse(JSON.stringify(row)));
- scenarioDialogVisible.value = true;
- };
- const submitScenarioForm = async () => {
- const item = scenarioList.value[scenarioEditIndex.value];
- if (!item) return;
- const data: ScenarioCardsForm = {
- id: item.id,
- title: scenarioForm.title,
- titleColor: scenarioForm.titleColor,
- subTitle: scenarioForm.subTitle,
- imageUrl: scenarioForm.image,
- jumpLink: scenarioForm.link,
- sortOrder: (item as any).sortOrder ?? scenarioEditIndex.value,
- remark: JSON.stringify({
- subTitleColor: scenarioForm.subTitleColor,
- bgColor: scenarioForm.bgColor,
- opacity: scenarioForm.opacity
- })
- };
- try {
- const res = await updateScenarioCards(data);
- if (res.code === 200) {
- ElMessage.success('方案修改成功');
- scenarioDialogVisible.value = false;
- getScenarioList();
- } else {
- ElMessage.error(res.msg || '修改失败');
- }
- } catch (error) {
- console.error('修改失败:', error);
- ElMessage.error('修改失败');
- }
- };
- const moveScenario = async (index: number, direction: number) => {
- const newIndex = index + direction;
- if (newIndex < 0 || newIndex >= scenarioList.value.length) return;
- const item = scenarioList.value.splice(index, 1)[0];
- scenarioList.value.splice(newIndex, 0, item);
- // 同步排序到后端
- try {
- const start = Math.min(index, newIndex);
- const end = Math.max(index, newIndex);
- for (let i = start; i <= end; i++) {
- const row = scenarioList.value[i] as any;
- await updateScenarioCards({
- id: row.id,
- title: row.title,
- titleColor: row.titleColor,
- subTitle: row.subTitle,
- imageUrl: row.image || row.imageUrl,
- jumpLink: row.link || row.jumpLink,
- sortOrder: i,
- remark: JSON.stringify({
- subTitleColor: row.subTitleColor || '#333333',
- bgColor: row.bgColor || '#ffffff',
- opacity: row.opacity ?? 1
- })
- });
- }
- } catch (error) {
- console.error('排序更新失败:', error);
- ElMessage.error('排序更新失败');
- }
- };
- const handleRemoveCategory = async (index: number) => {
- const item = categoryList.value[index];
- try {
- await ElMessageBox.confirm('确定要删除该分类吗?', '提示');
- const res = await delCategoryMain(item.id);
- if (res.code === 200) {
- ElMessage.success('删除成功');
- getCategoryList();
- } else {
- ElMessage.error(res.msg || '删除失败');
- }
- } catch (error) {
- if (error !== 'cancel') {
- console.error('删除失败:', error);
- ElMessage.error('删除失败');
- }
- }
- };
- const addPanelNote = () => {
- categoryForm.panelData.notes.push({ name: '', link: '' });
- };
- const removePanelNote = (index) => {
- categoryForm.panelData.notes.splice(index, 1);
- };
- const moveCategory = (index, direction) => {
- const newIndex = index + direction;
- if (newIndex < 0 || newIndex >= categoryList.value.length) return;
- const item = categoryList.value.splice(index, 1)[0];
- categoryList.value.splice(newIndex, 0, item);
- };
- onMounted(() => {
- startPlaceholderScroll();
- });
- // 头部分类模块逻辑
- const headerThemeColor = ref('#e60012');
- const headerCategoryList = ref<HeaderCategoryVO[]>([]);
- // 获取头部分类列表
- const getHeaderCategoryList = async () => {
- try {
- const res = await listHeaderCategory();
- if (res.code === 200 && res.rows) {
- headerCategoryList.value = res.rows;
- }
- } catch (error) {
- console.error('获取头部分类列表失败:', error);
- ElMessage.error('获取头部分类列表失败');
- }
- };
- const headerDialogVisible = ref(false);
- const headerEditIndex = ref(-1);
- const headerForm = reactive({ title: '', icon: '', link: '', openMode: 'current', status: 1 });
- const handleAddHeaderCategory = () => {
- headerEditIndex.value = -1;
- Object.assign(headerForm, { title: '', icon: '', link: '', openMode: 'current', status: 1 });
- headerDialogVisible.value = true;
- };
- const handleEditHeaderCategory = (row, index) => {
- headerEditIndex.value = index;
- Object.assign(headerForm, JSON.parse(JSON.stringify(row)));
- headerDialogVisible.value = true;
- };
- const submitHeaderForm = async () => {
- const data: HeaderCategoryForm = {
- title: headerForm.title,
- icon: headerForm.icon,
- link: headerForm.link,
- openMode: headerForm.openMode,
- status: headerForm.status
- };
- try {
- if (headerEditIndex.value > -1) {
- const id = headerCategoryList.value[headerEditIndex.value]?.id;
- const res = await updateHeaderCategory({ ...data, id });
- if (res.code === 200) {
- ElMessage.success('修改成功');
- headerDialogVisible.value = false;
- getHeaderCategoryList();
- } else {
- ElMessage.error(res.msg || '修改失败');
- }
- } else {
- const res = await addHeaderCategory(data);
- if (res.code === 200) {
- ElMessage.success('新增成功');
- headerDialogVisible.value = false;
- getHeaderCategoryList();
- } else {
- ElMessage.error(res.msg || '新增失败');
- }
- }
- } catch (error) {
- console.error('操作失败:', error);
- ElMessage.error('操作失败');
- }
- };
- const handleDeleteHeaderCategory = async (index: number) => {
- const item = headerCategoryList.value[index];
- try {
- await ElMessageBox.confirm('确定删除该分类吗?', '提示');
- const res = await delHeaderCategory(item.id);
- if (res.code === 200) {
- ElMessage.success('删除成功');
- getHeaderCategoryList();
- } else {
- ElMessage.error(res.msg || '删除失败');
- }
- } catch (error) {
- if (error !== 'cancel') {
- console.error('删除失败:', error);
- ElMessage.error('删除失败');
- }
- }
- };
- const moveHeader = (index, delta) => {
- const target = index + delta;
- if (target < 0 || target >= headerCategoryList.value.length) return;
- const temp = headerCategoryList.value[index];
- headerCategoryList.value[index] = headerCategoryList.value[target];
- headerCategoryList.value[target] = temp;
- };
- // 导航滚动逻辑
- const headerNavScrollRef = ref(null);
- const showLeftArrow = ref(false);
- const showRightArrow = ref(false);
- const updateNavArrows = () => {
- if (!headerNavScrollRef.value) return;
- const { scrollLeft, scrollWidth, clientWidth } = headerNavScrollRef.value;
- showLeftArrow.value = scrollLeft > 5;
- showRightArrow.value = scrollLeft + clientWidth < scrollWidth - 5;
- };
- const scrollHeaderNav = (direction) => {
- const container = headerNavScrollRef.value;
- if (!container) return;
- const scrollAmount = 350;
- if (direction === 'left') {
- container.scrollLeft -= scrollAmount;
- } else {
- container.scrollLeft += scrollAmount;
- }
- };
- // 广告模块逻辑
- const adModules = ref([
- {
- id: 1,
- title: '企业购x百亿补贴',
- titleColor: '#333333',
- subTitle: '先采后付 享底价',
- subTitleColor: '#999999',
- type: 'subsidy',
- items: [
- { id: 101, name: '企业商用台式机', image: '/static/images/purchase/pc_desktop.jpg', price: '69.9' },
- { id: 102, name: '商务笔记本', image: '/static/images/purchase/laptop_hp.jpg', price: '84.8' },
- { id: 103, name: '智能打印机', image: '/static/images/purchase/printer_office.jpg', price: '139.9' },
- { id: 104, name: '高效办公组网', image: '/static/images/purchase/network_router.jpg', price: '1749' }
- ]
- },
- {
- id: 2,
- title: '企采榜单',
- titleColor: '#333333',
- subTitle: '同行都在买',
- subTitleColor: '#f58220',
- type: 'ranking',
- items: [
- { id: 201, name: '办公电脑榜', image: '/static/images/purchase/laptop_lenovo.jpg', price: '0', tag: '办公电脑榜', tagLink: '', sales: '1543' },
- { id: 202, name: '文具榜', image: '/static/images/purchase/stationery_ranking.jpg', price: '0', tag: '文具榜', tagLink: '', sales: '2.3万' }
- ]
- },
- {
- id: 3,
- title: '品牌好店',
- titleColor: '#333333',
- subTitle: '返2000元E卡',
- subTitleColor: '#f58220',
- type: 'brand',
- items: [
- { id: 301, name: '鲁花', image: '/static/images/purchase/oil_luhua.jpg', tag: '品质保障', tagLink: '鲁花京东自营旗舰店' },
- { id: 302, name: '金龙鱼', image: '/static/images/purchase/oil_jinlongyu.jpg', tag: '热销品牌', tagLink: '金龙鱼京东自营旗舰店' }
- ]
- },
- {
- id: 4,
- title: '企业精选',
- titleColor: '#333333',
- subTitle: '品牌专供 库存充足',
- subTitleColor: '#999999',
- type: 'selection',
- items: [
- { id: 401, name: '高性能工作站', image: '/static/images/purchase/pc_desktop.jpg', price: '10740' },
- { id: 402, name: '办公咖啡机', image: '/static/images/purchase/coffee_machine.jpg', price: '877' }
- ]
- },
- {
- id: 5,
- title: '企业购x京东新品',
- titleColor: '#333333',
- subTitle: '美的新鲜',
- subTitleColor: '#f58220',
- type: 'new',
- items: [
- { id: 501, name: '商用冷柜', image: '/static/images/purchase/freezer.jpg', price: '7188' },
- { id: 502, name: '得力笔记本', image: '/static/images/purchase/notebook_deli.jpg', price: '34.9' }
- ]
- }
- ]);
- const adDialogVisible = ref(false);
- const currentAdIdx = ref(-1);
- const currentItemIdx = ref(-1);
- const adForm = reactive({ title: '', titleColor: '#333333', subTitle: '', subTitleColor: '#f58220', items: [] });
- // 实时预览辅助函数
- const getAdTitleStyle = (index, type) => {
- const isEditing = adDialogVisible.value && currentAdIdx.value === index;
- const key = type === 'main' ? 'titleColor' : 'subTitleColor';
- const defaultColor = type === 'main' ? '#333' : '#999';
- const color = isEditing ? adForm[key] : adModules.value[index][key] || defaultColor;
- return { color };
- };
- const getAdTitleText = (index, type) => {
- const isEditing = adDialogVisible.value && currentAdIdx.value === index;
- const key = type === 'main' ? 'title' : 'subTitle';
- return isEditing ? adForm[key] : adModules.value[index][key];
- };
- const handleEditAd = (index) => {
- currentAdIdx.value = index;
- const ad = adModules.value[index];
- Object.assign(adForm, JSON.parse(JSON.stringify(ad)));
- adDialogVisible.value = true;
- };
- const submitAdForm = () => {
- adModules.value[currentAdIdx.value] = JSON.parse(JSON.stringify(adForm));
- adDialogVisible.value = false;
- ElMessage.success('配置保存成功');
- };
- // 推荐设置模块逻辑
- const recommendThemeColor = ref('#e60012');
- const recommendProductThemeColor = ref('#e60012');
- const recommendActiveId = ref(1);
- const recommendList = ref([
- {
- id: 1,
- name: '为你推荐',
- subTitle: '每日低价 妙券',
- icon: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZmlsbD0iI2U2MDAxMiIgZD0iTTE2IDJsNC4zNSA4LjgxbDkuNzIgMS40MWwtNy4wMyA2Ljg1bDEuNjYgOS42OEwxNiAyNS4yN2wtOC43IDQuNTdsMS42Ni05LjY4bC03LjAzLTYuODVsOS43Mi0xLjQxTDE2IDJ6Ii8+PC9zdmc+',
- type: 'select',
- status: 1,
- selectedProducts: [
- { id: 1001, name: 'Lenovo 联想 昭阳K4e 轻薄办公本 14英寸 i7/16G/512G', image: '/static/images/purchase/laptop_lenovo.jpg', price: '4599' },
- { id: 1002, name: 'HP 惠普 战66 六代 商务笔记本电脑 锐龙版 15.6英寸', image: '/static/images/purchase/laptop_hp.jpg', price: '3899' }
- ]
- },
- {
- id: 2,
- name: '新客专享',
- subTitle: '精选爆品 低价',
- icon: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZmlsbD0iI2U2MDAxMiIgZD0iTTI2IDE0djEwaC00VjhIMTB2MTZINnYtMTBMNCAxMmw4LThoOHoiLz48cGF0aCBmaWxsPSIjZTYwMDEyIiBkPSJNMjIgMjRIMTB2LTRoMTJ6Ii8+PC9zdmc+',
- type: 'select',
- status: 1,
- selectedProducts: []
- },
- {
- id: 3,
- name: '办公设备',
- subTitle: '电脑设备 批量',
- icon: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZmlsbD0iI2U2MDAxMiIgZD0iTTI4IDI0SDR2LTJoMjR6bS0yLTJIMnYtNGgyNHptMC00SDJ2LTRoMjR6bTAtNEgydi00aDI0eiIvPjxwYXRoIGZpbGw9IiNlNjAwMTIiIGQ9Ik04IDI4aDE2di0ySDh6Ii8+PC9zdmc+',
- type: 'category',
- categoryLabel: '办公设备 > 办公电脑 > 笔记本',
- status: 1,
- selectedProducts: []
- },
- {
- id: 4,
- name: '办公耗材',
- subTitle: '低价直供 囤货',
- icon: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZmlsbD0iI2U2MDAxMiIgZD0iTTI0IDRINFYyOGgyMHYtNHoiLz48cGF0aCBmaWxsPSIjZTYwMDEyIiBkPSJNMjggMTJsLTQgNHY4aDR6Ii8+PC9zdmc+',
- type: 'category',
- categoryLabel: '文具耗材 > 打印耗材 > 复印纸',
- status: 1,
- selectedProducts: []
- },
- {
- id: 5,
- name: '工业生产',
- subTitle: '车间工具 规格',
- icon: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZmlsbD0iI2U2MDAxMiIgZD0iTTE2IDhsLTIuNDUgNC4yNUg4LjY0djQuOTFMNi4xOCAxOWwyLjQ1IDQuMjV2NC45MWg0LjkxbDIuNDUgNC4yNWwyLjQ1LTQuMjVoNC45MXYtNC45MWwyLjQ1LTQuMjVsLTIuNDUtNC4yNXYtNC45MWgtNC45MUwxNiA4eiIvPjwvc3ZnPg==',
- type: 'category',
- categoryLabel: '工业品 > 五金工具 > 电动工具',
- status: 1,
- selectedProducts: []
- },
- {
- id: 6,
- name: '员工福利',
- subTitle: '节日礼盒 一键',
- icon: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZmlsbD0iI2U2MDAxMiIgZD0iTTE2IDI4czEyLTYuNDIgMTItMTZjMC01LjM2LTQuNjQtOS05LTlhOC43OCA4Ljc4IDAgMC0wIDMtM2MtNC4zNiAwLTkgMy42NC05IDlzMTIgMTYgMTIgMTZ6Ii8+PC9zdmc+',
- type: 'select',
- status: 1,
- selectedProducts: []
- },
- {
- id: 7,
- name: '办公环境',
- subTitle: '电器家具 焕新',
- icon: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZmlsbD0iI2U2MDAxMiIgZD0iTTE2IDhsOCAxNkg4bDgtMTZ6Ii8+PHBhdGggZmlsbD0iI2U2MDAxMiIgZD0iTTI2IDI4SDR2LTRoMjJ6Ii8+PC9zdmc+',
- type: 'select',
- status: 1,
- selectedProducts: []
- },
- {
- id: 8,
- name: '营销礼品',
- subTitle: '客户礼包 特惠',
- icon: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZmlsbD0iI2U2MDAxMiIgZD0iTTI2IDEwaC02VjhIMTJ2Mkg2djE2aDIwVjEweiIvPjxwYXRoIGZpbGw9IiNlNjAwMTIiIGQ9Ik0xOCAxMHYtMmgLTR2MnoiLz48L3N2Zz4=',
- type: 'select',
- status: 1,
- selectedProducts: []
- },
- {
- id: 9,
- name: '个人防护',
- subTitle: '劳保用品 齐全',
- icon: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZmlsbD0iI2U2MDAxMiIgZD0iTTE2IDJsLTEyIDR2MTBzMCAxMiAxMiAxNmMxMi00IDEyLTE2IDEyLTE2VjZMMTYgMnoiLz48L3N2Zz4=',
- type: 'category',
- categoryLabel: '个人防护 > 头部防护 > 安全帽',
- status: 1,
- selectedProducts: []
- },
- { id: 10, name: '清洁用品', subTitle: '扫把 拖把 纸巾', icon: '', type: 'select', status: 1, selectedProducts: [] },
- { id: 11, name: '运动器材', subTitle: '跑步机 哑铃', icon: '', type: 'select', status: 1, selectedProducts: [] },
- { id: 12, name: '生鲜水果', subTitle: '苹果 橙子 香蕉', icon: '', type: 'select', status: 1, selectedProducts: [] },
- { id: 13, name: '零食小吃', subTitle: '坚果 薯片 饼干', icon: '', type: 'select', status: 1, selectedProducts: [] },
- { id: 14, name: '美妆护肤', subTitle: '洗面奶 补水', icon: '', type: 'select', status: 1, selectedProducts: [] }
- ]);
- const activeRecommendList = computed(() => {
- return recommendList.value.filter((item) => item.status === 1);
- });
- const recommendDialogVisible = ref(false);
- const recommendEditIndex = ref(-1);
- const recommendForm = reactive({
- name: '',
- subTitle: '',
- icon: '',
- type: 'select',
- categoryValue: [],
- categoryLabel: '',
- selectedProducts: [],
- status: 1
- });
- const mockCategoryOptions = [
- {
- value: 'bg',
- label: '办公设备',
- children: [
- {
- value: 'dn',
- label: '办公电脑',
- children: [
- { value: 'bjb', label: '笔记本' },
- { value: 'tsj', label: '台式机' }
- ]
- }
- ]
- },
- {
- value: 'wj',
- label: '文具耗材',
- children: [
- {
- value: 'dy',
- label: '打印耗材',
- children: [
- { value: 'fyz', label: '复印纸' },
- { value: 'xhg', label: '硒鼓' }
- ]
- }
- ]
- }
- ];
- const handleAddRecommend = () => {
- recommendEditIndex.value = -1;
- Object.assign(recommendForm, {
- name: '',
- subTitle: '',
- icon: '',
- type: 'select',
- categoryValue: [],
- categoryLabel: '',
- selectedProducts: [],
- status: 1
- });
- recommendDialogVisible.value = true;
- };
- const handleEditRecommend = (row, index) => {
- recommendEditIndex.value = index;
- Object.assign(recommendForm, JSON.parse(JSON.stringify(row)));
- recommendDialogVisible.value = true;
- };
- const getLabelsByValues = (values, options) => {
- const labels = [];
- let currentOptions = options;
- for (const val of values) {
- const target = currentOptions.find((opt) => opt.value === val);
- if (target) {
- labels.push(target.label);
- currentOptions = target.children || [];
- }
- }
- return labels.join(' > ');
- };
- const handleRecommendCategoryChange = (val) => {
- if (val && val.length > 0) {
- recommendForm.categoryLabel = getLabelsByValues(val, mockCategoryOptions);
- } else {
- recommendForm.categoryLabel = '';
- }
- };
- const submitRecommendForm = () => {
- if (recommendEditIndex.value > -1) {
- recommendList.value[recommendEditIndex.value] = { ...recommendForm };
- } else {
- recommendList.value.push({ id: Date.now(), ...recommendForm });
- }
- recommendDialogVisible.value = false;
- ElMessage.success('保存成功');
- };
- // 推荐商品选择增强逻辑
- const selectedProductDialogVisible = ref(false);
- const productSelectionDrawerVisible = ref(false);
- const currentRecommendIndex = ref(-1);
- const drawerSelection = ref([]);
- const selectedProductsTableRef = ref(null);
- const drawerTableRef = ref(null);
- const selectedCurrentPage = ref(1);
- const selectedPageSize = ref(10);
- const pagedSelectedProducts = computed(() => {
- const list = recommendList.value[currentRecommendIndex.value]?.selectedProducts || [];
- const start = (selectedCurrentPage.value - 1) * selectedPageSize.value;
- const end = start + selectedPageSize.value;
- return list.slice(start, end);
- });
- const handleSelectedProductsSelectionChange = (val) => {
- currentItemIdx.value = val; // 临时借用 currentItemIdx 存储选中的行
- };
- const openRecommendProductSelect = (index) => {
- currentRecommendIndex.value = index;
- selectedCurrentPage.value = 1;
- selectedProductDialogVisible.value = true;
- };
- const submitSelectedProducts = () => {
- selectedProductDialogVisible.value = false;
- ElMessage.success('已选商品配置已保存');
- };
- const openProductDrawer = () => {
- const currentList = recommendList.value[currentRecommendIndex.value]?.selectedProducts || [];
- drawerSelection.value = JSON.parse(JSON.stringify(currentList));
- selectSearchQuery.value = '';
- selectCurrentPage.value = 1;
- productSelectionDrawerVisible.value = true;
- // 回显勾选逻辑
- nextTick(() => {
- if (drawerTableRef.value) {
- drawerTableRef.value.clearSelection();
- // 由于启用了 reserve-selection,我们直接遍历库中匹配的项进行勾选
- mockProductList.forEach((item) => {
- if (currentList.some((exist) => exist.id === item.id)) {
- drawerTableRef.value.toggleRowSelection(item, true);
- }
- });
- }
- });
- };
- const handleDrawerSelectionChange = (val) => {
- drawerSelection.value = val;
- };
- const confirmDrawerSelection = () => {
- // 直接全量覆盖,支持在抽屉里取消勾选来删除
- recommendList.value[currentRecommendIndex.value].selectedProducts = JSON.parse(JSON.stringify(drawerSelection.value));
- ElMessage.success('商品列表同步成功');
- productSelectionDrawerVisible.value = false;
- };
- const removeSelectedProduct = (index) => {
- recommendList.value[currentRecommendIndex.value].selectedProducts.splice(index, 1);
- ElMessage.success('移除成功');
- };
- const batchRemoveSelectedProducts = () => {
- const selectedRows = selectedProductsTableRef.value?.getSelectionRows() || [];
- if (selectedRows.length === 0) return ElMessage.warning('请先勾选要移除的商品');
- ElMessageBox.confirm(`确定移除选中的 ${selectedRows.length} 个商品吗?`, '提示').then(() => {
- const currentList = recommendList.value[currentRecommendIndex.value].selectedProducts;
- const selectedIds = selectedRows.map((r) => r.id);
- recommendList.value[currentRecommendIndex.value].selectedProducts = currentList.filter((item) => !selectedIds.includes(item.id));
- ElMessage.success('批量移除成功');
- });
- };
- // 推荐预览滚动逻辑
- const recommendScrollRef = ref(null);
- const recShowLeft = ref(false);
- const recShowRight = ref(false);
- const updateRecArrows = () => {
- if (!recommendScrollRef.value) return;
- const { scrollLeft, scrollWidth, clientWidth } = recommendScrollRef.value;
- recShowLeft.value = scrollLeft > 5;
- recShowRight.value = scrollLeft + clientWidth < scrollWidth - 5;
- };
- const scrollRecommend = (direction) => {
- const container = recommendScrollRef.value;
- if (!container) return;
- const scrollAmount = 400;
- if (direction === 'left') {
- container.scrollLeft -= scrollAmount;
- } else {
- container.scrollLeft += scrollAmount;
- }
- };
- // 商品选择逻辑
- const selectDialogVisible = ref(false);
- const selectSearchQuery = ref('');
- const selectedTempId = ref(null);
- const selectCurrentPage = ref(1);
- const selectPageSize = ref(8);
- const mockProductList = [
- { id: 1001, name: 'Lenovo 联想 昭阳K4e 轻薄办公本 14英寸 i7/16G/512G', image: '/static/images/purchase/laptop_lenovo.jpg', price: '4599' },
- { id: 1002, name: 'HP 惠普 战66 六代 商务笔记本电脑 锐龙版 15.6英寸', image: '/static/images/purchase/laptop_hp.jpg', price: '3899' },
- { id: 1003, name: 'Apple iPad Air 10.9英寸 256G 银色 蜂窝版', image: '/static/images/purchase/ipad.jpg', price: '4799' },
- { id: 1004, name: 'Logitech 罗技 MX Master 3S 无线鼠标 石墨黑', image: '/static/images/purchase/mouse.jpg', price: '699' },
- { id: 1005, name: 'Dell 戴尔 U2723QE 27英寸 4K 核心显示器 IPS黑', image: '/static/images/purchase/monitor.jpg', price: '3299' },
- { id: 3001, name: '鲁花 5S一级压榨花生油 5L 礼盒装 物理压榨', image: '/static/images/purchase/oil_luhua.jpg', price: '159.9' },
- { id: 3002, name: '金龙鱼 阳光葵花籽油 5L 瓶装 零反式脂肪', image: '/static/images/purchase/oil_jinlongyu.jpg', price: '69.9' },
- { id: 3003, name: '蒙牛 特仑苏 纯牛奶 250ml*12 提装 高钙低脂', image: '/static/images/purchase/water_nongfu.jpg', price: '65.0' },
- { id: 3004, name: '三只松鼠 坚果礼盒 1.5kg 聚享版 办公室零食', image: '/static/images/purchase/coffee_machine.jpg', price: '128.0' },
- { id: 3005, name: '农夫山泉 饮用天然水 550ml*24 整箱 弱碱性', image: '/static/images/purchase/water_nongfu.jpg', price: '28.8' },
- { id: 5001, name: '得力 办公A4复印纸 80g 500张/包 5包/箱', image: '/static/images/purchase/paper_deli.jpg', price: '145.0' },
- { id: 5002, name: '公牛 插座 10位 5米总控 办公专用排插', image: '/static/images/purchase/socket_bull.jpg', price: '89.0' }
- ];
- const filteredSelectList = computed(() => {
- if (!selectSearchQuery.value) return mockProductList;
- return mockProductList.filter((item) => item.name.includes(selectSearchQuery.value) || item.id.toString().includes(selectSearchQuery.value));
- });
- const pagedSelectList = computed(() => {
- const start = (selectCurrentPage.value - 1) * selectPageSize.value;
- const end = start + selectPageSize.value;
- return filteredSelectList.value.slice(start, end);
- });
- const openProductSelect = (index) => {
- currentItemIdx.value = index;
- selectedTempId.value = adForm.items[index].id;
- selectSearchQuery.value = '';
- selectDialogVisible.value = true;
- };
- const confirmSelect = () => {
- const item = mockProductList.find((i) => i.id === selectedTempId.value);
- if (item) {
- const target = adForm.items[currentItemIdx.value];
- target.id = item.id;
- target.name = item.name;
- target.image = item.image;
- target.price = item.price;
- selectDialogVisible.value = false;
- ElMessage.success('选择成功');
- }
- };
- // 快捷入口模块逻辑
- const qePageIndex = ref(0);
- const quickEntrySettings = reactive({
- id: null as string | number | null,
- moduleName: '企业工作台',
- jumpLink: ''
- });
- // 获取快捷入口模块配置
- const getQuickEntryModuleList = async () => {
- try {
- const res = await listQuickEntryModule();
- if (res.code === 200 && res.rows && res.rows.length > 0) {
- const data = res.rows[0];
- quickEntrySettings.id = data.id;
- quickEntrySettings.moduleName = data.moduleName || '';
- quickEntrySettings.jumpLink = data.jumpLink || '';
- }
- } catch (error) {
- console.error('获取快捷入口模块配置失败:', error);
- ElMessage.error('获取快捷入口模块配置失败');
- }
- };
- // 保存快捷入口模块配置
- const saveQuickEntryModule = async () => {
- const data: QuickEntryModuleForm = {
- moduleName: quickEntrySettings.moduleName,
- jumpLink: quickEntrySettings.jumpLink
- };
- try {
- let res;
- if (quickEntrySettings.id) {
- res = await updateQuickEntryModule({ ...data, id: quickEntrySettings.id });
- } else {
- res = await addQuickEntryModule(data);
- if (res.code === 200 && res.data) {
- quickEntrySettings.id = res.data.id;
- }
- }
- if (res.code === 200) {
- ElMessage.success('快捷入口模块配置保存成功');
- } else {
- ElMessage.error(res.msg || '保存失败');
- }
- } catch (error) {
- console.error('保存快捷入口模块配置失败:', error);
- ElMessage.error('保存失败');
- }
- };
- const quickEntryList = ref<QuickEntryItemsVO[]>([]);
- // 获取快捷入口项列表
- const getQuickEntryItemsList = async () => {
- try {
- const res = await listQuickEntryItems();
- if (res.code === 200 && res.rows) {
- quickEntryList.value = res.rows.map((item: QuickEntryItemsVO) => ({
- ...item,
- icon: (item as any).iconUrl || '',
- tag: (item as any).tagText || '',
- link: (item as any).jumpLink || ''
- }));
- }
- } catch (error) {
- console.error('获取快捷入口项列表失败:', error);
- ElMessage.error('获取快捷入口项列表失败');
- }
- };
- const qePageCount = computed(() => Math.ceil(quickEntryList.value.filter((i) => i.status === 1).length / 8));
- const getPageItems = (pageIdx) => {
- const activeItems = quickEntryList.value.filter((i) => i.status === 1);
- return activeItems.slice(pageIdx * 8, (pageIdx + 1) * 8);
- };
- const quickEntryDialogVisible = ref(false);
- const quickEntryDialogType = ref('add');
- const qeEditIndex = ref(-1);
- const quickEntryForm = reactive({ name: '', icon: '', tag: '', link: '', status: 1 });
- const handleAddQuickEntry = () => {
- quickEntryDialogType.value = 'add';
- Object.assign(quickEntryForm, { name: '', icon: '', tag: '', link: '', status: 1 });
- quickEntryDialogVisible.value = true;
- };
- const handleEditQuickEntry = (row, index) => {
- quickEntryDialogType.value = 'edit';
- qeEditIndex.value = index;
- Object.assign(quickEntryForm, JSON.parse(JSON.stringify(row)));
- quickEntryDialogVisible.value = true;
- };
- const submitQuickEntryForm = async () => {
- if (!quickEntryForm.name) return ElMessage.warning('请输入入口名称');
- const data: QuickEntryItemsForm = {
- name: quickEntryForm.name,
- iconUrl: quickEntryForm.icon,
- tagText: quickEntryForm.tag,
- jumpLink: quickEntryForm.link,
- status: quickEntryForm.status,
- sortOrder: quickEntryList.value.length
- };
- try {
- if (quickEntryDialogType.value === 'add') {
- const res = await addQuickEntryItems(data);
- if (res.code === 200) {
- ElMessage.success('新增成功');
- quickEntryDialogVisible.value = false;
- getQuickEntryItemsList();
- } else {
- ElMessage.error(res.msg || '新增失败');
- }
- } else {
- const id = quickEntryList.value[qeEditIndex.value]?.id;
- const res = await updateQuickEntryItems({ ...data, id });
- if (res.code === 200) {
- ElMessage.success('修改成功');
- quickEntryDialogVisible.value = false;
- getQuickEntryItemsList();
- } else {
- ElMessage.error(res.msg || '修改失败');
- }
- }
- } catch (error) {
- console.error('操作失败:', error);
- ElMessage.error('操作失败');
- }
- };
- const handleDeleteQuickEntry = async (index: number) => {
- const item = quickEntryList.value[index];
- try {
- await ElMessageBox.confirm('确定要删除该入口吗?', '提示', { type: 'warning' });
- const res = await delQuickEntryItems(item.id);
- if (res.code === 200) {
- ElMessage.success('删除成功');
- getQuickEntryItemsList();
- } else {
- ElMessage.error(res.msg || '删除失败');
- }
- } catch (error) {
- if (error !== 'cancel') {
- console.error('删除失败:', error);
- ElMessage.error('删除失败');
- }
- }
- };
- const moveQE = async (index: number, direction: number) => {
- const newIndex = index + direction;
- if (newIndex < 0 || newIndex >= quickEntryList.value.length) return;
- const item = quickEntryList.value.splice(index, 1)[0];
- quickEntryList.value.splice(newIndex, 0, item);
- // 同步排序到后端
- try {
- const start = Math.min(index, newIndex);
- const end = Math.max(index, newIndex);
- for (let i = start; i <= end; i++) {
- const row = quickEntryList.value[i] as any;
- await updateQuickEntryItems({
- id: row.id,
- name: row.name,
- iconUrl: row.icon || row.iconUrl,
- tagText: row.tag || row.tagText,
- jumpLink: row.link || row.jumpLink,
- status: row.status,
- sortOrder: i
- });
- }
- } catch (error) {
- console.error('排序更新失败:', error);
- ElMessage.error('排序更新失败');
- }
- };
- watch(
- headerCategoryList,
- () => {
- nextTick(() => updateNavArrows());
- },
- { deep: true }
- );
- onMounted(() => {
- startPlaceholderScroll();
- // 获取当前配置
- getCurrentSearch();
- getCurrentAdLeftBtn();
- getCarouselList();
- getHeaderCategoryList();
- getCategoryList();
- getScenarioGlobalSettingsList();
- getScenarioList();
- getQuickEntryModuleList();
- getQuickEntryItemsList();
- // 获取左侧广告配置
- nextTick(() => {
- updateNavArrows();
- updateRecArrows();
- });
- // 延迟再次检测,确保图片加载后布局稳定
- setTimeout(() => {
- updateRecArrows();
- }, 500);
- window.addEventListener('resize', updateNavArrows);
- window.addEventListener('resize', updateRecArrows);
- });
- onUnmounted(() => {
- if (timer) clearInterval(timer);
- window.removeEventListener('resize', updateNavArrows);
- window.removeEventListener('resize', updateRecArrows);
- });
- watch(
- activeRecommendList,
- () => {
- nextTick(() => {
- updateRecArrows();
- });
- },
- { deep: true }
- );
- // 监听子页签切换,确保切换回推荐设置时更新箭头状态
- watch(activeSubTab, (newVal) => {
- if (newVal === 'recommend') {
- nextTick(() => {
- setTimeout(() => {
- updateRecArrows();
- }, 300);
- });
- }
- });
- </script>
- <style scoped>
- /* 基础辅助类 */
- .flex-column {
- display: flex;
- flex-direction: column;
- }
- .flex-center {
- display: flex;
- align-items: center;
- }
- .gap-5 {
- gap: 5px;
- }
- .gap-10 {
- gap: 10px;
- }
- .m-b-30 {
- margin-bottom: 30px;
- }
- .scenario-editor-container {
- padding: 32px 40px;
- display: flex;
- flex-direction: column;
- background-color: #fff; /* 纯白背景 */
- min-height: 100%;
- }
- .preview-section-standard {
- background: #fcfdfe;
- border: 1px solid #eef2f6;
- border-radius: 8px;
- padding: 32px;
- margin-bottom: 32px;
- }
- .section-title-standard {
- font-size: 16px;
- font-weight: bold;
- color: #333;
- margin-bottom: 24px;
- display: flex;
- align-items: center;
- }
- .section-title-standard::before {
- content: '';
- width: 4px;
- height: 16px;
- background-color: #e60012;
- margin-right: 12px;
- border-radius: 2px;
- }
- .config-section-standard {
- padding: 32px 0;
- border-bottom: 1px solid #f0f0f0;
- }
- .settings-form-standard {
- padding-left: 16px;
- }
- .preview-tip {
- font-size: 12px;
- color: #999;
- margin-top: 16px;
- }
- .rank-action-btns {
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 4px;
- }
- .rank-btn-mini {
- cursor: pointer;
- font-size: 14px;
- color: #909399;
- transition: color 0.2s;
- }
- .rank-btn-mini:hover {
- color: #e60012;
- }
- .standard-table :deep(.el-table__header) th {
- background-color: #f8fafc;
- color: #606266;
- font-weight: bold;
- }
- .parameter-settings {
- flex: 1;
- min-height: 0; /* 关键:防止 flex 子项被内容撑开 */
- display: flex;
- flex-direction: column;
- background-color: #fff;
- overflow: hidden;
- }
- .sub-tabs {
- display: flex;
- padding: 0 20px;
- border-bottom: 1px solid #f0f0f0;
- flex-shrink: 0;
- height: 48px; /* 固定高度,防止切换时抖动 */
- align-items: center;
- }
- .sub-tab-item {
- padding: 12px 20px;
- cursor: pointer;
- font-size: 14px;
- color: #666;
- font-weight: 500;
- position: relative;
- }
- .sub-tab-item.active {
- color: var(--primary-color);
- }
- .sub-tab-item.active::after {
- content: '';
- position: absolute;
- bottom: 0;
- left: 20px;
- right: 20px;
- height: 2px;
- background-color: var(--primary-color);
- }
- .content-body {
- flex: 1;
- overflow-y: auto;
- }
- /* 搜索编辑区布局 */
- .search-editor {
- display: flex;
- flex-direction: column;
- padding: 20px 40px;
- gap: 30px;
- }
- /* 预览区域 */
- .preview-section {
- background-color: #fff;
- border: 1px dashed #dcdfe6;
- border-radius: 8px;
- padding: 20px;
- }
- .preview-title {
- font-size: 13px;
- color: #909399;
- margin-bottom: 15px;
- font-weight: bold;
- }
- .live-preview-box {
- background-color: #fff;
- padding: 40px 20px;
- border-radius: 4px;
- box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
- }
- /* 仿真 Mockup */
- .search-bar-mockup {
- display: flex;
- align-items: center;
- max-width: 1400px; /* 进一步加宽容器 */
- margin: 0 auto;
- gap: 30px;
- }
- .mockup-left {
- flex-shrink: 0;
- text-align: center;
- }
- .main-title {
- font-size: 32px;
- font-weight: 800;
- line-height: 1.2;
- }
- .sub-title {
- font-size: 12px;
- color: #999;
- margin-top: 4px;
- letter-spacing: 1px;
- }
- .mockup-center {
- flex: 2; /* 增加中心区域的弹性占比,使搜索框更宽 */
- }
- .search-input-wrapper {
- height: 44px;
- border: 2px solid transparent; /* 由动态绑定控制颜色 */
- border-radius: 8px;
- display: flex;
- align-items: center;
- overflow: hidden;
- position: relative;
- }
- .placeholder-scroll {
- flex: 1;
- padding: 0 15px;
- height: 100%;
- overflow: hidden;
- }
- .scroll-container {
- height: 100%;
- position: relative;
- }
- .scroll-item {
- height: 100%;
- display: flex;
- align-items: center;
- color: #999;
- font-size: 15px;
- }
- .search-btn {
- width: 90px;
- height: 34px;
- color: #fff;
- display: flex;
- align-items: center;
- justify-content: center;
- font-weight: bold;
- font-size: 15px;
- cursor: pointer;
- border-radius: 6px;
- letter-spacing: 2px;
- margin-right: 4px;
- transition: opacity 0.2s;
- }
- .search-btn:hover {
- opacity: 0.9;
- }
- .hot-words {
- margin-top: 8px;
- display: flex;
- gap: 15px;
- padding-left: 5px;
- }
- .hot-word {
- font-size: 12px;
- color: #999;
- cursor: pointer;
- transition: color 0.2s;
- }
- .hot-word:hover {
- color: var(--theme-color);
- }
- .mockup-right {
- flex-shrink: 0;
- }
- .cart-btn {
- display: flex;
- align-items: center;
- gap: 8px;
- padding: 8px 16px;
- border: 1px solid transparent; /* 由动态绑定控制颜色 */
- border-radius: 8px;
- font-size: 14px;
- cursor: pointer;
- background-color: #fff;
- transition: all 0.2s;
- }
- .cart-btn:hover {
- filter: brightness(0.95);
- }
- /* 广告图编辑区 */
- .carousel-editor {
- padding: 20px 40px;
- display: flex;
- flex-direction: column;
- gap: 40px;
- }
- .editor-section {
- display: flex;
- flex-direction: column;
- gap: 20px;
- }
- .section-header {
- display: flex;
- flex-direction: column;
- gap: 4px;
- }
- .section-title {
- font-size: 16px;
- font-weight: bold;
- color: #333;
- }
- .section-desc {
- font-size: 13px;
- color: #999;
- }
- /* 左侧广告设置 */
- .left-ad-container {
- display: flex;
- flex-direction: column;
- gap: 10px;
- }
- .left-ad-preview-wrapper {
- width: 80px;
- height: 460px;
- border-radius: 8px;
- overflow: hidden;
- position: relative;
- cursor: pointer;
- transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
- border: 1px solid #eee;
- }
- .left-ad-preview-wrapper.expanded {
- width: 790px;
- }
- .left-ad-img {
- width: 790px; /* 固定宽度,外层容器裁剪 */
- height: 460px;
- object-fit: cover;
- display: block;
- }
- .left-ad-empty {
- width: 100%;
- height: 100%;
- background-color: #f5f7fa;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- color: #909399;
- border: 1px dashed #dcdfe6;
- }
- .ad-actions {
- position: absolute;
- top: 20px;
- right: 20px;
- display: flex;
- gap: 10px;
- background: rgba(255, 255, 255, 0.9);
- padding: 8px;
- border-radius: 30px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
- }
- .left-ad-settings {
- flex: 1;
- display: flex;
- flex-direction: column;
- gap: 15px;
- padding: 10px 0; /* 移除背景和边框 */
- }
- .settings-input-ad {
- max-width: 500px;
- }
- .left-ad-tip {
- display: flex;
- align-items: center;
- gap: 6px;
- font-size: 13px;
- color: #a8abb2;
- }
- /* 轮播图预览 */
- .carousel-preview-box {
- padding: 10px 0;
- }
- .preview-mockup {
- width: 552px;
- height: 190px;
- border-radius: 8px;
- overflow: hidden;
- box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
- background-color: #f5f7fa;
- }
- /* 强力锁定轮播图指示器至左下角 */
- :deep(.el-carousel__indicators--horizontal) {
- left: 20px !important;
- right: auto !important;
- bottom: 15px !important;
- transform: none !important;
- width: fit-content !important;
- margin: 0 !important;
- padding: 0 !important;
- display: flex !important;
- justify-content: flex-start !important;
- }
- :deep(.el-carousel__indicator--horizontal) {
- display: inline-block !important;
- padding: 0 3px !important;
- }
- :deep(.el-carousel__indicators--inside) {
- left: 20px !important;
- transform: none !important;
- }
- :deep(.el-carousel__indicator) {
- padding: 0 3px;
- }
- :deep(.el-carousel__button) {
- width: 6px;
- height: 6px;
- border-radius: 50%;
- background-color: rgba(255, 255, 255, 0.4) !important;
- opacity: 1 !important;
- transition: all 0.3s;
- }
- :deep(.el-carousel__indicator.is-active .el-carousel__button) {
- width: 20px; /* 激活状态变为长胶囊 */
- border-radius: 10px;
- background-color: #ffffff !important;
- }
- .carousel-slide {
- width: 100%;
- height: 100%;
- }
- .carousel-slide img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- .carousel-empty {
- height: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- color: #ccc;
- background-color: #f9f9f9;
- }
- /* 轮播列表 */
- .carousel-list-box {
- display: flex;
- flex-direction: column;
- gap: 15px;
- margin-top: 10px;
- }
- .list-toolbar {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 5px;
- }
- .btn-add-carousel {
- padding: 0 25px;
- font-weight: bold;
- }
- /* 自定义表头样式 */
- :deep(.table-header-custom) {
- background-color: #f8f9fb !important;
- color: #333 !important;
- font-weight: bold !important;
- height: 50px;
- }
- .drag-tip {
- font-size: 12px;
- color: #a8abb2;
- }
- .table-img {
- width: 140px;
- height: 48px;
- border-radius: 4px;
- border: 1px solid #f0f0f0;
- display: block;
- }
- .rank-box {
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 2px;
- }
- .rank-icon {
- cursor: pointer;
- color: #909399;
- font-size: 16px;
- transition: color 0.2s;
- }
- .rank-icon:hover {
- color: #409eff;
- }
- /* 弹窗上传样式 */
- .upload-placeholder {
- width: 240px;
- height: 82px;
- border: 1px dashed #dcdfe6;
- border-radius: 6px;
- cursor: pointer;
- overflow: hidden;
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: #f5f7fa;
- transition: border-color 0.2s;
- }
- .upload-placeholder:hover {
- border-color: #409eff;
- }
- .form-preview-img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- .upload-icon {
- font-size: 28px;
- color: #8c939d;
- }
- .upload-tip {
- font-size: 12px;
- color: #999;
- margin-top: 5px;
- line-height: 1.4;
- }
- .dialog-form-inner {
- padding: 30px 40px; /* 大幅增加内边距,使其更高、更大气 */
- }
- .dialog-form-inner :deep(.el-form-item) {
- margin-bottom: 25px; /* 增加表单项间距 */
- }
- .list-scroll-enter-active,
- .list-scroll-leave-active {
- transition: all 0.5s ease;
- position: absolute;
- width: 100%;
- }
- .list-scroll-enter-from {
- transform: translateY(100%);
- opacity: 0;
- }
- .list-scroll-leave-to {
- transform: translateY(-100%);
- opacity: 0;
- }
- /* 设置表单 */
- .settings-section {
- padding: 0 10px;
- }
- .settings-input {
- max-width: 600px;
- }
- .color-picker-wrap {
- display: flex;
- align-items: center;
- }
- .tip-text {
- font-size: 12px;
- color: #999;
- margin-top: 4px;
- }
- .color-val {
- margin-left: 10px;
- color: #666;
- font-family: monospace;
- }
- /* 热词配置样式 */
- .hot-words-config {
- display: flex;
- flex-direction: column;
- gap: 10px;
- width: 800px; /* 加宽配置区域 */
- }
- .hot-word-row {
- display: flex;
- align-items: center;
- gap: 10px;
- }
- .hot-word-input-name {
- width: 200px; /* 稍微加宽名称框 */
- }
- .hot-word-input-link {
- flex: 1; /* 此时地址框会占据剩余更多空间 */
- }
- .add-hotword-btn {
- width: fit-content;
- padding: 0;
- margin-top: 5px;
- }
- .footer-actions {
- padding: 20px 40px;
- border-top: 1px solid #f0f0f0;
- display: flex;
- gap: 15px;
- flex-shrink: 0;
- }
- .btn-confirm {
- padding: 0 30px;
- }
- .btn-reset {
- padding: 0 30px;
- }
- /* 分类设置编辑区 */
- .category-editor {
- padding: 20px 40px;
- display: flex;
- flex-direction: column;
- gap: 40px;
- }
- .category-preview-container {
- padding: 20px 0;
- display: flex;
- justify-content: flex-start;
- }
- /* 图1: 仿真菜单 */
- .category-menu-mockup {
- width: 280px;
- height: 398px;
- background: #f8f9fa;
- border-radius: 4px;
- padding: 10px 0;
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
- position: relative;
- z-index: 10;
- overflow: visible; /* 必须可见,否则遮罩层无法伸出 */
- }
- /* 仿真菜单项 */
- .menu-item {
- height: 44px;
- display: flex;
- align-items: center;
- padding: 0 15px;
- cursor: pointer;
- position: relative;
- transition: all 0.1s;
- background: transparent;
- box-sizing: border-box;
- }
- .menu-item:hover {
- background-color: #fff !important;
- color: v-bind(categoryThemeColor);
- border: 1px solid v-bind(categoryThemeColor);
- border-right: none;
- border-radius: 12px 0 0 12px;
- z-index: 1000;
- margin-left: 10px;
- padding-left: 15px;
- width: calc(100% - 10px);
- }
- .menu-icon {
- width: 16px;
- height: 16px;
- margin-right: 15px; /* 增加间距 */
- color: #999;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-shrink: 0;
- }
- .menu-icon img {
- width: 100%;
- height: 100%;
- object-fit: contain;
- }
- .menu-name {
- font-size: 14px;
- color: #333;
- flex: 1;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- /* 遮盖层:仅抹除中间垂直线,保留上下边框连贯 */
- .menu-item:hover::after {
- content: '';
- position: absolute;
- top: 0; /* 保持在边框内侧 */
- bottom: 0; /* 保持在边框内侧 */
- right: -1px; /* 贴合右边缘 */
- width: 2px; /* 覆盖面板左边框 */
- background: #fff;
- z-index: 1001;
- }
- .menu-item:hover .menu-icon {
- color: v-bind(categoryThemeColor);
- }
- .menu-name {
- font-size: 14px;
- color: #333;
- }
- .menu-item:hover .menu-name {
- color: v-bind(categoryThemeColor);
- font-weight: bold;
- }
- /* 图2: 右滑面板 */
- .category-panel-mockup {
- position: absolute;
- left: 100%; /* 紧贴菜单项右侧 */
- margin-left: 0;
- top: -1px; /* 顶部边框对齐 */
- width: 980px;
- min-height: 480px;
- background: #fff;
- box-shadow: 15px 15px 40px rgba(0, 0, 0, 0.1);
- border-radius: 0 12px 12px 12px;
- z-index: 500;
- border: 1px solid v-bind(categoryThemeColor);
- display: none;
- flex-direction: column;
- box-sizing: border-box;
- cursor: default;
- }
- /* 悬停时显示面板 */
- .menu-item:hover .category-panel-mockup {
- display: flex;
- }
- .panel-content {
- flex: 1;
- padding: 25px 30px;
- position: relative; /* 为品牌位定位提供基准 */
- overflow: hidden;
- }
- .panel-tabs {
- display: flex;
- gap: 15px;
- margin-bottom: 25px;
- padding-right: 200px; /* 为右上角品牌位留出空间 */
- }
- .panel-tab-item {
- padding: 6px 14px;
- background-color: #f5f5f5;
- color: #666;
- font-size: 12px;
- border-radius: 4px;
- cursor: pointer;
- transition: all 0.2s;
- }
- .panel-tab-item:hover {
- background-color: #f5f5f5; /* 保持浅灰或根据主题调整 */
- color: v-bind(categoryThemeColor);
- filter: brightness(0.95);
- }
- .panel-body {
- display: flex;
- flex-direction: column; /* 改为垂直布局,内容横向撑开 */
- flex: 1;
- }
- .panel-main {
- flex: 1;
- overflow-y: auto;
- max-height: 400px;
- }
- .category-group {
- margin-bottom: 15px;
- display: flex;
- }
- .group-title {
- width: 80px;
- font-size: 12px;
- font-weight: bold;
- color: #333;
- flex-shrink: 0;
- line-height: 1.6;
- }
- .group-items {
- flex: 1;
- display: flex;
- flex-wrap: wrap;
- gap: 6px 15px;
- }
- .group-item {
- font-size: 12px;
- color: #666;
- cursor: pointer;
- transition: color 0.2s;
- }
- .group-item:hover {
- color: v-bind(categoryThemeColor);
- }
- /* 品牌位移至右上角 (图3) */
- .panel-side {
- display: none; /* 移除侧边栏布局 */
- }
- .brand-box {
- position: absolute;
- top: 25px;
- right: 30px;
- display: flex;
- flex-direction: column;
- align-items: flex-end; /* 右对齐更美观 */
- z-index: 105;
- }
- .brand-main-title {
- font-size: 20px;
- font-weight: 900;
- color: v-bind(categoryThemeColor);
- margin-bottom: 4px;
- display: flex;
- align-items: baseline;
- }
- .brand-strong {
- color: #333;
- margin-left: 2px;
- font-size: 20px;
- }
- .brand-notes {
- display: flex;
- gap: 5px;
- color: v-bind(categoryThemeColor);
- font-size: 12px;
- justify-content: flex-end;
- }
- .note-item {
- cursor: pointer;
- }
- .note-sep {
- color: #eee;
- margin: 0 2px;
- }
- /* 工具栏主题色设置 - 专业版 */
- .theme-color-setting-pro {
- display: flex;
- align-items: center;
- gap: 8px;
- margin-right: 20px;
- }
- .theme-color-setting-pro .label {
- font-size: 14px;
- color: #333;
- }
- .theme-color-setting-pro .value {
- font-size: 13px;
- color: #666;
- margin-left: 5px;
- font-family: monospace;
- }
- /* 覆盖 el-color-picker 样式 */
- :deep(.theme-color-setting-pro .el-color-picker__trigger) {
- width: 28px;
- height: 28px;
- padding: 2px;
- border-radius: 4px;
- }
- /* 列表样式 */
- .table-icon-preview {
- width: 24px;
- height: 24px;
- }
- .tag-wrap {
- display: flex;
- flex-wrap: wrap;
- gap: 5px;
- }
- .m-r-5 {
- margin-right: 5px;
- }
- .m-t-20 {
- margin-top: 20px;
- }
- /* 弹窗样式 */
- .panel-config-section {
- background: #fafafa;
- padding: 15px;
- border-radius: 4px;
- border: 1px dashed #eee;
- }
- /* 移除冗余的 .config-subtitle 定义,统一使用下方全局定义的样式 */
- .notes-config-list {
- display: flex;
- flex-direction: column;
- gap: 10px;
- }
- .note-config-row {
- display: flex;
- gap: 10px;
- align-items: center;
- }
- .field-tip {
- font-size: 12px;
- color: #999;
- margin-top: 5px;
- }
- /* 正方形图标上传 */
- .upload-placeholder-square {
- width: 80px;
- height: 80px;
- border: 1px dashed #d9d9d9;
- border-radius: 4px;
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: #fafafa;
- transition: border-color 0.2s;
- }
- .upload-placeholder-square:hover {
- border-color: v-bind(categoryThemeColor);
- }
- .upload-placeholder-square .upload-icon {
- font-size: 20px;
- color: #999;
- }
- .form-preview-img-square {
- width: 16px;
- height: 16px;
- object-fit: contain;
- }
- /* 头部分类样式 */
- .header-category-editor {
- padding: 20px 40px;
- display: flex;
- flex-direction: column;
- gap: 40px;
- }
- .header-preview-outer {
- width: 100%;
- background: #f8f9fa;
- padding: 40px 20px;
- border-radius: 8px;
- display: block; /* 改为 block 以便支持内部滚动 */
- overflow-x: auto; /* 允许内部滚动,防止溢出 */
- box-sizing: border-box;
- }
- .header-preview-box {
- width: 1350px; /* 强制保持 1350px 宽度以高度还原设计 */
- height: 60px;
- background: #fff;
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
- border-radius: 4px;
- display: flex;
- align-items: center;
- padding: 0 40px; /* 为箭头预留空间 */
- margin: 0 auto; /* 在容器足够大时居中 */
- flex-shrink: 0; /* 禁止缩小 */
- position: relative;
- overflow: hidden; /* 关键:确保内部超出部分被剪裁,由滚动容器处理 */
- }
- .header-nav-scroll {
- flex: 1;
- overflow-x: auto;
- scrollbar-width: none;
- display: flex;
- align-items: center;
- scroll-behavior: smooth;
- }
- .header-nav-scroll::-webkit-scrollbar {
- display: none;
- }
- .header-nav-list {
- display: flex;
- align-items: center;
- gap: 30px;
- flex-shrink: 0;
- }
- .nav-arrow {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- width: 24px;
- height: 24px;
- background: #eee;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- z-index: 10;
- color: #666;
- transition: all 0.2s;
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
- }
- .nav-arrow:hover {
- background: #e0e0e0;
- color: #333;
- }
- .left-arrow {
- left: 8px;
- }
- .right-arrow {
- right: 8px;
- }
- .header-nav-item {
- display: flex;
- align-items: center;
- gap: 8px;
- cursor: pointer;
- white-space: nowrap;
- flex-shrink: 0;
- }
- .header-nav-item .item-icon {
- width: 22px;
- height: 22px;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .header-nav-item .item-icon img {
- width: 100%;
- height: 100%;
- object-fit: contain;
- }
- .header-nav-item .item-text {
- font-size: 16px;
- font-weight: bold;
- color: #333;
- transition: color 0.2s;
- }
- .header-nav-item:hover .item-text {
- color: var(--hover-color);
- }
- /* 广告模块样式 */
- .ad-preview-grid {
- display: flex;
- flex-wrap: nowrap;
- gap: 20px;
- max-width: 1600px;
- margin: 0;
- }
- .ad-item {
- background: #f8f9fa;
- border-radius: 12px;
- padding: 15px;
- position: relative;
- overflow: hidden;
- box-sizing: border-box;
- }
- .ad-item:hover .ad-hover-mask {
- display: flex;
- }
- .ad-hover-mask {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0, 0, 0, 0.4);
- display: none;
- align-items: center;
- justify-content: center;
- z-index: 100;
- }
- .ad-header {
- display: flex;
- justify-content: space-between;
- align-items: baseline;
- margin-bottom: 12px;
- }
- .ad-title-main {
- font-size: 18px;
- font-weight: 800;
- color: #333;
- }
- .ad-title-sub {
- font-size: 13px;
- }
- .ad-title-sub.orange {
- color: #f58220;
- }
- .ad-title-sub.gray {
- color: #999;
- }
- /* Ad 1: 百亿补贴 */
- .ad-products-subsidy {
- display: flex;
- gap: 15px;
- }
- .ad-subsidy .product-item {
- flex: 1;
- text-align: center;
- }
- .ad-subsidy .product-img {
- width: 94px;
- height: 94px;
- background: #fff;
- border-radius: 8px;
- margin-bottom: 8px;
- overflow: hidden;
- }
- .ad-subsidy .product-img img {
- width: 100%;
- height: 100%;
- object-fit: contain;
- }
- .ad-subsidy .product-price {
- color: #e60012;
- font-weight: bold;
- font-size: 15px;
- }
- .ad-ranking {
- padding: 12px !important;
- }
- .ad-ranking .ad-header {
- margin-bottom: 8px;
- }
- /* Ad 2: 榜单 */
- .ad-products-ranking {
- display: flex;
- gap: 8px;
- flex: 1;
- }
- .ranking-item {
- flex: 1;
- background: #fff;
- border-radius: 8px;
- padding: 6px 5px 0;
- position: relative;
- text-align: center;
- display: flex;
- flex-direction: column;
- align-items: center;
- overflow: hidden;
- height: 135px; /* 高度调小一点 */
- }
- .ranking-badge {
- display: inline-block;
- background: #fff3e5;
- color: #f58220;
- font-size: 11px;
- padding: 2px 10px;
- border-radius: 20px;
- white-space: nowrap;
- margin-bottom: 4px;
- transform: scale(0.9); /* 略微缩小标签以腾出空间 */
- }
- .ranking-item .product-img {
- width: 80px; /* 略微缩小图片从 84 降至 80 */
- height: 80px;
- margin-bottom: 4px;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .ranking-item .product-img img {
- width: 100%;
- height: 100%;
- object-fit: contain;
- }
- .ranking-footer {
- background: #fff1f1;
- color: #e60012;
- font-size: 12px;
- padding: 5px 0;
- font-weight: bold;
- width: 100%;
- margin-top: auto;
- line-height: 1.2;
- }
- /* Ad 3: 品牌 */
- .ad-brands-content {
- display: flex;
- gap: 10px;
- }
- .brand-item {
- flex: 1;
- text-align: center;
- }
- .brand-logo {
- width: 50px;
- height: 50px;
- margin: 0 auto 8px;
- background: #fff;
- border-radius: 4px;
- padding: 5px;
- }
- .brand-logo img {
- width: 100%;
- height: 100%;
- object-fit: contain;
- }
- .brand-name {
- font-size: 11px;
- color: #0071bc;
- margin-bottom: 5px;
- height: 20px;
- line-height: 20px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- width: 100%;
- }
- .brand-tag-btn {
- display: inline-block;
- padding: 2px 10px;
- border: 1px solid #e60012;
- color: #e60012;
- border-radius: 10px;
- font-size: 11px;
- }
- /* Ad 4 & 5: 精选/新品 */
- .ad-products-selection {
- display: flex;
- gap: 10px;
- }
- .selection-item {
- flex: 1;
- text-align: center;
- }
- .selection-item .product-img {
- width: 84px;
- height: 84px;
- background: #fff;
- border-radius: 8px;
- margin-bottom: 5px;
- }
- .selection-item .product-img img {
- width: 100%;
- height: 100%;
- object-fit: contain;
- }
- .product-price-row {
- display: flex;
- align-items: baseline;
- justify-content: flex-start;
- gap: 2px;
- }
- .product-price-row.center {
- justify-content: center;
- }
- .p-unit {
- font-size: 12px;
- color: #e60012;
- font-weight: bold;
- }
- .p-val {
- font-size: 16px;
- color: #e60012;
- font-weight: 800;
- }
- .p-tag {
- background: #3fa9f5;
- color: #fff;
- font-size: 10px;
- padding: 0 4px;
- border-radius: 2px;
- margin-left: 2px;
- }
- /* 选择弹窗样式 */
- .select-item-row {
- display: flex;
- align-items: center;
- padding: 12px;
- border: 1px solid #eee;
- border-radius: 8px;
- margin-bottom: 10px;
- cursor: pointer;
- transition: all 0.2s;
- }
- .select-item-row:hover {
- border-color: #409eff;
- background: #f0f7ff;
- }
- .select-item-row.active {
- border-color: #409eff;
- background: #f0f7ff;
- }
- .select-item-img {
- width: 80px;
- height: 80px;
- object-fit: contain;
- margin-right: 20px;
- background: #f9f9f9;
- border-radius: 4px;
- }
- .select-item-info {
- flex: 1;
- }
- .select-item-name {
- font-size: 14px;
- color: #333;
- margin-bottom: 4px;
- }
- .select-item-price {
- color: #e60012;
- font-weight: bold;
- }
- .select-pagination {
- margin-top: 30px;
- display: flex;
- justify-content: center;
- padding-bottom: 20px;
- }
- .select-item-id {
- font-size: 11px;
- color: #999;
- margin-top: 2px;
- }
- /* 场景方案预览样式 */
- .scenario-preview-outer {
- width: 100%;
- overflow-x: auto;
- padding: 10px 0;
- }
- .scenario-preview-box-clean {
- width: 1600px;
- max-width: 100%;
- height: 158px;
- background: var(--s-theme-color, #66e0a3);
- border-radius: 16px; /* 加大圆角 */
- display: flex;
- align-items: center;
- padding: 0 20px 0 32px; /* 减小左边距使标题区左移 */
- box-sizing: border-box;
- position: relative;
- overflow: hidden;
- }
- .s-title-group {
- display: flex;
- align-items: center;
- gap: 12px;
- margin-bottom: 12px;
- white-space: nowrap; /* 强制不换行,向后追加 */
- }
- .s-main-title {
- font-size: 24px; /* 调整为 24px */
- font-weight: 900;
- color: #fff;
- flex-shrink: 0; /* 确保不收缩 */
- }
- .s-sub-title-inline {
- font-size: 24px; /* 调整为 24px */
- font-weight: 900;
- color: #fff;
- flex-shrink: 0; /* 确保不收缩 */
- }
- .s-btn-wrap {
- margin-top: 15px;
- }
- .s-btn-premium {
- display: inline-flex;
- align-items: center;
- background-color: #fff;
- color: #e60012;
- font-size: 14px;
- font-weight: bold;
- padding: 6px 20px;
- border-radius: 20px;
- }
- .scenario-card-premium {
- width: 288px;
- height: 130px;
- border-radius: 8px;
- display: flex;
- flex-direction: column;
- position: relative;
- }
- .card-top-header {
- height: 42px; /* 固定高度,确保下方图片间距准确 */
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 12px;
- box-sizing: border-box;
- }
- .card-titles-group {
- display: flex;
- align-items: center;
- gap: 8px;
- }
- .card-main-title {
- font-size: 15px;
- font-weight: bold;
- }
- .card-sub-title {
- font-size: 13px;
- font-weight: bold;
- }
- .card-arrow-icon {
- width: 18px;
- height: 18px;
- border-radius: 50%;
- color: #fff;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 10px;
- }
- .card-image-content {
- width: 272px;
- height: 80px;
- margin: 0 8px 8px 8px; /* 左右下保留相同间距 (8px) */
- border-radius: 4px;
- overflow: hidden;
- }
- .card-image-content img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- /* 响应式逻辑:优先隐藏最后一个方案卡片,再隐藏副标题 */
- @media (max-width: 1680px) {
- .scenario-preview-box-clean {
- width: 1300px;
- }
- .hidden-card-fourth {
- display: none !important;
- }
- }
- @media (max-width: 1400px) {
- .scenario-preview-box-clean {
- width: 1000px;
- }
- .s-sub-title-inline {
- display: none !important;
- }
- }
- .scenario-header-left {
- width: 320px;
- flex-shrink: 0;
- display: flex;
- flex-direction: column;
- }
- .scenario-cards-wrap {
- flex: 1;
- display: flex;
- justify-content: flex-end;
- gap: 12px; /* 间距调小 */
- }
- .scenario-card {
- width: 288px;
- height: 130px;
- background-color: #fff;
- border-radius: 12px;
- padding: 12px;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
- cursor: pointer;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
- border: 1px solid rgba(0, 0, 0, 0.02);
- }
- .scenario-card:hover {
- transform: translateY(-8px);
- box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
- border-color: rgba(102, 224, 163, 0.3);
- }
- .card-top {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 8px;
- padding: 0 5px;
- }
- .card-titles {
- display: flex;
- align-items: center;
- gap: 8px;
- }
- .card-main-title {
- font-size: 18px;
- font-weight: bold;
- }
- .card-sub-title {
- font-size: 12px;
- }
- .card-arrow {
- width: 18px;
- height: 18px;
- border-radius: 50%;
- color: #fff;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 10px;
- }
- .card-img {
- width: 272px;
- height: 80px;
- border-radius: 6px;
- overflow: hidden;
- background-color: #f5f7fa;
- }
- .card-img img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- /* 响应式调整 */
- @media (max-width: 1500px) {
- .scenario-preview-box {
- width: 1300px;
- }
- .hidden-card-fourth {
- display: none !important;
- }
- }
- @media (max-width: 1200px) {
- .scenario-preview-box {
- width: 1000px;
- }
- .s-sub-title {
- display: none !important;
- }
- }
- /* 广告模块弹窗精修 */
- .ad-setup-dialog :deep(.el-dialog__body) {
- padding: 30px 40px;
- max-height: 700px;
- overflow-y: auto;
- }
- .brand-name-display {
- font-size: 15px;
- font-weight: bold;
- color: #333;
- }
- .ad-setup-dialog :deep(.el-table__row) {
- height: 90px; /* 增加行高,大气美观 */
- }
- .config-subtitle {
- font-size: 15px;
- font-weight: bold;
- color: #333;
- margin: 25px 0 15px;
- display: flex;
- align-items: center;
- line-height: 1;
- }
- .config-subtitle::before {
- content: '';
- width: 3px;
- height: 14px;
- background: #e60012;
- margin-right: 8px;
- }
- /* 快捷入口预览样式 */
- .quick-entry-preview-outer {
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- padding: 20px 0;
- }
- .qe-mockup-card {
- width: 230px;
- height: 167px;
- background: #fff;
- border-radius: 12px;
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
- padding: 12px 16px;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- position: relative;
- }
- .qe-card-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 12px;
- }
- .qe-card-title {
- font-size: 16px;
- font-weight: bold;
- color: #333;
- }
- .qe-header-arrow {
- font-size: 12px;
- color: #999;
- }
- .qe-grid-container {
- width: 198px;
- height: 108px;
- margin: 0 auto;
- position: relative;
- overflow: hidden;
- }
- .qe-grid-wrapper {
- display: flex;
- transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
- height: 100%;
- }
- .qe-grid-page {
- width: 198px;
- flex-shrink: 0;
- display: grid;
- grid-template-columns: repeat(4, 1fr);
- grid-template-rows: repeat(2, 1fr);
- gap: 12px 0;
- }
- .qe-item {
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 4px;
- }
- .qe-icon-wrap {
- width: 24px;
- height: 24px;
- position: relative;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .qe-icon-img {
- width: 24px;
- height: 24px;
- object-fit: contain;
- }
- .qe-icon-placeholder {
- font-size: 20px;
- color: #666;
- }
- .qe-tag-bubble {
- position: absolute;
- top: -8px;
- right: -15px;
- background: #ff4d4f;
- color: #fff;
- font-size: 9px; /* 精确 9px */
- padding: 1px 5px;
- border-radius: 10px;
- white-space: nowrap;
- transform: scale(0.9);
- z-index: 100; /* 提升至最高图层 */
- }
- .qe-name {
- font-size: 11px; /* 精确 11px */
- color: #333;
- text-align: center;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- width: 100%;
- }
- .qe-nav-btns {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- pointer-events: none;
- }
- .qe-nav-btn {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- width: 22px;
- height: 22px;
- background: rgba(255, 255, 255, 0.9);
- border-radius: 50%;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
- display: flex;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- pointer-events: auto;
- color: #666;
- z-index: 110; /* 提升至最高图层,确保不被内容遮挡 */
- }
- .qe-nav-btn:hover {
- background: #fff;
- color: #e60012;
- }
- .qe-nav-btn.prev {
- left: -10px;
- }
- .qe-nav-btn.next {
- right: -10px;
- }
- /* 快捷入口编辑器特定样式 */
- .quick-entry-editor {
- display: flex;
- flex-direction: column;
- padding: 20px 40px;
- gap: 30px;
- }
- .config-form-inline {
- background: #fcfdfe;
- padding: 20px;
- border-radius: 8px;
- border: 1px solid #eef2f6;
- }
- .table-icon-cell {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- /* 推荐设置编辑区容器 */
- .recommend-editor-container {
- padding: 24px;
- border-bottom: none !important;
- }
- /* 推荐设置预览样式 */
- .recommend-preview-outer {
- width: 100%;
- padding: 10px 0 20px;
- position: relative;
- }
- .recommend-preview-container {
- width: 1600px !important; /* 严格按照要求设置背景尺寸 */
- height: 88px !important;
- position: relative;
- background: #fff;
- border-radius: 8px;
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
- overflow: hidden;
- margin-bottom: 10px;
- }
- .recommend-preview-box {
- width: 100% !important;
- height: 100% !important;
- display: flex;
- align-items: center;
- padding: 0 40px;
- box-sizing: border-box;
- overflow-x: auto;
- scroll-behavior: smooth;
- -ms-overflow-style: none;
- scrollbar-width: none;
- }
- .recommend-preview-box::-webkit-scrollbar {
- display: none;
- }
- .recommend-item {
- display: flex;
- align-items: center;
- padding: 10px 24px;
- margin: 0 4px;
- cursor: pointer;
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
- height: 60px;
- border-radius: 8px;
- flex-shrink: 0;
- }
- .recommend-item:hover {
- background: #f5f5f5;
- }
- .recommend-item.active {
- background: transparent;
- }
- .recommend-icon {
- width: 32px;
- height: 32px;
- margin-right: 12px;
- flex-shrink: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .table-icon-preview {
- width: 40px;
- height: 40px;
- background: #f5f5f5;
- border-radius: 4px;
- display: flex;
- align-items: center;
- justify-content: center;
- margin: 0 auto;
- overflow: hidden;
- }
- .row-icon {
- width: 100%;
- height: 100%;
- object-fit: contain;
- }
- .recommend-text {
- display: flex;
- flex-direction: column;
- white-space: nowrap;
- }
- .r-main-title {
- font-size: 16px;
- font-weight: bold;
- line-height: 1.4;
- white-space: nowrap;
- }
- .r-sub-title {
- font-size: 12px;
- color: #999;
- margin-top: 2px;
- white-space: nowrap;
- }
- .recommend-nav-btn {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- width: 32px;
- height: 32px;
- background: rgba(255, 255, 255, 0.9);
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- color: #666;
- z-index: 100;
- transition: all 0.2s;
- border: 1px solid #eee;
- }
- .recommend-nav-btn:hover {
- color: var(--r-theme-color);
- background: #fff;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
- }
- .recommend-nav-btn.prev {
- left: 10px;
- }
- .recommend-nav-btn.next {
- right: 10px;
- }
- /* 修复色块标签换行 */
- .config-section-standard :deep(.el-form-item__label) {
- white-space: nowrap;
- }
- /* 去除底部冗余线条 */
- .recommend-editor-container :deep(.el-table__inner-wrapper::before),
- .recommend-editor-container :deep(.el-table--border::after),
- .recommend-editor-container :deep(.el-table--group::after),
- .recommend-editor-container :deep(.el-table::before) {
- display: none !important;
- }
- .recommend-icon img {
- width: 100%;
- height: 100%;
- object-fit: contain;
- background: #f2f2f2;
- border-radius: 4px;
- }
- /* 已选商品管理弹窗增强 */
- .selected-products-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 20px;
- padding: 10px 0;
- }
- .selected-products-header .right-info {
- font-size: 14px;
- color: #666;
- }
- .selected-products-header .count {
- color: #e60012;
- font-weight: 800;
- margin: 0 4px;
- }
- .price-text {
- color: #e60012;
- font-weight: bold;
- }
- .empty-placeholder {
- padding: 60px 0;
- }
- /* 商品多选抽屉样式 */
- .product-selection-drawer :deep(.el-drawer__body) {
- padding: 0;
- background: #fcfdfe;
- }
- .drawer-content-wrapper {
- display: flex;
- flex-direction: column;
- height: 100%;
- }
- .drawer-search-bar {
- padding: 20px;
- background: #fff;
- border-bottom: 1px solid #f0f2f5;
- }
- .drawer-stat-bar {
- padding: 12px 20px;
- background: #e6f7ff;
- border: 1px solid #91d5ff;
- color: #1890ff;
- font-size: 13px;
- display: flex;
- align-items: center;
- gap: 8px;
- margin: 15px 20px 0;
- border-radius: 4px;
- }
- .drawer-stat-bar .highlight {
- font-weight: bold;
- font-size: 16px;
- margin: 0 2px;
- }
- .drawer-content-wrapper :deep(.el-table) {
- margin: 15px 20px;
- width: auto !important;
- }
- .drawer-product-info {
- display: flex;
- align-items: center;
- gap: 12px;
- }
- .drawer-product-info .mini-img {
- width: 50px;
- height: 50px;
- border-radius: 4px;
- border: 1px solid #f0f0f0;
- flex-shrink: 0;
- }
- .drawer-product-info .detail {
- flex: 1;
- overflow: hidden;
- }
- .drawer-product-info .name {
- font-size: 13px;
- color: #333;
- line-height: 1.4;
- margin-bottom: 4px;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- overflow: hidden;
- }
- .drawer-product-info .id {
- font-size: 11px;
- color: #999;
- }
- .drawer-product-info .price {
- color: #e60012;
- font-weight: bold;
- margin-top: 2px;
- }
- .drawer-pagination {
- padding: 20px;
- display: flex;
- justify-content: center;
- background: #fff;
- border-top: 1px solid #f0f2f5;
- }
- .drawer-footer-actions {
- display: flex;
- justify-content: flex-end;
- gap: 12px;
- padding: 20px;
- }
- .m-l-10 {
- margin-left: 10px;
- }
- </style>
|