detail.vue 93 KB

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