level.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  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" v-if="userInfo.userLevel -1 === index">
  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">{{userInfo.integral}}/{{userLevelList[index].needIntegralEnd}}</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">还需 {{userLevelList[index].needIntegralEnd - userInfo.integral}} 经验可升级成为{{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" @click="jumpmenu(4)">去完成</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. <button class="box2_btn" open-type="share" v-if="taskType3 === 0" >去完成</button>
  160. <!-- <view class="box2_btn" v-if="taskType3 === 0" @click="jumpPagesz">去完成</view> -->
  161. <view class="box3_btn" v-if="taskType3 === 1">
  162. 已完成
  163. </view>
  164. </u-col>
  165. </u-row>
  166. </view>
  167. <view style="margin-top: 15rpx;" v-if="false">
  168. <u-row >
  169. <u-col span="2">
  170. <image class="box2_img" src="/static/level/hdbaoming.png"></image>
  171. </u-col>
  172. <u-col span="5">
  173. <view class="box_qd1">
  174. <view style="width: 95rpx;">活动报名</view>
  175. <text style="margin-left: 20rpx;">经验 +100</text>
  176. </view>
  177. <view class="box_qd">报名参加一次活动</view>
  178. </u-col>
  179. <u-col offset="2" span="3" text-align="right">
  180. <view class="box2_btn">去完成</view>
  181. </u-col>
  182. </u-row>
  183. </view>
  184. </view>
  185. </view>
  186. </view>
  187. </view>
  188. </template>
  189. <script>
  190. import {mapGetters} from 'vuex';
  191. export default {
  192. data() {
  193. return {
  194. list:[
  195. {
  196. title_color:'#0046AB',
  197. name:'初出茅庐',
  198. img:'/static/level/flower_1.png',
  199. tip:'「崭露头角」',
  200. bac:'linear-gradient(45deg, rgba(99, 163, 255, 0.8), rgba(182, 220, 255, 0.8), rgba(114, 190, 255, 0.8));'
  201. },
  202. {
  203. title_color:'#6724BD',
  204. name:'崭露头角',
  205. img:'/static/level/flower_2.png',
  206. tip:'「自成一派」',
  207. bac:'linear-gradient(45deg, rgba(152, 14, 188, 0.4), rgba(173, 108, 254, 0.4));'
  208. },
  209. {
  210. title_color:'#27BA27',
  211. name:'自成一派',
  212. img:'/static/level/flower_3.png',
  213. tip:'「小有名气」',
  214. bac:'linear-gradient(45deg, rgba(8, 202, 96, 0.4), rgba(66, 254, 64, 0.4));'
  215. },
  216. {
  217. title_color:'#E17713',
  218. name:'小有名气',
  219. img:'/static/level/flower_4.png',
  220. tip:'「惊艳四座」',
  221. bac:'linear-gradient(45deg, rgba(231, 105, 45, 0.4), rgba(255, 169, 90, 0.4));'
  222. },
  223. {
  224. title_color:'#C21A7A',
  225. name:'惊艳四座',
  226. img:'/static/level/flower_5.png',
  227. tip:'「初露锋芒」',
  228. bac:'linear-gradient(45deg, rgba(148, 38, 117, 0.4), rgba(228, 83, 165, 0.4));'
  229. },
  230. {
  231. title_color:'#D1B214',
  232. name:'初露锋芒',
  233. img:'/static/level/flower_6.png',
  234. tip:'您已解锁所有成就!',
  235. bac:'linear-gradient(45deg, rgba(240, 157, 9, 0.4), rgba(251, 218, 56, 0.4));'
  236. }
  237. ],
  238. issue: 0,
  239. taskType0: 0,
  240. taskType1: 0,
  241. taskType2: 0,
  242. taskType3: 0,
  243. taskType4: 0,
  244. userLevelList: []
  245. }
  246. },
  247. onLoad(option) {
  248. this.getInit()
  249. this.getInitList()
  250. this.getLevel()
  251. },
  252. onShareAppMessage: function(res) {
  253. return {
  254. title: '中正',
  255. path: `/pages/index/index?inviteCode=${this.userInfo.userAccout}`
  256. };
  257. },
  258. methods: {
  259. getLevel(){
  260. var self = this
  261. this.$api.gradelist().then(res => {
  262. self.userLevelList = res.data.rows
  263. })
  264. },
  265. qd() {
  266. var self = this
  267. var data = {
  268. taskType: 0
  269. }
  270. self.$api.taskSignIn(data).then(res => {
  271. if(res.data.code === 200){
  272. self.getInit()
  273. self.$api.refreshUserInfo()
  274. uni.showToast({
  275. title: '签到成功',
  276. icon: 'none'
  277. })
  278. }
  279. })
  280. },
  281. jumpZL(){
  282. this.$navTo.togo('/pages2/wd/info');
  283. },
  284. getInit(){
  285. let self = this;
  286. this.$api.appInfoAttached().then(res => {
  287. self.issue = res.data.data.issue
  288. });
  289. },
  290. getInitList(){
  291. this.$api.taskList().then(res => {
  292. res.data.rows.forEach((item,index) => {
  293. if(item.taskType === 0){
  294. this.taskType0 = item.userStatus
  295. }
  296. if(item.taskType === 1){
  297. this.taskType1 = item.userStatus
  298. }
  299. if(item.taskType === 2){
  300. this.taskType2 = item.userStatus
  301. }
  302. if(item.taskType === 3){
  303. this.taskType3 = item.userStatus
  304. }
  305. if(item.taskType === 4){
  306. this.taskType4 = item.userStatus
  307. }
  308. })
  309. })
  310. },
  311. jumpmenu(int){
  312. if(int === 1){
  313. this.$navTo.togo('/pages2/wd/coupon', {
  314. menuStatus:1
  315. });
  316. return
  317. }
  318. if(int === 2){
  319. this.$navTo.togo('/pages2/wd/coupon', {
  320. menuStatus:2
  321. });
  322. return
  323. }
  324. if(int === 3){
  325. this.$navTo.togo('/pages2/study/index', {
  326. status:1
  327. });
  328. return
  329. }
  330. if(int === 4){
  331. this.$navTo.togo('/pages2/study/index', {
  332. status:0
  333. });
  334. return
  335. }
  336. }
  337. },
  338. computed: {...mapGetters(['userInfo'])},
  339. }
  340. </script>
  341. <style>
  342. ::-webkit-scrollbar{
  343. width: 0;
  344. height: 0;
  345. color: transparent;
  346. }
  347. </style>
  348. <style scope>
  349. .level_flower{
  350. width: 280rpx;
  351. height: 160rpx;
  352. position: absolute;
  353. top: 0;
  354. left: 0;
  355. }
  356. .menu_p{
  357. display: flex;
  358. flex-direction: column;
  359. justify-content: center;
  360. height: 130rpx;
  361. }
  362. .menu_box{
  363. width: 100%;
  364. text-align: center;
  365. }
  366. .menu_t{
  367. font-size: 24rpx;
  368. font-family: PingFang SC;
  369. font-weight: 500;
  370. color: #32467B;
  371. margin-top: 10rpx;
  372. }
  373. .menu_img{
  374. width: 44rpx;
  375. height: 38rpx;
  376. }
  377. .box_jy{
  378. font-size: 22rpx;
  379. font-family: PingFang SC;
  380. font-weight: 400;
  381. color: #000000;
  382. }
  383. .box_qd1{
  384. font-size: 22rpx;
  385. font-family: PingFang SC;
  386. font-weight: 400;
  387. color: #000000;
  388. display: flex;
  389. }
  390. .box_qd{
  391. font-size: 18rpx;
  392. font-family: PingFang SC;
  393. font-weight: 400;
  394. color: #999999;
  395. margin-top: 8rpx;
  396. }
  397. .box2_btn{
  398. width: 132rpx;
  399. height: 40rpx;
  400. background: rgba(249, 96, 10, 0.6);
  401. border-radius: 20rpx;
  402. font-size: 24rpx;
  403. color: #FFFFFF;
  404. text-align: center;
  405. line-height: 40rpx;
  406. margin-right: 20rpx;
  407. }
  408. .box3_btn{
  409. width: 132rpx;
  410. height: 40rpx;
  411. background: rgba(238, 238, 238, 0.6);
  412. border-radius: 20rpx;
  413. font-size: 24rpx;
  414. color: #666;
  415. text-align: center;
  416. line-height: 40rpx;
  417. margin-right: 20rpx;
  418. }
  419. .box2_img{
  420. width: 83rpx;
  421. height: 83rpx;
  422. }
  423. .box2_title{
  424. font-size: 24rpx;
  425. font-family: PingFang SC;
  426. font-weight: bold;
  427. color: #32467B;
  428. }
  429. .box2{
  430. width: 100%;
  431. background: #FFFFFF;
  432. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  433. border-radius: 32rpx;
  434. padding: 20rpx;
  435. margin-top: 30rpx;
  436. }
  437. .box1{
  438. width: 100%;
  439. height: 130rpx;
  440. background: #FFFFFF;
  441. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  442. border-radius: 32rpx;
  443. margin-top: 20rpx;
  444. }
  445. .tip{
  446. font-size: 16rpx;
  447. font-family: PingFang SC;
  448. font-weight: 400;
  449. color: #32467B;
  450. margin-top: 8rpx;
  451. }
  452. .progress_box{
  453. padding: 40rpx;
  454. margin-top: 40rpx;
  455. }
  456. .progress_text{
  457. font-size: 24rpx;
  458. font-family: PingFang SC;
  459. font-weight: 800;
  460. color: #2F4379;
  461. position: relative;
  462. top: 15rpx;
  463. }
  464. .left_t2{
  465. font-size: 32rpx;
  466. font-family: PingFang SC;
  467. font-weight: bold;
  468. }
  469. .left_t{
  470. width: 118rpx;
  471. height: 40rpx;
  472. background: rgba(50, 70, 123, 0.5);
  473. border-radius: 0rpx 20rpx 20rpx 0rpx;
  474. color: #FEFEFF;
  475. font-size: 24rpx;
  476. text-align: center;
  477. line-height: 40rpx;
  478. margin-top: 30rpx;
  479. }
  480. .item_bac1{
  481. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  482. border-radius: 32rpx;
  483. }
  484. .sv_item_box{
  485. margin-right: 20rpx;
  486. display:inline-block;
  487. width: 678rpx;
  488. height: 296rpx;
  489. }
  490. .sv_box{
  491. width: 100%;
  492. height: 296rpx;
  493. background: #FFFFFF;
  494. white-space:nowrap;
  495. overflow: hidden;
  496. margin-left: 20rpx;
  497. }
  498. .rule{
  499. width: 132rpx;
  500. height: 40rpx;
  501. background: rgba(255, 255, 255, 0.5);
  502. border: 1rpx solid #32467B;
  503. border-radius: 20rpx;
  504. color: #2F4379;
  505. opacity: 0.5;
  506. font-size: 24rpx;
  507. text-align: center;
  508. }
  509. page {
  510. background: #FFFFFF;
  511. }
  512. .r_t2{
  513. font-size: 32rpx;
  514. font-weight: bold;
  515. color: #32467B;
  516. line-height: 80rpx;
  517. padding-left: 20rpx;
  518. }
  519. </style>