info.vue 91 KB

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