info.vue 87 KB

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