detail.vue 94 KB

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