detail.vue 93 KB

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