detail.vue 91 KB

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