info.vue 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330
  1. <template>
  2. <view class="content">
  3. <view class="video-box">
  4. <!-- 返回按钮 -->
  5. <!-- #ifdef APP-PLUS -->
  6. <image class="back-img" @click.stop="navBack()" src="@/static/images/course/back_white_icon.png"></image>
  7. <!-- #endif -->
  8. <view class="cousrseImg x-c" v-show="!pickCatalog.url">
  9. <u-loading-icon size="30"></u-loading-icon>
  10. <!-- <image :src="data.imgUrl" mode="aspectFit"></image> -->
  11. </view>
  12. <!-- 视频 -->
  13. <view class="video-container" style="position: relative;height: 422rpx;" :videoPlayStatus="videoPlayStatus" :change:videoPlayStatus="xgplayer.changeVideo">
  14. <view id="detail-video"
  15. :pickCatalog="pickCatalog"
  16. :change:pickCatalog="xgplayer.initJs"
  17. :exitFullscreen="exitFullscreen"
  18. :change:exitFullscreen="xgplayer.handleExitFullscreen"
  19. ></view>
  20. <image class="back-img" v-if="fullScreen" @click.stop="videoback" src="@/static/images/course/back_white_icon.png"></image>
  21. <!-- 疗法 -->
  22. <!-- <view v-if="showTherapy&&fullScreen" class="horizontal" @tap.stop>
  23. <view class="goods" @tap.stop="goToPro(showTherapyItem.packageId)">
  24. <image :src="showTherapyItem.imgUrl" mode="aspectFill" class="goodsimg"></image>
  25. <view class="goodsname textOne">{{showTherapyItem.packageName}}</view>
  26. </view>
  27. <view style="width: 20px;height: 20px;position: absolute;right:0rpx;top:0rpx;z-index:999">
  28. <image style="width: 20px;height: 20px" src="@/static/images/close40.png"
  29. @tap.stop="closeTherapy"></image>
  30. </view>
  31. </view> -->
  32. <view class="audiobox es es-ver es-ac es-pc" v-if="showAudio" @click.stop>
  33. <view class="audiobox-title">
  34. <image class="back" @click.stop="navBack()" src="@/static/images/course/back_white_icon.png"></image>
  35. <view class="textOne">
  36. {{catalogueList[pickCatalogIdx]&&catalogueList[pickCatalogIdx].title}}
  37. </view>
  38. </view>
  39. <view class="es es-ver es-ac es-pc">
  40. <view class="es es-ac es-pc">
  41. <image class="es-icon-52 es-icon-play-last"
  42. src="/static/images/video/play-last.png" @tap="endedPlayPrev()"></image>
  43. <image class="es-icon-88 es-ml-50 es-mr-50"
  44. :src="audioPlayIng?'/static/images/video/play-stop.png':'/static/images/course/video_icon.png'" @tap="playAudioAction()"></image>
  45. <image class="es-icon-52 es-icon-play-next"
  46. src="/static/images/video/play-next.png" @tap="endedPlayNext('click')"></image>
  47. </view>
  48. <view class="audiobox-time">{{utils.formatSeconds(tempAudioDuration)}} / {{utils.formatSeconds(pickCatalog.seconds)}}</view>
  49. </view>
  50. <view class="audiobox-video x-ac" @tap="backPlayVideo">返回视频</view>
  51. </view>
  52. </view>
  53. </view>
  54. <scroll-view class="scroll-Y" :scroll-y="true" :style="'height:' + clientHeight + 'px;'" v-show="!isShowList">
  55. <view class="video-info">
  56. <view class="video-info-header">
  57. <view class="video-info-headerl">
  58. <image mode="aspectFill" :src="data.talentAvatar"></image>
  59. <text class="textOne">{{data.courseName}}</text>
  60. </view>
  61. <button class="follow-btn" @tap="doFollow()">
  62. <image v-show="!isFollow" src="@/static/images/course/guanzhu_icon.png" mode="aspectFill"></image>
  63. <text>{{isFollow?"已关注":"关注"}}</text>
  64. </button>
  65. </view>
  66. <view>
  67. <view class="video-info-voicebox2">
  68. <text>{{data.views}}次播放 · 总时长:{{data.totalDuration}}</text>
  69. <view class="x-c" @click="isExpand = !isExpand" v-if="showExpandText">
  70. <text>{{isExpand ? '收起简介' : '展开简介'}}</text>
  71. <view :class="isExpand ? 'rotate':''"><uni-icons type="down" size="14"
  72. color="#bbbbbb"></uni-icons></view>
  73. </view>
  74. </view>
  75. <view :class="showDes|| !showExpandText? 'opacity video-info-desc':'video-info-desc' "
  76. id="descbox-desc" :style="{height: isExpand ? 'auto': '84rpx'}">
  77. {{data.description}}
  78. <image v-show="!isExpand&&showExpandText" class="desc-image x-c"
  79. src="/static/images/other/bg_bar.png"></image>
  80. </view>
  81. </view>
  82. <view class="video-info-footer">
  83. <view @tap="handleListen()">
  84. <image src="@/static/images/course/sound_icon24.png" mode="aspectFill"></image>
  85. <text :style="{color: showAudio ? '#FF5C03':'#757575'}">听声</text>
  86. </view>
  87. <!-- v-if="!$qconfig.isAppStore" -->
  88. <view @tap="$navTo('./note?courseId='+courseId)">
  89. <image src="@/static/images/course/note_icon24.png" mode="aspectFill"></image>
  90. <text>笔记</text>
  91. </view>
  92. <view @tap="doFavorite()">
  93. <image
  94. :src="isFavorite?'/static/images/course/collect_on_icon24.png':'/static/images/course/collect_icon24.png'"
  95. mode="aspectFill"></image>
  96. <text>{{isFavorite?"已收藏":"收藏"}}</text>
  97. </view>
  98. <view @tap="doLike()">
  99. <image :src="isLike?'/static/images/course/like_on_icon.png':'/static/images/course/like_icon.png'"
  100. mode="aspectFill"></image>
  101. <text>{{isLike?"喜欢":"喜欢"}}</text>
  102. </view>
  103. <!-- <view @tap="openShare()">
  104. <image src="@/static/images/course/weixin_icon.png" mode="aspectFill"></image>
  105. <text>分享</text>
  106. </view> -->
  107. </view>
  108. </view>
  109. <!-- 讲堂目录 -->
  110. <view class="video-directory">
  111. <view class="box-header">
  112. <view class="box-header-title">讲堂目录</view>
  113. <view class="box-header-r" @tap="goToCatalogue()">
  114. <text>共{{catalogueList.length}}节</text>
  115. <image src="@/static/images/course/my_right_arrow_right_icon.png" mode="aspectFill"></image>
  116. </view>
  117. </view>
  118. <scroll-view class="video-directory-scrollx" scroll-x="true" :scroll-into-view="scrollIntoViewId"
  119. scroll-with-animation="true" overflow-anchor="none">
  120. <view :id="'cataLogue' + index"
  121. :class="pickCatalogIdx == index ? 'active-scrollitem video-directory-scrollitem':'video-directory-scrollitem'"
  122. v-for="(item,index) in catalogueList" :key="index" @click="pickCatalogAction(index)">
  123. <view
  124. :class="index>1 && canShowVip(item) ? 'freeflag freeflag-member':'freeflag freeflag-free'">
  125. {{ index>1 && canShowVip(item) ? '限时特惠' : '免费'}}
  126. </view>
  127. <view class="video-directory-num">
  128. <text>第{{item.courseSort}}讲</text>
  129. <image v-if='pickCatalogIdx == index' src="@/static/images/course/hear_icon.png"></image>
  130. <view class="empty" v-else></view>
  131. </view>
  132. <view class="video-directory-title">
  133. <view class="textTwo">{{item.title}}</view>
  134. <!-- <view class="imagebox">
  135. <view class="mask" v-if='pickCatalogIdx != index'>
  136. <image src="@/static/images/course/video_icon.png" mode="aspectFill"></image>
  137. </view>
  138. <image class="video-directory-img" src="@/static/image/home1/logo.png" mode="aspectFill"></image>
  139. </view> -->
  140. </view>
  141. </view>
  142. </scroll-view>
  143. </view>
  144. <!-- 课程疗法 -->
  145. <!-- <view class="therapy" v-show="packageJsonList&&packageJsonList.length > 0">
  146. <view class="box-header-title" style="margin-bottom: 20rpx;">课程疗法</view>
  147. <scroll-view class="therapy-scrollx" scroll-x="true" :scroll-into-view="scrollIntoTherapy"
  148. scroll-with-animation="true" overflow-anchor="none">
  149. <view :class="therapyIndex == idx ? 'therapy-active therapy-scrollitem':'therapy-scrollitem'"
  150. :id="'therapy' + idx" v-for="(item,idx) in packageJsonList" :key="idx"
  151. @click="handleTherapy(item,idx)">
  152. <image mode="aspectFill" class="therapy-goodsimg" :src="item.imgUrl"></image>
  153. <view class="therapy-goodsname textTwo">{{item.packageName}}</view>
  154. </view>
  155. </scroll-view>
  156. </view> -->
  157. <!-- 评论 v-if="!$qconfig.isAppStore"-->
  158. <view class="video-comment">
  159. <view class="box-header">
  160. <view class="box-header-title">评论</view>
  161. <view class="box-header-r" @tap="goToComment()">
  162. <text>共{{data.commentNum}}条</text>
  163. <image src="@/static/images/course/my_right_arrow_right_icon.png" mode="aspectFill"></image>
  164. </view>
  165. </view>
  166. <view style="padding: 20rpx 24rpx;">
  167. <commentList :commentList="data.commentList" />
  168. </view>
  169. </view>
  170. <!-- 猜你喜欢 -->
  171. <view class="video-comment">
  172. <view class="box-header">
  173. <view class="box-header-title">猜你喜欢</view>
  174. <view class="box-header-r" v-if="false">
  175. <text>更多</text>
  176. <image src="@/static/images/course/my_right_arrow_right_icon.png" mode="aspectFill"></image>
  177. </view>
  178. </view>
  179. <view class="hall-box">
  180. <hallItem class="gapitem" v-for="(item, index) in dataList " :key="index" :item="item"
  181. @click.native="navTo('/pages_course/info?courseId='+item.courseId)" />
  182. </view>
  183. </view>
  184. </scroll-view>
  185. <!-- h5下载 -->
  186. <!-- <h5-down-app-tip :pageUrl="pageUrl" :type="'course'" :courseId="courseId" /> -->
  187. <!-- 分享弹窗 -->
  188. <u-popup :show="showShare" @close="closeShareAct()">
  189. <share-box :shareItem="shareItem" @closeShare='closeShareAct()'></share-box>
  190. </u-popup>
  191. <!-- VIP特权弹窗 -->
  192. <uni-popup ref="popPrivilege" type="bottom" borderRadius="10rpx 10rpx 0px 0px">
  193. <view class="privilegeBox es es-ver es-br-38 es-pt-30 es-pb-30 ">
  194. <view class="es es-fx es-pc es-h-56 es-ml-48 es-mr-48">
  195. <image class="es-w-74 es-h-40" style="position: absolute;left:60rpx;top:0"
  196. src="/static/images/course/xiangyun.png"></image>
  197. <view class="es-fs-40 es-h-56 es-fw-500" style="color: #FFDAA3;">限时特惠</view>
  198. <image class="es-w-74 es-h-40" style="position: absolute;right:60rpx;top:0"
  199. src="/static/images/course/xiangyun2.png"></image>
  200. <image class="es-w-40 es-h-40" style="position: absolute;right:-20rpx;top:-10rpx"
  201. @tap="closePrivilege" src="/static/images/close40.png"></image>
  202. </view>
  203. <!-- <view class="sec1 es-mt-20 es-ml-48 es-mr-48">
  204. <view class="es x-bc es-pl-28 es-pt-12">
  205. <view class="l1">
  206. <view class="x-f">
  207. <image class="es-w-44 es-h-44" src="/static/images/course/fozhu.png">
  208. </image>
  209. <view class="es-ml-8 es-c-white es-fs-32 es-fw-600">名家讲堂</view>
  210. </view>
  211. <view class="es-fs-30 es-mt-10 es-c-99">畅享10000+VIP视频</view>
  212. </view>
  213. <view class="es">
  214. <image src="/static/images/course/zyx.png" class="es-w-183 es-h-98 es-br-15"></image> -->
  215. <!-- <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> -->
  216. <!-- </view>
  217. </view>
  218. </view> -->
  219. <!-- <view class="sec2 es es-fx es-pc es-h-56 es-mt-40 es-ml-48 es-mr-48"> -->
  220. <!-- <image class="es-w-148 es-h-3" style="position: absolute;left:0;top:16rpx" src="/static/image/course/privilege/line1.png"></image> -->
  221. <!-- <view class="es-fs-30 es-h-56 es-fw-bold" style="color: #FFDAA3;">超多权益待你开启</view> -->
  222. <!-- <image class="es-w-148 es-h-3" style="position: absolute;right:0;top:16rpx" src="/static/image/course/privilege/line2.png"></image> -->
  223. <!-- </view> -->
  224. <!-- <view class="primenu-box es es-fx es-pc es-mt-20 es-ml-48 es-mr-48">
  225. <view class="content-inner">
  226. <view class="item">
  227. <image class="img" src="/static/images/course/privilege/she.png" mode="heightFix"></image>
  228. <text class="label">AI舌诊</text>
  229. </view>
  230. <view class="item">
  231. <image class="img jlxw" src="/static/images/course/privilege/tizhi.png" mode="heightFix">
  232. </image>
  233. <text class="label">体质检测</text>
  234. </view>
  235. <view class="item">
  236. <image class="img" src="/static/images/course/privilege/baike.png" mode="heightFix"></image>
  237. <text class="label">养生百科</text>
  238. </view>
  239. <view class="item">
  240. <image class="img" src="/static/images/course/privilege/yishu.png" mode="heightFix"></image>
  241. <text class="label">经典医书</text>
  242. </view>
  243. <view class="item">
  244. <image class="img" src="/static/images/course/privilege/more.png" mode="heightFix"></image>
  245. <text class="label">多设备登陆</text>
  246. </view>
  247. <view class="item">
  248. <image class="img" src="/static/images/course/privilege/ad.png" mode="heightFix"></image>
  249. <text class="label">去除广告</text>
  250. </view>
  251. </view>
  252. </view> -->
  253. <view class="es-ml-48 es-mr-48 es-mt-10 es-pt-10 es-pb-10 es-br-5" style="background:#2a2f32">
  254. <view v-for="(item, index) in vipMethods" :key="index" @tap="changeVipMethod(index)">
  255. <view v-if="index!=0" class="vipMethodItem es x-bc">
  256. <view class="x-bc es-ml-14">
  257. <view class="es-fs-32 es-fw-500 es-ml-14">{{item}}</view>
  258. </view>
  259. <image v-if="vipMethodIdx==index" class="es-w-40 es-h-40 es-br-ban es-mr-14 es-mr-26"
  260. src="/static/images/course/check.png"></image>
  261. <view v-else class="es-w-40 es-h-40 es-br-ban es-mr-14 es-mr-26 circle"></view>
  262. </view>
  263. </view>
  264. </view>
  265. <view v-if="isShowPayType" class="es-ml-48 es-mr-48 es-mt-40 x-bc" style="background:#2a2f32">
  266. <view v-for="(item, index) in payTypes" :key="index" @tap="changePayType(index)"
  267. class="payTypeItem es x-bc " :class="payType==index+1?'pt_ac':''">
  268. <view class="x-bc es-ml-14">
  269. <image class="es-w-59 es-h-52"
  270. :src="index==0?'/static/images/course/vipBuy/wx.png':'/static/images/course/vipBuy/zfb.png'">
  271. </image>
  272. <view class="es-fs-33 es-c-white es-fw-500 es-ml-14">{{item}}</view>
  273. </view>
  274. <image v-if="payType==index+1" src="/static/images/course/check.png"
  275. class="es-w-40 es-h-40 es-br-ban es-mr-14"></image>
  276. <view v-else class="es-w-40 es-h-40 es-br-ban es-mr-14 circle"></view>
  277. </view>
  278. </view>
  279. <view class="es es-mt-40 es-ml-48 es-mr-48 x-c">
  280. <view @tap="doBuy()" class="es-h-94 x-c es-fw-700 es-fs-34 vipCourseBtn vipAc es-br-46"
  281. style="width: 310rpx;">
  282. 立即购买
  283. </view>
  284. </view>
  285. </view>
  286. </uni-popup>
  287. <uni-popup ref="popTip" type="dialog">
  288. <uni-popup-dialog cancelText="支付失败" confirmText="支付成功" mode="base" content="是否已支付成功?" title="提示"
  289. :duration="2000" :before-close="true" @close="confirmTip" @confirm="confirmTip"></uni-popup-dialog>
  290. </uni-popup>
  291. <!-- 评论弹窗 -->
  292. <popupBottom ref="mescrollItem" :visible.sync="specVisible" @close="closePop" :cmdId="courseId"
  293. :smsNum="data.commentNum" :title="data.commentNum+'条评论'" :type="1" radius="32" maxHeight="1200">
  294. </popupBottom>
  295. </view>
  296. </template>
  297. <script>
  298. import {getUserInfo} from '@/api/user'
  299. import { getCourseById,getCourseList,getCourseVideoList,checkFavorite,checkFollow,checkLike,doFavorite,doFollow,doLike,addDuration,
  300. createCourseOrder,createIntegralOrder,getIntegral,createVipOrder,aliPayment,wxPayment,getCourseOrderById } from '@/api/course'
  301. import commentList from "./components/commentList.vue";
  302. import hallItem from "@/pages/course/components/hallItem.vue";
  303. import popupBottom from '@/components/popupBottom/popupBottom.vue'
  304. import MescrollCompMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mixins/mescroll-comp.js";
  305. import adMask from "@/components/adMask/adMask.vue"
  306. export default {
  307. mixins: [MescrollCompMixin],
  308. components: {
  309. popupBottom,
  310. commentList,
  311. hallItem,
  312. adMask
  313. },
  314. data() {
  315. return {
  316. player: null,
  317. Events: null,
  318. isH5: false,
  319. showDes: false,
  320. showExpandText: false,
  321. isExpand: true,
  322. textHeight: 0, //文本高度
  323. courseId: null,
  324. isShare: false,
  325. videoId: null,
  326. isLearning: false,
  327. data: {
  328. courseId: null,
  329. imgUrl: "",
  330. talentAvatar: "",
  331. price: "",
  332. remark: "",
  333. noteNum: 0,
  334. courseName: "",
  335. description: "",
  336. cataIndex: 0,
  337. isFast: 1,
  338. isAutoPlay: false,
  339. commentList: [{
  340. avatar: "",
  341. content: "",
  342. createTime: "",
  343. nickName: ""
  344. }]
  345. },
  346. dataList: [],
  347. talentId: null,
  348. studyLog: null,
  349. isNext: 0,
  350. user: {},
  351. isFavorite: 0,
  352. isFollow: 0,
  353. isLike: 0,
  354. clientHeight: 0,
  355. isShowList: false, // 是否展示讲堂目录列表
  356. catalogueList: [],
  357. scrollIntoViewId: 'cataLogue0',
  358. pickCatalog: {
  359. // videoUrl: "https://tcpv.ylrzcloud.com/course/20241014/1728890026184.mp4",
  360. videoUrl:"",
  361. thumbnail: "",
  362. duration: 0,
  363. videoId: 0,
  364. seconds: 0,
  365. studyTime: null,
  366. isFast: 1,
  367. },
  368. pickCatalogIdx: 0,
  369. packageJsonList: [],
  370. poster: '',
  371. showShare: false,
  372. shareItem: {
  373. imageUrl: "",
  374. title: "",
  375. path: ""
  376. },
  377. fullScreen: false,
  378. showTherapy: false,
  379. showTherapyItem: {},
  380. playDuration:0, // 播放时长
  381. timer: null, // 定时器
  382. lookDuration: 0 ,// 观看时长
  383. countdowning: false, // 观看时长计时开关
  384. showAudio: false, //音频展示
  385. videoPlayStatus:{
  386. status: '',
  387. tempAudioDuration: 0,
  388. studyTime: 0,
  389. }, // 视频播放状态
  390. pageUrl: '',
  391. courseOrderId:0,
  392. scrollIntoTherapy: 'therapy0',
  393. therapyIndex: null,
  394. allLookTimer: null, // 定时器
  395. allLookDuration:0,//H5未登录状态播放五分钟就跳出登录页面
  396. tempAudioDuration:0, //用于记录视频和音频播放的时间,达到无缝续播
  397. audioTimer:null,
  398. playTime:"00:00",
  399. studyTimes:0,
  400. audioContext: null,
  401. audioPlayIng:false,
  402. isPostBack:true,//页面是否已初次加载
  403. specVisible: false,
  404. esComment:null,
  405. vipSelIndex:0,
  406. vipMethods:["开通会员"],
  407. vipMethodIdx:0,
  408. isShowPayType:false,
  409. payTypes:["微信支付","支付宝支付"],
  410. payType:1,//微信支付1 支付宝支付2
  411. createType:3,//1直接购买,2积分兑换 3开通会员
  412. orderId:null,
  413. order:null,
  414. showPayTips:false,
  415. isPlayIng:false,//是否正在播放
  416. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  417. direction: "",
  418. nodeTime: 0,
  419. exitFullscreen: '', //是否退出全屏yes , no 加上时间戳
  420. }
  421. },
  422. onLoad(options) {
  423. this.courseId = options.courseId;
  424. this.isShare = options.isShare || false
  425. this.videoId = options.videoId || null;
  426. this.isLearning = options.isLearning || false;
  427. // #ifdef APP-PLUS
  428. uni.getSubNVueById('videoPopup').hide();
  429. uni.$on('getEventType', (data) => {
  430. uni.getSubNVueById('videoPopup').hide();
  431. if(data.type == 'confirm') {
  432. // 确认
  433. this.tipConfirm(data.extraData)
  434. } else {
  435. // 取消
  436. this.tipCancel(data.extraData)
  437. }
  438. })
  439. // #endif
  440. this.esComment=this.$refs["esComment"];
  441. let that=this;
  442. uni.$on('refreshTitle', (pingCount) => {
  443. that.data.commentNum=pingCount;
  444. });
  445. this.getCourseInfo();
  446. if (this.$checkToken()) {
  447. this.getUserInfo();
  448. this.checkFavorite();
  449. this.checkLike();
  450. }
  451. },
  452. onShow() {
  453. this.exitFullscreen = 'no'+ new Date().getTime()
  454. //#ifdef H5
  455. this.isH5 = true;
  456. //#endif
  457. //#ifdef APP-PLUS
  458. if(this.$checkToken()){
  459. if(!this.timer){
  460. this.timer=setInterval(() => {
  461. if(this.countdowning){ //观看时长计时开关开启
  462. this.lookDuration+=5;
  463. this.addIntegral();
  464. }
  465. }, 5000);
  466. }
  467. }
  468. //#endif
  469. if(!this.$checkToken()){
  470. if(!this.allLookTimer){
  471. this.allLookTimer=setInterval(() => {
  472. if(this.countdowning){ //观看时长计时开关开启
  473. this.allLookDuration+=5;
  474. }
  475. }, 5000);
  476. }
  477. }
  478. this.playFun()
  479. if(this.showPayTips){
  480. this.$refs.popTip.open();
  481. this.showPayTips=false;
  482. }
  483. },
  484. onReady() {
  485. this.audioContext = uni.createInnerAudioContext();
  486. uni.getSystemInfo({
  487. success: (res) => {
  488. this.clientHeight = res.windowHeight - uni.upx2px(422) - res.statusBarHeight;
  489. }
  490. });
  491. },
  492. onHide() {
  493. const type = this.showAudio ? 'audio' : 'video'
  494. this.pauseFun(type);
  495. },
  496. onUnload() {
  497. this.exitFullscreen = 'yes'+ new Date().getTime()
  498. // 页面卸载时清除计时器
  499. this.endCountsTime();
  500. this.addStudyCourse();
  501. this.destoryAudio();
  502. // #ifdef APP-PLUS
  503. uni.$off('getEventType');
  504. // #endif
  505. uni.$emit('refreshStudyTime', {});
  506. uni.$off("backStudyTime");
  507. uni.$off("refreshUser");
  508. uni.$off("showPayTips");
  509. uni.$off("pickCatalogAction");
  510. uni.$off("refreshTitle");
  511. uni.$off("refreshCatalog");
  512. },
  513. methods: {
  514. navBack() {
  515. uni.navigateBack({
  516. animationType: 'pop-out',
  517. animationDuration: 200
  518. });
  519. },
  520. endCountsTime(){
  521. if (this.timer) {
  522. clearInterval(this.timer);
  523. this.timer = null;
  524. }
  525. if (this.allLookTimer) {
  526. clearInterval(this.allLookTimer);
  527. this.allLookTimer = null;
  528. }
  529. },
  530. getCourseInfo() {
  531. this.showDes = false
  532. getCourseById(this.courseId).then(res => {
  533. if (res.code == 200) {
  534. this.data = res.data;
  535. this.dataList = res.data.courseList;
  536. this.talentId = res.data.talentId;
  537. this.studyLog = res.data.studyLog;
  538. this.isNext = res.data.isNext;
  539. this.videoId = this.studyLog ? this.studyLog.videoId : null;
  540. this.vipMethods = ["开通会员"];
  541. if (this.data.isIntegral == 1) {
  542. this.vipMethods.push("积分兑换")
  543. }
  544. if (this.data.sellPrice > 0) {
  545. this.vipMethods.push(this.data.sellPrice + "元购买");
  546. }
  547. this.getDescHeight()
  548. this.getCourseVideoList();
  549. if (this.$checkToken()) {
  550. this.checkFollow();
  551. }
  552. }
  553. },
  554. rej => {}
  555. );
  556. },
  557. getDescHeight() {
  558. this.$nextTick(() => {
  559. const query = uni.createSelectorQuery().in(this);
  560. query
  561. .select("#descbox-desc")
  562. .boundingClientRect((data) => {
  563. this.textHeight = data.height
  564. this.isExpand = this.textHeight > uni.upx2px(84) ? false : true
  565. this.showExpandText = this.textHeight > uni.upx2px(84) ? true : false
  566. this.showDes = true
  567. })
  568. .exec();
  569. })
  570. },
  571. //课程目录
  572. getCourseVideoList() {
  573. let that = this;
  574. const params = {
  575. "courseId": this.courseId
  576. };
  577. getCourseVideoList(params, 1, 50).then(res => {
  578. if (res.code == 200) {
  579. this.catalogueList = res.data.list;
  580. if (this.catalogueList.length > 0) {
  581. this.pickCatalogIdx = this.getCatalogIdx();
  582. //开始播放计时
  583. if (this.data.isAutoPlay == 1) {
  584. this.pickCatalogMethod(this.pickCatalogIdx);
  585. }
  586. }
  587. }
  588. },
  589. rej => {}
  590. );
  591. },
  592. canShowVip(item) {
  593. return true;
  594. if (this.user.isVip) {
  595. return false;
  596. }
  597. return item.isVip == 1 && item.isBuy == 0;
  598. },
  599. getCatalogIdx() {
  600. let index = this.catalogueList.findIndex(item => item.videoId == this.videoId);
  601. if (!this.videoId || index < 0) {
  602. index = 0;
  603. }
  604. return index;
  605. },
  606. getUserInfo() {
  607. let that = this;
  608. getUserInfo().then(res => {
  609. if (res.code == 200) {
  610. if (res.user != null) {
  611. uni.setStorageSync('userInfo', JSON.stringify(res.user));
  612. this.user = res.user;
  613. } else {
  614. uni.showToast({
  615. icon: 'none',
  616. title: res.msg,
  617. });
  618. }
  619. }
  620. },
  621. rej => {}
  622. );
  623. },
  624. checkFavorite() {
  625. checkFavorite(this.courseId).then(res => {
  626. if (res.code == 200) {
  627. this.isFavorite = res.isFavorite;
  628. }
  629. },
  630. rej => {}
  631. );
  632. },
  633. checkFollow() {
  634. checkFollow(this.talentId).then(res => {
  635. if (res.code == 200) {
  636. this.isFollow = res.isFollow;
  637. }
  638. },
  639. rej => {}
  640. );
  641. },
  642. checkLike() {
  643. checkLike(this.courseId).then(res => {
  644. if (res.code == 200) {
  645. this.isLike = res.isLike;
  646. }
  647. },
  648. rej => {}
  649. );
  650. },
  651. doFollow() {
  652. if (!this.$checkToken()) {
  653. this.$showLoginPage();
  654. return;
  655. }
  656. uni.showLoading({
  657. title: ""
  658. });
  659. doFollow(this.talentId).then(res => {
  660. uni.hideLoading();
  661. if (res.code == 200) {
  662. uni.showToast({
  663. title: '操作成功',
  664. icon: 'none'
  665. });
  666. } else {
  667. uni.showToast({
  668. title: res.msg,
  669. icon: 'none'
  670. });
  671. }
  672. this.isFollow = !this.isFollow;
  673. },
  674. rej => {}
  675. );
  676. },
  677. doFavorite() {
  678. if (!this.$checkToken()) {
  679. this.$showLoginPage();
  680. return;
  681. }
  682. uni.showLoading({
  683. title: ""
  684. });
  685. doFavorite(this.courseId).then(res => {
  686. uni.hideLoading();
  687. if (res.code == 200) {
  688. uni.showToast({
  689. title: '操作成功',
  690. icon: 'none'
  691. });
  692. } else {
  693. uni.showToast({
  694. title: res.msg,
  695. icon: 'none'
  696. });
  697. }
  698. this.isFavorite = !this.isFavorite;
  699. },
  700. rej => {}
  701. );
  702. },
  703. doLike() {
  704. if (!this.$checkToken()) {
  705. this.$showLoginPage();
  706. return;
  707. }
  708. uni.showLoading({
  709. title: ""
  710. });
  711. doLike(this.courseId).then(res => {
  712. uni.hideLoading();
  713. if (res.code == 200) {
  714. uni.showToast({
  715. title: '操作成功',
  716. icon: 'none'
  717. });
  718. } else {
  719. uni.showToast({
  720. title: res.msg,
  721. icon: 'none'
  722. });
  723. }
  724. this.isLike = !this.isLike;
  725. },
  726. rej => {}
  727. );
  728. },
  729. openShare() {
  730. if (this.isH5) {
  731. return;
  732. }
  733. console.log("qxj title:" + this.pickCatalog.title);
  734. if (this.$isEmpty(this.pickCatalog.title)) {
  735. this.shareItem.title = this.data.courseName;
  736. } else {
  737. this.shareItem.title = this.data.courseName + "-" + this.pickCatalog.title;
  738. }
  739. this.shareItem.isMini = false
  740. this.shareItem.imageUrl = this.data.imgUrl;
  741. this.shareItem.courseId = this.courseId;
  742. this.shareItem.summary = !this.$isEmpty(this.data.description) ? this.data.description : "";
  743. let cdn = uni.getStorageSync('h5Path');
  744. this.shareItem.url = cdn + "/pages_course/info?courseId=" + this.courseId;
  745. this.showShare = true;
  746. },
  747. goToComment(){
  748. if(this.isH5){
  749. this.specVisible=true;
  750. }
  751. else{
  752. // this.$navTo('./comment?courseId='+this.courseId);
  753. // return;
  754. const subNVue = uni.getSubNVueById('commentN');
  755. subNVue.show('slide-in-bottom', 250);
  756. uni.$emit('comment', {
  757. videoId: this.pickCatalog.videoId,
  758. courseId: this.courseId
  759. });
  760. }
  761. },
  762. closePop(){
  763. this.specVisible=false;
  764. },
  765. navTo(url) {
  766. uni.navigateTo({
  767. url: url
  768. });
  769. },
  770. openVipCourse(index) {
  771. if(!this.isPostBack){
  772. this.isPostBack=true;
  773. return;
  774. }
  775. this.showPopPrivilege(index);
  776. },
  777. showPopPrivilege(index){
  778. if(this.isH5){
  779. this.$refs.popPrivilege.open("bottom");
  780. }
  781. else{
  782. const subNVue = uni.getSubNVueById('privilege');
  783. subNVue.show('slide-in-bottom', 250);
  784. let pickCatalog=this.catalogueList[index];
  785. uni.$emit('privilege', {
  786. videoId: pickCatalog.videoId,
  787. courseId: this.courseId,
  788. sellPrice:this.data.sellPrice,
  789. catalogIndex:index,
  790. integral: this.data.integral,
  791. });
  792. }
  793. },
  794. changeVip(index){
  795. this.vipSelIndex=index;
  796. if(index==2){
  797. this.showPopPrivilege();
  798. }
  799. },
  800. changeVipMethod(index){
  801. this.vipMethodIdx=index;
  802. const vipMethod=this.vipMethods[index];
  803. this.isShowPayType=false;
  804. if(vipMethod.indexOf('元购买')!=-1){ //直接购买
  805. this.isShowPayType=true;
  806. this.createType=1;
  807. }
  808. if(vipMethod.indexOf('积分兑换')!=-1){ //积分兑换
  809. this.createType=2;
  810. }
  811. if(vipMethod.indexOf('开通会员')!=-1){ //开通会员
  812. this.createType=3;
  813. }
  814. },
  815. changePayType(index){
  816. this.payType=index+1;
  817. },
  818. doBuy(){
  819. if(this.createType==1){ //直接购买
  820. this.createCourseOrder();
  821. }
  822. else if(this.createType==2){ //积分兑换
  823. this.createIntegralOrder();
  824. }
  825. else{ //开通会员
  826. this.$navTo('./vipBuy');
  827. }
  828. },
  829. createCourseOrder(){
  830. if(!this.$checkToken()){
  831. this.$showLoginPage();
  832. return;
  833. }
  834. uni.showLoading({title:""});
  835. let params={"courseId":this.courseId,"createType":this.createType,"videoId":this.pickCatalog.videoId,"payType":this.payType};
  836. createCourseOrder(params).then(res => {
  837. uni.hideLoading();
  838. if(res.code==200){
  839. this.order=res.order;
  840. if(this.payType==1){ //微信支付
  841. this.doWxPay();
  842. }else{ //支付宝
  843. this.doAlipay();
  844. }
  845. }else{
  846. uni.showToast({title: res.msg,icon: 'none'});
  847. }
  848. },
  849. rej => {}
  850. );
  851. },
  852. createIntegralOrder(){
  853. if(!this.$checkToken()){
  854. this.$showLoginPage();
  855. return;
  856. }
  857. uni.showLoading({title:""});
  858. let params={"courseId":this.courseId,"videoId":this.pickCatalog.videoId};
  859. createIntegralOrder(params).then(res => {
  860. uni.hideLoading();
  861. if(res.code==200){
  862. uni.showToast({title: res.msg,icon: 'success'});
  863. }else{
  864. uni.showToast({title: res.msg,icon: 'none'});
  865. }
  866. },
  867. rej => {}
  868. );
  869. },
  870. doAlipay(){
  871. var data = {orderId:this.order.orderId};
  872. uni.showLoading();
  873. aliPayment(data).then(res => {
  874. uni.hideLoading()
  875. this.$refs.popPrivilege.close();
  876. if(res.code==200){
  877. this.$refs.popTip.open();
  878. if (uni.getSystemInfoSync().platform == 'android') {
  879. var alipayScheme ='alipays://platformapi/startApp?&saId=10000007&qrcode=' + res.data.qr_code;
  880. }else{
  881. var alipayScheme ='alipay://platformapi/startApp?&saId=10000007&qrcode=' + res.data.qr_code;
  882. }
  883. console.log(alipayScheme)
  884. // 在uni-app中使用plus.runtime.openURL打开URL
  885. plus.runtime.openURL(alipayScheme, function(error) {
  886. // console.error('打开支付宝失败: ' + error.message);
  887. // 处理打开支付宝失败的情况,比如提示用户或者跳转到其他支付方式
  888. });
  889. }
  890. else{
  891. uni.showToast({
  892. title:res.msg,
  893. icon:'none'
  894. })
  895. }
  896. },
  897. rej => {}
  898. );
  899. },
  900. doWxPay(){
  901. var that=this;
  902. plus.share.getServices(function(res){
  903. var sweixin = null;
  904. for(var i=0;i<res.length;i++){
  905. var t = res[i];
  906. if(t.id == 'weixin'){
  907. sweixin = t;
  908. }
  909. }
  910. if(sweixin){
  911. console.log('调起小程序')
  912. that.$refs.popPrivilege.close();
  913. that.$refs.popTip.open()
  914. //唤起微信跳转小程序
  915. sweixin.launchMiniProgram({
  916. id:"gh_7a6a32e5ef61",
  917. path:'pages_order/coursePayment?orderId='+that.orderId+"&payMethod=app",
  918. type:0
  919. },function(){
  920. console.log("微信唤起成功");
  921. return true;
  922. },function(e){
  923. console.log("微信唤起失败",e);
  924. uni.showToast({
  925. title:'微信唤起失败,请检查是否有微信应用',
  926. icon:'none'
  927. })
  928. return false;
  929. })
  930. }else{
  931. uni.showToast({
  932. title:'微信唤起失败,请检查是否有微信应用',
  933. icon:'none',
  934. duration:3000
  935. })
  936. return false;
  937. }
  938. },function(res){
  939. console.log(JSON.stringify(res));
  940. });
  941. },
  942. goToCatalogue(){
  943. if(this.isH5){
  944. let url='./catalogue?courseId='+this.courseId+'&videoId='+this.pickCatalog.videoId+'&isAutoPlay='+this.data.isAutoPlay+'&studyTimes='+this.tempAudioDuration;
  945. this.$navTo(url);
  946. }
  947. else{
  948. const subNVue = uni.getSubNVueById('catalogueN');
  949. subNVue.show('slide-in-bottom', 250);
  950. uni.$emit('catalogue', {
  951. videoId: this.pickCatalog.videoId,
  952. courseId: this.courseId,
  953. pickCatalogIdx:this.pickCatalogIdx
  954. });
  955. }
  956. },
  957. pickCatalogAction(index,type){
  958. if (this.pickCatalogIdx === index) return;
  959. if(type == 'catalogueN'&&this.isNext == 1 && this.pickCatalogIdx != index - 1) {
  960. const type = this.showAudio ? 'audio' : 'video'
  961. this.pauseFun(type);
  962. this.openTips(index)
  963. return
  964. }
  965. this.pickCatalogActionFun(index,type)
  966. },
  967. pickCatalogActionFun(index,type) {
  968. if(!this.$checkToken()){ //切换小节需要登录
  969. this.$showLoginPage();
  970. return;
  971. }
  972. if(this.isH5 && index>1){
  973. uni.showToast({title: "请下载App观看",icon: 'none'});
  974. return;
  975. }
  976. //切换之前添加课程目录学习记录
  977. this.addStudyCourse();
  978. this.addIntegral(); //加积分
  979. this.pickCatalogMethod(index,type);
  980. this.scrollIntoViewId = 'cataLogue' + index;
  981. },
  982. pickCatalogMethod(index,type){
  983. let tempCatalogue=this.catalogueList[index];
  984. this.lookDuration=0;//重置观看当前小节的课程时长
  985. if(tempCatalogue.isVip==1){ //需要Vip才能观看
  986. if(!this.$checkToken()){
  987. this.$showLoginPage();
  988. return;
  989. }
  990. if(this.user==null){
  991. this.user=this.$getUserInfo();
  992. }
  993. if(this.user.isVip!=1 && tempCatalogue.isBuy!=1){
  994. this.openVipCourse(index);
  995. return;
  996. }
  997. }
  998. this.pickCatalogIdx=index;
  999. //传递消息给小节弹窗
  1000. uni.$emit('pickCatalogIdx', {pickCatalogIdx:index,type:type});
  1001. this.pickCatalog=this.catalogueList[index];
  1002. this.pickCatalog.isFast = this.data.isFast
  1003. this.packageJsonList = this.pickCatalog && this.pickCatalog.packageJson ? JSON.parse(this.pickCatalog.packageJson) : []
  1004. this.initStudyTime(this.pickCatalog.studyTime || 0)
  1005. const url = this.pickCatalog.lineTwo ? this.pickCatalog.lineTwo : this.pickCatalog.videoUrl
  1006. this.resetAudioContext(url)
  1007. },
  1008. resetAudioContext(url) {
  1009. if (this.audioContext==null) {
  1010. this.audioContext = uni.createInnerAudioContext();
  1011. }
  1012. this.audioContext.src = url
  1013. // this.audioContext.src = this.pickCatalog.videoUrl;
  1014. this.audioContext.onTimeUpdate(()=>{
  1015. this.initStudyTime(this.audioContext.currentTime)
  1016. })
  1017. },
  1018. changeLine(data) {
  1019. this.resetAudioContext(data.url)
  1020. },
  1021. endedPlayNext(type){
  1022. let nextCatalog=this.catalogueList[this.pickCatalogIdx+1];
  1023. if(!nextCatalog){
  1024. return;
  1025. }
  1026. if(nextCatalog && this.pickCatalogIdx<this.catalogueList.length-1){ //未播放到最后一节自动续播
  1027. this.pickCatalogAction(this.pickCatalogIdx+1)
  1028. }
  1029. },
  1030. endedPlayPrev(){
  1031. if(this.pickCatalogIdx == 0) {
  1032. uni.showToast({
  1033. title: '已经是第一节视频了',
  1034. icon: 'none',
  1035. position: 'top',
  1036. duration: 2000
  1037. })
  1038. return
  1039. }
  1040. let nextCatalog=this.catalogueList[this.pickCatalogIdx-1];
  1041. if(!nextCatalog){
  1042. return;
  1043. }
  1044. this.pickCatalogAction(this.pickCatalogIdx-1)
  1045. },
  1046. addStudyCourse(){
  1047. if(this.catalogueList.length==0 || this.tempAudioDuration==0){
  1048. return;
  1049. }
  1050. // this.pickCatalog=this.catalogueList[this.pickCatalogIdx];
  1051. // this.packageJsonList = this.pickCatalog && this.pickCatalog.packageJson ? JSON.parse(this.pickCatalog.packageJson) : []
  1052. if(this.pickCatalog.isBuy==0){
  1053. return;
  1054. }
  1055. const parmas={"courseId":parseInt(this.courseId),"duration":this.tempAudioDuration,"videoId":this.pickCatalog.videoId};
  1056. addDuration(parmas).then(res => {
  1057. if(res.code==200){
  1058. }
  1059. },
  1060. rej => {}
  1061. );
  1062. },
  1063. addIntegral(){
  1064. // 观看到视频时长50%加一次积分
  1065. if(this.lookDuration==0 || this.playDuration==0){
  1066. return;
  1067. }
  1068. // this.pickCatalog=this.catalogueList[this.pickCatalogIdx];
  1069. // this.packageJsonList = this.pickCatalog && this.pickCatalog.packageJson ? JSON.parse(this.pickCatalog.packageJson) : []
  1070. if(this.lookDuration<this.pickCatalog.seconds*0.5){
  1071. return;
  1072. }
  1073. let data={videoId:this.pickCatalog.videoId,duration:this.lookDuration};
  1074. getIntegral(data).then(res => {
  1075. if(res.code==200){
  1076. uni.showToast({icon:'none',title:res.msg,duration:3000,position:'bottom'});
  1077. this.countdowning=false;
  1078. }
  1079. },
  1080. rej => {}
  1081. );
  1082. },
  1083. closeShareAct(){
  1084. this.showShare=false;
  1085. },
  1086. closeTherapy() {
  1087. this.showTherapy = false
  1088. },
  1089. goToPro(productId) {
  1090. this.exitFullscreen = 'yes'+ new Date().getTime()
  1091. this.showTherapy = false
  1092. setTimeout(()=> {
  1093. uni.navigateTo({
  1094. url: "/pages/store/packageDetails?packageId="+productId
  1095. });
  1096. }, 500);
  1097. },
  1098. // 返回视频
  1099. backPlayVideo() {
  1100. this.showAudio = false;
  1101. this.audioPlayIng = false;
  1102. this.isLearning=false;
  1103. this.pauseFun('audio');
  1104. this.playFun();
  1105. },
  1106. changeCountdowning(data) {
  1107. this.countdowning=data.countdowning;
  1108. },
  1109. onTimeUpdate(data) {
  1110. this.playDuration = Math.round(data.time)
  1111. this.initStudyTime(this.playDuration)
  1112. if(data.time>=this.pickCatalog.seconds){
  1113. this.countdowning = false; //观看时长开关关闭
  1114. }
  1115. if(this.isH5){
  1116. if(this.allLookDuration>=300){ //H5未登录状态播放五分钟就跳出登录页面
  1117. if(!this.$checkToken()){
  1118. this.$showLoginPage();
  1119. const type = this.showAudio ? 'audio' : 'video'
  1120. this.pauseFun(type);
  1121. }
  1122. }
  1123. }
  1124. else{
  1125. if(this.allLookDuration>=120){ //未登录状态播放两分钟就跳出登录页面
  1126. if(!this.$checkToken()){
  1127. this.$showLoginPage();
  1128. const type = this.showAudio ? 'audio' : 'video'
  1129. this.pauseFun(type);
  1130. }
  1131. }
  1132. }
  1133. uni.$u.throttle(this.checkTherapy, 1000,false);
  1134. },
  1135. checkTherapy() {
  1136. let currentTime = Math.round(this.tempAudioDuration || 0)
  1137. let node = this.packageJsonList.filter(item => item.duration == currentTime)
  1138. if(node&&node.length > 0) {
  1139. this.nodeTime = node[0].duration
  1140. this.showTherapyItem = node[0]
  1141. if(!this.showTherapy) {
  1142. this.showTherapy = true
  1143. }
  1144. } else {
  1145. if(this.showTherapy && this.nodeTime && this.nodeTime > currentTime) {
  1146. this.showTherapy = false
  1147. }
  1148. }
  1149. },
  1150. // 打开集观看提示弹窗
  1151. openTips(index){
  1152. // #ifdef APP-PLUS
  1153. uni.$emit('getTipShowType', {index:index})
  1154. uni.getSubNVueById('videoPopup').show();
  1155. // #endif
  1156. },
  1157. tipConfirm() { // 提示确认
  1158. // 继续播放
  1159. //传递消息给小节弹窗
  1160. uni.$emit('pickCatalogIdx', {pickCatalogIdx:this.pickCatalogIdx,type: 'catalogueN'});
  1161. this.playFun()
  1162. },
  1163. tipCancel(index) { // 提示取消
  1164. // 播放选择的一节
  1165. this.pickCatalogActionFun(index,'catalogueN')
  1166. },
  1167. // 听声
  1168. handleListen() {
  1169. if(this.showAudio) {
  1170. this.backPlayVideo()
  1171. } else {
  1172. // 打开音频
  1173. this.showAudio = true
  1174. this.pauseFun('video');
  1175. this.playFun()
  1176. }
  1177. },
  1178. // 播放音频
  1179. playAudioAction(type) {
  1180. if(!this.audioPlayIng){
  1181. setTimeout(()=>{
  1182. this.audioContext.play()
  1183. },200)
  1184. }
  1185. else{
  1186. this.pauseAudioAction()
  1187. }
  1188. this.audioPlayIng=!this.audioPlayIng;
  1189. },
  1190. // 播放
  1191. playFun() {
  1192. this.audioPlayIng = false
  1193. if(this.showAudio) {
  1194. const ended = this.tempAudioDuration == this.pickCatalog.seconds
  1195. this.audioContext.seek(ended ? 0: this.tempAudioDuration);
  1196. // this.audioContext.onSeeked(() => {
  1197. this.playAudioAction()
  1198. // })
  1199. } else {
  1200. this.videoPlayStatus={
  1201. status: 'play'+ new Date().getTime(),
  1202. tempAudioDuration: this.tempAudioDuration || 0,
  1203. studyTime: this.pickCatalog.studyTime,
  1204. }
  1205. }
  1206. },
  1207. initStudyTime(time){
  1208. this.tempAudioDuration = Math.round(time)
  1209. },
  1210. // 暂停音频
  1211. pauseAudioAction() {
  1212. if(this.audioContext) {
  1213. setTimeout(()=>{
  1214. this.audioContext.pause();
  1215. },200)
  1216. clearInterval(this.audioTimer);
  1217. this.audioTimer=null;
  1218. }
  1219. },
  1220. destoryAudio() {
  1221. if(this.audioContext) {
  1222. this.audioContext.destroy();
  1223. clearInterval(this.audioTimer);
  1224. this.audioTimer=null;
  1225. }
  1226. },
  1227. // 暂停
  1228. pauseFun(type) {
  1229. this.audioPlayIng = true
  1230. if(type == 'audio') {
  1231. this.pauseAudioAction()
  1232. } else if(type == 'video'){
  1233. this.videoPlayStatus={
  1234. status: 'pause'+ new Date().getTime(),
  1235. tempAudioDuration: this.tempAudioDuration || 0,
  1236. studyTime: this.pickCatalog.studyTime,
  1237. }
  1238. }
  1239. },
  1240. closePrivilege(){
  1241. this.$refs.popPrivilege.close();
  1242. },
  1243. closeTip(){
  1244. this.$refs.popTip.close();
  1245. },
  1246. canShowVip(item){
  1247. return true;
  1248. if(this.user.isVip){
  1249. return false;
  1250. }
  1251. return item.isVip==1 && item.isBuy==0;
  1252. },
  1253. confirmTip() {
  1254. this.getUserInfo();
  1255. this.getCourseInfo();
  1256. this.$refs.popTip.close();
  1257. uni.showLoading({title:"请稍侯...",mask:true,duration:3000});
  1258. setTimeout(()=>{
  1259. this.getCourseOrderById();
  1260. },2000);
  1261. },
  1262. getCourseOrderById(){
  1263. getCourseOrderById(this.courseOrderId).then(res => {
  1264. uni.hideLoading();
  1265. if(res.code==200){
  1266. if(res.order.status==2 || res.order.payTime!=null){
  1267. // #ifdef APP-PLUS
  1268. if(plus.runtime.channel=="baidu"){ //获取渠道标识
  1269. let bdCmdType=uni.getStorageSync("bdCmdType");
  1270. if(bdCmdType!=null && parseInt(bdCmdType)<=2){
  1271. //this.$registerIdCode("orders",2,res.order.payMoney.toString()); //已下单
  1272. }
  1273. }
  1274. // #endif
  1275. uni.showToast({title:"支付成功",icon:'success'});
  1276. }
  1277. else if(res.order.status==1){
  1278. uni.showToast({title:"课程待支付请稍侯",icon:'none'});
  1279. }
  1280. else{
  1281. uni.showToast({title:"支付失败",icon:'error'});
  1282. }
  1283. }
  1284. },
  1285. rej => {}
  1286. );
  1287. },
  1288. handleTherapy(item,idx) {
  1289. this.scrollIntoTherapy = 'therapy' + idx,
  1290. this.therapyIndex = idx
  1291. setTimeout(()=> {
  1292. uni.navigateTo({
  1293. url: "/pages/store/packageDetails?packageId="+item.packageId
  1294. });
  1295. }, 500);
  1296. },
  1297. onFullscreenChange(data) {
  1298. this.fullScreen = data.isFullscreen
  1299. // direction取为 vertical 或 horizontal
  1300. this.direction = data.direction
  1301. if (!data.isFullscreen) {
  1302. // 退出全屏,锁定竖屏
  1303. // #ifdef APP-PLUS
  1304. plus.screen.lockOrientation('portrait-primary');
  1305. // #endif
  1306. }
  1307. },
  1308. // 全屏返回
  1309. videoback() {
  1310. this.exitFullscreen = 'yes'+ new Date().getTime()
  1311. }
  1312. },
  1313. created() {
  1314. let that = this;
  1315. uni.$on('backStudyTime', function(data) {
  1316. that.videoId=data.videoId;
  1317. that.pickCatalogIdx=that.getCatalogIdx();
  1318. that.pickCatalog=that.catalogueList[that.pickCatalogIdx];
  1319. that.pickCatalog.studyTime=data.studyTimes;
  1320. that.catalogueList[that.pickCatalogIdx]=that.pickCatalog;
  1321. that.packageJsonList = that.pickCatalog && that.pickCatalog.packageJson ? JSON.parse(that.pickCatalog.packageJson) : []
  1322. that.pickCatalogMethod(that.pickCatalogIdx);
  1323. });
  1324. uni.$on('showPayTips', function(data) {
  1325. console.log("qxj showPayTips")
  1326. that.courseOrderId=data.courseOrderId;
  1327. //that.showPayTips=true;
  1328. that.$refs.popTip.open();
  1329. });
  1330. uni.$on('refreshUser', function(data) {
  1331. that.getUserInfo();
  1332. that.getCourseInfo();
  1333. });
  1334. uni.$on('pickCatalogAction', function(data) {
  1335. that.pickCatalogAction(data.index,data.type);
  1336. });
  1337. uni.$on('refreshCatalog', function(index) {
  1338. let catalog=that.catalogueList[index];
  1339. catalog.isBuy=true;
  1340. that.catalogueList[index]=catalog;
  1341. });
  1342. },
  1343. destroyed() {
  1344. uni.$off("backStudyTime");
  1345. uni.$off("refreshUser");
  1346. uni.$off("showPayTips");
  1347. uni.$off("pickCatalogAction");
  1348. uni.$off("refreshTitle");
  1349. uni.$off("refreshCatalog");
  1350. // #ifdef APP-PLUS
  1351. uni.$off('getEventType');
  1352. // #endif
  1353. }
  1354. }
  1355. </script>
  1356. <script module="xgplayer" lang="renderjs">
  1357. // import Player from "xgplayer"
  1358. // import Mp4Plugin from "xgplayer-mp4"
  1359. // import 'xgplayer/dist/index.min.css';
  1360. let xgPlayer
  1361. export default {
  1362. data() {
  1363. return {
  1364. player: null,
  1365. ownerInstance: null,
  1366. ownerInstanceVideo: null,
  1367. isFullscreen: false,
  1368. isCSSFull: false,
  1369. lineName:""
  1370. }
  1371. },
  1372. beforeDestroy() {
  1373. if(this.player) {
  1374. if(this.isFullscreen) {
  1375. if(this.isCSSFull) {
  1376. this.player.exitCssFullscreen()
  1377. } else {
  1378. this.player.exitFullscreen()
  1379. }
  1380. }
  1381. this.player.destroy()
  1382. // 销毁播放器
  1383. this.player = null
  1384. }
  1385. },
  1386. methods: {
  1387. initJs(newValue, oldValue,ownerInstance) {
  1388. if (typeof window.Player === 'function') {
  1389. this.initPlayer(newValue, oldValue,ownerInstance)
  1390. } else {
  1391. // 动态引入较大类库避免影响页面展示
  1392. const script = document.createElement('script')
  1393. // view 层的页面运行在根目录
  1394. script.src = 'https://unpkg.byted-static.com/xgplayer/3.0.20/dist/index.min.js'
  1395. script.onload = this.initPlayer.bind(this, newValue, oldValue,ownerInstance)
  1396. document.head.appendChild(script)
  1397. const l_tag = document.createElement('link'); // 引入播放器css
  1398. l_tag.rel = 'stylesheet';
  1399. l_tag.href = 'https://unpkg.byted-static.com/xgplayer/3.0.20/dist/index.min.css';
  1400. document.body.appendChild(l_tag);
  1401. }
  1402. },
  1403. initPlayer(newValue, oldValue,ownerInstance) {
  1404. this.Events = window.Player.Events
  1405. if (!this.ownerInstance) this.ownerInstance = ownerInstance
  1406. let xgplayerOption = {
  1407. lang: 'zh',
  1408. url: "",
  1409. id: 'detail-video',
  1410. autoplay: false,
  1411. // height: uni.upx2px(422),
  1412. height: '100%',
  1413. width: '100%',
  1414. poster: "",
  1415. 'x5-video-player-type': 'h5', // 微信内置浏览器设置,防止被浏览器劫持
  1416. playsinline: true,
  1417. playbackRate: false,
  1418. ignores: ['volume', 'miniscreen', 'keyboard'],
  1419. plugins: [],
  1420. startTime: 0, // 起始播放时间
  1421. fullscreenTarget: document.querySelector('.video-container'),
  1422. commonStyle: {
  1423. // 播放完成部分进度条底色
  1424. playedColor: '#FF5C03',
  1425. cachedColor: 'transparent'
  1426. },
  1427. seekedStatus: 'auto',
  1428. disableGesture: true,
  1429. closeVideoTouch: true,
  1430. closeVideoDblclick: true,
  1431. closeVideoClick: false,
  1432. progress: {
  1433. isDraggingSeek: false,
  1434. isCloseClickSeek: true,
  1435. closeMoveSeek: true
  1436. },
  1437. fullscreen:{
  1438. useScreenOrientation: true,
  1439. lockOrientationType: 'landscape'
  1440. },
  1441. definition: {
  1442. defaultDefinition: "线路二"
  1443. }
  1444. }
  1445. xgplayerOption.url = newValue.lineTwo ? newValue.lineTwo : newValue.videoUrl
  1446. xgplayerOption.definition.defaultDefinition = newValue.lineTwo ? '线路二' :'线路一'
  1447. if(!xgplayerOption.url) return
  1448. xgplayerOption.poster = newValue.thumbnail
  1449. if(newValue.studyTime && newValue.seconds != newValue.studyTime) {
  1450. xgplayerOption.startTime = newValue.studyTime
  1451. }
  1452. if(newValue.isFast == 1) {
  1453. // 允许拖动进度条
  1454. xgplayerOption.progress.isCloseClickSeek = false
  1455. xgplayerOption.progress.closeMoveSeek = false
  1456. }else {
  1457. // 不允许拖动进度条
  1458. xgplayerOption.progress.isCloseClickSeek = true
  1459. xgplayerOption.progress.closeMoveSeek = true
  1460. }
  1461. if(this.player) {
  1462. this.player.playNext({
  1463. url: newValue.lineTwo ? newValue.lineTwo : newValue.videoUrl,
  1464. startTime: newValue.startTime || 0,
  1465. poster:xgplayerOption.thumbnail || '',
  1466. ignores:xgplayerOption.ignores,
  1467. progress: xgplayerOption.progress,
  1468. definition: xgplayerOption.definition,
  1469. })
  1470. } else {
  1471. this.player = new Player(xgplayerOption);
  1472. }
  1473. if(newValue.isFast == 1) {
  1474. this.player.getPlugin('progress').show()
  1475. }else {
  1476. this.player.getPlugin('progress').hide()
  1477. }
  1478. let lines=[]
  1479. if(newValue.lineOne) {
  1480. lines.push({
  1481. name: '线路一',
  1482. definition: '线路一',
  1483. url:newValue.lineOne
  1484. })
  1485. }
  1486. if(newValue.lineTwo) {
  1487. lines.push({
  1488. name: '线路二',
  1489. definition: '线路二',
  1490. url:newValue.lineTwo
  1491. })
  1492. }
  1493. if(newValue.lineThree) {
  1494. lines.push({
  1495. name: '线路三',
  1496. definition: '线路三',
  1497. url:newValue.lineThree
  1498. })
  1499. }
  1500. this.player.emit('resourceReady', lines)
  1501. this.progressMove(xgplayerOption)
  1502. },
  1503. progressMove(data) {
  1504. this.rjsPlayFun(data)
  1505. const Events = this.Events
  1506. this.player.on(Events.PlAY, () => {
  1507. this.ownerInstance.callMethod("changeCountdowning",{countdowning:true})
  1508. })
  1509. this.player.on(Events.PLAYING, () => {
  1510. // console.log("===播放Events.PLAYING")
  1511. this.ownerInstance.callMethod("changeCountdowning",{countdowning:true})
  1512. })
  1513. this.player.on(Events.WAITING, () => {
  1514. this.ownerInstance.callMethod("changeCountdowning",{countdowning:false})
  1515. })
  1516. this.player.on(Events.PAUSE, () => {
  1517. // console.log("===暂停Events.PAUSE")
  1518. this.ownerInstance.callMethod("changeCountdowning",{countdowning:false})
  1519. })
  1520. this.player.on(Events.ERROR, (error) => {
  1521. console.log('video error:', error)
  1522. this.ownerInstance.callMethod("changeCountdowning",{countdowning:false})
  1523. })
  1524. // 监听用户的播放进度
  1525. this.player.on(Events.TIME_UPDATE, () => {
  1526. this.ownerInstance.callMethod("onTimeUpdate",{time: this.player.currentTime});
  1527. })
  1528. this.player.on(Events.ENDED, () => {
  1529. this.ownerInstance.callMethod("changeCountdowning",{countdowning:false})
  1530. })
  1531. this.player.on(Events.FULLSCREEN_CHANGE, (isFullscreen) => {
  1532. if(this.isFullscreen == isFullscreen) return
  1533. this.isFullscreen = isFullscreen
  1534. plus.screen.lockOrientation('landscape')
  1535. this.ownerInstance.callMethod("onFullscreenChange",{isFullscreen:isFullscreen})
  1536. })
  1537. this.player.on(Events.CSS_FULLSCREEN_CHANGE, (isFullscreen) => {
  1538. if(this.isFullscreen == isFullscreen) return
  1539. this.isCSSFull = true
  1540. this.isFullscreen = isFullscreen
  1541. this.ownerInstance.callMethod("onFullscreenChange",{isFullscreen:isFullscreen})
  1542. })
  1543. // 清晰度发生变化
  1544. this.player.on(Events.DEFINITION_CHANGE, (res) => {
  1545. if(this.lineName == res.to.name) return
  1546. this.lineName = res.to.name
  1547. this.ownerInstance.callMethod("changeLine",{url: res.to.url})
  1548. })
  1549. },
  1550. rjsPlayFun(xgplayerOption){
  1551. this.ownerInstance.callMethod("playFun",{time: xgplayerOption.startTime})
  1552. },
  1553. changeVideo(newValue, oldValue,ownerInstance) {
  1554. if (!this.ownerInstanceVideo) this.ownerInstanceVideo = ownerInstance
  1555. if(this.player) {
  1556. if(newValue.status.indexOf('play') > -1) {
  1557. const tempAudioDuration = newValue.tempAudioDuration
  1558. const flag = newValue.tempAudioDuration != newValue.studyTime
  1559. if(flag) {
  1560. this.player.seek(tempAudioDuration)
  1561. this.player.on(this.Events.SEEKED, () => {
  1562. setTimeout(()=>{
  1563. this.player.play()
  1564. },200)
  1565. })
  1566. } else {
  1567. setTimeout(()=>{
  1568. this.player.play()
  1569. },200)
  1570. }
  1571. }else if(newValue.status.indexOf('pause') > -1) {
  1572. this.player.pause()
  1573. }
  1574. }
  1575. },
  1576. handleExitFullscreen(newValue, oldValue,ownerInstance) {
  1577. // 退出全屏
  1578. if(this.player&&this.isFullscreen && newValue.indexOf('yes') > -1) {
  1579. if(this.isCSSFull) {
  1580. this.player.exitCssFullscreen()
  1581. } else {
  1582. this.player.exitFullscreen()
  1583. }
  1584. }
  1585. }
  1586. }
  1587. }
  1588. </script>
  1589. <style lang="scss" scoped>
  1590. @mixin u-flex($flexD, $alignI, $justifyC) {
  1591. display: flex;
  1592. flex-direction: $flexD;
  1593. align-items: $alignI;
  1594. justify-content: $justifyC;
  1595. }
  1596. .content {
  1597. background: #f7f7f7;
  1598. }
  1599. .cousrseImg {
  1600. position: absolute;
  1601. top: 0;
  1602. left: 0;
  1603. width: 100%;
  1604. height: 422rpx;
  1605. background-color: #000;
  1606. image {
  1607. width: 100%;
  1608. height: 100%;
  1609. }
  1610. }
  1611. .video-box {
  1612. width: 100%;
  1613. height: calc(var(--status-bar-height) + 422rpx);
  1614. overflow: hidden;
  1615. position: relative;
  1616. padding-top: var(--status-bar-height);
  1617. }
  1618. .scroll-Y {
  1619. font-family: PingFang SC, PingFang SC;
  1620. font-weight: 400;
  1621. font-size: 28rpx;
  1622. color: #222222;
  1623. }
  1624. .horizontal {
  1625. width: 130px;
  1626. height: 150px;
  1627. position: absolute;
  1628. bottom: 50px;
  1629. left: 20px;
  1630. z-index: 999;
  1631. display: flex;
  1632. flex-direction: column;
  1633. align-items: center;
  1634. justify-content: flex-end;
  1635. background-color: transparent;
  1636. .es-w-40 {
  1637. width: 20px;
  1638. }
  1639. .es-h-40 {
  1640. height: 20px;
  1641. }
  1642. .goods {
  1643. width: 120px;
  1644. height: 140px;
  1645. border-radius: 10px;
  1646. background-color: rgba(255, 255, 255, 0.4);
  1647. overflow: hidden;
  1648. display: flex;
  1649. flex-direction: column;
  1650. align-items: center;
  1651. justify-content: center;
  1652. }
  1653. .goodsimg {
  1654. width: 100px;
  1655. height: 100px;
  1656. border-radius: 10px;
  1657. }
  1658. .goodsname {
  1659. width: 100px;
  1660. font-size: 12px;
  1661. box-sizing: border-box;
  1662. padding-top: 7px;
  1663. verflow: hidden;
  1664. word-break: break-all;
  1665. }
  1666. }
  1667. .rotate {
  1668. transform: rotate(-180deg);
  1669. }
  1670. .status_bar {
  1671. background-color: #000;
  1672. }
  1673. .back-img {
  1674. width: 25px;
  1675. height: 25px;
  1676. position: absolute;
  1677. top: calc(var(--status-bar-height) + 10px);
  1678. left: 34rpx;
  1679. z-index: 99;
  1680. }
  1681. .audiobox {
  1682. width: 100%;
  1683. height: 422rpx;
  1684. position: absolute;
  1685. top: 0;
  1686. left: 0;
  1687. background-color: #333;
  1688. z-index: 9990;
  1689. font-family: PingFang SC, PingFang SC;
  1690. font-weight: 400;
  1691. font-size: 26rpx;
  1692. color: #fff;
  1693. &-video {
  1694. background-color: rgba(255, 255, 255, 0.3);
  1695. padding: 8rpx 20rpx;
  1696. border-radius: 50rpx;
  1697. position: absolute;
  1698. bottom: 40rpx;
  1699. left: 50%;
  1700. transform: translateX(-50%);
  1701. z-index: 9991;
  1702. text-align: center;
  1703. }
  1704. &-title {
  1705. position: absolute;
  1706. top: 0;
  1707. left: 0;
  1708. z-index: 9991;
  1709. padding: 30rpx 40rpx;
  1710. width: 100%;
  1711. box-sizing: border-box;
  1712. background: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.8) 100%);
  1713. display: flex;
  1714. align-items: center;
  1715. .back {
  1716. width: 50rpx;
  1717. height: 50rpx;
  1718. margin-right: 15rpx;
  1719. flex-shrink: 0;
  1720. }
  1721. }
  1722. &-time {
  1723. margin-top: 18rpx;
  1724. font-size: 24rpx;
  1725. }
  1726. }
  1727. .scroll-Y {
  1728. font-family: PingFang SC, PingFang SC;
  1729. font-weight: 400;
  1730. font-size: 28rpx;
  1731. color: #222222;
  1732. }
  1733. .video-info {
  1734. padding: 24rpx;
  1735. background-color: #fff;
  1736. &-header {
  1737. width: 100%;
  1738. @include u-flex(row, center, space-between);
  1739. }
  1740. &-headerl {
  1741. flex: 1;
  1742. @include u-flex(row, center, flex-start);
  1743. font-weight: 500;
  1744. font-size: 32rpx;
  1745. overflow: hidden;
  1746. image {
  1747. flex-shrink: 0;
  1748. width: 88rpx;
  1749. height: 88rpx;
  1750. margin-right: 28rpx;
  1751. background: #F5F7FA;
  1752. border-radius: 50%;
  1753. overflow: hidden;
  1754. }
  1755. }
  1756. .follow-btn {
  1757. @include u-flex(row, center, center);
  1758. height: 56rpx;
  1759. min-width: 154rpx;
  1760. padding: 0 23rpx;
  1761. background: #FF5C03;
  1762. border-radius: 28rpx 28rpx 28rpx 28rpx;
  1763. color: #FFFFFF;
  1764. font-size: 28rpx;
  1765. image {
  1766. height: 32rpx;
  1767. width: 32rpx;
  1768. margin-right: 6rpx;
  1769. }
  1770. }
  1771. &-voice {
  1772. width: 100%;
  1773. padding: 24rpx 20rpx 38rpx 28rpx;
  1774. margin-top: 26rpx;
  1775. background: #F5F7FA;
  1776. border-radius: 16rpx 16rpx 16rpx 16rpx;
  1777. box-sizing: border-box;
  1778. image {
  1779. width: 48rpx;
  1780. height: 48rpx;
  1781. }
  1782. &-l {
  1783. @include u-flex(row, center, flex-start);
  1784. image {
  1785. margin-right: 20rpx;
  1786. }
  1787. }
  1788. }
  1789. &-voicebox1 {
  1790. @include u-flex(row, center, space-between);
  1791. }
  1792. &-voicebox2 {
  1793. padding: 24rpx 0;
  1794. @include u-flex(row, center, space-between);
  1795. font-weight: 400;
  1796. font-size: 26rpx;
  1797. color: #757575;
  1798. }
  1799. ::v-deep .uni-collapse-item__title-arrow {
  1800. margin-right: -8rpx;
  1801. }
  1802. .opacity {
  1803. position: relative !important;
  1804. opacity: 1 !important;
  1805. z-index: 1 !important;
  1806. }
  1807. &-desc {
  1808. margin-bottom: 52rpx;
  1809. font-weight: 400;
  1810. font-size: 28rpx;
  1811. color: #222222;
  1812. word-break: break-all;
  1813. overflow: hidden;
  1814. line-height: 42rpx;
  1815. position: absolute;
  1816. opacity: 0;
  1817. z-index: -1;
  1818. .desc-image {
  1819. height: 60rpx;
  1820. width: 100%;
  1821. position: absolute;
  1822. bottom: 0;
  1823. left: 0;
  1824. }
  1825. }
  1826. .text-clamp {
  1827. display: -webkit-box;
  1828. -webkit-line-clamp: 2;
  1829. /* 显示的行数 */
  1830. -webkit-box-orient: vertical;
  1831. /* 内容会垂直堆叠 */
  1832. overflow: hidden;
  1833. /* 隐藏溢出的内容 */
  1834. text-overflow: ellipsis;
  1835. /* 当内容被裁剪时显示省略号 */
  1836. }
  1837. &-footer {
  1838. @include u-flex(row, center, space-between);
  1839. color: #757575;
  1840. font-weight: 400;
  1841. font-size: 24rpx;
  1842. view {
  1843. width: 128rpx;
  1844. height: 104rpx;
  1845. @include u-flex(column, center, center);
  1846. }
  1847. image {
  1848. width: 48rpx;
  1849. height: 48rpx;
  1850. margin-bottom: 8rpx;
  1851. }
  1852. }
  1853. }
  1854. .box-header {
  1855. height: 80rpx;
  1856. padding: 0 24rpx;
  1857. @include u-flex(row, center, space-between);
  1858. font-weight: 500;
  1859. font-size: 24rpx;
  1860. color: #999999;
  1861. &-title {
  1862. color: #222222;
  1863. font-size: 34rpx;
  1864. }
  1865. &-r {
  1866. @include u-flex(row, center, flex-start);
  1867. image {
  1868. width: 48rpx;
  1869. height: 48rpx;
  1870. }
  1871. }
  1872. }
  1873. .therapy {
  1874. background-color: #fff;
  1875. padding-left: 24rpx;
  1876. padding-bottom: 20rpx;
  1877. &-scrollx {
  1878. white-space: nowrap;
  1879. width: 100%;
  1880. // margin-left: 24rpx;
  1881. }
  1882. &-scrollitem {
  1883. display: inline-block;
  1884. overflow: hidden;
  1885. background: #F5F7FA;
  1886. padding: 10rpx;
  1887. margin-right: 20rpx;
  1888. border-radius: 10rpx;
  1889. overflow: hidden;
  1890. border: 1rpx solid #F5F7FA;
  1891. box-sizing: border-box;
  1892. position: relative;
  1893. image {
  1894. width: 200rpx;
  1895. height: 200rpx;
  1896. border-radius: 10rpx;
  1897. background-color: #F5F7FA;
  1898. }
  1899. &::after {
  1900. content: '查看详情';
  1901. background-color: #F5F7FA;
  1902. position: absolute;
  1903. top: 0;
  1904. left: 0;
  1905. font-weight: 400;
  1906. font-size: 20rpx;
  1907. padding: 4rpx 14rpx;
  1908. border-radius: 10rpx 0 10rpx 0;
  1909. color: #757575;
  1910. }
  1911. }
  1912. &-active {
  1913. background: #fff;
  1914. border: 1rpx solid #FF5C03;
  1915. .therapy-goodsname {
  1916. color: #FF5C03 !important;
  1917. }
  1918. &::after {
  1919. background: #fff;
  1920. color: #FF5C03 !important;
  1921. }
  1922. }
  1923. &-goodsname {
  1924. margin-top: 6rpx;
  1925. width: 200rpx;
  1926. min-height: 64rpx;
  1927. font-size: 24rpx;
  1928. color: #757575;
  1929. word-break: break-all;
  1930. white-space: normal;
  1931. }
  1932. }
  1933. .video-directory {
  1934. background-color: #fff;
  1935. padding-top: 12rpx;
  1936. margin-top: 20rpx;
  1937. &-scrollx {
  1938. white-space: nowrap;
  1939. width: calc(100% - 24rpx);
  1940. margin-left: 24rpx;
  1941. }
  1942. &-scrollitem {
  1943. display: inline-block;
  1944. width: 276rpx;
  1945. height: 160rpx;
  1946. background: #F5F7FA;
  1947. border-radius: 8rpx 8rpx 8rpx 8rpx;
  1948. margin-right: 18rpx;
  1949. padding: 20rpx 12rpx 20rpx 20rpx;
  1950. box-sizing: border-box;
  1951. position: relative;
  1952. margin-bottom: 20rpx;
  1953. overflow: hidden;
  1954. }
  1955. .freeflag {
  1956. min-width: 68rpx;
  1957. height: 32rpx;
  1958. padding: 0 12rpx 0 12rpx;
  1959. text-align: center;
  1960. line-height: 32rpx;
  1961. position: absolute;
  1962. right: 0;
  1963. top: 0;
  1964. font-weight: 500;
  1965. font-size: 20rpx;
  1966. color: #FFFFFF;
  1967. border-radius: 0 8rpx 0 8rpx;
  1968. box-sizing: border-box;
  1969. &-free {
  1970. // background: url('@/static/images/course/free_lable_bg.png') no-repeat right / 100% 32rpx;
  1971. background-color: #FF5C03;
  1972. }
  1973. &-member {
  1974. // background: url('@/static/images/course/member_label_bg.png') no-repeat right / 100% 32rpx;
  1975. background-color: #FFB205;
  1976. }
  1977. }
  1978. &-num {
  1979. font-weight: 500;
  1980. font-size: 28rpx;
  1981. @include u-flex(row, center, flex-start);
  1982. image,
  1983. .empty {
  1984. width: 48rpx;
  1985. height: 48rpx;
  1986. margin-left: 10rpx;
  1987. }
  1988. }
  1989. &-title {
  1990. @include u-flex(row, center, space-between);
  1991. font-size: 24rpx;
  1992. color: #757575;
  1993. word-break: break-all;
  1994. white-space: normal;
  1995. .imagebox {
  1996. flex-shrink: 0;
  1997. margin: 0 8rpx;
  1998. position: relative;
  1999. image {
  2000. width: 92rpx;
  2001. height: 72rpx;
  2002. border-radius: 8rpx 8rpx 8rpx 8rpx;
  2003. overflow: hidden;
  2004. }
  2005. }
  2006. }
  2007. .mask {
  2008. width: 92rpx;
  2009. height: 72rpx;
  2010. border-radius: 8rpx 8rpx 8rpx 8rpx;
  2011. background: rgba(0, 0, 0, 0.2);
  2012. overflow: hidden;
  2013. position: absolute;
  2014. top: 0;
  2015. left: 0;
  2016. z-index: 1;
  2017. @include u-flex(row, center, center);
  2018. image {
  2019. width: 24rpx;
  2020. height: 24rpx;
  2021. }
  2022. }
  2023. .active-scrollitem {
  2024. background: #FCF0E7;
  2025. color: #FF5C03;
  2026. .video-directory-title {
  2027. color: #FF5C03;
  2028. }
  2029. }
  2030. }
  2031. .video-comment {
  2032. background-color: #fff;
  2033. padding-top: 12rpx;
  2034. margin-top: 20rpx;
  2035. }
  2036. .hall-box {
  2037. @include u-flex(row, center, flex-start);
  2038. flex-wrap: wrap;
  2039. margin: 0 -18rpx -18rpx 0;
  2040. padding: 12rpx 24rpx 24rpx 24rpx;
  2041. .gapitem {
  2042. margin: 0 18rpx 18rpx 0;
  2043. }
  2044. }
  2045. .popbox {
  2046. background-color: #fff;
  2047. position: relative;
  2048. .box-header {
  2049. padding-top: 12rpx;
  2050. padding-bottom: 12rpx;
  2051. box-sizing: border-box;
  2052. background-color: #fff;
  2053. }
  2054. .popbox-body {
  2055. .comment,
  2056. .directoryinfo {
  2057. padding: 24rpx;
  2058. }
  2059. }
  2060. .search-box {
  2061. @include u-flex(row, center, space-between);
  2062. padding: 10px 24rpx;
  2063. .search {
  2064. padding: 0;
  2065. flex: 1;
  2066. image {
  2067. width: 24rpx;
  2068. height: 24rpx;
  2069. padding-left: 16rpx;
  2070. }
  2071. }
  2072. }
  2073. }
  2074. .search-btn {
  2075. flex-shrink: 0;
  2076. height: 68rpx;
  2077. padding: 0 42rpx;
  2078. margin-left: 20rpx;
  2079. background: #FCF0E7;
  2080. border-radius: 34rpx 34rpx 34rpx 34rpx;
  2081. font-family: PingFang SC, PingFang SC;
  2082. font-weight: 600;
  2083. font-size: 26rpx;
  2084. color: #FF5C03;
  2085. text-align: center;
  2086. line-height: 68rpx;
  2087. }
  2088. .comment-inputbox {
  2089. @include u-flex(row, center, space-between);
  2090. padding: 28rpx 24rpx;
  2091. box-sizing: border-box;
  2092. background: #FFFFFF;
  2093. .inputbox {
  2094. flex: 1;
  2095. height: 72rpx;
  2096. padding-left: 24rpx;
  2097. background: #F5F7FA;
  2098. border-radius: 36rpx 36rpx 36rpx 36rpx;
  2099. font-family: PingFang SC, PingFang SC;
  2100. font-weight: 400;
  2101. font-size: 26rpx;
  2102. color: #999999;
  2103. line-height: 72rpx;
  2104. }
  2105. .release-btn {
  2106. @extend .search-btn;
  2107. }
  2108. }
  2109. .audio {
  2110. display: flex;
  2111. flex-direction: row;
  2112. align-items: center;
  2113. font-family: PingFang SC, PingFang SC;
  2114. font-weight: 500;
  2115. font-size: 24rpx;
  2116. color: #757575;
  2117. &-play {
  2118. display: flex;
  2119. flex-direction: row;
  2120. align-items: center;
  2121. }
  2122. &-icon {
  2123. width: 48rpx;
  2124. height: 48rpx;
  2125. }
  2126. &-slider {
  2127. flex: 1;
  2128. }
  2129. &-time {
  2130. flex-shrink: 0;
  2131. }
  2132. }
  2133. .vipCourseBtn {
  2134. background: #1B1F22;
  2135. border-radius: 46rpx;
  2136. border: 1px solid #FFDAA3;
  2137. color: #FFDAA3;
  2138. width: calc(33.33333% - 46.6666rpx);
  2139. }
  2140. .vipAc {
  2141. background: linear-gradient(90deg, #FFE0B2, #F8BA8B);
  2142. border-radius: 46rpx;
  2143. border: 1px solid #FFDAA3;
  2144. color: #1B1F22;
  2145. }
  2146. .privilegeBox {
  2147. background-color: #171a1d;
  2148. box-sizing: border-box;
  2149. }
  2150. .primenu-box {
  2151. border-radius: 16rpx;
  2152. margin-top: 0rpx;
  2153. padding: 10rpx 20rpx;
  2154. }
  2155. .content-inner {
  2156. display: flex;
  2157. flex-wrap: wrap;
  2158. min-height: 310rpx;
  2159. }
  2160. .content-inner .item {
  2161. width: calc(33.3333333%);
  2162. height: 150rpx;
  2163. display: flex;
  2164. flex-direction: column;
  2165. align-items: center;
  2166. justify-content: center;
  2167. margin-top: 0rpx;
  2168. }
  2169. .content-inner .item .img {
  2170. width: 84rpx;
  2171. height: 84rpx;
  2172. margin-bottom: 8rpx;
  2173. }
  2174. .content-inner .item .label {
  2175. font-size: 32rpx;
  2176. color: #83878A;
  2177. }
  2178. .vipMethodItem {
  2179. border-radius: 10rpx;
  2180. width: calc(100%);
  2181. height: 70rpx;
  2182. color: #FDD8A1;
  2183. }
  2184. .payTypeItem {
  2185. background-color: #1B1F22;
  2186. border: 1px solid #fff;
  2187. border-radius: 10rpx;
  2188. width: calc(50% - 15rpx);
  2189. height: 94rpx;
  2190. }
  2191. .circle {
  2192. border: 1px solid #FDD8A1;
  2193. }
  2194. .pt_ac {
  2195. border: 1px solid #FDD8A1;
  2196. }
  2197. .slider-box {
  2198. flex: 1
  2199. }
  2200. </style>