info.vue 89 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466
  1. <template>
  2. <view class="content">
  3. <view :style="{ height: statusBarHeight + 'px', width: '100%', background: '#000' }"></view>
  4. <view class="video-box">
  5. <!-- 返回按钮 -->
  6. <!-- #ifdef APP-PLUS -->
  7. <image class="back-img" @click.stop="$navBack()" src="@/static/image/hall/back_white_icon.png"></image>
  8. <!-- #endif -->
  9. <view class="cousrseImg x-c" v-show="!pickCatalog.url">
  10. <u-loading-icon size="30"></u-loading-icon>
  11. <!-- <image :src="data.imgUrl" mode="aspectFit"></image> -->
  12. </view>
  13. <!-- 视频 -->
  14. <view class="video-container" style="position: relative;height: 422rpx;" :videoPlayStatus="videoPlayStatus"
  15. :change:videoPlayStatus="xgplayer.changeVideo" :danmuFunInfo="danmuFunInfo"
  16. :change:danmuFunInfo="xgplayer.danmuFun">
  17. <view id="detail-video" :pickCatalog="pickCatalog" :change:pickCatalog="xgplayer.initJs"
  18. :exitFullscreen="exitFullscreen" :change:exitFullscreen="xgplayer.handleExitFullscreen"
  19. @click.stop="clickVideo"></view>
  20. <image class="back-img" v-if="fullScreen" @click.stop="videoback"
  21. src="@/static/image/hall/back_white_icon.png"></image>
  22. <!-- 疗法 -->
  23. <view v-if="showTherapy && fullScreen" class="horizontal" @tap.stop>
  24. <view class="goods" @tap.stop="goToPro(showTherapyItem.packageId)">
  25. <image :src="showTherapyItem.imgUrl" mode="aspectFill" class="goodsimg"></image>
  26. <view class="goodsname textOne">{{ showTherapyItem.packageName }}</view>
  27. </view>
  28. <view style="width: 20px;height: 20px;position: absolute;right:0rpx;top:0rpx;z-index:999">
  29. <image style="width: 20px;height: 20px" src="@/static/images/close40.png"
  30. @tap.stop="closeTherapy"></image>
  31. </view>
  32. </view>
  33. <view class="audiobox es es-ver es-ac es-pc" v-if="showAudio" @click.stop>
  34. <view class="audiobox-title">
  35. <image class="back" @click.stop="$navBack()" src="@/static/image/hall/back_white_icon.png">
  36. </image>
  37. <view class="textOne">
  38. {{ catalogueList[pickCatalogIdx] && catalogueList[pickCatalogIdx].title }}
  39. </view>
  40. </view>
  41. <view class="es es-ver es-ac es-pc">
  42. <view class="es es-ac es-pc">
  43. <image class="es-icon-52 es-icon-play-last" src="/static/images/other/video/play-last.png"
  44. @tap="endedPlayPrev()"></image>
  45. <image class="es-icon-88 es-ml-50 es-mr-50"
  46. :src="audioPlayIng ? '/static/images/other/video/play-stop.png' : '/static/image/hall/video_icon.png'"
  47. @tap="playAudioAction()"></image>
  48. <image class="es-icon-52 es-icon-play-next" src="/static/images/other/video/play-next.png"
  49. @tap="endedPlayNext('click')"></image>
  50. </view>
  51. <view class="audiobox-time">{{ $formatSeconds(tempAudioDuration) }} /
  52. {{ $formatSeconds(pickCatalog.seconds) }}
  53. </view>
  54. </view>
  55. <view class="audiobox-video x-ac" @tap="backPlayVideo">返回视频</view>
  56. </view>
  57. <!-- 视频控制栏 -->
  58. <view class="es"
  59. :style="{ paddingLeft: fullScreen ? statusBarHeight + 'px' : 0, display: isPause || isClickVideo ? 'flex' : 'none' }"
  60. style="width: 100%;height: 48px;position: absolute;z-index: 999;bottom: 0;left: 0;background: transparent;">
  61. <view class="xgplayer" id="controls_new_root" style="flex: 1;background:transparent;"></view>
  62. <view v-if="fullScreen" class="xgplayer-switch xgplayer-icon es es-ac es-pc"
  63. style="padding: 0 8px 8px 8px;">
  64. <view class="danmu-controls es es-ac es-pc" @click="openDanmu">
  65. 点我发弹幕
  66. </view>
  67. <view class="danmu-controls-r es es-ac es-pc">
  68. <image class="xg-img danmu-switch-open" v-show="danmuFunInfo.switch == 1"
  69. src="/static/images/other/course/danmu-on.png" @tap="switchDanmu(0)"></image>
  70. <image class="xg-img danmu-switch-open" v-show="danmuFunInfo.switch == 0"
  71. src="/static/images/other/course/danmu-off.png" @tap="switchDanmu(1)"></image>
  72. </view>
  73. </view>
  74. </view>
  75. <!-- 弹幕设置 -->
  76. <uni-popup ref="danmuPopup" type="bottom" style="z-index: 999;">
  77. <view class="danmuPopup" :style="{ marginLeft: fullScreen ? statusBarHeight + 'px' : 0 }">
  78. <view class="danmuPopup-head border-line" style="margin-bottom: 20px;">
  79. <image class="danmu-icon" v-show="danmuFunInfo.switch == 1"
  80. src="/static/images/other/course/danmu-on.png" @click="switchDanmu(0)"></image>
  81. <image class="danmu-icon" v-show="danmuFunInfo.switch == 0"
  82. src="/static/images/other/course/danmu-off.png" @click="switchDanmu(1)"></image>
  83. <image class="danmu-icon" src="/static/images/other/course/danmu-style-on.png"
  84. mode="aspectFill" @click="openDanmuStyle(2)"></image>
  85. <u--input class="danmuPopup-input" placeholder="发个弹幕吧~" border="surround" shape="circle"
  86. focus :adjustPosition="false" :autoBlur="true" maxlength="140" clearable
  87. v-model="danmuIput.txt"></u--input>
  88. <button class="danmuPopup-send" :disabled="danmubtnLoading" @click="sendDanmu">发送</button>
  89. </view>
  90. <view class="danmuPopup-con"
  91. :style="{ height: danmuboxHeight ? fullScreen ? `calc(${danmuboxHeight}px + 20px)` : danmuboxHeight + 'px' : 'auto' }">
  92. <view class="es" style="margin-bottom: 25px;">
  93. <view class="es-mr-24px">弹幕字号</view>
  94. <view class="es">
  95. <view class="es-mr-24px" v-for="size in danmuFontSize"
  96. :style="{ color: danmuIput.fontSize == size ? '#FF233C' : '#757575' }"
  97. @click="clickStyle('font', size)">{{ size == '16px' ? '默认' : '较小' }}</view>
  98. </view>
  99. </view>
  100. <view class="es" style="margin-bottom: 25px;">
  101. <view class="es-mr-24px">弹幕位置</view>
  102. <view class="es">
  103. <view class="es-mr-24px" v-for="mode in danmuMode"
  104. :style="{ color: danmuIput.mode == mode ? '#FF233C' : '#757575' }"
  105. @click="clickStyle('mode', mode)">
  106. {{ mode == 'top' ? '置顶' : mode == 'bottom' ? '置底' : '滚动' }}
  107. </view>
  108. </view>
  109. </view>
  110. <view class="es" style="margin-bottom: 25px;">
  111. <view class="es-mr-24px">弹幕颜色</view>
  112. <view class="es es-fx" style="flex-wrap: wrap;">
  113. <view class="es-mr-24px coloritem" v-for="color in colorList"
  114. :style="{ background: color, border: `2px solid ${danmuIput.color == color ? '#FF233C' : '#F5F7FA'}` }"
  115. @click="clickStyle('color', color)"></view>
  116. </view>
  117. </view>
  118. <view class="es">
  119. <view class="es-mr-24px">弹幕位置</view>
  120. <view class="es">
  121. <view class="es-mr-24px" v-for="item in danmuArea"
  122. :style="{ color: danmuFunInfo.area == item ? '#FF233C' : '#757575' }"
  123. @click="clickArea(item)">
  124. {{ item * 100 + '%' }}
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. </uni-popup>
  131. </view>
  132. </view>
  133. <scroll-view class="scroll-Y" :scroll-y="true" :style="'height:' + clientHeight + 'px;'" v-show="!isShowList"
  134. @scrolltolower="getPageNewCommentData">
  135. <view class="video-info">
  136. <view class="video-info-header">
  137. <view class="video-info-headerl">
  138. <image v-if="false" mode="aspectFill" :src="data.talentAvatar"></image>
  139. <text class="textOne">{{ data.courseName }}</text>
  140. </view>
  141. <button v-if="false" class="follow-btn" @tap="doFollow()">
  142. <image v-show="!isFollow" src="@/static/image/hall/guanzhu_icon.png" mode="aspectFill"></image>
  143. <text>{{ isFollow ? "已关注" : "关注" }}</text>
  144. </button>
  145. </view>
  146. <view>
  147. <view class="video-info-voicebox2">
  148. <text class="boTextClass">{{ $formattedViewCount(data.views) }}次播放</text>
  149. <!-- <text>{{data.views}}次播放 · 总时长:{{data.totalDuration}}</text> -->
  150. <view class="x-c" @click="isExpand = !isExpand" v-if="showExpandText">
  151. <text>{{ isExpand ? '收起简介' : '展开简介' }}</text>
  152. <view :class="isExpand ? 'rotate' : ''"><uni-icons type="down" size="14"
  153. color="#bbbbbb"></uni-icons></view>
  154. </view>
  155. </view>
  156. <view :class="showDes || !showExpandText ? 'opacity video-info-desc' : 'video-info-desc'"
  157. id="descbox-desc" :style="{ height: isExpand ? 'auto' : '84rpx' }">
  158. {{ data.description }}
  159. <image v-show="!isExpand && showExpandText" class="desc-image x-c"
  160. src="/static/images/other/bg_bar.png"></image>
  161. </view>
  162. </view>
  163. <view v-if="false" class="video-info-footer">
  164. <view @tap="handleListen()">
  165. <image src="@/static/image/hall/sound_icon24.png" mode="aspectFill"></image>
  166. <text :style="{ color: showAudio ? '#FF233C' : '#757575' }">听声</text>
  167. </view>
  168. <view @tap="$navTo('./note?courseId=' + courseId)" v-if="!$qconfig.isAppStore">
  169. <image src="@/static/image/hall/note_icon24.png" mode="aspectFill"></image>
  170. <text>笔记</text>
  171. </view>
  172. <view @tap="doFavorite()">
  173. <image
  174. :src="isFavorite ? '/static/image/hall/collect_on_icon24.png' : '/static/image/hall/collect_icon24.png'"
  175. mode="aspectFill"></image>
  176. <text>{{ isFavorite ? "已收藏" : "收藏" }}</text>
  177. </view>
  178. <view @tap="doLike()">
  179. <image
  180. :src="isLike ? '/static/image/hall/like_on_icon.png' : '/static/image/hall/like_icon.png'"
  181. mode="aspectFill"></image>
  182. <text>{{ isLike ? "喜欢" : "喜欢" }}</text>
  183. </view>
  184. <view @tap="openShare()">
  185. <image src="@/static/image/hall/weixin_icon.png" mode="aspectFill"></image>
  186. <text>分享</text>
  187. </view>
  188. <view @tap="openDanmu()" :style="{ display: $isLogin() && !showAudio ? 'flex' : 'none' }">
  189. <image src="@/static/images/other/course/danmu-set.png" mode="aspectFill"></image>
  190. <text>弹幕</text>
  191. </view>
  192. </view>
  193. </view>
  194. <!-- 讲堂目录 -->
  195. <view class="video-directory">
  196. <view class="box-header">
  197. <view class="kechengLeftClass">
  198. <image class="kechengIconClass" src="/static/images/new/ke_list-icon.png" mode=""></image>
  199. <view class="box-header-title">课程目录</view>
  200. </view>
  201. <view class="box-header-r" @tap="goToCatalogue()">
  202. <text class="dataNumTextClass">共{{ catalogueList.length }}节</text>
  203. <image src="@/static/images/new/see_more.png" mode="aspectFill"></image>
  204. </view>
  205. </view>
  206. <scroll-view class="video-directory-scrollx" scroll-x="true" :scroll-into-view="scrollIntoViewId"
  207. scroll-with-animation="true" overflow-anchor="none">
  208. <view :id="'cataLogue' + index"
  209. :class="pickCatalogIdx == index ? 'active-scrollitem video-directory-scrollitem' : 'video-directory-scrollitem'"
  210. v-for="(item, index) in catalogueList" :key="index" @click="pickCatalogAction(index)">
  211. <view v-if="false"
  212. :class="index > 1 && canShowVip(item) ? 'freeflag freeflag-member' : 'freeflag freeflag-free'">
  213. {{ index > 1 && canShowVip(item) ? '限时特惠' : '限时免费' }}
  214. </view>
  215. <view class="freeflag freeflag-free">限时免费</view>
  216. <view class="video-directory-num">
  217. <text>第{{ item.courseSort }}讲</text>
  218. <image v-if='pickCatalogIdx == index' src="@/static/image/hall/hear_icon.png"></image>
  219. <view class="empty" v-else></view>
  220. </view>
  221. <view class="video-directory-title">
  222. <view class="textTwo">{{ item.title }}</view>
  223. <!-- <view class="imagebox">
  224. <view class="mask" v-if='pickCatalogIdx != index'>
  225. <image src="@/static/image/hall/video_icon.png" mode="aspectFill"></image>
  226. </view>
  227. <image class="video-directory-img" src="@/static/image/home1/logo.png" mode="aspectFill"></image>
  228. </view> -->
  229. </view>
  230. </view>
  231. </scroll-view>
  232. </view>
  233. <!-- 课程疗法 -->
  234. <view class="therapy" v-show="packageJsonList && packageJsonList.length > 0 && false">
  235. <view class="box-header-title" style="margin-bottom: 20rpx;">课程疗法</view>
  236. <scroll-view class="therapy-scrollx" scroll-x="true" :scroll-into-view="scrollIntoTherapy"
  237. scroll-with-animation="true" overflow-anchor="none">
  238. <view :class="therapyIndex == idx ? 'therapy-active therapy-scrollitem' : 'therapy-scrollitem'"
  239. :id="'therapy' + idx" v-for="(item, idx) in packageJsonList" :key="idx"
  240. @click="handleTherapy(item, idx)">
  241. <image mode="aspectFill" class="therapy-goodsimg" :src="item.imgUrl"></image>
  242. <view class="therapy-goodsname textTwo">{{ item.packageName }}</view>
  243. </view>
  244. </scroll-view>
  245. </view>
  246. <!-- 评论 -->
  247. <view class="video-comment" v-if="$qconfig.isAppStore">
  248. <view class="box-header">
  249. <view class="box-header-title">评论</view>
  250. <view v-if="false" class="box-header-r" @tap="goToComment()">
  251. <text>共{{ newCommentArrList.length }}条</text>
  252. <image src="@/static/image/hall/my_right_arrow_right_icon.png" mode="aspectFill"></image>
  253. </view>
  254. </view>
  255. <view style="padding: 0 24rpx 20rpx;">
  256. <!-- <commentList :commentList="data.commentList" /> -->
  257. <newCommentList :commentList="newCommentArrList" />
  258. </view>
  259. </view>
  260. <!-- 猜你喜欢 -->
  261. <view class="video-comment" v-if="false">
  262. <view class="box-header">
  263. <view class="box-header-title">猜你喜欢</view>
  264. <view class="box-header-r" v-if="false">
  265. <text>更多</text>
  266. <image src="@/static/image/hall/my_right_arrow_right_icon.png" mode="aspectFill"></image>
  267. </view>
  268. </view>
  269. <view class="hall-box">
  270. <hallItem class="gapitem" v-for="(item, index) in dataList" :key="index" :item="item"
  271. @click.native="navTo('/pages/course/info?courseId=' + item.courseId)" />
  272. </view>
  273. </view>
  274. </scroll-view>
  275. <view class="bottomCommentInputClass">
  276. <input type="text" v-model="inputComment" placeholder="发表我的态度" :maxlength="50" class="input-box"
  277. confirm-type="send" @confirm="sendCommentMsg" />
  278. <view class="send-btn" @click="sendCommentMsg">发送</view>
  279. <view class="icon-btn" @tap="openShare">
  280. <image src="/static/image/hall/share_icon.png" mode="aspectFill"></image>
  281. <text>分享</text>
  282. </view>
  283. </view>
  284. <!-- h5下载 -->
  285. <h5-down-app-tip :pageUrl="pageUrl" :type="'course'" :courseId="courseId" />
  286. <!-- 分享弹窗 -->
  287. <u-popup :show="showShare" @close="closeShareAct()">
  288. <share-box :shareItem="shareItem" @closeShare='closeShareAct()'></share-box>
  289. </u-popup>
  290. <!-- VIP特权弹窗 -->
  291. <uni-popup ref="popPrivilege" type="bottom" borderRadius="10rpx 10rpx 0px 0px">
  292. <view class="privilegeBox es es-ver es-br-38 es-pt-30 es-pb-30 ">
  293. <view class="es es-fx es-pc es-h-56 es-ml-48 es-mr-48">
  294. <image class="es-w-74 es-h-40" style="position: absolute;left:60rpx;top:0"
  295. src="../../static/image/course/xiangyun.png"></image>
  296. <view class="es-fs-40 es-h-56 es-fw-500" style="color: #FFDAA3;">开通VIP专享以下特权</view>
  297. <image class="es-w-74 es-h-40" style="position: absolute;right:60rpx;top:0"
  298. src="../../static/image/course/xiangyun2.png"></image>
  299. <image class="es-w-40 es-h-40" style="position: absolute;right:-20rpx;top:-10rpx"
  300. @tap="closePrivilege" src="/static/images/close40.png"></image>
  301. </view>
  302. <view class="sec1 es-mt-20 es-ml-48 es-mr-48">
  303. <view class="es x-bc es-pl-28 es-pt-12">
  304. <view class="l1">
  305. <view class="x-f">
  306. <image class="es-w-44 es-h-44" src="../../static/image/course/privilege/fozhu.png">
  307. </image>
  308. <view class="es-ml-8 es-c-white es-fs-32 es-fw-600">名家讲堂</view>
  309. </view>
  310. <view class="es-fs-30 es-mt-10 es-c-99">畅享10000+VIP视频</view>
  311. </view>
  312. <view class="es">
  313. <image src="../../static/image/course/zyx.png" class="es-w-183 es-h-98 es-br-15"></image>
  314. <!-- <view class="es-fs-20 es-br-8 es-w-80 es-h-30 es-fw-bold x-c" style="position:absolute; right: 0;top:10rpx;background: #000;opacity: 0.7;color: #FFDAA3;">10000+</view> -->
  315. </view>
  316. </view>
  317. </view>
  318. <view class="sec2 es es-fx es-pc es-h-56 es-mt-40 es-ml-48 es-mr-48">
  319. <!-- <image class="es-w-148 es-h-3" style="position: absolute;left:0;top:16rpx" src="../../static/image/course/privilege/line1.png"></image> -->
  320. <view class="es-fs-30 es-h-56 es-fw-bold" style="color: #FFDAA3;">超多权益待你开启</view>
  321. <!-- <image class="es-w-148 es-h-3" style="position: absolute;right:0;top:16rpx" src="../../static/image/course/privilege/line2.png"></image> -->
  322. </view>
  323. <view class="primenu-box es es-fx es-pc es-mt-20 es-ml-48 es-mr-48">
  324. <view class="content-inner">
  325. <!-- <view class="item">
  326. <image class="img" src="/static/image/course/privilege/she.png" mode="heightFix"></image>
  327. <text class="label">AI舌诊</text>
  328. </view> -->
  329. <view class="item">
  330. <image class="img jlxw" src="/static/image/course/privilege/tizhi.png" mode="heightFix">
  331. </image>
  332. <text class="label">体质检测</text>
  333. </view>
  334. <view class="item">
  335. <image class="img" src="/static/image/course/privilege/baike.png" mode="heightFix"></image>
  336. <text class="label">养生百科</text>
  337. </view>
  338. <view class="item">
  339. <image class="img" src="/static/image/course/privilege/yishu.png" mode="heightFix"></image>
  340. <text class="label">经典医书</text>
  341. </view>
  342. <view class="item">
  343. <image class="img" src="/static/image/course/privilege/more.png" mode="heightFix"></image>
  344. <text class="label">多设备登陆</text>
  345. </view>
  346. <view class="item">
  347. <image class="img" src="/static/image/course/privilege/ad.png" mode="heightFix"></image>
  348. <text class="label">去除广告</text>
  349. </view>
  350. </view>
  351. </view>
  352. <view class="es-ml-48 es-mr-48 es-mt-10 es-pt-10 es-pb-10 es-br-5" style="background:#2a2f32">
  353. <view v-for="(item, index) in vipMethods" :key="index" @tap="changeVipMethod(index)"
  354. class="vipMethodItem es x-bc">
  355. <view class="x-bc es-ml-14">
  356. <view class="es-fs-32 es-fw-500 es-ml-14">{{ item }}</view>
  357. </view>
  358. <image v-if="vipMethodIdx == index" class="es-w-40 es-h-40 es-br-ban es-mr-14 es-mr-26"
  359. src="../../static/image/course/vipBuy/check.png"></image>
  360. <view v-else class="es-w-40 es-h-40 es-br-ban es-mr-14 es-mr-26 circle"></view>
  361. </view>
  362. </view>
  363. <view v-if="isShowPayType" class="es-ml-48 es-mr-48 es-mt-40 x-bc" style="background:#2a2f32">
  364. <view v-for="(item, index) in payTypes" :key="index" @tap="changePayType(index)"
  365. class="payTypeItem es x-bc " :class="payType == index + 1 ? 'pt_ac' : ''">
  366. <view class="x-bc es-ml-14">
  367. <image class="es-w-59 es-h-52"
  368. :src="index == 0 ? '../../static/image/course/vipBuy/wx.png' : '../../static/image/course/vipBuy/zfb.png'">
  369. </image>
  370. <view class="es-fs-33 es-c-white es-fw-500 es-ml-14">{{ item }}</view>
  371. </view>
  372. <image v-if="payType == index + 1" src="../../static/image/course/vipBuy/check.png"
  373. class="es-w-40 es-h-40 es-br-ban es-mr-14"></image>
  374. <view v-else class="es-w-40 es-h-40 es-br-ban es-mr-14 circle"></view>
  375. </view>
  376. </view>
  377. <view class="es es-mt-40 es-ml-48 es-mr-48 x-c">
  378. <view @tap="doBuy()" class="es-h-94 x-c es-fw-700 es-fs-34 vipCourseBtn vipAc es-br-46"
  379. style="width: 310rpx;">
  380. 立即购买
  381. </view>
  382. </view>
  383. </view>
  384. </uni-popup>
  385. <uni-popup ref="popTip" type="dialog">
  386. <uni-popup-dialog cancelText="支付失败" confirmText="支付成功" mode="base" content="是否已支付成功?" title="提示"
  387. :duration="2000" :before-close="true" @close="confirmTip" @confirm="confirmTip"></uni-popup-dialog>
  388. </uni-popup>
  389. <!-- 评论弹窗 -->
  390. <popupBottom ref="mescrollItem" :visible.sync="specVisible" @close="closePop" :cmdId="courseId"
  391. :smsNum="data.commentNum" :title="data.commentNum + '条评论'" :type="1" radius="32" maxHeight="1200">
  392. </popupBottom>
  393. <!-- 右侧悬浮框 -->
  394. <answerFloatBox v-if="pickCatalog && pickCatalog.videoId && isShowPageEntryTimer"
  395. :typeNum="isShowPageEntryTimer" :pointsNum="answerPointsNum" :remainSeconds="pageEntryRequiredTime"
  396. @handleShowAnswer="handleAnswerMethods" @showTomorrowTipMethods="handleTomorrowTipMethods" />
  397. <!-- 答题弹窗 -->
  398. <questionsPopup v-if="pickCatalog && pickCatalog.videoId && isShowPageEntryTimer" :isShow="isShowQuestions"
  399. :remainSeconds="pageEntryRequiredTime" :videoId="pickCatalog.videoId" @closeMethod="questionsCloseMethod"
  400. @submitAnswer="handleSubmitAnswer" />
  401. <!-- 答题提示框和明日再来提示框 -->
  402. <answerPromptPopup v-if="pickCatalog && pickCatalog.videoId" :pointsNum="answerPointsNum"
  403. :isShow="isShowAnswerPrompt" :typeStatus="answerPromptType" @closeMethod="isShowAnswerPrompt = false" />
  404. </view>
  405. </template>
  406. <script>
  407. import {
  408. getUserInfo
  409. } from '@/api/user'
  410. import {
  411. getCourseById,
  412. getCourseList,
  413. getCourseVideoList,
  414. checkFavorite,
  415. checkFollow,
  416. checkLike,
  417. doFavorite,
  418. doFollow,
  419. doLike,
  420. addDuration,
  421. createCourseOrder,
  422. createIntegralOrder,
  423. getIntegral,
  424. createVipOrder,
  425. aliPayment,
  426. wxPayment,
  427. getCourseOrderById,
  428. getComments,
  429. saveMsg,
  430. getNewCommentListApi,
  431. addNewCommentApi,
  432. newPublicCourseAnswerApi,
  433. publicCourseAnswerStatusApi,
  434. publicCourseAnswerClaimIntegralApi,
  435. } from '@/api/course'
  436. import commentList from "./components/commentList.vue";
  437. import newCommentList from "./components/newCommentList.vue";
  438. import hallItem from "./components/hallItem.vue";
  439. import popupBottom from '@/components/popupBottom/popupBottom.vue'
  440. import MescrollCompMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mixins/mescroll-comp.js";
  441. import adMask from "@/components/adMask/adMask.vue"
  442. import answerFloatBox from "./components/answerFloatBox.vue"
  443. import questionsPopup from "./components/questionsPopup.vue"
  444. import answerPromptPopup from "./components/answerPromptPopup.vue"
  445. export default {
  446. mixins: [MescrollCompMixin],
  447. components: {
  448. popupBottom,
  449. commentList,
  450. newCommentList,
  451. hallItem,
  452. adMask,
  453. answerFloatBox,
  454. questionsPopup,
  455. answerPromptPopup
  456. },
  457. data() {
  458. return {
  459. player: null,
  460. Events: null,
  461. isH5: false,
  462. showDes: false,
  463. showExpandText: false,
  464. isExpand: true,
  465. textHeight: 0, //文本高度
  466. courseId: null,
  467. isShare: false,
  468. videoId: null,//当前视频(小节)章节ID(旧的,页面进入时带入的,后面没有更新,需要的话用pickCatalog.videoId来判断)
  469. isLearning: false,
  470. isShowQuestions: false,
  471. isShowAnswerPrompt: false,
  472. answerPromptType: 1,
  473. answerPointsNum: 0, // 答题获得的积分
  474. inputComment: '',
  475. newCommentArrList: [],
  476. data: {
  477. courseId: null,
  478. imgUrl: "",
  479. talentAvatar: "",
  480. price: "",
  481. remark: "",
  482. noteNum: 0,
  483. courseName: "",
  484. description: "",
  485. cataIndex: 0,
  486. isFast: 1,
  487. isAutoPlay: false,
  488. commentList: [{
  489. avatar: "",
  490. content: "",
  491. createTime: "",
  492. nickName: ""
  493. }]
  494. },
  495. dataList: [],
  496. talentId: null,
  497. studyLog: null,
  498. isNext: 0,
  499. user: {},
  500. isFavorite: 0,
  501. isFollow: 0,
  502. isLike: 0,
  503. clientHeight: 0,
  504. isShowList: false, // 是否展示讲堂目录列表
  505. catalogueList: [],
  506. scrollIntoViewId: 'cataLogue0',
  507. pickCatalog: {
  508. // videoUrl: "https://tcpv.ylrzcloud.com/course/20241014/1728890026184.mp4",
  509. videoUrl: "",
  510. thumbnail: "",
  511. duration: 0,
  512. videoId: 0,
  513. seconds: 0,
  514. studyTime: null,
  515. isFast: 1,
  516. },
  517. pickCatalogIdx: 0,
  518. packageJsonList: [],
  519. poster: '',
  520. showShare: false,
  521. shareItem: {
  522. imageUrl: "",
  523. title: "",
  524. path: ""
  525. },
  526. fullScreen: false,
  527. showTherapy: false,
  528. showTherapyItem: {},
  529. playDuration: 0, // 播放时长
  530. timer: null, // 定时器
  531. lookDuration: 0, // 观看时长
  532. countdowning: false, // 观看时长计时开关
  533. showAudio: false, //音频展示
  534. videoPlayStatus: {
  535. status: '',
  536. tempAudioDuration: 0,
  537. studyTime: 0,
  538. }, // 视频播放状态
  539. pageUrl: '',
  540. courseOrderId: 0,
  541. scrollIntoTherapy: 'therapy0',
  542. therapyIndex: null,
  543. allLookTimer: null, // 定时器
  544. allLookDuration: 0, //H5未登录状态播放五分钟就跳出登录页面
  545. tempAudioDuration: 0, //用于记录视频和音频播放的时间,达到无缝续播
  546. audioTimer: null,
  547. playTime: "00:00",
  548. studyTimes: 0,
  549. audioContext: null,
  550. audioPlayIng: false,
  551. isPostBack: true, //页面是否已初次加载
  552. specVisible: false,
  553. esComment: null,
  554. vipSelIndex: 0,
  555. vipMethods: ["开通会员"],
  556. vipMethodIdx: 0,
  557. isShowPayType: false,
  558. payTypes: ["微信支付", "支付宝支付"],
  559. payType: 1, //微信支付1 支付宝支付2
  560. createType: 3, //1直接购买,2福币兑换 3开通会员
  561. orderId: null,
  562. order: null,
  563. showPayTips: false,
  564. isPlayIng: false, //是否正在播放
  565. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  566. direction: "",
  567. nodeTime: 0,
  568. exitFullscreen: '', //是否退出全屏yes , no 加上时间戳
  569. danmubtnLoading: false,
  570. colorList: ['#ffffff', '#e70012', '#fcf103', '#009843', '#00a0ea', '#e2027f'],
  571. danmuMode: ['scroll', 'top', 'bottom'],
  572. danmuArea: [0.1, 0.25, 0.5, 0.75, 1],
  573. danmuFontSize: ['18px', '16px'],
  574. danmuIput: {
  575. txt: '',
  576. mode: 'scroll',
  577. color: '#ffffff',
  578. fontSize: '18px',
  579. },
  580. danmuItem: {
  581. //发送弹幕
  582. duration: 10000,
  583. id: '',
  584. txt: '',
  585. mode: 'scroll',
  586. style: {
  587. color: '#ffffff',
  588. fontSize: '18px',
  589. border: 'solid 1px #ffffff',
  590. borderRadius: '5px',
  591. padding: '2px 5px',
  592. backgroundColor: 'rgba(255, 255, 255, 0.1)'
  593. }
  594. },
  595. danmuFunInfo: {
  596. time: new Date().getTime(),
  597. event: '',
  598. switch: 1,
  599. area: 0.25
  600. },
  601. socket: null,
  602. // 页面一进入-答题奖励相关
  603. pageEntryTimer: null, // 页面一进入-答题奖励计时器
  604. pageEntryRequiredTime: 0, // 页面一进入-答题奖励当前小节后台设定的奖励时间(秒)(倒计时总时长)
  605. hasGotPageEntryReward: 0, // 页面一进入-答题奖励当前小节是否已领取奖励-答题状态:1未答题 2可以答题 3达到上限 4已完成;-1学习缺失 -2无看课 -3未完课
  606. isSocketOpen: false,
  607. isSend: true,
  608. reOpenSocket: false,
  609. pingpangTimes: null,
  610. danmuboxHeight: 0,
  611. isPause: true, // 视频是否暂停
  612. isClickVideo: false, // 是否点击视频
  613. commentPage: {
  614. pageNum: 1,
  615. pageSize: 10,
  616. total: 0,
  617. },
  618. }
  619. },
  620. computed: {
  621. isShowPageEntryTimer() {
  622. let newData = 0
  623. if (this.hasGotPageEntryReward == 1) {
  624. // 未答题
  625. newData = 4
  626. }
  627. if (this.hasGotPageEntryReward == 2) {
  628. // 答错了但未达上限- 可以答题
  629. newData = 3
  630. }
  631. if (this.hasGotPageEntryReward == 3) {
  632. // 答错了且达上限- 达到上限
  633. newData = 2
  634. }
  635. if (this.hasGotPageEntryReward == 4) {
  636. // 答对了获得积分- 已完成
  637. newData = 1
  638. }
  639. return newData
  640. }
  641. },
  642. onLoad(options) {
  643. this.courseId = options.courseId;
  644. this.isShare = options.isShare || false
  645. this.videoId = options.videoId || null;
  646. this.isLearning = options.isLearning || false;
  647. // #ifdef APP-PLUS
  648. uni.getSubNVueById('videoPopup').hide();
  649. uni.$on('getEventType', (data) => {
  650. uni.getSubNVueById('videoPopup').hide();
  651. if (data.type == 'confirm') {
  652. // 确认
  653. this.tipConfirm(data.extraData)
  654. } else {
  655. // 取消
  656. this.tipCancel(data.extraData)
  657. }
  658. })
  659. // #endif
  660. this.esComment = this.$refs["esComment"];
  661. let that = this;
  662. uni.$on('refreshTitle', (pingCount) => {
  663. that.data.commentNum = pingCount;
  664. });
  665. this.getCourseInfo();
  666. if (this.$isLogin()) {
  667. this.getUserInfo();
  668. this.checkFavorite();
  669. this.getNewCommentArrList();
  670. this.checkLike();
  671. // #ifndef H5
  672. uni.onKeyboardHeightChange(this.keyboardHeightChange);
  673. // #endif
  674. }
  675. },
  676. onShow() {
  677. this.exitFullscreen = 'no' + new Date().getTime()
  678. //#ifdef H5
  679. this.isH5 = true;
  680. //#endif
  681. //#ifdef APP-PLUS
  682. if (this.$isLogin()) {
  683. if (!this.timer) {
  684. this.timer = setInterval(() => {
  685. if (this.countdowning) { //观看时长计时开关开启
  686. this.lookDuration += 5;
  687. this.addIntegral();
  688. }
  689. }, 5000);
  690. }
  691. }
  692. //#endif
  693. if (!this.$isLogin()) {
  694. if (!this.allLookTimer) {
  695. this.allLookTimer = setInterval(() => {
  696. if (this.countdowning) { //观看时长计时开关开启
  697. this.allLookDuration += 5;
  698. }
  699. }, 5000);
  700. }
  701. }
  702. this.playFun()
  703. if (this.showPayTips) {
  704. this.$refs.popTip.open();
  705. this.showPayTips = false;
  706. }
  707. },
  708. onReady() {
  709. this.audioContext = uni.createInnerAudioContext();
  710. uni.getSystemInfo({
  711. success: (res) => {
  712. this.clientHeight = res.windowHeight - uni.upx2px(422) - res.statusBarHeight;
  713. }
  714. });
  715. },
  716. onHide() {
  717. const type = this.showAudio ? 'audio' : 'video'
  718. this.pauseFun(type);
  719. },
  720. onUnload() {
  721. if (this.socket != null) {
  722. this.socket.close()
  723. clearInterval(this.pingpangTimes)
  724. this.socket = null
  725. }
  726. // #ifndef H5
  727. uni.offKeyboardHeightChange(this.keyboardHeightChange);
  728. // #endif
  729. this.exitFullscreen = 'yes' + new Date().getTime()
  730. // 页面卸载时清除计时器
  731. this.endCountsTime();
  732. this.stopPageEntryTimer(); // 清理章节奖励计时器
  733. this.addStudyCourse();
  734. this.destoryAudio();
  735. // #ifdef APP-PLUS
  736. uni.$off('getEventType');
  737. // #endif
  738. uni.$emit('refreshStudyTime', {});
  739. uni.$off("backStudyTime");
  740. uni.$off("refreshUser");
  741. uni.$off("showPayTips");
  742. uni.$off("pickCatalogAction");
  743. uni.$off("refreshTitle");
  744. uni.$off("refreshCatalog");
  745. },
  746. methods: {
  747. // 获取新版-评论列表
  748. async getNewCommentArrList() {
  749. let params = {
  750. courseId: this.courseId,
  751. sortType: 2
  752. };
  753. const res = await getNewCommentListApi(params, this.commentPage.pageNum, this.commentPage.pageSize);
  754. if (res.code === 200 && res.data.list.length > 0) {
  755. this.commentPage.total = res.data.total;
  756. this.newCommentArrList = [...this.newCommentArrList, ...res.data.list];
  757. }
  758. },
  759. // 分页获取评论数据
  760. getPageNewCommentData() {
  761. if (this.commentPage.total <= this.newCommentArrList.length) {
  762. return;
  763. }
  764. this.commentPage.pageNum++;
  765. this.getNewCommentArrList();
  766. },
  767. // 点击答题
  768. handleAnswerMethods() {
  769. this.isShowQuestions = true
  770. },
  771. // 点击关闭答题弹窗
  772. questionsCloseMethod() {
  773. this.isShowQuestions = false
  774. },
  775. // 点击提交答案后
  776. handleSubmitAnswer(quesList) {
  777. let newData = quesList.map(item => ({ ...item, question: JSON.stringify(item.question) }));
  778. let param = {
  779. questions: newData,
  780. videoId: this.pickCatalog.videoId,
  781. courseId: this.courseId
  782. }
  783. uni.showLoading({
  784. title: '加载中'
  785. });
  786. newPublicCourseAnswerApi(param).then(res => {
  787. this.questionsCloseMethod()
  788. uni.hideLoading()
  789. if (res.code == 200) {
  790. if (res.msg == "答题成功") {
  791. // 答对
  792. this.answerPromptType = 1
  793. this.handleClaimIntegralMethods()
  794. } else {
  795. // 答错
  796. this.answerPromptType = 2
  797. }
  798. this.checkPageEntryStatus();
  799. this.isShowAnswerPrompt = true
  800. }
  801. })
  802. },
  803. // 答题成功后领取本节答题积分
  804. handleClaimIntegralMethods() {
  805. publicCourseAnswerClaimIntegralApi({
  806. videoId: this.pickCatalog.videoId,
  807. })
  808. },
  809. // 点击提示明日再来
  810. handleTomorrowTipMethods() {
  811. this.answerPromptType = 3
  812. this.isShowAnswerPrompt = true
  813. },
  814. // 发送评论
  815. sendCommentMsg() {
  816. if (this.inputComment == '' || this.inputComment.trim() == '') {
  817. uni.showToast({
  818. title: '评论不能为空~',
  819. icon: 'none'
  820. })
  821. return;
  822. }
  823. if (!this.$isLogin()) {
  824. uni.showToast({
  825. title: '请先登录后评论~',
  826. icon: 'none'
  827. })
  828. setTimeout(() => {
  829. this.$showLoginPage();
  830. }, 1500);
  831. }
  832. addNewCommentApi({
  833. courseId: this.courseId,
  834. type: 1,
  835. content: this.inputComment,
  836. toUserId: this.user.userId,
  837. }).then(res => {
  838. if (res.code == 200) {
  839. uni.showToast({
  840. title: '评论成功~',
  841. icon: 'none'
  842. })
  843. this.inputComment = '';
  844. this.commentPage.pageNum = 1;
  845. this.commentPage.total = 0;
  846. this.newCommentArrList = [];
  847. this.getNewCommentArrList();
  848. }
  849. });
  850. },
  851. endCountsTime() {
  852. if (this.timer) {
  853. clearInterval(this.timer);
  854. this.timer = null;
  855. }
  856. if (this.allLookTimer) {
  857. clearInterval(this.allLookTimer);
  858. this.allLookTimer = null;
  859. }
  860. },
  861. // 检查章节奖励领取状态
  862. checkPageEntryStatus() {
  863. this.hasGotPageEntryReward = 0;
  864. // 检查该章节是否已领取章节奖励
  865. publicCourseAnswerStatusApi({
  866. videoId: this.pickCatalog.videoId,
  867. courseId: this.courseId
  868. }).then(res => {
  869. if (res.code == 200) {
  870. this.hasGotPageEntryReward = Number(res.data.status);
  871. // 启动答题奖励计时器(需要先获取当前章节ID)
  872. if (this.pickCatalog.videoId && (this.hasGotPageEntryReward == 1 || this.hasGotPageEntryReward == 2)) {
  873. this.startPageEntryTimer();
  874. }
  875. }
  876. })
  877. },
  878. // 启动章节奖励计时器
  879. startPageEntryTimer() {
  880. // 启动前或切换章节都先重置计时
  881. this.stopPageEntryTimer();
  882. // 每秒计时
  883. this.pageEntryTimer = setInterval(() => {
  884. this.pageEntryRequiredTime--;
  885. if (this.pageEntryRequiredTime <= 0) {
  886. this.stopPageEntryTimer();
  887. }
  888. }, 1000);
  889. },
  890. // 重置-停止-清除章节奖励计时器
  891. stopPageEntryTimer() {
  892. if (this.pageEntryTimer) {
  893. clearInterval(this.pageEntryTimer);
  894. this.pageEntryTimer = null;
  895. }
  896. },
  897. getCourseInfo() {
  898. this.showDes = false
  899. getCourseById(this.courseId).then(res => {
  900. if (res.code == 200) {
  901. this.data = res.data;
  902. this.dataList = res.data.courseList;
  903. this.talentId = res.data.talentId;
  904. this.studyLog = res.data.studyLog;
  905. this.isNext = res.data.isNext;
  906. this.videoId = this.studyLog ? this.studyLog.videoId : null;
  907. this.vipMethods = ["开通会员"];
  908. if (this.data.isIntegral == 1) {
  909. this.vipMethods.push("福币兑换")
  910. }
  911. if (this.data.sellPrice > 0) {
  912. this.vipMethods.push(this.data.sellPrice + "元购买");
  913. }
  914. this.getDescHeight()
  915. this.getCourseVideoList();
  916. if (this.$isLogin()) {
  917. this.checkFollow();
  918. }
  919. }
  920. },
  921. rej => { }
  922. );
  923. },
  924. getDescHeight() {
  925. this.$nextTick(() => {
  926. const query = uni.createSelectorQuery().in(this);
  927. query
  928. .select("#descbox-desc")
  929. .boundingClientRect((data) => {
  930. this.textHeight = data.height
  931. this.isExpand = this.textHeight > uni.upx2px(84) ? false : true
  932. this.showExpandText = this.textHeight > uni.upx2px(84) ? true : false
  933. this.showDes = true
  934. })
  935. .exec();
  936. })
  937. },
  938. //课程目录
  939. getCourseVideoList() {
  940. let that = this;
  941. const params = {
  942. "courseId": this.courseId
  943. };
  944. getCourseVideoList(params, 1, 50).then(res => {
  945. if (res.code == 200) {
  946. this.catalogueList = res.data.list;
  947. if (this.catalogueList.length > 0) {
  948. this.pickCatalogIdx = this.getCatalogIdx();
  949. //开始播放计时
  950. if (this.data.isAutoPlay == 1) {
  951. this.pickCatalogMethod(this.pickCatalogIdx);
  952. setTimeout(() => {
  953. this.addStudyCourse();
  954. }, 1000);
  955. }
  956. }
  957. }
  958. },
  959. rej => { }
  960. );
  961. },
  962. canShowVip(item) {
  963. return true;
  964. if (this.user.isVip) {
  965. return false;
  966. }
  967. return item.isVip == 1 && item.isBuy == 0;
  968. },
  969. getCatalogIdx() {
  970. let index = this.catalogueList.findIndex(item => item.videoId == this.videoId);
  971. if (!this.videoId || index < 0) {
  972. index = 0;
  973. }
  974. return index;
  975. },
  976. getUserInfo() {
  977. let that = this;
  978. getUserInfo().then(res => {
  979. if (res.code == 200) {
  980. if (res.user != null) {
  981. uni.setStorageSync('userInfo', JSON.stringify(res.user));
  982. this.user = res.user;
  983. } else {
  984. uni.showToast({
  985. icon: 'none',
  986. title: res.msg,
  987. });
  988. }
  989. }
  990. },
  991. rej => { }
  992. );
  993. },
  994. checkFavorite() {
  995. checkFavorite(this.courseId).then(res => {
  996. if (res.code == 200) {
  997. this.isFavorite = res.isFavorite;
  998. }
  999. },
  1000. rej => { }
  1001. );
  1002. },
  1003. checkFollow() {
  1004. checkFollow(this.talentId).then(res => {
  1005. if (res.code == 200) {
  1006. this.isFollow = res.isFollow;
  1007. }
  1008. },
  1009. rej => { }
  1010. );
  1011. },
  1012. checkLike() {
  1013. checkLike(this.courseId).then(res => {
  1014. if (res.code == 200) {
  1015. this.isLike = res.isLike;
  1016. }
  1017. },
  1018. rej => { }
  1019. );
  1020. },
  1021. doFollow() {
  1022. if (!this.$isLogin()) {
  1023. this.$showLoginPage();
  1024. return;
  1025. }
  1026. uni.showLoading({
  1027. title: ""
  1028. });
  1029. doFollow(this.talentId).then(res => {
  1030. uni.hideLoading();
  1031. if (res.code == 200) {
  1032. uni.showToast({
  1033. title: '操作成功',
  1034. icon: 'none'
  1035. });
  1036. } else {
  1037. uni.showToast({
  1038. title: res.msg,
  1039. icon: 'none'
  1040. });
  1041. }
  1042. this.isFollow = !this.isFollow;
  1043. },
  1044. rej => { }
  1045. );
  1046. },
  1047. doFavorite() {
  1048. if (!this.$isLogin()) {
  1049. this.$showLoginPage();
  1050. return;
  1051. }
  1052. uni.showLoading({
  1053. title: ""
  1054. });
  1055. doFavorite(this.courseId).then(res => {
  1056. uni.hideLoading();
  1057. if (res.code == 200) {
  1058. uni.showToast({
  1059. title: '操作成功',
  1060. icon: 'none'
  1061. });
  1062. } else {
  1063. uni.showToast({
  1064. title: res.msg,
  1065. icon: 'none'
  1066. });
  1067. }
  1068. this.isFavorite = !this.isFavorite;
  1069. },
  1070. rej => { }
  1071. );
  1072. },
  1073. doLike() {
  1074. if (!this.$isLogin()) {
  1075. this.$showLoginPage();
  1076. return;
  1077. }
  1078. uni.showLoading({
  1079. title: ""
  1080. });
  1081. doLike(this.courseId).then(res => {
  1082. uni.hideLoading();
  1083. if (res.code == 200) {
  1084. uni.showToast({
  1085. title: '操作成功',
  1086. icon: 'none'
  1087. });
  1088. } else {
  1089. uni.showToast({
  1090. title: res.msg,
  1091. icon: 'none'
  1092. });
  1093. }
  1094. this.isLike = !this.isLike;
  1095. },
  1096. rej => { }
  1097. );
  1098. },
  1099. openShare() {
  1100. if (this.isH5) {
  1101. return;
  1102. }
  1103. if (this.$isEmpty(this.pickCatalog.title)) {
  1104. this.shareItem.title = this.data.courseName;
  1105. } else {
  1106. // this.shareItem.title = this.data.courseName + "-" + this.pickCatalog.title;
  1107. this.shareItem.title = this.pickCatalog.title;
  1108. }
  1109. this.shareItem.isMini = true
  1110. // this.shareItem.imageUrl = this.data.imgUrl;
  1111. this.shareItem.imageUrl = this.pickCatalog.thumbnail;
  1112. this.shareItem.compressImage = 0;
  1113. this.shareItem.courseId = this.courseId;
  1114. this.shareItem.summary = !this.$isEmpty(this.data.description) ? this.data.description : "";
  1115. // let cdn = uni.getStorageSync('h5Path');
  1116. let cdn = '';
  1117. this.shareItem.url = cdn + "/pages_index/courseDetail?courseId=" + this.courseId;
  1118. this.shareItem.path = "/pages_index/courseDetail?courseId=" + this.courseId;
  1119. this.showShare = true;
  1120. },
  1121. goToComment() {
  1122. if (this.isH5) {
  1123. this.specVisible = true;
  1124. } else {
  1125. // this.$navTo('./comment?courseId='+this.courseId);
  1126. // return;
  1127. const subNVue = uni.getSubNVueById('commentN');
  1128. subNVue.show('slide-in-bottom', 250);
  1129. uni.$emit('comment', {
  1130. videoId: this.pickCatalog.videoId,
  1131. courseId: this.courseId
  1132. });
  1133. }
  1134. },
  1135. closePop() {
  1136. this.specVisible = false;
  1137. },
  1138. navTo(url) {
  1139. uni.navigateTo({
  1140. url: url
  1141. });
  1142. },
  1143. openVipCourse(index) {
  1144. if (!this.isPostBack) {
  1145. this.isPostBack = true;
  1146. return;
  1147. }
  1148. this.showPopPrivilege(index);
  1149. },
  1150. showPopPrivilege(index) {
  1151. if (this.isH5) {
  1152. this.$refs.popPrivilege.open("bottom");
  1153. } else {
  1154. const subNVue = uni.getSubNVueById('privilege');
  1155. subNVue.show('slide-in-bottom', 250);
  1156. let pickCatalog = this.catalogueList[index];
  1157. uni.$emit('privilege', {
  1158. videoId: pickCatalog.videoId,
  1159. courseId: this.courseId,
  1160. sellPrice: this.data.sellPrice,
  1161. catalogIndex: index,
  1162. integral: this.data.integral,
  1163. });
  1164. }
  1165. },
  1166. changeVip(index) {
  1167. this.vipSelIndex = index;
  1168. if (index == 2) {
  1169. this.showPopPrivilege();
  1170. }
  1171. },
  1172. changeVipMethod(index) {
  1173. this.vipMethodIdx = index;
  1174. const vipMethod = this.vipMethods[index];
  1175. this.isShowPayType = false;
  1176. if (vipMethod.indexOf('元购买') != -1) { //直接购买
  1177. this.isShowPayType = true;
  1178. this.createType = 1;
  1179. }
  1180. if (vipMethod.indexOf('福币兑换') != -1) { //福币兑换
  1181. this.createType = 2;
  1182. }
  1183. if (vipMethod.indexOf('开通会员') != -1) { //开通会员
  1184. this.createType = 3;
  1185. }
  1186. },
  1187. changePayType(index) {
  1188. this.payType = index + 1;
  1189. },
  1190. doBuy() {
  1191. if (this.createType == 1) { //直接购买
  1192. this.createCourseOrder();
  1193. } else if (this.createType == 2) { //福币兑换
  1194. this.createIntegralOrder();
  1195. } else { //开通会员
  1196. this.$navTo('./vipBuy');
  1197. }
  1198. },
  1199. createCourseOrder() {
  1200. if (!this.$isLogin()) {
  1201. this.$showLoginPage();
  1202. return;
  1203. }
  1204. uni.showLoading({
  1205. title: ""
  1206. });
  1207. let params = {
  1208. "courseId": this.courseId,
  1209. "createType": this.createType,
  1210. "videoId": this.pickCatalog.videoId,
  1211. "payType": this.payType
  1212. };
  1213. createCourseOrder(params).then(res => {
  1214. uni.hideLoading();
  1215. if (res.code == 200) {
  1216. this.order = res.order;
  1217. if (this.payType == 1) { //微信支付
  1218. this.doWxPay();
  1219. } else { //支付宝
  1220. this.doAlipay();
  1221. }
  1222. } else {
  1223. uni.showToast({
  1224. title: res.msg,
  1225. icon: 'none'
  1226. });
  1227. }
  1228. },
  1229. rej => { }
  1230. );
  1231. },
  1232. createIntegralOrder() {
  1233. if (!this.$isLogin()) {
  1234. this.$showLoginPage();
  1235. return;
  1236. }
  1237. uni.showLoading({
  1238. title: ""
  1239. });
  1240. let params = {
  1241. "courseId": this.courseId,
  1242. "videoId": this.pickCatalog.videoId
  1243. };
  1244. createIntegralOrder(params).then(res => {
  1245. uni.hideLoading();
  1246. if (res.code == 200) {
  1247. // uni.showToast({
  1248. // title: res.msg,
  1249. // icon: 'success'
  1250. // });
  1251. } else {
  1252. uni.showToast({
  1253. title: res.msg,
  1254. icon: 'none'
  1255. });
  1256. }
  1257. },
  1258. rej => { }
  1259. );
  1260. },
  1261. doAlipay() {
  1262. var data = {
  1263. orderId: this.order.orderId
  1264. };
  1265. uni.showLoading();
  1266. aliPayment(data).then(res => {
  1267. uni.hideLoading()
  1268. this.$refs.popPrivilege.close();
  1269. if (res.code == 200) {
  1270. this.$refs.popTip.open();
  1271. if (uni.getSystemInfoSync().platform == 'android') {
  1272. var alipayScheme = 'alipays://platformapi/startApp?&saId=10000007&qrcode=' + res.data
  1273. .qr_code;
  1274. } else {
  1275. var alipayScheme = 'alipay://platformapi/startApp?&saId=10000007&qrcode=' + res.data
  1276. .qr_code;
  1277. }
  1278. console.log(alipayScheme)
  1279. // 在uni-app中使用plus.runtime.openURL打开URL
  1280. plus.runtime.openURL(alipayScheme, function (error) {
  1281. // console.error('打开支付宝失败: ' + error.message);
  1282. // 处理打开支付宝失败的情况,比如提示用户或者跳转到其他支付方式
  1283. });
  1284. } else {
  1285. uni.showToast({
  1286. title: res.msg,
  1287. icon: 'none'
  1288. })
  1289. }
  1290. },
  1291. rej => { }
  1292. );
  1293. },
  1294. doWxPay() {
  1295. var that = this;
  1296. plus.share.getServices(function (res) {
  1297. var sweixin = null;
  1298. for (var i = 0; i < res.length; i++) {
  1299. var t = res[i];
  1300. if (t.id == 'weixin') {
  1301. sweixin = t;
  1302. }
  1303. }
  1304. if (sweixin) {
  1305. console.log('调起小程序')
  1306. that.$refs.popPrivilege.close();
  1307. that.$refs.popTip.open()
  1308. //唤起微信跳转小程序
  1309. sweixin.launchMiniProgram({
  1310. id: getApp().globalData.miniprogamId,
  1311. path: 'pages_order/coursePayment?orderId=' + that.orderId + "&payMethod=app",
  1312. type: 0
  1313. }, function () {
  1314. console.log("微信唤起成功");
  1315. return true;
  1316. }, function (e) {
  1317. console.log("微信唤起失败", e);
  1318. uni.showToast({
  1319. title: '微信唤起失败,请检查是否有微信应用',
  1320. icon: 'none'
  1321. })
  1322. return false;
  1323. })
  1324. } else {
  1325. uni.showToast({
  1326. title: '微信唤起失败,请检查是否有微信应用',
  1327. icon: 'none',
  1328. duration: 3000
  1329. })
  1330. return false;
  1331. }
  1332. }, function (res) {
  1333. console.log(JSON.stringify(res));
  1334. });
  1335. },
  1336. goToCatalogue() {
  1337. if (this.isH5) {
  1338. let url = './catalogue?courseId=' + this.courseId + '&videoId=' + this.pickCatalog.videoId +
  1339. '&isAutoPlay=' + this.data.isAutoPlay + '&studyTimes=' + this.tempAudioDuration;
  1340. this.$navTo(url);
  1341. } else {
  1342. const subNVue = uni.getSubNVueById('catalogueN');
  1343. subNVue.show('slide-in-bottom', 250);
  1344. uni.$emit('catalogue', {
  1345. videoId: this.pickCatalog.videoId,
  1346. courseId: this.courseId,
  1347. pickCatalogIdx: this.pickCatalogIdx
  1348. });
  1349. }
  1350. },
  1351. pickCatalogAction(index, type) {
  1352. if (this.pickCatalogIdx === index) return;
  1353. if (type == 'catalogueN' && this.isNext == 1 && this.pickCatalogIdx != index - 1) {
  1354. const type = this.showAudio ? 'audio' : 'video'
  1355. this.pauseFun(type);
  1356. this.openTips(index)
  1357. return
  1358. }
  1359. this.pickCatalogActionFun(index, type)
  1360. },
  1361. pickCatalogActionFun(index, type) {
  1362. if (!this.$isLogin()) { //切换小节需要登录
  1363. this.$showLoginPage();
  1364. return;
  1365. }
  1366. if (this.isH5 && index > 1) {
  1367. uni.showToast({
  1368. title: "请下载App观看",
  1369. icon: 'none'
  1370. });
  1371. return;
  1372. }
  1373. //切换之前添加课程目录学习记录
  1374. this.addStudyCourse();
  1375. this.addIntegral(); //加福币
  1376. this.pickCatalogMethod(index, type);
  1377. },
  1378. pickCatalogMethod(index, type) {
  1379. setTimeout(() => {
  1380. this.scrollIntoViewId = 'cataLogue' + index;
  1381. }, 100)
  1382. let tempCatalogue = this.catalogueList[index];
  1383. console.log("qxj catalogueList", this.catalogueList);
  1384. this.lookDuration = 0; //重置观看当前小节的课程时长
  1385. // if(tempCatalogue.isVip==1){ //需要Vip才能观看
  1386. // if(!this.$isLogin()){
  1387. // this.$showLoginPage();
  1388. // return;
  1389. // }
  1390. // if(this.user==null){
  1391. // this.user=this.$getUserInfo();
  1392. // }
  1393. // if(this.user.isVip!=1 && tempCatalogue.isBuy!=1){
  1394. // this.openVipCourse(index);
  1395. // return;
  1396. // }
  1397. // }
  1398. this.pickCatalogIdx = index;
  1399. //传递消息给小节弹窗
  1400. uni.$emit('pickCatalogIdx', {
  1401. pickCatalogIdx: index,
  1402. type: type
  1403. });
  1404. this.pickCatalog = this.catalogueList[index];
  1405. // 获取章节看视频答题奖励后所得积分
  1406. this.answerPointsNum = this.pickCatalog.integralReward;
  1407. // 获取章节看视频答题奖励所需时间
  1408. this.pageEntryRequiredTime = Number(this.pickCatalog.watchDurationMinutes) * 60;
  1409. this.isShowQuestions = false
  1410. this.isShowAnswerPrompt = false
  1411. // 检查该章节是否已领取章节奖励-获取答题状态
  1412. this.checkPageEntryStatus();
  1413. this.pickCatalog.isFast = this.data.isFast
  1414. this.packageJsonList = this.pickCatalog && this.pickCatalog.packageJson ? JSON.parse(this.pickCatalog
  1415. .packageJson) : []
  1416. this.initStudyTime(this.pickCatalog.studyTime || 0)
  1417. const url = this.pickCatalog.lineTwo ? this.pickCatalog.lineTwo : this.pickCatalog.videoUrl
  1418. this.resetAudioContext(url)
  1419. },
  1420. resetAudioContext(url) {
  1421. if (this.audioContext == null) {
  1422. this.audioContext = uni.createInnerAudioContext();
  1423. }
  1424. this.audioContext.src = url
  1425. // this.audioContext.src = this.pickCatalog.videoUrl;
  1426. this.audioContext.onTimeUpdate(() => {
  1427. this.initStudyTime(this.audioContext.currentTime)
  1428. })
  1429. },
  1430. changeLine(data) {
  1431. this.resetAudioContext(data.url)
  1432. },
  1433. endedPlayNext(type) {
  1434. let nextCatalog = this.catalogueList[this.pickCatalogIdx + 1];
  1435. if (!nextCatalog) {
  1436. return;
  1437. }
  1438. if (nextCatalog && this.pickCatalogIdx < this.catalogueList.length - 1) { //未播放到最后一节自动续播
  1439. this.pickCatalogAction(this.pickCatalogIdx + 1)
  1440. }
  1441. },
  1442. endedPlayPrev() {
  1443. if (this.pickCatalogIdx == 0) {
  1444. uni.showToast({
  1445. title: '已经是第一节视频了',
  1446. icon: 'none',
  1447. position: 'top',
  1448. duration: 2000
  1449. })
  1450. return
  1451. }
  1452. let nextCatalog = this.catalogueList[this.pickCatalogIdx - 1];
  1453. if (!nextCatalog) {
  1454. return;
  1455. }
  1456. this.pickCatalogAction(this.pickCatalogIdx - 1)
  1457. },
  1458. addStudyCourse() {
  1459. if (this.catalogueList.length == 0 || this.tempAudioDuration == 0) {
  1460. return;
  1461. }
  1462. // this.pickCatalog=this.catalogueList[this.pickCatalogIdx];
  1463. // this.packageJsonList = this.pickCatalog && this.pickCatalog.packageJson ? JSON.parse(this.pickCatalog.packageJson) : []
  1464. // if(this.pickCatalog.isBuy==0){
  1465. // return;
  1466. // }
  1467. const parmas = {
  1468. "courseId": parseInt(this.courseId),
  1469. "duration": this.tempAudioDuration,
  1470. "videoId": this.pickCatalog.videoId
  1471. };
  1472. addDuration(parmas).then(res => {
  1473. if (res.code == 200) { }
  1474. },
  1475. rej => { }
  1476. );
  1477. },
  1478. addIntegral() {
  1479. // 观看到视频时长50%加一次福币
  1480. if (this.lookDuration == 0 || this.playDuration == 0) {
  1481. return;
  1482. }
  1483. // this.pickCatalog=this.catalogueList[this.pickCatalogIdx];
  1484. // this.packageJsonList = this.pickCatalog && this.pickCatalog.packageJson ? JSON.parse(this.pickCatalog.packageJson) : []
  1485. if (this.lookDuration < this.pickCatalog.seconds * 0.5) {
  1486. return;
  1487. }
  1488. let data = {
  1489. videoId: this.pickCatalog.videoId,
  1490. duration: this.lookDuration
  1491. };
  1492. getIntegral(data).then(res => {
  1493. if (res.code == 200) {
  1494. uni.showToast({
  1495. icon: 'none',
  1496. title: res.msg,
  1497. duration: 3000,
  1498. position: 'bottom'
  1499. });
  1500. this.countdowning = false;
  1501. }
  1502. },
  1503. rej => { }
  1504. );
  1505. },
  1506. closeShareAct() {
  1507. this.showShare = false;
  1508. },
  1509. closeTherapy() {
  1510. this.showTherapy = false
  1511. },
  1512. goToPro(productId) {
  1513. this.exitFullscreen = 'yes' + new Date().getTime()
  1514. this.showTherapy = false
  1515. setTimeout(() => {
  1516. uni.navigateTo({
  1517. url: "/pages/store/packageDetails?packageId=" + productId
  1518. });
  1519. }, 500);
  1520. },
  1521. // 返回视频
  1522. backPlayVideo() {
  1523. this.showAudio = false;
  1524. this.audioPlayIng = false;
  1525. this.isLearning = false;
  1526. this.pauseFun('audio');
  1527. this.playFun();
  1528. },
  1529. // 点击视频
  1530. clickVideo() {
  1531. this.isClickVideo = true
  1532. setTimeout(() => {
  1533. this.isClickVideo = false
  1534. }, 3000)
  1535. },
  1536. changeCountdowning(data) {
  1537. this.countdowning = data.countdowning;
  1538. // 视频是否暂停
  1539. if (data.isXGPause == false) {
  1540. setTimeout(() => {
  1541. this.isPause = data.isXGPause
  1542. }, 3000)
  1543. } else {
  1544. this.isPause = data.isXGPause
  1545. }
  1546. },
  1547. onTimeUpdate(data) {
  1548. this.playDuration = Math.round(data.time)
  1549. this.initStudyTime(this.playDuration)
  1550. if (data.time >= this.pickCatalog.seconds) {
  1551. this.countdowning = false; //观看时长开关关闭
  1552. }
  1553. if (this.isH5) {
  1554. if (this.allLookDuration >= 300) { //H5未登录状态播放五分钟就跳出登录页面
  1555. if (!this.$isLogin()) {
  1556. this.$showLoginPage();
  1557. const type = this.showAudio ? 'audio' : 'video'
  1558. this.pauseFun(type);
  1559. }
  1560. }
  1561. } else {
  1562. if (this.allLookDuration >= 120) { //未登录状态播放两分钟就跳出登录页面
  1563. if (!this.$isLogin()) {
  1564. this.$showLoginPage();
  1565. const type = this.showAudio ? 'audio' : 'video'
  1566. this.pauseFun(type);
  1567. }
  1568. }
  1569. }
  1570. // uni.$u.throttle(this.checkTherapy, 1000,false);
  1571. },
  1572. // 展示疗法
  1573. checkTherapy() {
  1574. let currentTime = Math.round(this.tempAudioDuration || 0)
  1575. let node = this.packageJsonList.filter(item => item.duration == currentTime)
  1576. if (node && node.length > 0) {
  1577. this.nodeTime = node[0].duration
  1578. this.showTherapyItem = node[0]
  1579. if (!this.showTherapy) {
  1580. this.showTherapy = true
  1581. }
  1582. } else {
  1583. if (this.showTherapy && this.nodeTime && this.nodeTime > currentTime) {
  1584. this.showTherapy = false
  1585. }
  1586. }
  1587. },
  1588. // 打开集观看提示弹窗
  1589. openTips(index) {
  1590. // #ifdef APP-PLUS
  1591. uni.$emit('getTipShowType', {
  1592. index: index
  1593. })
  1594. uni.getSubNVueById('videoPopup').show();
  1595. // #endif
  1596. },
  1597. tipConfirm() { // 提示确认
  1598. // 继续播放
  1599. //传递消息给小节弹窗
  1600. uni.$emit('pickCatalogIdx', {
  1601. pickCatalogIdx: this.pickCatalogIdx,
  1602. type: 'catalogueN'
  1603. });
  1604. this.playFun()
  1605. },
  1606. tipCancel(index) { // 提示取消
  1607. // 播放选择的一节
  1608. this.pickCatalogActionFun(index, 'catalogueN')
  1609. },
  1610. // 听声
  1611. handleListen() {
  1612. if (this.showAudio) {
  1613. this.backPlayVideo()
  1614. } else {
  1615. // 打开音频
  1616. this.showAudio = true
  1617. this.pauseFun('video');
  1618. this.playFun()
  1619. }
  1620. },
  1621. // 播放音频
  1622. playAudioAction(type) {
  1623. if (!this.audioPlayIng) {
  1624. setTimeout(() => {
  1625. this.audioContext.play()
  1626. }, 200)
  1627. } else {
  1628. this.pauseAudioAction()
  1629. }
  1630. this.audioPlayIng = !this.audioPlayIng;
  1631. },
  1632. // 播放
  1633. playFun() {
  1634. // console.log("initSocket videoId:",this.pickCatalog.videoId)
  1635. this.reOpenSocket = false
  1636. if (this.pickCatalog.videoId) {
  1637. this.getDanmuList()
  1638. if (this.socket) {
  1639. this.socket.close({
  1640. success: () => {
  1641. this.reOpenSocket = true
  1642. clearInterval(this.pingpangTimes)
  1643. }
  1644. })
  1645. } else {
  1646. this.initSocket()
  1647. }
  1648. }
  1649. this.audioPlayIng = false
  1650. if (this.showAudio) {
  1651. const ended = this.tempAudioDuration == this.pickCatalog.seconds
  1652. this.audioContext.seek(ended ? 0 : this.tempAudioDuration);
  1653. // this.audioContext.onSeeked(() => {
  1654. this.playAudioAction()
  1655. // })
  1656. } else {
  1657. this.videoPlayStatus = {
  1658. status: 'play' + new Date().getTime(),
  1659. tempAudioDuration: this.tempAudioDuration || 0,
  1660. studyTime: this.pickCatalog.studyTime,
  1661. }
  1662. }
  1663. },
  1664. initStudyTime(time) {
  1665. this.tempAudioDuration = Math.round(time)
  1666. },
  1667. // 暂停音频
  1668. pauseAudioAction() {
  1669. if (this.audioContext) {
  1670. setTimeout(() => {
  1671. this.audioContext.pause();
  1672. }, 200)
  1673. clearInterval(this.audioTimer);
  1674. this.audioTimer = null;
  1675. }
  1676. },
  1677. destoryAudio() {
  1678. if (this.audioContext) {
  1679. this.audioContext.destroy();
  1680. clearInterval(this.audioTimer);
  1681. this.audioTimer = null;
  1682. }
  1683. },
  1684. // 暂停
  1685. pauseFun(type) {
  1686. this.audioPlayIng = true
  1687. if (type == 'audio') {
  1688. this.pauseAudioAction()
  1689. } else if (type == 'video') {
  1690. this.videoPlayStatus = {
  1691. status: 'pause' + new Date().getTime(),
  1692. tempAudioDuration: this.tempAudioDuration || 0,
  1693. studyTime: this.pickCatalog.studyTime,
  1694. }
  1695. }
  1696. },
  1697. closePrivilege() {
  1698. this.$refs.popPrivilege.close();
  1699. },
  1700. closeTip() {
  1701. this.$refs.popTip.close();
  1702. },
  1703. canShowVip(item) {
  1704. return true;
  1705. if (this.user.isVip) {
  1706. return false;
  1707. }
  1708. return item.isVip == 1 && item.isBuy == 0;
  1709. },
  1710. confirmTip() {
  1711. this.getUserInfo();
  1712. this.getCourseInfo();
  1713. this.$refs.popTip.close();
  1714. uni.showLoading({
  1715. title: "请稍侯...",
  1716. mask: true,
  1717. duration: 3000
  1718. });
  1719. setTimeout(() => {
  1720. this.getCourseOrderById();
  1721. }, 2000);
  1722. },
  1723. getCourseOrderById() {
  1724. getCourseOrderById(this.courseOrderId).then(res => {
  1725. uni.hideLoading();
  1726. if (res.code == 200) {
  1727. if (res.order.status == 2 || res.order.payTime != null) {
  1728. // #ifdef APP-PLUS
  1729. if (plus.runtime.channel == "baidu") { //获取渠道标识
  1730. let bdCmdType = uni.getStorageSync("bdCmdType");
  1731. if (bdCmdType != null && parseInt(bdCmdType) <= 2) {
  1732. //this.$registerIdCode("orders",2,res.order.payMoney.toString()); //已下单
  1733. }
  1734. }
  1735. // #endif
  1736. uni.showToast({
  1737. title: "支付成功",
  1738. icon: 'success'
  1739. });
  1740. } else if (res.order.status == 1) {
  1741. uni.showToast({
  1742. title: "课程待支付请稍侯",
  1743. icon: 'none'
  1744. });
  1745. } else {
  1746. uni.showToast({
  1747. title: "支付失败",
  1748. icon: 'error'
  1749. });
  1750. }
  1751. }
  1752. },
  1753. rej => { }
  1754. );
  1755. },
  1756. handleTherapy(item, idx) {
  1757. this.scrollIntoTherapy = 'therapy' + idx,
  1758. this.therapyIndex = idx
  1759. setTimeout(() => {
  1760. uni.navigateTo({
  1761. url: "/pages/store/packageDetails?packageId=" + item.packageId
  1762. });
  1763. }, 500);
  1764. },
  1765. onFullscreenChange(data) {
  1766. this.fullScreen = data.isFullscreen
  1767. // direction取为 vertical 或 horizontal
  1768. this.direction = data.direction
  1769. if (!data.isFullscreen) {
  1770. // 退出全屏,锁定竖屏
  1771. // #ifdef APP-PLUS
  1772. plus.screen.lockOrientation('portrait-primary');
  1773. // #endif
  1774. }
  1775. },
  1776. // 全屏返回
  1777. videoback() {
  1778. this.exitFullscreen = 'yes' + new Date().getTime()
  1779. },
  1780. // 弹幕
  1781. openDanmu() {
  1782. // #ifdef H5
  1783. uni.showToast({
  1784. title: "请下载app发弹幕",
  1785. icon: "none"
  1786. })
  1787. return
  1788. // #endif
  1789. this.danmuIput = {
  1790. txt: '',
  1791. mode: 'scroll',
  1792. color: '#ffffff',
  1793. fontSize: '18px',
  1794. }
  1795. this.$refs.danmuPopup.open()
  1796. },
  1797. keyboardHeightChange(res) {
  1798. // #ifndef H5
  1799. this.danmuboxHeight = res.height
  1800. // #endif
  1801. },
  1802. openDanmuStyle(type) {
  1803. if (type == 2) {
  1804. uni.hideKeyboard()
  1805. }
  1806. },
  1807. clickStyle(type, value) {
  1808. if (type == 'mode') {
  1809. this.danmuIput.mode = value
  1810. } else if (type == 'font') {
  1811. this.danmuIput.fontSize = value
  1812. } else if (type == 'color') {
  1813. this.danmuIput.color = value
  1814. this.danmuIput.border = `solid 1px ${value}`
  1815. }
  1816. },
  1817. clickArea(value) {
  1818. this.danmuFunInfo = {
  1819. time: new Date().getTime(),
  1820. event: 'setArea',
  1821. switch: this.danmuFunInfo.switch,
  1822. area: value
  1823. }
  1824. },
  1825. // 发送弹幕
  1826. sendDanmu() {
  1827. if (this.danmuIput.txt == '' || this.danmuIput.txt.trim() == '') {
  1828. uni.showToast({
  1829. title: '弹幕不能为空',
  1830. icon: 'none'
  1831. })
  1832. return;
  1833. }
  1834. if (!this.isSend) {
  1835. return;
  1836. }
  1837. const param = {
  1838. userId: this.user.userId || '',
  1839. userType: 2, // 1-管理员,2-用户
  1840. courseId: this.courseId,
  1841. videoId: this.pickCatalog.videoId,
  1842. type: 1, // 评论类型 1:评论,2:回复,目前没有回复,默认传1就行了
  1843. content: this.danmuIput.txt,
  1844. time: this.tempAudioDuration, // 弹幕对应视频时间节点()秒
  1845. fontSize: this.danmuIput.fontSize,
  1846. mode: this.danmuIput.mode,
  1847. color: this.danmuIput.color,
  1848. }
  1849. saveMsg(param).then(res => {
  1850. if (res.code == 200) {
  1851. const status = res.status ? 0 : 1
  1852. this.sendMsg(param, status);
  1853. } else {
  1854. uni.showToast({
  1855. title: res.msg,
  1856. icon: "none"
  1857. })
  1858. }
  1859. })
  1860. },
  1861. // 弹幕开关
  1862. switchDanmu(type) {
  1863. this.danmuFunInfo = {
  1864. time: new Date().getTime(),
  1865. event: 'switch',
  1866. switch: type,
  1867. area: this.danmuFunInfo.area
  1868. }
  1869. },
  1870. // 弹幕列表
  1871. getDanmuList() {
  1872. this.danmuFunInfo = {
  1873. time: new Date().getTime(),
  1874. event: 'clearDanmuList',
  1875. switch: this.danmuFunInfo.switch,
  1876. area: this.danmuFunInfo.area,
  1877. }
  1878. let patam = {
  1879. pageNum: 1,
  1880. pageSize: 300,
  1881. courseId: this.courseId,
  1882. videoId: this.pickCatalog.videoId,
  1883. openCommentStatus: 2, // 1-开启评论;2-开启弹幕;3-关闭
  1884. }
  1885. getComments(patam).then(res => {
  1886. let danmuList = []
  1887. if (res.code == 200 && res.data.list && res.data.list.length > 0) {
  1888. let arry = res.data.list.sort((a, b) => a.time - b.time)
  1889. danmuList = arry.map(item => ({
  1890. duration: this.danmuItem.duration,
  1891. id: item.commentId,
  1892. txt: item.content,
  1893. start: Number(item.time || 0) * 1000, // 单位:ms 毫秒
  1894. mode: item.mode || this.danmuItem.mode,
  1895. style: {
  1896. color: item.color || this.danmuItem.style.color,
  1897. fontSize: item.fontSize || this.danmuItem.style.fontSize,
  1898. padding: this.danmuItem.style.padding,
  1899. border: this.user.userId == item.userId ? item.color ?
  1900. `solid 1px ${item.color}` : this.danmuItem.style.border : 'none',
  1901. borderRadius: this.user.userId == item.userId ? this.danmuItem.style
  1902. .borderRadius : 0,
  1903. backgroundColor: this.user.userId == item.userId ? this.danmuItem.style
  1904. .backgroundColor : 'transparent'
  1905. }
  1906. }))
  1907. }
  1908. try {
  1909. this.danmuFunInfo = {
  1910. time: new Date().getTime(),
  1911. event: 'getDanmuList',
  1912. switch: this.danmuFunInfo.switch,
  1913. danmuList: danmuList,
  1914. area: this.danmuFunInfo.area
  1915. }
  1916. } catch (e) {
  1917. console.log('e', e)
  1918. }
  1919. })
  1920. },
  1921. //创建一个socket连接
  1922. initSocket() {
  1923. let userId = this.user.userId;
  1924. let that = this;
  1925. this.socket = uni.connectSocket({
  1926. // url: getApp().globalData.danmuWSUrl + "/ws/barrage/" + this.pickCatalog.videoId,
  1927. url: getApp().globalData.danmuWSUrl + "/app/webSocket/" + userId,
  1928. multiple: true,
  1929. // header: {
  1930. // 'token': uni.getStorageSync('AppToken')
  1931. // },
  1932. success: res => {
  1933. console.log('WebSocket连接已打开1!');
  1934. that.isSocketOpen = true
  1935. that.reOpenSocket = false
  1936. // 保持心跳
  1937. if (that.pingpangTimes) {
  1938. clearInterval(that.pingpangTimes)
  1939. that.pingpangTimes = null
  1940. }
  1941. that.pingpangTimes = setInterval(() => {
  1942. // let data={cmd:"heartbeat",userId: userId};
  1943. let data = {
  1944. userId: userId || '',
  1945. userType: 2, // 1-管理员,2-用户
  1946. courseId: that.courseId,
  1947. videoId: that.pickCatalog.videoId,
  1948. type: 1, // 评论类型 1:评论,2:回复,目前没有回复,默认传1就行了
  1949. cmd: 'heartbeat'
  1950. }
  1951. that.socket.send({
  1952. data: JSON.stringify(data),
  1953. success: () => {
  1954. // console.log('WebSocket发送心条数据!');
  1955. },
  1956. fail: () => {
  1957. that.isSocketOpen = false
  1958. }
  1959. });
  1960. }, 15000)
  1961. },
  1962. error: err => {
  1963. console.log(err)
  1964. },
  1965. })
  1966. this.socket.onMessage((res) => {
  1967. // console.log("收到消息parse",JSON.parse(res.data))
  1968. const redata = JSON.parse(res.data);
  1969. if (redata.cmd == "heartbeat") {
  1970. //心跳
  1971. // console.log("heartbeat")
  1972. } else if (redata.cmd == "sendMsg") {
  1973. that.isSend = true;
  1974. that.addMsg(redata);
  1975. }
  1976. })
  1977. //监听socket打开
  1978. this.socket.onOpen(() => {
  1979. console.log('WebSocket连接已打开2!');
  1980. that.isSocketOpen = true
  1981. that.reOpenSocket = false
  1982. that.isSend = true;
  1983. })
  1984. //监听socket关闭
  1985. this.socket.onClose(() => {
  1986. that.isSocketOpen = false
  1987. that.socket = null
  1988. console.log('WebSocket连接已关闭!', that.reOpenSocket);
  1989. if (that.pingpangTimes) {
  1990. clearInterval(that.pingpangTimes)
  1991. that.pingpangTimes = null
  1992. }
  1993. if (that.reOpenSocket) {
  1994. //重启
  1995. that.initSocket()
  1996. }
  1997. // that.msgEnd = true
  1998. })
  1999. //监听socket错误
  2000. this.socket.onError((err) => {
  2001. console.log("socket err:", err)
  2002. that.isSocketOpen = false
  2003. that.reOpenSocket = false
  2004. that.socket = null
  2005. if (that.pingpangTimes) {
  2006. clearInterval(that.pingpangTimes)
  2007. that.pingpangTimes = null
  2008. }
  2009. })
  2010. },
  2011. sendMsg(param, status) {
  2012. if (status == 1) {
  2013. this.isSend = true;
  2014. this.addMsg({
  2015. msg: param.content,
  2016. time: param.time
  2017. }, 2)
  2018. return
  2019. }
  2020. if (this.isSocketOpen) {
  2021. var userId = this.user.userId;
  2022. var data = {
  2023. userId: userId || '',
  2024. userType: 2, // 1-管理员,2-用户
  2025. courseId: this.courseId,
  2026. videoId: this.pickCatalog.videoId,
  2027. type: 1, // 评论类型 1:评论,2:回复,目前没有回复,默认传1就行了
  2028. msg: param.content,
  2029. cmd: 'sendMsg',
  2030. time: param.time,
  2031. fontSize: param.fontSize,
  2032. mode: param.mode,
  2033. color: param.color,
  2034. };
  2035. this.socket.send({
  2036. data: JSON.stringify(data),
  2037. success: () => {
  2038. console.log("发送成功", data)
  2039. this.$refs.danmuPopup.close()
  2040. this.isSend = false;
  2041. },
  2042. fail: () => {
  2043. console.log("发送失败")
  2044. }
  2045. });
  2046. }
  2047. },
  2048. // 收到消息
  2049. addMsg(data, type) {
  2050. let obj = {}
  2051. if (type == 2) {
  2052. obj = {
  2053. content: data.msg,
  2054. courseId: this.courseId,
  2055. type: 1,
  2056. userId: this.userId,
  2057. userType: 2,
  2058. videoId: this.pickCatalog.videoId,
  2059. nickName: '',
  2060. time: data.time,
  2061. fontSize: data.fontSize,
  2062. mode: data.mode,
  2063. color: data.color,
  2064. }
  2065. } else {
  2066. obj = {
  2067. content: data.msg,
  2068. courseId: this.courseId,
  2069. type: data.type,
  2070. userId: data.userId,
  2071. userType: data.userType,
  2072. videoId: this.pickCatalog.videoId,
  2073. nickName: data.nickName,
  2074. time: data.time,
  2075. fontSize: data.fontSize,
  2076. mode: data.mode,
  2077. color: data.color,
  2078. }
  2079. }
  2080. this.addDanmuMsg(obj)
  2081. },
  2082. addDanmuMsg(content) {
  2083. const id = content.userId + '_' + new Date().getTime()
  2084. const mystyle = {
  2085. color: content.color || this.danmuItem.style.color,
  2086. fontSize: content.fontSize || this.danmuItem.style.fontSize,
  2087. border: content.color ? `solid 1px ${content.color}` : this.danmuItem.style.border,
  2088. borderRadius: this.danmuItem.style.borderRadius,
  2089. padding: this.danmuItem.style.padding,
  2090. backgroundColor: this.danmuItem.style.backgroundColor
  2091. }
  2092. const otherstyle = {
  2093. color: content.color || this.danmuItem.style.color,
  2094. fontSize: content.fontSize || this.danmuItem.style.fontSize,
  2095. padding: this.danmuItem.style.padding,
  2096. }
  2097. const mode = content.mode || this.danmuItem.mode
  2098. const danmuItem = {
  2099. //发送弹幕
  2100. duration: content.duration ? content.duration : mode == 'scro11' ? this.danmuItem.duration : this
  2101. .danmuItem.duration,
  2102. id: content.id || id,
  2103. txt: content.content,
  2104. mode: mode,
  2105. style: this.user.userId == content.userId ? mystyle : otherstyle
  2106. }
  2107. this.danmuFunInfo = {
  2108. time: new Date().getTime(),
  2109. event: 'send',
  2110. switch: this.danmuFunInfo.switch,
  2111. danmuItem: danmuItem,
  2112. area: this.danmuFunInfo.area
  2113. }
  2114. },
  2115. },
  2116. created() {
  2117. let that = this;
  2118. uni.$on('backStudyTime', function (data) {
  2119. that.videoId = data.videoId;
  2120. that.pickCatalogIdx = that.getCatalogIdx();
  2121. that.pickCatalog = that.catalogueList[that.pickCatalogIdx];
  2122. that.pickCatalog.studyTime = data.studyTimes;
  2123. that.catalogueList[that.pickCatalogIdx] = that.pickCatalog;
  2124. that.packageJsonList = that.pickCatalog && that.pickCatalog.packageJson ? JSON.parse(that
  2125. .pickCatalog.packageJson) : []
  2126. that.pickCatalogMethod(that.pickCatalogIdx);
  2127. });
  2128. uni.$on('showPayTips', function (data) {
  2129. console.log("qxj showPayTips")
  2130. that.courseOrderId = data.courseOrderId;
  2131. //that.showPayTips=true;
  2132. that.$refs.popTip.open();
  2133. });
  2134. uni.$on('refreshUser', function (data) {
  2135. that.getUserInfo();
  2136. that.getCourseInfo();
  2137. });
  2138. uni.$on('pickCatalogAction', function (data) {
  2139. that.pickCatalogAction(data.index, data.type);
  2140. });
  2141. uni.$on('refreshCatalog', function (index) {
  2142. let catalog = that.catalogueList[index];
  2143. catalog.isBuy = true;
  2144. that.catalogueList[index] = catalog;
  2145. that.pickCatalogAction(index);
  2146. });
  2147. },
  2148. beforeDestroy() {
  2149. if (this.socket != null) {
  2150. this.socket.close()
  2151. }
  2152. if (this.pingpangTimes) {
  2153. clearInterval(this.pingpangTimes)
  2154. this.pingpangTimes = null
  2155. }
  2156. this.danmuFunInfo = {
  2157. time: new Date().getTime(),
  2158. event: '',
  2159. area: this.danmuFunInfo.area
  2160. }
  2161. },
  2162. destroyed() {
  2163. uni.$off("backStudyTime");
  2164. uni.$off("refreshUser");
  2165. uni.$off("showPayTips");
  2166. uni.$off("pickCatalogAction");
  2167. uni.$off("refreshTitle");
  2168. uni.$off("refreshCatalog");
  2169. // #ifdef APP-PLUS
  2170. uni.$off('getEventType');
  2171. // #endif
  2172. }
  2173. }
  2174. </script>
  2175. <script module="xgplayer" lang="renderjs">
  2176. // import Player from "xgplayer"
  2177. // import Mp4Plugin from "xgplayer-mp4"
  2178. // import 'xgplayer/dist/index.min.css';
  2179. import Danmu from 'xgplayer/es/plugins/danmu'
  2180. // import "xgplayer/es/plugins/danmu/index.css"
  2181. let xgPlayer
  2182. const openDanmu = '/static/images/other/course/danmukai.png';
  2183. const closeDanmu = '/static/images/other/course/danmukai_1.png';
  2184. export default {
  2185. data() {
  2186. return {
  2187. player: null,
  2188. ownerInstance: null,
  2189. ownerInstanceVideo: null,
  2190. isFullscreen: false,
  2191. isCSSFull: false,
  2192. lineName: "",
  2193. danmuInstance: null,
  2194. newDanmu: {
  2195. //发送弹幕
  2196. duration: 10000,
  2197. id: '',
  2198. txt: '',
  2199. mode: 'scroll',
  2200. style: {
  2201. color: '#ffffff',
  2202. fontSize: '18px',
  2203. border: 'solid 1px #ffffff',
  2204. borderRadius: '10px',
  2205. padding: '5px 11px',
  2206. backgroundColor: 'rgba(255, 255, 255, 0.1)'
  2207. }
  2208. },
  2209. isXGPause: true,
  2210. }
  2211. },
  2212. beforeDestroy() {
  2213. if (this.player) {
  2214. if (this.isFullscreen) {
  2215. if (this.isCSSFull) {
  2216. this.player.exitCssFullscreen()
  2217. } else {
  2218. this.player.exitFullscreen()
  2219. }
  2220. }
  2221. this.player.destroy() // 销毁播放器
  2222. this.player = null
  2223. }
  2224. },
  2225. methods: {
  2226. initJs(newValue, oldValue, ownerInstance) {
  2227. if (typeof window.Player === 'function') {
  2228. this.initPlayer(newValue, oldValue, ownerInstance)
  2229. } else {
  2230. // 动态引入较大类库避免影响页面展示
  2231. const script = document.createElement('script')
  2232. // view 层的页面运行在根目录
  2233. script.src = 'https://unpkg.byted-static.com/xgplayer/3.0.20/dist/index.min.js'
  2234. script.onload = this.initPlayer.bind(this, newValue, oldValue, ownerInstance)
  2235. document.head.appendChild(script)
  2236. const l_tag = document.createElement('link'); // 引入播放器css
  2237. l_tag.rel = 'stylesheet';
  2238. l_tag.href = 'https://unpkg.byted-static.com/xgplayer/3.0.20/dist/index.min.css';
  2239. document.body.appendChild(l_tag);
  2240. }
  2241. },
  2242. initPlayer(newValue, oldValue, ownerInstance) {
  2243. this.Events = window.Player.Events
  2244. if (!this.ownerInstance) this.ownerInstance = ownerInstance
  2245. let xgplayerOption = {
  2246. lang: 'zh',
  2247. url: "",
  2248. id: 'detail-video',
  2249. autoplay: false,
  2250. // height: uni.upx2px(422),
  2251. height: '100%',
  2252. width: '100%',
  2253. poster: "",
  2254. 'x5-video-player-type': 'h5', // 微信内置浏览器设置,防止被浏览器劫持
  2255. playsinline: true,
  2256. playbackRate: false,
  2257. ignores: ['volume', 'miniscreen', 'keyboard'],
  2258. plugins: [Danmu],
  2259. danmu: {
  2260. "comments": [],
  2261. "area": {
  2262. "start": 0,
  2263. "end": 0.25
  2264. },
  2265. "closeDefaultBtn": true,
  2266. "defaultOpen": true,
  2267. ext: {
  2268. channelSize: 30
  2269. }
  2270. },
  2271. startTime: 0, // 起始播放时间
  2272. fullscreenTarget: document.querySelector('.video-container'),
  2273. controls: {
  2274. root: document.getElementById('controls_new_root') // 指定播放器之外挂载dom
  2275. },
  2276. // icons: {
  2277. // openDanmu: openDanmu,
  2278. // closeDanmu: closeDanmu
  2279. // },
  2280. commonStyle: {
  2281. // 播放完成部分进度条底色
  2282. playedColor: '#FF233C',
  2283. cachedColor: 'transparent'
  2284. },
  2285. seekedStatus: 'auto',
  2286. disableGesture: true,
  2287. closeVideoTouch: true,
  2288. closeVideoDblclick: true,
  2289. closeVideoClick: false,
  2290. progress: {
  2291. isDraggingSeek: false,
  2292. isCloseClickSeek: true,
  2293. closeMoveSeek: true
  2294. },
  2295. fullscreen: {
  2296. useScreenOrientation: true,
  2297. lockOrientationType: 'landscape'
  2298. },
  2299. definition: {
  2300. defaultDefinition: "线路二"
  2301. }
  2302. }
  2303. xgplayerOption.url = newValue.lineTwo ? newValue.lineTwo : newValue.videoUrl
  2304. xgplayerOption.definition.defaultDefinition = newValue.lineTwo ? '线路二' : '线路一'
  2305. if (!xgplayerOption.url) return
  2306. xgplayerOption.poster = newValue.thumbnail
  2307. if (newValue.studyTime && newValue.seconds != newValue.studyTime) {
  2308. xgplayerOption.startTime = newValue.studyTime
  2309. }
  2310. if (newValue.isFast == 1) {
  2311. // 允许拖动进度条
  2312. xgplayerOption.progress.isCloseClickSeek = false
  2313. xgplayerOption.progress.closeMoveSeek = false
  2314. } else {
  2315. // 不允许拖动进度条
  2316. xgplayerOption.progress.isCloseClickSeek = true
  2317. xgplayerOption.progress.closeMoveSeek = true
  2318. }
  2319. if (this.player) {
  2320. // this.player.off()
  2321. this.player.playNext({
  2322. url: newValue.lineTwo ? newValue.lineTwo : newValue.videoUrl,
  2323. startTime: newValue.startTime || 0,
  2324. poster: xgplayerOption.thumbnail || '',
  2325. ignores: xgplayerOption.ignores,
  2326. progress: xgplayerOption.progress,
  2327. definition: xgplayerOption.definition,
  2328. })
  2329. } else {
  2330. this.player = new Player(xgplayerOption);
  2331. this.danmuInstance = this.player.getPlugin('danmu')
  2332. this.progressMove(xgplayerOption)
  2333. }
  2334. if (newValue.isFast == 1) {
  2335. this.player.getPlugin('progress').show()
  2336. } else {
  2337. this.player.getPlugin('progress').hide()
  2338. }
  2339. let lines = []
  2340. if (newValue.lineOne) {
  2341. lines.push({
  2342. name: '线路一',
  2343. definition: '线路一',
  2344. url: newValue.lineOne
  2345. })
  2346. }
  2347. if (newValue.lineTwo) {
  2348. lines.push({
  2349. name: '线路二',
  2350. definition: '线路二',
  2351. url: newValue.lineTwo
  2352. })
  2353. }
  2354. if (newValue.lineThree) {
  2355. lines.push({
  2356. name: '线路三',
  2357. definition: '线路三',
  2358. url: newValue.lineThree
  2359. })
  2360. }
  2361. this.player.emit('resourceReady', lines)
  2362. this.rjsPlayFun(xgplayerOption)
  2363. },
  2364. progressMove(data) {
  2365. const Events = this.Events
  2366. this.player.on(Events.PlAY, () => {
  2367. this.isXGPause = false
  2368. this.ownerInstance.callMethod("changeCountdowning", {
  2369. countdowning: true,
  2370. isXGPause: this.isXGPause
  2371. })
  2372. })
  2373. this.player.on(Events.PLAYING, () => {
  2374. // console.log("===播放Events.PLAYING")
  2375. this.isXGPause = false
  2376. this.ownerInstance.callMethod("changeCountdowning", {
  2377. countdowning: true,
  2378. isXGPause: this.isXGPause
  2379. })
  2380. })
  2381. this.player.on(Events.WAITING, () => {
  2382. this.ownerInstance.callMethod("changeCountdowning", {
  2383. countdowning: false,
  2384. isXGPause: this.isXGPause
  2385. })
  2386. })
  2387. this.player.on(Events.PAUSE, () => {
  2388. // console.log("===暂停Events.PAUSE")
  2389. this.isXGPause = true
  2390. this.ownerInstance.callMethod("changeCountdowning", {
  2391. countdowning: false,
  2392. isXGPause: this.isXGPause
  2393. })
  2394. })
  2395. this.player.on(Events.ERROR, (error) => {
  2396. console.log('video error:', error)
  2397. this.ownerInstance.callMethod("changeCountdowning", {
  2398. countdowning: false,
  2399. isXGPause: this.isXGPause
  2400. })
  2401. })
  2402. // 监听用户的播放进度
  2403. this.player.on(Events.TIME_UPDATE, () => {
  2404. this.ownerInstance.callMethod("onTimeUpdate", {
  2405. time: this.player.currentTime
  2406. });
  2407. })
  2408. this.player.on(Events.ENDED, () => {
  2409. this.ownerInstance.callMethod("changeCountdowning", {
  2410. countdowning: false,
  2411. isXGPause: this.isXGPause
  2412. })
  2413. this.ownerInstance.callMethod("endedPlayNext")
  2414. })
  2415. this.player.on(Events.FULLSCREEN_CHANGE, (isFullscreen) => {
  2416. if (this.isFullscreen == isFullscreen) return
  2417. this.isFullscreen = isFullscreen
  2418. plus.screen.lockOrientation('landscape')
  2419. this.ownerInstance.callMethod("onFullscreenChange", {
  2420. isFullscreen: isFullscreen
  2421. })
  2422. })
  2423. this.player.on(Events.CSS_FULLSCREEN_CHANGE, (isFullscreen) => {
  2424. if (this.isFullscreen == isFullscreen) return
  2425. this.isCSSFull = true
  2426. this.isFullscreen = isFullscreen
  2427. this.ownerInstance.callMethod("onFullscreenChange", {
  2428. isFullscreen: isFullscreen
  2429. })
  2430. })
  2431. // 清晰度发生变化
  2432. this.player.on(Events.DEFINITION_CHANGE, (res) => {
  2433. if (this.lineName == res.to.name) return
  2434. this.lineName = res.to.name
  2435. this.ownerInstance.callMethod("changeLine", {
  2436. url: res.to.url
  2437. })
  2438. })
  2439. },
  2440. rjsPlayFun(xgplayerOption) {
  2441. this.ownerInstance.callMethod("playFun", {
  2442. time: xgplayerOption.startTime
  2443. })
  2444. },
  2445. changeVideo(newValue, oldValue, ownerInstance) {
  2446. if (!this.ownerInstanceVideo) this.ownerInstanceVideo = ownerInstance
  2447. if (this.player) {
  2448. if (newValue.status.indexOf('play') > -1) {
  2449. const tempAudioDuration = newValue.tempAudioDuration
  2450. const flag = newValue.tempAudioDuration != newValue.studyTime
  2451. if (flag) {
  2452. this.player.seek(tempAudioDuration)
  2453. this.player.on(this.Events.SEEKED, () => {
  2454. setTimeout(() => {
  2455. this.player.play()
  2456. }, 200)
  2457. })
  2458. } else {
  2459. setTimeout(() => {
  2460. this.player.play()
  2461. }, 200)
  2462. }
  2463. } else if (newValue.status.indexOf('pause') > -1) {
  2464. this.player.pause()
  2465. }
  2466. }
  2467. },
  2468. handleExitFullscreen(newValue, oldValue, ownerInstance) {
  2469. // 退出全屏
  2470. if (this.player && this.isFullscreen && newValue.indexOf('yes') > -1) {
  2471. if (this.isCSSFull) {
  2472. this.player.exitCssFullscreen()
  2473. } else {
  2474. this.player.exitFullscreen()
  2475. }
  2476. }
  2477. },
  2478. // 发送弹幕
  2479. danmuFun(newValue, oldValue, ownerInstance) {
  2480. if (oldValue && newValue.event == oldValue.event && newValue.time == oldValue.time) {
  2481. return
  2482. }
  2483. if (newValue.event == 'send') {
  2484. // 发送弹幕
  2485. // console.log("===========发送弹幕",this.danmuInstance)
  2486. this.danmuInstance.sendComment(newValue.danmuItem)
  2487. } else if (newValue.event == 'switch') {
  2488. // 弹幕开关
  2489. // console.log("===========弹幕开关",newValue.switch)
  2490. if (newValue.switch == 1) {
  2491. this.danmuInstance.start()
  2492. } else {
  2493. this.danmuInstance.stop()
  2494. }
  2495. } else if (newValue.event == "getDanmuList") {
  2496. // console.log("===========弹幕列表")
  2497. this.danmuInstance.updateComments(newValue.danmuList, true)
  2498. } else if (newValue.event == "clearDanmuList") {
  2499. // console.log("===========清除列表")
  2500. this.danmuInstance.clear()
  2501. } else if (newValue.event == "setArea") {
  2502. this.danmuInstance.setArea({
  2503. start: 0,
  2504. end: newValue.area,
  2505. })
  2506. }
  2507. }
  2508. }
  2509. }
  2510. </script>
  2511. <style>
  2512. @import './danmu.css';
  2513. </style>
  2514. <style lang="scss" scoped>
  2515. @mixin u-flex($flexD, $alignI, $justifyC) {
  2516. display: flex;
  2517. flex-direction: $flexD;
  2518. align-items: $alignI;
  2519. justify-content: $justifyC;
  2520. }
  2521. .es-mr-24px {
  2522. margin-right: 24px;
  2523. }
  2524. .coloritem {
  2525. height: 24px;
  2526. width: 24px;
  2527. margin-bottom: 12px;
  2528. border-radius: 5px;
  2529. }
  2530. .danmu-controls {
  2531. background-color: #F5F7FA;
  2532. overflow: hidden;
  2533. font-family: PingFang SC, PingFang SC;
  2534. font-weight: 400;
  2535. font-size: 12px;
  2536. color: #999999;
  2537. padding: 0 10px;
  2538. border-radius: 50px 0 0 50px;
  2539. height: 28px;
  2540. overflow: hidden;
  2541. box-sizing: border-box;
  2542. &-r {
  2543. padding: 0 10px;
  2544. border-radius: 0 50px 50px 0;
  2545. height: 28px;
  2546. overflow: hidden;
  2547. box-sizing: border-box;
  2548. background-color: #fff;
  2549. image {
  2550. height: 20px;
  2551. width: 20px;
  2552. }
  2553. }
  2554. }
  2555. ::v-deep {
  2556. .danmu-switch-open,
  2557. .danmu-switch-closed {
  2558. height: 25px;
  2559. width: 25px;
  2560. }
  2561. }
  2562. .xgplayer-switch {
  2563. background-image: linear-gradient(180deg, transparent, rgba(0, 0, 0, .37), rgba(0, 0, 0, .75), rgba(0, 0, 0, .75));
  2564. }
  2565. .danmuPopup {
  2566. background-color: #fff;
  2567. &-head {
  2568. width: 100%;
  2569. padding: 10px;
  2570. box-sizing: border-box;
  2571. overflow: hidden;
  2572. @include u-flex(row, center, flex-start);
  2573. .danmu-icon {
  2574. height: 24px;
  2575. width: 24px;
  2576. margin-right: 12px;
  2577. }
  2578. }
  2579. &-input {
  2580. flex: 1;
  2581. height: 35px;
  2582. }
  2583. &-send {
  2584. flex-shrink: 0;
  2585. height: 35px;
  2586. display: flex;
  2587. align-items: center;
  2588. justify-content: center;
  2589. padding: 5px 15px;
  2590. box-sizing: border-box;
  2591. background: #FF233C !important;
  2592. border-radius: 22px;
  2593. font-family: PingFang SC, PingFang SC;
  2594. font-weight: 500;
  2595. font-size: 15px;
  2596. color: #fff !important;
  2597. margin-left: 12px;
  2598. &::after {
  2599. border: none;
  2600. }
  2601. }
  2602. &-con {
  2603. background-color: #F5F7FA;
  2604. padding: 24px 12px 48px 12px;
  2605. font-family: PingFang SC, PingFang SC;
  2606. font-weight: 400;
  2607. font-size: 14px;
  2608. color: #757575;
  2609. }
  2610. }
  2611. .content {
  2612. background: #f7f7f7;
  2613. }
  2614. .cousrseImg {
  2615. position: absolute;
  2616. top: 0;
  2617. left: 0;
  2618. width: 100%;
  2619. height: 422rpx;
  2620. background-color: #000;
  2621. image {
  2622. width: 100%;
  2623. height: 100%;
  2624. }
  2625. }
  2626. .video-box {
  2627. width: 100%;
  2628. height: 422rpx;
  2629. overflow: hidden;
  2630. position: relative;
  2631. // padding-top: var(--status-bar-height);
  2632. }
  2633. .scroll-Y {
  2634. font-family: PingFang SC, PingFang SC;
  2635. font-weight: 400;
  2636. font-size: 28rpx;
  2637. color: #222222;
  2638. }
  2639. .horizontal {
  2640. width: 130px;
  2641. height: 150px;
  2642. position: absolute;
  2643. bottom: 50px;
  2644. left: 20px;
  2645. z-index: 999;
  2646. display: flex;
  2647. flex-direction: column;
  2648. align-items: center;
  2649. justify-content: flex-end;
  2650. background-color: transparent;
  2651. .es-w-40 {
  2652. width: 20px;
  2653. }
  2654. .es-h-40 {
  2655. height: 20px;
  2656. }
  2657. .goods {
  2658. width: 120px;
  2659. height: 140px;
  2660. border-radius: 10px;
  2661. background-color: rgba(255, 255, 255, 0.4);
  2662. overflow: hidden;
  2663. display: flex;
  2664. flex-direction: column;
  2665. align-items: center;
  2666. justify-content: center;
  2667. }
  2668. .goodsimg {
  2669. width: 100px;
  2670. height: 100px;
  2671. border-radius: 10px;
  2672. }
  2673. .goodsname {
  2674. width: 100px;
  2675. font-size: 12px;
  2676. box-sizing: border-box;
  2677. padding-top: 7px;
  2678. verflow: hidden;
  2679. word-break: break-all;
  2680. }
  2681. }
  2682. .rotate {
  2683. transform: rotate(-180deg);
  2684. }
  2685. .status_bar {
  2686. background-color: #000;
  2687. }
  2688. .back-img {
  2689. width: 25px;
  2690. height: 25px;
  2691. position: absolute;
  2692. top: 10px;
  2693. left: 34rpx;
  2694. z-index: 99;
  2695. }
  2696. .audiobox {
  2697. width: 100%;
  2698. height: 422rpx;
  2699. position: absolute;
  2700. top: 0;
  2701. left: 0;
  2702. background-color: #333;
  2703. z-index: 9990;
  2704. font-family: PingFang SC, PingFang SC;
  2705. font-weight: 400;
  2706. font-size: 26rpx;
  2707. color: #fff;
  2708. &-video {
  2709. background-color: rgba(255, 255, 255, 0.3);
  2710. padding: 8rpx 20rpx;
  2711. border-radius: 50rpx;
  2712. position: absolute;
  2713. bottom: 40rpx;
  2714. left: 50%;
  2715. transform: translateX(-50%);
  2716. z-index: 9991;
  2717. text-align: center;
  2718. }
  2719. &-title {
  2720. position: absolute;
  2721. top: 0;
  2722. left: 0;
  2723. z-index: 9991;
  2724. padding: 30rpx 40rpx;
  2725. width: 100%;
  2726. box-sizing: border-box;
  2727. background: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.8) 100%);
  2728. display: flex;
  2729. align-items: center;
  2730. .back {
  2731. width: 50rpx;
  2732. height: 50rpx;
  2733. margin-right: 15rpx;
  2734. flex-shrink: 0;
  2735. }
  2736. }
  2737. &-time {
  2738. margin-top: 18rpx;
  2739. font-size: 24rpx;
  2740. }
  2741. }
  2742. .scroll-Y {
  2743. font-family: PingFang SC, PingFang SC;
  2744. font-weight: 400;
  2745. font-size: 28rpx;
  2746. color: #222222;
  2747. }
  2748. .video-info {
  2749. padding: 30rpx 24rpx;
  2750. background-color: #fff;
  2751. &-header {
  2752. width: 100%;
  2753. @include u-flex(row, center, space-between);
  2754. }
  2755. &-headerl {
  2756. flex: 1;
  2757. @include u-flex(row, center, flex-start);
  2758. font-weight: 600;
  2759. font-size: 40rpx;
  2760. color: rgba(0, 0, 0, 0.85);
  2761. overflow: hidden;
  2762. image {
  2763. flex-shrink: 0;
  2764. width: 88rpx;
  2765. height: 88rpx;
  2766. margin-right: 28rpx;
  2767. background: #F5F7FA;
  2768. border-radius: 50%;
  2769. overflow: hidden;
  2770. }
  2771. }
  2772. .follow-btn {
  2773. @include u-flex(row, center, center);
  2774. height: 56rpx;
  2775. min-width: 154rpx;
  2776. padding: 0 23rpx;
  2777. background: #FF233C;
  2778. border-radius: 28rpx 28rpx 28rpx 28rpx;
  2779. color: #FFFFFF;
  2780. font-size: 28rpx;
  2781. image {
  2782. height: 32rpx;
  2783. width: 32rpx;
  2784. margin-right: 6rpx;
  2785. }
  2786. }
  2787. &-voice {
  2788. width: 100%;
  2789. padding: 24rpx 20rpx 38rpx 28rpx;
  2790. margin-top: 26rpx;
  2791. background: #F5F7FA;
  2792. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2793. box-sizing: border-box;
  2794. image {
  2795. width: 48rpx;
  2796. height: 48rpx;
  2797. }
  2798. &-l {
  2799. @include u-flex(row, center, flex-start);
  2800. image {
  2801. margin-right: 20rpx;
  2802. }
  2803. }
  2804. }
  2805. &-voicebox1 {
  2806. @include u-flex(row, center, space-between);
  2807. }
  2808. &-voicebox2 {
  2809. padding: 20rpx 0;
  2810. @include u-flex(row, center, space-between);
  2811. font-weight: 400;
  2812. font-size: 26rpx;
  2813. color: #757575;
  2814. .boTextClass {
  2815. font-weight: 400;
  2816. font-size: 32rpx;
  2817. color: rgba(0, 0, 0, 0.45);
  2818. }
  2819. }
  2820. ::v-deep .uni-collapse-item__title-arrow {
  2821. margin-right: -8rpx;
  2822. }
  2823. .opacity {
  2824. position: relative !important;
  2825. opacity: 1 !important;
  2826. z-index: 1 !important;
  2827. }
  2828. &-desc {
  2829. // margin-bottom: 52rpx;
  2830. font-weight: 400;
  2831. font-size: 32rpx;
  2832. color: rgba(0, 0, 0, 0.65);
  2833. line-height: 44rpx;
  2834. word-break: break-all;
  2835. overflow: hidden;
  2836. position: absolute;
  2837. opacity: 0;
  2838. z-index: -1;
  2839. .desc-image {
  2840. height: 60rpx;
  2841. width: 100%;
  2842. position: absolute;
  2843. bottom: 0;
  2844. left: 0;
  2845. }
  2846. }
  2847. .text-clamp {
  2848. display: -webkit-box;
  2849. -webkit-line-clamp: 2;
  2850. /* 显示的行数 */
  2851. -webkit-box-orient: vertical;
  2852. /* 内容会垂直堆叠 */
  2853. overflow: hidden;
  2854. /* 隐藏溢出的内容 */
  2855. text-overflow: ellipsis;
  2856. /* 当内容被裁剪时显示省略号 */
  2857. }
  2858. &-footer {
  2859. @include u-flex(row, center, space-between);
  2860. color: #757575;
  2861. font-weight: 400;
  2862. font-size: 24rpx;
  2863. view {
  2864. width: 128rpx;
  2865. height: 104rpx;
  2866. @include u-flex(column, center, center);
  2867. }
  2868. image {
  2869. width: 48rpx;
  2870. height: 48rpx;
  2871. margin-bottom: 8rpx;
  2872. }
  2873. }
  2874. }
  2875. .box-header {
  2876. margin-bottom: 24rpx;
  2877. padding: 0 24rpx;
  2878. @include u-flex(row, center, space-between);
  2879. font-weight: 500;
  2880. font-size: 24rpx;
  2881. color: #999999;
  2882. .kechengLeftClass {
  2883. @include u-flex(row, center, center);
  2884. }
  2885. &-title {
  2886. font-weight: 600;
  2887. font-size: 36rpx;
  2888. color: #222222;
  2889. }
  2890. .kechengIconClass {
  2891. width: 30rpx;
  2892. height: 30rpx;
  2893. margin-right: 12rpx
  2894. }
  2895. &-r {
  2896. @include u-flex(row, center, center);
  2897. image {
  2898. width: 16rpx;
  2899. height: 16rpx;
  2900. margin-left: 10rpx;
  2901. }
  2902. }
  2903. }
  2904. .therapy {
  2905. background-color: #fff;
  2906. padding-left: 24rpx;
  2907. padding-bottom: 20rpx;
  2908. &-scrollx {
  2909. white-space: nowrap;
  2910. width: 100%;
  2911. // margin-left: 24rpx;
  2912. }
  2913. &-scrollitem {
  2914. display: inline-block;
  2915. overflow: hidden;
  2916. background: #F5F7FA;
  2917. padding: 10rpx;
  2918. margin-right: 20rpx;
  2919. border-radius: 10rpx;
  2920. overflow: hidden;
  2921. border: 1rpx solid #F5F7FA;
  2922. box-sizing: border-box;
  2923. position: relative;
  2924. overflow: hidden;
  2925. image {
  2926. width: 200rpx;
  2927. height: 200rpx;
  2928. border-radius: 10rpx;
  2929. background-color: #F5F7FA;
  2930. }
  2931. &::after {
  2932. content: '查看详情';
  2933. background-color: #F5F7FA;
  2934. position: absolute;
  2935. top: 0;
  2936. left: 0;
  2937. font-weight: 400;
  2938. font-size: 20rpx;
  2939. padding: 4rpx 14rpx;
  2940. border-radius: 10rpx 0 10rpx 0;
  2941. color: #757575;
  2942. }
  2943. }
  2944. &-active {
  2945. background: #fff;
  2946. border: 1rpx solid #FF233C;
  2947. .therapy-goodsname {
  2948. color: #FF233C !important;
  2949. }
  2950. &::after {
  2951. background: #fff;
  2952. color: #FF233C !important;
  2953. }
  2954. }
  2955. &-goodsname {
  2956. margin-top: 6rpx;
  2957. width: 200rpx;
  2958. min-height: 64rpx;
  2959. font-size: 24rpx;
  2960. color: #757575;
  2961. word-break: break-all;
  2962. white-space: normal;
  2963. }
  2964. }
  2965. .video-directory {
  2966. background-color: #fff;
  2967. padding-top: 24rpx;
  2968. margin-top: 20rpx;
  2969. &-scrollx {
  2970. white-space: nowrap;
  2971. width: calc(100% - 24rpx);
  2972. margin-left: 24rpx;
  2973. }
  2974. &-scrollitem {
  2975. display: inline-block;
  2976. width: 280rpx;
  2977. height: 192rpx;
  2978. background: #F5F5F5;
  2979. border-radius: 20rpx;
  2980. margin-right: 24rpx;
  2981. padding: 24rpx;
  2982. box-sizing: border-box;
  2983. position: relative;
  2984. margin-bottom: 20rpx;
  2985. }
  2986. .freeflag {
  2987. min-width: 132rpx;
  2988. height: 44rpx;
  2989. padding: 0 12rpx;
  2990. text-align: center;
  2991. position: absolute;
  2992. right: 0;
  2993. top: 0;
  2994. font-size: 28rpx;
  2995. color: #FFFFFF;
  2996. border-radius: 0rpx 20rpx 0rpx 20rpx;
  2997. &-free {
  2998. // background: url('@/static/image/hall/free_lable_bg.png') no-repeat right / 100% 32rpx;
  2999. background-color: #FF233C;
  3000. }
  3001. &-member {
  3002. // background: url('@/static/image/hall/member_label_bg.png') no-repeat right / 100% 32rpx;
  3003. background-color: #FFB205;
  3004. }
  3005. }
  3006. &-num {
  3007. font-weight: 600;
  3008. font-size: 32rpx;
  3009. @include u-flex(row, center, flex-start);
  3010. margin-bottom: 12rpx;
  3011. image,
  3012. .empty {
  3013. width: 32rpx;
  3014. height: 32rpx;
  3015. margin-left: 10rpx;
  3016. }
  3017. }
  3018. &-title {
  3019. @include u-flex(row, center, space-between);
  3020. font-size: 32rpx;
  3021. color: #757575;
  3022. line-height: 44rpx;
  3023. word-break: break-all;
  3024. white-space: normal;
  3025. .imagebox {
  3026. flex-shrink: 0;
  3027. margin: 0 8rpx;
  3028. position: relative;
  3029. image {
  3030. width: 92rpx;
  3031. height: 72rpx;
  3032. border-radius: 8rpx 8rpx 8rpx 8rpx;
  3033. overflow: hidden;
  3034. }
  3035. }
  3036. }
  3037. .mask {
  3038. width: 92rpx;
  3039. height: 72rpx;
  3040. border-radius: 8rpx 8rpx 8rpx 8rpx;
  3041. background: rgba(0, 0, 0, 0.2);
  3042. overflow: hidden;
  3043. position: absolute;
  3044. top: 0;
  3045. left: 0;
  3046. z-index: 1;
  3047. @include u-flex(row, center, center);
  3048. image {
  3049. width: 24rpx;
  3050. height: 24rpx;
  3051. }
  3052. }
  3053. .active-scrollitem {
  3054. background: #FFF0F2FF;
  3055. color: #FF233CFF;
  3056. .video-directory-title {
  3057. color: #FF233CFF;
  3058. }
  3059. }
  3060. }
  3061. .video-comment {
  3062. background-color: #fff;
  3063. padding-top: 12rpx;
  3064. margin-top: 20rpx;
  3065. }
  3066. .hall-box {
  3067. @include u-flex(row, center, flex-start);
  3068. flex-wrap: wrap;
  3069. margin: 0 -18rpx -18rpx 0;
  3070. padding: 12rpx 24rpx 24rpx 24rpx;
  3071. .gapitem {
  3072. margin: 0 18rpx 18rpx 0;
  3073. }
  3074. }
  3075. .popbox {
  3076. background-color: #fff;
  3077. position: relative;
  3078. .box-header {
  3079. padding-top: 12rpx;
  3080. padding-bottom: 12rpx;
  3081. box-sizing: border-box;
  3082. background-color: #fff;
  3083. }
  3084. .popbox-body {
  3085. .comment,
  3086. .directoryinfo {
  3087. padding: 24rpx;
  3088. }
  3089. }
  3090. .search-box {
  3091. @include u-flex(row, center, space-between);
  3092. padding: 10px 24rpx;
  3093. .search {
  3094. padding: 0;
  3095. flex: 1;
  3096. image {
  3097. width: 24rpx;
  3098. height: 24rpx;
  3099. padding-left: 16rpx;
  3100. }
  3101. }
  3102. }
  3103. }
  3104. .search-btn {
  3105. flex-shrink: 0;
  3106. height: 68rpx;
  3107. padding: 0 42rpx;
  3108. margin-left: 20rpx;
  3109. background: #eef5fd;
  3110. border-radius: 34rpx 34rpx 34rpx 34rpx;
  3111. font-family: PingFang SC, PingFang SC;
  3112. font-weight: 600;
  3113. font-size: 26rpx;
  3114. color: #FF233C;
  3115. text-align: center;
  3116. line-height: 68rpx;
  3117. }
  3118. .comment-inputbox {
  3119. @include u-flex(row, center, space-between);
  3120. padding: 28rpx 24rpx;
  3121. box-sizing: border-box;
  3122. background: #FFFFFF;
  3123. .inputbox {
  3124. flex: 1;
  3125. height: 72rpx;
  3126. padding-left: 24rpx;
  3127. background: #F5F7FA;
  3128. border-radius: 36rpx 36rpx 36rpx 36rpx;
  3129. font-family: PingFang SC, PingFang SC;
  3130. font-weight: 400;
  3131. font-size: 26rpx;
  3132. color: #999999;
  3133. line-height: 72rpx;
  3134. }
  3135. .release-btn {
  3136. @extend .search-btn;
  3137. }
  3138. }
  3139. .audio {
  3140. display: flex;
  3141. flex-direction: row;
  3142. align-items: center;
  3143. font-family: PingFang SC, PingFang SC;
  3144. font-weight: 500;
  3145. font-size: 24rpx;
  3146. color: #757575;
  3147. &-play {
  3148. display: flex;
  3149. flex-direction: row;
  3150. align-items: center;
  3151. }
  3152. &-icon {
  3153. width: 48rpx;
  3154. height: 48rpx;
  3155. }
  3156. &-slider {
  3157. flex: 1;
  3158. }
  3159. &-time {
  3160. flex-shrink: 0;
  3161. }
  3162. }
  3163. .vipCourseBtn {
  3164. background: #1B1F22;
  3165. border-radius: 46rpx;
  3166. border: 1px solid #FFDAA3;
  3167. color: #FFDAA3;
  3168. width: calc(33.33333% - 46.6666rpx);
  3169. }
  3170. .vipAc {
  3171. background: linear-gradient(90deg, #FFE0B2, #F8BA8B);
  3172. border-radius: 46rpx;
  3173. border: 1px solid #FFDAA3;
  3174. color: #1B1F22;
  3175. }
  3176. .privilegeBox {
  3177. background-color: #171a1d;
  3178. box-sizing: border-box;
  3179. }
  3180. .primenu-box {
  3181. border-radius: 16rpx;
  3182. margin-top: 0rpx;
  3183. padding: 10rpx 20rpx;
  3184. }
  3185. .content-inner {
  3186. display: flex;
  3187. flex-wrap: wrap;
  3188. min-height: 310rpx;
  3189. }
  3190. .content-inner .item {
  3191. width: calc(33.3333333%);
  3192. height: 150rpx;
  3193. display: flex;
  3194. flex-direction: column;
  3195. align-items: center;
  3196. justify-content: center;
  3197. margin-top: 0rpx;
  3198. }
  3199. .content-inner .item .img {
  3200. width: 84rpx;
  3201. height: 84rpx;
  3202. margin-bottom: 8rpx;
  3203. }
  3204. .content-inner .item .label {
  3205. font-size: 32rpx;
  3206. color: #83878A;
  3207. }
  3208. .vipMethodItem {
  3209. border-radius: 10rpx;
  3210. width: calc(100%);
  3211. height: 70rpx;
  3212. color: #FDD8A1;
  3213. }
  3214. .payTypeItem {
  3215. background-color: #1B1F22;
  3216. border: 1px solid #fff;
  3217. border-radius: 10rpx;
  3218. width: calc(50% - 15rpx);
  3219. height: 94rpx;
  3220. }
  3221. .circle {
  3222. border: 1px solid #FDD8A1;
  3223. }
  3224. .pt_ac {
  3225. border: 1px solid #FDD8A1;
  3226. }
  3227. .slider-box {
  3228. flex: 1
  3229. }
  3230. .dataNumTextClass {
  3231. font-weight: 400;
  3232. font-size: 32rpx;
  3233. color: rgba(0, 0, 0, 0.45);
  3234. }
  3235. .bottomCommentInputClass {
  3236. position: fixed;
  3237. left: 0;
  3238. right: 0;
  3239. z-index: 900;
  3240. bottom: 0;
  3241. width: 100%;
  3242. height: 160rpx;
  3243. background-color: #fff;
  3244. padding: 0 24rpx 10rpx;
  3245. display: flex;
  3246. align-items: center;
  3247. padding-bottom: constant(safe-area-inset-bottom);
  3248. padding-bottom: env(safe-area-inset-bottom);
  3249. .input-box {
  3250. flex: 1;
  3251. background-color: #f5f5f5;
  3252. height: 96rpx;
  3253. border-radius: 48rpx;
  3254. padding: 0 30rpx;
  3255. font-size: 32rpx;
  3256. margin-right: 24rpx;
  3257. }
  3258. .send-btn {
  3259. width: 160rpx;
  3260. height: 96rpx;
  3261. background: linear-gradient(135deg, #FF5267 0%, #FF233C 100%);
  3262. border-radius: 48rpx;
  3263. font-weight: 600;
  3264. font-size: 40rpx;
  3265. text-align: center;
  3266. color: #FFFFFF;
  3267. line-height: 96rpx;
  3268. margin-right: 25rpx;
  3269. }
  3270. .icon-btn {
  3271. display: flex;
  3272. flex-direction: column;
  3273. align-items: center;
  3274. justify-content: center;
  3275. image {
  3276. width: 52rpx;
  3277. height: 52rpx;
  3278. }
  3279. text {
  3280. font-weight: 600;
  3281. font-size: 32rpx;
  3282. color: #222222;
  3283. margin-top: 4rpx;
  3284. }
  3285. }
  3286. }
  3287. </style>