detail.vue 95 KB

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