level.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. <template>
  2. <view >
  3. <view style="margin: 20rpx;">
  4. <u-row gutter="16" justify="center">
  5. <u-col span="9">
  6. <view style="vertical-align: middle;display: flex;">
  7. <image :src="userInfo!=null?$method.splitImgHost(userInfo.avatar):''" style="width: 80rpx;height: 80rpx;border-radius: 50%;"></image>
  8. <view class="r_t2">{{userInfo.nickname}}</view>
  9. </view>
  10. </u-col>
  11. <u-col span="3" text-align="right">
  12. <view style="height: 80rpx;display: flex;justify-content: center;flex-direction: column;">
  13. <view class="rule">
  14. <text>查看规则</text>
  15. </view>
  16. </view>
  17. </u-col>
  18. </u-row>
  19. </view>
  20. <view class="sv_box">
  21. <scroll-view class="r_sliper" scroll-x="true" >
  22. <view v-for="(item,index) in list" :key="index" class="sv_item_box item_bac1" :style="'background:'+item.bac">
  23. <view style="display: flex;">
  24. <view class="left_t" >
  25. 当前等级
  26. </view>
  27. <view style="position: relative;">
  28. <view style="width: 280rpx;text-align: center;margin-top: 30rpx;">
  29. <text class="left_t2" :style="'color:'+item.title_color">{{item.name}}</text>
  30. </view>
  31. <image :src="item.img" class="level_flower"></image>
  32. </view>
  33. </view>
  34. <view class="progress_box">
  35. <view class="progress_text">0/1000</view>
  36. <u-line-progress height="8" inactive-color="rgba(47, 67, 121, 0.1)" :active-color="item.title_color" :percent="0" :show-percent="false"></u-line-progress>
  37. <view class="tip">{{item.tip}}</view>
  38. </view>
  39. </view>
  40. </scroll-view>
  41. </view>
  42. <view style="padding: 20rpx;">
  43. <view class="box1">
  44. <u-row >
  45. <u-col span="3">
  46. <view class="menu_p">
  47. <view class="menu_box" @click="jumpmenu(1)">
  48. <image src="/static/level/menu1.png" class="menu_img"></image>
  49. <view class="menu_t">优惠券</view>
  50. </view>
  51. </view>
  52. </u-col>
  53. <u-col span="3">
  54. <view class="menu_p">
  55. <view class="menu_box" @click="jumpmenu(2)">
  56. <image src="/static/level/menu2.png" class="menu_img"></image>
  57. <view class="menu_t">折扣券</view>
  58. </view>
  59. </view>
  60. </u-col>
  61. <u-col span="3">
  62. <view class="menu_p">
  63. <view class="menu_box" @click="jumpmenu(3)">
  64. <image src="/static/level/menu3.png" class="menu_img"></image>
  65. <view class="menu_t">解锁题库</view>
  66. </view>
  67. </view>
  68. </u-col>
  69. <u-col span="3">
  70. <view class="menu_p">
  71. <view class="menu_box" @click="jumpmenu(4)">
  72. <image src="/static/level/menu4.png" class="menu_img"></image>
  73. <view class="menu_t">解锁课程</view>
  74. </view>
  75. </view>
  76. </u-col>
  77. </u-row>
  78. </view>
  79. <view class="box2">
  80. <view >
  81. <u-row >
  82. <u-col >
  83. <view class="box2_title">做任务得经验</view>
  84. </u-col>
  85. </u-row>
  86. <view style="margin-top: 15rpx;">
  87. <u-row >
  88. <u-col span="2">
  89. <image class="box2_img" src="/static/level/qiandao.png"></image>
  90. </u-col>
  91. <u-col span="5">
  92. <view class="box_qd1">
  93. <view style="width: 95rpx;">签到</view>
  94. <text style="margin-left: 20rpx;">经验 +2</text>
  95. </view>
  96. <view class="box_qd" >每日签到</view>
  97. </u-col>
  98. <u-col offset="2" span="3" text-align="right">
  99. <view class="box2_btn" v-if="issue === 0" @click="qd">去完成</view>
  100. <view class="box3_btn" v-if="issue === 1">
  101. 已完成
  102. </view>
  103. </u-col>
  104. </u-row>
  105. </view>
  106. <view style="margin-top: 15rpx;">
  107. <u-row >
  108. <u-col span="2">
  109. <image class="box2_img" src="/static/level/spxuexi.png"></image>
  110. </u-col>
  111. <u-col span="5">
  112. <view class="box_qd1">
  113. <view style="width: 95rpx;">视频学习</view>
  114. <text style="margin-left: 20rpx;">经验 +2</text>
  115. </view>
  116. <view class="box_qd">观看课程视频5分钟</view>
  117. </u-col>
  118. <u-col offset="2" span="3" text-align="right">
  119. <view class="box2_btn" v-if="taskType4 === 0">去完成</view>
  120. <view class="box3_btn" v-if="taskType4 === 1">
  121. 已完成
  122. </view>
  123. </u-col>
  124. </u-row>
  125. </view>
  126. <view style="margin-top: 15rpx;">
  127. <u-row >
  128. <u-col span="2">
  129. <image class="box2_img" src="/static/level/wsziliao.png"></image>
  130. </u-col>
  131. <u-col span="5">
  132. <view class="box_qd1">
  133. <view style="width: 95rpx;">完善资料</view>
  134. <text style="margin-left: 20rpx;">经验 +1</text>
  135. </view>
  136. <view class="box_qd">完善学习档案信息</view>
  137. </u-col>
  138. <u-col offset="2" span="3" text-align="right">
  139. <view class="box2_btn" v-if="taskType1 === 0" @click="jumpZL">去完成</view>
  140. <view class="box3_btn" v-if="taskType1 === 1">
  141. 已完成
  142. </view>
  143. </u-col>
  144. </u-row>
  145. </view>
  146. <view style="margin-top: 15rpx;">
  147. <u-row >
  148. <u-col span="2">
  149. <image class="box2_img" src="/static/level/zffenxiang.png"></image>
  150. </u-col>
  151. <u-col span="5">
  152. <view class="box_qd1">
  153. <view style="width: 95rpx;">转发分享</view>
  154. <text style="margin-left: 20rpx;">经验 +5</text>
  155. </view>
  156. <view class="box_qd">转发分享给好友</view>
  157. </u-col>
  158. <u-col offset="2" span="3" text-align="right">
  159. <view class="box2_btn" v-if="taskType3 === 0">去完成</view>
  160. <view class="box3_btn" v-if="taskType3 === 1">
  161. 已完成
  162. </view>
  163. </u-col>
  164. </u-row>
  165. </view>
  166. <view style="margin-top: 15rpx;" v-if="false">
  167. <u-row >
  168. <u-col span="2">
  169. <image class="box2_img" src="/static/level/hdbaoming.png"></image>
  170. </u-col>
  171. <u-col span="5">
  172. <view class="box_qd1">
  173. <view style="width: 95rpx;">活动报名</view>
  174. <text style="margin-left: 20rpx;">经验 +100</text>
  175. </view>
  176. <view class="box_qd">报名参加一次活动</view>
  177. </u-col>
  178. <u-col offset="2" span="3" text-align="right">
  179. <view class="box2_btn">去完成</view>
  180. </u-col>
  181. </u-row>
  182. </view>
  183. </view>
  184. </view>
  185. </view>
  186. </view>
  187. </template>
  188. <script>
  189. import {mapGetters} from 'vuex';
  190. export default {
  191. data() {
  192. return {
  193. list:[
  194. {
  195. title_color:'#0046AB',
  196. name:'初出茅庐',
  197. img:'/static/level/flower_1.png',
  198. tip:'还需 651 经验可升级成为「崭露头角」',
  199. bac:'linear-gradient(45deg, rgba(99, 163, 255, 0.8), rgba(182, 220, 255, 0.8), rgba(114, 190, 255, 0.8));'
  200. },
  201. {
  202. title_color:'#6724BD',
  203. name:'崭露头角',
  204. img:'/static/level/flower_2.png',
  205. tip:'还需 651 经验可升级成为「自成一派」',
  206. bac:'linear-gradient(45deg, rgba(152, 14, 188, 0.4), rgba(173, 108, 254, 0.4));'
  207. },
  208. {
  209. title_color:'#27BA27',
  210. name:'自成一派',
  211. img:'/static/level/flower_3.png',
  212. tip:'还需 651 经验可升级成为「小有名气」',
  213. bac:'linear-gradient(45deg, rgba(8, 202, 96, 0.4), rgba(66, 254, 64, 0.4));'
  214. },
  215. {
  216. title_color:'#E17713',
  217. name:'小有名气',
  218. img:'/static/level/flower_4.png',
  219. tip:'还需 651 经验可升级成为「惊艳四座」',
  220. bac:'linear-gradient(45deg, rgba(231, 105, 45, 0.4), rgba(255, 169, 90, 0.4));'
  221. },
  222. {
  223. title_color:'#C21A7A',
  224. name:'惊艳四座',
  225. img:'/static/level/flower_5.png',
  226. tip:'还需 651 经验可升级成为「初露锋芒」',
  227. bac:'linear-gradient(45deg, rgba(148, 38, 117, 0.4), rgba(228, 83, 165, 0.4));'
  228. },
  229. {
  230. title_color:'#D1B214',
  231. name:'初露锋芒',
  232. img:'/static/level/flower_6.png',
  233. tip:'您已解锁所有成就!',
  234. bac:'linear-gradient(45deg, rgba(240, 157, 9, 0.4), rgba(251, 218, 56, 0.4));'
  235. }
  236. ],
  237. issue: 0,
  238. taskType0: 0,
  239. taskType1: 0,
  240. taskType2: 0,
  241. taskType3: 0,
  242. taskType4: 0,
  243. }
  244. },
  245. onLoad(option) {
  246. this.getInit()
  247. this.getInitList()
  248. },
  249. onShow(){
  250. },
  251. methods: {
  252. qd() {
  253. var self = this
  254. var data = {
  255. taskType: 0
  256. }
  257. self.$api.taskSignIn(data).then(res => {
  258. if(res.data.code === 200){
  259. self.getInit()
  260. }
  261. })
  262. },
  263. jumpZL(){
  264. this.$navTo.togo('/pages2/wd/info');
  265. },
  266. getInit(){
  267. let self = this;
  268. this.$api.appInfoAttached().then(res => {
  269. self.issue = res.data.data.issue
  270. });
  271. },
  272. getInitList(){
  273. this.$api.taskList().then(res => {
  274. res.data.rows.forEach((item,index) => {
  275. if(item.taskType === 0){
  276. this.taskType0 = item.userStatus
  277. }
  278. if(item.taskType === 1){
  279. this.taskType1 = item.userStatus
  280. }
  281. if(item.taskType === 2){
  282. this.taskType2 = item.userStatus
  283. }
  284. if(item.taskType === 3){
  285. this.taskType3 = item.userStatus
  286. }
  287. if(item.taskType === 4){
  288. this.taskType4 = item.userStatus
  289. }
  290. })
  291. })
  292. },
  293. jumpmenu(int){
  294. if(int === 1){
  295. this.$navTo.togo('/pages2/wd/coupon', {
  296. menuStatus:1
  297. });
  298. return
  299. }
  300. if(int === 2){
  301. this.$navTo.togo('/pages2/wd/coupon', {
  302. menuStatus:2
  303. });
  304. return
  305. }
  306. if(int === 3){
  307. this.$navTo.togo('/pages2/study/index', {
  308. status:1
  309. });
  310. return
  311. }
  312. if(int === 4){
  313. this.$navTo.togo('/pages2/study/index', {
  314. status:0
  315. });
  316. return
  317. }
  318. }
  319. },
  320. computed: {...mapGetters(['userInfo'])},
  321. }
  322. </script>
  323. <style>
  324. ::-webkit-scrollbar{
  325. width: 0;
  326. height: 0;
  327. color: transparent;
  328. }
  329. </style>
  330. <style scope>
  331. .level_flower{
  332. width: 280rpx;
  333. height: 160rpx;
  334. position: absolute;
  335. top: 0;
  336. left: 0;
  337. }
  338. .menu_p{
  339. display: flex;
  340. flex-direction: column;
  341. justify-content: center;
  342. height: 130rpx;
  343. }
  344. .menu_box{
  345. width: 100%;
  346. text-align: center;
  347. }
  348. .menu_t{
  349. font-size: 24rpx;
  350. font-family: PingFang SC;
  351. font-weight: 500;
  352. color: #32467B;
  353. margin-top: 10rpx;
  354. }
  355. .menu_img{
  356. width: 44rpx;
  357. height: 38rpx;
  358. }
  359. .box_jy{
  360. font-size: 22rpx;
  361. font-family: PingFang SC;
  362. font-weight: 400;
  363. color: #000000;
  364. }
  365. .box_qd1{
  366. font-size: 22rpx;
  367. font-family: PingFang SC;
  368. font-weight: 400;
  369. color: #000000;
  370. display: flex;
  371. }
  372. .box_qd{
  373. font-size: 18rpx;
  374. font-family: PingFang SC;
  375. font-weight: 400;
  376. color: #999999;
  377. margin-top: 8rpx;
  378. }
  379. .box2_btn{
  380. width: 132rpx;
  381. height: 40rpx;
  382. background: rgba(249, 96, 10, 0.6);
  383. border-radius: 20rpx;
  384. font-size: 24rpx;
  385. color: #FFFFFF;
  386. text-align: center;
  387. line-height: 40rpx;
  388. margin-right: 20rpx;
  389. }
  390. .box3_btn{
  391. width: 132rpx;
  392. height: 40rpx;
  393. background: rgba(238, 238, 238, 0.6);
  394. border-radius: 20rpx;
  395. font-size: 24rpx;
  396. color: #666;
  397. text-align: center;
  398. line-height: 40rpx;
  399. margin-right: 20rpx;
  400. }
  401. .box2_img{
  402. width: 83rpx;
  403. height: 83rpx;
  404. }
  405. .box2_title{
  406. font-size: 24rpx;
  407. font-family: PingFang SC;
  408. font-weight: bold;
  409. color: #32467B;
  410. }
  411. .box2{
  412. width: 100%;
  413. background: #FFFFFF;
  414. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  415. border-radius: 32rpx;
  416. padding: 20rpx;
  417. margin-top: 30rpx;
  418. }
  419. .box1{
  420. width: 100%;
  421. height: 130rpx;
  422. background: #FFFFFF;
  423. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  424. border-radius: 32rpx;
  425. margin-top: 20rpx;
  426. }
  427. .tip{
  428. font-size: 16rpx;
  429. font-family: PingFang SC;
  430. font-weight: 400;
  431. color: #32467B;
  432. margin-top: 8rpx;
  433. }
  434. .progress_box{
  435. padding: 40rpx;
  436. margin-top: 40rpx;
  437. }
  438. .progress_text{
  439. font-size: 24rpx;
  440. font-family: PingFang SC;
  441. font-weight: 800;
  442. color: #2F4379;
  443. position: relative;
  444. top: 15rpx;
  445. }
  446. .left_t2{
  447. font-size: 32rpx;
  448. font-family: PingFang SC;
  449. font-weight: bold;
  450. }
  451. .left_t{
  452. width: 118rpx;
  453. height: 40rpx;
  454. background: rgba(50, 70, 123, 0.5);
  455. border-radius: 0rpx 20rpx 20rpx 0rpx;
  456. color: #FEFEFF;
  457. font-size: 24rpx;
  458. text-align: center;
  459. line-height: 40rpx;
  460. margin-top: 30rpx;
  461. }
  462. .item_bac1{
  463. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  464. border-radius: 32rpx;
  465. }
  466. .sv_item_box{
  467. margin-right: 20rpx;
  468. display:inline-block;
  469. width: 678rpx;
  470. height: 296rpx;
  471. }
  472. .sv_box{
  473. width: 100%;
  474. height: 296rpx;
  475. background: #FFFFFF;
  476. white-space:nowrap;
  477. overflow: hidden;
  478. margin-left: 20rpx;
  479. }
  480. .rule{
  481. width: 132rpx;
  482. height: 40rpx;
  483. background: rgba(255, 255, 255, 0.5);
  484. border: 1rpx solid #32467B;
  485. border-radius: 20rpx;
  486. color: #2F4379;
  487. opacity: 0.5;
  488. font-size: 24rpx;
  489. text-align: center;
  490. }
  491. page {
  492. background: #FFFFFF;
  493. }
  494. .r_t2{
  495. font-size: 32rpx;
  496. font-weight: bold;
  497. color: #32467B;
  498. line-height: 80rpx;
  499. padding-left: 20rpx;
  500. }
  501. </style>