info.vue 89 KB

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