index.vue 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821
  1. <template>
  2. <view class="home">
  3. <view class="pop" v-if="showPrivacy">
  4. <view class="pop_con">
  5. <view class="title">用户隐私保护提示</view>
  6. <view class="desc">
  7. <view class="desc_con">感谢您使用本程序,您使用本程序前应当阅井同意</view>
  8. <view class="file" @click="openPrivacyContract">《大卫博士争霸赛小程序隐私保护指引》</view>
  9. <view class="desc_con">
  10. 当您点击同意并开始时用产品服务时,即表示你已理解并同息该条款内容,该条款将对您产生法律约束力。如您拒绝,将无法进入程序。</view>
  11. </view>
  12. <view class="btn_box">
  13. <navigator open-type="exit" target="miniProgram" class="exit_btn" id="disagree-btn">不同意退出
  14. </navigator>
  15. <button id="agree-btn" @agreeprivacyauthorization="handleAgreePrivacyAuthorization"
  16. open-type="agreePrivacyAuthorization">同意并继续</button>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="index">
  21. <!-- <tel-verify v-if="showVerify"></tel-verify> -->
  22. <custom-warn v-if="showWarn"></custom-warn>
  23. <custom-toast ref='toast'></custom-toast>
  24. <view class="header-bg"></view>
  25. <view v-if="showphonelabel" class="showphonelabel" @click="goshowphone"></view>
  26. <!-- <view class="" @click="gotoyan">
  27. 奖学金明细
  28. </view> -->
  29. <!-- <view class="title" v-if="userServerInfo.season">大卫博士学位争霸赛第{{ userServerInfo.season | numToZh }}季</view> -->
  30. <view class="title" v-if="userServerInfo.season">大卫博士学位争霸赛第{{ userServerInfo.season }}季</view>
  31. <view class="user_info_new">
  32. <view class="userinfo">
  33. <view class="top">
  34. <!-- <open-data class="user-pic" type="userAvatarUrl"></open-data> -->
  35. <image class="user-pic"
  36. :src="userServerInfo.avatar ? userServerInfo.avatar : '../../static/icon/user.jpg'"
  37. mode="scaleToFill" @tap="toself"></image>
  38. <image v-if="userServerInfo.score >= 300" class="hat" src="../../static/icon/hat.png"
  39. mode="scaleToFill" @tap="toself"></image>
  40. <view class="user-info" @tap="changeName">
  41. <view class="name-grade-level">
  42. <view class="name">
  43. {{ userServerInfo.name ? userServerInfo.name : '更换昵称头像' }}
  44. </view>
  45. <!-- <open-data type="userNickName" class="name"></open-data> -->
  46. <view class="grade">
  47. {{ userServerInfo.grade === undefined ? '未验证' : userServerInfo.grade }}
  48. </view>
  49. <!-- 隐藏等级 -->
  50. <!-- <view class="level" v-if="userServerInfo.level_name">
  51. <image src="../../static/icon/level.png" mode="scaleToFill"></image>
  52. <text>{{ userServerInfo.level_name }}</text>
  53. </view> -->
  54. </view>
  55. </view>
  56. </view>
  57. <view class="user-status" v-if="userStatus"
  58. :class="(userStatus === '报名截止' || userStatus === '暂未开赛') ? 'end' : ''" @tap="tapUserStatus">
  59. {{ userStatus }}
  60. </view>
  61. <view class="score-rank">
  62. <view class="score">学分:{{ userServerInfo.score ? userServerInfo.score : '0' }}</view>
  63. <view class="rank">排名:{{ userServerInfo.rank ? userServerInfo.rank : '0' }}</view>
  64. </view>
  65. </view>
  66. <view class="biye_tip" v-if="userServerInfo.signuped">
  67. <template v-if="userServerInfo.status === 1">
  68. <view>
  69. 你已连续参赛{{ userServerInfo.enrol_count }}季,你真棒!继续努力,加油!
  70. </view>
  71. </template>
  72. <template v-else>
  73. <view v-if="userServerInfo.score === userServerInfo.max_score">
  74. 您已达到历史最高学分,请继续加油!
  75. </view>
  76. <view v-else>
  77. 距离 {{ userServerInfo.score | willDeg(userServerInfo.max_score) }} 还差
  78. {{ userServerInfo.score | lessScore(userServerInfo.max_score) }} 学分
  79. </view>
  80. </template>
  81. <view v-if="userServerInfo.score === userServerInfo.max_score">
  82. 你已连续参赛{{ userServerInfo.enrol_count }}季,你真棒!继续努力,加油!
  83. </view>
  84. <view v-else>
  85. 距离 {{ userServerInfo.score | willDeg(userServerInfo.max_score) }} 还差
  86. {{ userServerInfo.score | lessScore(userServerInfo.max_score) }} 学分
  87. </view>
  88. </view>
  89. </view>
  90. <view v-if="timer" class="index_countdown">
  91. <text style="font-size: 30rpx;">距{{ timerStatus ? '结束' : '开始' }}仅剩:</text>
  92. <text class="spec bg1">{{ countDown[0] || '00' }}</text>
  93. <text class="small">天</text>
  94. <text class="spec bg2">{{ countDown[1] || '00' }}</text>
  95. <text class="small">时</text>
  96. <text class="spec bg3">{{ countDown[2] || '00' }}</text>
  97. <text class="small">分</text>
  98. <view class="spec bg4 animate_second" v-if="countDown[3] || countDown[3] === 0">
  99. <swiper :indicator-dots="false" :autoplay="false" :interval="10000" :duration="300" :circular="true"
  100. :vertical="true" :current="countA.findIndex(i => +i === Number(countDown[3]))" :disable-touch="true"
  101. class="animate_item">
  102. <swiper-item v-for="n of countA" :key="n">
  103. <view class="swiper-item">{{ n }}</view>
  104. </swiper-item>
  105. </swiper>
  106. <swiper :indicator-dots="false" :autoplay="true" :interval="1000" :duration="300" :circular="true"
  107. :vertical="true" :disable-touch="true" :current="countB.findIndex(i => +i === Number(countDown[4]))"
  108. class="animate_item" @change="changeCountTime">
  109. <swiper-item v-for="n in countB" :key="n">
  110. <view class="swiper-item">{{ n }}</view>
  111. </swiper-item>
  112. </swiper>
  113. </view>
  114. <text class="small">秒</text>
  115. </view>
  116. <view v-if="messageList.length > 0" class="swiper_parant">
  117. <view class="message_icon_box">
  118. <image src="../../static/new/message2.jpg" mode="" class="message_icon"></image>
  119. <text>恭喜</text>
  120. </view>
  121. <swiper class="swiper swiper_message" :indicator-dots="false" :autoplay="true" :circular="true"
  122. @animationfinish="changeMessageSwiper" interval="1500">
  123. <swiper-item v-for="(item, i) in messageList" :key="i">
  124. <view class="swiper-item uni-bg-red">{{ item.data }}</view>
  125. </swiper-item>
  126. </swiper>
  127. </view>
  128. <view class="entrance">
  129. <!-- <view class="nav_container"> -->
  130. <view class="index-item item_bg1" @tap="toranking">
  131. <text class="name">销售排行</text>
  132. <view v-if="userServerInfo.rank" class="userranking">
  133. 我的排名:{{ userServerInfo.rank ? userServerInfo.rank : '0' }}</view>
  134. <image src="https://api.jiuweiyun.cn/public/uploads/weapp/icon/index_bg1.png" class="coverImg cv1">
  135. </view>
  136. <view class="index-item item_bg2" @tap="toupload">
  137. <text class="name">培训课程表</text>
  138. <image src="https://api.jiuweiyun.cn/public/uploads/weapp/icon/index_bg2.png" class="coverImg cv2">
  139. </view>
  140. <view class="index-item item_bg3" @tap="toHonor">
  141. <text class="name">荣誉殿堂</text>
  142. <image src="https://api.jiuweiyun.cn/public/uploads/weapp/icon/index_bg5.png" class="coverImg cv3">
  143. </view>
  144. <!-- <view class="index-item item_bg3" @tap="toChallenge()">
  145. <text class="name">挑战竞猜</text>
  146. <image src="https://api.jiuweiyun.cn/public/uploads/weapp/icon/index_bg3.png" class="coverImg cv3">
  147. </view> -->
  148. <view class="index-item item_bg4" @tap="toOther">
  149. <text class="name">其他</text>
  150. <image src="https://api.jiuweiyun.cn/public/uploads/weapp/icon/index_bg4.png" class="coverImg cv4">
  151. </view>
  152. <!-- </view> -->
  153. </view>
  154. <view class="rules" @tap="torules" @longpress="toLongTapIndex">查看赛季规则 <text class="cuIcon-question"></text>
  155. </view>
  156. <!-- <button v-if="!canIUseProfile && showGetUserInfoButton" class="getUserInfo" type="default" open-type="getUserInfo" @getuserinfo="getuserinfo"></button> -->
  157. <button v-if="showGetUserInfoButton" class="getUserInfo" type="default" @click="getuserinfo"></button>
  158. <!-- <button class="getUserInfo" type="default" @click="getuserinfo"></button> -->
  159. <!-- 学位弹窗 -->
  160. <page-toast
  161. :is-show="isXuefenToast && (userServerInfo.glory_popovers && userServerInfo.glory_popovers.type === 1)">
  162. <view class="toast_container xuewei_toast" @click="toToastDetail">
  163. <image class="bg" src="https://api.jiuweiyun.cn/public/uploads/icon/toast8.png"></image>
  164. <view class="text">{{ userServerInfo.score | userXueWei }}</view>
  165. </view>
  166. </page-toast>
  167. <!-- 学霸弹窗 -->
  168. <page-toast :is-show="isXuebaToast && (userServerInfo.max_popovers && userServerInfo.max_popovers.type === 10)">
  169. <view class="toast_container xueba_toast" @click="toToastXueBa">
  170. <image class="bg" src="https://api.jiuweiyun.cn/public/uploads/icon/toast7.png"></image>
  171. <view class="text">{{ userServerInfo.level_name }}学霸</view>
  172. </view>
  173. </page-toast>
  174. <!-- 挑战详情 -->
  175. <page-toast
  176. :is-show="isTiaoXhanToast && (userServerInfo.challenge_result && userServerInfo.challenge_result.type === 1)"
  177. :is-close="false" :before-close="resetTiaoZhanToast">
  178. <view class="challenge-num">
  179. <view class="challenage-num-top">
  180. <view class="challenage-num-body">
  181. <view class="challenge-num-item">
  182. <view>
  183. <text class="label">参加挑战:</text>
  184. <text class="spec">
  185. {{ userServerInfo.challenge_result.data.challenge_num || 0 }}
  186. </text>
  187. <text class="label">场</text>
  188. </view>
  189. <view>
  190. <text class="label">参加竞猜:</text>
  191. <text class="spec">
  192. {{ userServerInfo.challenge_result.data.guessing_num || 0 }}
  193. </text>
  194. <text class="label">场</text>
  195. </view>
  196. </view>
  197. <view class="challenge-num-item">
  198. <view>
  199. <text class="label">挑战成功:</text>
  200. <text class="spec">
  201. {{ userServerInfo.challenge_result.data.challenge_success || 0 }}
  202. </text>
  203. <text class="label">场</text>
  204. </view>
  205. <view>
  206. <text class="label">挑战失败:</text>
  207. <text class="spec">
  208. {{ userServerInfo.challenge_result.data.challenge_fail || 0 }}
  209. </text>
  210. <text class="label">场</text>
  211. </view>
  212. </view>
  213. <view class="challenge-num-item">
  214. <view>
  215. <text class="label">猜赢了:</text>
  216. <text class="spec">
  217. {{ userServerInfo.challenge_result.data.guessing_success || 0 }}
  218. </text>
  219. <text class="label">场</text>
  220. </view>
  221. <view>
  222. <text class="label">猜输了:</text>
  223. <text class="spec">
  224. {{ userServerInfo.challenge_result.data.guessing_fail || 0 }}
  225. </text>
  226. <text class="label">场</text>
  227. </view>
  228. </view>
  229. </view>
  230. </view>
  231. <view class="challenge-num-btn" @click="toTiaoZhan">查看详情</view>
  232. </view>
  233. </page-toast>
  234. <!-- 发起挑战 -->
  235. <page-toast :is-show="userServerInfo.cha_nickname" :is-close="false">
  236. <view class="challenge-invite">
  237. <view class="challenge-user">
  238. <view class="user-avatar"></view>
  239. </view>
  240. <view class="challenge-title">
  241. “{{ userServerInfo.cha_nickname | getName }}”向你发起学分挑战 详情可在“我的挑战”列表中查看
  242. </view>
  243. <view class="challenage-btn" @click="toChallenge('0')">查看详情</view>
  244. </view>
  245. </page-toast>
  246. <!-- 课程提醒 -->
  247. <page-toast :is-show="userServerInfo.link && showLink" :before-close="closeCourseLink">
  248. <scroll-view class="courseDialog" scroll-y="true">
  249. <image :src="userServerInfo.link" mode="widthFix" class="courseImg" @click="toCourseList" />
  250. </scroll-view>
  251. </page-toast>
  252. <!-- 跳转争霸赛New -->
  253. <uni-popup ref="popup" type="center">
  254. <view class="new_pop">
  255. <view class="new_title">温馨提示</view>
  256. <view class="new_content">即将跳转新的小程序</view>
  257. <view class="new_btns">
  258. <!-- <view @click="hint">取消</view> -->
  259. <view @click.stop="goNew()">继续前往</view>
  260. </view>
  261. </view>
  262. </uni-popup>
  263. </view>
  264. </view>
  265. </template>
  266. <script>
  267. import telVerify from '../../components/tel-verify.vue'
  268. import customWarn from '../../components/custom-warn.vue'
  269. import {
  270. toast_sure,
  271. index_message,
  272. course_confim,
  273. api_onLaunch,
  274. GetSetingTime
  275. } from '../../api.js'
  276. import {
  277. setInterval,
  278. clearInterval
  279. } from 'timers'
  280. import PrivacyPopup from "../../components/privacyPopup.vue";
  281. export default {
  282. onShareAppMessage() { //分享荣誉证书
  283. uni.showLoading({
  284. title: '加载中',
  285. mask: true
  286. }) //显示loading
  287. return { //如果点击右上角分享按钮,则分享页面为小程序主页
  288. title: '大卫博士学位争霸赛',
  289. path: '/pages/index/index'
  290. }
  291. },
  292. onPullDownRefresh() {
  293. if (this.showPrivacy) {
  294. return
  295. }
  296. this.routing = false
  297. // if ('none'.indexOf(this.networkType) == -1) { //有网络连接时才进行下一步
  298. if (this.showGetUserInfoButton == false) {
  299. this.$store.dispatch('newLogin').then(() => {
  300. this.init()
  301. })
  302. }
  303. // } else {
  304. // uni.showToast({
  305. // title: '似乎已经断开网络连接',
  306. // icon: 'none'
  307. // })
  308. // }
  309. },
  310. components: {
  311. telVerify,
  312. customWarn,
  313. PrivacyPopup
  314. },
  315. filters: {
  316. getName(name) {
  317. if (name) {
  318. return name.length > 6 ? name.slice(0, 6) + '...' : name
  319. }
  320. return ''
  321. }
  322. },
  323. data() {
  324. return {
  325. timer: null,
  326. now: null,
  327. canIUseProfile: false,
  328. isXuefenToast: true,
  329. isXuebaToast: true,
  330. filterUserScore: 20,
  331. isTiaoXhanToast: true,
  332. messageList: [],
  333. timerStatus: null,
  334. countA: [5, 4, 3, 2, 1, 0],
  335. countB: [9, 8, 7, 6, 5, 4, 3, 2, 1, 0],
  336. showLink: true,
  337. code: '',
  338. showPrivacy: false, //是否展示隐私弹窗
  339. userId: '' //用户id 用于跳转新的小程序免登录
  340. }
  341. },
  342. computed: {
  343. // showVerify () { //是否弹出手机验证框
  344. // return this.$store.state.showVerify
  345. // },
  346. // showPrivacy() { //隐私协议弹窗
  347. // return this.$store.state.showPrivacy
  348. // },
  349. showphonelabel() {
  350. // console.log('index里的按钮',this.$store.state.showphoneBtn)
  351. return this.$store.state.showphoneBtn
  352. },
  353. showWarn() {
  354. return this.$store.state.showWarn
  355. },
  356. userWeixinInfo() { //用户微信信息
  357. return this.$store.state.userWeixinInfo
  358. },
  359. userServerInfo() { //用户服务器信息
  360. if (this.$store.state.userServerInfo.report_card && this.$store.state.userServerInfo.report_card.status ===
  361. 1) {
  362. let _this = this
  363. uni.showModal({
  364. content: '查看成绩单',
  365. success: function (res) {
  366. let id = _this.$store.state.userServerInfo.report_card.id
  367. if (res.confirm) {
  368. _this.$ajax.get(`${toast_sure}?id=${id}`).then(([, {
  369. data: res
  370. }]) => {
  371. uni.navigateTo({
  372. url: '../schoolReport/index'
  373. })
  374. })
  375. } else if (res.cancel) {
  376. }
  377. }
  378. })
  379. }
  380. return this.$store.state.userServerInfo
  381. },
  382. // networkType() { //网络类型
  383. // return this.$store.state.networkType
  384. // // return 'not'
  385. // },
  386. showGetUserInfoButton() { //是否显示获取用户信息的透明按钮
  387. // console.log('授权按钮',this.$store.state.showGetUserInfoButton)
  388. return this.$store.state.showGetUserInfoButton
  389. },
  390. userStatus() { //根据赛季阶段和用户类型,显示不同可操作项
  391. if (this.$verified()) { //如果用户已经登录,进行下一步判断
  392. if (this.userServerInfo.status) { //如果赛季已经开赛
  393. if (this.userServerInfo.status === 1) { //如果赛季正处于报名阶段
  394. if (this.userServerInfo.signuped) { //如果用户已报名
  395. return '已报名'
  396. } else { //如果用户未报名,那么可能是 1 用户真没报名 2 批发商 3 客服
  397. if (this.userServerInfo.type === 1) {
  398. return '报名参赛'
  399. } else if (this.userServerInfo.type === 2) {
  400. return '报名参赛'
  401. } else if (this.userServerInfo.type === 3) {
  402. return ''
  403. }
  404. }
  405. } else if (this.userServerInfo.status === 2 || this.userServerInfo.status === 3 || this
  406. .userServerInfo.status === 5) { //如果赛季正处于比赛或兑奖阶段
  407. if (this.userServerInfo.signuped) { //如果用户已报名
  408. return '学分账单'
  409. } else { //如果用户未报名,那么可能是 1 用户真没报名 2 批发商 3 客服
  410. if (this.userServerInfo.type === 1) {
  411. return '报名截止'
  412. } else if (this.userServerInfo.type === 2) {
  413. return '学分账单'
  414. } else if (this.userServerInfo.type === 3) {
  415. return ''
  416. }
  417. }
  418. } else if (this.userServerInfo.status === 4) { // 如果赛季正处于报名结束的空档期
  419. if (this.userServerInfo.signuped) { //如果用户已报名
  420. return '已报名'
  421. } else { //如果用户未报名,那么可能是 1 用户真没报名 2 批发商 3 客服
  422. if (this.userServerInfo.type === 1) {
  423. return '报名截止'
  424. } else if (this.userServerInfo.type === 2) {
  425. return '学分账单'
  426. } else if (this.userServerInfo.type === 3) {
  427. return ''
  428. }
  429. }
  430. }
  431. } else { //如果赛季暂未开赛
  432. return '暂未开赛'
  433. }
  434. } else { //如果用户未登录
  435. return '绑定账号'
  436. }
  437. },
  438. countDown() {
  439. let time = this.timerStatus ? this.userServerInfo.end_time : this.userServerInfo.start_time
  440. const sec = Math.floor((time - this.now) / 1000)
  441. let day = Math.floor(sec / 86400)
  442. let hour = Math.floor((sec % 86400) / 3600)
  443. let minite = Math.floor((sec - 86400 * day - hour * 3600) / 60)
  444. let second = Math.floor(sec - 86400 * day - hour * 3600 - minite * 60)
  445. day = day >= 10 ? day : `0${day}`
  446. hour = hour >= 10 ? hour : `0${hour}`
  447. minite = minite >= 10 ? minite : `0${minite}`
  448. second = String(second)
  449. let arr = [day, hour, minite, second >= 10 ? second[0] : 0, second >= 10 ? second[1] : second]
  450. return arr
  451. }
  452. },
  453. created() { //加载完成后开启监听全局 MESSAGE 事件
  454. uni.$on('MESSAGE', (m, d, p) => { //m 要提示的文字信息 d 文字信息出现的时常 p 文字信息出现的位置
  455. this.$refs.toast.hover(m, d, p)
  456. })
  457. uni.$on('HIDEMESSAGE', () => { // 隐藏 文字提示
  458. this.$refs.toast.hide()
  459. })
  460. // console.log('初始化',this.showphonelabel)
  461. },
  462. onShow() { //每次展示首页时都初始化一次,达到实时更新数据的功能
  463. // 判断是否授权了隐私协议
  464. if (uni.getPrivacySetting) {
  465. uni.getPrivacySetting({
  466. success: res => {
  467. //console.log("是否需要授权:", res.needAuthorization, "隐私协议的名称为:", res.privacyContractName)
  468. if (res.needAuthorization) {
  469. //显示隐私协议弹窗
  470. this.showPrivacy = true
  471. } else {
  472. //隐藏隐私协议弹窗并获取用户信息
  473. this.showPrivacy = false
  474. let that = this
  475. // console.log(1111111,uni.getStorageSync('play'))
  476. // if ('none'.indexOf(that.networkType) == -1) { //有网络连接时才进行下一步
  477. this.GetSetingTimeInfo()
  478. this.$store.dispatch('newLogin').then(() => {
  479. this.routing = false
  480. this.init()
  481. })
  482. if (uni.fromUpload) {
  483. uni.fromUpload = false
  484. if (uni.toRank) {
  485. uni.toRank = false
  486. uni.navigateTo({
  487. url: '../ranking/ranking'
  488. })
  489. }
  490. }
  491. // } else {
  492. // uni.showToast({
  493. // title: '似乎已经断开网络连接',
  494. // icon: 'none'
  495. // })
  496. // }
  497. }
  498. },
  499. fail: () => { },
  500. complete: () => { },
  501. })
  502. }
  503. },
  504. methods: {
  505. //修改昵称头像
  506. changeName() {
  507. if (this.$verified()) { //用户是否已登录
  508. if (this.userServerInfo.type === 1 || this.userServerInfo.type === 2) { //只有普通客户和批发商个人主页
  509. if (this.routing) {
  510. return
  511. }
  512. this.routing = true
  513. uni.navigateTo({
  514. url: '../information/information?from=' + 1
  515. })
  516. }
  517. } else { //未登录弹出登录框
  518. console.log('111')
  519. // this.$store.commit('SHOWVERIFY')
  520. // uni.navigateTo({ url: '../boundPhone/boundPhone' })
  521. }
  522. },
  523. //跳转小程序取消按钮提示语
  524. hint() {
  525. uni.showToast({
  526. title: '请前往新的小程序',
  527. icon: 'none'
  528. })
  529. },
  530. //继续前往按钮
  531. goNew() {
  532. this.userId = this.userServerInfo.id
  533. wx.navigateToMiniProgram({
  534. appId: 'wxa9d1325fd98f5a7d',
  535. path: 'pages/index/index',
  536. //develop开发版;trial体验版;release正式版
  537. envVersion: 'release',
  538. extraData: { // 传递的参数,可选
  539. HeaderID:this.userId,
  540. },
  541. success: res => {
  542. // 打开成功
  543. console.log("跳转小程序成功!", res);
  544. },
  545. fail: err => {
  546. uni.showToast({
  547. title: '跳转失败',
  548. icon: 'none'
  549. })
  550. }
  551. })
  552. },
  553. //打开隐私协议
  554. openPrivacyContract() {
  555. wx.openPrivacyContract({
  556. success: res => {
  557. console.log('openPrivacyContract success')
  558. },
  559. fail: res => {
  560. console.error('openPrivacyContract fail', res)
  561. }
  562. })
  563. },
  564. //同意并继续按钮
  565. handleAgreePrivacyAuthorization() {
  566. this.showPrivacy = false
  567. let that = this;
  568. // if ('none'.indexOf(that.networkType) == -1) { //有网络连接时才进行下一步
  569. this.GetSetingTimeInfo()
  570. this.$store.dispatch('newLogin').then(() => {
  571. this.routing = false
  572. this.init()
  573. })
  574. if (uni.fromUpload) {
  575. uni.fromUpload = false
  576. if (uni.toRank) {
  577. uni.toRank = false
  578. uni.navigateTo({
  579. url: '../ranking/ranking'
  580. })
  581. }
  582. }
  583. // } else {
  584. // uni.showToast({
  585. // title: '似乎已经断开网络连接',
  586. // icon: 'none'
  587. // })
  588. // }
  589. },
  590. goshowphone() {
  591. uni.showModal({
  592. title: '提示',
  593. showCancel: false,
  594. content: '请使用代理商系统的账号密码登录',
  595. success: function (res) {
  596. if (res.confirm) {
  597. uni.navigateTo({
  598. url: '../boundPhone/boundPhone'
  599. })
  600. }
  601. }
  602. });
  603. // uni.navigateTo({ url: '../boundPhone/boundPhone' })
  604. },
  605. // 系统升级
  606. GetSetingTimeInfo() {
  607. let that = this
  608. this.$ajax.get(`${GetSetingTime}`).then(([, {
  609. data: res
  610. }]) => {
  611. if (res.code == 200) {
  612. if (res.data.status == 1) {
  613. var start_time = res.data.start_time
  614. var end_time = res.data.end_time
  615. var tmp = (Date.parse(new Date()).toString()).substr(0, 10)
  616. if (tmp >= start_time && tmp <= end_time) {
  617. uni.redirectTo({
  618. url: './upgrade?end_time=' + end_time
  619. })
  620. }
  621. }
  622. this.routing = false
  623. } else {
  624. this.routing = false
  625. uni.showModal({
  626. content: res.message,
  627. showCancel: false
  628. })
  629. }
  630. }).catch(() => {
  631. this.routing = false
  632. })
  633. },
  634. gotoyan() {
  635. // uni.navigateTo({ url: '../makeApply/makeApply' })
  636. uni.redirectTo({
  637. url: './upgrade'
  638. })
  639. },
  640. closeCourseLink() {
  641. this.$ajax.get(`${course_confim}`).then(([, {
  642. data: res
  643. }]) => {
  644. this.showLink = false
  645. })
  646. },
  647. toCourseList() {
  648. this.$ajax.get(`${course_confim}`).then(([, {
  649. data: res
  650. }]) => {
  651. if (res.code === 200) {
  652. let {
  653. end_time,
  654. start_time
  655. } = this.userServerInfo
  656. let week = Math.ceil((end_time - start_time) / (7 * 24 * 60 * 60 * 1000))
  657. uni.navigateTo({
  658. url: '../course/list?week=' + week
  659. })
  660. } else {
  661. uni.showModal({
  662. content: '课程确认失败',
  663. showCancel: false
  664. })
  665. }
  666. })
  667. },
  668. changeCountTime() {
  669. this.now = Date.now()
  670. },
  671. init() {
  672. //跳转到争霸赛New
  673. this.$refs.popup.open('center')
  674. return
  675. let _this = this
  676. _this.now = Date.now()
  677. if (_this.userServerInfo.start_time && _this.userServerInfo.end_time) {
  678. let {
  679. start_time,
  680. end_time
  681. } = _this.userServerInfo
  682. if (_this.now > start_time - 5 * 24 * 3600 * 1000 && _this.now < start_time) {
  683. _this.timerStatus = false
  684. _this.timer = true
  685. // _this.timer = setInterval(() => {
  686. // _this.now = Date.now()
  687. // }, 1000 * 60)
  688. } else if (_this.now > start_time && _this.now < end_time) {
  689. _this.timerStatus = true
  690. _this.timer = true
  691. // _this.timer = setInterval(() => {
  692. // _this.now = Date.now()
  693. // }, 1000 * 1)
  694. // 活动期间 获取滚动卖货消息
  695. _this.index_message()
  696. } else {
  697. if (this.timer) {
  698. // clearInterval(_this.timer)
  699. _this.timer = null;
  700. }
  701. }
  702. } else {
  703. if (this.timer) {
  704. // clearInterval(_this.timer)
  705. _this.timer = null;
  706. }
  707. }
  708. uni.stopPullDownRefresh()
  709. },
  710. changeMessageSwiper({
  711. detail
  712. }) {
  713. let current = detail.current;
  714. if (current >= this.messageList.length) {
  715. this.index_message();
  716. }
  717. },
  718. // 获取滚动消息
  719. index_message() {
  720. this.$ajax.get(`${index_message}`).then(([, {
  721. data: res
  722. }]) => {
  723. if (res.code === 200) {
  724. this.messageList = res.data.list
  725. }
  726. })
  727. },
  728. resetTiaoZhanToast() {
  729. this.isTiaoXhanToast = false
  730. },
  731. toTiaoZhan() {
  732. let toast_id = this.userServerInfo.challenge_result.id
  733. let _this = this
  734. this.$ajax.get(`${toast_sure}?id=${toast_id}`).then(([, {
  735. data: res
  736. }]) => {
  737. _this.isTiaoXhanToast = false
  738. _this.toChallenge()
  739. })
  740. },
  741. // 其他
  742. toOther() {
  743. uni.redirectTo({
  744. url: "../other/other"
  745. })
  746. },
  747. // 荣誉殿堂
  748. toHonor() {
  749. uni.navigateTo({
  750. url: '../honorList/index'
  751. })
  752. },
  753. // 学霸弹窗
  754. toToastXueBa() {
  755. let toast_id = this.userServerInfo.max_popovers.id
  756. let _this = this
  757. this.$ajax.get(`${toast_sure}?id=${toast_id}`).then(([, {
  758. data: res
  759. }]) => {
  760. _this.isXuebaToast = false
  761. _this.toChallenge()
  762. })
  763. },
  764. toToastDetail() {
  765. let toast_id = this.userServerInfo.glory_popovers.id
  766. let _this = this
  767. this.$ajax.get(`${toast_sure}?id=${toast_id}`).then(([, {
  768. data: res
  769. }]) => {
  770. _this.isXuefenToast = false
  771. _this.tohonour()
  772. })
  773. },
  774. getuserinfo() { //获取用户信息
  775. this.$store.commit('HIDEGETUSERINFOBUTTON') //隐藏透明按钮
  776. let _this = this
  777. this.$store.dispatch('getUserInfo').then(() => {
  778. _this.init()
  779. })
  780. },
  781. toself() { //点击用户信息
  782. if (this.$verified()) { //用户是否已登录
  783. if (this.userServerInfo.type === 1 || this.userServerInfo.type === 2) { //只有普通客户和批发商个人主页
  784. if (this.routing) {
  785. return
  786. }
  787. this.routing = true
  788. uni.navigateTo({
  789. url: `../self/self?from=index&id=${this.userServerInfo.id}`
  790. }) //已登录跳转到用户中心
  791. }
  792. } else { //未登录弹出登录框
  793. console.log('111')
  794. // this.$store.commit('SHOWVERIFY')
  795. // uni.navigateTo({ url: '../boundPhone/boundPhone' })
  796. }
  797. },
  798. tapUserStatus() { //点击用户状态
  799. if (this.userStatus === '绑定账号') {
  800. // this.$store.commit('SHOWVERIFY')
  801. // uni.navigateTo({ url: '../boundPhone/boundPhone' })
  802. } else if (this.userStatus === '报名参赛') {
  803. if (this.routing) {
  804. return
  805. }
  806. this.routing = true
  807. uni.navigateTo({
  808. url: '../signup/signup'
  809. })
  810. } else if (this.userStatus === '学分账单') {
  811. if (this.routing) {
  812. return
  813. }
  814. this.routing = true
  815. uni.navigateTo({
  816. url: '../score/score'
  817. })
  818. } else if (this.userStatus === '报名截止') {
  819. this.$refs.toast.hover('报名时间已过,非常感谢您的关注。')
  820. } else if (this.userStatus === '暂未开赛') {
  821. this.$refs.toast.hover('暂未开赛,非常感谢您的关注。')
  822. } else if (this.userStatus === '已报名') {
  823. uni.navigateTo({
  824. url: "../certificate/notice"
  825. })
  826. }
  827. },
  828. toranking() { //点击排行榜
  829. // uni.navigateTo({ url: '../ranking/ranking' })
  830. if (this.$verified()) { //用户是否已登录
  831. if (this.userServerInfo.type === 1) { //判断用户类型,普通用户需要报名后才可以查看排行榜
  832. if (this.userServerInfo.signuped) { //如果用户已报名,就跳转
  833. if (this.routing) {
  834. return
  835. }
  836. this.routing = true
  837. uni.navigateTo({
  838. url: '../ranking/ranking'
  839. })
  840. } else { ////如果用户已报名,就提示用户没有报名
  841. uni.showModal({
  842. content: "您还没有报名参赛",
  843. showCancel: false
  844. })
  845. }
  846. } else { //批发商和客服可以直接查看排行榜页
  847. if (this.routing) {
  848. return
  849. }
  850. this.routing = true
  851. uni.navigateTo({
  852. url: '../ranking/ranking'
  853. })
  854. }
  855. } else { //未登录弹出登录框
  856. // this.$store.commit('SHOWVERIFY')
  857. // uni.navigateTo({ url: '../boundPhone/boundPhone' })
  858. }
  859. },
  860. toupload() { //点击上传图片
  861. let now = Date.now()
  862. let {
  863. end_time,
  864. start_time
  865. } = this.userServerInfo
  866. let week
  867. if (now > end_time) {
  868. week = 3
  869. } else if (now < start_time) {
  870. week = 0
  871. } else {
  872. week = Math.ceil((now - start_time) / (7 * 24 * 60 * 60 * 1000))
  873. }
  874. uni.navigateTo({
  875. url: '../course/list?week=' + week
  876. })
  877. // this.$refs.toast.hover('本季争霸赛不允许使用')
  878. // if (this.$verified()) { //用户是否已登录
  879. // if (this.userServerInfo.signuped) {
  880. // if (this.userServerInfo.status === 1 || this.userServerInfo.status === 4) {
  881. // this.$refs.toast.hover('比赛还没有开始')
  882. // } else if (this.userServerInfo.status === 2) {
  883. // if (this.routing) { return }
  884. // this.routing = true
  885. // uni.navigateTo({ url: '../upload/upload' })
  886. // uni.fromUpload = true
  887. // } else if (this.userServerInfo.status === 3 || this.userServerInfo.status === 5) {
  888. // this.$refs.toast.hover('比赛已经结束了')
  889. // }
  890. // } else {
  891. // this.$refs.toast.hover('您还没有报名参赛')
  892. // }
  893. // } else { //未登录弹出登录框
  894. // // this.$store.commit('SHOWVERIFY')
  895. // uni.navigateTo({ url: '../boundPhone/boundPhone' })
  896. // }
  897. },
  898. toChallenge(active) { // 点击学分挑战
  899. uni.navigateTo({
  900. url: '../challengeList/challengeList' + (active ? `?active=${active}` : '')
  901. })
  902. // uni.navigateTo({ url: '../challengeList/challengeList'+(active ? `?active=${active}` : '') })
  903. // return false
  904. if (this.$verified()) { //用户是否已登录
  905. if (this.userServerInfo.signuped) { // 用户是否已经报名
  906. if (this.userServerInfo.level_name === '批发商' || this.userServerInfo.level_name ===
  907. '经销商') { // 只有批发商能够参加学分竞赛
  908. if (this.routing) {
  909. return
  910. }
  911. this.routing = true
  912. this.closeChallenge()
  913. uni.navigateTo({
  914. url: '../challengeList/challengeList' + (active ? `?active=${active}` : '')
  915. })
  916. } else { //批发商和客服不可参赛,所以提示无参赛记录
  917. //隐藏等级
  918. // this.$refs.toast.hover('只有批发商可以参与挑战')
  919. this.$refs.toast.hover('暂无参与挑战权限')
  920. }
  921. } else {
  922. this.$refs.toast.hover('您还没有报名参赛')
  923. }
  924. } else { //未登录弹出登录框
  925. // this.$store.commit('SHOWVERIFY')
  926. // uni.navigateTo({ url: '../boundPhone/boundPhone' })
  927. }
  928. },
  929. torules() { //点击赛季规则
  930. if (this.routing) {
  931. return
  932. }
  933. this.routing = true
  934. uni.navigateTo({
  935. url: '../rules/rules'
  936. })
  937. },
  938. // 长按赛季规则跳转
  939. toLongTapIndex() {
  940. uni.navigateTo({
  941. url: '../longTapIndex/longTapIndex'
  942. })
  943. },
  944. closeChallenge() {
  945. this.$store.commit('READCHALLENGE')
  946. }
  947. }
  948. }
  949. </script>
  950. <style lang="scss" scoped>
  951. .new_pop {
  952. width: 648rpx;
  953. height: 368rpx;
  954. background: #FFFFFF;
  955. border-radius: 24rpx;
  956. margin: 0 auto;
  957. text-align: center;
  958. padding-top: 60rpx;
  959. z-index: 999999;
  960. .new_title {
  961. font-size: 38rpx;
  962. font-weight: bold;
  963. color: #000;
  964. }
  965. .new_content {
  966. font-size: 34rpx;
  967. color: #333;
  968. margin: 24rpx 0 40rpx 0;
  969. }
  970. .new_btns {
  971. display: flex;
  972. justify-content: space-around;
  973. align-items: center;
  974. view {
  975. width: 260rpx;
  976. height: 88rpx;
  977. line-height: 88rpx;
  978. background: #F5F5F5;
  979. border-radius: 44rpx;
  980. color: #333;
  981. font-size: 32rpx;
  982. font-weight: bold;
  983. }
  984. view:last-child {
  985. background: linear-gradient(93deg, #F30000 0%, #FE4815 100%);
  986. color: #fff;
  987. }
  988. }
  989. }
  990. .home {
  991. width: 100vw;
  992. height: 100vh;
  993. position: relative;
  994. .pop {
  995. width: 100%;
  996. height: 100%;
  997. position: fixed;
  998. top: 0;
  999. bottom: 0;
  1000. z-index: 999;
  1001. background-color: rgba(0, 0, 0, 0.3);
  1002. .pop_con {
  1003. width: 100%;
  1004. height: 40vh;
  1005. background: #fff;
  1006. border-top-left-radius: 26rpx;
  1007. border-top-top-radius: 26rpx;
  1008. position: fixed;
  1009. left: 0;
  1010. bottom: 0;
  1011. padding: 0 30rpx;
  1012. box-sizing: border-box;
  1013. z-index: 9999;
  1014. .title {
  1015. font-size: 36rpx;
  1016. font-weight: bold;
  1017. margin: 24rpx 0;
  1018. }
  1019. .desc {
  1020. font-size: 30rpx;
  1021. color: 999;
  1022. .file {
  1023. color: #FB231F;
  1024. margin: 24rpx 0;
  1025. font-size: 32rpx;
  1026. }
  1027. }
  1028. .btn_box {
  1029. margin-top: 40rpx;
  1030. display: flex;
  1031. justify-content: space-around;
  1032. align-items: center;
  1033. .exit_btn {
  1034. display: flex;
  1035. justify-content: center;
  1036. align-items: center;
  1037. width: 300rpx;
  1038. height: 88rpx;
  1039. background: #E9E9E9;
  1040. border-radius: 44rpx;
  1041. font-size: 32rpx;
  1042. color: #333;
  1043. }
  1044. button {
  1045. display: flex;
  1046. justify-content: center;
  1047. align-items: center;
  1048. width: 300rpx;
  1049. height: 88rpx;
  1050. background: #FB231F;
  1051. border-radius: 44rpx;
  1052. font-size: 32rpx;
  1053. color: #fff;
  1054. background: linear-gradient(93deg, #F30000 0%, #FE4815 100%);
  1055. }
  1056. }
  1057. }
  1058. }
  1059. }
  1060. .privacy-popup {
  1061. position: absolute;
  1062. top: 0;
  1063. left: 0;
  1064. }
  1065. .challenge-num {
  1066. display: flex;
  1067. flex-direction: column;
  1068. align-items: center;
  1069. .challenage-num-top {
  1070. width: 626rpx;
  1071. height: 612rpx;
  1072. background: url(http://picture.liuliwa.top/new_challenge_toast/7.png) center no-repeat;
  1073. background-size: 100%;
  1074. margin: 0 auto 94rpx auto;
  1075. position: relative;
  1076. .challenage-num-body {
  1077. width: 570rpx;
  1078. height: 385rpx;
  1079. position: absolute;
  1080. bottom: 28rpx;
  1081. left: 28rpx;
  1082. border-radius: 24rpx;
  1083. padding: 84rpx 30rpx 44rpx 30rpx;
  1084. display: flex;
  1085. justify-content: space-between;
  1086. flex-direction: column;
  1087. .challenge-num-item {
  1088. display: flex;
  1089. align-items: center;
  1090. justify-content: space-between;
  1091. .label {
  1092. color: #5D330D;
  1093. font-size: 32rpx;
  1094. margin-right: 10rpx;
  1095. }
  1096. .spec {
  1097. color: #DD372D;
  1098. font-size: 48rpx;
  1099. }
  1100. }
  1101. }
  1102. }
  1103. .challenge-num-btn {
  1104. width: 502rpx;
  1105. height: 96rpx;
  1106. border-radius: 96rpx;
  1107. background: linear-gradient(180deg, #FEEB71 0%, #F89018 100%);
  1108. color: #984100;
  1109. font-size: 32rpx;
  1110. font-weight: bold;
  1111. line-height: 96rpx;
  1112. text-align: center;
  1113. }
  1114. }
  1115. .challenge-invite {
  1116. display: flex;
  1117. flex-direction: column;
  1118. align-items: center;
  1119. .challenge-user {
  1120. width: 426rpx;
  1121. height: 334rpx;
  1122. margin: 0 auto 48rpx auto;
  1123. background: url(http://picture.liuliwa.top/new_challenge_toast/5.png) center no-repeat;
  1124. background-size: 100%;
  1125. position: relative;
  1126. .user-avatar {
  1127. width: 168rpx;
  1128. height: 168rpx;
  1129. border-radius: 50%;
  1130. position: absolute;
  1131. bottom: 8rpx;
  1132. left: 50%;
  1133. transform: translateX(-50%);
  1134. background-position: center;
  1135. background-repeat: no-repeat;
  1136. background-size: 100%;
  1137. background-color: #007AFF;
  1138. }
  1139. }
  1140. .challenge-title {
  1141. width: 456rpx;
  1142. color: #FFF1AD;
  1143. font-size: 32rpx;
  1144. line-height: 50rpx;
  1145. margin-bottom: 86rpx;
  1146. font-weight: bold;
  1147. }
  1148. .challenage-btn {
  1149. width: 502rpx;
  1150. height: 96rpx;
  1151. border-radius: 96rpx;
  1152. background: linear-gradient(180deg, #FEEB71 0%, #F89018 100%);
  1153. color: #984100;
  1154. font-size: 32rpx;
  1155. font-weight: bold;
  1156. line-height: 96rpx;
  1157. text-align: center;
  1158. }
  1159. }
  1160. .index {
  1161. width: 100%;
  1162. height: 100vh;
  1163. position: relative;
  1164. box-sizing: border-box;
  1165. padding: 161rpx 30rpx 0;
  1166. display: flex;
  1167. flex-direction: column;
  1168. .index_countdown {
  1169. width: 100%;
  1170. height: 140rpx;
  1171. background-image: linear-gradient(#4CBA59, #6BE57D);
  1172. color: #FFFFFF;
  1173. border-radius: 6rpx;
  1174. margin-top: 10rpx;
  1175. line-height: 60rpx;
  1176. text-align: center;
  1177. letter-spacing: 4rpx;
  1178. display: flex;
  1179. align-items: center;
  1180. justify-content: center;
  1181. font-size: 36rpx;
  1182. .bg1 {
  1183. background-color: #FD715D;
  1184. }
  1185. .bg2 {
  1186. background-color: #3397DB;
  1187. }
  1188. .bg3 {
  1189. background-color: #F39B11;
  1190. }
  1191. .bg4 {
  1192. // background-color: #B933FF;
  1193. }
  1194. .animate_second {
  1195. display: flex !important;
  1196. justify-content: space-between;
  1197. align-items: center;
  1198. .animate_item {
  1199. flex: 1;
  1200. height: 70rpx;
  1201. &:nth-of-type(1) {
  1202. background-color: #e3abff;
  1203. }
  1204. &:nth-last-of-type(1) {
  1205. background-color: #B933FF;
  1206. }
  1207. text-align: center;
  1208. }
  1209. }
  1210. .spec {
  1211. display: block;
  1212. text-align: center;
  1213. line-height: 70rpx;
  1214. color: #FFFFFF;
  1215. width: 70rpx;
  1216. height: 70rpx;
  1217. border-radius: 10rpx;
  1218. overflow: hidden;
  1219. }
  1220. .small {
  1221. font-size: 24rpx;
  1222. margin: 0 8rpx;
  1223. margin-top: 40rpx;
  1224. }
  1225. }
  1226. .xuefen_toast {
  1227. width: 600rpx;
  1228. height: 760rpx;
  1229. .text {
  1230. position: absolute;
  1231. width: 430rpx;
  1232. bottom: 217rpx;
  1233. left: 50%;
  1234. margin-left: -215rpx;
  1235. display: flex;
  1236. justify-content: flex-start;
  1237. flex-wrap: wrap;
  1238. font-size: 28rpx;
  1239. color: #333333;
  1240. view {
  1241. width: calc(50% - 10rpx);
  1242. margin-bottom: 20rpx;
  1243. display: flex;
  1244. justify-content: space-between;
  1245. align-items: center;
  1246. &:nth-last-child(1),
  1247. &:nth-last-child(2) {
  1248. margin-bottom: 0;
  1249. }
  1250. &:nth-child(2n) {
  1251. text-align: right;
  1252. margin-left: 20rpx;
  1253. }
  1254. }
  1255. }
  1256. }
  1257. .yingzhan_toast {
  1258. width: 574rpx;
  1259. height: 596rpx;
  1260. .text {
  1261. left: 0;
  1262. width: 100%;
  1263. color: #F76454;
  1264. font-size: 36rpx;
  1265. position: absolute;
  1266. text-align: center;
  1267. top: 120rpx;
  1268. }
  1269. }
  1270. .xiazhu_toast {
  1271. width: 563rpx;
  1272. height: 653rpx;
  1273. .text {
  1274. color: #712722;
  1275. font-size: 28rpx;
  1276. width: 402rpx;
  1277. position: absolute;
  1278. bottom: 188rpx;
  1279. left: 50%;
  1280. margin-left: -201rpx;
  1281. text {
  1282. display: block;
  1283. margin-bottom: 20rpx;
  1284. text-align: center;
  1285. &:nth-last-child(1) {
  1286. margin-bottom: 0;
  1287. }
  1288. }
  1289. }
  1290. }
  1291. .tiaozhan_toast {
  1292. width: 520rpx;
  1293. height: 755rpx;
  1294. .text {
  1295. color: #712722;
  1296. font-size: 28rpx;
  1297. width: 390rpx;
  1298. position: absolute;
  1299. bottom: 160rpx;
  1300. left: 50%;
  1301. margin-left: -195rpx;
  1302. line-height: 48rpx;
  1303. text-align: center;
  1304. }
  1305. }
  1306. .xuewei_toast {
  1307. width: 712rpx;
  1308. height: 750rpx;
  1309. .text {
  1310. font-size: 62rpx;
  1311. color: #FFFFFF;
  1312. position: absolute;
  1313. width: 488rpx;
  1314. text-align: center;
  1315. height: 104rpx;
  1316. line-height: 104rpx;
  1317. left: 50%;
  1318. margin-left: -244rpx;
  1319. bottom: 138rpx;
  1320. }
  1321. }
  1322. .xueba_toast {
  1323. width: 662rpx;
  1324. height: 685rpx;
  1325. .text {
  1326. width: 416rpx;
  1327. text-align: center;
  1328. height: 112rpx;
  1329. line-height: 112rpx;
  1330. color: #FFFFFF;
  1331. font-size: 58rpx;
  1332. position: absolute;
  1333. left: 50%;
  1334. margin-left: -208rpx;
  1335. bottom: 226rpx;
  1336. }
  1337. }
  1338. .getUserInfo {
  1339. position: fixed;
  1340. top: 0;
  1341. left: 0;
  1342. right: 0;
  1343. bottom: 0;
  1344. z-index: 9999;
  1345. background: rgba(1, 1, 1, 0);
  1346. }
  1347. .showphonelabel {
  1348. position: fixed;
  1349. top: 0;
  1350. left: 0;
  1351. right: 0;
  1352. bottom: 0;
  1353. z-index: 9999;
  1354. background: rgba(1, 1, 1, 0);
  1355. }
  1356. .header-bg {
  1357. position: absolute;
  1358. z-index: -1;
  1359. top: 0;
  1360. left: 0;
  1361. width: 100%;
  1362. height: 286rpx;
  1363. background: linear-gradient(-2deg, rgba(255, 68, 54, 1) 0%, rgba(254, 132, 72, 1) 100%);
  1364. border-bottom-right-radius: 350rpx 30rpx;
  1365. border-bottom-left-radius: 350rpx 30rpx;
  1366. }
  1367. .title {
  1368. position: absolute;
  1369. top: 70rpx;
  1370. left: 30rpx;
  1371. @include text(34rpx);
  1372. color: #FFFFFF;
  1373. }
  1374. .user_info_new {
  1375. background: linear-gradient(#FFCF82, #FF9C00);
  1376. border-radius: 10rpx;
  1377. .biye_tip {
  1378. height: 64rpx;
  1379. background: rgba(0, 0, 0, .4);
  1380. color: #FFFFFF;
  1381. font-size: 28rpx;
  1382. padding: 0 22rpx;
  1383. box-sizing: border-box;
  1384. width: 100%;
  1385. line-height: 64rpx;
  1386. border-bottom-left-radius: 10rpx;
  1387. border-bottom-right-radius: 10rpx;
  1388. }
  1389. }
  1390. .userinfo {
  1391. position: relative;
  1392. width: 100%;
  1393. height: 225rpx;
  1394. box-shadow: 0rpx 1rpx 3rpx 0rpx rgba(0, 0, 0, 0.2);
  1395. border-radius: 10px;
  1396. box-sizing: border-box;
  1397. padding: 22rpx;
  1398. .top {
  1399. height: 98rpx;
  1400. display: flex;
  1401. align-items: center;
  1402. position: relative;
  1403. .user-pic {
  1404. height: 100%;
  1405. width: 98rpx;
  1406. background-color: #B2B2B2;
  1407. border-radius: 50%;
  1408. overflow: hidden;
  1409. }
  1410. .hat {
  1411. position: absolute;
  1412. top: -40rpx;
  1413. left: 0px;
  1414. width: 80rpx;
  1415. height: 69.873rpx;
  1416. }
  1417. .user-info {
  1418. flex: 1;
  1419. display: flex;
  1420. flex-direction: column;
  1421. justify-content: space-between;
  1422. height: 100%;
  1423. margin-left: 16rpx;
  1424. overflow: hidden;
  1425. .progress {
  1426. font-size: 26rpx;
  1427. color: #FFFFFF;
  1428. }
  1429. .name-grade-level {
  1430. height: 100%;
  1431. width: 100%;
  1432. display: flex;
  1433. align-items: center;
  1434. .name {
  1435. font-size: 32rpx;
  1436. color: #FFFFFF;
  1437. max-width: 38%;
  1438. overflow: hidden;
  1439. white-space: nowrap;
  1440. text-overflow: ellipsis;
  1441. }
  1442. .grade {
  1443. font-size: 26rpx;
  1444. color: rgba(255, 255, 255, 1);
  1445. margin-left: 16rpx;
  1446. vertical-align: baseline;
  1447. }
  1448. .level {
  1449. margin-left: 18rpx;
  1450. height: 30rpx;
  1451. border-radius: 15rpx;
  1452. font-size: 26rpx;
  1453. background: #FFFFFF;
  1454. color: rgba(250, 99, 66, 1);
  1455. text {
  1456. float: right;
  1457. line-height: 35rpx;
  1458. margin: 0 12rpx;
  1459. }
  1460. image {
  1461. width: 30rpx;
  1462. height: 30rpx;
  1463. float: left;
  1464. }
  1465. }
  1466. }
  1467. }
  1468. }
  1469. .user-status {
  1470. position: absolute;
  1471. width: 170rpx;
  1472. height: 60rpx;
  1473. top: 111rpx;
  1474. right: 0;
  1475. line-height: 62rpx;
  1476. background: #FFFFFF;
  1477. text-align: center;
  1478. border-radius: 30rpx 0 0 30rpx;
  1479. font-size: 32rpx;
  1480. color: rgba(250, 99, 66, 1);
  1481. &.end {
  1482. background: #999999;
  1483. color: #FFFFFF;
  1484. }
  1485. }
  1486. .countdown {
  1487. position: absolute;
  1488. right: 12rpx;
  1489. top: 171rpx;
  1490. display: flex;
  1491. color: #FFFFFF;
  1492. }
  1493. .score,
  1494. .rank {
  1495. position: absolute;
  1496. left: 32rpx;
  1497. bottom: 35rpx;
  1498. font-size: 32rpx;
  1499. color: rgba(255, 255, 255, 1);
  1500. &.rank {
  1501. left: 294rpx;
  1502. }
  1503. }
  1504. }
  1505. .entrance {
  1506. flex: 1;
  1507. z-index: 1;
  1508. margin: 10rpx 0;
  1509. position: relative;
  1510. display: flex;
  1511. justify-content: flex-start;
  1512. flex-wrap: wrap;
  1513. .nav_container {
  1514. display: flex;
  1515. justify-content: flex-start;
  1516. flex-wrap: wrap;
  1517. }
  1518. .item_bg1 {
  1519. // background-image: url(../../static/new/index_bg1.png);
  1520. background-image: linear-gradient(#79a9fd, #929ef2);
  1521. }
  1522. .item_bg2 {
  1523. // background-image: url(../../static/new/index_bg2.png);
  1524. background-image: linear-gradient(#ff634c, #ff9587);
  1525. }
  1526. .item_bg3 {
  1527. // background-image: url(../../static/new/index_bg3.png);
  1528. background-image: linear-gradient(#fdad29, #ffcf4b);
  1529. }
  1530. .item_bg4 {
  1531. // background-image: url(../../static/new/index_bg4.png);
  1532. background-image: linear-gradient(#d486f9, #b063f8);
  1533. }
  1534. .index-item {
  1535. width: calc(50% - 5rpx);
  1536. position: relative;
  1537. min-height: 285rpx;
  1538. overflow: hidden;
  1539. border-radius: 10px;
  1540. box-shadow: 0rpx 1rpx 3rpx 0rpx rgba(0, 0, 0, 0.2);
  1541. font-size: 30rpx;
  1542. color: #FFFFFF;
  1543. background-size: 100% 100%;
  1544. background-repeat: no-repeat;
  1545. margin-right: 5rpx;
  1546. margin-bottom: 12rpx;
  1547. &:nth-of-type(2n) {
  1548. margin-right: 0;
  1549. margin-left: 5rpx;
  1550. }
  1551. .name {
  1552. z-index: 1;
  1553. top: 38rpx;
  1554. left: 30rpx;
  1555. color: #FFFFFF;
  1556. font-size: 40rpx;
  1557. position: absolute;
  1558. font-weight: 500;
  1559. }
  1560. view {
  1561. position: absolute;
  1562. left: 30rpx;
  1563. top: 87rpx;
  1564. font-size: 24rpx;
  1565. color: #FFFFFF;
  1566. }
  1567. .coverImg {
  1568. position: absolute;
  1569. }
  1570. .cv1 {
  1571. width: 238rpx;
  1572. height: 260rpx;
  1573. right: 30rpx;
  1574. bottom: 0;
  1575. }
  1576. .cv2 {
  1577. width: 200rpx;
  1578. height: 163rpx;
  1579. right: 44rpx;
  1580. bottom: 31rpx;
  1581. }
  1582. .cv3 {
  1583. width: 194rpx;
  1584. height: 180rpx;
  1585. right: 22rpx;
  1586. bottom: 25rpx;
  1587. }
  1588. .cv4 {
  1589. width: 187rpx;
  1590. height: 187rpx;
  1591. right: 53rpx;
  1592. bottom: 31rpx;
  1593. }
  1594. }
  1595. }
  1596. .rules {
  1597. font-size: 24rpx;
  1598. height: 80rpx;
  1599. line-height: 80rpx;
  1600. text-align: center;
  1601. font-weight: bold;
  1602. color: rgba(243, 67, 54, 1);
  1603. text {
  1604. margin-left: 9rpx;
  1605. }
  1606. }
  1607. .swiper_parant {
  1608. display: flex;
  1609. justify-content: space-between;
  1610. align-items: center;
  1611. background-color: #FF9C00;
  1612. border-radius: 10rpx;
  1613. height: 70rpx;
  1614. margin: 5px 0;
  1615. padding: 0 20rpx;
  1616. box-sizing: border-box;
  1617. // &::before{
  1618. // content: "";
  1619. // display: block;
  1620. // width: 30rpx;
  1621. // height: 30rpx;
  1622. // background-image: url(../../static/new/message.png);
  1623. // background-repeat: no-repeat;
  1624. // background-size: 100% 100%;
  1625. // margin-right: 10rpx;
  1626. // }
  1627. .message_icon_box {
  1628. color: #FA6342;
  1629. font-size: 32rpx;
  1630. width: 135rpx;
  1631. height: 54rpx;
  1632. padding: 14rpx 12rpx;
  1633. box-sizing: border-box;
  1634. display: flex;
  1635. align-items: center;
  1636. justify-content: space-between;
  1637. margin-right: 20rpx;
  1638. background-color: #FFFFFF;
  1639. border-radius: 8rpx;
  1640. .message_icon {
  1641. width: 32rpx;
  1642. height: 26rpx;
  1643. margin-right: 10rpx;
  1644. }
  1645. }
  1646. }
  1647. .swiper_message {
  1648. flex: 1;
  1649. height: 60rpx;
  1650. box-sizing: border-box;
  1651. line-height: 60rpx;
  1652. color: #FFFFFF;
  1653. font-size: 28rpx;
  1654. }
  1655. .hadChallenge {
  1656. position: fixed;
  1657. left: 0;
  1658. top: 0;
  1659. width: 100%;
  1660. height: 100%;
  1661. background: rgba(0, 0, 0, 0.3);
  1662. @include flex(column);
  1663. z-index: 2;
  1664. .challenage {
  1665. width: 574rpx;
  1666. height: 596rpx;
  1667. position: relative;
  1668. image {
  1669. width: 100%;
  1670. height: 100%;
  1671. }
  1672. .challengeName {
  1673. left: 0;
  1674. width: 100%;
  1675. top: 128rpx;
  1676. color: #F76454;
  1677. font-size: 36rpx;
  1678. position: absolute;
  1679. text-align: center;
  1680. }
  1681. }
  1682. .closeChallenge {
  1683. width: 62rpx;
  1684. height: 62rpx;
  1685. @include flex();
  1686. font-size: 56rpx;
  1687. margin-top: 30rpx;
  1688. border-radius: 50%;
  1689. background: #FFFFFF;
  1690. }
  1691. }
  1692. }
  1693. .courseDialog {
  1694. width: 80%;
  1695. margin: 0 auto;
  1696. height: 700rpx;
  1697. .courseImg {
  1698. display: block;
  1699. width: 100%;
  1700. }
  1701. }
  1702. </style>