detail.vue 96 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299
  1. <template>
  2. <view class="polyv_detail">
  3. <nav-bar
  4. :title="detail.courseName || '课程详情'"
  5. v-show="navShow"
  6. ></nav-bar>
  7. <view id="top">
  8. <view class="video_box" v-if="!startStatus">
  9. <image
  10. :src="$method.splitImgHost(goodsData.coverUrl)"
  11. mode="widthFix"
  12. style="width: 100%; height: 421rpx"
  13. ></image>
  14. <image
  15. v-if="false"
  16. class="video_play"
  17. src="/static/play.png"
  18. @click="startVideo"
  19. ></image>
  20. </view>
  21. <view v-else>
  22. <view
  23. class="video_box"
  24. style="width: 100%; height: 421rpx"
  25. v-if="playVID"
  26. >
  27. <polyv-player
  28. id="playerVideo"
  29. playerId="playerVideo"
  30. height="421rpx"
  31. :vid="vid"
  32. :showSettingBtn="true"
  33. :enablePlayGesture="true"
  34. :custom-cache="false"
  35. :object-fit="'contain'"
  36. @statechange="onStateChange"
  37. @fullscreenchange="fullscreenchange"
  38. @error="playError"
  39. :autoplay="true"
  40. :page-gesture="true"
  41. :vslide-gesture="true"
  42. :vslide-gesture-in-fullscreen="true"
  43. :isAllowSeek="isAllowSeek"
  44. :playbackRate="playbackRate"
  45. :startTime="startTime"
  46. :enableAutoRotation="enableAutoRotation"
  47. @loadedmetadata="loadedmetadata"
  48. ></polyv-player>
  49. <cover-view
  50. class="video-toast__close"
  51. v-if="videoToastShow"
  52. @click="closeToast()"
  53. >X</cover-view
  54. >
  55. <cover-view class="video-toast" v-if="videoToastShow">
  56. <cover-view class="video-toast__text"
  57. >您上次看到 {{ seekTime }},正在自动续播</cover-view
  58. >
  59. <cover-view class="video-toast__btn" @click="restart()"
  60. >从头播放</cover-view
  61. >
  62. </cover-view>
  63. </view>
  64. <view
  65. class="video_box"
  66. style="width: 100%; height: 421rpx"
  67. v-if="playChannelId > 0"
  68. >
  69. <player
  70. class="plv-mp-demo-player"
  71. :videoOption="videoOption"
  72. :page-gesture="true"
  73. :vslide-gesture="true"
  74. :vslide-gesture-in-fullscreen="true"
  75. @onLiveStatusChange="playerLiveStatusChange"
  76. />
  77. </view>
  78. </view>
  79. <view>
  80. <u-row>
  81. <u-col span="10">
  82. <view class="video_t1">{{ detail.courseName }}</view>
  83. </u-col>
  84. <u-col span="2">
  85. <div class="notice_wrap" v-if="goodsData.buyNote">
  86. <view class="video_t1_t" @click="studyNotice"> 学员须知 </view>
  87. </div>
  88. </u-col>
  89. </u-row>
  90. </view>
  91. <view class="course-list" v-if="courseList.length > 1">
  92. <picker class="picker" @change="courseChange2" range-key='courseName' :range="courseList">{{courseName}}</picker>
  93. <u-icon name="arrow-down"></u-icon>
  94. </view>
  95. <u-line color="#D6D6DB" />
  96. <view>
  97. <view
  98. ><u-tabs
  99. gutter="0"
  100. :item-width="itemWidth()"
  101. :list="list"
  102. font-size="32"
  103. bar-width="24"
  104. :current="current"
  105. @change="change"
  106. active-color="#007AFF"
  107. ></u-tabs
  108. ></view>
  109. </view>
  110. <u-line color="#D6D6DB" />
  111. </view>
  112. <view class="box">
  113. <scroll-view class="box_in" scroll-y="true">
  114. <!--目录 -->
  115. <view v-show="current == 0">
  116. <view
  117. class="top__header"
  118. v-if="livingItem"
  119. @click="goLive(livingItem)"
  120. >
  121. <image
  122. class="img"
  123. src="/pages5/static/live.png"
  124. mode="widthFix"
  125. ></image>
  126. <view class="note">正在直播中</view>
  127. <view class="title">{{ livingItem.name }}</view>
  128. </view>
  129. <view class="menuBox" v-for="(item, index) in menuList" :key="index">
  130. <!--模块 -->
  131. <view v-if="item.type == 1"
  132. ><courseModule
  133. :orderGoodsId="orderGoodsId"
  134. :sectionMaxNum="goodsData.sectionMaxNum"
  135. :needOpen="menuIndex[0] === index ? true : false"
  136. :courseId="courseId"
  137. :preItem="menuList[index - 1]"
  138. :learningOrder="businessData.goodsLearningOrder"
  139. :goodsId="goodsId"
  140. :gradeId="gradeId"
  141. :isBuy="true"
  142. :menuItem="item"
  143. :levelId="item.menuId"
  144. ></courseModule
  145. ></view>
  146. <!--章 -->
  147. <view v-if="item.type == 2"
  148. ><courseChapter
  149. :orderGoodsId="orderGoodsId"
  150. :sectionMaxNum="goodsData.sectionMaxNum"
  151. :needOpen="menuIndex[0] === index ? true : false"
  152. :courseId="courseId"
  153. :preItem="menuList[index - 1]"
  154. @playEnd="sectionPlayEnd($event, index)"
  155. :learningOrder="businessData.goodsLearningOrder"
  156. :goodsId="goodsId"
  157. :gradeId="gradeId"
  158. :isBuy="true"
  159. :menuItem="item"
  160. :levelId="'0-' + item.menuId"
  161. ></courseChapter
  162. ></view>
  163. <!--节 -->
  164. <view v-if="item.type == 3"
  165. ><courseSection
  166. :orderGoodsId="orderGoodsId"
  167. :sectionMaxNum="goodsData.sectionMaxNum"
  168. @playEnd="sectionPlayEnd($event, index)"
  169. :courseId="courseId"
  170. :preItem="menuList[index - 1]"
  171. :learningOrder="businessData.goodsLearningOrder"
  172. :goodsId="goodsId"
  173. :gradeId="gradeId"
  174. :isBuy="true"
  175. :menuItem="item"
  176. :levelId="'0-0-' + item.menuId"
  177. ></courseSection
  178. ></view>
  179. </view>
  180. </view>
  181. <!--讲义 -->
  182. <view v-show="current == 1">
  183. <view class="lecture-box" v-if="courseHandoutsData">
  184. <view class="title">
  185. {{ courseHandoutsData.handoutsName }}
  186. <!-- 这是后台配置的讲义标题过长省略这是后台配置的讲义标题过长省略 -->
  187. </view>
  188. <view class="btn" @click="openDocument">
  189. <u-icon name="download" color="#007AFF" size="40"></u-icon>
  190. </view>
  191. </view>
  192. <view style="text-align: center" v-else>暂无讲义</view>
  193. <!-- <view class="lecture-content">
  194. <rich-text :nodes="'讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容'"></rich-text>
  195. </view> -->
  196. <!-- <view class="inputBottom">
  197. <view style="width: 10%;"><image src="/static/icon/note3.png" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image></view>
  198. <view style="width: 73%;height: 100%;padding: 10rpx 0;">
  199. <u-input class="input" height="60" fixed="true" placeholder="您可以在这里输入笔记内容" type="textarea" :custom-style="inputStyle" v-model="noteValue" />
  200. </view>
  201. <view style="color: #007AFF;font-size: 30rpx;font-weight: bold;width: 15%;text-align: center;" @click="postNote">提交</view>
  202. </view> -->
  203. </view>
  204. <!--笔记 -->
  205. <view v-show="current == 2">
  206. <view v-if="noteList.length == 0" style="text-align: center"
  207. >暂无笔记</view
  208. >
  209. <view
  210. class="inputBottom"
  211. v-if="!(isPlayRebuild > 0) && playChannelId == 0"
  212. >
  213. <view style="width: 10%"
  214. ><image
  215. src="/static/icon/note3.png"
  216. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  217. ></image
  218. ></view>
  219. <view style="width: 73%; height: 100%; padding: 10rpx 0">
  220. <u-input
  221. class="input"
  222. height="60"
  223. fixed="true"
  224. placeholder="您可以在这里输入笔记内容"
  225. type="input"
  226. :custom-style="inputStyle"
  227. v-model="noteValue"
  228. />
  229. </view>
  230. <view
  231. style="
  232. color: #007aff;
  233. font-size: 30rpx;
  234. font-weight: bold;
  235. width: 15%;
  236. text-align: center;
  237. "
  238. @click="postNote"
  239. >提交</view
  240. >
  241. </view>
  242. <view v-for="(item, index) in noteList" :key="index">
  243. <view class="dateBox">{{
  244. $method.timestampToTime(item.dateNote)
  245. }}</view>
  246. <view class="noteBox">
  247. <view
  248. v-for="(item1, index1) in item.userNotes"
  249. :key="index1"
  250. style="margin-top: 30rpx"
  251. @click="jumpNote(item1)"
  252. >
  253. <view style="display: flex">
  254. <view>
  255. <view>
  256. <image
  257. src="/static/icon/note2.png"
  258. v-if="noteId != item1.noteId"
  259. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  260. ></image>
  261. <image
  262. src="/static/icon/note1.png"
  263. v-if="noteId == item1.noteId"
  264. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  265. ></image>
  266. </view>
  267. <view
  268. class="title"
  269. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  270. >{{ $method.secondToDate(item1.noteSecond) }}</view
  271. >
  272. </view>
  273. <view style="margin-left: 10rpx">
  274. <view class="t2Content leftPadding">{{
  275. item1.sectionName
  276. }}</view>
  277. <view class="tBox2">{{ item1.noteText }}</view>
  278. </view>
  279. </view>
  280. </view>
  281. </view>
  282. </view>
  283. </view>
  284. <!--答疑 -->
  285. <view v-show="current == 3">
  286. <view class="inputBottom">
  287. <view class="flex_auto">
  288. <u-input
  289. height="60"
  290. fixed="true"
  291. :focus="isFocus"
  292. :placeholder="placeholder"
  293. type="input"
  294. @blur="blur"
  295. :custom-style="inputStyle"
  296. v-model="ctxValue"
  297. />
  298. </view>
  299. <view class="btn" @click="postContent">提交</view>
  300. </view>
  301. <view
  302. v-for="(item, index) in answerList"
  303. :key="index"
  304. style="background-color: #ffffff; margin-bottom: 20rpx"
  305. >
  306. <view class="chat_box" @click.stop="clearCtx">
  307. <view style="display: flex; flex: 1">
  308. <view
  309. ><image
  310. :src="
  311. item.assignUserId > 0 && !item.realname
  312. ? '/static/logo_xcx.png'
  313. : $method.splitImgHost(item.avatar)
  314. "
  315. style="width: 64rpx; height: 64rpx"
  316. ></image
  317. ></view>
  318. <view style="margin-left: 15rpx">
  319. <view class="chat1">{{
  320. item.assignUserId > 0 && !item.realname
  321. ? "祥粤老师"
  322. : item.realname
  323. }}</view>
  324. <view class="chat2">{{
  325. $method.timestampToTime(item.createTime, false)
  326. }}</view>
  327. <view class="chat3">
  328. <text v-if="item.assignUserId > 0">回复</text>
  329. <text v-if="item.assignUserId > 0" style="color: #007aff"
  330. >@{{ item.assignRealname }}</text
  331. >
  332. <view style="word-break: break-all">{{
  333. item.answerText
  334. }}</view>
  335. </view>
  336. </view>
  337. </view>
  338. <view
  339. class="btnReply"
  340. @click.stop="replyContent(item)"
  341. v-if="item.userId != userInfo.userId"
  342. >回复</view
  343. >
  344. <view v-else class="btnDel" @click.stop="delContent(item)"
  345. >删除</view
  346. >
  347. </view>
  348. <u-line color="#D6D6DB" />
  349. </view>
  350. <view v-if="answerList.length == 0" style="text-align: center"
  351. >暂无记录</view
  352. >
  353. </view>
  354. <!--目录 -->
  355. <view v-show="current == 4">
  356. <view
  357. class="menuBox"
  358. v-for="(item, index) in reMenuList"
  359. :key="index"
  360. >
  361. <!--模块 -->
  362. <view v-if="item.type == 1"
  363. ><courseModule
  364. :orderGoodsId="orderGoodsId"
  365. :sectionMaxNum="goodsData.sectionMaxNum"
  366. :courseId="courseId"
  367. :goodsId="goodsId"
  368. :gradeId="gradeId"
  369. :isRebuild="true"
  370. :isBuy="true"
  371. :menuItem="item"
  372. :levelId="item.menuId"
  373. ></courseModule
  374. ></view>
  375. <!--章 -->
  376. <view v-if="item.type == 2">
  377. <courseChapter
  378. :orderGoodsId="orderGoodsId"
  379. :courseId="courseId"
  380. :sectionMaxNum="goodsData.sectionMaxNum"
  381. @playEnd="sectionPlayEnd($event, index)"
  382. :gradeId="gradeId"
  383. :goodsId="goodsId"
  384. :isRebuild="true"
  385. :isBuy="true"
  386. :menuItem="item"
  387. :levelId="'0-' + item.menuId"
  388. ></courseChapter>
  389. </view>
  390. <!--节 -->
  391. <view v-if="item.type == 3">
  392. <courseSection
  393. :orderGoodsId="orderGoodsId"
  394. :courseId="courseId"
  395. :sectionMaxNum="goodsData.sectionMaxNum"
  396. @playEnd="sectionPlayEnd($event, index)"
  397. :gradeId="gradeId"
  398. :goodsId="goodsId"
  399. :isRebuild="true"
  400. :isBuy="true"
  401. :nextMenuItem="findMenuNextSection(index)"
  402. :menuItem="item"
  403. :levelId="'0-0-' + item.menuId"
  404. ></courseSection>
  405. </view>
  406. </view>
  407. </view>
  408. </scroll-view>
  409. </view>
  410. <!-- 播放前拍照end -->
  411. <u-popup
  412. v-model="showSet"
  413. :mask-close-able="false"
  414. mode="center"
  415. border-radius="24"
  416. >
  417. <view
  418. style="
  419. align-items: center;
  420. padding: 0 40rpx;
  421. display: flex;
  422. flex-direction: column;
  423. justify-content: center;
  424. "
  425. >
  426. <view
  427. style="
  428. font-weight: bold;
  429. color: #333333;
  430. font-size: 30rpx;
  431. margin-top: 30rpx;
  432. "
  433. >温馨提示</view
  434. >
  435. <view
  436. style="
  437. width: 457rpx;
  438. color: #666666;
  439. font-size: 30rpx;
  440. margin-top: 30rpx;
  441. "
  442. >学习过程中需要拍照验证学员身份, 拍照功能需要使用您的相机。
  443. 是否授权使用?</view
  444. >
  445. <view style="margin: 40rpx 0">
  446. <button
  447. open-type="openSetting"
  448. @bindopensetting="openSetting"
  449. class="btnSet"
  450. >
  451. 去授权
  452. </button>
  453. </view>
  454. </view>
  455. </u-popup>
  456. <u-mask :show="photoPopup">
  457. <!-- 播放前拍照start -->
  458. <view
  459. v-if="photoPopup"
  460. :mask-close-able="false"
  461. style="bottom: 0; position: fixed; width: 100%; z-index: 999"
  462. >
  463. <view class="photoBox">
  464. <view class="photoTop">
  465. <view class="sqzz" v-if="false"
  466. ><u-icon
  467. name="close"
  468. color="#333333"
  469. size="30"
  470. @click="closePhoto"
  471. ></u-icon
  472. ></view>
  473. <view class="centersq">请正视手机屏幕</view>
  474. <view class="sqzz"></view>
  475. </view>
  476. <view class="photoCenter">
  477. <view
  478. style="width: 100%; height: 979rpx; position: fixed"
  479. v-if="photoPopup && isTaking"
  480. >
  481. <camera
  482. device-position="front"
  483. flash="off"
  484. @error="error"
  485. style="width: 100%; height: 100%"
  486. ></camera>
  487. </view>
  488. <view class="custom" v-if="!isTaking"
  489. ><image :src="avatarUrl" mode=""></image
  490. ></view>
  491. </view>
  492. <view class="btns">
  493. <view class="btnResult" v-if="isTaking" @click="takePhoto"
  494. >拍照</view
  495. >
  496. <view class="btnResult" v-if="!isTaking" @click="reTake">重拍</view>
  497. <view class="btnResult" v-if="!isTaking" @click="submit">确认</view>
  498. </view>
  499. </view>
  500. </view>
  501. </u-mask>
  502. <u-popup
  503. v-model="noticeShow"
  504. class="notice_modal"
  505. @close="closeNotice"
  506. mode="center"
  507. border-radius="14"
  508. width="700rpx"
  509. height="900rpx"
  510. >
  511. <div class="content">
  512. <scroll-view scroll-y="true" style="height: 100%">
  513. <view class="title">学员须知</view>
  514. <text class="text">
  515. {{ goodsData.buyNote }}
  516. </text>
  517. </scroll-view>
  518. </div>
  519. </u-popup>
  520. <u-modal
  521. v-model="showMark"
  522. title="提示"
  523. @confirm="markConfirm"
  524. @cancel="markCancel"
  525. confirm-text="复制学习网址"
  526. :show-cancel-button="true"
  527. cancel-text="关闭"
  528. >
  529. <view class="slot-content">
  530. <view>您的学习账号已经开通,请按照步骤操作,进行学习。</view>
  531. <view>1.复制学习地址:{{ markContent }}</view>
  532. <view>2.在【浏览器中】打开复制的学习网址</view>
  533. <view>3.打开学习网址后,选择【个人用户】进行登录</view>
  534. <view>(1)账号:您个人的身份证号码</view>
  535. <view>(2)密码:身份证号码,再加111111</view>
  536. </view>
  537. </u-modal>
  538. </view>
  539. </template>
  540. <script>
  541. import plv from "../static/polyv-sdk/index";
  542. import courseModule from "@/components/course/courseModule.vue";
  543. import courseChapter from "@/components/course/courseChapter.vue";
  544. import courseSection from "@/components/course/courseSection.vue";
  545. import { WEBVIEW_URL } from "@/common/request.js";
  546. // import { websocket } from "@/common/socket.js";
  547. import { mapGetters, mapMutations } from "vuex";
  548. export default {
  549. components: {
  550. courseModule,
  551. courseChapter,
  552. courseSection,
  553. },
  554. data() {
  555. return {
  556. courseName:'',
  557. markContent: "http://admin.zhujianpeixun.com/",
  558. showMark: false,
  559. hasStart: false,
  560. channelItem: null,
  561. lockTimer: null,
  562. orderGoodsId: 0,
  563. noticeShow: false,
  564. navShow: true,
  565. enableAutoRotation: true,
  566. seekTime: "",
  567. toastTimer: null,
  568. videoToastShow: false,
  569. initLiveOk: false,
  570. livePlay: false, //是否正在播放直播,不含暂停
  571. liveDuration: 0, //直播观看时长
  572. videoOption: {
  573. mode: "live",
  574. uid: "",
  575. cid: "",
  576. openId: "",
  577. isAutoChange: false,
  578. forceVideo: false,
  579. },
  580. courseHandoutsData: "",
  581. liveDetail: {},
  582. showSet: false,
  583. startStatus: false,
  584. detail: {},
  585. courseId: 0,
  586. placeholder:
  587. "您可以在这里输入笔记内容\n还可以点击左侧图标为笔记加上时间标记",
  588. inputStyle: {
  589. background: "rgba(244, 244, 244, 0.98)",
  590. borderRadius: "24rpx",
  591. padding: "8rpx",
  592. marginBottom: "10rpx",
  593. },
  594. list: [],
  595. menuList: [],
  596. current: 0,
  597. vid: "",
  598. goodsId: 0,
  599. goodsData: {},
  600. photoPopup: false,
  601. goodsPlayConfig: null,
  602. autoplay: false,
  603. isAllowSeek: "no",
  604. playbackRate: [1.0],
  605. timer: null,
  606. answerTimer: null,
  607. goodsPhotographConfig: null,
  608. intervalTimeList: [], // 间隔拍照时长
  609. intervalTimeIndex: 0, //当前处于哪个时间段拍照
  610. playTime: 0, //页面播放时长,不含暂停
  611. currentTime: 0,
  612. avatarUrl: "",
  613. ossAvatarUrl: "",
  614. studyDuration: 0, // 当前视频时长
  615. gradeId: 0,
  616. chapterId: 0,
  617. moduleId: 0,
  618. reMenuList: [],
  619. answerList: [],
  620. assignUserId: 0,
  621. placeholder: "您可以在这里输入答疑内容",
  622. ctxValue: "",
  623. noteList: [],
  624. courseList:[],
  625. noteValue: "",
  626. noteId: 0,
  627. recordObj: 0,
  628. gradeDetail: {},
  629. isTaking: true, //是否正在拍照
  630. needSeek: false, //第一次播放是否需要跳转
  631. needProfileModal: false, //是否需要资料审核弹框
  632. liveObj: {},
  633. photoNum: 0,
  634. photoList: [], //拍照的时间点
  635. photoConfig: false, //是否配置好拍照次数
  636. photoIndex: 0, //当前位于拍照的区间下标 从0开始
  637. photoHistoryList: [], //已拍照历史的下标点
  638. sectionItem: null,
  639. businessData: {},
  640. showNotes: true,
  641. menuIndex: [],
  642. uploadLock: false, //上传图片
  643. isPlayRebuild: false, //是否正在播放重修视频
  644. isRebuild: false, //视频是否从重修目录点击
  645. isFocus: false,
  646. clearTimer: null,
  647. livingItem: "",
  648. option: null,
  649. isOther: "",
  650. };
  651. },
  652. computed: {
  653. ...mapGetters(["userInfo", "playSectionId", "playChannelId", "playVID"]),
  654. },
  655. onLoad(option) {
  656. this.courseId = Number(option.id);
  657. this.goodsId = Number(option.goodsId);
  658. this.orderGoodsId = Number(option.orderGoodsId) || "";
  659. this.isOther = option.isOther;
  660. this.option = option;
  661. // this.courseDetail();
  662. // this.getGoodsDetail();
  663. // this.getAnswerList();
  664. // this.studyRecordMenuAllList();
  665. // this.answerTimer = setInterval(() => {
  666. // this.getAnswerList();
  667. // }, 5000);
  668. // let noteSecond = Number(option.noteSecond);
  669. // if (noteSecond > 0) {
  670. // //我的消息跳过来,播放节
  671. // let item = {
  672. // sectionId: Number(option.sectionId),
  673. // recordingUrl: option.recordingUrl,
  674. // noteSecond: noteSecond,
  675. // studyDuration: noteSecond,
  676. // };
  677. // let playNextId = `moduleId${option.moduleId}chapterId${
  678. // option.chapterId
  679. // }sectionId${option.sectionId}${option.isRebuild ? "isRebuild" : ""}`;
  680. // this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId });
  681. // this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  682. // this.$store.commit("updatePlayNextId", playNextId);
  683. // console.log("this.playNoteVideo");
  684. // this.playNoteVideo(item)
  685. // } else {
  686. // this.studyRecordQueryLiveLast();
  687. // }
  688. },
  689. async onShow() {
  690. var self = this;
  691. //相机授权
  692. // this.userConfirmInfoDetail().then(res => {
  693. // })
  694. if (this.isOther) {
  695. this.showMark = true;
  696. return;
  697. }
  698. await this.getGoodsDetail();
  699. this.getbaseprofiletplists().then(async (res) => {
  700. await this.courseCourseList();
  701. if(this.option.recordingUrl) {
  702. let noteSecond = Number(this.option.noteSecond);
  703. if (noteSecond > 0) {
  704. //我的消息跳过来,播放节
  705. let item = {
  706. sectionId: Number(this.option.sectionId),
  707. recordingUrl: this.option.recordingUrl,
  708. noteSecond: noteSecond,
  709. studyDuration: noteSecond,
  710. };
  711. let playNextId = `moduleId${this.option.moduleId}chapterId${
  712. this.option.chapterId
  713. }sectionId${this.option.sectionId}${
  714. this.option.isRebuild ? "isRebuild" : ""
  715. }`;
  716. this.$store.commit("setPlaySectionId", {
  717. playSectionId: item.sectionId,
  718. });
  719. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  720. this.$store.commit("updatePlayNextId", playNextId);
  721. console.log("this.playNoteVideo");
  722. this.playNoteVideo(item);
  723. } else {
  724. this.studyRecordQueryLiveLast();
  725. }
  726. }
  727. });
  728. console.log(this.gradeId, 7512);
  729. },
  730. onHide() {},
  731. onUnload() {
  732. if (this.playSectionId > 0 && this.hasStart) {
  733. //退出提交记录
  734. this.postStudyRecord();
  735. }
  736. //清除正在播放的节ID
  737. // this.$store.commit('setPlayObj',null)
  738. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  739. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  740. this.$store.commit("setPlayVID", { playVID: null });
  741. this.closePlv();
  742. console.log("onUnload");
  743. //移除所有的事件监听器
  744. uni.$off();
  745. clearInterval(this.answerTimer);
  746. if (this.timer) {
  747. clearInterval(this.timer);
  748. }
  749. console.log(this.lockTimer, "this.lockTimer");
  750. if (this.lockTimer) {
  751. clearInterval(this.lockTimer);
  752. this.$api
  753. .lockDelLock({
  754. action: "jxjy",
  755. uuid: this.$method.getUuid(),
  756. })
  757. .then((res) => {});
  758. }
  759. // websocket.sendMsg("delAction");
  760. },
  761. mounted() {
  762. uni.$on("changeSection", (oldSectionId) => {
  763. console.log(this.playVID);
  764. this.hasStart = false;
  765. this.photoConfig = false;
  766. this.photoIndex = 0;
  767. var polyvPlayerContext = this.selectComponent("#playerVideo");
  768. if (polyvPlayerContext) {
  769. //解决同个节视频切换问题
  770. polyvPlayerContext.seek(0);
  771. polyvPlayerContext.pause();
  772. }
  773. //清除直播
  774. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  775. this.postStudyRecord(0, oldSectionId);
  776. });
  777. uni.$on("getSection", (item) => {
  778. //清除直播
  779. this.hasStart = false;
  780. this.isPlayRebuild = item.rebuild;
  781. this.photoConfig = false;
  782. this.photoIndex = 0;
  783. this.sectionItem = item;
  784. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  785. //获取拍照历史
  786. this.getPhotoLastRecord();
  787. this.playVideo(item);
  788. });
  789. uni.$on("levelId", (item) => {
  790. let arr = item.split("-");
  791. //点击节获取的各层级ID
  792. this.moduleId = arr[0];
  793. this.chapterId = arr[1];
  794. });
  795. uni.$on("getChannel", (item) => {
  796. //清除录播
  797. this.hasStart = false;
  798. this.$store.commit("setPlayVID", { playVID: null });
  799. this.getPhotoLastRecord();
  800. this.playChannel(item);
  801. this.channelItem = item;
  802. });
  803. uni.$on("isRebuild", (item) => {
  804. console.log(item);
  805. this.isRebuild = item;
  806. });
  807. this.updateChapterOpen(true);
  808. },
  809. methods: {
  810. ...mapMutations(["updateChapterOpen", "updateLiveLast"]),
  811. markCancel() {
  812. uni.navigateBack({
  813. delta: 1,
  814. });
  815. },
  816. courseCourseList() {
  817. return new Promise((resolve) => {
  818. this.$api.courseCourseList({
  819. gradeId:this.gradeId,
  820. goodsId:this.goodsId,
  821. pageSize:10,
  822. pageNum:1,
  823. }).then(async (res) => {
  824. this.courseList.push(...res.data.rows);
  825. if (!this.courseId) {
  826. this.courseId = this.courseList[0].courseId;
  827. this.courseName = this.courseList[0].courseName;
  828. } else {
  829. this.courseName = this.courseList.find(item => item.courseId == this.courseId).courseName;
  830. }
  831. await this.courseChange();
  832. resolve();
  833. });
  834. });
  835. },
  836. courseChange2(e) {
  837. this.courseId = this.courseList[e.detail.value].courseId;
  838. this.courseName = this.courseList[e.detail.value].courseName;
  839. this.courseChange();
  840. },
  841. /**
  842. * 切换科目
  843. */
  844. courseChange() {
  845. return new Promise((resolve) => {
  846. if(this.playSectionId) {
  847. this.postStudyRecord(0)
  848. }
  849. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  850. this.$store.commit("setPlayVID", { playVID: null });
  851. this.startStatus = false;
  852. this.vid = ''
  853. this.courseDetail();
  854. this.getAnswerList();
  855. this.studyRecordMenuAllList();
  856. this.getNoteList();
  857. this.getMenuList();
  858. this.getReMenuList(); //获取重修目录
  859. clearTimeout(this.answerTimer)
  860. this.answerTimer = setInterval(() => {
  861. this.getAnswerList();
  862. }, 5000);
  863. resolve();
  864. });
  865. },
  866. markConfirm() {
  867. uni.setClipboardData({
  868. data: this.markContent,
  869. success: function () {
  870. console.log("success");
  871. setTimeout(() => {
  872. uni.navigateBack({
  873. delta: 1,
  874. });
  875. }, 1000);
  876. },
  877. });
  878. },
  879. closeNotice() {
  880. this.$api
  881. .baseHandoutTip({
  882. orderGoodsId: this.orderGoodsId,
  883. })
  884. .then((res) => {});
  885. },
  886. baseHandoutTipList() {
  887. this.$api
  888. .baseHandoutTipList({
  889. orderGoodsId: this.orderGoodsId,
  890. })
  891. .then((res) => {
  892. if (res.data.rows.length == 0) {
  893. this.noticeShow = true;
  894. }
  895. });
  896. },
  897. /**
  898. * 获取上次观看的直播
  899. */
  900. studyRecordGetLastLive() {
  901. this.$api
  902. .studyRecordGetLastLive({
  903. orderGoodsId: this.orderGoodsId,
  904. courseId: this.courseId,
  905. })
  906. .then((res) => {
  907. console.log(res, "liveres");
  908. this.updateLiveLast(res.data.data);
  909. });
  910. },
  911. studyRecordQueryLiveLast() {
  912. this.$api
  913. .studyRecordQueryLiveLast({
  914. orderGoodsId: this.orderGoodsId,
  915. courseId: this.courseId,
  916. })
  917. .then((res) => {
  918. console.log(res, "couse");
  919. if (res.data.data) {
  920. if (res.data.data.sectionType == 1) {
  921. //录播
  922. this.$store.commit("setPlaySectionId", {
  923. playSectionId: res.data.data.sectionId,
  924. });
  925. this.$store.commit("setPlayVID", {
  926. playVID: res.data.data.recordingUrl,
  927. });
  928. this.sectionItem = res.data.data;
  929. this.playVideo(res.data.data);
  930. } else if (res.data.data.sectionType == 2) {
  931. //直播
  932. this.studyRecordGetLastLive();
  933. } else if (res.data.data.sectionType == 3) {
  934. //回放
  935. this.$store.commit("setPlaySectionId", {
  936. playSectionId: res.data.data.sectionId,
  937. });
  938. this.$store.commit("setPlayVID", {
  939. playVID: res.data.data.recordingUrl,
  940. });
  941. this.sectionItem = res.data.data;
  942. this.playVideo(res.data.data);
  943. }
  944. }
  945. });
  946. },
  947. /**
  948. * 模块大节播放完毕,刷新列表
  949. */
  950. sectionPlayEnd(isRebuild, index) {
  951. console.log("sectionPlayEnd");
  952. console.log("isRebuild", isRebuild), console.log("index", index);
  953. if (this.reMenuList.length > 0) {
  954. //有重修目录
  955. if (isRebuild.isRebuild) {
  956. //从重修点击
  957. this.$api
  958. .reMenuList({
  959. orderGoodsId: this.orderGoodsId,
  960. courseId: this.courseId,
  961. rebuild: 1,
  962. gradeId: this.gradeId,
  963. })
  964. .then((res) => {
  965. console.log("Rebuild1");
  966. if (res.data.code == 200) {
  967. if (res.data.rows.length) {
  968. res.data.rows[index].name = res.data.rows[index].menuName;
  969. this.$set(this.reMenuList, index, res.data.rows[index]);
  970. for (let i = 0; i < res.data.rows.length; i++) {
  971. let item = res.data.rows[i];
  972. item.down = true;
  973. item.id = item.menuId;
  974. item.name = item.menuName;
  975. }
  976. this.reMenuList = [];
  977. this.$nextTick(() => {
  978. this.reMenuList = res.data.rows;
  979. console.log(this.reMenuList, "this.reMenuList1");
  980. });
  981. } else {
  982. this.reMenuList = [];
  983. }
  984. this.$nextTick(() => {
  985. if (this.reMenuList.length > 0) {
  986. this.list = [
  987. {
  988. name: "目录",
  989. },
  990. {
  991. name: "讲义",
  992. },
  993. {
  994. name: "笔记",
  995. },
  996. {
  997. name: "答疑",
  998. },
  999. { name: "重修目录" },
  1000. ];
  1001. } else {
  1002. this.list = [
  1003. {
  1004. name: "目录",
  1005. },
  1006. {
  1007. name: "讲义",
  1008. },
  1009. {
  1010. name: "笔记",
  1011. },
  1012. {
  1013. name: "答疑",
  1014. },
  1015. ];
  1016. if (this.current == 4) {
  1017. this.current = 0;
  1018. }
  1019. }
  1020. });
  1021. }
  1022. });
  1023. this.$api
  1024. .reMenuList({
  1025. courseId: this.courseId,
  1026. gradeId: this.gradeId,
  1027. orderGoodsId: this.orderGoodsId,
  1028. })
  1029. .then((res) => {
  1030. console.log("noRebuild1");
  1031. if (res.data.code == 200) {
  1032. for (let i = 0; i < res.data.rows.length; i++) {
  1033. let item = res.data.rows[i];
  1034. item.down = true;
  1035. item.id = item.menuId;
  1036. item.name = item.menuName;
  1037. item.menuType = item.type;
  1038. }
  1039. this.menuList = [];
  1040. this.$nextTick(() => {
  1041. this.menuList = res.data.rows;
  1042. });
  1043. }
  1044. });
  1045. } else {
  1046. //从普通目录点击
  1047. this.$api
  1048. .reMenuList({
  1049. courseId: this.courseId,
  1050. gradeId: this.gradeId,
  1051. orderGoodsId: this.orderGoodsId,
  1052. })
  1053. .then((res) => {
  1054. console.log("noRebuild2");
  1055. if (res.data.code == 200) {
  1056. res.data.rows[index].name = res.data.rows[index].menuName;
  1057. res.data.rows[index].id = res.data.rows[index].menuId;
  1058. this.$set(this.menuList, index, res.data.rows[index]);
  1059. }
  1060. });
  1061. this.$api
  1062. .reMenuList({
  1063. orderGoodsId: this.orderGoodsId,
  1064. courseId: this.courseId,
  1065. rebuild: 1,
  1066. gradeId: this.gradeId,
  1067. })
  1068. .then((res) => {
  1069. console.log("Rebuild2");
  1070. if (res.data.code == 200) {
  1071. if (res.data.rows.length) {
  1072. // for (let i = 0; i < res.data.rows.length; i++) {
  1073. // let item = res.data.rows[i];
  1074. // item.down = true;
  1075. // item.id = item.menuId;
  1076. // item.name = item.menuName;
  1077. // }
  1078. // this.reMenuList = res.data.rows;
  1079. } else {
  1080. this.reMenuList = [];
  1081. }
  1082. this.$nextTick(() => {
  1083. if (this.reMenuList.length > 0) {
  1084. this.list = [
  1085. {
  1086. name: "目录",
  1087. },
  1088. {
  1089. name: "讲义",
  1090. },
  1091. {
  1092. name: "笔记",
  1093. },
  1094. {
  1095. name: "答疑",
  1096. },
  1097. { name: "重修目录" },
  1098. ];
  1099. } else {
  1100. this.list = [
  1101. {
  1102. name: "目录",
  1103. },
  1104. {
  1105. name: "讲义",
  1106. },
  1107. {
  1108. name: "笔记",
  1109. },
  1110. {
  1111. name: "答疑",
  1112. },
  1113. ];
  1114. if (this.current == 4) {
  1115. this.current = 0;
  1116. }
  1117. }
  1118. });
  1119. }
  1120. });
  1121. }
  1122. } else {
  1123. //没有重修目录
  1124. this.$api
  1125. .reMenuList({
  1126. courseId: this.courseId,
  1127. gradeId: this.gradeId,
  1128. orderGoodsId: this.orderGoodsId,
  1129. })
  1130. .then((res) => {
  1131. console.log("noRebuild3");
  1132. console.log("noRebuild3index", index);
  1133. if (res.data.code == 200) {
  1134. res.data.rows[index].name = res.data.rows[index].menuName;
  1135. res.data.rows[index].id = res.data.rows[index].menuId;
  1136. this.$set(this.menuList, index, res.data.rows[index]);
  1137. }
  1138. });
  1139. }
  1140. },
  1141. goLive(item) {
  1142. let moduleId = item.moduleId || 0;
  1143. let chapterId = item.chapterId || 0;
  1144. let sectionId = item.sectionId || item.menuId;
  1145. let encode = encodeURIComponent(
  1146. WEBVIEW_URL +
  1147. "pages/live/index?token=" +
  1148. uni.getStorageSync("token") +
  1149. "&userInfo=" +
  1150. JSON.stringify(this.userInfo) +
  1151. "&channelId=" +
  1152. item.liveUrl +
  1153. "&gradeId=" +
  1154. this.gradeId +
  1155. "&courseId=" +
  1156. this.courseId +
  1157. "&goodsId=" +
  1158. this.goodsId +
  1159. "&orderGoodsId=" +
  1160. this.orderGoodsId +
  1161. "&sectionId=" +
  1162. sectionId +
  1163. "&chapterId=" +
  1164. chapterId +
  1165. "&moduleId=" +
  1166. moduleId
  1167. );
  1168. uni.navigateTo({
  1169. url: `../../pages/webview/index?url=` + encode,
  1170. });
  1171. },
  1172. studyRecordMenuAllList() {
  1173. this.$api
  1174. .studyRecordMenuAllList({
  1175. courseId: this.courseId,
  1176. gradeId: this.gradeId,
  1177. goodsId: this.goodsId,
  1178. })
  1179. .then((res) => {
  1180. let nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  1181. // this.livingItem = res.data.data[0]
  1182. this.livingItem = res.data.data.find(
  1183. (item) =>
  1184. item.liveStartTime <= nowTime && item.liveEndTime > nowTime
  1185. );
  1186. });
  1187. },
  1188. getbaseprofiletplists() {
  1189. return new Promise((resolve) => {
  1190. let self = this;
  1191. this.getCameraSetting();
  1192. this.$api
  1193. .getbaseprofiletplists({
  1194. goodsId: self.goodsId,
  1195. orderGoodsId: this.orderGoodsId,
  1196. })
  1197. .then((res) => {
  1198. console.log(res, "res1");
  1199. if (res.data.code === 200 && res.data.rows.length) {
  1200. if (res.data.rows[0].keyValue) {
  1201. self.$api.getbaseprofiletpId(self.goodsId).then((baseRes) => {
  1202. if (baseRes.data.code === 200) {
  1203. if (baseRes.data.data) {
  1204. self.$api
  1205. .getbaseprofiletpgetInfo({
  1206. goodsId: self.goodsId,
  1207. orderGoodsId: self.orderGoodsId,
  1208. })
  1209. .then((result) => {
  1210. console.log(result, "result");
  1211. if (result.data.code === 200) {
  1212. if (
  1213. !result.data.data ||
  1214. (result.data.data.status === 3 &&
  1215. result.data.data.changeStatus === 1)
  1216. ) {
  1217. if (!result.data.data) {
  1218. self.needProfileModal = true;
  1219. uni.showModal({
  1220. content: "请前往填写资料",
  1221. cancelText: "返回",
  1222. success: function (resultst) {
  1223. if (resultst.confirm) {
  1224. self.$navTo.togo("/pages2/verify/input", {
  1225. id: self.goodsId,
  1226. orderGoodsId: self.orderGoodsId,
  1227. });
  1228. }
  1229. if (resultst.cancel) {
  1230. uni.navigateBack();
  1231. }
  1232. },
  1233. });
  1234. } else {
  1235. self.needProfileModal = true;
  1236. uni.showModal({
  1237. content: "资料审核不通过,请前往重新填写",
  1238. cancelText: "返回",
  1239. success: function (resultst) {
  1240. if (resultst.confirm) {
  1241. self.$navTo.togo("/pages2/verify/input", {
  1242. id: self.goodsId,
  1243. orderGoodsId: self.orderGoodsId,
  1244. });
  1245. }
  1246. if (resultst.cancel) {
  1247. uni.navigateBack();
  1248. }
  1249. },
  1250. });
  1251. }
  1252. } else if (
  1253. result.data.data.status === 1 &&
  1254. JSON.parse(res.data.rows[0].keyValue2)[0]
  1255. ) {
  1256. self.$api
  1257. .getbaseprofileStampgetInfo({
  1258. goodsId: self.goodsId,
  1259. orderGoodsId: self.orderGoodsId,
  1260. })
  1261. .then((k) => {
  1262. if (k.data.code === 200) {
  1263. if (
  1264. !k.data.data ||
  1265. (k.data.data.status === 3 &&
  1266. k.data.data.changeStatus === 1)
  1267. ) {
  1268. if (!k.data.data) {
  1269. self.needProfileModal = true;
  1270. uni.showModal({
  1271. cancelText: "返回",
  1272. content: "请前往填写盖章资料",
  1273. success: function (resultst) {
  1274. if (resultst.confirm) {
  1275. self.$navTo.togo(
  1276. "/pages2/verify/input2",
  1277. {
  1278. id: self.goodsId,
  1279. orderGoodsId:
  1280. self.orderGoodsId,
  1281. }
  1282. );
  1283. }
  1284. if (resultst.cancel) {
  1285. uni.navigateBack();
  1286. }
  1287. },
  1288. });
  1289. } else {
  1290. self.needProfileModal = true;
  1291. uni.showModal({
  1292. cancelText: "返回",
  1293. content:
  1294. "资料盖章审核不通过,请前往重新填写",
  1295. success: function (resultst) {
  1296. if (resultst.confirm) {
  1297. self.$navTo.togo(
  1298. "/pages2/verify/input2",
  1299. {
  1300. id: self.goodsId,
  1301. orderGoodsId:
  1302. self.orderGoodsId,
  1303. }
  1304. );
  1305. }
  1306. if (resultst.cancel) {
  1307. uni.navigateBack();
  1308. }
  1309. },
  1310. });
  1311. }
  1312. } else {
  1313. resolve();
  1314. }
  1315. }
  1316. });
  1317. } else {
  1318. resolve();
  1319. }
  1320. }
  1321. });
  1322. } else {
  1323. resolve();
  1324. }
  1325. }
  1326. });
  1327. } else {
  1328. resolve();
  1329. }
  1330. } else {
  1331. resolve();
  1332. }
  1333. });
  1334. if (this.gradeId > 0) {
  1335. //提交完资料返回判断是否已开班
  1336. this.getGradeInfo();
  1337. }
  1338. });
  1339. },
  1340. /**
  1341. * 获取业务层次详情
  1342. */
  1343. courseBusiness() {
  1344. this.$api.courseBusiness(this.goodsData.businessId).then((res) => {
  1345. this.businessData = res.data.data;
  1346. });
  1347. },
  1348. /**
  1349. * 计算tabs宽度
  1350. */
  1351. itemWidth() {
  1352. return 100 / this.list.length + "%";
  1353. },
  1354. /**
  1355. * 获取讲义权限
  1356. */
  1357. courseHandouts() {
  1358. this.$api.courseHandouts(this.goodsData.handoutsId).then((res) => {
  1359. this.courseHandoutsData = res.data.data;
  1360. });
  1361. },
  1362. findMenuNextSection(index) {
  1363. for (let i = index + 1; i < this.reMenuList.length; i++) {
  1364. let item = this.reMenuList[i];
  1365. if (item.type == 3) {
  1366. return item;
  1367. }
  1368. }
  1369. return {};
  1370. },
  1371. loadedmetadata(e) {
  1372. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1373. this.hasStart = true;
  1374. uni.$off("playPause");
  1375. uni.$on("playPause", () => {
  1376. polyvPlayerContext.pause();
  1377. });
  1378. if (!this.recordObj.videoCurrentTime) {
  1379. //新视频直接提交一条观看记录
  1380. this.postStudyRecord(0);
  1381. }
  1382. },
  1383. getPhotoLastRecord() {
  1384. let self = this;
  1385. let data = {
  1386. sectionId: parseInt(self.playSectionId),
  1387. goodsId: parseInt(self.goodsId),
  1388. courseId: parseInt(self.courseId),
  1389. gradeId: parseInt(self.gradeId),
  1390. chapterId: parseInt(self.chapterId),
  1391. moduleId: parseInt(self.moduleId),
  1392. orderGoodsId: this.orderGoodsId,
  1393. };
  1394. this.$api.getPhotoLastRecord(data).then((res) => {
  1395. if (res.data.code == 200) {
  1396. //清空历史数据
  1397. self.photoHistoryList = [];
  1398. this.photoIndex = 0;
  1399. self.photoList = [];
  1400. for (let i = 0; i < res.data.data.length; i++) {
  1401. //-2存储随机拍照数组
  1402. if (res.data.data[i].photoIndex == -2) {
  1403. self.photoList = res.data.data[i].timeInterval.split(",");
  1404. } else {
  1405. self.photoHistoryList.push(res.data.data[i].photoIndex);
  1406. }
  1407. }
  1408. }
  1409. });
  1410. },
  1411. //postTime 只提交随机时间
  1412. postCoursePhotoRecord(postTime = false) {
  1413. return new Promise((resolve, reject) => {
  1414. let currentTime = 0;
  1415. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1416. if (polyvPlayerContext) {
  1417. currentTime = polyvPlayerContext.getCurrentTime();
  1418. }
  1419. let self = this;
  1420. let photoIndex = self.photoIndex;
  1421. let data = {
  1422. photo: self.ossAvatarUrl,
  1423. sectionId: parseInt(self.playSectionId),
  1424. goodsId: parseInt(self.goodsId),
  1425. courseId: parseInt(self.courseId),
  1426. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  1427. gradeId: parseInt(self.gradeId),
  1428. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  1429. photoNum: parseInt(self.photoNum),
  1430. chapterId: parseInt(self.chapterId),
  1431. moduleId: parseInt(self.moduleId),
  1432. timeInterval: postTime ? self.photoList.join(",") : "",
  1433. orderGoodsId: this.orderGoodsId,
  1434. };
  1435. console.log("提交接口", data);
  1436. this.$api
  1437. .coursePhotoRecord(data)
  1438. .then((res) => {
  1439. console.log(res, "postCoursePhotoRecord");
  1440. if (res.data.code == 200) {
  1441. resolve();
  1442. } else {
  1443. reject();
  1444. }
  1445. })
  1446. .catch((err) => {
  1447. reject();
  1448. });
  1449. });
  1450. },
  1451. randomNum(minNum, maxNum) {
  1452. switch (arguments.length) {
  1453. case 1:
  1454. return parseInt(Math.random() * minNum + 1, 10);
  1455. break;
  1456. case 2:
  1457. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  1458. break;
  1459. default:
  1460. return 0;
  1461. break;
  1462. }
  1463. },
  1464. //配置随机拍照时间
  1465. configPhoto() {
  1466. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1467. let totalVideoTime = polyvPlayerContext.getDuration();
  1468. let duration = polyvPlayerContext.getCurrentTime();
  1469. let photoNum = this.photoNum;
  1470. if (!this.photoConfig) {
  1471. this.photoConfig = true;
  1472. // let spaceTime = Math.floor(totalVideoTime/photoNum) //拍照时间区间
  1473. // if(spaceTime<5){//区间小于5秒
  1474. // photoNum = Math.floor(totalVideoTime/5)
  1475. // spaceTime = 5
  1476. // }
  1477. // if(photoNum<1){
  1478. // photoNum = 1 //只要设置,至少拍一次
  1479. // spaceTime = totalVideoTime
  1480. // }
  1481. // let initSpace = 0
  1482. //没有历史拍照间隔数据
  1483. if (this.photoList.length == 0) {
  1484. if (totalVideoTime >= 900) {
  1485. //大于15分钟
  1486. if (photoNum == 1) {
  1487. //开头拍1张
  1488. this.photoList.push(0);
  1489. } else if (photoNum == 3) {
  1490. //拍3张
  1491. this.photoList.push(0); //开头拍一张
  1492. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  1493. let centerMinTime = centerTime - 300; //前后5分钟
  1494. let centerMaxTime = centerTime + 300;
  1495. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  1496. this.photoList.push(centerTakeTime); //中间拍一张
  1497. let endMaxTime = totalVideoTime - 60;
  1498. let endMinTime = totalVideoTime - 300;
  1499. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1500. this.photoList.push(endTakeTime); //最后拍一张
  1501. }
  1502. } else {
  1503. //小于15分钟,只拍前后各一张
  1504. if (photoNum == 1) {
  1505. //开头拍1张
  1506. this.photoList.push(0);
  1507. } else if (photoNum == 3) {
  1508. //拍2张
  1509. if (totalVideoTime <= 300) {
  1510. //小于5分钟
  1511. this.photoList.push(0); //开头拍一张
  1512. let endTakeTime = this.randomNum(10, totalVideoTime); //中间随机取一张
  1513. this.photoList.push(endTakeTime);
  1514. } else {
  1515. this.photoList.push(0); //开头拍一张
  1516. let endMaxTime = totalVideoTime - 60;
  1517. let endMinTime = totalVideoTime - 300;
  1518. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1519. this.photoList.push(endTakeTime); //最后1-5分钟拍一张
  1520. }
  1521. }
  1522. }
  1523. // for(let i=0;i<photoNum;i++){
  1524. // let s = this.randomNum(initSpace,initSpace+spaceTime)
  1525. // if(s>totalVideoTime){
  1526. // s = totalVideoTime-1
  1527. // }
  1528. // if(s<=5){
  1529. // s =5 //避免出现5秒内拍照时间
  1530. // }
  1531. // this.photoList.push(s)
  1532. // initSpace+=spaceTime
  1533. // }
  1534. console.log(this.photoList, "随机拍照时间数组11", photoNum);
  1535. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  1536. }
  1537. console.log(this.photoList, "随机拍照时间数组");
  1538. //兼容已有观看历史
  1539. for (let i = 0; i < this.photoList.length - 1; i++) {
  1540. if (
  1541. this.photoList[i] < duration &&
  1542. this.photoList[i + 1] > duration
  1543. ) {
  1544. this.photoIndex = i + 1;
  1545. // console.log("我的修改了photoIndex")
  1546. break;
  1547. }
  1548. if (duration > this.photoList[this.photoList.length - 1]) {
  1549. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  1550. // console.log("我的修改了photoIndex")
  1551. break;
  1552. }
  1553. }
  1554. }
  1555. },
  1556. getLiveUid(channelId) {
  1557. let self = this;
  1558. return new Promise((resolve) => {
  1559. let data = {
  1560. channelId: channelId,
  1561. orderGoodsId: this.orderGoodsId,
  1562. };
  1563. self.$api.polyvSign(data).then((res) => {
  1564. resolve(res.data.data);
  1565. });
  1566. });
  1567. },
  1568. timeEventLiving() {
  1569. if (plv != null) {
  1570. if (this.livePlay) {
  1571. this.liveDuration = this.liveDuration + 1; //每隔1秒
  1572. if (this.liveDuration == 2) {
  1573. //直播第2秒拍照
  1574. console.log(this.channelItem);
  1575. console.log(this.photoHistoryList, "this.photoHistoryList");
  1576. if (
  1577. this.goodsPhotographConfig &&
  1578. this.goodsPhotographConfig.livephotograph == 1 &&
  1579. this.channelItem.learning != 1 &&
  1580. this.photoHistoryList.length == 0
  1581. ) {
  1582. //开启直播拍照
  1583. this.openPhoto();
  1584. } else {
  1585. this.postStudyRecord(0);
  1586. }
  1587. }
  1588. }
  1589. }
  1590. },
  1591. playerLiveStatusChange(e) {
  1592. const status = e.detail.status;
  1593. console.log("直播状态", status);
  1594. if (status === "live") {
  1595. console.log("开始直播");
  1596. //开始播放
  1597. if (this.timer) {
  1598. clearInterval(this.timer);
  1599. }
  1600. this.livePlay = true;
  1601. this.timer = setInterval(this.timeEventLiving, 1000); //定时器
  1602. }
  1603. if (status === "end") {
  1604. this.hasStart = false;
  1605. if (this.livePlay) {
  1606. //只有播放过的结束才提交,避免未开播触发结束
  1607. this.postStudyRecord(1);
  1608. }
  1609. console.log("结束直播");
  1610. this.livePlay = false;
  1611. // 未开始
  1612. }
  1613. },
  1614. closePlv() {
  1615. if (plv) {
  1616. plv.destroy();
  1617. }
  1618. },
  1619. playChannel(item) {
  1620. if (this.timer) {
  1621. clearInterval(this.timer);
  1622. }
  1623. this.startStatus = true;
  1624. this.initLive();
  1625. },
  1626. setLiveOption(status) {
  1627. const { userId, channelId, recordFileSimpleModel, playbackEnabled } =
  1628. this.detail;
  1629. const playRecordFile =
  1630. playbackEnabled && recordFileSimpleModel && status === "end";
  1631. this.videoOption = {
  1632. mode: "live",
  1633. uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  1634. cid: this.playChannelId,
  1635. openId: this.userInfo.userAccount,
  1636. isAutoChange: false,
  1637. forceVideo: false,
  1638. };
  1639. },
  1640. async initLive() {
  1641. console.log(this.playChannelId, 7111);
  1642. this.liveObj = await this.getLiveUid(this.playChannelId);
  1643. this.initLiveOk = true;
  1644. let optionsData = {};
  1645. optionsData.mode = "live";
  1646. optionsData.forceVideo = false;
  1647. optionsData.channelId = this.playChannelId; // 频道ID '2553128'
  1648. optionsData.openId = this.userInfo.userAccount; // 用户openId this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
  1649. optionsData.userId = this.liveObj.uid; // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
  1650. let self = this;
  1651. this.closePlv();
  1652. plv.init(optionsData).then(({ detail, chat }) => {
  1653. self.liveDetail = detail;
  1654. // 设置mode为live的videoOption
  1655. this.setLiveOption();
  1656. if (detail.isPPT) {
  1657. chat.on(chat.events.SLICESTART, () => {
  1658. // 开始直播
  1659. });
  1660. } else {
  1661. plv.api.getOrdinaryLiveStatus(detail.stream);
  1662. }
  1663. });
  1664. },
  1665. openSetting(res) {
  1666. console.log(res, 98);
  1667. },
  1668. getCameraSetting() {
  1669. const self = this;
  1670. wx.getSetting({
  1671. success: (res) => {
  1672. if (res.authSetting["scope.camera"]) {
  1673. // 用户已经授权
  1674. self.showSet = false;
  1675. } else {
  1676. // 用户还没有授权,向用户发起授权请求
  1677. wx.authorize({
  1678. scope: "scope.camera",
  1679. success() {
  1680. // 用户同意授权
  1681. self.showSet = false;
  1682. },
  1683. fail() {
  1684. // 用户不同意授权
  1685. self.showSet = true;
  1686. /* wx.showToast({
  1687. title: '摄像头授权失败',
  1688. icon: 'none',
  1689. duration: 3000
  1690. }) */
  1691. },
  1692. });
  1693. }
  1694. },
  1695. fail: (res) => {},
  1696. });
  1697. },
  1698. studyNotice() {
  1699. this.noticeShow = true;
  1700. },
  1701. //播放笔记视频
  1702. async playNoteVideo(item) {
  1703. console.log(item, "noteItem");
  1704. if (this.timer) {
  1705. clearInterval(this.timer);
  1706. }
  1707. if (this.vid) {
  1708. //切换视频
  1709. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1710. polyvPlayerContext.changeVid(item.recordingUrl);
  1711. } else {
  1712. this.vid = item.recordingUrl;
  1713. }
  1714. this.recordObj = { videoCurrentTime: item.noteSecond };
  1715. if (this.recordObj.videoCurrentTime) {
  1716. this.needSeek = true; //需要跳转到播放记录
  1717. }
  1718. this.startStatus = true;
  1719. //获取节笔记
  1720. },
  1721. //正常播放视频
  1722. async playVideo(item) {
  1723. console.log(item, "222");
  1724. if (this.timer) {
  1725. clearInterval(this.timer);
  1726. }
  1727. if (this.vid) {
  1728. //切换视频
  1729. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1730. polyvPlayerContext.changeVid(item.recordingUrl);
  1731. } else {
  1732. this.vid = item.recordingUrl;
  1733. }
  1734. this.recordObj = null;
  1735. this.recordObj = await this.getRecordLast();
  1736. this.needSeek = true; //跳转到播放记录
  1737. this.startStatus = true;
  1738. //获取节笔记
  1739. this.getNoteList();
  1740. },
  1741. getRecordLast() {
  1742. let self = this;
  1743. return new Promise((resolve) => {
  1744. let data = {
  1745. gradeId: Number(self.gradeId),
  1746. goodsId: Number(self.goodsId),
  1747. sectionId: Number(self.playSectionId),
  1748. courseId: Number(self.courseId),
  1749. chapterId: parseInt(self.chapterId),
  1750. moduleId: parseInt(self.moduleId),
  1751. orderGoodsId: this.orderGoodsId,
  1752. };
  1753. self.$api.recordLast(data).then((res) => {
  1754. resolve(res.data.data);
  1755. });
  1756. });
  1757. },
  1758. jumpNote(item) {
  1759. this.noteId = item.noteId;
  1760. //没视频播放
  1761. if (this.playSectionId == 0) {
  1762. console.log("即将跳到笔记位置1");
  1763. this.$u.toast("即将跳到笔记位置");
  1764. this.$store.commit("setPlaySectionId", {
  1765. playSectionId: item.sectionId,
  1766. });
  1767. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  1768. this.playNoteVideo(item);
  1769. } else {
  1770. //正在看当前笔记视频
  1771. console.log("即将跳到笔记位置2");
  1772. this.$u.toast("即将跳到笔记位置");
  1773. //跳到笔记时刻
  1774. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1775. polyvPlayerContext.seek(item.noteSecond);
  1776. polyvPlayerContext.play();
  1777. }
  1778. },
  1779. postNote() {
  1780. let self = this;
  1781. if (!(this.playSectionId > 0)) {
  1782. this.$u.toast("目前无播放视频");
  1783. return;
  1784. }
  1785. if (!this.noteValue) {
  1786. this.$u.toast("请输入内容");
  1787. return;
  1788. }
  1789. if (!this.gradeId) {
  1790. this.$u.toast("暂无班级数据");
  1791. return;
  1792. }
  1793. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1794. let noteDate = this.$method.getZeroTime();
  1795. let noteSecond = polyvPlayerContext.getCurrentTime();
  1796. console.log(noteSecond, 698);
  1797. if (!noteSecond) {
  1798. if (noteSecond == 0) {
  1799. //播放结束
  1800. noteSecond = polyvPlayerContext.getDuration();
  1801. console.log(noteSecond, 63398);
  1802. }
  1803. if (!noteSecond) {
  1804. this.$u.toast("视频暂未开始");
  1805. return;
  1806. }
  1807. }
  1808. let data = {
  1809. gradeId: this.gradeId,
  1810. goodsId: this.goodsId,
  1811. sectionId: this.playSectionId,
  1812. courseId: this.courseId,
  1813. noteText: this.noteValue,
  1814. noteDate: noteDate,
  1815. noteSecond: noteSecond,
  1816. orderGoodsId: this.orderGoodsId,
  1817. };
  1818. this.$api.postNote(data).then((res) => {
  1819. if (res.data.code == 200) {
  1820. this.$u.toast("发布成功");
  1821. self.getNoteList();
  1822. this.noteValue = "";
  1823. }
  1824. });
  1825. },
  1826. getGradeInfo() {
  1827. let self = this;
  1828. this.$store.state.allowLoading = false;
  1829. this.$api.goodsGradeInfo(this.gradeId).then((res) => {
  1830. if (res.data.code == 200) {
  1831. self.gradeDetail = res.data.data;
  1832. if (self.needProfileModal) {
  1833. return;
  1834. }
  1835. if (self.gradeDetail.learningStatus == 2) {
  1836. uni.showModal({
  1837. showCancel: false,
  1838. confirmText: "确定",
  1839. content:
  1840. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  1841. success: function (resultst) {
  1842. uni.navigateBack();
  1843. },
  1844. });
  1845. }
  1846. if (
  1847. self.gradeDetail.learningStatus == 3 &&
  1848. Number(self.gradeDetail.learningTimeStart) >
  1849. Number(new Date() / 1000)
  1850. ) {
  1851. uni.showModal({
  1852. showCancel: false,
  1853. cancelText: "返回",
  1854. content:
  1855. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  1856. success: function (resultst) {
  1857. uni.navigateBack();
  1858. },
  1859. });
  1860. }
  1861. }
  1862. });
  1863. this.$store.state.allowLoading = true;
  1864. },
  1865. getNoteList() {
  1866. let self = this;
  1867. self.noteList = [];
  1868. let data = {
  1869. courseId: this.courseId,
  1870. gradeId: this.gradeId,
  1871. goodsId: this.goodsId,
  1872. orderGoodsId: this.orderGoodsId,
  1873. };
  1874. if (this.playSectionId > 0) {
  1875. data.sectionId = this.playSectionId;
  1876. }
  1877. this.$api.noteList(data).then((res) => {
  1878. if (res.data.code == 200) {
  1879. self.noteList = res.data.rows;
  1880. }
  1881. });
  1882. },
  1883. delAnswer(answerId) {
  1884. let self = this;
  1885. let data = {
  1886. answerId: answerId,
  1887. status: -1,
  1888. orderGoodsId: this.orderGoodsId,
  1889. };
  1890. this.$api.delAnswer(data).then((res) => {
  1891. if (res.data.code == 200) {
  1892. self.getAnswerList();
  1893. }
  1894. });
  1895. },
  1896. clearCtx() {
  1897. console.log(4234);
  1898. this.placeholder = "您可以在这里输入答疑内容";
  1899. this.ctxValue = "";
  1900. this.assignUserId = 0;
  1901. },
  1902. blur() {
  1903. this.clearTimer = setTimeout(() => {
  1904. this.ctxValue = "";
  1905. this.isFocus = false;
  1906. this.assignUserId = 0;
  1907. this.placeholder = "您可以在这里输入答疑内容";
  1908. }, 2000);
  1909. },
  1910. replyContent(item) {
  1911. this.isFocus = true;
  1912. this.assignUserId = item.userId;
  1913. this.placeholder = "@" + item.realname;
  1914. },
  1915. delContent(item) {
  1916. this.delAnswer(item.answerId);
  1917. },
  1918. postAnswer() {
  1919. let self = this;
  1920. let data = {
  1921. courseId: this.courseId,
  1922. answerText: this.ctxValue,
  1923. goodsId: this.goodsId,
  1924. orderGoodsId: this.orderGoodsId,
  1925. };
  1926. if (this.assignUserId > 0) {
  1927. data.assignUserId = this.assignUserId;
  1928. }
  1929. this.$api.postAnswer(data).then((res) => {
  1930. if (res.data.code == 200) {
  1931. this.$u.toast("发布成功");
  1932. self.getAnswerList();
  1933. this.isFocus = false;
  1934. this.placeholder = "您可以在这里输入答疑内容";
  1935. this.ctxValue = "";
  1936. this.assignUserId = 0;
  1937. }
  1938. });
  1939. },
  1940. postContent() {
  1941. if (!this.ctxValue || this.ctxValue == "") {
  1942. this.$u.toast("请输入内容");
  1943. return;
  1944. }
  1945. this.postAnswer();
  1946. },
  1947. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  1948. console.log("status", status);
  1949. let currentTime = 0;
  1950. let PlayDuration = 0;
  1951. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1952. if (polyvPlayerContext) {
  1953. currentTime = polyvPlayerContext.getCurrentTime(); //总的视频播放时刻
  1954. PlayDuration = polyvPlayerContext.getVideoPlayDuration(); //本次看的时长
  1955. }
  1956. if (this.playChannelId > 0) {
  1957. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  1958. }
  1959. let self = this;
  1960. let data = {
  1961. photo: self.ossAvatarUrl,
  1962. sectionId: parseInt(sectionId),
  1963. goodsId: parseInt(self.goodsId),
  1964. courseId: parseInt(self.courseId),
  1965. orderGoodsId: this.orderGoodsId,
  1966. studyDuration: parseInt(
  1967. PlayDuration > 0 ? PlayDuration : self.studyDuration
  1968. ),
  1969. gradeId: parseInt(self.gradeId),
  1970. chapterId: parseInt(self.chapterId),
  1971. moduleId: parseInt(self.moduleId),
  1972. videoCurrentTime: parseInt(
  1973. currentTime > 0 ? currentTime : self.studyDuration
  1974. ),
  1975. };
  1976. if (status > 0) {
  1977. console.log(sectionId, "sectionId");
  1978. data.status = status;
  1979. }
  1980. console.log("提交接口", data);
  1981. this.$api.studyRecord(data).then((res) => {
  1982. if (res.data.code == 200) {
  1983. if (status > 0) {
  1984. let moduleId = this.moduleId || 0;
  1985. let chapterId = this.chapterId || 0;
  1986. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  1987. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  1988. console.log(playNextId, "playNextId");
  1989. console.log(playNextIdisRebuild, "playNextIdisRebuild");
  1990. uni.$emit("playNext" + playNextIdisRebuild, {
  1991. fromRebuild: this.isRebuild,
  1992. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  1993. uni.$emit("playNext" + playNextId); //通知播放结束
  1994. }
  1995. self.ossAvatarUrl = "";
  1996. } else {
  1997. this.uploadLock = false;
  1998. uni.showToast({
  1999. icon: "none",
  2000. title: res.data.msg,
  2001. });
  2002. }
  2003. console.log(res, "res");
  2004. });
  2005. },
  2006. uploadFile(options, int) {
  2007. console.log(options);
  2008. var self = this;
  2009. return new Promise((resolve, reject) => {
  2010. var data = {
  2011. imageStatus: int,
  2012. gradeId: this.gradeId,
  2013. orderGoodsId: this.orderGoodsId,
  2014. };
  2015. self.$api.aliyunpolicy(data).then((res) => {
  2016. if (res.data.code != 200) {
  2017. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  2018. return;
  2019. }
  2020. var ossToken = res.data.data.resultContent;
  2021. if (ossToken.host == null || ossToken.host == undefined) {
  2022. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  2023. return;
  2024. }
  2025. uni.uploadFile({
  2026. url: ossToken.host,
  2027. name: "file",
  2028. filePath: options,
  2029. fileType: "image",
  2030. header: {
  2031. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  2032. },
  2033. formData: {
  2034. key: ossToken.dir,
  2035. OSSAccessKeyId: ossToken.accessid,
  2036. policy: ossToken.policy,
  2037. Signature: ossToken.signature,
  2038. callback: ossToken.callback,
  2039. success_action_status: 200,
  2040. },
  2041. success: (result) => {
  2042. if (result.statusCode === 200) {
  2043. self.ossAvatarUrl = ossToken.dir;
  2044. resolve();
  2045. } else {
  2046. uni.showToast({
  2047. title: "上传失败",
  2048. icon: "none",
  2049. });
  2050. this.openPhoto();
  2051. return;
  2052. }
  2053. },
  2054. fail: (error) => {
  2055. uni.showToast({
  2056. title: "上传接口报错,请重新拍照上传" + error,
  2057. icon: "none",
  2058. });
  2059. this.openPhoto();
  2060. return;
  2061. },
  2062. });
  2063. });
  2064. });
  2065. },
  2066. imageInfos() {
  2067. var self = this;
  2068. return new Promise((resolve, reject) => {
  2069. uni.getImageInfo({
  2070. src: self.avatarUrl,
  2071. success: async (res) => {
  2072. let canvasWidth = res.width; //图片原始长宽
  2073. let canvasHeight = res.height;
  2074. if (canvasWidth > 2000 || canvasHeight > 2000) {
  2075. uni.compressImage({
  2076. src: self.avatarUrl,
  2077. quality: 75,
  2078. width: "35%",
  2079. height: "35%",
  2080. success: async (rest) => {
  2081. const waitUpload = await self.uploadFile(
  2082. rest.tempFilePath,
  2083. 0
  2084. );
  2085. resolve(waitUpload);
  2086. },
  2087. });
  2088. } else if (canvasWidth > 1000 || canvasHeight > 1000) {
  2089. uni.compressImage({
  2090. src: self.avatarUrl,
  2091. quality: 75,
  2092. width: "50%",
  2093. height: "50%",
  2094. success: async (rest) => {
  2095. const waitUpload = await self.uploadFile(
  2096. rest.tempFilePath,
  2097. 0
  2098. );
  2099. resolve(waitUpload);
  2100. },
  2101. });
  2102. } else {
  2103. console.log("无需压缩");
  2104. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  2105. resolve(waitUpload);
  2106. }
  2107. },
  2108. });
  2109. });
  2110. },
  2111. timeEvent() {
  2112. let self = this;
  2113. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2114. if (polyvPlayerContext != null) {
  2115. this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
  2116. // console.log(this.playTime,789,this.photoHistoryList)
  2117. //判断是否需要拍照
  2118. if (this.photoNum > 0) {
  2119. this.configPhoto();
  2120. let photoTime = 0; //获取拍照秒数
  2121. for (let i = 0; i < this.photoList.length; i++) {
  2122. photoTime = Number(this.photoList[i]); //获取拍照秒数
  2123. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  2124. //3秒区间内才触发拍照,避免拉动滚动条
  2125. if (
  2126. this.photoHistoryList.indexOf(i) < 0 &&
  2127. this.sectionItem.learning != 1
  2128. ) {
  2129. //不存在拍照历史,没有重修过,没有学过,则拍照
  2130. //启动拍照
  2131. //暂停
  2132. polyvPlayerContext.exitFullScreen();
  2133. polyvPlayerContext.pause();
  2134. this.photoIndex = i;
  2135. this.openPhoto();
  2136. }
  2137. }
  2138. }
  2139. }
  2140. }
  2141. },
  2142. closeToast() {
  2143. clearTimeout(this.toastTimer);
  2144. this.videoToastShow = false;
  2145. },
  2146. restart() {
  2147. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2148. polyvPlayerContext.seek(0);
  2149. console.log("seek1");
  2150. clearTimeout(this.toastTimer);
  2151. this.videoToastShow = false;
  2152. },
  2153. onStateChange(newstate, oldstate) {
  2154. if (newstate.detail.newstate == "playing") {
  2155. if (this.needSeek) {
  2156. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2157. if (this.recordObj.videoCurrentTime) {
  2158. console.log("seek2");
  2159. polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
  2160. this.seekTime = this.$method.secondToDate(
  2161. this.recordObj.videoCurrentTime
  2162. );
  2163. this.videoToastShow = true;
  2164. this.toastTimer = setTimeout(() => {
  2165. this.videoToastShow = false;
  2166. }, 3000);
  2167. } else {
  2168. polyvPlayerContext.seek(1); //避免相同节继续播放
  2169. console.log("seek3");
  2170. }
  2171. polyvPlayerContext.play();
  2172. this.needSeek = false;
  2173. }
  2174. //开始播放
  2175. if (this.timer) {
  2176. clearInterval(this.timer);
  2177. }
  2178. this.timer = setInterval(this.timeEvent, 1000); //定时器
  2179. }
  2180. if (newstate.detail.newstate == "pause") {
  2181. clearInterval(this.timer);
  2182. //暂停提交记录
  2183. /* this.ossAvatarUrl = ""
  2184. this.postStudyRecord() */
  2185. }
  2186. if (newstate.detail.newstate == "ended") {
  2187. clearInterval(this.timer);
  2188. uni.showToast({
  2189. icon: "none",
  2190. title: "播放完毕",
  2191. });
  2192. this.hasStart = false;
  2193. this.postStudyRecord(1);
  2194. // uni.$emit('playNext') //播放重修下一节
  2195. }
  2196. },
  2197. //拍照
  2198. openPhoto() {
  2199. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2200. if (polyvPlayerContext) {
  2201. polyvPlayerContext.exitFullScreen();
  2202. }
  2203. this.enableAutoRotation = false;
  2204. this.photoPopup = true;
  2205. this.isTaking = true;
  2206. uni.setKeepScreenOn({
  2207. keepScreenOn: true,
  2208. });
  2209. uni.authorize({
  2210. scope: "scope.camera",
  2211. success() {},
  2212. });
  2213. },
  2214. /**
  2215. * 人脸匹配
  2216. */
  2217. faceRecognition() {
  2218. return new Promise((resolve) => {
  2219. let fileSystem = uni.getFileSystemManager();
  2220. fileSystem.readFile({
  2221. filePath: `${this.avatarUrl}`,
  2222. encoding: "base64",
  2223. position: 0,
  2224. success: (res) => {
  2225. console.log(res);
  2226. let base64 = "data:image/jpg;base64," + res.data;
  2227. console.log(
  2228. {
  2229. imageA: base64,
  2230. orderGoodsId: this.orderGoodsId,
  2231. gradeId: this.gradeId,
  2232. },
  2233. "base64Data"
  2234. );
  2235. this.$api
  2236. .faceCertificationCompareFace({
  2237. imageA: base64,
  2238. orderGoodsId: this.orderGoodsId,
  2239. gradeId: this.gradeId,
  2240. })
  2241. .then((res) => {
  2242. console.log(res, "res");
  2243. resolve(res.data.data);
  2244. });
  2245. },
  2246. fail(err) {
  2247. console.error(err, "err");
  2248. },
  2249. });
  2250. });
  2251. },
  2252. async submit() {
  2253. if (this.uploadLock) {
  2254. return;
  2255. }
  2256. this.uploadLock = true;
  2257. let compareFaceData = await this.faceRecognition();
  2258. console.log(compareFaceData, "compareFaceData");
  2259. if (compareFaceData >= 80) {
  2260. const waitYS = await this.imageInfos();
  2261. this.postCoursePhotoRecord()
  2262. .then((res) => {
  2263. this.photoHistoryList.push(this.photoIndex);
  2264. this.postStudyRecord(); //提交记录
  2265. //恢复播放
  2266. uni.setKeepScreenOn({
  2267. keepScreenOn: false,
  2268. });
  2269. this.photoPopup = false;
  2270. this.uploadLock = false;
  2271. this.enableAutoRotation = true;
  2272. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2273. if (polyvPlayerContext != null) {
  2274. polyvPlayerContext.play();
  2275. }
  2276. })
  2277. .catch((err) => {
  2278. uni.showToast({
  2279. title: "上传接口报错,请重新拍照上传" + err,
  2280. icon: "none",
  2281. });
  2282. this.uploadLock = false;
  2283. this.openPhoto();
  2284. });
  2285. } else {
  2286. uni.showToast({
  2287. title: "人脸匹配不通过,请重新拍照上传",
  2288. icon: "none",
  2289. duration: 2000,
  2290. });
  2291. setTimeout(() => {
  2292. this.uploadLock = false;
  2293. this.openPhoto();
  2294. }, 2000);
  2295. return;
  2296. }
  2297. },
  2298. reTake() {
  2299. this.isTaking = true;
  2300. },
  2301. //确认拍照
  2302. takePhoto() {
  2303. var self = this;
  2304. const ctx = uni.createCameraContext();
  2305. ctx.takePhoto({
  2306. quality: "high",
  2307. success: (res) => {
  2308. console.log(res.tempImagePath);
  2309. self.avatarUrl = res.tempImagePath;
  2310. this.isTaking = false;
  2311. // self.submit();
  2312. // self.photoPopup = false;
  2313. // self.enableAutoRotation = true;
  2314. },
  2315. fail: (err) => {
  2316. console.log(err);
  2317. },
  2318. });
  2319. },
  2320. playError(e) {
  2321. console.log(e);
  2322. },
  2323. //拍照报错
  2324. error(e) {
  2325. console.log(e.detail);
  2326. },
  2327. //关闭相机
  2328. closePhoto() {
  2329. this.photoPopup = false;
  2330. self.enableAutoRotation = true;
  2331. },
  2332. /**
  2333. * 进入全屏
  2334. */
  2335. fullscreenchange(event) {
  2336. console.log(event);
  2337. if (event.detail.direction == "vertical") {
  2338. this.navShow = true;
  2339. } else if (event.detail.direction == "horizontal") {
  2340. this.navShow = false;
  2341. }
  2342. },
  2343. getGoodsDetail() {
  2344. return new Promise(resolve => {
  2345. let self = this;
  2346. this.$api.goodsDetail(this.goodsId).then((res) => {
  2347. self.goodsData = res.data.data;
  2348. if (self.goodsData.buyNote) {
  2349. this.baseHandoutTipList();
  2350. }
  2351. self.gradeId = self.goodsData.gradeId;
  2352. console.log(self.gradeId, "班级ID");
  2353. this.courseBusiness();
  2354. this.courseHandouts();
  2355. setTimeout(function () {
  2356. if (!self.needProfileModal) {
  2357. self.getGradeInfo();
  2358. }
  2359. }, 500);
  2360. //获取节笔记
  2361. this.getNoteList();
  2362. if (self.goodsData.goodsPlayConfig) {
  2363. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  2364. if (self.goodsPlayConfig.autoPlay > 0) {
  2365. self.autoplay = true;
  2366. }
  2367. if (self.goodsPlayConfig.drag > 0) {
  2368. self.isAllowSeek = "yes";
  2369. }
  2370. if (self.goodsPlayConfig.speed > 0) {
  2371. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  2372. }
  2373. }
  2374. if (self.goodsData.goodsPhotographConfig) {
  2375. self.goodsPhotographConfig = JSON.parse(
  2376. self.goodsData.goodsPhotographConfig
  2377. );
  2378. if (self.goodsPhotographConfig.photoNum > 0) {
  2379. self.photoNum = self.goodsPhotographConfig.photoNum;
  2380. console.log(self.photoNum, 777777);
  2381. }
  2382. }
  2383. resolve()
  2384. });
  2385. })
  2386. },
  2387. startVideo() {
  2388. this.startStatus = true;
  2389. },
  2390. getAnswerList() {
  2391. let self = this;
  2392. this.$api
  2393. .answerList({
  2394. courseId: this.courseId,
  2395. goodsId: this.goodsId,
  2396. orderGoodsId: this.orderGoodsId,
  2397. })
  2398. .then((res) => {
  2399. if (res.data.code == 200) {
  2400. self.answerList = res.data.rows;
  2401. }
  2402. });
  2403. },
  2404. getReMenuList() {
  2405. let self = this;
  2406. this.$api
  2407. .reMenuList({
  2408. orderGoodsId: this.orderGoodsId,
  2409. courseId: this.courseId,
  2410. rebuild: 1,
  2411. gradeId: this.gradeId,
  2412. })
  2413. .then((res) => {
  2414. if (res.data.code == 200) {
  2415. for (let i = 0; i < res.data.rows.length; i++) {
  2416. let item = res.data.rows[i];
  2417. item.down = true;
  2418. item.id = item.menuId;
  2419. item.name = item.menuName;
  2420. }
  2421. self.reMenuList = res.data.rows;
  2422. if (self.reMenuList.length > 0) {
  2423. this.showNotes = false;
  2424. self.list = [
  2425. {
  2426. name: "目录",
  2427. },
  2428. {
  2429. name: "讲义",
  2430. },
  2431. {
  2432. name: "笔记",
  2433. },
  2434. {
  2435. name: "答疑",
  2436. },
  2437. { name: "重修目录" },
  2438. ];
  2439. this.current = 0;
  2440. } else {
  2441. self.list = [
  2442. {
  2443. name: "目录",
  2444. },
  2445. {
  2446. name: "讲义",
  2447. },
  2448. {
  2449. name: "笔记",
  2450. },
  2451. {
  2452. name: "答疑",
  2453. },
  2454. ];
  2455. this.current = 0;
  2456. }
  2457. }
  2458. });
  2459. },
  2460. getMenuList() {
  2461. let self = this;
  2462. this.$api
  2463. .reMenuList({
  2464. courseId: this.courseId,
  2465. gradeId: this.gradeId,
  2466. orderGoodsId: this.orderGoodsId,
  2467. })
  2468. .then((res) => {
  2469. if (res.data.code == 200) {
  2470. for (let i = 0; i < res.data.rows.length; i++) {
  2471. let item = res.data.rows[i];
  2472. item.down = true;
  2473. item.id = item.menuId;
  2474. item.name = item.menuName;
  2475. item.menuType = item.type;
  2476. }
  2477. self.menuList = res.data.rows;
  2478. for (let i = 0; i < res.data.rows.length; i++) {
  2479. if (res.data.rows[i].type == 1) {
  2480. this.menuIndex = [i];
  2481. break;
  2482. } else if (res.data.rows[i].type == 2) {
  2483. this.menuIndex = [i];
  2484. break;
  2485. }
  2486. }
  2487. }
  2488. });
  2489. },
  2490. courseDetail() {
  2491. let self = this;
  2492. this.$api.courseDetail(this.courseId).then((res) => {
  2493. if (res.data.code == 200) {
  2494. // if (res.data.data.educationName == "继续教育") {
  2495. this.$api
  2496. .lockLockAction({
  2497. action: "jxjy",
  2498. uuid: this.$method.getUuid(),
  2499. })
  2500. .then((res) => {});
  2501. this.lockTimer = setInterval(() => {
  2502. this.$api
  2503. .lockLockAction({
  2504. action: "jxjy",
  2505. uuid: this.$method.getUuid(),
  2506. })
  2507. .then((res) => {});
  2508. }, 10000);
  2509. // websocket.sendMsg("doCourse");
  2510. // }
  2511. self.detail = res.data.data;
  2512. }
  2513. });
  2514. },
  2515. open(item) {
  2516. item.showChildren = !item.showChildren;
  2517. },
  2518. change(index) {
  2519. this.current = index;
  2520. },
  2521. openDocument() {
  2522. let self = this;
  2523. let url = this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl);
  2524. console.log(url);
  2525. uni.downloadFile({
  2526. url: url,
  2527. success: function (res) {
  2528. console.log(999);
  2529. var filePath = res.tempFilePath;
  2530. uni.openDocument({
  2531. filePath: filePath,
  2532. showMenu: self.courseHandoutsData.canDownload == 1 ? true : false,
  2533. success: function (res) {
  2534. console.log(res, "打开文档成功");
  2535. },
  2536. fail: function (err) {
  2537. console.log(err);
  2538. uni.showToast({
  2539. icon: "none",
  2540. title: "文档地址错误",
  2541. });
  2542. },
  2543. });
  2544. },
  2545. fail: (err) => {
  2546. uni.showModal({
  2547. title: "提示",
  2548. content: "文档错误," + err.errMsg,
  2549. showCancel: false,
  2550. });
  2551. },
  2552. });
  2553. },
  2554. },
  2555. };
  2556. </script>
  2557. <style lang="scss" scope>
  2558. .top {
  2559. &__header {
  2560. position: relative;
  2561. width: 100%;
  2562. height: 150rpx;
  2563. padding: 24rpx 150rpx 24rpx 24rpx;
  2564. .img {
  2565. position: absolute;
  2566. left: 0;
  2567. top: 0;
  2568. width: 100%;
  2569. }
  2570. .note {
  2571. position: relative;
  2572. z-index: 10;
  2573. font-size: 24rpx;
  2574. font-family: PingFang SC;
  2575. font-weight: bold;
  2576. color: #efdbff;
  2577. }
  2578. .title {
  2579. position: relative;
  2580. z-index: 10;
  2581. font-size: 26rpx;
  2582. font-family: PingFang SC;
  2583. font-weight: bold;
  2584. color: #ffffff;
  2585. }
  2586. .desc {
  2587. }
  2588. }
  2589. }
  2590. .course-list {
  2591. padding:0 24rpx;
  2592. margin:24rpx 0;
  2593. width: 100%;
  2594. height: 70rpx;
  2595. background: #fff;
  2596. display: flex;
  2597. align-items: center;
  2598. background:#fff;
  2599. border-radius: 16rpx;
  2600. .picker {
  2601. flex:1;
  2602. }
  2603. }
  2604. .polyv_detail {
  2605. display: flex;
  2606. flex-direction: column;
  2607. height: 100vh;
  2608. .box {
  2609. flex: 1;
  2610. overflow: hidden;
  2611. margin: 20rpx;
  2612. .box_in {
  2613. height: 100%;
  2614. }
  2615. }
  2616. }
  2617. .btnSet {
  2618. width: 440rpx;
  2619. height: 80rpx;
  2620. background: #007aff;
  2621. border-radius: 40rpx;
  2622. color: #ffffff;
  2623. font-size: 28rpx;
  2624. line-height: 80rpx;
  2625. }
  2626. .btnReply {
  2627. width: 80rpx;
  2628. height: 40rpx;
  2629. background: #e3f0ff;
  2630. border-radius: 16rpx;
  2631. text-align: center;
  2632. color: #007aff;
  2633. }
  2634. .btnDel {
  2635. width: 80rpx;
  2636. height: 40rpx;
  2637. background: #ffedf0;
  2638. border-radius: 16rpx;
  2639. text-align: center;
  2640. color: #ff2d55;
  2641. }
  2642. .btnReply {
  2643. width: 80rpx;
  2644. height: 40rpx;
  2645. background: #e3f0ff;
  2646. border-radius: 16rpx;
  2647. font-size: 24rpx;
  2648. }
  2649. .lecture-box {
  2650. display: flex;
  2651. align-items: center;
  2652. height: 80rpx;
  2653. background: #ffffff;
  2654. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2655. .title {
  2656. padding: 10rpx;
  2657. flex: 1;
  2658. overflow: hidden;
  2659. text-overflow: ellipsis;
  2660. white-space: nowrap;
  2661. color: #333;
  2662. font-weight: bold;
  2663. font-size: 32rpx;
  2664. }
  2665. .btn {
  2666. display: flex;
  2667. align-items: center;
  2668. justify-content: center;
  2669. width: 80rpx;
  2670. height: 80rpx;
  2671. background: #ffffff;
  2672. box-shadow: -4rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.1);
  2673. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2674. }
  2675. }
  2676. .lecture-content {
  2677. background: #fff;
  2678. margin-top: 10rpx;
  2679. padding: 10rpx;
  2680. border-radius: 16rpx;
  2681. }
  2682. .photoBox {
  2683. background-color: #ffffff;
  2684. border-radius: 32px 32px 0px 0px;
  2685. .photoTop {
  2686. height: 74rpx;
  2687. display: flex;
  2688. align-items: center;
  2689. justify-content: space-between;
  2690. padding: 0rpx 38rpx;
  2691. .sqzz {
  2692. width: 28rpx;
  2693. height: 28rpx;
  2694. display: flex;
  2695. align-items: center;
  2696. justify-content: center;
  2697. }
  2698. .centersq {
  2699. color: #333;
  2700. font-size: 30rpx;
  2701. font-weight: 500;
  2702. }
  2703. }
  2704. .photoCenter {
  2705. width: 750rpx;
  2706. height: 979rpx;
  2707. position: relative;
  2708. .custom {
  2709. width: 750rpx;
  2710. height: 979rpx;
  2711. position: absolute;
  2712. z-index: 1000;
  2713. top: 0;
  2714. left: 0;
  2715. image {
  2716. width: 100%;
  2717. height: 100%;
  2718. }
  2719. }
  2720. }
  2721. .btns {
  2722. display: flex;
  2723. .btnResult {
  2724. height: 100rpx;
  2725. flex: 1;
  2726. background-color: #07c160;
  2727. text-align: center;
  2728. line-height: 100rpx;
  2729. color: #fff;
  2730. font-size: 32rpx;
  2731. font-weight: bold;
  2732. }
  2733. }
  2734. }
  2735. .chat_box {
  2736. display: flex;
  2737. padding: 20rpx;
  2738. justify-content: space-between;
  2739. }
  2740. .chat3 {
  2741. font-size: 30rpx;
  2742. font-family: PingFang SC;
  2743. font-weight: 500;
  2744. color: #666666;
  2745. margin-top: 10rpx;
  2746. }
  2747. .chat2 {
  2748. font-size: 20rpx;
  2749. font-family: PingFang SC;
  2750. font-weight: 500;
  2751. color: #999999;
  2752. margin-top: 10rpx;
  2753. }
  2754. .chat1 {
  2755. font-size: 24rpx;
  2756. font-family: PingFang SC;
  2757. font-weight: 500;
  2758. color: #333333;
  2759. }
  2760. .leftPadding {
  2761. margin-left: 8rpx;
  2762. }
  2763. .t2Content {
  2764. font-size: 28rpx;
  2765. font-family: PingFang SC;
  2766. font-weight: bold;
  2767. color: #999999;
  2768. line-height: 48rpx;
  2769. }
  2770. .tBox2 {
  2771. display: flex;
  2772. padding-top: 10rpx;
  2773. color: #333333;
  2774. font-size: 30rpx;
  2775. }
  2776. .tBox {
  2777. display: flex;
  2778. align-items: center;
  2779. padding-top: 10rpx;
  2780. }
  2781. .title {
  2782. font-size: 24rpx;
  2783. color: #999999;
  2784. }
  2785. page {
  2786. // padding-top: 10px;
  2787. // padding-top: constant(safe-area-inset-top);
  2788. // padding-top: env(safe-area-inset-top);
  2789. }
  2790. .inputBottom {
  2791. position: fixed;
  2792. left: 0;
  2793. bottom: 0;
  2794. background: #ffffff;
  2795. height: 98rpx;
  2796. display: flex;
  2797. align-items: center;
  2798. width: 100%;
  2799. .flex_auto {
  2800. flex: 1;
  2801. margin-left: 10%;
  2802. .input {
  2803. height: 60rpx;
  2804. }
  2805. }
  2806. .btn {
  2807. color: #007aff;
  2808. font-size: 30rpx;
  2809. font-weight: bold;
  2810. width: 15%;
  2811. text-align: center;
  2812. }
  2813. }
  2814. .noteBox {
  2815. width: 100%;
  2816. background: #ffffff;
  2817. padding: 10rpx;
  2818. border-radius: 16rpx;
  2819. }
  2820. .dateBox {
  2821. width: 216rpx;
  2822. height: 48rpx;
  2823. background: #ffffff;
  2824. border-radius: 24rpx;
  2825. font-size: 24rpx;
  2826. color: #666666;
  2827. text-align: center;
  2828. line-height: 48rpx;
  2829. margin: 20rpx 0;
  2830. }
  2831. .t_content1 {
  2832. color: #007aff;
  2833. margin-left: 10rpx;
  2834. }
  2835. .tag1 {
  2836. border: 2rpx solid #007aff;
  2837. border-radius: 8rpx;
  2838. font-size: 20rpx;
  2839. color: #007aff;
  2840. padding: 5rpx;
  2841. }
  2842. .b_title {
  2843. color: #333333;
  2844. font-size: 30rpx;
  2845. font-weight: bold;
  2846. }
  2847. page {
  2848. background: #eaeef1;
  2849. }
  2850. .menuBox {
  2851. width: 100%;
  2852. background: #ffffff;
  2853. border-radius: 16rpx;
  2854. padding: 20rpx;
  2855. margin-bottom: 20rpx;
  2856. }
  2857. .btnspric {
  2858. border-top: 1rpx solid #eee;
  2859. display: flex;
  2860. align-items: center;
  2861. justify-content: space-between;
  2862. height: 108rpx;
  2863. padding-left: 43rpx;
  2864. padding-right: 32rpx;
  2865. }
  2866. .btnspric > .lefprL {
  2867. font-size: 36rpx;
  2868. color: #0c141f;
  2869. font-weight: bold;
  2870. }
  2871. .btnspric > .lefprR {
  2872. padding: 0rpx 24rpx;
  2873. height: 60rpx;
  2874. line-height: 60rpx;
  2875. text-align: center;
  2876. color: #fff;
  2877. background: #32467b;
  2878. border-radius: 24rpx;
  2879. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2880. }
  2881. .yhj,
  2882. .hdyhj {
  2883. padding: 24rpx 29rpx 24rpx 34rpx;
  2884. }
  2885. .yhj {
  2886. border-bottom: 16rpx solid #f9f9f9;
  2887. }
  2888. .yhjtit {
  2889. font-size: 30rpx;
  2890. color: #0c141f;
  2891. font-weight: 500;
  2892. margin-bottom: 14rpx;
  2893. }
  2894. .yhjList {
  2895. display: flex;
  2896. align-items: center;
  2897. justify-content: space-between;
  2898. margin-bottom: 14rpx;
  2899. }
  2900. .yhjList > .yhjLefts {
  2901. display: flex;
  2902. align-items: center;
  2903. }
  2904. .yhjLefts > .yhl {
  2905. color: #32467b;
  2906. font-size: 30rpx;
  2907. margin-right: 31rpx;
  2908. }
  2909. .yhjLefts > .yhbq {
  2910. font-size: 24rpx;
  2911. color: #ff9500;
  2912. border-radius: 18rpx;
  2913. background-color: rgba(255, 149, 0, 0.2);
  2914. border: 2rpx solid #ff9500;
  2915. height: 38rpx;
  2916. line-height: 38rpx;
  2917. padding: 0rpx 16rpx;
  2918. }
  2919. .ts {
  2920. font-size: 24rpx;
  2921. color: #999;
  2922. margin: 14rpx 0rpx;
  2923. padding-right: 29rpx;
  2924. padding-left: 34rpx;
  2925. }
  2926. .yh {
  2927. padding-top: 20rpx;
  2928. }
  2929. .yh > .yhtitle {
  2930. display: flex;
  2931. align-items: center;
  2932. justify-content: space-between;
  2933. padding-right: 29rpx;
  2934. padding-left: 34rpx;
  2935. }
  2936. .priceBxs {
  2937. display: flex;
  2938. align-items: center;
  2939. }
  2940. .priceBxs > .pricleft {
  2941. border-radius: 24rpx;
  2942. border: 1rpx solid #e91313;
  2943. background-color: rgba(233, 19, 19, 0.1);
  2944. padding: 0rpx 18rpx;
  2945. height: 49rpx;
  2946. line-height: 49rpx;
  2947. text-align: center;
  2948. font-size: 30rpx;
  2949. font-weight: 500;
  2950. color: #e91313;
  2951. margin-right: 13rpx;
  2952. }
  2953. .topBox {
  2954. padding: 32rpx 32rpx 24rpx;
  2955. border-bottom: 1rpx solid #eeeeee;
  2956. }
  2957. .topBox > .boldFonstType {
  2958. font-weight: 500;
  2959. font-size: 30rpx;
  2960. margin: 16rpx 0rpx 23rpx;
  2961. }
  2962. .topBox > .firstTopL {
  2963. display: flex;
  2964. align-items: center;
  2965. }
  2966. .topBox > .firstTopL > .imageBs {
  2967. width: 331rpx;
  2968. height: 160rpx;
  2969. border-radius: 6rpx;
  2970. overflow: hidden;
  2971. margin-right: 8rpx;
  2972. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  2973. }
  2974. .topBox > .firstTopL > .imageBs > image {
  2975. width: 100%;
  2976. height: 100%;
  2977. }
  2978. .topBox > .firstTopL > .textBs {
  2979. font-size: 30rpx;
  2980. font-weight: bold;
  2981. color: #0c141f;
  2982. }
  2983. .content {
  2984. padding: 24rpx;
  2985. text-align: left;
  2986. }
  2987. .catalogBox {
  2988. display: flex;
  2989. align-items: center;
  2990. flex-wrap: nowrap;
  2991. overflow-x: auto;
  2992. padding-left: 38rpx;
  2993. max-height: 305rpx;
  2994. overflow-y: auto;
  2995. transition: all 0.4s;
  2996. }
  2997. .catalogBox > .catalogA {
  2998. min-width: 200rpx;
  2999. height: 48rpx;
  3000. line-height: 48rpx;
  3001. // text-align: center;
  3002. border: 2rpx solid transparent;
  3003. white-space: nowrap;
  3004. text-overflow: ellipsis;
  3005. overflow: hidden;
  3006. word-break: break-all;
  3007. border-radius: 10rpx;
  3008. background: rgba(22, 119, 255, 0.05);
  3009. padding-left: 19rpx;
  3010. box-sizing: border-box;
  3011. padding-right: 15rpx;
  3012. margin-right: 16rpx;
  3013. margin-bottom: 20rpx;
  3014. margin-top: 15rpx;
  3015. font-size: 24rpx;
  3016. color: #666;
  3017. }
  3018. .catalogBox > .activesq {
  3019. border-color: #1677ff;
  3020. }
  3021. .changeCatalogBox {
  3022. display: block;
  3023. }
  3024. .catalogBox::-webkit-scrollbar {
  3025. display: none; /* Chrome Safari */
  3026. }
  3027. .price_t2 {
  3028. font-size: 18rpx;
  3029. font-family: PingFang SC;
  3030. font-weight: 500;
  3031. text-decoration: line-through;
  3032. color: #999999;
  3033. }
  3034. .price_t1 {
  3035. font-size: 33rpx;
  3036. font-family: PingFang SC;
  3037. font-weight: bold;
  3038. color: #e91313;
  3039. }
  3040. .sc_t {
  3041. font-size: 22rpx;
  3042. color: #000000;
  3043. }
  3044. .sc {
  3045. width: 29rpx;
  3046. height: 29rpx;
  3047. }
  3048. .buy {
  3049. width: 138rpx;
  3050. height: 48rpx;
  3051. line-height: 48rpx;
  3052. background: #32467b;
  3053. border-radius: 10rpx;
  3054. color: #ffffff;
  3055. font-size: 28rpx;
  3056. text-align: center;
  3057. vertical-align: middle;
  3058. position: absolute;
  3059. right: 30rpx;
  3060. }
  3061. .video_body {
  3062. padding-bottom: 96rpx;
  3063. }
  3064. .footer_tab {
  3065. position: fixed;
  3066. bottom: 0;
  3067. height: 96rpx;
  3068. width: 100%;
  3069. background-color: #ffffff;
  3070. }
  3071. .tj_box {
  3072. width: 50%;
  3073. display: inline-block;
  3074. text-align: center;
  3075. margin: 10rpx 0;
  3076. }
  3077. .teacher_t {
  3078. font-size: 24rpx;
  3079. font-family: PingFang SC;
  3080. font-weight: 400;
  3081. color: #666666;
  3082. line-height: 36rpx;
  3083. margin-left: 15rpx;
  3084. }
  3085. .teacher_img {
  3086. width: 87rpx;
  3087. height: 129rpx;
  3088. }
  3089. .t2 {
  3090. font-size: 24rpx;
  3091. font-family: PingFang SC;
  3092. color: #666666;
  3093. line-height: 36rpx;
  3094. margin: 15rpx;
  3095. }
  3096. .r_t2 {
  3097. width: 201rpx;
  3098. height: 49rpx;
  3099. background: rgba(22, 119, 255, 0.05);
  3100. border: 1rpx solid #32467b;
  3101. border-radius: 16rpx;
  3102. color: #666666;
  3103. font-size: 23rpx;
  3104. text-align: center;
  3105. display: flex;
  3106. align-items: center;
  3107. padding: 5rpx;
  3108. }
  3109. .scroll_box {
  3110. width: 100%;
  3111. height: 60rpx;
  3112. background: #ffffff;
  3113. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  3114. white-space: nowrap;
  3115. overflow: hidden;
  3116. margin: 15rpx 0;
  3117. }
  3118. .r_sliper {
  3119. padding: 0 20rpx;
  3120. }
  3121. .top_line {
  3122. width: 6rpx;
  3123. height: 22rpx;
  3124. background: #32467b;
  3125. margin-right: 10rpx;
  3126. }
  3127. .video_t2 {
  3128. font-size: 24rpx;
  3129. font-family: PingFang SC;
  3130. font-weight: 500;
  3131. color: #666666;
  3132. }
  3133. .video_t1 {
  3134. height: 80rpx;
  3135. color: #333333;
  3136. line-height: 80rpx;
  3137. font-size: 30rpx;
  3138. font-family: PingFang SC;
  3139. font-weight: bold;
  3140. color: #333333;
  3141. overflow: hidden;
  3142. text-overflow: ellipsis;
  3143. white-space: nowrap;
  3144. }
  3145. .notice_wrap {
  3146. height: 80rpx;
  3147. display: flex;
  3148. align-items: center;
  3149. justify-content: flex-end;
  3150. .video_t1_t {
  3151. width: 100%;
  3152. height: 40rpx;
  3153. line-height: 40rpx;
  3154. text-align: center;
  3155. background: rgba(245, 154, 35, 1);
  3156. color: #333;
  3157. border-radius: 10rpx;
  3158. font-size: 24rpx;
  3159. }
  3160. }
  3161. .video_play {
  3162. position: absolute;
  3163. width: 95rpx;
  3164. height: 95rpx;
  3165. top: 0;
  3166. left: 0;
  3167. right: 0;
  3168. bottom: 0;
  3169. margin: auto;
  3170. }
  3171. .video_box {
  3172. position: relative;
  3173. .video-toast {
  3174. position: absolute;
  3175. width: 686rpx;
  3176. height: 80rpx;
  3177. background: rgba(0, 0, 0, 0.6);
  3178. border-radius: 24rpx;
  3179. bottom: 100rpx;
  3180. left: 50%;
  3181. transform: translateX(-50%);
  3182. color: #fff;
  3183. display: flex;
  3184. font-size: 26rpx;
  3185. align-items: center;
  3186. overflow: visible;
  3187. &__text {
  3188. flex: 1;
  3189. margin-left: 40rpx;
  3190. }
  3191. &__btn {
  3192. width: 180rpx;
  3193. text-align: center;
  3194. border-left: 1rpx solid #fff;
  3195. }
  3196. }
  3197. .video-toast__close {
  3198. position: absolute;
  3199. right: 32rpx;
  3200. bottom: 184rpx;
  3201. width: 40rpx;
  3202. height: 40rpx;
  3203. line-height: 40rpx;
  3204. text-align: center;
  3205. background: rgba(0, 0, 0, 0.6);
  3206. border-radius: 50%;
  3207. color: rgba(255, 255, 255, 0.3);
  3208. }
  3209. }
  3210. .rotoct {
  3211. transform: rotate(90deg);
  3212. }
  3213. .slot-content {
  3214. padding: 0 20rpx;
  3215. }
  3216. .notice_modal {
  3217. .content {
  3218. width: 100%;
  3219. height: 100%;
  3220. padding: 20rpx;
  3221. .title {
  3222. color: #333;
  3223. line-height: 40rpx;
  3224. font-size: 30rpx;
  3225. text-align: center;
  3226. font-weight: bold;
  3227. }
  3228. .text {
  3229. line-height: 40rpx;
  3230. }
  3231. }
  3232. }
  3233. </style>