detail.vue 95 KB

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