detail.vue 95 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333
  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. this.$u.toast('上传成功')
  1979. self.ossAvatarUrl = ossToken.dir;
  1980. resolve();
  1981. // } else {
  1982. // uni.showToast({
  1983. // title: "上传失败",
  1984. // icon: "none",
  1985. // });
  1986. // this.openPhoto();
  1987. // return;
  1988. // }
  1989. },
  1990. fail: (error) => {
  1991. uni.showToast({
  1992. title: "上传接口报错,请重新拍照上传" + error,
  1993. icon: "none",
  1994. });
  1995. this.openPhoto();
  1996. return;
  1997. },
  1998. });
  1999. });
  2000. });
  2001. },
  2002. imageInfos() {
  2003. var self = this;
  2004. return new Promise((resolve, reject) => {
  2005. uni.getImageInfo({
  2006. src: self.avatarUrl,
  2007. success: async (res) => {
  2008. let canvasWidth = res.width; //图片原始长宽
  2009. let canvasHeight = res.height;
  2010. if (canvasWidth > 2000 || canvasHeight > 2000) {
  2011. uni.compressImage({
  2012. src: self.avatarUrl,
  2013. quality: 75,
  2014. width: "35%",
  2015. height: "35%",
  2016. success: async (rest) => {
  2017. const waitUpload = await self.uploadFile(
  2018. rest.tempFilePath,
  2019. 0
  2020. );
  2021. resolve(waitUpload);
  2022. },
  2023. });
  2024. } else if (canvasWidth > 1000 || canvasHeight > 1000) {
  2025. uni.compressImage({
  2026. src: self.avatarUrl,
  2027. quality: 75,
  2028. width: "50%",
  2029. height: "50%",
  2030. success: async (rest) => {
  2031. const waitUpload = await self.uploadFile(
  2032. rest.tempFilePath,
  2033. 0
  2034. );
  2035. resolve(waitUpload);
  2036. },
  2037. });
  2038. } else {
  2039. console.log("无需压缩");
  2040. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  2041. resolve(waitUpload);
  2042. }
  2043. },
  2044. fail: (err) => {
  2045. this.$u.toast('图片上传失败')
  2046. }
  2047. });
  2048. });
  2049. },
  2050. timeEvent() {
  2051. let self = this;
  2052. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2053. if (polyvPlayerContext != null) {
  2054. this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
  2055. // console.log(this.playTime,789,this.photoHistoryList)
  2056. //判断是否需要拍照
  2057. if (this.photoNum > 0) {
  2058. this.configPhoto();
  2059. let photoTime = 0; //获取拍照秒数
  2060. for (let i = 0; i < this.photoList.length; i++) {
  2061. photoTime = Number(this.photoList[i]); //获取拍照秒数
  2062. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  2063. //3秒区间内才触发拍照,避免拉动滚动条
  2064. if (
  2065. this.photoHistoryList.indexOf(i) < 0 &&
  2066. this.sectionItem.learning != 1
  2067. ) {
  2068. //不存在拍照历史,没有重修过,没有学过,则拍照
  2069. //启动拍照
  2070. //暂停
  2071. polyvPlayerContext.exitFullScreen();
  2072. polyvPlayerContext.pause();
  2073. this.photoIndex = i;
  2074. this.openPhoto();
  2075. }
  2076. }
  2077. }
  2078. }
  2079. }
  2080. },
  2081. closeToast() {
  2082. clearTimeout(this.toastTimer);
  2083. this.videoToastShow = false;
  2084. },
  2085. restart() {
  2086. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2087. polyvPlayerContext.seek(0);
  2088. console.log("seek1");
  2089. clearTimeout(this.toastTimer);
  2090. this.videoToastShow = false;
  2091. },
  2092. onStateChange(newstate, oldstate) {
  2093. if (newstate.detail.newstate == "playing") {
  2094. if (this.needSeek) {
  2095. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2096. if (this.recordObj.videoCurrentTime) {
  2097. console.log("seek2");
  2098. polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
  2099. this.seekTime = this.$method.secondToDate(
  2100. this.recordObj.videoCurrentTime
  2101. );
  2102. this.videoToastShow = true;
  2103. this.toastTimer = setTimeout(() => {
  2104. this.videoToastShow = false;
  2105. }, 3000);
  2106. } else {
  2107. polyvPlayerContext.seek(1); //避免相同节继续播放
  2108. console.log("seek3");
  2109. }
  2110. polyvPlayerContext.play();
  2111. this.needSeek = false;
  2112. }
  2113. //开始播放
  2114. if (this.timer) {
  2115. clearInterval(this.timer);
  2116. }
  2117. this.timer = setInterval(this.timeEvent, 1000); //定时器
  2118. }
  2119. if (newstate.detail.newstate == "pause") {
  2120. clearInterval(this.timer);
  2121. //暂停提交记录
  2122. /* this.ossAvatarUrl = ""
  2123. this.postStudyRecord() */
  2124. }
  2125. if (newstate.detail.newstate == "ended") {
  2126. clearInterval(this.timer);
  2127. uni.showToast({
  2128. icon: "none",
  2129. title: "播放完毕",
  2130. });
  2131. this.hasStart = false;
  2132. this.postStudyRecord(1);
  2133. // uni.$emit('playNext') //播放重修下一节
  2134. }
  2135. },
  2136. //拍照
  2137. openPhoto() {
  2138. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2139. if (polyvPlayerContext) {
  2140. polyvPlayerContext.exitFullScreen();
  2141. }
  2142. this.enableAutoRotation = false;
  2143. this.photoPopup = true;
  2144. this.isTaking = true;
  2145. uni.setKeepScreenOn({
  2146. keepScreenOn: true,
  2147. });
  2148. uni.authorize({
  2149. scope: "scope.camera",
  2150. success() {},
  2151. });
  2152. },
  2153. /**
  2154. * 人脸匹配
  2155. */
  2156. faceRecognition() {
  2157. return new Promise((resolve) => {
  2158. let fileSystem = uni.getFileSystemManager();
  2159. fileSystem.readFile({
  2160. filePath: `${this.avatarUrl}`,
  2161. encoding: "base64",
  2162. position: 0,
  2163. success: (res) => {
  2164. console.log(res);
  2165. let base64 = "data:image/jpg;base64," + res.data;
  2166. console.log({
  2167. imageA: base64,
  2168. orderGoodsId: this.orderGoodsId,
  2169. gradeId: this.gradeId,
  2170. },'base64Data')
  2171. this.$api
  2172. .faceCertificationCompareFace({
  2173. imageA: base64,
  2174. orderGoodsId: this.orderGoodsId,
  2175. gradeId: this.gradeId,
  2176. })
  2177. .then((res) => {
  2178. console.log(res, "res");
  2179. resolve(res.data.data);
  2180. });
  2181. },
  2182. fail(err) {
  2183. console.error(err, "err");
  2184. },
  2185. });
  2186. });
  2187. },
  2188. async submit() {
  2189. if (this.uploadLock) {
  2190. return;
  2191. }
  2192. this.uploadLock = true;
  2193. let compareFaceData = await this.faceRecognition();
  2194. console.log(compareFaceData,'compareFaceData')
  2195. if (compareFaceData >= 80) {
  2196. const waitYS = await this.imageInfos();
  2197. this.postCoursePhotoRecord()
  2198. .then((res) => {
  2199. this.photoHistoryList.push(this.photoIndex);
  2200. this.postStudyRecord(); //提交记录
  2201. //恢复播放
  2202. uni.setKeepScreenOn({
  2203. keepScreenOn: false,
  2204. });
  2205. this.photoPopup = false;
  2206. this.uploadLock = false;
  2207. this.enableAutoRotation = true;
  2208. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2209. if (polyvPlayerContext != null) {
  2210. polyvPlayerContext.play();
  2211. }
  2212. })
  2213. .catch((err) => {
  2214. uni.showToast({
  2215. title: "上传接口报错,请重新拍照上传" + err,
  2216. icon: "none",
  2217. });
  2218. this.uploadLock = false;
  2219. this.openPhoto();
  2220. });
  2221. } else {
  2222. uni.showToast({
  2223. title: "人脸匹配不通过,请重新拍照上传",
  2224. icon: "none",
  2225. duration: 2000,
  2226. });
  2227. setTimeout(() => {
  2228. this.uploadLock = false;
  2229. this.openPhoto();
  2230. }, 2000);
  2231. return;
  2232. }
  2233. },
  2234. reTake() {
  2235. this.isTaking = true;
  2236. },
  2237. //确认拍照
  2238. takePhoto() {
  2239. var self = this;
  2240. const ctx = uni.createCameraContext();
  2241. ctx.takePhoto({
  2242. quality: "high",
  2243. success: (res) => {
  2244. console.log(res.tempImagePath);
  2245. self.avatarUrl = res.tempImagePath;
  2246. this.isTaking = false;
  2247. // self.submit();
  2248. // self.photoPopup = false;
  2249. // self.enableAutoRotation = true;
  2250. },
  2251. fail: (err) => {
  2252. console.log(err);
  2253. },
  2254. });
  2255. },
  2256. playError(e) {
  2257. console.log(e);
  2258. },
  2259. //拍照报错
  2260. error(e) {
  2261. console.log(e.detail);
  2262. },
  2263. //关闭相机
  2264. closePhoto() {
  2265. this.photoPopup = false;
  2266. self.enableAutoRotation = true;
  2267. },
  2268. /**
  2269. * 进入全屏
  2270. */
  2271. fullscreenchange(event) {
  2272. console.log('进入全屏',event);
  2273. if (event.detail.direction == "vertical") {
  2274. this.navShow = true;
  2275. } else if (event.detail.direction == "horizontal") {
  2276. this.navShow = false;
  2277. }
  2278. },
  2279. getGoodsDetail() {
  2280. let self = this;
  2281. this.$api.goodsDetail(this.goodsId).then((res) => {
  2282. self.goodsData = res.data.data;
  2283. if(self.goodsData.buyNote) {
  2284. this.baseHandoutTipList()
  2285. }
  2286. self.gradeId = self.goodsData.gradeId;
  2287. console.log(self.gradeId, "班级ID");
  2288. this.courseBusiness();
  2289. this.courseHandouts();
  2290. self.getMenuList();
  2291. self.getReMenuList(); //获取重修目录
  2292. setTimeout(function () {
  2293. if (!self.needProfileModal) {
  2294. self.getGradeInfo();
  2295. }
  2296. }, 500);
  2297. //获取节笔记
  2298. this.getNoteList();
  2299. if (self.goodsData.goodsPlayConfig) {
  2300. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  2301. if (self.goodsPlayConfig.autoPlay > 0) {
  2302. self.autoplay = true;
  2303. }
  2304. if (self.goodsPlayConfig.drag > 0) {
  2305. self.isAllowSeek = "yes";
  2306. }
  2307. if (self.goodsPlayConfig.speed > 0) {
  2308. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  2309. }
  2310. }
  2311. if (self.goodsData.goodsPhotographConfig) {
  2312. self.goodsPhotographConfig = JSON.parse(
  2313. self.goodsData.goodsPhotographConfig
  2314. );
  2315. if (self.goodsPhotographConfig.photoNum > 0) {
  2316. self.photoNum = self.goodsPhotographConfig.photoNum;
  2317. console.log(self.photoNum, 777777);
  2318. }
  2319. }
  2320. });
  2321. },
  2322. startVideo() {
  2323. this.startStatus = true;
  2324. },
  2325. getAnswerList() {
  2326. let self = this;
  2327. this.$api
  2328. .answerList({ courseId: this.courseId, goodsId: this.goodsId,orderGoodsId: this.orderGoodsId, })
  2329. .then((res) => {
  2330. if (res.data.code == 200) {
  2331. self.answerList = res.data.rows;
  2332. }
  2333. });
  2334. },
  2335. getReMenuList() {
  2336. let self = this;
  2337. this.$api
  2338. .reMenuList({
  2339. orderGoodsId: this.orderGoodsId,
  2340. courseId: this.courseId,
  2341. rebuild: 1,
  2342. gradeId: this.gradeId,
  2343. })
  2344. .then((res) => {
  2345. if (res.data.code == 200) {
  2346. for (let i = 0; i < res.data.rows.length; i++) {
  2347. let item = res.data.rows[i];
  2348. item.down = true;
  2349. item.id = item.menuId;
  2350. item.name = item.menuName;
  2351. }
  2352. self.reMenuList = res.data.rows;
  2353. if (self.reMenuList.length > 0) {
  2354. this.showNotes = false;
  2355. self.list = [
  2356. {
  2357. name: "目录",
  2358. },
  2359. {
  2360. name: "讲义",
  2361. },
  2362. {
  2363. name: "笔记",
  2364. },
  2365. {
  2366. name: "答疑",
  2367. },
  2368. { name: "重修目录" },
  2369. ];
  2370. this.current = 0;
  2371. } else {
  2372. self.list = [
  2373. {
  2374. name: "目录",
  2375. },
  2376. {
  2377. name: "讲义",
  2378. },
  2379. {
  2380. name: "笔记",
  2381. },
  2382. {
  2383. name: "答疑",
  2384. },
  2385. ];
  2386. this.current = 0;
  2387. }
  2388. }
  2389. });
  2390. },
  2391. getMenuList() {
  2392. let self = this;
  2393. this.$api
  2394. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  2395. .then((res) => {
  2396. if (res.data.code == 200) {
  2397. for (let i = 0; i < res.data.rows.length; i++) {
  2398. let item = res.data.rows[i];
  2399. item.down = true;
  2400. item.id = item.menuId;
  2401. item.name = item.menuName;
  2402. item.menuType = item.type;
  2403. }
  2404. self.menuList = res.data.rows;
  2405. for (let i = 0; i < res.data.rows.length; i++) {
  2406. if (res.data.rows[i].type == 1) {
  2407. this.menuIndex = [i];
  2408. break;
  2409. } else if (res.data.rows[i].type == 2) {
  2410. this.menuIndex = [i];
  2411. break;
  2412. }
  2413. }
  2414. }
  2415. });
  2416. },
  2417. courseDetail() {
  2418. let self = this;
  2419. this.$api.courseDetail(this.courseId).then((res) => {
  2420. if (res.data.code == 200) {
  2421. // if (res.data.data.educationName == "继续教育") {
  2422. this.$api
  2423. .lockLockAction({
  2424. action: "jxjy",
  2425. uuid:this.$method.getUuid()
  2426. })
  2427. .then((res) => {});
  2428. this.lockTimer = setInterval(() => {
  2429. this.$api
  2430. .lockLockAction({
  2431. action: "jxjy",
  2432. uuid:this.$method.getUuid()
  2433. })
  2434. .then((res) => {});
  2435. }, 10000);
  2436. // websocket.sendMsg("doCourse");
  2437. // }
  2438. self.detail = res.data.data;
  2439. }
  2440. });
  2441. },
  2442. open(item) {
  2443. item.showChildren = !item.showChildren;
  2444. },
  2445. change(index) {
  2446. this.current = index;
  2447. },
  2448. openDocument() {
  2449. this.downLoading = true
  2450. let url = this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl);
  2451. console.log(url);
  2452. uni.downloadFile({
  2453. url: url,
  2454. success: (res) => {
  2455. console.log(999);
  2456. var filePath = res.tempFilePath;
  2457. uni.openDocument({
  2458. filePath: filePath,
  2459. showMenu: this.courseHandoutsData.canDownload == 1 ? true : false,
  2460. success: (res) => {
  2461. this.downLoading = false
  2462. uni.setStorageSync('current', this.current)
  2463. console.log(res, "打开文档成功");
  2464. },
  2465. fail: (err) => {
  2466. this.downLoading = false
  2467. console.log(err);
  2468. uni.showToast({
  2469. icon: "none",
  2470. title: "文档地址错误",
  2471. });
  2472. },
  2473. });
  2474. },
  2475. fail: (err) => {
  2476. this.downLoading = false
  2477. uni.showModal({
  2478. title: "提示",
  2479. content: "文档错误," + err.errMsg,
  2480. showCancel: false,
  2481. });
  2482. },
  2483. });
  2484. },
  2485. clickMulu() {
  2486. this.muluStyle = !this.muluStyle
  2487. }
  2488. },
  2489. };
  2490. </script>
  2491. <style lang="scss" scope>
  2492. .top {
  2493. &__header {
  2494. position:relative;
  2495. width:100%;
  2496. height:150rpx;
  2497. padding:24rpx 150rpx 24rpx 24rpx;
  2498. .img {
  2499. position:absolute;
  2500. left:0;
  2501. top:0;
  2502. width:100%;
  2503. }
  2504. .note {
  2505. position:relative;
  2506. z-index: 10;
  2507. font-size: 24rpx;
  2508. font-family: PingFang SC;
  2509. font-weight: bold;
  2510. color: #EFDBFF;
  2511. }
  2512. .title {
  2513. position:relative;
  2514. z-index: 10;
  2515. font-size: 26rpx;
  2516. font-family: PingFang SC;
  2517. font-weight: bold;
  2518. color: #FFFFFF;
  2519. }
  2520. }
  2521. }
  2522. #top {
  2523. position: relative;
  2524. z-index: 99;
  2525. }
  2526. .polyv_detail {
  2527. display: flex;
  2528. flex-direction: column;
  2529. height: 100vh;
  2530. position: relative;
  2531. top: 0;
  2532. left: 0;
  2533. .pops {
  2534. position: absolute;
  2535. top: 0;
  2536. left: 0;
  2537. background: #ccc;
  2538. opacity: 0.5;
  2539. width: 100%;
  2540. height: 300rpx;
  2541. z-index: 9999;
  2542. }
  2543. .box {
  2544. flex: 1;
  2545. overflow: hidden;
  2546. margin: 16rpx 16rpx 100rpx 16rpx;
  2547. .box_in {
  2548. height: 100%;
  2549. }
  2550. }
  2551. .first_ml {
  2552. margin: 16rpx 16rpx 16rpx 16rpx;
  2553. }
  2554. }
  2555. .btnSet {
  2556. width: 440rpx;
  2557. height: 80rpx;
  2558. background: #007aff;
  2559. border-radius: 40rpx;
  2560. color: #ffffff;
  2561. font-size: 28rpx;
  2562. line-height: 80rpx;
  2563. }
  2564. .btnReply {
  2565. width: 80rpx;
  2566. height: 40rpx;
  2567. background: #e3f0ff;
  2568. border-radius: 16rpx;
  2569. text-align: center;
  2570. color: #007aff;
  2571. }
  2572. .btnDel {
  2573. width: 80rpx;
  2574. height: 40rpx;
  2575. background: #ffedf0;
  2576. border-radius: 16rpx;
  2577. text-align: center;
  2578. color: #ff2d55;
  2579. }
  2580. .btnReply {
  2581. width: 80rpx;
  2582. height: 40rpx;
  2583. background: #e3f0ff;
  2584. border-radius: 16rpx;
  2585. font-size: 24rpx;
  2586. }
  2587. .lecture-box {
  2588. display: flex;
  2589. align-items: center;
  2590. height: 80rpx;
  2591. background: #ffffff;
  2592. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2593. .title {
  2594. padding: 10rpx;
  2595. flex: 1;
  2596. overflow: hidden;
  2597. text-overflow: ellipsis;
  2598. white-space: nowrap;
  2599. color: #333;
  2600. font-weight: bold;
  2601. font-size: 32rpx;
  2602. }
  2603. .btn {
  2604. display: flex;
  2605. align-items: center;
  2606. justify-content: center;
  2607. width: 80rpx;
  2608. height: 80rpx;
  2609. background: #ffffff;
  2610. box-shadow: -4rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.1);
  2611. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2612. }
  2613. @keyframes rotation{
  2614. from {-webkit-transform: rotate(0deg);}
  2615. to {-webkit-transform: rotate(360deg);}
  2616. }
  2617. .loading_down {
  2618. transform: rotate(360deg);
  2619. animation: rotation 3s linear infinite;
  2620. }
  2621. }
  2622. .lecture-content {
  2623. background: #fff;
  2624. margin-top: 10rpx;
  2625. padding: 10rpx;
  2626. border-radius: 16rpx;
  2627. }
  2628. .photoBox {
  2629. background-color: #ffffff;
  2630. border-radius: 32px 32px 0px 0px;
  2631. .photoTop {
  2632. height: 74rpx;
  2633. display: flex;
  2634. align-items: center;
  2635. justify-content: space-between;
  2636. padding: 0rpx 38rpx;
  2637. .sqzz {
  2638. width: 28rpx;
  2639. height: 28rpx;
  2640. display: flex;
  2641. align-items: center;
  2642. justify-content: center;
  2643. }
  2644. .centersq {
  2645. color: #333;
  2646. font-size: 30rpx;
  2647. font-weight: 500;
  2648. }
  2649. }
  2650. .photoCenter {
  2651. width: 750rpx;
  2652. height: 979rpx;
  2653. position: relative;
  2654. .custom {
  2655. width: 750rpx;
  2656. height: 979rpx;
  2657. position: absolute;
  2658. z-index: 1000;
  2659. top: 0;
  2660. left: 0;
  2661. image {
  2662. width: 100%;
  2663. height: 100%;
  2664. }
  2665. }
  2666. }
  2667. .btns {
  2668. display: flex;
  2669. .btnResult {
  2670. height: 100rpx;
  2671. flex: 1;
  2672. background-color: #07c160;
  2673. text-align: center;
  2674. line-height: 100rpx;
  2675. color: #fff;
  2676. font-size: 32rpx;
  2677. font-weight: bold;
  2678. }
  2679. }
  2680. }
  2681. .chat_box {
  2682. display: flex;
  2683. padding: 20rpx;
  2684. justify-content: space-between;
  2685. }
  2686. .chat3 {
  2687. font-size: 30rpx;
  2688. font-family: PingFang SC;
  2689. font-weight: 500;
  2690. color: #666666;
  2691. margin-top: 10rpx;
  2692. }
  2693. .chat2 {
  2694. font-size: 20rpx;
  2695. font-family: PingFang SC;
  2696. font-weight: 500;
  2697. color: #999999;
  2698. margin-top: 10rpx;
  2699. }
  2700. .chat1 {
  2701. font-size: 24rpx;
  2702. font-family: PingFang SC;
  2703. font-weight: 500;
  2704. color: #333333;
  2705. }
  2706. .leftPadding {
  2707. margin-left: 8rpx;
  2708. }
  2709. .t2Content {
  2710. font-size: 24rpx;
  2711. font-family: PingFang SC;
  2712. font-weight: bold;
  2713. color: #999999;
  2714. line-height: 48rpx;
  2715. }
  2716. .tBox2 {
  2717. display: flex;
  2718. padding-top: 10rpx;
  2719. color: #333333;
  2720. font-size: 30rpx;
  2721. font-weight: 400;
  2722. }
  2723. .tBox {
  2724. display: flex;
  2725. align-items: center;
  2726. padding-top: 10rpx;
  2727. }
  2728. .title {
  2729. font-size: 24rpx;
  2730. color: #999999;
  2731. }
  2732. .Answering {
  2733. .answer_item {
  2734. &:nth-child(2) {
  2735. border-radius: 16rpx 16rpx 0rpx 0rpx;
  2736. }
  2737. &:nth-last-child(1) {
  2738. border-radius: 0rpx 0rpx 16rpx 16rpx;
  2739. }
  2740. }
  2741. }
  2742. .inputBottom {
  2743. position: fixed;
  2744. left: 0;
  2745. bottom: 0;
  2746. background: #ffffff;
  2747. height: 98rpx;
  2748. display: flex;
  2749. align-items: center;
  2750. width: 100%;
  2751. .flex_auto {
  2752. flex: 1;
  2753. margin-left: 10%;
  2754. // .input {
  2755. // height: 60rpx;
  2756. // }
  2757. }
  2758. .btn {
  2759. color: #007aff;
  2760. font-size: 30rpx;
  2761. font-weight: bold;
  2762. width: 15%;
  2763. text-align: center;
  2764. }
  2765. .input {
  2766. background: rgba(244, 244, 244, 0.98);
  2767. height: 60rpx;
  2768. border-radius: 24rpx;
  2769. margin-top: 12rpx;
  2770. }
  2771. }
  2772. .noteBox {
  2773. width: 100%;
  2774. background: #ffffff;
  2775. padding: 0rpx 10rpx 20rpx;
  2776. border-radius: 16rpx;
  2777. overflow: hidden;
  2778. .left_ti {
  2779. padding-top: 14rpx;
  2780. }
  2781. }
  2782. .dateBox {
  2783. width: 216rpx;
  2784. height: 48rpx;
  2785. background: #ffffff;
  2786. border-radius: 24rpx;
  2787. font-size: 24rpx;
  2788. color: #666666;
  2789. text-align: center;
  2790. line-height: 48rpx;
  2791. margin: 16rpx 0rpx 8rpx;
  2792. }
  2793. .t_content1 {
  2794. color: #007aff;
  2795. margin-left: 10rpx;
  2796. }
  2797. .tag1 {
  2798. border: 2rpx solid #007aff;
  2799. border-radius: 8rpx;
  2800. font-size: 20rpx;
  2801. color: #007aff;
  2802. padding: 5rpx;
  2803. }
  2804. .b_title {
  2805. color: #333333;
  2806. font-size: 30rpx;
  2807. font-weight: bold;
  2808. }
  2809. page {
  2810. background: #eaeef1;
  2811. }
  2812. .menuBox {
  2813. width: 100%;
  2814. background: #ffffff;
  2815. border-radius: 16rpx;
  2816. padding: 0rpx 20rpx;
  2817. margin-bottom: 20rpx;
  2818. }
  2819. .btnspric {
  2820. border-top: 1rpx solid #eee;
  2821. display: flex;
  2822. align-items: center;
  2823. justify-content: space-between;
  2824. height: 108rpx;
  2825. padding-left: 43rpx;
  2826. padding-right: 32rpx;
  2827. }
  2828. .btnspric > .lefprL {
  2829. font-size: 36rpx;
  2830. color: #0c141f;
  2831. font-weight: bold;
  2832. }
  2833. .btnspric > .lefprR {
  2834. padding: 0rpx 24rpx;
  2835. height: 60rpx;
  2836. line-height: 60rpx;
  2837. text-align: center;
  2838. color: #fff;
  2839. background: #32467b;
  2840. border-radius: 24rpx;
  2841. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2842. }
  2843. .yhj,
  2844. .hdyhj {
  2845. padding: 24rpx 29rpx 24rpx 34rpx;
  2846. }
  2847. .yhj {
  2848. border-bottom: 16rpx solid #f9f9f9;
  2849. }
  2850. .yhjtit {
  2851. font-size: 30rpx;
  2852. color: #0c141f;
  2853. font-weight: 500;
  2854. margin-bottom: 14rpx;
  2855. }
  2856. .yhjList {
  2857. display: flex;
  2858. align-items: center;
  2859. justify-content: space-between;
  2860. margin-bottom: 14rpx;
  2861. }
  2862. .yhjList > .yhjLefts {
  2863. display: flex;
  2864. align-items: center;
  2865. }
  2866. .yhjLefts > .yhl {
  2867. color: #32467b;
  2868. font-size: 30rpx;
  2869. margin-right: 31rpx;
  2870. }
  2871. .yhjLefts > .yhbq {
  2872. font-size: 24rpx;
  2873. color: #ff9500;
  2874. border-radius: 18rpx;
  2875. background-color: rgba(255, 149, 0, 0.2);
  2876. border: 2rpx solid #ff9500;
  2877. height: 38rpx;
  2878. line-height: 38rpx;
  2879. padding: 0rpx 16rpx;
  2880. }
  2881. .ts {
  2882. font-size: 24rpx;
  2883. color: #999;
  2884. margin: 14rpx 0rpx;
  2885. padding-right: 29rpx;
  2886. padding-left: 34rpx;
  2887. }
  2888. .yh {
  2889. padding-top: 20rpx;
  2890. }
  2891. .yh > .yhtitle {
  2892. display: flex;
  2893. align-items: center;
  2894. justify-content: space-between;
  2895. padding-right: 29rpx;
  2896. padding-left: 34rpx;
  2897. }
  2898. .priceBxs {
  2899. display: flex;
  2900. align-items: center;
  2901. }
  2902. .priceBxs > .pricleft {
  2903. border-radius: 24rpx;
  2904. border: 1rpx solid #e91313;
  2905. background-color: rgba(233, 19, 19, 0.1);
  2906. padding: 0rpx 18rpx;
  2907. height: 49rpx;
  2908. line-height: 49rpx;
  2909. text-align: center;
  2910. font-size: 30rpx;
  2911. font-weight: 500;
  2912. color: #e91313;
  2913. margin-right: 13rpx;
  2914. }
  2915. .topBox {
  2916. padding: 32rpx 32rpx 24rpx;
  2917. border-bottom: 1rpx solid #eeeeee;
  2918. }
  2919. .topBox > .boldFonstType {
  2920. font-weight: 500;
  2921. font-size: 30rpx;
  2922. margin: 16rpx 0rpx 23rpx;
  2923. }
  2924. .topBox > .firstTopL {
  2925. display: flex;
  2926. align-items: center;
  2927. }
  2928. .topBox > .firstTopL > .imageBs {
  2929. width: 331rpx;
  2930. height: 160rpx;
  2931. border-radius: 6rpx;
  2932. overflow: hidden;
  2933. margin-right: 8rpx;
  2934. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  2935. }
  2936. .topBox > .firstTopL > .imageBs > image {
  2937. width: 100%;
  2938. height: 100%;
  2939. }
  2940. .topBox > .firstTopL > .textBs {
  2941. font-size: 30rpx;
  2942. font-weight: bold;
  2943. color: #0c141f;
  2944. }
  2945. .content {
  2946. padding: 24rpx;
  2947. text-align: left;
  2948. }
  2949. .catalogBox {
  2950. display: flex;
  2951. align-items: center;
  2952. flex-wrap: nowrap;
  2953. overflow-x: auto;
  2954. padding-left: 38rpx;
  2955. max-height: 305rpx;
  2956. overflow-y: auto;
  2957. transition: all 0.4s;
  2958. }
  2959. .catalogBox > .catalogA {
  2960. min-width: 200rpx;
  2961. height: 48rpx;
  2962. line-height: 48rpx;
  2963. // text-align: center;
  2964. border: 2rpx solid transparent;
  2965. white-space: nowrap;
  2966. text-overflow: ellipsis;
  2967. overflow: hidden;
  2968. word-break: break-all;
  2969. border-radius: 10rpx;
  2970. background: rgba(22, 119, 255, 0.05);
  2971. padding-left: 19rpx;
  2972. box-sizing: border-box;
  2973. padding-right: 15rpx;
  2974. margin-right: 16rpx;
  2975. margin-bottom: 20rpx;
  2976. margin-top: 15rpx;
  2977. font-size: 24rpx;
  2978. color: #666;
  2979. }
  2980. .catalogBox > .activesq {
  2981. border-color: #1677ff;
  2982. }
  2983. .changeCatalogBox {
  2984. display: block;
  2985. }
  2986. .catalogBox::-webkit-scrollbar {
  2987. display: none; /* Chrome Safari */
  2988. }
  2989. .price_t2 {
  2990. font-size: 18rpx;
  2991. font-family: PingFang SC;
  2992. font-weight: 500;
  2993. text-decoration: line-through;
  2994. color: #999999;
  2995. }
  2996. .price_t1 {
  2997. font-size: 33rpx;
  2998. font-family: PingFang SC;
  2999. font-weight: bold;
  3000. color: #e91313;
  3001. }
  3002. .sc_t {
  3003. font-size: 22rpx;
  3004. color: #000000;
  3005. }
  3006. .sc {
  3007. width: 29rpx;
  3008. height: 29rpx;
  3009. }
  3010. .buy {
  3011. width: 138rpx;
  3012. height: 48rpx;
  3013. line-height: 48rpx;
  3014. background: #32467b;
  3015. border-radius: 10rpx;
  3016. color: #ffffff;
  3017. font-size: 28rpx;
  3018. text-align: center;
  3019. vertical-align: middle;
  3020. position: absolute;
  3021. right: 30rpx;
  3022. }
  3023. .video_body {
  3024. padding-bottom: 96rpx;
  3025. }
  3026. .footer_tab {
  3027. position: fixed;
  3028. bottom: 0;
  3029. height: 96rpx;
  3030. width: 100%;
  3031. background-color: #ffffff;
  3032. }
  3033. .tj_box {
  3034. width: 50%;
  3035. display: inline-block;
  3036. text-align: center;
  3037. margin: 10rpx 0;
  3038. }
  3039. .teacher_t {
  3040. font-size: 24rpx;
  3041. font-family: PingFang SC;
  3042. font-weight: 400;
  3043. color: #666666;
  3044. line-height: 36rpx;
  3045. margin-left: 15rpx;
  3046. }
  3047. .teacher_img {
  3048. width: 87rpx;
  3049. height: 129rpx;
  3050. }
  3051. .t2 {
  3052. font-size: 24rpx;
  3053. font-family: PingFang SC;
  3054. color: #666666;
  3055. line-height: 36rpx;
  3056. margin: 15rpx;
  3057. }
  3058. .r_t2 {
  3059. width: 201rpx;
  3060. height: 49rpx;
  3061. background: rgba(22, 119, 255, 0.05);
  3062. border: 1rpx solid #32467b;
  3063. border-radius: 16rpx;
  3064. color: #666666;
  3065. font-size: 23rpx;
  3066. text-align: center;
  3067. display: flex;
  3068. align-items: center;
  3069. padding: 5rpx;
  3070. }
  3071. .scroll_box {
  3072. width: 100%;
  3073. height: 60rpx;
  3074. background: #ffffff;
  3075. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  3076. white-space: nowrap;
  3077. overflow: hidden;
  3078. margin: 15rpx 0;
  3079. }
  3080. .r_sliper {
  3081. padding: 0 20rpx;
  3082. }
  3083. .top_line {
  3084. width: 6rpx;
  3085. height: 22rpx;
  3086. background: #32467b;
  3087. margin-right: 10rpx;
  3088. }
  3089. .video_t2 {
  3090. font-size: 24rpx;
  3091. font-family: PingFang SC;
  3092. font-weight: 500;
  3093. color: #666666;
  3094. }
  3095. .course_name {
  3096. height: 80rpx;
  3097. background-color: #fff;
  3098. }
  3099. .video_t1 {
  3100. height: 80rpx;
  3101. color: #333333;
  3102. line-height: 80rpx;
  3103. font-size: 30rpx;
  3104. font-family: PingFang SC;
  3105. font-weight: bold;
  3106. color: #333333;
  3107. overflow: hidden;
  3108. text-overflow: ellipsis;
  3109. white-space: nowrap;
  3110. }
  3111. .notice_wrap {
  3112. height: 80rpx;
  3113. display: flex;
  3114. align-items: center;
  3115. justify-content: flex-end;
  3116. .video_t1_t {
  3117. width: 100%;
  3118. height: 40rpx;
  3119. line-height: 40rpx;
  3120. text-align: center;
  3121. background: rgba(245, 154, 35, 1);
  3122. color: #333;
  3123. border-radius: 10rpx;
  3124. font-size: 24rpx;
  3125. }
  3126. }
  3127. .video_play {
  3128. position: absolute;
  3129. width: 95rpx;
  3130. height: 95rpx;
  3131. top: 0;
  3132. left: 0;
  3133. right: 0;
  3134. bottom: 0;
  3135. margin: auto;
  3136. }
  3137. .video_box {
  3138. position: relative;
  3139. #playerVideo {
  3140. position: relative;
  3141. z-index: 99;
  3142. }
  3143. .video-toast {
  3144. position: absolute;
  3145. width: 686rpx;
  3146. height: 80rpx;
  3147. background: rgba(0, 0, 0, 0.6);
  3148. border-radius: 24rpx;
  3149. bottom: 100rpx;
  3150. left: 50%;
  3151. transform: translateX(-50%);
  3152. color: #fff;
  3153. display: flex;
  3154. font-size: 26rpx;
  3155. align-items: center;
  3156. overflow: visible;
  3157. &__text {
  3158. flex: 1;
  3159. margin-left: 40rpx;
  3160. }
  3161. &__btn {
  3162. width: 180rpx;
  3163. text-align: center;
  3164. border-left: 1rpx solid #fff;
  3165. }
  3166. }
  3167. .video-toast__close {
  3168. position: absolute;
  3169. right: 32rpx;
  3170. bottom: 184rpx;
  3171. width: 40rpx;
  3172. height: 40rpx;
  3173. line-height: 40rpx;
  3174. text-align: center;
  3175. background: rgba(0, 0, 0, 0.6);
  3176. border-radius: 50%;
  3177. color: rgba(255, 255, 255, 0.3);
  3178. }
  3179. }
  3180. .rotoct {
  3181. transform: rotate(90deg);
  3182. }
  3183. .slot-content {
  3184. padding: 0 20rpx;
  3185. }
  3186. .notice_modal {
  3187. .content {
  3188. width: 100%;
  3189. height: 100%;
  3190. padding: 20rpx;
  3191. .title {
  3192. color: #333;
  3193. line-height: 40rpx;
  3194. font-size: 30rpx;
  3195. text-align: center;
  3196. font-weight: bold;
  3197. }
  3198. .text {
  3199. line-height: 40rpx;
  3200. }
  3201. }
  3202. }
  3203. .full_mulu {
  3204. position: absolute;
  3205. top: 100rpx;
  3206. right: 20rpx;
  3207. width: 700rpx;
  3208. height: 515rpx;
  3209. color: #333;
  3210. display: flex;
  3211. align-items: center;
  3212. justify-content: space-between;
  3213. z-index: 99999;
  3214. .mulus {
  3215. width: 623rpx;
  3216. // height: 515rpx;
  3217. height: 400rpx;
  3218. overflow-y: scroll;
  3219. // overflow: scroll;
  3220. }
  3221. .mulu_box_in {
  3222. background-color: #b7b7b7;
  3223. border-radius: 16rpx;
  3224. // transition: all 0.5s;
  3225. &::after {
  3226. content: "";
  3227. width: 0;
  3228. height: 0;
  3229. position: absolute;
  3230. top: 235rpx;
  3231. right: 27px;
  3232. border-top: 16rpx solid transparent;
  3233. border-right: 16rpx solid transparent;
  3234. border-left: 16rpx solid #b7b7b7;
  3235. border-bottom: 16rpx solid transparent;
  3236. }
  3237. }
  3238. .mulu_box_out {
  3239. // visibility: hidden;
  3240. display: none;
  3241. }
  3242. .menuBox_mulu {
  3243. // width: 100%;
  3244. background: #ffffff;
  3245. border-radius: 16rpx;
  3246. padding: 0rpx 20rpx;
  3247. margin-bottom: 20rpx;
  3248. }
  3249. .ml_img {
  3250. position: absolute;
  3251. right: 0;
  3252. top: 100rpx;
  3253. }
  3254. .items {
  3255. width: 620rpx;
  3256. height: 100rpx;
  3257. border: 1rpx solid red;
  3258. }
  3259. }
  3260. </style>