detail.vue 94 KB

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