detail.vue 84 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899
  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.getPhotoLastRecord();
  836. this.playChannel(item);
  837. this.channelItem = item;
  838. });
  839. uni.$on("isRebuild", (item) => {
  840. console.log(item);
  841. this.isRebuild = item;
  842. });
  843. this.updateChapterOpen(true);
  844. },
  845. methods: {
  846. ...mapMutations(["updateChapterOpen"]),
  847. /**
  848. * 模块大节播放完毕,刷新列表
  849. */
  850. sectionPlayEnd(isRebuild, index) {
  851. console.log("sectionPlayEnd");
  852. console.log("isRebuild", isRebuild), console.log("index", index);
  853. if (this.reMenuList.length > 0) {
  854. //有重修目录
  855. if (isRebuild.isRebuild) {
  856. //从重修点击
  857. this.$api
  858. .reMenuList({
  859. orderGoodsId: this.orderGoodsId,
  860. courseId: this.courseId,
  861. rebuild: 1,
  862. gradeId: this.gradeId,
  863. })
  864. .then((res) => {
  865. console.log("Rebuild1");
  866. if (res.data.code == 200) {
  867. if (res.data.rows.length) {
  868. res.data.rows[index].name = res.data.rows[index].menuName;
  869. this.$set(this.reMenuList,index,res.data.rows[index])
  870. for (let i = 0; i < res.data.rows.length; i++) {
  871. let item = res.data.rows[i];
  872. item.down = true;
  873. item.id = item.menuId;
  874. item.name = item.menuName;
  875. }
  876. this.reMenuList = []
  877. this.$nextTick(() => {
  878. this.reMenuList = res.data.rows;
  879. console.log(this.reMenuList,'this.reMenuList1')
  880. })
  881. } else {
  882. this.reMenuList = [];
  883. }
  884. this.$nextTick(() => {
  885. if (this.reMenuList.length > 0) {
  886. this.list = [
  887. {
  888. name: "目录",
  889. },
  890. {
  891. name: "讲义",
  892. },
  893. {
  894. name: "笔记",
  895. },
  896. {
  897. name: "答疑",
  898. },
  899. { name: "重修目录" },
  900. ];
  901. } else {
  902. this.list = [
  903. {
  904. name: "目录",
  905. },
  906. {
  907. name: "讲义",
  908. },
  909. {
  910. name: "笔记",
  911. },
  912. {
  913. name: "答疑",
  914. },
  915. ];
  916. if (this.current == 4) {
  917. this.current = 0;
  918. }
  919. }
  920. });
  921. }
  922. });
  923. this.$api
  924. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  925. .then((res) => {
  926. console.log("noRebuild1");
  927. if (res.data.code == 200) {
  928. for (let i = 0; i < res.data.rows.length; i++) {
  929. let item = res.data.rows[i];
  930. item.down = true;
  931. item.id = item.menuId;
  932. item.name = item.menuName;
  933. item.menuType = item.type;
  934. }
  935. this.menuList = [];
  936. this.$nextTick(() => {
  937. this.menuList = res.data.rows;
  938. });
  939. }
  940. });
  941. } else {
  942. //从普通目录点击
  943. this.$api
  944. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  945. .then((res) => {
  946. console.log("noRebuild2");
  947. if (res.data.code == 200) {
  948. res.data.rows[index].name = res.data.rows[index].menuName;
  949. res.data.rows[index].id = res.data.rows[index].menuId;
  950. this.$set(this.menuList, index, res.data.rows[index]);
  951. }
  952. });
  953. this.$api
  954. .reMenuList({
  955. orderGoodsId: this.orderGoodsId,
  956. courseId: this.courseId,
  957. rebuild: 1,
  958. gradeId: this.gradeId,
  959. })
  960. .then((res) => {
  961. console.log("Rebuild2");
  962. if (res.data.code == 200) {
  963. if (res.data.rows.length) {
  964. // for (let i = 0; i < res.data.rows.length; i++) {
  965. // let item = res.data.rows[i];
  966. // item.down = true;
  967. // item.id = item.menuId;
  968. // item.name = item.menuName;
  969. // }
  970. // this.reMenuList = res.data.rows;
  971. } else {
  972. this.reMenuList = [];
  973. }
  974. this.$nextTick(() => {
  975. if (this.reMenuList.length > 0) {
  976. this.list = [
  977. {
  978. name: "目录",
  979. },
  980. {
  981. name: "讲义",
  982. },
  983. {
  984. name: "笔记",
  985. },
  986. {
  987. name: "答疑",
  988. },
  989. { name: "重修目录" },
  990. ];
  991. } else {
  992. this.list = [
  993. {
  994. name: "目录",
  995. },
  996. {
  997. name: "讲义",
  998. },
  999. {
  1000. name: "笔记",
  1001. },
  1002. {
  1003. name: "答疑",
  1004. },
  1005. ];
  1006. if (this.current == 4) {
  1007. this.current = 0;
  1008. }
  1009. }
  1010. });
  1011. }
  1012. });
  1013. }
  1014. } else {
  1015. //没有重修目录
  1016. this.$api
  1017. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId ,orderGoodsId: this.orderGoodsId,})
  1018. .then((res) => {
  1019. console.log("noRebuild3");
  1020. console.log("noRebuild3index", index);
  1021. if (res.data.code == 200) {
  1022. res.data.rows[index].name = res.data.rows[index].menuName;
  1023. res.data.rows[index].id = res.data.rows[index].menuId;
  1024. this.$set(this.menuList, index, res.data.rows[index]);
  1025. }
  1026. });
  1027. }
  1028. },
  1029. /**
  1030. * 获取业务层次详情
  1031. */
  1032. courseBusiness() {
  1033. this.$api.courseBusiness(this.goodsData.businessId).then((res) => {
  1034. this.businessData = res.data.data;
  1035. });
  1036. },
  1037. /**
  1038. * 计算tabs宽度
  1039. */
  1040. itemWidth() {
  1041. return 100 / this.list.length + "%";
  1042. },
  1043. /**
  1044. * 获取讲义权限
  1045. */
  1046. courseHandouts() {
  1047. this.$api.courseHandouts(this.goodsData.handoutsId).then((res) => {
  1048. this.courseHandoutsData = res.data.data;
  1049. });
  1050. },
  1051. findMenuNextSection(index) {
  1052. for (let i = index + 1; i < this.reMenuList.length; i++) {
  1053. let item = this.reMenuList[i];
  1054. if (item.type == 3) {
  1055. return item;
  1056. }
  1057. }
  1058. return {};
  1059. },
  1060. loadedmetadata(e) {
  1061. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1062. this.hasStart = true;
  1063. uni.$off('playPause')
  1064. uni.$on('playPause',() => {
  1065. polyvPlayerContext.pause()
  1066. })
  1067. if(!this.recordObj.videoCurrentTime) { //新视频直接提交一条观看记录
  1068. this.postStudyRecord(0)
  1069. }
  1070. },
  1071. getPhotoLastRecord() {
  1072. let self = this;
  1073. let data = {
  1074. sectionId: parseInt(self.playSectionId),
  1075. goodsId: parseInt(self.goodsId),
  1076. courseId: parseInt(self.courseId),
  1077. gradeId: parseInt(self.gradeId),
  1078. chapterId: parseInt(self.chapterId),
  1079. moduleId: parseInt(self.moduleId),
  1080. orderGoodsId: this.orderGoodsId,
  1081. };
  1082. this.$api.getPhotoLastRecord(data).then((res) => {
  1083. if (res.data.code == 200) {
  1084. //清空历史数据
  1085. self.photoHistoryList = [];
  1086. this.photoIndex = 0;
  1087. self.photoList = [];
  1088. for (let i = 0; i < res.data.data.length; i++) {
  1089. //-2存储随机拍照数组
  1090. if (res.data.data[i].photoIndex == -2) {
  1091. self.photoList = res.data.data[i].timeInterval.split(",");
  1092. } else {
  1093. self.photoHistoryList.push(res.data.data[i].photoIndex);
  1094. }
  1095. }
  1096. }
  1097. });
  1098. },
  1099. //postTime 只提交随机时间
  1100. postCoursePhotoRecord(postTime = false) {
  1101. return new Promise((resolve, reject) => {
  1102. let currentTime = 0;
  1103. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1104. if (polyvPlayerContext) {
  1105. currentTime = polyvPlayerContext.getCurrentTime();
  1106. }
  1107. let self = this;
  1108. let photoIndex = self.photoIndex;
  1109. let data = {
  1110. photo: self.ossAvatarUrl,
  1111. sectionId: parseInt(self.playSectionId),
  1112. goodsId: parseInt(self.goodsId),
  1113. courseId: parseInt(self.courseId),
  1114. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  1115. gradeId: parseInt(self.gradeId),
  1116. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  1117. photoNum: parseInt(self.photoNum),
  1118. chapterId: parseInt(self.chapterId),
  1119. moduleId: parseInt(self.moduleId),
  1120. timeInterval: postTime ? self.photoList.join(",") : "",
  1121. orderGoodsId: this.orderGoodsId,
  1122. };
  1123. console.log("提交接口", data);
  1124. this.$api
  1125. .coursePhotoRecord(data)
  1126. .then((res) => {
  1127. console.log(res,'postCoursePhotoRecord')
  1128. if (res.data.code == 200) {
  1129. resolve();
  1130. } else {
  1131. reject();
  1132. }
  1133. })
  1134. .catch((err) => {
  1135. reject();
  1136. });
  1137. });
  1138. },
  1139. randomNum(minNum, maxNum) {
  1140. switch (arguments.length) {
  1141. case 1:
  1142. return parseInt(Math.random() * minNum + 1, 10);
  1143. break;
  1144. case 2:
  1145. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  1146. break;
  1147. default:
  1148. return 0;
  1149. break;
  1150. }
  1151. },
  1152. //配置随机拍照时间
  1153. configPhoto() {
  1154. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1155. let totalVideoTime = polyvPlayerContext.getDuration();
  1156. let duration = polyvPlayerContext.getCurrentTime();
  1157. let photoNum = this.photoNum;
  1158. if (!this.photoConfig) {
  1159. this.photoConfig = true;
  1160. // let spaceTime = Math.floor(totalVideoTime/photoNum) //拍照时间区间
  1161. // if(spaceTime<5){//区间小于5秒
  1162. // photoNum = Math.floor(totalVideoTime/5)
  1163. // spaceTime = 5
  1164. // }
  1165. // if(photoNum<1){
  1166. // photoNum = 1 //只要设置,至少拍一次
  1167. // spaceTime = totalVideoTime
  1168. // }
  1169. // let initSpace = 0
  1170. //没有历史拍照间隔数据
  1171. if (this.photoList.length == 0) {
  1172. if (totalVideoTime >= 900) {
  1173. //大于15分钟
  1174. if (photoNum == 1) {
  1175. //开头拍1张
  1176. this.photoList.push(0);
  1177. } else if (photoNum == 3) {
  1178. //拍3张
  1179. this.photoList.push(0); //开头拍一张
  1180. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  1181. let centerMinTime = centerTime - 300; //前后5分钟
  1182. let centerMaxTime = centerTime + 300;
  1183. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  1184. this.photoList.push(centerTakeTime); //中间拍一张
  1185. let endMaxTime = totalVideoTime - 60;
  1186. let endMinTime = totalVideoTime - 300;
  1187. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1188. this.photoList.push(endTakeTime); //最后拍一张
  1189. }
  1190. } else {
  1191. //小于15分钟,只拍前后各一张
  1192. if (photoNum == 1) {
  1193. //开头拍1张
  1194. this.photoList.push(0);
  1195. } else if (photoNum == 3) {
  1196. //拍2张
  1197. if (totalVideoTime <= 300) {
  1198. //小于5分钟
  1199. this.photoList.push(0); //开头拍一张
  1200. let endTakeTime = this.randomNum(10, totalVideoTime); //中间随机取一张
  1201. this.photoList.push(endTakeTime);
  1202. } else {
  1203. this.photoList.push(0); //开头拍一张
  1204. let endMaxTime = totalVideoTime - 60;
  1205. let endMinTime = totalVideoTime - 300;
  1206. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1207. this.photoList.push(endTakeTime); //最后1-5分钟拍一张
  1208. }
  1209. }
  1210. }
  1211. // for(let i=0;i<photoNum;i++){
  1212. // let s = this.randomNum(initSpace,initSpace+spaceTime)
  1213. // if(s>totalVideoTime){
  1214. // s = totalVideoTime-1
  1215. // }
  1216. // if(s<=5){
  1217. // s =5 //避免出现5秒内拍照时间
  1218. // }
  1219. // this.photoList.push(s)
  1220. // initSpace+=spaceTime
  1221. // }
  1222. console.log(this.photoList, "随机拍照时间数组11", photoNum);
  1223. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  1224. }
  1225. console.log(this.photoList, "随机拍照时间数组");
  1226. //兼容已有观看历史
  1227. for (let i = 0; i < this.photoList.length - 1; i++) {
  1228. if (
  1229. this.photoList[i] < duration &&
  1230. this.photoList[i + 1] > duration
  1231. ) {
  1232. this.photoIndex = i + 1;
  1233. // console.log("我的修改了photoIndex")
  1234. break;
  1235. }
  1236. if (duration > this.photoList[this.photoList.length - 1]) {
  1237. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  1238. // console.log("我的修改了photoIndex")
  1239. break;
  1240. }
  1241. }
  1242. }
  1243. },
  1244. getLiveUid(channelId) {
  1245. let self = this;
  1246. return new Promise((resolve) => {
  1247. let data = {
  1248. channelId: channelId,
  1249. orderGoodsId: this.orderGoodsId,
  1250. };
  1251. self.$api.polyvSign(data).then((res) => {
  1252. resolve(res.data.data);
  1253. });
  1254. });
  1255. },
  1256. timeEventLiving() {
  1257. if (plv != null) {
  1258. if (this.livePlay) {
  1259. this.liveDuration = this.liveDuration + 1; //每隔1秒
  1260. if (this.liveDuration == 2) {
  1261. //直播第2秒拍照
  1262. console.log(this.channelItem)
  1263. console.log(this.photoHistoryList,'this.photoHistoryList')
  1264. if (
  1265. this.goodsPhotographConfig && this.goodsPhotographConfig.livephotograph == 1 &&
  1266. this.channelItem.learning != 1 && this.photoHistoryList.length == 0
  1267. ) {
  1268. //开启直播拍照
  1269. this.openPhoto();
  1270. } else {
  1271. this.postStudyRecord(0);
  1272. }
  1273. }
  1274. }
  1275. }
  1276. },
  1277. playerLiveStatusChange(e) {
  1278. const status = e.detail.status;
  1279. console.log("直播状态", status);
  1280. if (status === "live") {
  1281. console.log("开始直播");
  1282. //开始播放
  1283. if (this.timer) {
  1284. clearInterval(this.timer);
  1285. }
  1286. this.livePlay = true;
  1287. this.timer = setInterval(this.timeEventLiving, 1000); //定时器
  1288. }
  1289. if (status === "end") {
  1290. this.hasStart = false;
  1291. if (this.livePlay) {
  1292. //只有播放过的结束才提交,避免未开播触发结束
  1293. this.postStudyRecord(1);
  1294. }
  1295. console.log("结束直播");
  1296. this.livePlay = false;
  1297. // 未开始
  1298. }
  1299. },
  1300. closePlv() {
  1301. if (plv) {
  1302. plv.destroy();
  1303. }
  1304. },
  1305. playChannel(item) {
  1306. if (this.timer) {
  1307. clearInterval(this.timer);
  1308. }
  1309. this.startStatus = true;
  1310. this.initLive();
  1311. },
  1312. setLiveOption(status) {
  1313. const { userId, channelId, recordFileSimpleModel, playbackEnabled } =
  1314. this.detail;
  1315. const playRecordFile =
  1316. playbackEnabled && recordFileSimpleModel && status === "end";
  1317. this.videoOption = {
  1318. mode: "live",
  1319. uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  1320. cid: this.playChannelId,
  1321. openId: this.userInfo.userAccount,
  1322. isAutoChange: false,
  1323. forceVideo: false,
  1324. };
  1325. },
  1326. async initLive() {
  1327. console.log(this.playChannelId, 7111);
  1328. this.liveObj = await this.getLiveUid(this.playChannelId);
  1329. this.initLiveOk = true;
  1330. let optionsData = {};
  1331. optionsData.mode = "live";
  1332. optionsData.forceVideo = false;
  1333. optionsData.channelId = this.playChannelId; // 频道ID '2553128'
  1334. optionsData.openId = this.userInfo.userAccount; // 用户openId this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
  1335. optionsData.userId = this.liveObj.uid; // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
  1336. let self = this;
  1337. this.closePlv();
  1338. plv.init(optionsData).then(({ detail, chat }) => {
  1339. self.liveDetail = detail;
  1340. // 设置mode为live的videoOption
  1341. this.setLiveOption();
  1342. if (detail.isPPT) {
  1343. chat.on(chat.events.SLICESTART, () => {
  1344. // 开始直播
  1345. });
  1346. } else {
  1347. plv.api.getOrdinaryLiveStatus(detail.stream);
  1348. }
  1349. });
  1350. },
  1351. openSetting(res) {
  1352. console.log(res, 98);
  1353. },
  1354. getCameraSetting() {
  1355. const self = this;
  1356. wx.getSetting({
  1357. success: (res) => {
  1358. if (res.authSetting["scope.camera"]) {
  1359. // 用户已经授权
  1360. self.showSet = false;
  1361. } else {
  1362. // 用户还没有授权,向用户发起授权请求
  1363. wx.authorize({
  1364. scope: "scope.camera",
  1365. success() {
  1366. // 用户同意授权
  1367. self.showSet = false;
  1368. },
  1369. fail() {
  1370. // 用户不同意授权
  1371. self.showSet = true;
  1372. /* wx.showToast({
  1373. title: '摄像头授权失败',
  1374. icon: 'none',
  1375. duration: 3000
  1376. }) */
  1377. },
  1378. });
  1379. }
  1380. },
  1381. fail: (res) => {},
  1382. });
  1383. },
  1384. studyNotice() {
  1385. this.noticeShow = true;
  1386. },
  1387. //播放笔记视频
  1388. async playNoteVideo(item) {
  1389. console.log(item, "noteItem");
  1390. if (this.timer) {
  1391. clearInterval(this.timer);
  1392. }
  1393. if (this.vid) {
  1394. //切换视频
  1395. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1396. polyvPlayerContext.changeVid(item.recordingUrl);
  1397. } else {
  1398. this.vid = item.recordingUrl;
  1399. }
  1400. this.recordObj = { videoCurrentTime: item.noteSecond };
  1401. if (this.recordObj.videoCurrentTime) {
  1402. this.needSeek = true; //需要跳转到播放记录
  1403. }
  1404. this.startStatus = true;
  1405. //获取节笔记
  1406. this.getNoteList();
  1407. },
  1408. //正常播放视频
  1409. async playVideo(item) {
  1410. console.log(item);
  1411. if (this.timer) {
  1412. clearInterval(this.timer);
  1413. }
  1414. if (this.vid) {
  1415. //切换视频
  1416. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1417. polyvPlayerContext.changeVid(item.recordingUrl);
  1418. } else {
  1419. this.vid = item.recordingUrl;
  1420. }
  1421. this.recordObj = null;
  1422. this.recordObj = await this.getRecordLast();
  1423. this.needSeek = true; //跳转到播放记录
  1424. this.startStatus = true;
  1425. //获取节笔记
  1426. this.getNoteList();
  1427. },
  1428. getRecordLast() {
  1429. let self = this;
  1430. return new Promise((resolve) => {
  1431. let data = {
  1432. gradeId: Number(self.gradeId),
  1433. goodsId: Number(self.goodsId),
  1434. sectionId: Number(self.playSectionId),
  1435. courseId: Number(self.courseId),
  1436. chapterId: parseInt(self.chapterId),
  1437. moduleId: parseInt(self.moduleId),
  1438. orderGoodsId: this.orderGoodsId,
  1439. };
  1440. self.$api.recordLast(data).then((res) => {
  1441. resolve(res.data.data);
  1442. });
  1443. });
  1444. },
  1445. jumpNote(item) {
  1446. this.noteId = item.noteId;
  1447. //没视频播放
  1448. if (this.playSectionId == 0) {
  1449. console.log("即将跳到笔记位置1");
  1450. this.$u.toast("即将跳到笔记位置");
  1451. this.$store.commit("setPlaySectionId", {
  1452. playSectionId: item.sectionId,
  1453. });
  1454. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  1455. this.playNoteVideo(item);
  1456. } else {
  1457. //正在看当前笔记视频
  1458. console.log("即将跳到笔记位置2");
  1459. this.$u.toast("即将跳到笔记位置");
  1460. //跳到笔记时刻
  1461. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1462. polyvPlayerContext.seek(item.noteSecond);
  1463. polyvPlayerContext.play();
  1464. }
  1465. },
  1466. postNote() {
  1467. let self = this;
  1468. if (!(this.playSectionId > 0)) {
  1469. this.$u.toast("目前无播放视频");
  1470. return;
  1471. }
  1472. if (!this.noteValue) {
  1473. this.$u.toast("请输入内容");
  1474. return;
  1475. }
  1476. if (!this.gradeId) {
  1477. this.$u.toast("暂无班级数据");
  1478. return;
  1479. }
  1480. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1481. let noteDate = this.$method.getZeroTime();
  1482. let noteSecond = polyvPlayerContext.getCurrentTime();
  1483. console.log(noteSecond, 698);
  1484. if (!noteSecond) {
  1485. if (noteSecond == 0) {
  1486. //播放结束
  1487. noteSecond = polyvPlayerContext.getDuration();
  1488. console.log(noteSecond, 63398);
  1489. }
  1490. if (!noteSecond) {
  1491. this.$u.toast("视频暂未开始");
  1492. return;
  1493. }
  1494. }
  1495. let data = {
  1496. gradeId: this.gradeId,
  1497. goodsId: this.goodsId,
  1498. sectionId: this.playSectionId,
  1499. courseId: this.courseId,
  1500. noteText: this.noteValue,
  1501. noteDate: noteDate,
  1502. noteSecond: noteSecond,
  1503. orderGoodsId: this.orderGoodsId,
  1504. };
  1505. this.$api.postNote(data).then((res) => {
  1506. if (res.data.code == 200) {
  1507. this.$u.toast("发布成功");
  1508. self.getNoteList();
  1509. this.noteValue = "";
  1510. }
  1511. });
  1512. },
  1513. getGradeInfo() {
  1514. let self = this;
  1515. this.$store.state.allowLoading = false;
  1516. this.$api.goodsGradeInfo(this.gradeId).then((res) => {
  1517. if (res.data.code == 200) {
  1518. self.gradeDetail = res.data.data;
  1519. if (self.needProfileModal) {
  1520. return;
  1521. }
  1522. if (self.gradeDetail.learningStatus == 2) {
  1523. uni.showModal({
  1524. showCancel: false,
  1525. confirmText: "确定",
  1526. content:
  1527. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  1528. success: function (resultst) {
  1529. uni.navigateBack();
  1530. },
  1531. });
  1532. }
  1533. if (
  1534. self.gradeDetail.learningStatus == 3 &&
  1535. Number(self.gradeDetail.learningTimeStart) >
  1536. Number(new Date() / 1000)
  1537. ) {
  1538. uni.showModal({
  1539. showCancel: false,
  1540. cancelText: "返回",
  1541. content:
  1542. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  1543. success: function (resultst) {
  1544. uni.navigateBack();
  1545. },
  1546. });
  1547. }
  1548. }
  1549. });
  1550. this.$store.state.allowLoading = true;
  1551. },
  1552. getNoteList() {
  1553. let self = this;
  1554. self.noteList = [];
  1555. let data = {
  1556. courseId: this.courseId,
  1557. gradeId: this.gradeId,
  1558. goodsId: this.goodsId,
  1559. orderGoodsId: this.orderGoodsId,
  1560. };
  1561. if (this.playSectionId > 0) {
  1562. data.sectionId = this.playSectionId;
  1563. }
  1564. this.$api.noteList(data).then((res) => {
  1565. if (res.data.code == 200) {
  1566. self.noteList = res.data.rows;
  1567. }
  1568. });
  1569. },
  1570. delAnswer(answerId) {
  1571. let self = this;
  1572. let data = { answerId: answerId, status: -1 ,orderGoodsId: this.orderGoodsId,};
  1573. this.$api.delAnswer(data).then((res) => {
  1574. if (res.data.code == 200) {
  1575. self.getAnswerList();
  1576. }
  1577. });
  1578. },
  1579. clearCtx() {
  1580. console.log(4234);
  1581. this.placeholder = "您可以在这里输入答疑内容";
  1582. this.ctxValue = "";
  1583. this.assignUserId = 0;
  1584. },
  1585. blur() {
  1586. this.clearTimer = setTimeout(() => {
  1587. this.ctxValue = ""
  1588. this.isFocus = false;
  1589. this.assignUserId = 0;
  1590. this.placeholder = '您可以在这里输入答疑内容';
  1591. },2000)
  1592. },
  1593. replyContent(item) {
  1594. this.isFocus = true;
  1595. this.assignUserId = item.userId;
  1596. this.placeholder = "@" + item.realname;
  1597. },
  1598. delContent(item) {
  1599. this.delAnswer(item.answerId);
  1600. },
  1601. postAnswer() {
  1602. let self = this;
  1603. let data = {
  1604. courseId: this.courseId,
  1605. answerText: this.ctxValue,
  1606. goodsId: this.goodsId,
  1607. orderGoodsId: this.orderGoodsId,
  1608. };
  1609. if (this.assignUserId > 0) {
  1610. data.assignUserId = this.assignUserId;
  1611. }
  1612. this.$api.postAnswer(data).then((res) => {
  1613. if (res.data.code == 200) {
  1614. this.$u.toast("发布成功");
  1615. self.getAnswerList();
  1616. this.isFocus = false;
  1617. this.placeholder = "您可以在这里输入答疑内容";
  1618. this.ctxValue = "";
  1619. this.assignUserId = 0;
  1620. }
  1621. });
  1622. },
  1623. postContent() {
  1624. if (!this.ctxValue || this.ctxValue == "") {
  1625. this.$u.toast("请输入内容");
  1626. return;
  1627. }
  1628. this.postAnswer();
  1629. },
  1630. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  1631. console.log("status", status);
  1632. let currentTime = 0;
  1633. let PlayDuration = 0;
  1634. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1635. if (polyvPlayerContext) {
  1636. currentTime = polyvPlayerContext.getCurrentTime(); //总的视频播放时刻
  1637. PlayDuration = polyvPlayerContext.getVideoPlayDuration(); //本次看的时长
  1638. }
  1639. if (this.playChannelId > 0) {
  1640. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  1641. }
  1642. let self = this;
  1643. let data = {
  1644. photo: self.ossAvatarUrl,
  1645. sectionId: parseInt(sectionId),
  1646. goodsId: parseInt(self.goodsId),
  1647. courseId: parseInt(self.courseId),
  1648. orderGoodsId: this.orderGoodsId,
  1649. studyDuration: parseInt(
  1650. PlayDuration > 0 ? PlayDuration : self.studyDuration
  1651. ),
  1652. gradeId: parseInt(self.gradeId),
  1653. chapterId: parseInt(self.chapterId),
  1654. moduleId: parseInt(self.moduleId),
  1655. videoCurrentTime: parseInt(
  1656. currentTime > 0 ? currentTime : self.studyDuration
  1657. ),
  1658. };
  1659. if (status > 0) {
  1660. console.log(sectionId, "sectionId");
  1661. data.status = status;
  1662. }
  1663. console.log("提交接口", data);
  1664. this.$api.studyRecord(data).then((res) => {
  1665. if (res.data.code == 200) {
  1666. if (status > 0) {
  1667. let moduleId = this.moduleId || 0;
  1668. let chapterId = this.chapterId || 0;
  1669. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  1670. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  1671. console.log(playNextId, "playNextId");
  1672. console.log(playNextIdisRebuild, "playNextIdisRebuild");
  1673. uni.$emit("playNext" + playNextIdisRebuild, {
  1674. fromRebuild: this.isRebuild,
  1675. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  1676. uni.$emit("playNext" + playNextId); //通知播放结束
  1677. }
  1678. self.ossAvatarUrl = "";
  1679. } else {
  1680. this.uploadLock = false;
  1681. uni.showToast({
  1682. icon: "none",
  1683. title: res.data.msg,
  1684. });
  1685. }
  1686. console.log(res, "res");
  1687. });
  1688. },
  1689. uploadFile(options, int) {
  1690. console.log(options)
  1691. var self = this;
  1692. return new Promise((resolve, reject) => {
  1693. var data = {
  1694. imageStatus: int,
  1695. gradeId: this.gradeId,
  1696. orderGoodsId: this.orderGoodsId,
  1697. };
  1698. self.$api.aliyunpolicy(data).then((res) => {
  1699. if (res.data.code != 200) {
  1700. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  1701. return;
  1702. }
  1703. var ossToken = res.data.data.resultContent;
  1704. if (ossToken.host == null || ossToken.host == undefined) {
  1705. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  1706. return;
  1707. }
  1708. uni.uploadFile({
  1709. url: ossToken.host,
  1710. name: "file",
  1711. filePath: options,
  1712. fileType: "image",
  1713. header: {
  1714. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  1715. },
  1716. formData: {
  1717. key: ossToken.dir,
  1718. OSSAccessKeyId: ossToken.accessid,
  1719. policy: ossToken.policy,
  1720. Signature: ossToken.signature,
  1721. callback: ossToken.callback,
  1722. success_action_status: 200,
  1723. },
  1724. success: (result) => {
  1725. if (result.statusCode === 200) {
  1726. self.ossAvatarUrl = ossToken.dir;
  1727. resolve();
  1728. } else {
  1729. uni.showToast({
  1730. title: "上传失败",
  1731. icon: "none",
  1732. });
  1733. this.openPhoto();
  1734. return;
  1735. }
  1736. },
  1737. fail: (error) => {
  1738. uni.showToast({
  1739. title: "上传接口报错,请重新拍照上传" + error,
  1740. icon: "none",
  1741. });
  1742. this.openPhoto();
  1743. return;
  1744. },
  1745. });
  1746. });
  1747. });
  1748. },
  1749. imageInfos() {
  1750. var self = this;
  1751. return new Promise((resolve, reject) => {
  1752. uni.getImageInfo({
  1753. src: self.avatarUrl,
  1754. success: async (res) => {
  1755. let canvasWidth = res.width; //图片原始长宽
  1756. let canvasHeight = res.height;
  1757. if (canvasWidth > 2000 || canvasHeight > 2000) {
  1758. uni.compressImage({
  1759. src: self.avatarUrl,
  1760. quality: 75,
  1761. width: "35%",
  1762. height: "35%",
  1763. success: async (rest) => {
  1764. const waitUpload = await self.uploadFile(
  1765. rest.tempFilePath,
  1766. 0
  1767. );
  1768. resolve(waitUpload);
  1769. },
  1770. });
  1771. } else if (canvasWidth > 1000 || canvasHeight > 1000) {
  1772. uni.compressImage({
  1773. src: self.avatarUrl,
  1774. quality: 75,
  1775. width: "50%",
  1776. height: "50%",
  1777. success: async (rest) => {
  1778. const waitUpload = await self.uploadFile(
  1779. rest.tempFilePath,
  1780. 0
  1781. );
  1782. resolve(waitUpload);
  1783. },
  1784. });
  1785. } else {
  1786. console.log("无需压缩");
  1787. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  1788. resolve(waitUpload);
  1789. }
  1790. },
  1791. });
  1792. });
  1793. },
  1794. timeEvent() {
  1795. let self = this;
  1796. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1797. if (polyvPlayerContext != null) {
  1798. this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
  1799. // console.log(this.playTime,789,this.photoHistoryList)
  1800. //判断是否需要拍照
  1801. if (this.photoNum > 0) {
  1802. this.configPhoto();
  1803. let photoTime = 0; //获取拍照秒数
  1804. for (let i = 0; i < this.photoList.length; i++) {
  1805. photoTime = Number(this.photoList[i]); //获取拍照秒数
  1806. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  1807. //3秒区间内才触发拍照,避免拉动滚动条
  1808. if (
  1809. this.photoHistoryList.indexOf(i) < 0 &&
  1810. this.sectionItem.learning != 1
  1811. ) {
  1812. //不存在拍照历史,没有重修过,没有学过,则拍照
  1813. //启动拍照
  1814. //暂停
  1815. polyvPlayerContext.exitFullScreen();
  1816. polyvPlayerContext.pause();
  1817. this.photoIndex = i;
  1818. this.openPhoto();
  1819. }
  1820. }
  1821. }
  1822. }
  1823. }
  1824. },
  1825. closeToast() {
  1826. clearTimeout(this.toastTimer);
  1827. this.videoToastShow = false;
  1828. },
  1829. restart() {
  1830. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1831. polyvPlayerContext.seek(0);
  1832. console.log("seek1");
  1833. clearTimeout(this.toastTimer);
  1834. this.videoToastShow = false;
  1835. },
  1836. onStateChange(newstate, oldstate) {
  1837. if (newstate.detail.newstate == "playing") {
  1838. if (this.needSeek) {
  1839. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1840. if (this.recordObj.videoCurrentTime) {
  1841. console.log("seek2");
  1842. polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
  1843. this.seekTime = this.$method.secondToDate(
  1844. this.recordObj.videoCurrentTime
  1845. );
  1846. this.videoToastShow = true;
  1847. this.toastTimer = setTimeout(() => {
  1848. this.videoToastShow = false;
  1849. }, 3000);
  1850. } else {
  1851. polyvPlayerContext.seek(1); //避免相同节继续播放
  1852. console.log("seek3");
  1853. }
  1854. polyvPlayerContext.play();
  1855. this.needSeek = false;
  1856. }
  1857. //开始播放
  1858. if (this.timer) {
  1859. clearInterval(this.timer);
  1860. }
  1861. this.timer = setInterval(this.timeEvent, 1000); //定时器
  1862. }
  1863. if (newstate.detail.newstate == "pause") {
  1864. clearInterval(this.timer);
  1865. //暂停提交记录
  1866. /* this.ossAvatarUrl = ""
  1867. this.postStudyRecord() */
  1868. }
  1869. if (newstate.detail.newstate == "ended") {
  1870. clearInterval(this.timer);
  1871. uni.showToast({
  1872. icon: "none",
  1873. title: "播放完毕",
  1874. });
  1875. this.hasStart = false;
  1876. this.postStudyRecord(1);
  1877. // uni.$emit('playNext') //播放重修下一节
  1878. }
  1879. },
  1880. //拍照
  1881. openPhoto() {
  1882. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1883. if (polyvPlayerContext) {
  1884. polyvPlayerContext.exitFullScreen();
  1885. }
  1886. this.enableAutoRotation = false;
  1887. this.photoPopup = true;
  1888. this.isTaking = true;
  1889. uni.setKeepScreenOn({
  1890. keepScreenOn: true,
  1891. });
  1892. uni.authorize({
  1893. scope: "scope.camera",
  1894. success() {},
  1895. });
  1896. },
  1897. /**
  1898. * 人脸匹配
  1899. */
  1900. faceRecognition() {
  1901. return new Promise((resolve) => {
  1902. let fileSystem = uni.getFileSystemManager();
  1903. fileSystem.readFile({
  1904. filePath: `${this.avatarUrl}`,
  1905. encoding: "base64",
  1906. position: 0,
  1907. success: (res) => {
  1908. console.log(res);
  1909. let base64 = "data:image/jpg;base64," + res.data;
  1910. console.log({
  1911. imageA: base64,
  1912. orderGoodsId: this.orderGoodsId,
  1913. gradeId: this.gradeId,
  1914. },'base64Data')
  1915. this.$api
  1916. .faceCertificationCompareFace({
  1917. imageA: base64,
  1918. orderGoodsId: this.orderGoodsId,
  1919. gradeId: this.gradeId,
  1920. })
  1921. .then((res) => {
  1922. console.log(res, "res");
  1923. resolve(res.data.data);
  1924. });
  1925. },
  1926. fail(err) {
  1927. console.error(err, "err");
  1928. },
  1929. });
  1930. });
  1931. },
  1932. async submit() {
  1933. if (this.uploadLock) {
  1934. return;
  1935. }
  1936. this.uploadLock = true;
  1937. let compareFaceData = await this.faceRecognition();
  1938. console.log(compareFaceData,'compareFaceData')
  1939. if (compareFaceData >= 80) {
  1940. const waitYS = await this.imageInfos();
  1941. this.postCoursePhotoRecord()
  1942. .then((res) => {
  1943. this.photoHistoryList.push(this.photoIndex);
  1944. this.postStudyRecord(); //提交记录
  1945. //恢复播放
  1946. uni.setKeepScreenOn({
  1947. keepScreenOn: false,
  1948. });
  1949. this.photoPopup = false;
  1950. this.uploadLock = false;
  1951. this.enableAutoRotation = true;
  1952. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1953. if (polyvPlayerContext != null) {
  1954. polyvPlayerContext.play();
  1955. }
  1956. })
  1957. .catch((err) => {
  1958. uni.showToast({
  1959. title: "上传接口报错,请重新拍照上传" + err,
  1960. icon: "none",
  1961. });
  1962. this.uploadLock = false;
  1963. this.openPhoto();
  1964. });
  1965. } else {
  1966. uni.showToast({
  1967. title: "人脸匹配不通过,请重新拍照上传",
  1968. icon: "none",
  1969. duration: 2000,
  1970. });
  1971. setTimeout(() => {
  1972. this.uploadLock = false;
  1973. this.openPhoto();
  1974. }, 2000);
  1975. return;
  1976. }
  1977. },
  1978. reTake() {
  1979. this.isTaking = true;
  1980. },
  1981. //确认拍照
  1982. takePhoto() {
  1983. var self = this;
  1984. const ctx = uni.createCameraContext();
  1985. ctx.takePhoto({
  1986. quality: "high",
  1987. success: (res) => {
  1988. console.log(res.tempImagePath);
  1989. self.avatarUrl = res.tempImagePath;
  1990. this.isTaking = false;
  1991. // self.submit();
  1992. // self.photoPopup = false;
  1993. // self.enableAutoRotation = true;
  1994. },
  1995. fail: (err) => {
  1996. console.log(err);
  1997. },
  1998. });
  1999. },
  2000. playError(e) {
  2001. console.log(e);
  2002. },
  2003. //拍照报错
  2004. error(e) {
  2005. console.log(e.detail);
  2006. },
  2007. //关闭相机
  2008. closePhoto() {
  2009. this.photoPopup = false;
  2010. self.enableAutoRotation = true;
  2011. },
  2012. /**
  2013. * 进入全屏
  2014. */
  2015. fullscreenchange(event) {
  2016. console.log(event);
  2017. if (event.detail.direction == "vertical") {
  2018. this.navShow = true;
  2019. } else if (event.detail.direction == "horizontal") {
  2020. this.navShow = false;
  2021. }
  2022. },
  2023. getGoodsDetail() {
  2024. let self = this;
  2025. this.$api.goodsDetail(this.goodsId).then((res) => {
  2026. self.goodsData = res.data.data;
  2027. self.gradeId = self.goodsData.gradeId;
  2028. console.log(self.gradeId, "班级ID");
  2029. this.courseBusiness();
  2030. this.courseHandouts();
  2031. self.getMenuList();
  2032. self.getReMenuList(); //获取重修目录
  2033. setTimeout(function () {
  2034. if (!self.needProfileModal) {
  2035. self.getGradeInfo();
  2036. }
  2037. }, 500);
  2038. //获取节笔记
  2039. this.getNoteList();
  2040. if (self.goodsData.goodsPlayConfig) {
  2041. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  2042. if (self.goodsPlayConfig.autoPlay > 0) {
  2043. self.autoplay = true;
  2044. }
  2045. if (self.goodsPlayConfig.drag > 0) {
  2046. self.isAllowSeek = "yes";
  2047. }
  2048. if (self.goodsPlayConfig.speed > 0) {
  2049. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  2050. }
  2051. }
  2052. if (self.goodsData.goodsPhotographConfig) {
  2053. self.goodsPhotographConfig = JSON.parse(
  2054. self.goodsData.goodsPhotographConfig
  2055. );
  2056. if (self.goodsPhotographConfig.photoNum > 0) {
  2057. self.photoNum = self.goodsPhotographConfig.photoNum;
  2058. console.log(self.photoNum, 777777);
  2059. }
  2060. }
  2061. });
  2062. },
  2063. startVideo() {
  2064. this.startStatus = true;
  2065. },
  2066. getAnswerList() {
  2067. let self = this;
  2068. this.$api
  2069. .answerList({ courseId: this.courseId, goodsId: this.goodsId,orderGoodsId: this.orderGoodsId, })
  2070. .then((res) => {
  2071. if (res.data.code == 200) {
  2072. self.answerList = res.data.rows;
  2073. }
  2074. });
  2075. },
  2076. getReMenuList() {
  2077. let self = this;
  2078. this.$api
  2079. .reMenuList({
  2080. orderGoodsId: this.orderGoodsId,
  2081. courseId: this.courseId,
  2082. rebuild: 1,
  2083. gradeId: this.gradeId,
  2084. })
  2085. .then((res) => {
  2086. if (res.data.code == 200) {
  2087. for (let i = 0; i < res.data.rows.length; i++) {
  2088. let item = res.data.rows[i];
  2089. item.down = true;
  2090. item.id = item.menuId;
  2091. item.name = item.menuName;
  2092. }
  2093. self.reMenuList = res.data.rows;
  2094. if (self.reMenuList.length > 0) {
  2095. this.showNotes = false;
  2096. self.list = [
  2097. {
  2098. name: "目录",
  2099. },
  2100. {
  2101. name: "讲义",
  2102. },
  2103. {
  2104. name: "笔记",
  2105. },
  2106. {
  2107. name: "答疑",
  2108. },
  2109. { name: "重修目录" },
  2110. ];
  2111. this.current = 0;
  2112. } else {
  2113. self.list = [
  2114. {
  2115. name: "目录",
  2116. },
  2117. {
  2118. name: "讲义",
  2119. },
  2120. {
  2121. name: "笔记",
  2122. },
  2123. {
  2124. name: "答疑",
  2125. },
  2126. ];
  2127. this.current = 0;
  2128. }
  2129. }
  2130. });
  2131. },
  2132. getMenuList() {
  2133. let self = this;
  2134. this.$api
  2135. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  2136. .then((res) => {
  2137. if (res.data.code == 200) {
  2138. for (let i = 0; i < res.data.rows.length; i++) {
  2139. let item = res.data.rows[i];
  2140. item.down = true;
  2141. item.id = item.menuId;
  2142. item.name = item.menuName;
  2143. item.menuType = item.type;
  2144. }
  2145. self.menuList = res.data.rows;
  2146. for (let i = 0; i < res.data.rows.length; i++) {
  2147. if (res.data.rows[i].type == 1) {
  2148. this.menuIndex = [i];
  2149. break;
  2150. } else if (res.data.rows[i].type == 2) {
  2151. this.menuIndex = [i];
  2152. break;
  2153. }
  2154. }
  2155. }
  2156. });
  2157. },
  2158. courseDetail() {
  2159. let self = this;
  2160. this.$api.courseDetail(this.courseId).then((res) => {
  2161. if (res.data.code == 200) {
  2162. if (res.data.data.educationName == "继续教育") {
  2163. this.$api
  2164. .lockLockAction({
  2165. action: "jxjy",
  2166. })
  2167. .then((res) => {});
  2168. this.lockTimer = setInterval(() => {
  2169. this.$api
  2170. .lockLockAction({
  2171. action: "jxjy",
  2172. })
  2173. .then((res) => {});
  2174. }, 10000);
  2175. // websocket.sendMsg("doCourse");
  2176. }
  2177. self.detail = res.data.data;
  2178. }
  2179. });
  2180. },
  2181. open(item) {
  2182. item.showChildren = !item.showChildren;
  2183. },
  2184. change(index) {
  2185. this.current = index;
  2186. },
  2187. openDocument() {
  2188. let self = this;
  2189. let url = this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl);
  2190. console.log(url);
  2191. uni.downloadFile({
  2192. url: url,
  2193. success: function (res) {
  2194. console.log(999);
  2195. var filePath = res.tempFilePath;
  2196. uni.openDocument({
  2197. filePath: filePath,
  2198. showMenu: self.courseHandoutsData.canDownload == 1 ? true : false,
  2199. success: function (res) {
  2200. console.log(res, "打开文档成功");
  2201. },
  2202. fail: function (err) {
  2203. console.log(err);
  2204. uni.showToast({
  2205. icon: "none",
  2206. title: "文档地址错误",
  2207. });
  2208. },
  2209. });
  2210. },
  2211. fail: (err) => {
  2212. uni.showModal({
  2213. title: "提示",
  2214. content: "文档错误," + err.errMsg,
  2215. showCancel: false,
  2216. });
  2217. },
  2218. });
  2219. },
  2220. },
  2221. };
  2222. </script>
  2223. <style lang="scss" scope>
  2224. .polyv_detail {
  2225. display: flex;
  2226. flex-direction: column;
  2227. height: 100vh;
  2228. .box {
  2229. flex: 1;
  2230. overflow: hidden;
  2231. margin: 20rpx;
  2232. .box_in {
  2233. height: 100%;
  2234. }
  2235. }
  2236. }
  2237. .btnSet {
  2238. width: 440rpx;
  2239. height: 80rpx;
  2240. background: #007aff;
  2241. border-radius: 40rpx;
  2242. color: #ffffff;
  2243. font-size: 28rpx;
  2244. line-height: 80rpx;
  2245. }
  2246. .btnReply {
  2247. width: 80rpx;
  2248. height: 40rpx;
  2249. background: #e3f0ff;
  2250. border-radius: 16rpx;
  2251. text-align: center;
  2252. color: #007aff;
  2253. }
  2254. .btnDel {
  2255. width: 80rpx;
  2256. height: 40rpx;
  2257. background: #ffedf0;
  2258. border-radius: 16rpx;
  2259. text-align: center;
  2260. color: #ff2d55;
  2261. }
  2262. .btnReply {
  2263. width: 80rpx;
  2264. height: 40rpx;
  2265. background: #e3f0ff;
  2266. border-radius: 16rpx;
  2267. font-size: 24rpx;
  2268. }
  2269. .lecture-box {
  2270. display: flex;
  2271. align-items: center;
  2272. height: 80rpx;
  2273. background: #ffffff;
  2274. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2275. .title {
  2276. padding: 10rpx;
  2277. flex: 1;
  2278. overflow: hidden;
  2279. text-overflow: ellipsis;
  2280. white-space: nowrap;
  2281. color: #333;
  2282. font-weight: bold;
  2283. font-size: 32rpx;
  2284. }
  2285. .btn {
  2286. display: flex;
  2287. align-items: center;
  2288. justify-content: center;
  2289. width: 80rpx;
  2290. height: 80rpx;
  2291. background: #ffffff;
  2292. box-shadow: -4rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.1);
  2293. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2294. }
  2295. }
  2296. .lecture-content {
  2297. background: #fff;
  2298. margin-top: 10rpx;
  2299. padding: 10rpx;
  2300. border-radius: 16rpx;
  2301. }
  2302. .photoBox {
  2303. background-color: #ffffff;
  2304. border-radius: 32px 32px 0px 0px;
  2305. .photoTop {
  2306. height: 74rpx;
  2307. display: flex;
  2308. align-items: center;
  2309. justify-content: space-between;
  2310. padding: 0rpx 38rpx;
  2311. .sqzz {
  2312. width: 28rpx;
  2313. height: 28rpx;
  2314. display: flex;
  2315. align-items: center;
  2316. justify-content: center;
  2317. }
  2318. .centersq {
  2319. color: #333;
  2320. font-size: 30rpx;
  2321. font-weight: 500;
  2322. }
  2323. }
  2324. .photoCenter {
  2325. width: 750rpx;
  2326. height: 979rpx;
  2327. position: relative;
  2328. .custom {
  2329. width: 750rpx;
  2330. height: 979rpx;
  2331. position: absolute;
  2332. z-index: 1000;
  2333. top: 0;
  2334. left: 0;
  2335. image {
  2336. width: 100%;
  2337. height: 100%;
  2338. }
  2339. }
  2340. }
  2341. .btns {
  2342. display: flex;
  2343. .btnResult {
  2344. height: 100rpx;
  2345. flex: 1;
  2346. background-color: #07c160;
  2347. text-align: center;
  2348. line-height: 100rpx;
  2349. color: #fff;
  2350. font-size: 32rpx;
  2351. font-weight: bold;
  2352. }
  2353. }
  2354. }
  2355. .chat_box {
  2356. display: flex;
  2357. padding: 20rpx;
  2358. justify-content: space-between;
  2359. }
  2360. .chat3 {
  2361. font-size: 30rpx;
  2362. font-family: PingFang SC;
  2363. font-weight: 500;
  2364. color: #666666;
  2365. margin-top: 10rpx;
  2366. }
  2367. .chat2 {
  2368. font-size: 20rpx;
  2369. font-family: PingFang SC;
  2370. font-weight: 500;
  2371. color: #999999;
  2372. margin-top: 10rpx;
  2373. }
  2374. .chat1 {
  2375. font-size: 24rpx;
  2376. font-family: PingFang SC;
  2377. font-weight: 500;
  2378. color: #333333;
  2379. }
  2380. .leftPadding {
  2381. margin-left: 8rpx;
  2382. }
  2383. .t2Content {
  2384. font-size: 28rpx;
  2385. font-family: PingFang SC;
  2386. font-weight: bold;
  2387. color: #999999;
  2388. line-height: 48rpx;
  2389. }
  2390. .tBox2 {
  2391. display: flex;
  2392. padding-top: 10rpx;
  2393. color: #333333;
  2394. font-size: 30rpx;
  2395. }
  2396. .tBox {
  2397. display: flex;
  2398. align-items: center;
  2399. padding-top: 10rpx;
  2400. }
  2401. .title {
  2402. font-size: 24rpx;
  2403. color: #999999;
  2404. }
  2405. page {
  2406. // padding-top: 10px;
  2407. // padding-top: constant(safe-area-inset-top);
  2408. // padding-top: env(safe-area-inset-top);
  2409. }
  2410. .inputBottom {
  2411. position: fixed;
  2412. left: 0;
  2413. bottom: 0;
  2414. background: #ffffff;
  2415. height: 98rpx;
  2416. display: flex;
  2417. align-items: center;
  2418. width: 100%;
  2419. .flex_auto {
  2420. flex: 1;
  2421. margin-left: 10%;
  2422. .input {
  2423. height: 60rpx;
  2424. }
  2425. }
  2426. .btn {
  2427. color: #007aff;
  2428. font-size: 30rpx;
  2429. font-weight: bold;
  2430. width: 15%;
  2431. text-align: center;
  2432. }
  2433. }
  2434. .noteBox {
  2435. width: 100%;
  2436. background: #ffffff;
  2437. padding: 10rpx;
  2438. border-radius: 16rpx;
  2439. }
  2440. .dateBox {
  2441. width: 216rpx;
  2442. height: 48rpx;
  2443. background: #ffffff;
  2444. border-radius: 24rpx;
  2445. font-size: 24rpx;
  2446. color: #666666;
  2447. text-align: center;
  2448. line-height: 48rpx;
  2449. margin: 20rpx 0;
  2450. }
  2451. .t_content1 {
  2452. color: #007aff;
  2453. margin-left: 10rpx;
  2454. }
  2455. .tag1 {
  2456. border: 2rpx solid #007aff;
  2457. border-radius: 8rpx;
  2458. font-size: 20rpx;
  2459. color: #007aff;
  2460. padding: 5rpx;
  2461. }
  2462. .b_title {
  2463. color: #333333;
  2464. font-size: 30rpx;
  2465. font-weight: bold;
  2466. }
  2467. page {
  2468. background: #eaeef1;
  2469. }
  2470. .menuBox {
  2471. width: 100%;
  2472. background: #ffffff;
  2473. border-radius: 16rpx;
  2474. padding: 20rpx;
  2475. margin-bottom: 20rpx;
  2476. }
  2477. .btnspric {
  2478. border-top: 1rpx solid #eee;
  2479. display: flex;
  2480. align-items: center;
  2481. justify-content: space-between;
  2482. height: 108rpx;
  2483. padding-left: 43rpx;
  2484. padding-right: 32rpx;
  2485. }
  2486. .btnspric > .lefprL {
  2487. font-size: 36rpx;
  2488. color: #0c141f;
  2489. font-weight: bold;
  2490. }
  2491. .btnspric > .lefprR {
  2492. padding: 0rpx 24rpx;
  2493. height: 60rpx;
  2494. line-height: 60rpx;
  2495. text-align: center;
  2496. color: #fff;
  2497. background: #32467b;
  2498. border-radius: 24rpx;
  2499. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2500. }
  2501. .yhj,
  2502. .hdyhj {
  2503. padding: 24rpx 29rpx 24rpx 34rpx;
  2504. }
  2505. .yhj {
  2506. border-bottom: 16rpx solid #f9f9f9;
  2507. }
  2508. .yhjtit {
  2509. font-size: 30rpx;
  2510. color: #0c141f;
  2511. font-weight: 500;
  2512. margin-bottom: 14rpx;
  2513. }
  2514. .yhjList {
  2515. display: flex;
  2516. align-items: center;
  2517. justify-content: space-between;
  2518. margin-bottom: 14rpx;
  2519. }
  2520. .yhjList > .yhjLefts {
  2521. display: flex;
  2522. align-items: center;
  2523. }
  2524. .yhjLefts > .yhl {
  2525. color: #32467b;
  2526. font-size: 30rpx;
  2527. margin-right: 31rpx;
  2528. }
  2529. .yhjLefts > .yhbq {
  2530. font-size: 24rpx;
  2531. color: #ff9500;
  2532. border-radius: 18rpx;
  2533. background-color: rgba(255, 149, 0, 0.2);
  2534. border: 2rpx solid #ff9500;
  2535. height: 38rpx;
  2536. line-height: 38rpx;
  2537. padding: 0rpx 16rpx;
  2538. }
  2539. .ts {
  2540. font-size: 24rpx;
  2541. color: #999;
  2542. margin: 14rpx 0rpx;
  2543. padding-right: 29rpx;
  2544. padding-left: 34rpx;
  2545. }
  2546. .yh {
  2547. padding-top: 20rpx;
  2548. }
  2549. .yh > .yhtitle {
  2550. display: flex;
  2551. align-items: center;
  2552. justify-content: space-between;
  2553. padding-right: 29rpx;
  2554. padding-left: 34rpx;
  2555. }
  2556. .priceBxs {
  2557. display: flex;
  2558. align-items: center;
  2559. }
  2560. .priceBxs > .pricleft {
  2561. border-radius: 24rpx;
  2562. border: 1rpx solid #e91313;
  2563. background-color: rgba(233, 19, 19, 0.1);
  2564. padding: 0rpx 18rpx;
  2565. height: 49rpx;
  2566. line-height: 49rpx;
  2567. text-align: center;
  2568. font-size: 30rpx;
  2569. font-weight: 500;
  2570. color: #e91313;
  2571. margin-right: 13rpx;
  2572. }
  2573. .topBox {
  2574. padding: 32rpx 32rpx 24rpx;
  2575. border-bottom: 1rpx solid #eeeeee;
  2576. }
  2577. .topBox > .boldFonstType {
  2578. font-weight: 500;
  2579. font-size: 30rpx;
  2580. margin: 16rpx 0rpx 23rpx;
  2581. }
  2582. .topBox > .firstTopL {
  2583. display: flex;
  2584. align-items: center;
  2585. }
  2586. .topBox > .firstTopL > .imageBs {
  2587. width: 331rpx;
  2588. height: 160rpx;
  2589. border-radius: 6rpx;
  2590. overflow: hidden;
  2591. margin-right: 8rpx;
  2592. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  2593. }
  2594. .topBox > .firstTopL > .imageBs > image {
  2595. width: 100%;
  2596. height: 100%;
  2597. }
  2598. .topBox > .firstTopL > .textBs {
  2599. font-size: 30rpx;
  2600. font-weight: bold;
  2601. color: #0c141f;
  2602. }
  2603. .content {
  2604. padding: 24rpx;
  2605. text-align: left;
  2606. }
  2607. .catalogBox {
  2608. display: flex;
  2609. align-items: center;
  2610. flex-wrap: nowrap;
  2611. overflow-x: auto;
  2612. padding-left: 38rpx;
  2613. max-height: 305rpx;
  2614. overflow-y: auto;
  2615. transition: all 0.4s;
  2616. }
  2617. .catalogBox > .catalogA {
  2618. min-width: 200rpx;
  2619. height: 48rpx;
  2620. line-height: 48rpx;
  2621. // text-align: center;
  2622. border: 2rpx solid transparent;
  2623. white-space: nowrap;
  2624. text-overflow: ellipsis;
  2625. overflow: hidden;
  2626. word-break: break-all;
  2627. border-radius: 10rpx;
  2628. background: rgba(22, 119, 255, 0.05);
  2629. padding-left: 19rpx;
  2630. box-sizing: border-box;
  2631. padding-right: 15rpx;
  2632. margin-right: 16rpx;
  2633. margin-bottom: 20rpx;
  2634. margin-top: 15rpx;
  2635. font-size: 24rpx;
  2636. color: #666;
  2637. }
  2638. .catalogBox > .activesq {
  2639. border-color: #1677ff;
  2640. }
  2641. .changeCatalogBox {
  2642. display: block;
  2643. }
  2644. .catalogBox::-webkit-scrollbar {
  2645. display: none; /* Chrome Safari */
  2646. }
  2647. .price_t2 {
  2648. font-size: 18rpx;
  2649. font-family: PingFang SC;
  2650. font-weight: 500;
  2651. text-decoration: line-through;
  2652. color: #999999;
  2653. }
  2654. .price_t1 {
  2655. font-size: 33rpx;
  2656. font-family: PingFang SC;
  2657. font-weight: bold;
  2658. color: #e91313;
  2659. }
  2660. .sc_t {
  2661. font-size: 22rpx;
  2662. color: #000000;
  2663. }
  2664. .sc {
  2665. width: 29rpx;
  2666. height: 29rpx;
  2667. }
  2668. .buy {
  2669. width: 138rpx;
  2670. height: 48rpx;
  2671. line-height: 48rpx;
  2672. background: #32467b;
  2673. border-radius: 10rpx;
  2674. color: #ffffff;
  2675. font-size: 28rpx;
  2676. text-align: center;
  2677. vertical-align: middle;
  2678. position: absolute;
  2679. right: 30rpx;
  2680. }
  2681. .video_body {
  2682. padding-bottom: 96rpx;
  2683. }
  2684. .footer_tab {
  2685. position: fixed;
  2686. bottom: 0;
  2687. height: 96rpx;
  2688. width: 100%;
  2689. background-color: #ffffff;
  2690. }
  2691. .tj_box {
  2692. width: 50%;
  2693. display: inline-block;
  2694. text-align: center;
  2695. margin: 10rpx 0;
  2696. }
  2697. .teacher_t {
  2698. font-size: 24rpx;
  2699. font-family: PingFang SC;
  2700. font-weight: 400;
  2701. color: #666666;
  2702. line-height: 36rpx;
  2703. margin-left: 15rpx;
  2704. }
  2705. .teacher_img {
  2706. width: 87rpx;
  2707. height: 129rpx;
  2708. }
  2709. .t2 {
  2710. font-size: 24rpx;
  2711. font-family: PingFang SC;
  2712. color: #666666;
  2713. line-height: 36rpx;
  2714. margin: 15rpx;
  2715. }
  2716. .r_t2 {
  2717. width: 201rpx;
  2718. height: 49rpx;
  2719. background: rgba(22, 119, 255, 0.05);
  2720. border: 1rpx solid #32467b;
  2721. border-radius: 16rpx;
  2722. color: #666666;
  2723. font-size: 23rpx;
  2724. text-align: center;
  2725. display: flex;
  2726. align-items: center;
  2727. padding: 5rpx;
  2728. }
  2729. .scroll_box {
  2730. width: 100%;
  2731. height: 60rpx;
  2732. background: #ffffff;
  2733. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2734. white-space: nowrap;
  2735. overflow: hidden;
  2736. margin: 15rpx 0;
  2737. }
  2738. .r_sliper {
  2739. padding: 0 20rpx;
  2740. }
  2741. .top_line {
  2742. width: 6rpx;
  2743. height: 22rpx;
  2744. background: #32467b;
  2745. margin-right: 10rpx;
  2746. }
  2747. .video_t2 {
  2748. font-size: 24rpx;
  2749. font-family: PingFang SC;
  2750. font-weight: 500;
  2751. color: #666666;
  2752. }
  2753. .video_t1 {
  2754. height: 80rpx;
  2755. color: #333333;
  2756. line-height: 80rpx;
  2757. font-size: 30rpx;
  2758. font-family: PingFang SC;
  2759. font-weight: bold;
  2760. color: #333333;
  2761. overflow: hidden;
  2762. text-overflow: ellipsis;
  2763. white-space: nowrap;
  2764. }
  2765. .notice_wrap {
  2766. height: 80rpx;
  2767. display: flex;
  2768. align-items: center;
  2769. justify-content: flex-end;
  2770. .video_t1_t {
  2771. width: 100%;
  2772. height: 40rpx;
  2773. line-height: 40rpx;
  2774. text-align: center;
  2775. background: rgba(245, 154, 35, 1);
  2776. color: #333;
  2777. border-radius: 10rpx;
  2778. font-size: 24rpx;
  2779. }
  2780. }
  2781. .video_play {
  2782. position: absolute;
  2783. width: 95rpx;
  2784. height: 95rpx;
  2785. top: 0;
  2786. left: 0;
  2787. right: 0;
  2788. bottom: 0;
  2789. margin: auto;
  2790. }
  2791. .video_box {
  2792. position: relative;
  2793. .video-toast {
  2794. position: absolute;
  2795. width: 686rpx;
  2796. height: 80rpx;
  2797. background: rgba(0, 0, 0, 0.6);
  2798. border-radius: 24rpx;
  2799. bottom: 100rpx;
  2800. left: 50%;
  2801. transform: translateX(-50%);
  2802. color: #fff;
  2803. display: flex;
  2804. font-size: 26rpx;
  2805. align-items: center;
  2806. overflow: visible;
  2807. &__text {
  2808. flex: 1;
  2809. margin-left: 40rpx;
  2810. }
  2811. &__btn {
  2812. width: 180rpx;
  2813. text-align: center;
  2814. border-left: 1rpx solid #fff;
  2815. }
  2816. }
  2817. .video-toast__close {
  2818. position: absolute;
  2819. right: 32rpx;
  2820. bottom: 184rpx;
  2821. width: 40rpx;
  2822. height: 40rpx;
  2823. line-height: 40rpx;
  2824. text-align: center;
  2825. background: rgba(0, 0, 0, 0.6);
  2826. border-radius: 50%;
  2827. color: rgba(255, 255, 255, 0.3);
  2828. }
  2829. }
  2830. .rotoct {
  2831. transform: rotate(90deg);
  2832. }
  2833. .notice_modal {
  2834. .content {
  2835. width: 100%;
  2836. height: 100%;
  2837. padding: 20rpx;
  2838. .title {
  2839. color: #333;
  2840. line-height: 40rpx;
  2841. font-size: 30rpx;
  2842. text-align: center;
  2843. font-weight: bold;
  2844. }
  2845. .text {
  2846. line-height: 40rpx;
  2847. }
  2848. }
  2849. }
  2850. </style>