detail.vue 90 KB

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