info.vue 87 KB

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