detail.vue 74 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148
  1. <template>
  2. <view class="page">
  3. <view class="pageDecor">
  4. <view class="pageGlow glowA" />
  5. <view class="pageGlow glowB" />
  6. <view class="pageGlow glowC" />
  7. <view class="pageGrain" />
  8. </view>
  9. <!-- 顶部留白:兼容 iOS 刘海 -->
  10. <view class="safeTop" />
  11. <!-- 轻品牌页头:极克制、无导航栏,让独立扫码页有品牌收口 -->
  12. <view class="brandPageHeader">
  13. <view class="brandPageHeaderInner">
  14. <text class="brandPageHeaderName">佳友厚苑</text>
  15. <view class="brandPageHeaderDot" />
  16. <text class="brandPageHeaderLabel">官方溯源 品质可验</text>
  17. </view>
  18. </view>
  19. <view class="hero">
  20. <!-- 完整首屏大卡:品牌信任区 + 商品信息面板 -->
  21. <view class="heroCard">
  22. <!-- Hero 视觉区:商品图 + 品牌氛围 -->
  23. <view class="heroBg">
  24. <!-- 优先商品图,没有则用农场图 -->
  25. <image
  26. class="heroImage"
  27. :src="traceDetail.product?.image || traceDetail.farm?.image"
  28. mode="aspectFill"
  29. />
  30. <!-- 底部大字号水印,营造品牌氛围 -->
  31. <view class="heroBrandAnchor">
  32. <text class="heroBrandAnchorText">JIAYOU</text>
  33. </view>
  34. <!-- 光感层:多层次渐变 + 景深 + 底部暗化 -->
  35. <view class="heroMask" />
  36. </view>
  37. <!-- 商品信息面板:嵌入 Hero 底部,与 Hero 自然过渡 -->
  38. <view v-if="traceDetail.product?.name" class="heroInfoPanel">
  39. <view class="infoPanelInner">
  40. <view class="sectionHeader">
  41. <view class="sectionHeaderLeft">
  42. <text class="sectionEn">Product</text>
  43. <text class="sectionTitle">商品信息</text>
  44. </view>
  45. <view v-if="traceDetail.batch?.statusBadge" class="trustBadge" :class="traceDetail.batch.statusBadge.type">
  46. <!-- 认证徽章 SVG:双圆环 + 对勾,图标主视觉,文字辅助 -->
  47. <svg class="trustBadgeIcon" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  48. <circle cx="10" cy="10" r="9" stroke="rgba(27,71,42,0.38)" stroke-width="0.9" />
  49. <circle cx="10" cy="10" r="5.5" stroke="rgba(27,71,42,0.22)" stroke-width="0.7" />
  50. <path d="M6.6 10.4L9.1 12.9L13.8 8" stroke="rgba(27,71,42,0.8)" stroke-width="1.15" stroke-linecap="round" stroke-linejoin="round" />
  51. </svg>
  52. <text class="trustBadgeText">{{ traceDetail.batch.statusBadge.text }}</text>
  53. </view>
  54. </view>
  55. <view class="infoPanelBody">
  56. <text class="infoPanelName">{{ traceDetail.product.name }}</text>
  57. <view v-if="traceDetail.product.spec" class="infoPanelSpec">
  58. <view class="specDot" />
  59. <text class="specText">{{ traceDetail.product.spec }}</text>
  60. </view>
  61. <view v-if="traceDetail.product?.intro" class="infoPanelIntro">
  62. <text>{{ traceDetail.product.intro }}</text>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <scroll-view class="content" scroll-y>
  70. <!-- 溯源结论卡:先给结论,再给证据 -->
  71. <view v-if="traceDetail.batch?.exists && traceDetail.traceConclusionCard" class="card cardLevel1 cardConclusion">
  72. <view class="sectionHeader">
  73. <view class="sectionHeaderLeft">
  74. <text class="sectionEn">Conclusion</text>
  75. <text class="sectionTitle">溯源结论</text>
  76. </view>
  77. </view>
  78. <view class="conclusionBody">
  79. <text class="conclusionLead">{{ traceDetail.traceConclusionCard.conclusion }}</text>
  80. <text class="conclusionDesc">{{ traceDetail.traceConclusionCard.desc }}</text>
  81. </view>
  82. </view>
  83. <!-- 农场信息(合并为单卡:图片+名称+地区+介绍连续表达) -->
  84. <view v-if="traceDetail.farm?.name" class="card cardLevel2 cardFarm">
  85. <view class="sectionHeader">
  86. <view class="sectionHeaderLeft">
  87. <text class="sectionEn">Farm</text>
  88. <text class="sectionTitle">农场信息</text>
  89. </view>
  90. </view>
  91. <!-- 农场主体:左图右文结构,融入主体内容 -->
  92. <view class="farmBody">
  93. <view class="farmImageWrap">
  94. <image class="farmImage" :src="traceDetail.farm.image" mode="aspectFill" />
  95. </view>
  96. <view class="farmMeta">
  97. <text class="farmName">{{ traceDetail.farm.name }}</text>
  98. <view v-if="traceDetail.farm.location" class="farmLocation">
  99. <svg class="locationIcon" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  100. <path d="M10 2C7.24 2 5 4.24 5 7c0 4 5 11 5 11s5-7 5-11c0-2.76-2.24-5-5-5zm0 6.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" fill="rgba(39,113,76,0.6)"/>
  101. </svg>
  102. <text class="locationText">{{ traceDetail.farm.location }}</text>
  103. </view>
  104. </view>
  105. </view>
  106. <view v-if="traceDetail.farm?.intro" class="farmIntro">
  107. <text>{{ traceDetail.farm.intro }}</text>
  108. </view>
  109. </view>
  110. <!-- 农事时间轴:关键种植过程 -->
  111. <view v-if="traceDetail.batch?.exists && traceDetail.farmTimeline?.length" class="card cardLevel1 cardTimeline">
  112. <view class="sectionHeader">
  113. <view class="sectionHeaderLeft">
  114. <text class="sectionEn">Process</text>
  115. <text class="sectionTitle">种植过程记录</text>
  116. </view>
  117. </view>
  118. <view class="timelineList">
  119. <view
  120. v-for="(item, index) in traceDetail.farmTimeline"
  121. :key="`timeline-${index}`"
  122. :class="{
  123. 'timelineItem': true,
  124. 'is-key': item.stage === 'test',
  125. 'is-current': item.stage === 'pack'
  126. }"
  127. >
  128. <view class="timelineLeft">
  129. <view class="timelineDot" />
  130. <view v-if="index !== traceDetail.farmTimeline.length - 1" class="timelineLine" />
  131. </view>
  132. <view class="timelineRight">
  133. <text v-if="item.time" class="timelineTime">{{ item.time }}</text>
  134. <text class="timelineTitle">{{ item.title }}</text>
  135. <text class="timelineDesc">{{ item.desc }}</text>
  136. </view>
  137. </view>
  138. </view>
  139. <view class="timelineFootnote">
  140. <text>以上信息真实有效,可追溯验证</text>
  141. </view>
  142. </view>
  143. <!-- 种植现场实时画面 -->
  144. <view v-if="traceDetail.batch?.exists && traceDetail.camera" class="card cardLevel1 cardLive">
  145. <view class="sectionHeader">
  146. <view class="sectionHeaderLeft">
  147. <text class="sectionEn">Live Scene</text>
  148. <text class="sectionTitle">种植现场</text>
  149. </view>
  150. </view>
  151. <!-- <image
  152. v-if="traceDetail.camera.coverImage"
  153. class="liveCover"
  154. :src="traceDetail.camera.coverImage"
  155. mode="aspectFill"
  156. />
  157. <view v-else class="livePlaceholder">
  158. <view class="livePlayIcon">
  159. <view class="livePlayDot" />
  160. <view class="livePlayDot dot2" />
  161. <view class="livePlayDot dot3" />
  162. </view>
  163. <text class="livePlaceholderMain">实时画面接入中</text>
  164. <text class="livePlaceholderSub">请稍候查看现场情况</text>
  165. </view> -->
  166. <!-- 视频预览区域 -->
  167. <view class="video-section">
  168. <view class="video-container" :class="{'fullscreen-mode': isFullscreen}">
  169. <image v-if="!isPlaying" src="/static/images/video-placeholder.jpg" mode="aspectFill"
  170. class="video-placeholder"></image>
  171. <!-- 使用跨平台视频播放组件 -->
  172. <!-- #ifdef H5 -->
  173. <view v-if="isPlaying" class="h5-video-wrapper">
  174. <Jessibuca ref="jessibucaRef" :videoUrl="getH5StreamUrl" :hasAudio="true" @error="onVideoError" />
  175. </view>
  176. <!-- #endif -->
  177. <!-- 微信小程序视频播放 -->
  178. <!-- #ifdef MP-WEIXIN -->
  179. <video
  180. v-if="isPlaying"
  181. id="myVideo"
  182. class="video-player"
  183. :src="getAppStreamUrl"
  184. :autoplay="true"
  185. :controls="true"
  186. :show-center-play-btn="true"
  187. :enable-progress-gesture="false"
  188. :object-fit="'contain'"
  189. @error="onVideoError"
  190. @play="onVideoPlay"
  191. @pause="onVideoPause"
  192. @ended="onVideoEnded"
  193. @timeupdate="onTimeUpdate"
  194. @fullscreenchange="onFullscreenChange"
  195. ></video>
  196. <!-- #endif -->
  197. <!-- App端视频播放 -->
  198. <!-- #ifdef APP-PLUS || APP-HARMONY -->
  199. <video
  200. v-if="isPlaying"
  201. id="appVideo"
  202. class="video-player"
  203. :src="getAppStreamUrl"
  204. :autoplay="true"
  205. :controls="true"
  206. :show-center-play-btn="true"
  207. @error="onVideoError"
  208. ></video>
  209. <!-- #endif -->
  210. <!-- 视频控制层 -->
  211. <view class="video-controls">
  212. <view class="control-row top-controls">
  213. <view class="signal-indicator">
  214. <image src="/static/icons/signal_icon.png" mode="aspectFit"
  215. style="width: 16px; height: 16px;"></image>
  216. <text class="signal-text">信号良好</text>
  217. </view>
  218. <view class="fullscreen-button" @click="toggleFullscreen">
  219. <image src="/static/icons/resize_icon.png" mode="aspectFit"
  220. style="width: 20px; height: 20px;"></image>
  221. </view>
  222. </view>
  223. <view class="control-row center-controls">
  224. <view v-if="!isPlaying" class="play-button" @click="togglePlayState">
  225. <image src="/static/icons/play_icon.png" mode="aspectFit"
  226. style="width: 32px; height: 32px;"></image>
  227. </view>
  228. <view v-else class="center-button-container" @click="togglePlayState">
  229. <view class="pause-icon">
  230. <image src="/static/icons/pause_icon.png" mode="aspectFit"
  231. style="width: 24px; height: 24px;"></image>
  232. </view>
  233. </view>
  234. </view>
  235. <view class="control-row bottom-controls">
  236. <view class="video-time">{{ currentTime }}</view>
  237. </view>
  238. </view>
  239. </view>
  240. </view>
  241. <view class="liveStatusPill" :class="cameraStatus.value">
  242. <view class="liveStatusDot" />
  243. <text>{{ cameraStatusText }}</text>
  244. </view>
  245. <view class="liveDesc">
  246. <text>{{ traceDetail.camera.desc }}</text>
  247. </view>
  248. </view>
  249. <!-- 批次信息(可选:batch 可能不存在) -->
  250. <view v-if="traceDetail.batch?.exists" class="card cardLevel1 cardBatch">
  251. <view class="sectionHeader">
  252. <view class="sectionHeaderLeft">
  253. <text class="sectionEn">Batch</text>
  254. <text class="sectionTitle">批次信息</text>
  255. </view>
  256. </view>
  257. <!-- 批次信息主体:左右两列布局,左列标签固定宽度,右列内容左对齐 -->
  258. <view class="batchBody">
  259. <view v-if="traceDetail.batch?.no" class="batchRow">
  260. <text class="batchRowLabel">批次号</text>
  261. <text class="batchRowValue">{{ traceDetail.batch.no }}</text>
  262. </view>
  263. <view v-if="traceDetail.batch?.harvestTime" class="batchRow">
  264. <text class="batchRowLabel">生产/采收时间</text>
  265. <text class="batchRowValue">{{ traceDetail.batch.harvestTime }}</text>
  266. </view>
  267. <view v-if="traceDetail.batch?.packTime" class="batchRow">
  268. <text class="batchRowLabel">包装时间</text>
  269. <text class="batchRowValue">{{ traceDetail.batch.packTime }}</text>
  270. </view>
  271. </view>
  272. </view>
  273. <!-- 批次不存在/已下线的说明 -->
  274. <view v-else-if="traceDetail.batch?.statusBadge" class="card soft cardLevel1 cardBatchState">
  275. <view class="sectionHeader">
  276. <view class="sectionHeaderLeft">
  277. <text class="sectionEn">Batch</text>
  278. <text class="sectionTitle">当前批次状态</text>
  279. </view>
  280. <view class="statusBadge" :class="traceDetail.batch.statusBadge.type">
  281. {{ traceDetail.batch.statusBadge.text }}
  282. </view>
  283. </view>
  284. <view class="emptyText">{{ traceDetail.batch?.emptyMessage || '该批次暂不可查询' }}</view>
  285. <view class="btnRow">
  286. <button class="primaryBtn" @click="goBackToPurchase">返回购买渠道</button>
  287. </view>
  288. </view>
  289. <!-- 检测报告:横向卡片列表 -->
  290. <view v-if="traceDetail.batch?.exists" class="card cardLevel2 cardCredential">
  291. <view class="sectionHeader">
  292. <view class="sectionHeaderLeft">
  293. <text class="sectionEn">Report</text>
  294. <text class="sectionTitle">检测报告</text>
  295. </view>
  296. </view>
  297. <!-- 横向滑动卡片列表 -->
  298. <scroll-view
  299. v-if="reportItems.length"
  300. class="reportCardList"
  301. scroll-x
  302. :show-scrollbar="false"
  303. enhanced
  304. >
  305. <view class="reportCardTrack">
  306. <view
  307. v-for="(item, itemIdx) in reportItems"
  308. :key="`report-card-${itemIdx}`"
  309. class="reportCard"
  310. @click="previewDoc('report', getReportGlobalIndex(itemIdx, 0))"
  311. >
  312. <!-- 报告缩略图(带页数角标) -->
  313. <view class="reportCardThumb">
  314. <image
  315. v-if="item.images && item.images.length"
  316. class="reportCardThumbImg"
  317. :src="item.images[0]"
  318. mode="aspectFit"
  319. />
  320. <view v-else class="reportCardThumbEmpty">
  321. <text class="reportCardThumbEmptyText">暂无图片</text>
  322. </view>
  323. <view v-if="item.images && item.images.length > 1" class="reportCardPages">
  324. 共{{ item.images.length }}页
  325. </view>
  326. </view>
  327. <!-- 报告信息 -->
  328. <view class="reportCardMeta">
  329. <view v-if="item.detectDate" class="reportCardRow">
  330. <text class="reportCardLabel">检测日期</text>
  331. <text class="reportCardValue">{{ item.detectDate }}</text>
  332. </view>
  333. <view v-if="item.no" class="reportCardRow">
  334. <text class="reportCardLabel">报告编号</text>
  335. <text class="reportCardValue reportCardValueNo">{{ item.no }}</text>
  336. </view>
  337. </view>
  338. <!-- 点击提示 -->
  339. <text class="reportCardHint">点击查看大图</text>
  340. </view>
  341. </view>
  342. </scroll-view>
  343. <!-- 待补充状态 -->
  344. <view v-else class="docPlaceholder">
  345. <text class="docPlaceholderTitle">检测报告待补充</text>
  346. <text class="docPlaceholderText">
  347. {{ traceDetail.report?.emptyMessage || '检测报告待补充,请耐心等待。' }}
  348. </text>
  349. </view>
  350. </view>
  351. <!-- 合格证:信息摘要 + 缩略图一体化布局 -->
  352. <view v-if="traceDetail.batch?.exists" class="card cardLevel1 cardCredential">
  353. <view class="sectionHeader">
  354. <view class="sectionHeaderLeft">
  355. <text class="sectionEn">Certificate</text>
  356. <text class="sectionTitle">合格证</text>
  357. </view>
  358. </view>
  359. <!-- 信息与缩略图一体化区域 -->
  360. <view class="certSummary">
  361. <!-- 左侧:信息摘要 -->
  362. <view class="certSummaryInfo">
  363. <view v-if="traceDetail.certificate?.issueDate" class="certSummaryRow">
  364. <text class="certSummaryLabel">开具日期</text>
  365. <text class="certSummaryValue">{{ traceDetail.certificate.issueDate }}</text>
  366. </view>
  367. <view v-if="traceDetail.certificate?.no" class="certSummaryRow">
  368. <text class="certSummaryLabel">合格证编号</text>
  369. <text class="certSummaryValue">{{ traceDetail.certificate.no }}</text>
  370. </view>
  371. </view>
  372. <!-- 右侧:缩略图 -->
  373. <view
  374. v-if="traceDetail.certificate?.status === 'uploaded' && certificateImages.length"
  375. class="certThumbContainer"
  376. @click="previewDoc('certificate', 0)"
  377. >
  378. <view class="certThumbWrap">
  379. <image class="certThumbImage" :src="certificateImages[0]" mode="aspectFit" />
  380. </view>
  381. <text class="certPreviewHint">点击查看</text>
  382. </view>
  383. <!-- 待补充状态:仅显示提示 -->
  384. <view v-else class="certPendingHint">
  385. <text class="certPendingText">
  386. {{ traceDetail.certificate?.emptyMessage || '合格证待补充,请耐心等待。' }}
  387. </text>
  388. </view>
  389. </view>
  390. </view>
  391. <!-- 底部柔和收口渐变 -->
  392. <view class="footerFade" />
  393. <!-- 轻量页脚 -->
  394. <view class="traceFooter">
  395. <view class="traceFooterHint">如需帮助,联系客服</view>
  396. <view class="traceFooterPhone" @click="contactCustomer">
  397. <image class="traceFooterPhoneIcon" src="/static/icons/phone.svg" mode="aspectFit" />
  398. <text class="traceFooterPhoneNum">13379508760</text>
  399. </view>
  400. <view class="traceFooterBrand">佳友厚苑 · 安心之选</view>
  401. </view>
  402. </scroll-view>
  403. </view>
  404. </template>
  405. <script setup>
  406. import { computed, ref, reactive } from 'vue'
  407. import { onLoad } from '@dcloudio/uni-app'
  408. import {getTraceDetail } from '@/api/base/index.js'
  409. import {
  410. getDeviceCollectorDetail,
  411. getChannels,
  412. playStart,
  413. pause ,
  414. } from '@/api/device.js'
  415. import Jessibuca from '@/components/common/jessibuca.vue'
  416. // 页面状态选择(H5 演示用):通过路由参数传入 state 即可切换 mock 场景
  417. // 例如:/pages/trace/detail?state=reportPending
  418. // 加载状态
  419. const loading = ref(false)
  420. // 数据存储
  421. const traceInfo = ref(null)
  422. const routeOptions = ref({})
  423. const mockStateKey = ref('normal')
  424. const isFullscreen = ref(false)
  425. const isPlaying = ref(false)
  426. const livePlayerContext = ref(null) // 小程序视频上下文
  427. const appLivePlayerContext = ref(null) // App端视频上下文
  428. const jessibucaRef = ref(null)
  429. const isMuted = ref(false)
  430. const isRecording = ref(false)
  431. const isVoiceActive = ref(false)
  432. const isGridView = ref(false)
  433. const isZoomMode = ref(false)
  434. const currentTime = ref('14:30:25')
  435. // 响应式数据
  436. const deviceInfo = reactive({
  437. deviceId: '34020000001110000001',
  438. name: '设备加载中...',
  439. status: 'off',
  440. location: '正在获取位置...',
  441. lastUpdate: '',
  442. deviceType: 'weather', // 默认类型,会根据API返回更新
  443. deviceTypeId: null,
  444. streamUrl: '',
  445. channelId: null, // 当前通道ID
  446. originalStreamUrl: '',
  447. })
  448. const MOCK_TRACE_DETAILS = {
  449. normal: {
  450. product: {
  451. name: '',
  452. spec: '',
  453. image: '',
  454. intro: ''
  455. },
  456. farm: {
  457. name: '',
  458. location: '',
  459. image: '',
  460. intro: ''
  461. },
  462. batch: {
  463. exists: false,
  464. statusBadge: { text: '', type: '' },
  465. no: '',
  466. harvestTime: '',
  467. packTime: ''
  468. },
  469. report: {
  470. status: '',
  471. statusBadge: { text: '', type: '' },
  472. // 每份报告独立 detectDate / no / images
  473. items: [
  474. {
  475. detectDate: '',
  476. no: '',
  477. images: ['']
  478. },
  479. {
  480. detectDate: '',
  481. no: '',
  482. images: ['']
  483. },
  484. {
  485. detectDate: '',
  486. no: '',
  487. images: ['']
  488. }
  489. ]
  490. },
  491. certificate: {
  492. status: '',
  493. statusBadge: { text: '', type: '' },
  494. issueDate: '',
  495. no: '',
  496. fileUrl: '',
  497. images: ['']
  498. },
  499. traceConclusionCard: {
  500. title: '溯源结论',
  501. conclusion: '本批次产品来源清晰,已完成安全检测,过程可查',
  502. desc: '检测材料与溯源数据已展示,可继续查看',
  503. passed: true
  504. },
  505. farmTimeline: [
  506. {
  507. time: '2026-03-01',
  508. stage: 'planting',
  509. title: '开始种植',
  510. desc: '本批次产品进入种植管理阶段'
  511. },
  512. {
  513. time: '2026-03-12',
  514. stage: 'care',
  515. title: '生长期养护',
  516. desc: '已完成灌溉、营养管理等日常养护'
  517. },
  518. {
  519. time: '2026-03-20',
  520. stage: 'inspection',
  521. title: '田间巡检',
  522. desc: '已完成长势检查与种植环境巡检'
  523. },
  524. {
  525. time: '2026-03-30',
  526. stage: 'harvest',
  527. title: '成熟采收',
  528. desc: '本批次产品进入成熟采收阶段'
  529. },
  530. {
  531. time: '2026-03-31',
  532. stage: 'test',
  533. title: '安全检测',
  534. desc: '已完成安全检测,相关结果可查'
  535. },
  536. {
  537. time: '2026-04-01',
  538. stage: 'pack',
  539. title: '包装出库',
  540. desc: '已完成包装整理,进入销售流通环节'
  541. }
  542. ],
  543. camera: {
  544. liveUrl: '',
  545. coverImage: '',
  546. status: 'online',
  547. desc: '来自农场实景画面,种植环境真实呈现'
  548. }
  549. },
  550. reportPending: {
  551. product: {
  552. name: '',
  553. spec: '',
  554. image: '',
  555. intro: ''
  556. },
  557. farm: {
  558. name: '',
  559. location: '',
  560. image: null,
  561. intro: ''
  562. },
  563. batch: {
  564. exists: false,
  565. statusBadge: { text: '', type: '' },
  566. no: '',
  567. harvestTime: '',
  568. packTime: ''
  569. },
  570. report: {
  571. status: '',
  572. statusBadge: { text: '', type: '' },
  573. emptyMessage: '',
  574. items: []
  575. },
  576. certificate: {
  577. status: '',
  578. statusBadge: { text: '', type: '' },
  579. issueDate: '',
  580. no: '',
  581. fileUrl: '',
  582. images: []
  583. },
  584. traceConclusionCard: {
  585. title: '溯源结论',
  586. conclusion: '本批次产品来源清晰,已完成安全检测,过程可查',
  587. desc: '检测材料与溯源数据已展示,可继续查看',
  588. passed: true
  589. },
  590. farmTimeline: []
  591. },
  592. certificatePending: {
  593. product: {
  594. name: '',
  595. spec: '',
  596. image: '',
  597. intro: ''
  598. },
  599. farm: {
  600. name: '',
  601. location: '',
  602. image: null,
  603. intro: ''
  604. },
  605. batch: {
  606. exists: false,
  607. statusBadge: { text: '', type: '' },
  608. no: '',
  609. harvestTime: '',
  610. packTime: ''
  611. },
  612. report: {
  613. status: '',
  614. statusBadge: { text: '', type: '' },
  615. items: [
  616. {
  617. detectDate: '',
  618. no: '',
  619. images: []
  620. }
  621. ]
  622. },
  623. certificate: {
  624. status: '',
  625. statusBadge: { text: '', type: '' },
  626. emptyMessage: ''
  627. },
  628. traceConclusionCard: {
  629. title: '溯源结论',
  630. conclusion: '本批次产品来源清晰,已完成安全检测,过程可查',
  631. desc: '检测材料与溯源数据已展示,可继续查看',
  632. passed: true
  633. },
  634. farmTimeline: []
  635. },
  636. batchNotFound: {
  637. product: {
  638. name:'',
  639. spec: '',
  640. image: '',
  641. intro: ''
  642. },
  643. farm: {
  644. name: '',
  645. location: '',
  646. image: null,
  647. intro: ''
  648. },
  649. batch: {
  650. exists: false,
  651. statusBadge: { text: '', type: '' },
  652. emptyMessage: ''
  653. },
  654. report: null,
  655. certificate: null,
  656. traceConclusionCard: {
  657. title: '溯源结论',
  658. conclusion: '本批次产品来源清晰,已完成安全检测,过程可查',
  659. desc: '检测材料与溯源数据已展示,可继续查看',
  660. passed: true
  661. },
  662. farmTimeline: []
  663. },
  664. batchOfflined: {
  665. product: {
  666. name: '',
  667. spec: '',
  668. image: '',
  669. intro: ''
  670. },
  671. farm: {
  672. name: '',
  673. location: '',
  674. image: null,
  675. intro: ''
  676. },
  677. batch: {
  678. exists: false,
  679. statusBadge: { text: '', type: '' },
  680. emptyMessage: ''
  681. },
  682. report: null,
  683. certificate: null,
  684. traceConclusionCard: {
  685. title: '溯源结论',
  686. conclusion: '本批次产品来源清晰,已完成安全检测,过程可查',
  687. desc: '检测材料与溯源数据已展示,可继续查看',
  688. passed: true
  689. },
  690. farmTimeline: []
  691. }
  692. }
  693. // 加载Jessibuca脚本
  694. const loadJessibucaScript = () => {
  695. // #ifdef H5
  696. const script = document.createElement('script')
  697. script.src = '/static/js/jessibuca/jessibuca.js'
  698. script.onload = () => {
  699. console.log('Jessibuca 脚本加载成功')
  700. }
  701. script.onerror = (error) => {
  702. console.error('Jessibuca 脚本加载失败:', error)
  703. }
  704. document.head.appendChild(script)
  705. // #endif
  706. }
  707. // 获取H5环境使用的流地址
  708. const getH5StreamUrl = computed(() => {
  709. // 确保使用安全的 WSS 协议
  710. let url = deviceInfo.originalStreamUrl
  711. if (url && url.startsWith('ws://')) {
  712. console.warn('检测到不安全的 ws:// 协议,自动转换为 wss://')
  713. url = url.replace('ws://', 'wss://')
  714. }
  715. return url
  716. })
  717. function resolveStateKey(opts) {
  718. const raw = (opts?.state || opts?.batchState || opts?.scene || '').toString().trim()
  719. if (!raw) return 'normal'
  720. const allowed = ['normal', 'reportPending', 'certificatePending', 'batchNotFound', 'batchOfflined']
  721. return allowed.includes(raw) ? raw : 'normal'
  722. }
  723. onLoad((opts) => {
  724. // 拿到浏览器路径参数
  725. const fullPath = window.location.pathname
  726. const batchId = fullPath.split('/').filter(Boolean).pop()
  727. // 优先使用路由参数中的 id,其次使用 URL 路径中的 id
  728. const finalId = batchId || 4
  729. loadData(finalId)
  730. queryChannels()
  731. routeOptions.value = opts || {}
  732. mockStateKey.value = resolveStateKey(opts || {})
  733. startTimeUpdate()
  734. // #ifdef MP-WEIXIN
  735. setTimeout(() => {
  736. livePlayerContext.value = uni.createVideoContext('myVideo')
  737. console.log('微信小程序视频上下文已创建')
  738. }, 500)
  739. // #endif
  740. // #ifdef APP-PLUS || APP-HARMONY
  741. setTimeout(() => {
  742. appLivePlayerContext.value = uni.createVideoContext('appVideo')
  743. console.log('App视频上下文已创建')
  744. }, 500)
  745. // #endif
  746. // #ifdef H5
  747. loadJessibucaScript()
  748. // #endif
  749. })
  750. // 根据设备id获取通道列表
  751. const queryChannels = () => {
  752. getChannels(deviceInfo.deviceId)
  753. .then(response => {
  754. console.log('获取通道列表:', response)
  755. const res = response.data
  756. if (res.code === 0 && res.data.total > 0) {
  757. const channels = res.data.list
  758. deviceInfo.channelId = channels[0].deviceId
  759. deviceInfo.status = channels[0].status
  760. playStart(deviceInfo.deviceId, deviceInfo.channelId).then(res => {
  761. if (res.data.code !== 0) {
  762. console.error('播放开始失败:', res.message)
  763. uni.showToast({
  764. title: '播放失败: ' + res.message,
  765. icon: 'none'
  766. })
  767. return
  768. }
  769. console.log('播放开始:', res)
  770. // #ifdef H5
  771. let streamUrl = res.data.data.wss_flv
  772. if (streamUrl) {
  773. const urlObj = new URL(streamUrl)
  774. // 替换 hostname
  775. urlObj.hostname = 'nxy.gbdfarm.com'
  776. // 替换端口
  777. urlObj.port = '9000'
  778. deviceInfo.originalStreamUrl = urlObj.toString()
  779. console.log("queryChannels - deviceInfo.originalStreamUrl", deviceInfo.originalStreamUrl)
  780. } else {
  781. console.warn('未获取到 wss_flv 流地址')
  782. }
  783. // #endif
  784. // #ifdef MP-WEIXIN
  785. deviceInfo.originalStreamUrl = res.data.data.hls || deviceInfo.originalStreamUrl
  786. // #endif
  787. // #ifdef APP-PLUS || APP-HARMONY
  788. deviceInfo.originalStreamUrl = res.data.data.fmp4 || deviceInfo.originalStreamUrl
  789. // #endif
  790. }).catch(err => {
  791. console.error('播放开始失败:', err)
  792. })
  793. } else {
  794. uni.showToast({
  795. title: '获取通道列表失败: ' + res.data.message,
  796. icon: 'none'
  797. })
  798. return
  799. }
  800. })
  801. .catch(err => {
  802. console.error('获取通道列表错误:', err)
  803. })
  804. }
  805. const loadData = async (batchId) => {
  806. loading.value = true
  807. try {
  808. // 调用接口
  809. const res = await getTraceDetail(batchId)
  810. traceInfo.value = res.data.data
  811. console.log('接口返回数据:', res)
  812. } catch (error) {
  813. console.error('加载失败', error)
  814. // 错误提示已在拦截器中自动处理
  815. } finally {
  816. // 无论成功失败都关闭 loading
  817. loading.value = false
  818. }
  819. }
  820. // 视频播放错误处理
  821. const onVideoError = (e) => {
  822. console.error('视频播放错误:', e)
  823. let errorMsg = '视频加载失败'
  824. // 微信小程序video组件错误码
  825. if (e && e.detail) {
  826. const errCode = e.detail.errCode
  827. switch(errCode) {
  828. case 10001:
  829. errorMsg = '网络错误,请检查网络连接'
  830. break
  831. case 10002:
  832. errorMsg = '视频格式不支持'
  833. break
  834. case 10003:
  835. errorMsg = '视频解码失败'
  836. break
  837. case 10004:
  838. errorMsg = '视频地址无效'
  839. break
  840. default:
  841. errorMsg = `播放失败(错误码:${errCode})`
  842. }
  843. console.error('视频错误详情:', e.detail)
  844. }
  845. uni.showToast({
  846. title: errorMsg,
  847. icon: 'none',
  848. duration: 3000
  849. })
  850. isPlaying.value = false
  851. // #ifdef H5
  852. setTimeout(() => {
  853. if (isPlaying.value && jessibucaRef.value) {
  854. console.log('尝试重新加载视频流')
  855. if (deviceInfo.originalStreamUrl !== config.streamServer.wsFlvServer) {
  856. deviceInfo.streamUrl = config.streamServer.wsFlvServer
  857. }
  858. }
  859. }, 3000)
  860. // #endif
  861. }
  862. // 更新时间
  863. const startTimeUpdate = () => {
  864. setInterval(() => {
  865. const now = new Date()
  866. const hours = String(now.getHours()).padStart(2, '0')
  867. const minutes = String(now.getMinutes()).padStart(2, '0')
  868. const seconds = String(now.getSeconds()).padStart(2, '0')
  869. currentTime.value = `${hours}:${minutes}:${seconds}`
  870. }, 1000)
  871. }
  872. // 播放/暂停切换
  873. const togglePlayState = () => {
  874. if (!isPlaying.value) {
  875. isPlaying.value = true
  876. // #ifdef MP-WEIXIN
  877. setTimeout(() => {
  878. if (livePlayerContext.value) {
  879. livePlayerContext.value.play()
  880. console.log('微信小程序开始播放')
  881. }
  882. }, 300)
  883. // #endif
  884. // #ifdef APP-PLUS || APP-HARMONY
  885. setTimeout(() => {
  886. if (appLivePlayerContext.value) {
  887. appLivePlayerContext.value.play()
  888. console.log('App开始播放')
  889. }
  890. }, 300)
  891. // #endif
  892. // #ifdef H5
  893. setTimeout(() => {
  894. playStart(deviceInfo.deviceId, deviceInfo.channelId).then(res => {
  895. if (res.data.code !== 0) {
  896. console.error('播放开始失败:', res.message)
  897. uni.showToast({
  898. title: '播放失败: ' + res.message,
  899. icon: 'none'
  900. })
  901. return
  902. }
  903. console.log('播放开始:', res)
  904. // 使用 wss_flv 并替换域名和端口
  905. let streamUrl = res.data.data.wss_flv
  906. if (streamUrl) {
  907. const urlObj = new URL(streamUrl)
  908. urlObj.hostname = 'nxy.gbdfarm.com'
  909. urlObj.port = '9000'
  910. deviceInfo.originalStreamUrl = urlObj.toString()
  911. console.log("togglePlayState - deviceInfo.originalStreamUrl", deviceInfo.originalStreamUrl)
  912. }
  913. }).catch(err => {
  914. console.error('播放开始失败:', err)
  915. })
  916. uni.vibrateShort()
  917. }, 300)
  918. // #endif
  919. } else {
  920. // #ifdef H5
  921. if (jessibucaRef.value) {
  922. jessibucaRef.value.pause()
  923. }
  924. // #endif
  925. // #ifdef MP-WEIXIN
  926. if (livePlayerContext.value) {
  927. livePlayerContext.value.pause()
  928. }
  929. // #endif
  930. // #ifdef APP-PLUS || APP-HARMONY
  931. if (appLivePlayerContext.value) {
  932. appLivePlayerContext.value.pause()
  933. }
  934. // #endif
  935. isPlaying.value = false
  936. uni.showToast({
  937. title: '视频已暂停',
  938. icon: 'none',
  939. duration: 1500
  940. })
  941. }
  942. }
  943. // 静音切换
  944. const toggleMute = () => {
  945. isMuted.value = !isMuted.value
  946. // #ifdef H5
  947. if (jessibucaRef.value) {
  948. if (isMuted.value) {
  949. jessibucaRef.value.mute()
  950. } else {
  951. jessibucaRef.value.cancelMute()
  952. }
  953. }
  954. // #endif
  955. // #ifndef H5
  956. // App端的静音通过 live-player 的 muted 属性控制,会自动响应
  957. uni.showToast({
  958. title: isMuted.value ? '已静音' : '已取消静音',
  959. icon: 'none'
  960. })
  961. // #endif
  962. }
  963. // 全屏切换
  964. const toggleFullscreen = () => {
  965. if (!isPlaying.value) {
  966. togglePlayState()
  967. setTimeout(() => {
  968. setFullscreen(true)
  969. }, 500)
  970. } else {
  971. setFullscreen(!isFullscreen.value)
  972. }
  973. }
  974. // 设置全屏状态
  975. const setFullscreen = (fullscreen) => {
  976. isFullscreen.value = fullscreen
  977. // #ifdef H5
  978. if (isFullscreen.value) {
  979. const ua = navigator.userAgent.toLowerCase()
  980. const isMobile = /mobile|android|iphone|ipad/.test(ua)
  981. if (isMobile && jessibucaRef.value) {
  982. jessibucaRef.value.fullscreenSwich()
  983. } else {
  984. setTimeout(() => {
  985. if (jessibucaRef.value) {
  986. jessibucaRef.value.resize()
  987. }
  988. }, 300)
  989. }
  990. if (window.screen && window.screen.orientation && window.screen.orientation.lock) {
  991. window.screen.orientation.lock('landscape').catch(err => {
  992. console.error('无法锁定屏幕方向:', err)
  993. })
  994. }
  995. } else {
  996. if (jessibucaRef.value) {
  997. if (jessibucaRef.value.isFullscreen()) {
  998. jessibucaRef.value.fullscreenSwich()
  999. }
  1000. setTimeout(() => {
  1001. if (jessibucaRef.value) {
  1002. jessibucaRef.value.resize()
  1003. }
  1004. }, 300)
  1005. }
  1006. if (window.screen && window.screen.orientation && window.screen.orientation.unlock) {
  1007. window.screen.orientation.unlock()
  1008. }
  1009. }
  1010. // #endif
  1011. // #ifdef MP-WEIXIN
  1012. if (livePlayerContext.value) {
  1013. if (isFullscreen.value) {
  1014. livePlayerContext.value.requestFullScreen({
  1015. direction: 90
  1016. })
  1017. } else {
  1018. livePlayerContext.value.exitFullScreen()
  1019. }
  1020. }
  1021. // #endif
  1022. // #ifdef APP-PLUS || APP-HARMONY
  1023. if (appLivePlayerContext.value) {
  1024. if (isFullscreen.value) {
  1025. appLivePlayerContext.value.requestFullScreen({
  1026. direction: 90
  1027. })
  1028. } else {
  1029. appLivePlayerContext.value.exitFullScreen()
  1030. }
  1031. }
  1032. // #endif
  1033. }
  1034. // 截图
  1035. const takeScreenshot = () => {
  1036. // #ifdef H5
  1037. if (jessibucaRef.value && isPlaying.value) {
  1038. jessibucaRef.value.screenshot()
  1039. uni.showToast({
  1040. title: '截图已保存',
  1041. icon: 'success'
  1042. })
  1043. } else {
  1044. uni.showToast({
  1045. title: '请先播放视频',
  1046. icon: 'none'
  1047. })
  1048. }
  1049. // #endif
  1050. // if (livePlayerContext.value && isPlaying.value) {
  1051. // livePlayerContext.value.snapshot({
  1052. // success: (res) => {
  1053. // console.log('截图成功:', res.tempImagePath)
  1054. // uni.saveImageToPhotosAlbum({
  1055. // filePath: res.tempImagePath,
  1056. // success: () => {
  1057. // uni.showToast({
  1058. // title: '截图已保存到相册',
  1059. // icon: 'success'
  1060. // })
  1061. // },
  1062. // fail: (err) => {
  1063. // console.error('保存截图失败:', err)
  1064. // uni.showToast({
  1065. // title: '保存截图失败',
  1066. // icon: 'none'
  1067. // })
  1068. // }
  1069. // })
  1070. // },
  1071. // fail: (err) => {
  1072. // console.error('截图失败:', err)
  1073. // uni.showToast({
  1074. // title: '截图失败',
  1075. // icon: 'none'
  1076. // })
  1077. // }
  1078. // })
  1079. // } else {
  1080. // uni.showToast({
  1081. // title: '请先播放视频',
  1082. // icon: 'none'
  1083. // })
  1084. // }
  1085. // #ifndef H5
  1086. if (appLivePlayerContext.value && isPlaying.value) {
  1087. appLivePlayerContext.value.snapshot({
  1088. success: (res) => {
  1089. console.log('App截图成功:', res.tempImagePath)
  1090. uni.saveImageToPhotosAlbum({
  1091. filePath: res.tempImagePath,
  1092. success: () => {
  1093. uni.showToast({
  1094. title: '截图已保存到相册',
  1095. icon: 'success'
  1096. })
  1097. },
  1098. fail: (err) => {
  1099. console.error('App保存截图失败:', err)
  1100. uni.showToast({
  1101. title: '保存截图失败',
  1102. icon: 'none'
  1103. })
  1104. }
  1105. })
  1106. },
  1107. fail: (err) => {
  1108. console.error('App截图失败:', err)
  1109. uni.showToast({
  1110. title: '截图失败',
  1111. icon: 'none'
  1112. })
  1113. }
  1114. })
  1115. } else {
  1116. uni.showToast({
  1117. title: '请先播放视频',
  1118. icon: 'none'
  1119. })
  1120. }
  1121. // #endif
  1122. }
  1123. // 小程序播放器状态变化处理
  1124. const onVideoPlay = () => {
  1125. console.log('视频开始播放')
  1126. isPlaying.value = true
  1127. }
  1128. const onVideoPause = () => {
  1129. console.log('视频暂停')
  1130. }
  1131. const onVideoEnded = () => {
  1132. console.log('视频播放结束')
  1133. isPlaying.value = false
  1134. }
  1135. const onTimeUpdate = (e) => {
  1136. // 更新播放时间
  1137. if (e && e.detail) {
  1138. const currentSeconds = Math.floor(e.detail.currentTime)
  1139. const hours = String(Math.floor(currentSeconds / 3600)).padStart(2, '0')
  1140. const minutes = String(Math.floor((currentSeconds % 3600) / 60)).padStart(2, '0')
  1141. const seconds = String(currentSeconds % 60).padStart(2, '0')
  1142. currentTime.value = `${hours}:${minutes}:${seconds}`
  1143. }
  1144. }
  1145. const onStateChange = (e) => {
  1146. console.log('播放器状态变化:', e.detail)
  1147. const state = e.detail.code
  1148. switch (state) {
  1149. case 2001:
  1150. console.log('已连接服务器')
  1151. break
  1152. case 2002:
  1153. console.log('开始拉流')
  1154. break
  1155. case 2003:
  1156. console.log('网络接收到首个视频帧')
  1157. break
  1158. case 2004:
  1159. console.log('视频播放开始')
  1160. break
  1161. case 2005:
  1162. console.log('视频播放进度')
  1163. break
  1164. case 2006:
  1165. console.log('视频播放结束')
  1166. isPlaying.value = false
  1167. break
  1168. case 2007:
  1169. console.log('视频播放Loading')
  1170. break
  1171. case 2008:
  1172. console.log('解码器启动')
  1173. break
  1174. case 2009:
  1175. console.log('视频分辨率改变')
  1176. break
  1177. case -2301:
  1178. console.error('网络断连,且重新连接亦不能恢复,播放器已停止')
  1179. isPlaying.value = false
  1180. uni.showToast({
  1181. title: '网络断连,请重试',
  1182. icon: 'none'
  1183. })
  1184. break
  1185. case -2302:
  1186. console.error('获取加速拉流地址失败')
  1187. break
  1188. case 2101:
  1189. console.error('当前视频帧解码失败')
  1190. break
  1191. case 2102:
  1192. console.error('当前音频帧解码失败')
  1193. break
  1194. case 2103:
  1195. console.warn('网络断连, 已启动自动重连')
  1196. break
  1197. case 2104:
  1198. console.warn('网络断连, 重连中...')
  1199. break
  1200. case 2105:
  1201. console.log('网络断连, 重连成功')
  1202. break
  1203. case 2106:
  1204. console.error('网络断连, 重连失败')
  1205. break
  1206. case 2107:
  1207. console.error('播放器连接超时')
  1208. break
  1209. case 2108:
  1210. console.error('获取点播文件信息失败')
  1211. break
  1212. default:
  1213. console.log('其他状态:', state)
  1214. }
  1215. }
  1216. // 小程序全屏状态变化
  1217. const onFullscreenChange = (e) => {
  1218. isFullscreen.value = e.detail.fullScreen
  1219. console.log('全屏状态变化:', isFullscreen.value)
  1220. }
  1221. // 获取App(安卓/鸿蒙)环境使用的流地址
  1222. const getAppStreamUrl = computed(() => {
  1223. // 优先使用 fmp4 格式(微信小程序和App都支持)
  1224. if (deviceInfo.originalStreamUrl) {
  1225. console.log("当前视频流地址:", deviceInfo.originalStreamUrl)
  1226. return deviceInfo.originalStreamUrl
  1227. }
  1228. // 如果没有流地址,返回空字符串
  1229. console.warn('未获取到视频流地址')
  1230. return ''
  1231. })
  1232. const traceDetail = computed(() => {
  1233. // 如果没有真实数据,返回 mock 数据
  1234. if (!traceInfo.value) {
  1235. return MOCK_TRACE_DETAILS[mockStateKey.value] || MOCK_TRACE_DETAILS.normal
  1236. }
  1237. const data = traceInfo.value
  1238. // 解析 certFiles 和 reportFiles(JSON 字符串转数组)
  1239. let certFiles = []
  1240. let reportFiles = []
  1241. try {
  1242. if (data.certificate?.certFiles) {
  1243. certFiles = JSON.parse(data.certificate.certFiles)
  1244. }
  1245. } catch (e) {
  1246. console.error('解析 certFiles 失败', e)
  1247. }
  1248. // 构建返回数据结构
  1249. return {
  1250. product: {
  1251. name: data.productName || '',
  1252. spec: data.productSpec || '',
  1253. image: data.productImage || '',
  1254. intro: data.productDesc || ''
  1255. },
  1256. farm: {
  1257. name: data.farmName || '',
  1258. location: data.farmRegion || '',
  1259. image: data.farmImage || '',
  1260. intro: data.farmIntro || ''
  1261. },
  1262. batch: {
  1263. exists: data.status === '2', // status 为 '2' 表示批次正常,已上线
  1264. statusBadge: data.status === '2'
  1265. ? { text: '检验合格', type: 'ok' }
  1266. : { text: '批次不存在', type: 'muted' },
  1267. no: data.batchNo || '',
  1268. harvestTime: data.produceDate || '',
  1269. packTime: data.packageDate || '',
  1270. emptyMessage: data.status !== '2' ? '未找到对应溯源批次信息。请确认二维码是否为佳友厚苑正品批次。' : ''
  1271. },
  1272. report: {
  1273. status: data.reports && data.reports.length > 0 ? 'uploaded' : 'pending',
  1274. statusBadge: data.reports && data.reports.length > 0
  1275. ? { text: '已上传', type: 'ok' }
  1276. : { text: '待补充', type: 'wait' },
  1277. emptyMessage: '检测报告待补充,上传完成后可查看大图。',
  1278. items: (data.reports || []).map(report => {
  1279. let images = []
  1280. // 处理 reportFiles:可能是字符串 URL、JSON 字符串数组、或已解析的数组
  1281. if (report.reportFiles) {
  1282. if (typeof report.reportFiles === 'string') {
  1283. // 尝试解析 JSON 字符串
  1284. try {
  1285. const parsed = JSON.parse(report.reportFiles)
  1286. // 如果解析成功且是数组,提取 url 字段
  1287. if (Array.isArray(parsed)) {
  1288. images = parsed.map(item =>
  1289. typeof item === 'string' ? item : (item.url || item)
  1290. ).filter(Boolean)
  1291. } else {
  1292. // 解析后不是数组,可能是单个对象
  1293. images = [parsed.url || parsed].filter(Boolean)
  1294. }
  1295. } catch (e) {
  1296. // 解析失败,当作普通 URL 字符串处理
  1297. images = [report.reportFiles]
  1298. }
  1299. } else if (Array.isArray(report.reportFiles)) {
  1300. // 已经是数组,提取 url 字段
  1301. images = report.reportFiles.map(item =>
  1302. typeof item === 'string' ? item : (item.url || item)
  1303. ).filter(Boolean)
  1304. } else if (typeof report.reportFiles === 'object') {
  1305. // 单个对象
  1306. images = [report.reportFiles.url || report.reportFiles].filter(Boolean)
  1307. }
  1308. }
  1309. return {
  1310. detectDate: report.reportDate || '',
  1311. no: report.reportNo || '',
  1312. images: images
  1313. }
  1314. })
  1315. },
  1316. certificate: {
  1317. status: data.certificate && certFiles.length > 0 ? 'uploaded' : 'pending',
  1318. statusBadge: data.certificate && certFiles.length > 0
  1319. ? { text: '已上传', type: 'ok' }
  1320. : { text: '待补充', type: 'wait' },
  1321. issueDate: data.certificate?.certIssueDate || '',
  1322. no: data.certificate?.certNo || '',
  1323. fileUrl: certFiles.length > 0 ? certFiles[0].url : '',
  1324. images: certFiles.map(f => f.url),
  1325. emptyMessage: '合格证待补充,上传完成后可查看大图。'
  1326. },
  1327. traceConclusionCard: {
  1328. title: '溯源结论',
  1329. conclusion: '本批次产品来源清晰,已完成安全检测,过程可查',
  1330. desc: '检测材料与溯源数据已展示,可继续查看',
  1331. passed: true
  1332. },
  1333. // 时间轴逻辑:演示态使用 mock + 真实态使用真实数据
  1334. farmTimeline: (() => {
  1335. // 判断是否有真实时间轴数据
  1336. const hasRealTimeline = Array.isArray(data.farmTimeline) && data.farmTimeline.length > 0
  1337. let timeline = []
  1338. if (!hasRealTimeline) {
  1339. // 演示态:使用完整 mock 时间轴(用于页面展示验证)
  1340. timeline = [
  1341. { time: '2026-03-01', stage: 'planting', title: '开始种植', desc: '本批次产品进入种植管理阶段' },
  1342. { time: '2026-03-12', stage: 'care', title: '生长期养护', desc: '已完成灌溉、营养管理等日常养护' },
  1343. { time: '2026-03-20', stage: 'inspection', title: '田间巡检', desc: '已完成长势检查与种植环境巡检' },
  1344. { time: data.produceDate || '', stage: 'harvest', title: '成熟采收', desc: '本批次产品进入成熟采收阶段' },
  1345. { time: (data.reports?.[0]?.reportDate) || '', stage: 'test', title: '安全检测', desc: '已完成安全检测,相关结果可查' },
  1346. { time: data.packageDate || '', stage: 'pack', title: '包装出库', desc: '已完成包装整理,进入销售流通环节' }
  1347. ]
  1348. } else {
  1349. // 真实态:使用真实数据 + 补充系统节点
  1350. timeline = [...data.farmTimeline]
  1351. const stageSet = new Set(timeline.map(n => n.stage))
  1352. // 成熟采收
  1353. if (data.produceDate && !stageSet.has('harvest')) {
  1354. timeline.push({
  1355. time: data.produceDate,
  1356. stage: 'harvest',
  1357. title: '成熟采收',
  1358. desc: '本批次产品进入成熟采收阶段'
  1359. })
  1360. }
  1361. // 安全检测
  1362. if (data.reports && data.reports.length > 0 && !stageSet.has('test')) {
  1363. const validDates = data.reports
  1364. .map(r => r.reportDate)
  1365. .filter(d => d && /^\d{4}-\d{2}-\d{2}/.test(d))
  1366. .sort()
  1367. if (validDates.length > 0) {
  1368. timeline.push({
  1369. time: validDates[0],
  1370. stage: 'test',
  1371. title: '安全检测',
  1372. desc: '已完成安全检测,相关结果可查'
  1373. })
  1374. }
  1375. }
  1376. // 包装出库
  1377. if (data.packageDate && !stageSet.has('pack')) {
  1378. timeline.push({
  1379. time: data.packageDate,
  1380. stage: 'pack',
  1381. title: '包装出库',
  1382. desc: '已完成包装整理,进入销售流通环节'
  1383. })
  1384. }
  1385. }
  1386. // stage 顺序权重
  1387. const stageOrder = {
  1388. planting: 1,
  1389. care: 2,
  1390. inspection: 3,
  1391. harvest: 4,
  1392. test: 5,
  1393. pack: 6
  1394. }
  1395. // 按业务阶段排序,同 stage 内再按时间
  1396. timeline.sort((a, b) => {
  1397. const orderA = stageOrder[a.stage] || 99
  1398. const orderB = stageOrder[b.stage] || 99
  1399. // 先按 stage 排序
  1400. if (orderA !== orderB) {
  1401. return orderA - orderB
  1402. }
  1403. // 同 stage 再按时间
  1404. if (!a.time) return -1
  1405. if (!b.time) return 1
  1406. return a.time > b.time ? 1 : -1
  1407. })
  1408. return timeline.slice(0, 6)
  1409. })(),
  1410. camera: {
  1411. liveUrl: data.camera?.liveUrl || '',
  1412. coverImage: data.camera?.coverImage || '',
  1413. status: data.camera?.status || 'online',
  1414. desc: data.camera?.liveUrl
  1415. ? '当前为种植现场实时画面,现场环境与种植状态可见'
  1416. : '来自农场实景画面,种植环境真实呈现'
  1417. }
  1418. }
  1419. })
  1420. // 种植现场状态:三态逻辑
  1421. const cameraStatus = computed(() => {
  1422. const camera = deviceInfo?.status
  1423. if (!camera) return 'off'
  1424. // const hasLiveUrl = !!camera.liveUrl
  1425. // 有 liveUrl 但无封面图 → loading(信号接入中)
  1426. // 有 liveUrl 且有封面图 → online(可播放)
  1427. // 无 liveUrl → offline
  1428. if (camera && camera == 'off') {
  1429. return 'loading'
  1430. }
  1431. if (camera && camera == 'ON') {
  1432. return 'online'
  1433. }
  1434. return 'offline'
  1435. })
  1436. const cameraStatusText = computed(() => {
  1437. const map = {
  1438. loading: '连接中',
  1439. online: '实时在线',
  1440. offline: '暂未连接'
  1441. }
  1442. return map[cameraStatus.value] || '暂未连接'
  1443. })
  1444. const reportImages = computed(() => {
  1445. const items = traceDetail.value?.report?.items
  1446. if (Array.isArray(items)) {
  1447. return items.flatMap(item => Array.isArray(item.images) ? item.images : [])
  1448. }
  1449. return []
  1450. })
  1451. const reportItems = computed(() => {
  1452. return traceDetail.value?.report?.items || []
  1453. })
  1454. // 计算某份报告内某张图在全局 reportImages 扁平数组中的索引
  1455. function getReportGlobalIndex(itemIndex, imgIndex) {
  1456. const items = reportItems.value
  1457. let offset = 0
  1458. for (let i = 0; i < itemIndex; i++) {
  1459. const imgArr = items[i]?.images
  1460. offset += Array.isArray(imgArr) ? imgArr.length : 0
  1461. }
  1462. return offset + imgIndex
  1463. }
  1464. const certificateImages = computed(() => {
  1465. const c = traceDetail.value?.certificate
  1466. if (!c) return []
  1467. if (Array.isArray(c.images) && c.images.length) return c.images
  1468. return c.fileUrl ? [c.fileUrl] : []
  1469. })
  1470. function contactCustomer() {
  1471. uni.makePhoneCall({
  1472. phoneNumber: '13379508760'
  1473. })
  1474. }
  1475. function goBackToPurchase() {
  1476. uni.showModal({
  1477. title: '返回购买渠道',
  1478. content: 'mock 模式:后续可跳转到直播间/小店页面。',
  1479. showCancel: true,
  1480. confirmText: '确认返回'
  1481. })
  1482. }
  1483. function previewDoc(kind, index) {
  1484. const urls = kind === 'report' ? reportImages.value : certificateImages.value
  1485. if (!urls.length) {
  1486. uni.showToast({ title: '该文件暂未上传', icon: 'none' })
  1487. return
  1488. }
  1489. uni.previewImage({
  1490. urls,
  1491. current: urls[index] || urls[0]
  1492. })
  1493. }
  1494. </script>
  1495. <style scoped>
  1496. .page {
  1497. position: relative;
  1498. min-height: 100vh;
  1499. --bg-cream-1: #f8f2e8;
  1500. --bg-cream-2: #f3ebdd;
  1501. --bg-cream-3: #ece1ce;
  1502. --forest-900: #143a2b;
  1503. --forest-800: #1f513b;
  1504. --forest-700: #2d6849;
  1505. --sage-500: #708f7d;
  1506. --gold-320: #ccb086;
  1507. --gold-260: #dcc4a0;
  1508. --text-900: #233126;
  1509. --text-700: #3c4d41;
  1510. --text-500: #6b776d;
  1511. background: linear-gradient(172deg,
  1512. #FAF6EF 0%,
  1513. #F4EEE3 38%,
  1514. #EDF0EC 68%,
  1515. #E8EFE9 100%
  1516. );
  1517. overflow: hidden;
  1518. }
  1519. /* 背景氛围层:三层光感(前景/中景/背景)+ grain */
  1520. .pageDecor {
  1521. position: fixed;
  1522. inset: 0;
  1523. pointer-events: none;
  1524. z-index: 0;
  1525. }
  1526. .pageGlow {
  1527. position: absolute;
  1528. border-radius: 50%;
  1529. filter: blur(14rpx);
  1530. }
  1531. /* 背景层:左上森林绿微光 */
  1532. .glowA {
  1533. width: 780rpx;
  1534. height: 780rpx;
  1535. top: -280rpx;
  1536. left: -300rpx;
  1537. background: radial-gradient(circle, rgba(26, 84, 58, 0.18) 0%, rgba(20, 72, 50, 0) 70%);
  1538. opacity: 0.85;
  1539. }
  1540. /* 中景层:右下金色暖光 */
  1541. .glowB {
  1542. width: 720rpx;
  1543. height: 720rpx;
  1544. right: -280rpx;
  1545. top: 480rpx;
  1546. background: radial-gradient(circle, rgba(200, 170, 120, 0.2) 0%, rgba(200, 170, 120, 0) 72%);
  1547. opacity: 0.9;
  1548. }
  1549. /* 前景层:顶部柔和高光,塑造空间感 */
  1550. .glowC {
  1551. width: 600rpx;
  1552. height: 360rpx;
  1553. top: -60rpx;
  1554. left: 50%;
  1555. transform: translateX(-50%);
  1556. background: radial-gradient(ellipse at 50% 0%, rgba(255, 252, 246, 0.38), transparent 70%);
  1557. filter: blur(20rpx);
  1558. opacity: 0.7;
  1559. }
  1560. /* 纹理叠加层 */
  1561. .pageGrain {
  1562. position: absolute;
  1563. inset: 0;
  1564. opacity: 0.55;
  1565. background:
  1566. radial-gradient(900rpx 380rpx at 48% -4%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0)),
  1567. radial-gradient(640rpx 400rpx at 104% 48%, rgba(68, 112, 86, 0.09), rgba(68, 112, 86, 0)),
  1568. radial-gradient(700rpx 320rpx at -4% 76%, rgba(210, 180, 130, 0.12), rgba(210, 180, 130, 0)),
  1569. linear-gradient(180deg, rgba(248, 244, 236, 0.16) 0%, rgba(228, 242, 232, 0.08) 100%);
  1570. }
  1571. .safeTop {
  1572. height: calc(env(safe-area-inset-top));
  1573. position: relative;
  1574. z-index: 1;
  1575. }
  1576. /* 轻品牌页头:透明底,不叠在 Hero 上产生「白雾」;层级低于首屏卡 */
  1577. .brandPageHeader {
  1578. position: relative;
  1579. z-index: 2;
  1580. display: flex;
  1581. align-items: center;
  1582. min-height: 72rpx;
  1583. padding: 0 40rpx;
  1584. box-sizing: border-box;
  1585. border-bottom: 1rpx solid rgba(39, 75, 57, 0.05);
  1586. background: transparent;
  1587. }
  1588. .brandPageHeaderInner {
  1589. display: flex;
  1590. align-items: center;
  1591. gap: 10rpx;
  1592. width: 100%;
  1593. }
  1594. .brandPageHeaderName {
  1595. font-size: 22rpx;
  1596. font-weight: 600;
  1597. line-height: 1.15;
  1598. letter-spacing: 0.1em;
  1599. color: rgba(27, 41, 33, 0.65);
  1600. }
  1601. .brandPageHeaderDot {
  1602. flex-shrink: 0;
  1603. width: 4rpx;
  1604. height: 4rpx;
  1605. border-radius: 50%;
  1606. background: rgba(39, 113, 76, 0.4);
  1607. }
  1608. .brandPageHeaderLabel {
  1609. font-size: 20rpx;
  1610. font-weight: 400;
  1611. line-height: 1.15;
  1612. letter-spacing: 0.06em;
  1613. color: rgba(112, 143, 125, 0.7);
  1614. }
  1615. .hero,
  1616. .content {
  1617. position: relative;
  1618. z-index: 1;
  1619. }
  1620. .hero {
  1621. padding: 0 24rpx;
  1622. }
  1623. /* 完整首屏大卡:与品牌页头分离,避免负 margin 上提后被页头遮盖 */
  1624. .heroCard {
  1625. border-radius: 42rpx;
  1626. overflow: hidden;
  1627. margin-top: 20rpx;
  1628. position: relative;
  1629. z-index: 4;
  1630. box-shadow:
  1631. 0 48rpx 120rpx rgba(10, 36, 24, 0.2),
  1632. 0 16rpx 48rpx rgba(10, 36, 24, 0.1),
  1633. 0 2rpx 0 rgba(255, 255, 255, 0.6) inset;
  1634. backdrop-filter: blur(4px);
  1635. }
  1636. /* Hero 视觉区:多层次光感空间,顶部高光 + 景深 + 底部暗化 */
  1637. .heroBg {
  1638. position: relative;
  1639. width: 100%;
  1640. height: 0;
  1641. padding-bottom: 56.25%;
  1642. overflow: hidden;
  1643. background: linear-gradient(160deg, rgba(20, 74, 52, 0.72), rgba(205, 177, 129, 0.3) 70%, rgba(243, 232, 214, 0.36));
  1644. }
  1645. /* 前景层光晕:右下淡金色微光(提升质感) */
  1646. .heroBg::before {
  1647. content: '';
  1648. position: absolute;
  1649. right: -100rpx;
  1650. bottom: -72rpx;
  1651. width: 520rpx;
  1652. height: 280rpx;
  1653. border-radius: 50%;
  1654. background: radial-gradient(ellipse at 42% 38%, rgba(252, 244, 228, 0.18), transparent 68%);
  1655. pointer-events: none;
  1656. z-index: 2;
  1657. }
  1658. .heroImage {
  1659. position: absolute;
  1660. inset: 0;
  1661. width: 100%;
  1662. height: 100%;
  1663. display: block;
  1664. z-index: 1;
  1665. }
  1666. .heroBrandAnchor {
  1667. position: absolute;
  1668. right: -48rpx;
  1669. bottom: -14rpx;
  1670. z-index: 2;
  1671. pointer-events: none;
  1672. }
  1673. .heroBrandAnchorText {
  1674. font-size: 164rpx;
  1675. font-weight: 760;
  1676. letter-spacing: 0.1em;
  1677. line-height: 1;
  1678. color: rgba(248, 241, 227, 0.045);
  1679. transform: rotate(-8deg);
  1680. }
  1681. /* Hero 遮罩层:提亮后仍保留轻微底部过渡,避免压住真实商品图 */
  1682. .heroMask {
  1683. position: absolute;
  1684. inset: 0;
  1685. z-index: 3;
  1686. background:
  1687. radial-gradient(ellipse 180% 60% at 50% 0%, rgba(255, 252, 248, 0.26), transparent 68%),
  1688. radial-gradient(480rpx 240rpx at 90% 8%, rgba(252, 248, 240, 0.2), transparent 62%),
  1689. radial-gradient(700rpx 360rpx at 8% 65%, rgba(6, 24, 16, 0.12), transparent 58%),
  1690. radial-gradient(560rpx 300rpx at 88% 80%, rgba(205, 177, 129, 0.06), transparent 62%),
  1691. linear-gradient(180deg,
  1692. rgba(8, 28, 18, 0) 0%,
  1693. rgba(8, 28, 18, 0) 62%,
  1694. rgba(10, 36, 24, 0.05) 80%,
  1695. rgba(8, 26, 18, 0.1) 92%,
  1696. rgba(248, 244, 238, 0.12) 100%
  1697. );
  1698. }
  1699. /* 商品信息面板:玻璃浮层效果,负margin上浮 + backdrop-filter */
  1700. .heroInfoPanel {
  1701. background: rgba(252, 248, 242, 0.88);
  1702. backdrop-filter: blur(14px);
  1703. -webkit-backdrop-filter: blur(14px);
  1704. position: relative;
  1705. }
  1706. /* 与 Hero 底部自然过渡 */
  1707. .heroInfoPanel::before {
  1708. content: '';
  1709. position: absolute;
  1710. top: -56rpx;
  1711. left: 0;
  1712. right: 0;
  1713. height: 56rpx;
  1714. background: linear-gradient(180deg,
  1715. rgba(252, 248, 242, 0) 0%,
  1716. rgba(252, 248, 242, 0.88) 100%
  1717. );
  1718. pointer-events: none;
  1719. z-index: 1;
  1720. }
  1721. .infoPanelInner {
  1722. position: relative;
  1723. z-index: 2;
  1724. padding: 32rpx 30rpx 30rpx;
  1725. }
  1726. /* 与下方农场/批次等卡片共用 .sectionHeader / .sectionHeaderLeft 样式 */
  1727. .infoPanelBody {
  1728. padding-top: 0;
  1729. }
  1730. .infoPanelName {
  1731. display: block;
  1732. font-size: 30rpx;
  1733. font-weight: 680;
  1734. line-height: 1.4;
  1735. letter-spacing: 0.01em;
  1736. color: rgba(27, 41, 33, 0.92);
  1737. }
  1738. .infoPanelSpec {
  1739. display: inline-flex;
  1740. align-items: center;
  1741. gap: 10rpx;
  1742. margin-top: 14rpx;
  1743. padding: 8rpx 16rpx;
  1744. border-radius: 20rpx;
  1745. background: rgba(39, 113, 76, 0.06);
  1746. border: 1rpx solid rgba(39, 113, 76, 0.08);
  1747. }
  1748. .specDot {
  1749. width: 6rpx;
  1750. height: 6rpx;
  1751. border-radius: 50%;
  1752. background: rgba(39, 113, 76, 0.5);
  1753. }
  1754. .specText {
  1755. font-size: 20rpx;
  1756. font-weight: 500;
  1757. color: rgba(54, 66, 57, 0.85);
  1758. }
  1759. .infoPanelIntro {
  1760. margin-top: 16rpx;
  1761. padding-top: 16rpx;
  1762. border-top: 1rpx solid rgba(39, 75, 57, 0.06);
  1763. font-size: 23rpx;
  1764. line-height: 1.8;
  1765. color: rgba(54, 66, 57, 0.75);
  1766. }
  1767. .content {
  1768. padding: 20rpx 0 40rpx;
  1769. }
  1770. /* 基础卡片:半透明玻璃质感 */
  1771. .card {
  1772. margin: 0 24rpx 22rpx;
  1773. padding: 30rpx 28rpx;
  1774. border-radius: 36rpx;
  1775. background: rgba(252, 250, 244, 0.76);
  1776. box-shadow:
  1777. 0 16rpx 40rpx rgba(38, 41, 32, 0.07),
  1778. 0 1rpx 0 rgba(255, 255, 255, 0.5) inset;
  1779. backdrop-filter: blur(8px);
  1780. -webkit-backdrop-filter: blur(8px);
  1781. }
  1782. .card.soft {
  1783. background: rgba(252, 248, 244, 0.6);
  1784. }
  1785. /* Hero 之后第一张卡:适度上浮 */
  1786. .cardHeroFirst {
  1787. margin-top: -28rpx;
  1788. position: relative;
  1789. z-index: 3;
  1790. }
  1791. /* 层级 0:与 Hero 同级,主卡(商品面板) */
  1792. .cardLevel0 {
  1793. box-shadow:
  1794. 0 48rpx 120rpx rgba(10, 36, 24, 0.16),
  1795. 0 16rpx 48rpx rgba(10, 36, 24, 0.08),
  1796. 0 1rpx 0 rgba(255, 255, 255, 0.6) inset;
  1797. }
  1798. /* 层级 1:次要信息卡,阴影中等 */
  1799. .cardLevel1 {
  1800. box-shadow:
  1801. 0 20rpx 50rpx rgba(30, 34, 24, 0.09),
  1802. 0 8rpx 24rpx rgba(30, 34, 24, 0.05),
  1803. 0 1rpx 0 rgba(255, 255, 255, 0.55) inset;
  1804. }
  1805. /* 层级 2:次次要信息卡,阴影更轻 */
  1806. .cardLevel2 {
  1807. box-shadow:
  1808. 0 14rpx 36rpx rgba(36, 38, 28, 0.065),
  1809. 0 1rpx 0 rgba(255, 255, 255, 0.5) inset;
  1810. }
  1811. /* 层级 3:底部辅助信息卡,最轻 */
  1812. .cardLevel3 {
  1813. box-shadow:
  1814. 0 8rpx 22rpx rgba(42, 44, 30, 0.04),
  1815. 0 1rpx 0 rgba(255, 255, 255, 0.44) inset;
  1816. }
  1817. .cardFarm {
  1818. background: rgba(250, 248, 242, 0.82);
  1819. }
  1820. .cardBatch {
  1821. background: rgba(251, 248, 242, 0.8);
  1822. }
  1823. .cardCredential {
  1824. background: rgba(252, 248, 240, 0.84);
  1825. }
  1826. .cardBatchState {
  1827. background: rgba(252, 248, 244, 0.74);
  1828. }
  1829. /* 检测结论卡:结论型卡片,比普通资料卡更有结论感 */
  1830. .cardConclusion {
  1831. background: rgba(252, 250, 244, 0.82);
  1832. }
  1833. .conclusionBody {
  1834. padding-top: 6rpx;
  1835. }
  1836. .conclusionLead {
  1837. display: block;
  1838. font-size: 32rpx;
  1839. font-weight: 680;
  1840. line-height: 1.5;
  1841. letter-spacing: 0.01em;
  1842. color: rgba(24, 38, 30, 0.96);
  1843. margin-bottom: 14rpx;
  1844. }
  1845. .conclusionDesc {
  1846. display: block;
  1847. font-size: 20rpx;
  1848. font-weight: 400;
  1849. line-height: 1.9;
  1850. color: rgba(84, 106, 93, 0.5);
  1851. }
  1852. /* 农事时间轴:关键种植过程 */
  1853. .cardTimeline {
  1854. background: rgba(252, 250, 244, 0.82);
  1855. }
  1856. .timelineList {
  1857. padding-top: 4rpx;
  1858. }
  1859. .timelineItem {
  1860. display: flex;
  1861. padding-bottom: 24rpx;
  1862. }
  1863. .timelineItem:last-child {
  1864. padding-bottom: 0;
  1865. }
  1866. .timelineLeft {
  1867. display: flex;
  1868. flex-direction: column;
  1869. align-items: center;
  1870. width: 40rpx;
  1871. flex-shrink: 0;
  1872. }
  1873. .timelineDot {
  1874. width: 12rpx;
  1875. height: 12rpx;
  1876. border-radius: 50%;
  1877. background: rgba(39, 113, 76, 0.5);
  1878. flex-shrink: 0;
  1879. }
  1880. .timelineLine {
  1881. width: 1rpx;
  1882. flex: 1;
  1883. background: rgba(39, 113, 76, 0.2);
  1884. margin-top: 8rpx;
  1885. }
  1886. .timelineRight {
  1887. flex: 1;
  1888. padding-left: 24rpx;
  1889. }
  1890. .timelineTime {
  1891. display: block;
  1892. font-size: 19rpx;
  1893. font-weight: 400;
  1894. color: rgba(84, 106, 93, 0.5);
  1895. margin-bottom: 6rpx;
  1896. letter-spacing: 0.02em;
  1897. }
  1898. .timelineTitle {
  1899. display: block;
  1900. font-size: 27rpx;
  1901. font-weight: 600;
  1902. color: rgba(27, 41, 33, 0.88);
  1903. margin-bottom: 6rpx;
  1904. line-height: 1.3;
  1905. }
  1906. .timelineDesc {
  1907. display: block;
  1908. font-size: 21rpx;
  1909. font-weight: 400;
  1910. line-height: 1.7;
  1911. color: rgba(84, 106, 93, 0.75);
  1912. }
  1913. /* 关键节点(安全检测):轻强调 */
  1914. .timelineItem.is-key .timelineDot {
  1915. background: rgba(39, 113, 76, 0.7);
  1916. }
  1917. .timelineItem.is-key .timelineTitle {
  1918. font-weight: 600;
  1919. color: rgba(27, 41, 33, 0.9);
  1920. }
  1921. /* 当前节点(包装出库):主高亮 */
  1922. .timelineItem.is-current .timelineDot {
  1923. background: #2f7d55;
  1924. box-shadow: 0 0 0 6rpx rgba(47, 125, 85, 0.12);
  1925. }
  1926. .timelineItem.is-current .timelineTitle {
  1927. font-weight: 700;
  1928. color: rgba(20, 60, 40, 0.95);
  1929. }
  1930. /* 底部可信来源说明 */
  1931. .timelineFootnote {
  1932. margin-top: 20rpx;
  1933. font-size: 20rpx;
  1934. color: rgba(84, 106, 93, 0.45);
  1935. line-height: 1.6;
  1936. }
  1937. /* 种植现场实时画面模块 */
  1938. .cardLive {
  1939. background: rgba(252, 250, 244, 0.82);
  1940. }
  1941. .liveMediaWrap {
  1942. position: relative;
  1943. width: 100%;
  1944. height: 380rpx;
  1945. border-radius: 20rpx;
  1946. overflow: hidden;
  1947. background: linear-gradient(
  1948. 160deg,
  1949. rgba(39, 113, 76, 0.04) 0%,
  1950. rgba(39, 113, 76, 0.015) 50%,
  1951. rgba(39, 113, 76, 0.05) 100%
  1952. );
  1953. border: 1rpx solid rgba(39, 75, 57, 0.08);
  1954. box-shadow: inset 0 2rpx 12rpx rgba(39, 113, 76, 0.04);
  1955. }
  1956. .liveCover {
  1957. width: 100%;
  1958. height: 100%;
  1959. }
  1960. .livePlaceholder {
  1961. width: 100%;
  1962. height: 100%;
  1963. display: flex;
  1964. flex-direction: column;
  1965. align-items: center;
  1966. justify-content: center;
  1967. background: transparent;
  1968. }
  1969. .livePlayIcon {
  1970. display: flex;
  1971. align-items: center;
  1972. gap: 8rpx;
  1973. margin-bottom: 20rpx;
  1974. }
  1975. .livePlayDot {
  1976. width: 8rpx;
  1977. height: 8rpx;
  1978. border-radius: 50%;
  1979. background: rgba(39, 113, 76, 0.35);
  1980. animation: livePulse 1.4s ease-in-out infinite;
  1981. }
  1982. .livePlayDot.dot2 {
  1983. animation-delay: 0.2s;
  1984. }
  1985. .livePlayDot.dot3 {
  1986. animation-delay: 0.4s;
  1987. }
  1988. @keyframes livePulse {
  1989. 0%, 100% {
  1990. opacity: 0.3;
  1991. transform: scale(0.8);
  1992. }
  1993. 50% {
  1994. opacity: 1;
  1995. transform: scale(1.1);
  1996. }
  1997. }
  1998. .livePlaceholderMain {
  1999. font-size: 26rpx;
  2000. font-weight: 500;
  2001. color: rgba(39, 113, 76, 0.5);
  2002. margin-bottom: 10rpx;
  2003. }
  2004. .livePlaceholderSub {
  2005. font-size: 20rpx;
  2006. color: rgba(84, 106, 93, 0.35);
  2007. }
  2008. .liveStatusPill {
  2009. position: absolute;
  2010. top: 20rpx;
  2011. right: 20rpx;
  2012. display: flex;
  2013. align-items: center;
  2014. gap: 8rpx;
  2015. padding: 8rpx 18rpx;
  2016. border-radius: 30rpx;
  2017. font-size: 20rpx;
  2018. font-weight: 600;
  2019. }
  2020. .liveStatusDot {
  2021. width: 10rpx;
  2022. height: 10rpx;
  2023. border-radius: 50%;
  2024. flex-shrink: 0;
  2025. }
  2026. .liveStatusPill.online {
  2027. background: rgba(47, 125, 85, 0.1);
  2028. color: #2f7d55;
  2029. }
  2030. .liveStatusPill.online .liveStatusDot {
  2031. background: #2f7d55;
  2032. animation: statusPulse 2s ease-in-out infinite;
  2033. }
  2034. @keyframes statusPulse {
  2035. 0%, 100% {
  2036. opacity: 1;
  2037. box-shadow: 0 0 0 0 rgba(47, 125, 85, 0.4);
  2038. }
  2039. 50% {
  2040. opacity: 0.7;
  2041. box-shadow: 0 0 0 4rpx rgba(47, 125, 85, 0);
  2042. }
  2043. }
  2044. .liveStatusPill.offline {
  2045. background: rgba(84, 106, 93, 0.08);
  2046. color: rgba(84, 106, 93, 0.55);
  2047. }
  2048. .liveStatusPill.offline .liveStatusDot {
  2049. background: rgba(84, 106, 93, 0.4);
  2050. }
  2051. .liveDesc {
  2052. margin-top: 16rpx;
  2053. font-size: 20rpx;
  2054. color: rgba(84, 106, 93, 0.5);
  2055. line-height: 1.6;
  2056. }
  2057. /* ================================================
  2058. 微动效:让页面"活起来"
  2059. ================================================ */
  2060. /* Hero 进入:上浮 + 淡入 */
  2061. @keyframes heroEnter {
  2062. 0% {
  2063. opacity: 0;
  2064. transform: translateY(28rpx);
  2065. }
  2066. 100% {
  2067. opacity: 1;
  2068. transform: translateY(0);
  2069. }
  2070. }
  2071. .heroCard {
  2072. animation: heroEnter 0.6s cubic-bezier(0.22, 0.78, 0.35, 1) both;
  2073. }
  2074. /* 卡片依次入场:延迟递增,制造节奏感 */
  2075. @keyframes cardEnter {
  2076. 0% {
  2077. opacity: 0;
  2078. transform: translateY(20rpx);
  2079. }
  2080. 100% {
  2081. opacity: 1;
  2082. transform: translateY(0);
  2083. }
  2084. }
  2085. /* 商品面板:稍晚于 Hero */
  2086. .heroInfoPanel {
  2087. animation: cardEnter 0.5s cubic-bezier(0.22, 0.78, 0.35, 1) 0.15s both;
  2088. }
  2089. /* 检测结论卡 */
  2090. .cardConclusion {
  2091. animation: cardEnter 0.5s cubic-bezier(0.22, 0.78, 0.35, 1) 0.2s both;
  2092. }
  2093. /* 农场卡 */
  2094. .cardFarm {
  2095. animation: cardEnter 0.5s cubic-bezier(0.22, 0.78, 0.35, 1) 0.25s both;
  2096. }
  2097. /* 批次卡 */
  2098. .cardBatch {
  2099. animation: cardEnter 0.5s cubic-bezier(0.22, 0.78, 0.35, 1) 0.35s both;
  2100. }
  2101. /* 凭证卡 */
  2102. .cardCredential {
  2103. animation: cardEnter 0.5s cubic-bezier(0.22, 0.78, 0.35, 1) 0.45s both;
  2104. }
  2105. /* ============================
  2106. 检测报告横向卡片列表
  2107. ============================ */
  2108. .reportCardList {
  2109. width: 100%;
  2110. overflow-x: auto;
  2111. overflow-y: hidden;
  2112. -webkit-overflow-scrolling: touch;
  2113. white-space: nowrap;
  2114. }
  2115. .reportCardList::-webkit-scrollbar {
  2116. display: none;
  2117. }
  2118. .reportCardTrack {
  2119. display: inline-flex;
  2120. flex-wrap: nowrap;
  2121. align-items: stretch;
  2122. gap: 16rpx;
  2123. padding: 6rpx 4rpx 10rpx;
  2124. /* 关键:让子项不受 flex 压缩,自然撑开形成横向溢出 */
  2125. width: max-content;
  2126. }
  2127. /* 单张报告卡片 */
  2128. .reportCard {
  2129. flex-shrink: 0;
  2130. width: 220rpx;
  2131. background: #FAFBF9;
  2132. border: 1rpx solid rgba(39, 75, 57, 0.09);
  2133. border-radius: 14rpx;
  2134. padding: 12rpx 12rpx 10rpx;
  2135. display: flex;
  2136. flex-direction: column;
  2137. align-items: stretch;
  2138. box-shadow: 0 2rpx 8rpx rgba(39, 75, 57, 0.04);
  2139. }
  2140. /* 缩略图(带页数角标覆盖层) */
  2141. .reportCardThumb {
  2142. position: relative;
  2143. width: 100%;
  2144. height: 196rpx;
  2145. background: rgba(39, 75, 57, 0.03);
  2146. border-radius: 10rpx;
  2147. overflow: hidden;
  2148. display: flex;
  2149. align-items: center;
  2150. justify-content: center;
  2151. margin-bottom: 10rpx;
  2152. }
  2153. .reportCardThumbImg {
  2154. width: 100%;
  2155. height: 100%;
  2156. }
  2157. .reportCardThumbEmpty {
  2158. width: 100%;
  2159. height: 100%;
  2160. display: flex;
  2161. align-items: center;
  2162. justify-content: center;
  2163. }
  2164. .reportCardThumbEmptyText {
  2165. font-size: 18rpx;
  2166. color: rgba(39, 75, 57, 0.3);
  2167. }
  2168. /* 页数角标:绝对定位在缩略图右下角 */
  2169. .reportCardPages {
  2170. position: absolute;
  2171. bottom: 8rpx;
  2172. right: 8rpx;
  2173. font-size: 15rpx;
  2174. color: rgba(39, 75, 57, 0.65);
  2175. background: rgba(250, 251, 249, 0.88);
  2176. border: 1rpx solid rgba(39, 75, 57, 0.1);
  2177. border-radius: 6rpx;
  2178. padding: 2rpx 8rpx;
  2179. line-height: 1.4;
  2180. }
  2181. /* 报告元信息 */
  2182. .reportCardMeta {
  2183. flex: 1;
  2184. margin-bottom: 6rpx;
  2185. }
  2186. .reportCardRow {
  2187. display: flex;
  2188. justify-content: space-between;
  2189. align-items: baseline;
  2190. gap: 4rpx;
  2191. margin-bottom: 4rpx;
  2192. }
  2193. .reportCardLabel {
  2194. font-size: 16rpx;
  2195. color: rgba(84, 106, 93, 0.6);
  2196. flex-shrink: 0;
  2197. }
  2198. .reportCardValue {
  2199. font-size: 16rpx;
  2200. color: rgba(68, 82, 72, 0.85);
  2201. font-weight: 460;
  2202. text-align: right;
  2203. word-break: break-all;
  2204. }
  2205. .reportCardValueNo {
  2206. font-size: 14rpx;
  2207. color: rgba(68, 82, 72, 0.72);
  2208. }
  2209. /* 点击提示 */
  2210. .reportCardHint {
  2211. font-size: 14rpx;
  2212. color: rgba(39, 75, 57, 0.3);
  2213. text-align: center;
  2214. margin-top: auto;
  2215. }
  2216. /* 底部辅助卡 */
  2217. .cardBatchState {
  2218. animation: cardEnter 0.5s cubic-bezier(0.22, 0.78, 0.35, 1) 0.55s both;
  2219. }
  2220. /* 卡片触摸反馈:阴影增强(模拟按压感) */
  2221. .card:active {
  2222. transition: box-shadow 0.15s ease, transform 0.15s ease;
  2223. }
  2224. /* 触摸时轻微缩小,增加真实感 */
  2225. .card:active:not(.heroInfoPanel) {
  2226. transform: scale(0.99);
  2227. }
  2228. .sectionHeader {
  2229. display: flex;
  2230. align-items: center;
  2231. justify-content: space-between;
  2232. gap: 18rpx;
  2233. margin-bottom: 20rpx;
  2234. }
  2235. .sectionHeaderLeft {
  2236. display: flex;
  2237. flex-direction: column;
  2238. gap: 10rpx;
  2239. position: relative;
  2240. padding-bottom: 8rpx;
  2241. }
  2242. .sectionHeaderLeft::after {
  2243. content: '';
  2244. position: absolute;
  2245. left: 0;
  2246. bottom: 0;
  2247. width: 78rpx;
  2248. height: 2rpx;
  2249. border-radius: 999rpx;
  2250. background: linear-gradient(90deg, rgba(46, 82, 63, 0.3), rgba(203, 176, 128, 0.26), rgba(46, 82, 63, 0));
  2251. pointer-events: none;
  2252. }
  2253. .sectionEn {
  2254. font-size: 15rpx;
  2255. font-weight: 500;
  2256. letter-spacing: 0.24em;
  2257. text-transform: uppercase;
  2258. color: rgba(84, 106, 93, 0.76);
  2259. }
  2260. .sectionTitle {
  2261. font-size: 27rpx;
  2262. font-weight: 620;
  2263. color: rgba(60, 72, 64, 0.72);
  2264. }
  2265. .statusBadge {
  2266. font-size: 18rpx;
  2267. font-weight: 620;
  2268. padding: 9rpx 15rpx;
  2269. border-radius: 999rpx;
  2270. white-space: nowrap;
  2271. border: 1rpx solid transparent;
  2272. box-shadow: 0 1rpx 0 rgba(255, 255, 255, 0.34) inset;
  2273. }
  2274. .statusBadge.ok {
  2275. color: #1d5d40;
  2276. background: rgba(39, 113, 76, 0.12);
  2277. border-color: rgba(39, 113, 76, 0.2);
  2278. }
  2279. .statusBadge.wait {
  2280. color: #715726;
  2281. background: rgba(203, 171, 112, 0.2);
  2282. border-color: rgba(203, 171, 112, 0.26);
  2283. }
  2284. .statusBadge.warning {
  2285. color: #8a5e22;
  2286. background: rgba(214, 174, 95, 0.22);
  2287. border-color: rgba(214, 174, 95, 0.28);
  2288. }
  2289. .statusBadge.muted {
  2290. color: #677069;
  2291. background: rgba(126, 137, 128, 0.14);
  2292. border-color: rgba(126, 137, 128, 0.2);
  2293. }
  2294. /* =============================================
  2295. 商品信息面板专用信任认证徽章:强化图标主视觉、文字辅助
  2296. ============================================= */
  2297. /* 整体:认证章风格,低饱和细边框,无交互感 */
  2298. .trustBadge {
  2299. display: inline-flex;
  2300. align-items: center;
  2301. gap: 7rpx;
  2302. padding: 9rpx 18rpx 9rpx 15rpx;
  2303. border-radius: 999rpx;
  2304. border: 1rpx solid rgba(39, 113, 76, 0.22);
  2305. background: rgba(39, 113, 76, 0.06);
  2306. box-shadow:
  2307. 0 2rpx 6rpx rgba(39, 113, 76, 0.06),
  2308. 0 1rpx 0 rgba(255, 255, 255, 0.55) inset;
  2309. white-space: nowrap;
  2310. cursor: default;
  2311. pointer-events: none;
  2312. user-select: none;
  2313. }
  2314. /* 双圆环认证图标:20×20 viewBox,图标为第一视觉焦点 */
  2315. .trustBadgeIcon {
  2316. width: 30rpx;
  2317. height: 30rpx;
  2318. flex-shrink: 0;
  2319. vertical-align: middle;
  2320. display: inline-block;
  2321. }
  2322. /* 文案:品牌深绿,字重略降,视觉权重低于图标 */
  2323. .trustBadgeText {
  2324. font-size: 18rpx;
  2325. font-weight: 500;
  2326. letter-spacing: 0.05em;
  2327. color: rgba(27, 71, 42, 0.68);
  2328. }
  2329. .kv {
  2330. display: flex;
  2331. flex-direction: column;
  2332. gap: 16rpx;
  2333. }
  2334. .kvRow {
  2335. display: flex;
  2336. align-items: baseline;
  2337. justify-content: space-between;
  2338. gap: 16rpx;
  2339. }
  2340. .kvKey {
  2341. font-size: 22rpx;
  2342. font-weight: 480;
  2343. color: rgba(54, 68, 58, 0.62);
  2344. }
  2345. .kvVal {
  2346. font-size: 24rpx;
  2347. font-weight: 660;
  2348. text-align: right;
  2349. color: rgba(27, 41, 33, 0.92);
  2350. }
  2351. /* 农场主体:左图右文,右栏与图片垂直居中,名称/地址成组 */
  2352. .farmBody {
  2353. display: flex;
  2354. align-items: center;
  2355. gap: 24rpx;
  2356. margin-bottom: 18rpx;
  2357. }
  2358. .farmImageWrap {
  2359. flex-shrink: 0;
  2360. width: 180rpx;
  2361. height: 136rpx;
  2362. border-radius: 22rpx;
  2363. overflow: hidden;
  2364. position: relative;
  2365. box-shadow:
  2366. 0 12rpx 28rpx rgba(24, 41, 30, 0.14),
  2367. 0 2rpx 0 rgba(255, 255, 255, 0.3) inset;
  2368. }
  2369. .farmImage {
  2370. width: 100%;
  2371. height: 100%;
  2372. display: block;
  2373. background: linear-gradient(160deg, rgba(234, 245, 240, 0.9), rgba(220, 238, 228, 0.85));
  2374. }
  2375. .farmMeta {
  2376. flex: 1;
  2377. display: flex;
  2378. flex-direction: column;
  2379. justify-content: center;
  2380. min-width: 0;
  2381. gap: 10rpx;
  2382. }
  2383. .farmName {
  2384. font-size: 28rpx;
  2385. font-weight: 680;
  2386. line-height: 1.45;
  2387. letter-spacing: 0.01em;
  2388. color: rgba(27, 41, 33, 0.94);
  2389. }
  2390. /* 农场地址:普通文本样式,弱于标题;多行时图标与首行对齐 */
  2391. .farmLocation {
  2392. display: flex;
  2393. align-items: flex-start;
  2394. gap: 8rpx;
  2395. }
  2396. /* 定位小图标:略弱、与首行文字视觉对齐 */
  2397. .locationIcon {
  2398. width: 18rpx;
  2399. height: 18rpx;
  2400. flex-shrink: 0;
  2401. margin-top: 6rpx;
  2402. opacity: 0.42;
  2403. }
  2404. .locationText {
  2405. flex: 1;
  2406. min-width: 0;
  2407. font-size: 21rpx;
  2408. font-weight: 400;
  2409. color: rgba(84, 106, 93, 0.82);
  2410. line-height: 1.55;
  2411. letter-spacing: 0.02em;
  2412. }
  2413. /* 农场介绍:融入主体,使用分隔线区分,与商品简介风格统一 */
  2414. .farmIntro {
  2415. padding-top: 18rpx;
  2416. border-top: 1rpx solid rgba(39, 75, 57, 0.06);
  2417. font-size: 23rpx;
  2418. line-height: 1.86;
  2419. color: rgba(54, 68, 58, 0.76);
  2420. }
  2421. .emptyText {
  2422. margin-top: 10rpx;
  2423. font-size: 24rpx;
  2424. line-height: 1.62;
  2425. color: rgba(16, 24, 19, 0.72);
  2426. }
  2427. .btnRow {
  2428. margin-top: 22rpx;
  2429. }
  2430. /* 合格证紧凑缩略图 */
  2431. /* ============================
  2432. 合格证:信息摘要 + 缩略图一体化布局
  2433. ============================ */
  2434. .certSummary {
  2435. display: flex;
  2436. align-items: flex-start;
  2437. gap: 24rpx;
  2438. }
  2439. .certSummaryInfo {
  2440. flex: 1;
  2441. display: flex;
  2442. flex-direction: column;
  2443. gap: 14rpx;
  2444. min-width: 0;
  2445. }
  2446. .certSummaryRow {
  2447. display: flex;
  2448. flex-direction: column;
  2449. gap: 4rpx;
  2450. }
  2451. .certSummaryLabel {
  2452. font-size: 20rpx;
  2453. font-weight: 500;
  2454. color: rgba(39, 75, 57, 0.55);
  2455. letter-spacing: 0.02em;
  2456. }
  2457. .certSummaryValue {
  2458. font-size: 25rpx;
  2459. font-weight: 580;
  2460. color: rgba(27, 41, 33, 0.9);
  2461. line-height: 1.4;
  2462. }
  2463. .certThumbContainer {
  2464. flex: 0 0 auto;
  2465. display: flex;
  2466. flex-direction: column;
  2467. align-items: center;
  2468. gap: 4rpx;
  2469. }
  2470. .certThumbContainer .certThumbWrap {
  2471. /* 与左侧两行摘要区总高约齐平:缩略图 + gap + 提示行 */
  2472. width: 88rpx;
  2473. height: 120rpx;
  2474. border-radius: 8rpx;
  2475. overflow: hidden;
  2476. background: #fff;
  2477. border: 1rpx solid rgba(200, 180, 140, 0.22);
  2478. box-shadow: 0 2rpx 8rpx rgba(30, 36, 26, 0.06);
  2479. }
  2480. .certThumbContainer .certThumbImage {
  2481. width: 100%;
  2482. height: 100%;
  2483. display: block;
  2484. }
  2485. .certPreviewHint {
  2486. font-size: 16rpx;
  2487. line-height: 1.15;
  2488. color: rgba(39, 75, 57, 0.4);
  2489. letter-spacing: 0.01em;
  2490. }
  2491. .certPendingHint {
  2492. flex: 1;
  2493. display: flex;
  2494. align-items: center;
  2495. padding: 12rpx 0;
  2496. }
  2497. .certPendingText {
  2498. font-size: 21rpx;
  2499. color: rgba(39, 75, 57, 0.5);
  2500. line-height: 1.5;
  2501. }
  2502. /* 旧样式保留但隐藏(兼容其他模块) */
  2503. .certPreviewCompact {
  2504. display: flex;
  2505. flex-direction: column;
  2506. align-items: center;
  2507. margin-top: 24rpx;
  2508. }
  2509. .docPlaceholder {
  2510. margin-top: 16rpx;
  2511. padding: 20rpx;
  2512. border-radius: 26rpx;
  2513. background: linear-gradient(160deg, rgba(244, 237, 224, 0.82), rgba(237, 244, 235, 0.72));
  2514. border: 1rpx solid rgba(201, 171, 120, 0.22);
  2515. }
  2516. .docPlaceholderTitle {
  2517. display: block;
  2518. margin-bottom: 12rpx;
  2519. font-size: 22rpx;
  2520. font-weight: 650;
  2521. color: rgba(35, 93, 64, 0.92);
  2522. }
  2523. .docPlaceholderText {
  2524. display: block;
  2525. font-size: 22rpx;
  2526. line-height: 1.75;
  2527. color: rgba(59, 71, 62, 0.82);
  2528. }
  2529. .docBlock {
  2530. margin-top: 14rpx;
  2531. padding: 18rpx;
  2532. border-radius: 22rpx;
  2533. background: rgba(255, 255, 255, 0.46);
  2534. }
  2535. .docBlock:first-of-type {
  2536. margin-top: 4rpx;
  2537. }
  2538. .docTitle {
  2539. display: block;
  2540. margin-bottom: 10rpx;
  2541. font-size: 22rpx;
  2542. font-weight: 620;
  2543. color: rgba(45, 87, 64, 0.84);
  2544. }
  2545. .docText {
  2546. font-size: 22rpx;
  2547. line-height: 1.8;
  2548. color: rgba(64, 75, 67, 0.8);
  2549. }
  2550. /* 批次信息主体:连续信息排版,标签-值对应,与商品信息卡风格统一 */
  2551. .batchBody {
  2552. display: flex;
  2553. flex-direction: column;
  2554. }
  2555. /* 批次信息主体:左右两列布局,左列固定,右列自适应,内容左对齐 */
  2556. .batchBody {
  2557. display: flex;
  2558. flex-direction: column;
  2559. }
  2560. .batchRow {
  2561. display: flex;
  2562. align-items: baseline;
  2563. padding: 16rpx 0;
  2564. }
  2565. .batchRow + .batchRow {
  2566. border-top: 1rpx solid rgba(39, 75, 57, 0.05);
  2567. }
  2568. .batchRowLabel {
  2569. flex-shrink: 0;
  2570. width: 162rpx;
  2571. font-size: 21rpx;
  2572. font-weight: 460;
  2573. color: rgba(84, 106, 93, 0.68);
  2574. letter-spacing: 0.02em;
  2575. line-height: 1.5;
  2576. }
  2577. .batchRowValue {
  2578. flex: 1;
  2579. min-width: 0;
  2580. font-size: 25rpx;
  2581. font-weight: 580;
  2582. line-height: 1.4;
  2583. letter-spacing: 0.01em;
  2584. color: rgba(27, 41, 33, 0.9);
  2585. }
  2586. .cardCredential .certSummary {
  2587. margin-top: 4rpx;
  2588. }
  2589. /* 底部柔和收口渐变 */
  2590. .footerFade {
  2591. position: relative;
  2592. height: 1rpx;
  2593. margin: 0 80rpx;
  2594. background: linear-gradient(90deg,
  2595. transparent 0%,
  2596. rgba(39, 75, 57, 0.15) 30%,
  2597. rgba(39, 75, 57, 0.2) 50%,
  2598. rgba(39, 75, 57, 0.15) 70%,
  2599. transparent 100%
  2600. );
  2601. }
  2602. .footerFade::before {
  2603. content: '';
  2604. position: absolute;
  2605. top: 0;
  2606. left: 50%;
  2607. transform: translateX(-50%);
  2608. width: 60%;
  2609. height: 80rpx;
  2610. background: radial-gradient(ellipse at 50% 100%, rgba(39, 75, 57, 0.06), transparent 70%);
  2611. }
  2612. /* 轻量页脚 */
  2613. .traceFooter {
  2614. padding: 36rpx 32rpx 52rpx;
  2615. display: flex;
  2616. flex-direction: column;
  2617. align-items: center;
  2618. gap: 14rpx;
  2619. }
  2620. .traceFooterHint {
  2621. font-size: 20rpx;
  2622. font-weight: 400;
  2623. color: rgba(88, 100, 92, 0.45);
  2624. letter-spacing: 0.03em;
  2625. }
  2626. .traceFooterPhone {
  2627. display: flex;
  2628. align-items: center;
  2629. gap: 6rpx;
  2630. padding: 8rpx 16rpx;
  2631. border-radius: 6rpx;
  2632. transition: opacity 0.2s ease;
  2633. }
  2634. .traceFooterPhone:active {
  2635. opacity: 0.55;
  2636. }
  2637. .traceFooterPhoneIcon {
  2638. width: 22rpx;
  2639. height: 22rpx;
  2640. opacity: 0.55;
  2641. }
  2642. .traceFooterPhoneNum {
  2643. font-size: 22rpx;
  2644. font-weight: 400;
  2645. color: rgba(39, 75, 57, 0.6);
  2646. letter-spacing: 0.04em;
  2647. }
  2648. .traceFooterBrand {
  2649. font-size: 17rpx;
  2650. font-weight: 400;
  2651. letter-spacing: 0.1em;
  2652. color: rgba(88, 100, 92, 0.3);
  2653. margin-top: 8rpx;
  2654. }
  2655. /* 视频预览区域 */
  2656. .video-section {
  2657. /* margin: 0 30rpx 20rpx; */
  2658. position: relative;
  2659. z-index: 1;
  2660. }
  2661. .video-container {
  2662. position: relative;
  2663. width: 100%;
  2664. height: 420rpx;
  2665. background-color: #000000;
  2666. border-radius: 16rpx;
  2667. overflow: hidden;
  2668. box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.1);
  2669. transition: all 0.3s ease;
  2670. }
  2671. .video-container.fullscreen-mode {
  2672. position: fixed;
  2673. top: 0;
  2674. left: 0;
  2675. width: 100vw;
  2676. height: 100vh;
  2677. margin: 0;
  2678. z-index: 9999;
  2679. border-radius: 0;
  2680. }
  2681. .video-container.fullscreen-mode .video-controls {
  2682. padding: 30rpx;
  2683. }
  2684. .video-container.fullscreen-mode .top-controls,
  2685. .video-container.fullscreen-mode .bottom-controls {
  2686. opacity: 0;
  2687. transition: opacity 0.3s ease;
  2688. }
  2689. .video-container.fullscreen-mode:hover .top-controls,
  2690. .video-container.fullscreen-mode:hover .bottom-controls {
  2691. opacity: 1;
  2692. }
  2693. .video-player,
  2694. .video-placeholder {
  2695. width: 100%;
  2696. height: 100%;
  2697. object-fit: contain;
  2698. }
  2699. /* 微信小程序video组件样式 */
  2700. #myVideo {
  2701. width: 100%;
  2702. height: 100%;
  2703. background-color: #000000;
  2704. }
  2705. /* App端video组件样式 */
  2706. /* #ifdef APP-PLUS || APP-HARMONY */
  2707. #appVideo {
  2708. width: 100%;
  2709. height: 100%;
  2710. background-color: #000000;
  2711. }
  2712. /* #endif */
  2713. .h5-video-wrapper {
  2714. width: 100%;
  2715. height: 100%;
  2716. }
  2717. /* App端视频播放器样式优化 */
  2718. /* #ifdef APP-PLUS || APP-HARMONY */
  2719. #appVideoPlayer {
  2720. width: 100%;
  2721. height: 100%;
  2722. background-color: #000000;
  2723. }
  2724. /* #endif */
  2725. .video-controls {
  2726. position: absolute;
  2727. top: 0;
  2728. left: 0;
  2729. width: 100%;
  2730. height: 100%;
  2731. display: flex;
  2732. flex-direction: column;
  2733. justify-content: space-between;
  2734. padding: 20rpx;
  2735. box-sizing: border-box;
  2736. background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.4) 100%);
  2737. }
  2738. .control-row {
  2739. display: flex;
  2740. justify-content: space-between;
  2741. align-items: center;
  2742. width: 100%;
  2743. }
  2744. .top-controls {
  2745. height: 80rpx;
  2746. }
  2747. .center-controls {
  2748. height: 120rpx;
  2749. justify-content: center;
  2750. align-items: center;
  2751. }
  2752. .bottom-controls {
  2753. height: 80rpx;
  2754. }
  2755. .signal-indicator {
  2756. display: flex;
  2757. align-items: center;
  2758. color: #FFFFFF;
  2759. font-size: 24rpx;
  2760. background-color: rgba(0, 0, 0, 0.5);
  2761. padding: 8rpx 16rpx;
  2762. border-radius: 30rpx;
  2763. }
  2764. .signal-indicator svg {
  2765. margin-right: 8rpx;
  2766. }
  2767. .signal-text {
  2768. font-weight: 500;
  2769. }
  2770. .fullscreen-button {
  2771. width: 60rpx;
  2772. height: 60rpx;
  2773. display: flex;
  2774. align-items: center;
  2775. justify-content: center;
  2776. color: #FFFFFF;
  2777. background-color: rgba(0, 0, 0, 0.5);
  2778. border-radius: 50%;
  2779. transition: all 0.2s;
  2780. }
  2781. .fullscreen-button:active {
  2782. background-color: rgba(76, 175, 80, 0.7);
  2783. transform: scale(0.9);
  2784. }
  2785. .video-time {
  2786. color: #FFFFFF;
  2787. font-size: 26rpx;
  2788. background-color: rgba(0, 0, 0, 0.5);
  2789. padding: 6rpx 16rpx;
  2790. border-radius: 30rpx;
  2791. font-weight: 500;
  2792. }
  2793. .play-button {
  2794. width: 100rpx;
  2795. height: 100rpx;
  2796. border-radius: 50%;
  2797. background-color: rgba(255, 255, 255, 0.9);
  2798. display: flex;
  2799. align-items: center;
  2800. justify-content: center;
  2801. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.5);
  2802. transition: all 0.2s;
  2803. transform: scale(1);
  2804. }
  2805. .play-button:active {
  2806. transform: scale(0.92);
  2807. background-color: rgba(255, 255, 255, 1);
  2808. }
  2809. .center-button-container {
  2810. width: 100%;
  2811. height: 100%;
  2812. display: flex;
  2813. align-items: center;
  2814. justify-content: center;
  2815. }
  2816. .pause-icon {
  2817. width: 80rpx;
  2818. height: 80rpx;
  2819. border-radius: 50%;
  2820. background-color: rgba(0, 0, 0, 0.5);
  2821. display: flex;
  2822. align-items: center;
  2823. justify-content: center;
  2824. opacity: 0;
  2825. transition: opacity 0.3s;
  2826. }
  2827. .center-button-container:active .pause-icon {
  2828. opacity: 1;
  2829. background-color: rgba(76, 175, 80, 0.7);
  2830. }
  2831. </style>