detail.vue 95 KB

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