detail.vue 84 KB

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