info.vue 89 KB

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