info.vue 89 KB

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