info.vue 89 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461
  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. this.isShowQuestions = false
  1405. this.isShowAnswerPrompt = false
  1406. // 检查该章节是否已领取章节奖励-获取答题状态
  1407. this.checkPageEntryStatus();
  1408. this.pickCatalog.isFast = this.data.isFast
  1409. this.packageJsonList = this.pickCatalog && this.pickCatalog.packageJson ? JSON.parse(this.pickCatalog
  1410. .packageJson) : []
  1411. this.initStudyTime(this.pickCatalog.studyTime || 0)
  1412. const url = this.pickCatalog.lineTwo ? this.pickCatalog.lineTwo : this.pickCatalog.videoUrl
  1413. this.resetAudioContext(url)
  1414. },
  1415. resetAudioContext(url) {
  1416. if (this.audioContext == null) {
  1417. this.audioContext = uni.createInnerAudioContext();
  1418. }
  1419. this.audioContext.src = url
  1420. // this.audioContext.src = this.pickCatalog.videoUrl;
  1421. this.audioContext.onTimeUpdate(() => {
  1422. this.initStudyTime(this.audioContext.currentTime)
  1423. })
  1424. },
  1425. changeLine(data) {
  1426. this.resetAudioContext(data.url)
  1427. },
  1428. endedPlayNext(type) {
  1429. let nextCatalog = this.catalogueList[this.pickCatalogIdx + 1];
  1430. if (!nextCatalog) {
  1431. return;
  1432. }
  1433. if (nextCatalog && this.pickCatalogIdx < this.catalogueList.length - 1) { //未播放到最后一节自动续播
  1434. this.pickCatalogAction(this.pickCatalogIdx + 1)
  1435. }
  1436. },
  1437. endedPlayPrev() {
  1438. if (this.pickCatalogIdx == 0) {
  1439. uni.showToast({
  1440. title: '已经是第一节视频了',
  1441. icon: 'none',
  1442. position: 'top',
  1443. duration: 2000
  1444. })
  1445. return
  1446. }
  1447. let nextCatalog = this.catalogueList[this.pickCatalogIdx - 1];
  1448. if (!nextCatalog) {
  1449. return;
  1450. }
  1451. this.pickCatalogAction(this.pickCatalogIdx - 1)
  1452. },
  1453. addStudyCourse() {
  1454. if (this.catalogueList.length == 0 || this.tempAudioDuration == 0) {
  1455. return;
  1456. }
  1457. // this.pickCatalog=this.catalogueList[this.pickCatalogIdx];
  1458. // this.packageJsonList = this.pickCatalog && this.pickCatalog.packageJson ? JSON.parse(this.pickCatalog.packageJson) : []
  1459. // if(this.pickCatalog.isBuy==0){
  1460. // return;
  1461. // }
  1462. const parmas = {
  1463. "courseId": parseInt(this.courseId),
  1464. "duration": this.tempAudioDuration,
  1465. "videoId": this.pickCatalog.videoId
  1466. };
  1467. addDuration(parmas).then(res => {
  1468. if (res.code == 200) { }
  1469. },
  1470. rej => { }
  1471. );
  1472. },
  1473. addIntegral() {
  1474. // 观看到视频时长50%加一次福币
  1475. if (this.lookDuration == 0 || this.playDuration == 0) {
  1476. return;
  1477. }
  1478. // this.pickCatalog=this.catalogueList[this.pickCatalogIdx];
  1479. // this.packageJsonList = this.pickCatalog && this.pickCatalog.packageJson ? JSON.parse(this.pickCatalog.packageJson) : []
  1480. if (this.lookDuration < this.pickCatalog.seconds * 0.5) {
  1481. return;
  1482. }
  1483. let data = {
  1484. videoId: this.pickCatalog.videoId,
  1485. duration: this.lookDuration
  1486. };
  1487. getIntegral(data).then(res => {
  1488. if (res.code == 200) {
  1489. uni.showToast({
  1490. icon: 'none',
  1491. title: res.msg,
  1492. duration: 3000,
  1493. position: 'bottom'
  1494. });
  1495. this.countdowning = false;
  1496. }
  1497. },
  1498. rej => { }
  1499. );
  1500. },
  1501. closeShareAct() {
  1502. this.showShare = false;
  1503. },
  1504. closeTherapy() {
  1505. this.showTherapy = false
  1506. },
  1507. goToPro(productId) {
  1508. this.exitFullscreen = 'yes' + new Date().getTime()
  1509. this.showTherapy = false
  1510. setTimeout(() => {
  1511. uni.navigateTo({
  1512. url: "/pages/store/packageDetails?packageId=" + productId
  1513. });
  1514. }, 500);
  1515. },
  1516. // 返回视频
  1517. backPlayVideo() {
  1518. this.showAudio = false;
  1519. this.audioPlayIng = false;
  1520. this.isLearning = false;
  1521. this.pauseFun('audio');
  1522. this.playFun();
  1523. },
  1524. // 点击视频
  1525. clickVideo() {
  1526. this.isClickVideo = true
  1527. setTimeout(() => {
  1528. this.isClickVideo = false
  1529. }, 3000)
  1530. },
  1531. changeCountdowning(data) {
  1532. this.countdowning = data.countdowning;
  1533. // 视频是否暂停
  1534. if (data.isXGPause == false) {
  1535. setTimeout(() => {
  1536. this.isPause = data.isXGPause
  1537. }, 3000)
  1538. } else {
  1539. this.isPause = data.isXGPause
  1540. }
  1541. },
  1542. onTimeUpdate(data) {
  1543. this.playDuration = Math.round(data.time)
  1544. this.initStudyTime(this.playDuration)
  1545. if (data.time >= this.pickCatalog.seconds) {
  1546. this.countdowning = false; //观看时长开关关闭
  1547. }
  1548. if (this.isH5) {
  1549. if (this.allLookDuration >= 300) { //H5未登录状态播放五分钟就跳出登录页面
  1550. if (!this.$isLogin()) {
  1551. this.$showLoginPage();
  1552. const type = this.showAudio ? 'audio' : 'video'
  1553. this.pauseFun(type);
  1554. }
  1555. }
  1556. } else {
  1557. if (this.allLookDuration >= 120) { //未登录状态播放两分钟就跳出登录页面
  1558. if (!this.$isLogin()) {
  1559. this.$showLoginPage();
  1560. const type = this.showAudio ? 'audio' : 'video'
  1561. this.pauseFun(type);
  1562. }
  1563. }
  1564. }
  1565. // uni.$u.throttle(this.checkTherapy, 1000,false);
  1566. },
  1567. // 展示疗法
  1568. checkTherapy() {
  1569. let currentTime = Math.round(this.tempAudioDuration || 0)
  1570. let node = this.packageJsonList.filter(item => item.duration == currentTime)
  1571. if (node && node.length > 0) {
  1572. this.nodeTime = node[0].duration
  1573. this.showTherapyItem = node[0]
  1574. if (!this.showTherapy) {
  1575. this.showTherapy = true
  1576. }
  1577. } else {
  1578. if (this.showTherapy && this.nodeTime && this.nodeTime > currentTime) {
  1579. this.showTherapy = false
  1580. }
  1581. }
  1582. },
  1583. // 打开集观看提示弹窗
  1584. openTips(index) {
  1585. // #ifdef APP-PLUS
  1586. uni.$emit('getTipShowType', {
  1587. index: index
  1588. })
  1589. uni.getSubNVueById('videoPopup').show();
  1590. // #endif
  1591. },
  1592. tipConfirm() { // 提示确认
  1593. // 继续播放
  1594. //传递消息给小节弹窗
  1595. uni.$emit('pickCatalogIdx', {
  1596. pickCatalogIdx: this.pickCatalogIdx,
  1597. type: 'catalogueN'
  1598. });
  1599. this.playFun()
  1600. },
  1601. tipCancel(index) { // 提示取消
  1602. // 播放选择的一节
  1603. this.pickCatalogActionFun(index, 'catalogueN')
  1604. },
  1605. // 听声
  1606. handleListen() {
  1607. if (this.showAudio) {
  1608. this.backPlayVideo()
  1609. } else {
  1610. // 打开音频
  1611. this.showAudio = true
  1612. this.pauseFun('video');
  1613. this.playFun()
  1614. }
  1615. },
  1616. // 播放音频
  1617. playAudioAction(type) {
  1618. if (!this.audioPlayIng) {
  1619. setTimeout(() => {
  1620. this.audioContext.play()
  1621. }, 200)
  1622. } else {
  1623. this.pauseAudioAction()
  1624. }
  1625. this.audioPlayIng = !this.audioPlayIng;
  1626. },
  1627. // 播放
  1628. playFun() {
  1629. // console.log("initSocket videoId:",this.pickCatalog.videoId)
  1630. this.reOpenSocket = false
  1631. if (this.pickCatalog.videoId) {
  1632. this.getDanmuList()
  1633. if (this.socket) {
  1634. this.socket.close({
  1635. success: () => {
  1636. this.reOpenSocket = true
  1637. clearInterval(this.pingpangTimes)
  1638. }
  1639. })
  1640. } else {
  1641. this.initSocket()
  1642. }
  1643. }
  1644. this.audioPlayIng = false
  1645. if (this.showAudio) {
  1646. const ended = this.tempAudioDuration == this.pickCatalog.seconds
  1647. this.audioContext.seek(ended ? 0 : this.tempAudioDuration);
  1648. // this.audioContext.onSeeked(() => {
  1649. this.playAudioAction()
  1650. // })
  1651. } else {
  1652. this.videoPlayStatus = {
  1653. status: 'play' + new Date().getTime(),
  1654. tempAudioDuration: this.tempAudioDuration || 0,
  1655. studyTime: this.pickCatalog.studyTime,
  1656. }
  1657. }
  1658. },
  1659. initStudyTime(time) {
  1660. this.tempAudioDuration = Math.round(time)
  1661. },
  1662. // 暂停音频
  1663. pauseAudioAction() {
  1664. if (this.audioContext) {
  1665. setTimeout(() => {
  1666. this.audioContext.pause();
  1667. }, 200)
  1668. clearInterval(this.audioTimer);
  1669. this.audioTimer = null;
  1670. }
  1671. },
  1672. destoryAudio() {
  1673. if (this.audioContext) {
  1674. this.audioContext.destroy();
  1675. clearInterval(this.audioTimer);
  1676. this.audioTimer = null;
  1677. }
  1678. },
  1679. // 暂停
  1680. pauseFun(type) {
  1681. this.audioPlayIng = true
  1682. if (type == 'audio') {
  1683. this.pauseAudioAction()
  1684. } else if (type == 'video') {
  1685. this.videoPlayStatus = {
  1686. status: 'pause' + new Date().getTime(),
  1687. tempAudioDuration: this.tempAudioDuration || 0,
  1688. studyTime: this.pickCatalog.studyTime,
  1689. }
  1690. }
  1691. },
  1692. closePrivilege() {
  1693. this.$refs.popPrivilege.close();
  1694. },
  1695. closeTip() {
  1696. this.$refs.popTip.close();
  1697. },
  1698. canShowVip(item) {
  1699. return true;
  1700. if (this.user.isVip) {
  1701. return false;
  1702. }
  1703. return item.isVip == 1 && item.isBuy == 0;
  1704. },
  1705. confirmTip() {
  1706. this.getUserInfo();
  1707. this.getCourseInfo();
  1708. this.$refs.popTip.close();
  1709. uni.showLoading({
  1710. title: "请稍侯...",
  1711. mask: true,
  1712. duration: 3000
  1713. });
  1714. setTimeout(() => {
  1715. this.getCourseOrderById();
  1716. }, 2000);
  1717. },
  1718. getCourseOrderById() {
  1719. getCourseOrderById(this.courseOrderId).then(res => {
  1720. uni.hideLoading();
  1721. if (res.code == 200) {
  1722. if (res.order.status == 2 || res.order.payTime != null) {
  1723. // #ifdef APP-PLUS
  1724. if (plus.runtime.channel == "baidu") { //获取渠道标识
  1725. let bdCmdType = uni.getStorageSync("bdCmdType");
  1726. if (bdCmdType != null && parseInt(bdCmdType) <= 2) {
  1727. //this.$registerIdCode("orders",2,res.order.payMoney.toString()); //已下单
  1728. }
  1729. }
  1730. // #endif
  1731. uni.showToast({
  1732. title: "支付成功",
  1733. icon: 'success'
  1734. });
  1735. } else if (res.order.status == 1) {
  1736. uni.showToast({
  1737. title: "课程待支付请稍侯",
  1738. icon: 'none'
  1739. });
  1740. } else {
  1741. uni.showToast({
  1742. title: "支付失败",
  1743. icon: 'error'
  1744. });
  1745. }
  1746. }
  1747. },
  1748. rej => { }
  1749. );
  1750. },
  1751. handleTherapy(item, idx) {
  1752. this.scrollIntoTherapy = 'therapy' + idx,
  1753. this.therapyIndex = idx
  1754. setTimeout(() => {
  1755. uni.navigateTo({
  1756. url: "/pages/store/packageDetails?packageId=" + item.packageId
  1757. });
  1758. }, 500);
  1759. },
  1760. onFullscreenChange(data) {
  1761. this.fullScreen = data.isFullscreen
  1762. // direction取为 vertical 或 horizontal
  1763. this.direction = data.direction
  1764. if (!data.isFullscreen) {
  1765. // 退出全屏,锁定竖屏
  1766. // #ifdef APP-PLUS
  1767. plus.screen.lockOrientation('portrait-primary');
  1768. // #endif
  1769. }
  1770. },
  1771. // 全屏返回
  1772. videoback() {
  1773. this.exitFullscreen = 'yes' + new Date().getTime()
  1774. },
  1775. // 弹幕
  1776. openDanmu() {
  1777. // #ifdef H5
  1778. uni.showToast({
  1779. title: "请下载app发弹幕",
  1780. icon: "none"
  1781. })
  1782. return
  1783. // #endif
  1784. this.danmuIput = {
  1785. txt: '',
  1786. mode: 'scroll',
  1787. color: '#ffffff',
  1788. fontSize: '18px',
  1789. }
  1790. this.$refs.danmuPopup.open()
  1791. },
  1792. keyboardHeightChange(res) {
  1793. // #ifndef H5
  1794. this.danmuboxHeight = res.height
  1795. // #endif
  1796. },
  1797. openDanmuStyle(type) {
  1798. if (type == 2) {
  1799. uni.hideKeyboard()
  1800. }
  1801. },
  1802. clickStyle(type, value) {
  1803. if (type == 'mode') {
  1804. this.danmuIput.mode = value
  1805. } else if (type == 'font') {
  1806. this.danmuIput.fontSize = value
  1807. } else if (type == 'color') {
  1808. this.danmuIput.color = value
  1809. this.danmuIput.border = `solid 1px ${value}`
  1810. }
  1811. },
  1812. clickArea(value) {
  1813. this.danmuFunInfo = {
  1814. time: new Date().getTime(),
  1815. event: 'setArea',
  1816. switch: this.danmuFunInfo.switch,
  1817. area: value
  1818. }
  1819. },
  1820. // 发送弹幕
  1821. sendDanmu() {
  1822. if (this.danmuIput.txt == '' || this.danmuIput.txt.trim() == '') {
  1823. uni.showToast({
  1824. title: '弹幕不能为空',
  1825. icon: 'none'
  1826. })
  1827. return;
  1828. }
  1829. if (!this.isSend) {
  1830. return;
  1831. }
  1832. const param = {
  1833. userId: this.user.userId || '',
  1834. userType: 2, // 1-管理员,2-用户
  1835. courseId: this.courseId,
  1836. videoId: this.pickCatalog.videoId,
  1837. type: 1, // 评论类型 1:评论,2:回复,目前没有回复,默认传1就行了
  1838. content: this.danmuIput.txt,
  1839. time: this.tempAudioDuration, // 弹幕对应视频时间节点()秒
  1840. fontSize: this.danmuIput.fontSize,
  1841. mode: this.danmuIput.mode,
  1842. color: this.danmuIput.color,
  1843. }
  1844. saveMsg(param).then(res => {
  1845. if (res.code == 200) {
  1846. const status = res.status ? 0 : 1
  1847. this.sendMsg(param, status);
  1848. } else {
  1849. uni.showToast({
  1850. title: res.msg,
  1851. icon: "none"
  1852. })
  1853. }
  1854. })
  1855. },
  1856. // 弹幕开关
  1857. switchDanmu(type) {
  1858. this.danmuFunInfo = {
  1859. time: new Date().getTime(),
  1860. event: 'switch',
  1861. switch: type,
  1862. area: this.danmuFunInfo.area
  1863. }
  1864. },
  1865. // 弹幕列表
  1866. getDanmuList() {
  1867. this.danmuFunInfo = {
  1868. time: new Date().getTime(),
  1869. event: 'clearDanmuList',
  1870. switch: this.danmuFunInfo.switch,
  1871. area: this.danmuFunInfo.area,
  1872. }
  1873. let patam = {
  1874. pageNum: 1,
  1875. pageSize: 300,
  1876. courseId: this.courseId,
  1877. videoId: this.pickCatalog.videoId,
  1878. openCommentStatus: 2, // 1-开启评论;2-开启弹幕;3-关闭
  1879. }
  1880. getComments(patam).then(res => {
  1881. let danmuList = []
  1882. if (res.code == 200 && res.data.list && res.data.list.length > 0) {
  1883. let arry = res.data.list.sort((a, b) => a.time - b.time)
  1884. danmuList = arry.map(item => ({
  1885. duration: this.danmuItem.duration,
  1886. id: item.commentId,
  1887. txt: item.content,
  1888. start: Number(item.time || 0) * 1000, // 单位:ms 毫秒
  1889. mode: item.mode || this.danmuItem.mode,
  1890. style: {
  1891. color: item.color || this.danmuItem.style.color,
  1892. fontSize: item.fontSize || this.danmuItem.style.fontSize,
  1893. padding: this.danmuItem.style.padding,
  1894. border: this.user.userId == item.userId ? item.color ?
  1895. `solid 1px ${item.color}` : this.danmuItem.style.border : 'none',
  1896. borderRadius: this.user.userId == item.userId ? this.danmuItem.style
  1897. .borderRadius : 0,
  1898. backgroundColor: this.user.userId == item.userId ? this.danmuItem.style
  1899. .backgroundColor : 'transparent'
  1900. }
  1901. }))
  1902. }
  1903. try {
  1904. this.danmuFunInfo = {
  1905. time: new Date().getTime(),
  1906. event: 'getDanmuList',
  1907. switch: this.danmuFunInfo.switch,
  1908. danmuList: danmuList,
  1909. area: this.danmuFunInfo.area
  1910. }
  1911. } catch (e) {
  1912. console.log('e', e)
  1913. }
  1914. })
  1915. },
  1916. //创建一个socket连接
  1917. initSocket() {
  1918. let userId = this.user.userId;
  1919. let that = this;
  1920. this.socket = uni.connectSocket({
  1921. // url: getApp().globalData.danmuWSUrl + "/ws/barrage/" + this.pickCatalog.videoId,
  1922. url: getApp().globalData.danmuWSUrl + "/app/webSocket/" + userId,
  1923. multiple: true,
  1924. // header: {
  1925. // 'token': uni.getStorageSync('AppToken')
  1926. // },
  1927. success: res => {
  1928. console.log('WebSocket连接已打开1!');
  1929. that.isSocketOpen = true
  1930. that.reOpenSocket = false
  1931. // 保持心跳
  1932. if (that.pingpangTimes) {
  1933. clearInterval(that.pingpangTimes)
  1934. that.pingpangTimes = null
  1935. }
  1936. that.pingpangTimes = setInterval(() => {
  1937. // let data={cmd:"heartbeat",userId: userId};
  1938. let data = {
  1939. userId: userId || '',
  1940. userType: 2, // 1-管理员,2-用户
  1941. courseId: that.courseId,
  1942. videoId: that.pickCatalog.videoId,
  1943. type: 1, // 评论类型 1:评论,2:回复,目前没有回复,默认传1就行了
  1944. cmd: 'heartbeat'
  1945. }
  1946. that.socket.send({
  1947. data: JSON.stringify(data),
  1948. success: () => {
  1949. // console.log('WebSocket发送心条数据!');
  1950. },
  1951. fail: () => {
  1952. that.isSocketOpen = false
  1953. }
  1954. });
  1955. }, 15000)
  1956. },
  1957. error: err => {
  1958. console.log(err)
  1959. },
  1960. })
  1961. this.socket.onMessage((res) => {
  1962. // console.log("收到消息parse",JSON.parse(res.data))
  1963. const redata = JSON.parse(res.data);
  1964. if (redata.cmd == "heartbeat") {
  1965. //心跳
  1966. // console.log("heartbeat")
  1967. } else if (redata.cmd == "sendMsg") {
  1968. that.isSend = true;
  1969. that.addMsg(redata);
  1970. }
  1971. })
  1972. //监听socket打开
  1973. this.socket.onOpen(() => {
  1974. console.log('WebSocket连接已打开2!');
  1975. that.isSocketOpen = true
  1976. that.reOpenSocket = false
  1977. that.isSend = true;
  1978. })
  1979. //监听socket关闭
  1980. this.socket.onClose(() => {
  1981. that.isSocketOpen = false
  1982. that.socket = null
  1983. console.log('WebSocket连接已关闭!', that.reOpenSocket);
  1984. if (that.pingpangTimes) {
  1985. clearInterval(that.pingpangTimes)
  1986. that.pingpangTimes = null
  1987. }
  1988. if (that.reOpenSocket) {
  1989. //重启
  1990. that.initSocket()
  1991. }
  1992. // that.msgEnd = true
  1993. })
  1994. //监听socket错误
  1995. this.socket.onError((err) => {
  1996. console.log("socket err:", err)
  1997. that.isSocketOpen = false
  1998. that.reOpenSocket = false
  1999. that.socket = null
  2000. if (that.pingpangTimes) {
  2001. clearInterval(that.pingpangTimes)
  2002. that.pingpangTimes = null
  2003. }
  2004. })
  2005. },
  2006. sendMsg(param, status) {
  2007. if (status == 1) {
  2008. this.isSend = true;
  2009. this.addMsg({
  2010. msg: param.content,
  2011. time: param.time
  2012. }, 2)
  2013. return
  2014. }
  2015. if (this.isSocketOpen) {
  2016. var userId = this.user.userId;
  2017. var data = {
  2018. userId: userId || '',
  2019. userType: 2, // 1-管理员,2-用户
  2020. courseId: this.courseId,
  2021. videoId: this.pickCatalog.videoId,
  2022. type: 1, // 评论类型 1:评论,2:回复,目前没有回复,默认传1就行了
  2023. msg: param.content,
  2024. cmd: 'sendMsg',
  2025. time: param.time,
  2026. fontSize: param.fontSize,
  2027. mode: param.mode,
  2028. color: param.color,
  2029. };
  2030. this.socket.send({
  2031. data: JSON.stringify(data),
  2032. success: () => {
  2033. console.log("发送成功", data)
  2034. this.$refs.danmuPopup.close()
  2035. this.isSend = false;
  2036. },
  2037. fail: () => {
  2038. console.log("发送失败")
  2039. }
  2040. });
  2041. }
  2042. },
  2043. // 收到消息
  2044. addMsg(data, type) {
  2045. let obj = {}
  2046. if (type == 2) {
  2047. obj = {
  2048. content: data.msg,
  2049. courseId: this.courseId,
  2050. type: 1,
  2051. userId: this.userId,
  2052. userType: 2,
  2053. videoId: this.pickCatalog.videoId,
  2054. nickName: '',
  2055. time: data.time,
  2056. fontSize: data.fontSize,
  2057. mode: data.mode,
  2058. color: data.color,
  2059. }
  2060. } else {
  2061. obj = {
  2062. content: data.msg,
  2063. courseId: this.courseId,
  2064. type: data.type,
  2065. userId: data.userId,
  2066. userType: data.userType,
  2067. videoId: this.pickCatalog.videoId,
  2068. nickName: data.nickName,
  2069. time: data.time,
  2070. fontSize: data.fontSize,
  2071. mode: data.mode,
  2072. color: data.color,
  2073. }
  2074. }
  2075. this.addDanmuMsg(obj)
  2076. },
  2077. addDanmuMsg(content) {
  2078. const id = content.userId + '_' + new Date().getTime()
  2079. const mystyle = {
  2080. color: content.color || this.danmuItem.style.color,
  2081. fontSize: content.fontSize || this.danmuItem.style.fontSize,
  2082. border: content.color ? `solid 1px ${content.color}` : this.danmuItem.style.border,
  2083. borderRadius: this.danmuItem.style.borderRadius,
  2084. padding: this.danmuItem.style.padding,
  2085. backgroundColor: this.danmuItem.style.backgroundColor
  2086. }
  2087. const otherstyle = {
  2088. color: content.color || this.danmuItem.style.color,
  2089. fontSize: content.fontSize || this.danmuItem.style.fontSize,
  2090. padding: this.danmuItem.style.padding,
  2091. }
  2092. const mode = content.mode || this.danmuItem.mode
  2093. const danmuItem = {
  2094. //发送弹幕
  2095. duration: content.duration ? content.duration : mode == 'scro11' ? this.danmuItem.duration : this
  2096. .danmuItem.duration,
  2097. id: content.id || id,
  2098. txt: content.content,
  2099. mode: mode,
  2100. style: this.user.userId == content.userId ? mystyle : otherstyle
  2101. }
  2102. this.danmuFunInfo = {
  2103. time: new Date().getTime(),
  2104. event: 'send',
  2105. switch: this.danmuFunInfo.switch,
  2106. danmuItem: danmuItem,
  2107. area: this.danmuFunInfo.area
  2108. }
  2109. },
  2110. },
  2111. created() {
  2112. let that = this;
  2113. uni.$on('backStudyTime', function (data) {
  2114. that.videoId = data.videoId;
  2115. that.pickCatalogIdx = that.getCatalogIdx();
  2116. that.pickCatalog = that.catalogueList[that.pickCatalogIdx];
  2117. that.pickCatalog.studyTime = data.studyTimes;
  2118. that.catalogueList[that.pickCatalogIdx] = that.pickCatalog;
  2119. that.packageJsonList = that.pickCatalog && that.pickCatalog.packageJson ? JSON.parse(that
  2120. .pickCatalog.packageJson) : []
  2121. that.pickCatalogMethod(that.pickCatalogIdx);
  2122. });
  2123. uni.$on('showPayTips', function (data) {
  2124. console.log("qxj showPayTips")
  2125. that.courseOrderId = data.courseOrderId;
  2126. //that.showPayTips=true;
  2127. that.$refs.popTip.open();
  2128. });
  2129. uni.$on('refreshUser', function (data) {
  2130. that.getUserInfo();
  2131. that.getCourseInfo();
  2132. });
  2133. uni.$on('pickCatalogAction', function (data) {
  2134. that.pickCatalogAction(data.index, data.type);
  2135. });
  2136. uni.$on('refreshCatalog', function (index) {
  2137. let catalog = that.catalogueList[index];
  2138. catalog.isBuy = true;
  2139. that.catalogueList[index] = catalog;
  2140. that.pickCatalogAction(index);
  2141. });
  2142. },
  2143. beforeDestroy() {
  2144. if (this.socket != null) {
  2145. this.socket.close()
  2146. }
  2147. if (this.pingpangTimes) {
  2148. clearInterval(this.pingpangTimes)
  2149. this.pingpangTimes = null
  2150. }
  2151. this.danmuFunInfo = {
  2152. time: new Date().getTime(),
  2153. event: '',
  2154. area: this.danmuFunInfo.area
  2155. }
  2156. },
  2157. destroyed() {
  2158. uni.$off("backStudyTime");
  2159. uni.$off("refreshUser");
  2160. uni.$off("showPayTips");
  2161. uni.$off("pickCatalogAction");
  2162. uni.$off("refreshTitle");
  2163. uni.$off("refreshCatalog");
  2164. // #ifdef APP-PLUS
  2165. uni.$off('getEventType');
  2166. // #endif
  2167. }
  2168. }
  2169. </script>
  2170. <script module="xgplayer" lang="renderjs">
  2171. // import Player from "xgplayer"
  2172. // import Mp4Plugin from "xgplayer-mp4"
  2173. // import 'xgplayer/dist/index.min.css';
  2174. import Danmu from 'xgplayer/es/plugins/danmu'
  2175. // import "xgplayer/es/plugins/danmu/index.css"
  2176. let xgPlayer
  2177. const openDanmu = '/static/images/other/course/danmukai.png';
  2178. const closeDanmu = '/static/images/other/course/danmukai_1.png';
  2179. export default {
  2180. data() {
  2181. return {
  2182. player: null,
  2183. ownerInstance: null,
  2184. ownerInstanceVideo: null,
  2185. isFullscreen: false,
  2186. isCSSFull: false,
  2187. lineName: "",
  2188. danmuInstance: null,
  2189. newDanmu: {
  2190. //发送弹幕
  2191. duration: 10000,
  2192. id: '',
  2193. txt: '',
  2194. mode: 'scroll',
  2195. style: {
  2196. color: '#ffffff',
  2197. fontSize: '18px',
  2198. border: 'solid 1px #ffffff',
  2199. borderRadius: '10px',
  2200. padding: '5px 11px',
  2201. backgroundColor: 'rgba(255, 255, 255, 0.1)'
  2202. }
  2203. },
  2204. isXGPause: true,
  2205. }
  2206. },
  2207. beforeDestroy() {
  2208. if (this.player) {
  2209. if (this.isFullscreen) {
  2210. if (this.isCSSFull) {
  2211. this.player.exitCssFullscreen()
  2212. } else {
  2213. this.player.exitFullscreen()
  2214. }
  2215. }
  2216. this.player.destroy() // 销毁播放器
  2217. this.player = null
  2218. }
  2219. },
  2220. methods: {
  2221. initJs(newValue, oldValue, ownerInstance) {
  2222. if (typeof window.Player === 'function') {
  2223. this.initPlayer(newValue, oldValue, ownerInstance)
  2224. } else {
  2225. // 动态引入较大类库避免影响页面展示
  2226. const script = document.createElement('script')
  2227. // view 层的页面运行在根目录
  2228. script.src = 'https://unpkg.byted-static.com/xgplayer/3.0.20/dist/index.min.js'
  2229. script.onload = this.initPlayer.bind(this, newValue, oldValue, ownerInstance)
  2230. document.head.appendChild(script)
  2231. const l_tag = document.createElement('link'); // 引入播放器css
  2232. l_tag.rel = 'stylesheet';
  2233. l_tag.href = 'https://unpkg.byted-static.com/xgplayer/3.0.20/dist/index.min.css';
  2234. document.body.appendChild(l_tag);
  2235. }
  2236. },
  2237. initPlayer(newValue, oldValue, ownerInstance) {
  2238. this.Events = window.Player.Events
  2239. if (!this.ownerInstance) this.ownerInstance = ownerInstance
  2240. let xgplayerOption = {
  2241. lang: 'zh',
  2242. url: "",
  2243. id: 'detail-video',
  2244. autoplay: false,
  2245. // height: uni.upx2px(422),
  2246. height: '100%',
  2247. width: '100%',
  2248. poster: "",
  2249. 'x5-video-player-type': 'h5', // 微信内置浏览器设置,防止被浏览器劫持
  2250. playsinline: true,
  2251. playbackRate: false,
  2252. ignores: ['volume', 'miniscreen', 'keyboard'],
  2253. plugins: [Danmu],
  2254. danmu: {
  2255. "comments": [],
  2256. "area": {
  2257. "start": 0,
  2258. "end": 0.25
  2259. },
  2260. "closeDefaultBtn": true,
  2261. "defaultOpen": true,
  2262. ext: {
  2263. channelSize: 30
  2264. }
  2265. },
  2266. startTime: 0, // 起始播放时间
  2267. fullscreenTarget: document.querySelector('.video-container'),
  2268. controls: {
  2269. root: document.getElementById('controls_new_root') // 指定播放器之外挂载dom
  2270. },
  2271. // icons: {
  2272. // openDanmu: openDanmu,
  2273. // closeDanmu: closeDanmu
  2274. // },
  2275. commonStyle: {
  2276. // 播放完成部分进度条底色
  2277. playedColor: '#FF233C',
  2278. cachedColor: 'transparent'
  2279. },
  2280. seekedStatus: 'auto',
  2281. disableGesture: true,
  2282. closeVideoTouch: true,
  2283. closeVideoDblclick: true,
  2284. closeVideoClick: false,
  2285. progress: {
  2286. isDraggingSeek: false,
  2287. isCloseClickSeek: true,
  2288. closeMoveSeek: true
  2289. },
  2290. fullscreen: {
  2291. useScreenOrientation: true,
  2292. lockOrientationType: 'landscape'
  2293. },
  2294. definition: {
  2295. defaultDefinition: "线路二"
  2296. }
  2297. }
  2298. xgplayerOption.url = newValue.lineTwo ? newValue.lineTwo : newValue.videoUrl
  2299. xgplayerOption.definition.defaultDefinition = newValue.lineTwo ? '线路二' : '线路一'
  2300. if (!xgplayerOption.url) return
  2301. xgplayerOption.poster = newValue.thumbnail
  2302. if (newValue.studyTime && newValue.seconds != newValue.studyTime) {
  2303. xgplayerOption.startTime = newValue.studyTime
  2304. }
  2305. if (newValue.isFast == 1) {
  2306. // 允许拖动进度条
  2307. xgplayerOption.progress.isCloseClickSeek = false
  2308. xgplayerOption.progress.closeMoveSeek = false
  2309. } else {
  2310. // 不允许拖动进度条
  2311. xgplayerOption.progress.isCloseClickSeek = true
  2312. xgplayerOption.progress.closeMoveSeek = true
  2313. }
  2314. if (this.player) {
  2315. // this.player.off()
  2316. this.player.playNext({
  2317. url: newValue.lineTwo ? newValue.lineTwo : newValue.videoUrl,
  2318. startTime: newValue.startTime || 0,
  2319. poster: xgplayerOption.thumbnail || '',
  2320. ignores: xgplayerOption.ignores,
  2321. progress: xgplayerOption.progress,
  2322. definition: xgplayerOption.definition,
  2323. })
  2324. } else {
  2325. this.player = new Player(xgplayerOption);
  2326. this.danmuInstance = this.player.getPlugin('danmu')
  2327. this.progressMove(xgplayerOption)
  2328. }
  2329. if (newValue.isFast == 1) {
  2330. this.player.getPlugin('progress').show()
  2331. } else {
  2332. this.player.getPlugin('progress').hide()
  2333. }
  2334. let lines = []
  2335. if (newValue.lineOne) {
  2336. lines.push({
  2337. name: '线路一',
  2338. definition: '线路一',
  2339. url: newValue.lineOne
  2340. })
  2341. }
  2342. if (newValue.lineTwo) {
  2343. lines.push({
  2344. name: '线路二',
  2345. definition: '线路二',
  2346. url: newValue.lineTwo
  2347. })
  2348. }
  2349. if (newValue.lineThree) {
  2350. lines.push({
  2351. name: '线路三',
  2352. definition: '线路三',
  2353. url: newValue.lineThree
  2354. })
  2355. }
  2356. this.player.emit('resourceReady', lines)
  2357. this.rjsPlayFun(xgplayerOption)
  2358. },
  2359. progressMove(data) {
  2360. const Events = this.Events
  2361. this.player.on(Events.PlAY, () => {
  2362. this.isXGPause = false
  2363. this.ownerInstance.callMethod("changeCountdowning", {
  2364. countdowning: true,
  2365. isXGPause: this.isXGPause
  2366. })
  2367. })
  2368. this.player.on(Events.PLAYING, () => {
  2369. // console.log("===播放Events.PLAYING")
  2370. this.isXGPause = false
  2371. this.ownerInstance.callMethod("changeCountdowning", {
  2372. countdowning: true,
  2373. isXGPause: this.isXGPause
  2374. })
  2375. })
  2376. this.player.on(Events.WAITING, () => {
  2377. this.ownerInstance.callMethod("changeCountdowning", {
  2378. countdowning: false,
  2379. isXGPause: this.isXGPause
  2380. })
  2381. })
  2382. this.player.on(Events.PAUSE, () => {
  2383. // console.log("===暂停Events.PAUSE")
  2384. this.isXGPause = true
  2385. this.ownerInstance.callMethod("changeCountdowning", {
  2386. countdowning: false,
  2387. isXGPause: this.isXGPause
  2388. })
  2389. })
  2390. this.player.on(Events.ERROR, (error) => {
  2391. console.log('video error:', error)
  2392. this.ownerInstance.callMethod("changeCountdowning", {
  2393. countdowning: false,
  2394. isXGPause: this.isXGPause
  2395. })
  2396. })
  2397. // 监听用户的播放进度
  2398. this.player.on(Events.TIME_UPDATE, () => {
  2399. this.ownerInstance.callMethod("onTimeUpdate", {
  2400. time: this.player.currentTime
  2401. });
  2402. })
  2403. this.player.on(Events.ENDED, () => {
  2404. this.ownerInstance.callMethod("changeCountdowning", {
  2405. countdowning: false,
  2406. isXGPause: this.isXGPause
  2407. })
  2408. this.ownerInstance.callMethod("endedPlayNext")
  2409. })
  2410. this.player.on(Events.FULLSCREEN_CHANGE, (isFullscreen) => {
  2411. if (this.isFullscreen == isFullscreen) return
  2412. this.isFullscreen = isFullscreen
  2413. plus.screen.lockOrientation('landscape')
  2414. this.ownerInstance.callMethod("onFullscreenChange", {
  2415. isFullscreen: isFullscreen
  2416. })
  2417. })
  2418. this.player.on(Events.CSS_FULLSCREEN_CHANGE, (isFullscreen) => {
  2419. if (this.isFullscreen == isFullscreen) return
  2420. this.isCSSFull = true
  2421. this.isFullscreen = isFullscreen
  2422. this.ownerInstance.callMethod("onFullscreenChange", {
  2423. isFullscreen: isFullscreen
  2424. })
  2425. })
  2426. // 清晰度发生变化
  2427. this.player.on(Events.DEFINITION_CHANGE, (res) => {
  2428. if (this.lineName == res.to.name) return
  2429. this.lineName = res.to.name
  2430. this.ownerInstance.callMethod("changeLine", {
  2431. url: res.to.url
  2432. })
  2433. })
  2434. },
  2435. rjsPlayFun(xgplayerOption) {
  2436. this.ownerInstance.callMethod("playFun", {
  2437. time: xgplayerOption.startTime
  2438. })
  2439. },
  2440. changeVideo(newValue, oldValue, ownerInstance) {
  2441. if (!this.ownerInstanceVideo) this.ownerInstanceVideo = ownerInstance
  2442. if (this.player) {
  2443. if (newValue.status.indexOf('play') > -1) {
  2444. const tempAudioDuration = newValue.tempAudioDuration
  2445. const flag = newValue.tempAudioDuration != newValue.studyTime
  2446. if (flag) {
  2447. this.player.seek(tempAudioDuration)
  2448. this.player.on(this.Events.SEEKED, () => {
  2449. setTimeout(() => {
  2450. this.player.play()
  2451. }, 200)
  2452. })
  2453. } else {
  2454. setTimeout(() => {
  2455. this.player.play()
  2456. }, 200)
  2457. }
  2458. } else if (newValue.status.indexOf('pause') > -1) {
  2459. this.player.pause()
  2460. }
  2461. }
  2462. },
  2463. handleExitFullscreen(newValue, oldValue, ownerInstance) {
  2464. // 退出全屏
  2465. if (this.player && this.isFullscreen && newValue.indexOf('yes') > -1) {
  2466. if (this.isCSSFull) {
  2467. this.player.exitCssFullscreen()
  2468. } else {
  2469. this.player.exitFullscreen()
  2470. }
  2471. }
  2472. },
  2473. // 发送弹幕
  2474. danmuFun(newValue, oldValue, ownerInstance) {
  2475. if (oldValue && newValue.event == oldValue.event && newValue.time == oldValue.time) {
  2476. return
  2477. }
  2478. if (newValue.event == 'send') {
  2479. // 发送弹幕
  2480. // console.log("===========发送弹幕",this.danmuInstance)
  2481. this.danmuInstance.sendComment(newValue.danmuItem)
  2482. } else if (newValue.event == 'switch') {
  2483. // 弹幕开关
  2484. // console.log("===========弹幕开关",newValue.switch)
  2485. if (newValue.switch == 1) {
  2486. this.danmuInstance.start()
  2487. } else {
  2488. this.danmuInstance.stop()
  2489. }
  2490. } else if (newValue.event == "getDanmuList") {
  2491. // console.log("===========弹幕列表")
  2492. this.danmuInstance.updateComments(newValue.danmuList, true)
  2493. } else if (newValue.event == "clearDanmuList") {
  2494. // console.log("===========清除列表")
  2495. this.danmuInstance.clear()
  2496. } else if (newValue.event == "setArea") {
  2497. this.danmuInstance.setArea({
  2498. start: 0,
  2499. end: newValue.area,
  2500. })
  2501. }
  2502. }
  2503. }
  2504. }
  2505. </script>
  2506. <style>
  2507. @import './danmu.css';
  2508. </style>
  2509. <style lang="scss" scoped>
  2510. @mixin u-flex($flexD, $alignI, $justifyC) {
  2511. display: flex;
  2512. flex-direction: $flexD;
  2513. align-items: $alignI;
  2514. justify-content: $justifyC;
  2515. }
  2516. .es-mr-24px {
  2517. margin-right: 24px;
  2518. }
  2519. .coloritem {
  2520. height: 24px;
  2521. width: 24px;
  2522. margin-bottom: 12px;
  2523. border-radius: 5px;
  2524. }
  2525. .danmu-controls {
  2526. background-color: #F5F7FA;
  2527. overflow: hidden;
  2528. font-family: PingFang SC, PingFang SC;
  2529. font-weight: 400;
  2530. font-size: 12px;
  2531. color: #999999;
  2532. padding: 0 10px;
  2533. border-radius: 50px 0 0 50px;
  2534. height: 28px;
  2535. overflow: hidden;
  2536. box-sizing: border-box;
  2537. &-r {
  2538. padding: 0 10px;
  2539. border-radius: 0 50px 50px 0;
  2540. height: 28px;
  2541. overflow: hidden;
  2542. box-sizing: border-box;
  2543. background-color: #fff;
  2544. image {
  2545. height: 20px;
  2546. width: 20px;
  2547. }
  2548. }
  2549. }
  2550. ::v-deep {
  2551. .danmu-switch-open,
  2552. .danmu-switch-closed {
  2553. height: 25px;
  2554. width: 25px;
  2555. }
  2556. }
  2557. .xgplayer-switch {
  2558. background-image: linear-gradient(180deg, transparent, rgba(0, 0, 0, .37), rgba(0, 0, 0, .75), rgba(0, 0, 0, .75));
  2559. }
  2560. .danmuPopup {
  2561. background-color: #fff;
  2562. &-head {
  2563. width: 100%;
  2564. padding: 10px;
  2565. box-sizing: border-box;
  2566. overflow: hidden;
  2567. @include u-flex(row, center, flex-start);
  2568. .danmu-icon {
  2569. height: 24px;
  2570. width: 24px;
  2571. margin-right: 12px;
  2572. }
  2573. }
  2574. &-input {
  2575. flex: 1;
  2576. height: 35px;
  2577. }
  2578. &-send {
  2579. flex-shrink: 0;
  2580. height: 35px;
  2581. display: flex;
  2582. align-items: center;
  2583. justify-content: center;
  2584. padding: 5px 15px;
  2585. box-sizing: border-box;
  2586. background: #FF233C !important;
  2587. border-radius: 22px;
  2588. font-family: PingFang SC, PingFang SC;
  2589. font-weight: 500;
  2590. font-size: 15px;
  2591. color: #fff !important;
  2592. margin-left: 12px;
  2593. &::after {
  2594. border: none;
  2595. }
  2596. }
  2597. &-con {
  2598. background-color: #F5F7FA;
  2599. padding: 24px 12px 48px 12px;
  2600. font-family: PingFang SC, PingFang SC;
  2601. font-weight: 400;
  2602. font-size: 14px;
  2603. color: #757575;
  2604. }
  2605. }
  2606. .content {
  2607. background: #f7f7f7;
  2608. }
  2609. .cousrseImg {
  2610. position: absolute;
  2611. top: 0;
  2612. left: 0;
  2613. width: 100%;
  2614. height: 422rpx;
  2615. background-color: #000;
  2616. image {
  2617. width: 100%;
  2618. height: 100%;
  2619. }
  2620. }
  2621. .video-box {
  2622. width: 100%;
  2623. height: 422rpx;
  2624. overflow: hidden;
  2625. position: relative;
  2626. // padding-top: var(--status-bar-height);
  2627. }
  2628. .scroll-Y {
  2629. font-family: PingFang SC, PingFang SC;
  2630. font-weight: 400;
  2631. font-size: 28rpx;
  2632. color: #222222;
  2633. }
  2634. .horizontal {
  2635. width: 130px;
  2636. height: 150px;
  2637. position: absolute;
  2638. bottom: 50px;
  2639. left: 20px;
  2640. z-index: 999;
  2641. display: flex;
  2642. flex-direction: column;
  2643. align-items: center;
  2644. justify-content: flex-end;
  2645. background-color: transparent;
  2646. .es-w-40 {
  2647. width: 20px;
  2648. }
  2649. .es-h-40 {
  2650. height: 20px;
  2651. }
  2652. .goods {
  2653. width: 120px;
  2654. height: 140px;
  2655. border-radius: 10px;
  2656. background-color: rgba(255, 255, 255, 0.4);
  2657. overflow: hidden;
  2658. display: flex;
  2659. flex-direction: column;
  2660. align-items: center;
  2661. justify-content: center;
  2662. }
  2663. .goodsimg {
  2664. width: 100px;
  2665. height: 100px;
  2666. border-radius: 10px;
  2667. }
  2668. .goodsname {
  2669. width: 100px;
  2670. font-size: 12px;
  2671. box-sizing: border-box;
  2672. padding-top: 7px;
  2673. verflow: hidden;
  2674. word-break: break-all;
  2675. }
  2676. }
  2677. .rotate {
  2678. transform: rotate(-180deg);
  2679. }
  2680. .status_bar {
  2681. background-color: #000;
  2682. }
  2683. .back-img {
  2684. width: 25px;
  2685. height: 25px;
  2686. position: absolute;
  2687. top: 10px;
  2688. left: 34rpx;
  2689. z-index: 99;
  2690. }
  2691. .audiobox {
  2692. width: 100%;
  2693. height: 422rpx;
  2694. position: absolute;
  2695. top: 0;
  2696. left: 0;
  2697. background-color: #333;
  2698. z-index: 9990;
  2699. font-family: PingFang SC, PingFang SC;
  2700. font-weight: 400;
  2701. font-size: 26rpx;
  2702. color: #fff;
  2703. &-video {
  2704. background-color: rgba(255, 255, 255, 0.3);
  2705. padding: 8rpx 20rpx;
  2706. border-radius: 50rpx;
  2707. position: absolute;
  2708. bottom: 40rpx;
  2709. left: 50%;
  2710. transform: translateX(-50%);
  2711. z-index: 9991;
  2712. text-align: center;
  2713. }
  2714. &-title {
  2715. position: absolute;
  2716. top: 0;
  2717. left: 0;
  2718. z-index: 9991;
  2719. padding: 30rpx 40rpx;
  2720. width: 100%;
  2721. box-sizing: border-box;
  2722. background: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.8) 100%);
  2723. display: flex;
  2724. align-items: center;
  2725. .back {
  2726. width: 50rpx;
  2727. height: 50rpx;
  2728. margin-right: 15rpx;
  2729. flex-shrink: 0;
  2730. }
  2731. }
  2732. &-time {
  2733. margin-top: 18rpx;
  2734. font-size: 24rpx;
  2735. }
  2736. }
  2737. .scroll-Y {
  2738. font-family: PingFang SC, PingFang SC;
  2739. font-weight: 400;
  2740. font-size: 28rpx;
  2741. color: #222222;
  2742. }
  2743. .video-info {
  2744. padding: 30rpx 24rpx;
  2745. background-color: #fff;
  2746. &-header {
  2747. width: 100%;
  2748. @include u-flex(row, center, space-between);
  2749. }
  2750. &-headerl {
  2751. flex: 1;
  2752. @include u-flex(row, center, flex-start);
  2753. font-weight: 600;
  2754. font-size: 40rpx;
  2755. color: rgba(0, 0, 0, 0.85);
  2756. overflow: hidden;
  2757. image {
  2758. flex-shrink: 0;
  2759. width: 88rpx;
  2760. height: 88rpx;
  2761. margin-right: 28rpx;
  2762. background: #F5F7FA;
  2763. border-radius: 50%;
  2764. overflow: hidden;
  2765. }
  2766. }
  2767. .follow-btn {
  2768. @include u-flex(row, center, center);
  2769. height: 56rpx;
  2770. min-width: 154rpx;
  2771. padding: 0 23rpx;
  2772. background: #FF233C;
  2773. border-radius: 28rpx 28rpx 28rpx 28rpx;
  2774. color: #FFFFFF;
  2775. font-size: 28rpx;
  2776. image {
  2777. height: 32rpx;
  2778. width: 32rpx;
  2779. margin-right: 6rpx;
  2780. }
  2781. }
  2782. &-voice {
  2783. width: 100%;
  2784. padding: 24rpx 20rpx 38rpx 28rpx;
  2785. margin-top: 26rpx;
  2786. background: #F5F7FA;
  2787. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2788. box-sizing: border-box;
  2789. image {
  2790. width: 48rpx;
  2791. height: 48rpx;
  2792. }
  2793. &-l {
  2794. @include u-flex(row, center, flex-start);
  2795. image {
  2796. margin-right: 20rpx;
  2797. }
  2798. }
  2799. }
  2800. &-voicebox1 {
  2801. @include u-flex(row, center, space-between);
  2802. }
  2803. &-voicebox2 {
  2804. padding: 20rpx 0;
  2805. @include u-flex(row, center, space-between);
  2806. font-weight: 400;
  2807. font-size: 26rpx;
  2808. color: #757575;
  2809. .boTextClass {
  2810. font-weight: 400;
  2811. font-size: 32rpx;
  2812. color: rgba(0, 0, 0, 0.45);
  2813. }
  2814. }
  2815. ::v-deep .uni-collapse-item__title-arrow {
  2816. margin-right: -8rpx;
  2817. }
  2818. .opacity {
  2819. position: relative !important;
  2820. opacity: 1 !important;
  2821. z-index: 1 !important;
  2822. }
  2823. &-desc {
  2824. // margin-bottom: 52rpx;
  2825. font-weight: 400;
  2826. font-size: 32rpx;
  2827. color: rgba(0, 0, 0, 0.65);
  2828. line-height: 44rpx;
  2829. word-break: break-all;
  2830. overflow: hidden;
  2831. position: absolute;
  2832. opacity: 0;
  2833. z-index: -1;
  2834. .desc-image {
  2835. height: 60rpx;
  2836. width: 100%;
  2837. position: absolute;
  2838. bottom: 0;
  2839. left: 0;
  2840. }
  2841. }
  2842. .text-clamp {
  2843. display: -webkit-box;
  2844. -webkit-line-clamp: 2;
  2845. /* 显示的行数 */
  2846. -webkit-box-orient: vertical;
  2847. /* 内容会垂直堆叠 */
  2848. overflow: hidden;
  2849. /* 隐藏溢出的内容 */
  2850. text-overflow: ellipsis;
  2851. /* 当内容被裁剪时显示省略号 */
  2852. }
  2853. &-footer {
  2854. @include u-flex(row, center, space-between);
  2855. color: #757575;
  2856. font-weight: 400;
  2857. font-size: 24rpx;
  2858. view {
  2859. width: 128rpx;
  2860. height: 104rpx;
  2861. @include u-flex(column, center, center);
  2862. }
  2863. image {
  2864. width: 48rpx;
  2865. height: 48rpx;
  2866. margin-bottom: 8rpx;
  2867. }
  2868. }
  2869. }
  2870. .box-header {
  2871. margin-bottom: 24rpx;
  2872. padding: 0 24rpx;
  2873. @include u-flex(row, center, space-between);
  2874. font-weight: 500;
  2875. font-size: 24rpx;
  2876. color: #999999;
  2877. .kechengLeftClass {
  2878. @include u-flex(row, center, center);
  2879. }
  2880. &-title {
  2881. font-weight: 600;
  2882. font-size: 36rpx;
  2883. color: #222222;
  2884. }
  2885. .kechengIconClass {
  2886. width: 30rpx;
  2887. height: 30rpx;
  2888. margin-right: 12rpx
  2889. }
  2890. &-r {
  2891. @include u-flex(row, center, center);
  2892. image {
  2893. width: 16rpx;
  2894. height: 16rpx;
  2895. margin-left: 10rpx;
  2896. }
  2897. }
  2898. }
  2899. .therapy {
  2900. background-color: #fff;
  2901. padding-left: 24rpx;
  2902. padding-bottom: 20rpx;
  2903. &-scrollx {
  2904. white-space: nowrap;
  2905. width: 100%;
  2906. // margin-left: 24rpx;
  2907. }
  2908. &-scrollitem {
  2909. display: inline-block;
  2910. overflow: hidden;
  2911. background: #F5F7FA;
  2912. padding: 10rpx;
  2913. margin-right: 20rpx;
  2914. border-radius: 10rpx;
  2915. overflow: hidden;
  2916. border: 1rpx solid #F5F7FA;
  2917. box-sizing: border-box;
  2918. position: relative;
  2919. overflow: hidden;
  2920. image {
  2921. width: 200rpx;
  2922. height: 200rpx;
  2923. border-radius: 10rpx;
  2924. background-color: #F5F7FA;
  2925. }
  2926. &::after {
  2927. content: '查看详情';
  2928. background-color: #F5F7FA;
  2929. position: absolute;
  2930. top: 0;
  2931. left: 0;
  2932. font-weight: 400;
  2933. font-size: 20rpx;
  2934. padding: 4rpx 14rpx;
  2935. border-radius: 10rpx 0 10rpx 0;
  2936. color: #757575;
  2937. }
  2938. }
  2939. &-active {
  2940. background: #fff;
  2941. border: 1rpx solid #FF233C;
  2942. .therapy-goodsname {
  2943. color: #FF233C !important;
  2944. }
  2945. &::after {
  2946. background: #fff;
  2947. color: #FF233C !important;
  2948. }
  2949. }
  2950. &-goodsname {
  2951. margin-top: 6rpx;
  2952. width: 200rpx;
  2953. min-height: 64rpx;
  2954. font-size: 24rpx;
  2955. color: #757575;
  2956. word-break: break-all;
  2957. white-space: normal;
  2958. }
  2959. }
  2960. .video-directory {
  2961. background-color: #fff;
  2962. padding-top: 24rpx;
  2963. margin-top: 20rpx;
  2964. &-scrollx {
  2965. white-space: nowrap;
  2966. width: calc(100% - 24rpx);
  2967. margin-left: 24rpx;
  2968. }
  2969. &-scrollitem {
  2970. display: inline-block;
  2971. width: 280rpx;
  2972. height: 192rpx;
  2973. background: #F5F5F5;
  2974. border-radius: 20rpx;
  2975. margin-right: 24rpx;
  2976. padding: 24rpx;
  2977. box-sizing: border-box;
  2978. position: relative;
  2979. margin-bottom: 20rpx;
  2980. }
  2981. .freeflag {
  2982. min-width: 132rpx;
  2983. height: 44rpx;
  2984. padding: 0 12rpx;
  2985. text-align: center;
  2986. position: absolute;
  2987. right: 0;
  2988. top: 0;
  2989. font-size: 28rpx;
  2990. color: #FFFFFF;
  2991. border-radius: 0rpx 20rpx 0rpx 20rpx;
  2992. &-free {
  2993. // background: url('@/static/image/hall/free_lable_bg.png') no-repeat right / 100% 32rpx;
  2994. background-color: #FF233C;
  2995. }
  2996. &-member {
  2997. // background: url('@/static/image/hall/member_label_bg.png') no-repeat right / 100% 32rpx;
  2998. background-color: #FFB205;
  2999. }
  3000. }
  3001. &-num {
  3002. font-weight: 600;
  3003. font-size: 32rpx;
  3004. @include u-flex(row, center, flex-start);
  3005. margin-bottom: 12rpx;
  3006. image,
  3007. .empty {
  3008. width: 32rpx;
  3009. height: 32rpx;
  3010. margin-left: 10rpx;
  3011. }
  3012. }
  3013. &-title {
  3014. @include u-flex(row, center, space-between);
  3015. font-size: 32rpx;
  3016. color: #757575;
  3017. line-height: 44rpx;
  3018. word-break: break-all;
  3019. white-space: normal;
  3020. .imagebox {
  3021. flex-shrink: 0;
  3022. margin: 0 8rpx;
  3023. position: relative;
  3024. image {
  3025. width: 92rpx;
  3026. height: 72rpx;
  3027. border-radius: 8rpx 8rpx 8rpx 8rpx;
  3028. overflow: hidden;
  3029. }
  3030. }
  3031. }
  3032. .mask {
  3033. width: 92rpx;
  3034. height: 72rpx;
  3035. border-radius: 8rpx 8rpx 8rpx 8rpx;
  3036. background: rgba(0, 0, 0, 0.2);
  3037. overflow: hidden;
  3038. position: absolute;
  3039. top: 0;
  3040. left: 0;
  3041. z-index: 1;
  3042. @include u-flex(row, center, center);
  3043. image {
  3044. width: 24rpx;
  3045. height: 24rpx;
  3046. }
  3047. }
  3048. .active-scrollitem {
  3049. background: #FFF0F2FF;
  3050. color: #FF233CFF;
  3051. .video-directory-title {
  3052. color: #FF233CFF;
  3053. }
  3054. }
  3055. }
  3056. .video-comment {
  3057. background-color: #fff;
  3058. padding-top: 12rpx;
  3059. margin-top: 20rpx;
  3060. }
  3061. .hall-box {
  3062. @include u-flex(row, center, flex-start);
  3063. flex-wrap: wrap;
  3064. margin: 0 -18rpx -18rpx 0;
  3065. padding: 12rpx 24rpx 24rpx 24rpx;
  3066. .gapitem {
  3067. margin: 0 18rpx 18rpx 0;
  3068. }
  3069. }
  3070. .popbox {
  3071. background-color: #fff;
  3072. position: relative;
  3073. .box-header {
  3074. padding-top: 12rpx;
  3075. padding-bottom: 12rpx;
  3076. box-sizing: border-box;
  3077. background-color: #fff;
  3078. }
  3079. .popbox-body {
  3080. .comment,
  3081. .directoryinfo {
  3082. padding: 24rpx;
  3083. }
  3084. }
  3085. .search-box {
  3086. @include u-flex(row, center, space-between);
  3087. padding: 10px 24rpx;
  3088. .search {
  3089. padding: 0;
  3090. flex: 1;
  3091. image {
  3092. width: 24rpx;
  3093. height: 24rpx;
  3094. padding-left: 16rpx;
  3095. }
  3096. }
  3097. }
  3098. }
  3099. .search-btn {
  3100. flex-shrink: 0;
  3101. height: 68rpx;
  3102. padding: 0 42rpx;
  3103. margin-left: 20rpx;
  3104. background: #eef5fd;
  3105. border-radius: 34rpx 34rpx 34rpx 34rpx;
  3106. font-family: PingFang SC, PingFang SC;
  3107. font-weight: 600;
  3108. font-size: 26rpx;
  3109. color: #FF233C;
  3110. text-align: center;
  3111. line-height: 68rpx;
  3112. }
  3113. .comment-inputbox {
  3114. @include u-flex(row, center, space-between);
  3115. padding: 28rpx 24rpx;
  3116. box-sizing: border-box;
  3117. background: #FFFFFF;
  3118. .inputbox {
  3119. flex: 1;
  3120. height: 72rpx;
  3121. padding-left: 24rpx;
  3122. background: #F5F7FA;
  3123. border-radius: 36rpx 36rpx 36rpx 36rpx;
  3124. font-family: PingFang SC, PingFang SC;
  3125. font-weight: 400;
  3126. font-size: 26rpx;
  3127. color: #999999;
  3128. line-height: 72rpx;
  3129. }
  3130. .release-btn {
  3131. @extend .search-btn;
  3132. }
  3133. }
  3134. .audio {
  3135. display: flex;
  3136. flex-direction: row;
  3137. align-items: center;
  3138. font-family: PingFang SC, PingFang SC;
  3139. font-weight: 500;
  3140. font-size: 24rpx;
  3141. color: #757575;
  3142. &-play {
  3143. display: flex;
  3144. flex-direction: row;
  3145. align-items: center;
  3146. }
  3147. &-icon {
  3148. width: 48rpx;
  3149. height: 48rpx;
  3150. }
  3151. &-slider {
  3152. flex: 1;
  3153. }
  3154. &-time {
  3155. flex-shrink: 0;
  3156. }
  3157. }
  3158. .vipCourseBtn {
  3159. background: #1B1F22;
  3160. border-radius: 46rpx;
  3161. border: 1px solid #FFDAA3;
  3162. color: #FFDAA3;
  3163. width: calc(33.33333% - 46.6666rpx);
  3164. }
  3165. .vipAc {
  3166. background: linear-gradient(90deg, #FFE0B2, #F8BA8B);
  3167. border-radius: 46rpx;
  3168. border: 1px solid #FFDAA3;
  3169. color: #1B1F22;
  3170. }
  3171. .privilegeBox {
  3172. background-color: #171a1d;
  3173. box-sizing: border-box;
  3174. }
  3175. .primenu-box {
  3176. border-radius: 16rpx;
  3177. margin-top: 0rpx;
  3178. padding: 10rpx 20rpx;
  3179. }
  3180. .content-inner {
  3181. display: flex;
  3182. flex-wrap: wrap;
  3183. min-height: 310rpx;
  3184. }
  3185. .content-inner .item {
  3186. width: calc(33.3333333%);
  3187. height: 150rpx;
  3188. display: flex;
  3189. flex-direction: column;
  3190. align-items: center;
  3191. justify-content: center;
  3192. margin-top: 0rpx;
  3193. }
  3194. .content-inner .item .img {
  3195. width: 84rpx;
  3196. height: 84rpx;
  3197. margin-bottom: 8rpx;
  3198. }
  3199. .content-inner .item .label {
  3200. font-size: 32rpx;
  3201. color: #83878A;
  3202. }
  3203. .vipMethodItem {
  3204. border-radius: 10rpx;
  3205. width: calc(100%);
  3206. height: 70rpx;
  3207. color: #FDD8A1;
  3208. }
  3209. .payTypeItem {
  3210. background-color: #1B1F22;
  3211. border: 1px solid #fff;
  3212. border-radius: 10rpx;
  3213. width: calc(50% - 15rpx);
  3214. height: 94rpx;
  3215. }
  3216. .circle {
  3217. border: 1px solid #FDD8A1;
  3218. }
  3219. .pt_ac {
  3220. border: 1px solid #FDD8A1;
  3221. }
  3222. .slider-box {
  3223. flex: 1
  3224. }
  3225. .dataNumTextClass {
  3226. font-weight: 400;
  3227. font-size: 32rpx;
  3228. color: rgba(0, 0, 0, 0.45);
  3229. }
  3230. .bottomCommentInputClass {
  3231. position: fixed;
  3232. left: 0;
  3233. right: 0;
  3234. z-index: 900;
  3235. bottom: 0;
  3236. width: 100%;
  3237. height: 160rpx;
  3238. background-color: #fff;
  3239. padding: 0 24rpx 10rpx;
  3240. display: flex;
  3241. align-items: center;
  3242. padding-bottom: constant(safe-area-inset-bottom);
  3243. padding-bottom: env(safe-area-inset-bottom);
  3244. .input-box {
  3245. flex: 1;
  3246. background-color: #f5f5f5;
  3247. height: 96rpx;
  3248. border-radius: 48rpx;
  3249. padding: 0 30rpx;
  3250. font-size: 32rpx;
  3251. margin-right: 24rpx;
  3252. }
  3253. .send-btn {
  3254. width: 160rpx;
  3255. height: 96rpx;
  3256. background: linear-gradient(135deg, #FF5267 0%, #FF233C 100%);
  3257. border-radius: 48rpx;
  3258. font-weight: 600;
  3259. font-size: 40rpx;
  3260. text-align: center;
  3261. color: #FFFFFF;
  3262. line-height: 96rpx;
  3263. margin-right: 25rpx;
  3264. }
  3265. .icon-btn {
  3266. display: flex;
  3267. flex-direction: column;
  3268. align-items: center;
  3269. justify-content: center;
  3270. image {
  3271. width: 52rpx;
  3272. height: 52rpx;
  3273. }
  3274. text {
  3275. font-weight: 600;
  3276. font-size: 32rpx;
  3277. color: #222222;
  3278. margin-top: 4rpx;
  3279. }
  3280. }
  3281. }
  3282. </style>