ren.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <view class="content">
  3. <view class="top-bg">
  4. </view>
  5. <view class="top-wrap">
  6. <view class="tit">
  7. ·我的收益
  8. </view>
  9. <view class="val">
  10. {{userInfo.points || 0}}
  11. </view>
  12. <view class="">
  13. 累计收益
  14. </view>
  15. </view>
  16. <view class="gg-wrap flex" v-for="(item,index) in ggInfo.day_video_count">
  17. <image src="../../static/icon/jiang.png" mode=""></image>
  18. <view class="gg-tit">
  19. <view class="tit">
  20. 观看视频赚阅读积分
  21. </view>
  22. <view class="">
  23. 观看可获得阅读积分
  24. </view>
  25. </view>
  26. <view class="gg-btn" :class="{pass: ggInfo.valid_bcount*1 > index}" @click="ggInfo.valid_bcount*1 > index? '': goLock(index)">
  27. {{ggInfo.valid_bcount*1 > index? '已观看': '去观看'}}
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import {
  34. mapState,
  35. mapMutations
  36. } from 'vuex';
  37. import {
  38. getGG,
  39. createGG
  40. } from '@/api/zero.js'
  41. import {
  42. getUserInfo,
  43. getLevelList
  44. } from '@/api/user.js';
  45. export default {
  46. data() {
  47. return {
  48. ggInfo: {},
  49. id: 0
  50. }
  51. },
  52. computed: {
  53. ...mapState('user', ['userInfo', 'hasLogin'])
  54. },
  55. onLoad(opt) {
  56. this.id = opt.id
  57. },
  58. onShow() {
  59. this.loadBaseData()
  60. this.getGG()
  61. },
  62. onReachBottom() {
  63. },
  64. onReady() {
  65. },
  66. methods: {
  67. ...mapMutations('user', ['setUserInfo']),
  68. loadBaseData() {
  69. const obj = this
  70. getUserInfo({})
  71. .then(({
  72. data
  73. }) => {
  74. obj.setUserInfo(data);
  75. // obj.getLevelList()
  76. })
  77. .catch(e => {
  78. console.log(e);
  79. });
  80. },
  81. getGG() {
  82. getGG().then(res => {
  83. console.log(res)
  84. this.ggInfo = res.data
  85. })
  86. },
  87. goLock() {
  88. createGG({
  89. ad_id: 0
  90. }).then(res => {
  91. uni.navigateTo({
  92. url: '/pages/zero/gg?id=' + res.data.id
  93. })
  94. })
  95. }
  96. }
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. .top-bg {
  101. height: 210rpx;
  102. background-color: #f53935;
  103. }
  104. .top-wrap {
  105. width: 684rpx;
  106. height: 254rpx;
  107. background: linear-gradient(-70deg, #FF6362, #FF9465);
  108. box-shadow: 0rpx 11rpx 17rpx 4rpx rgba(255, 76, 76, 0.1);
  109. border-radius: 16rpx;
  110. margin: -180rpx auto 20rpx;
  111. text-align: center;
  112. font-size: 20rpx;
  113. font-weight: 500;
  114. color: #fff;
  115. padding: 30rpx;
  116. .tit {
  117. text-align: left;
  118. font-size: 28rpx;
  119. padding: 10rpx 0;
  120. }
  121. .val {
  122. padding-bottom: 15rpx;
  123. font-size: 80rpx;
  124. font-weight: bold;
  125. }
  126. }
  127. .gg-wrap {
  128. width: 660rpx;
  129. height: 140rpx;
  130. background: #FEFEFE;
  131. box-shadow: 0rpx 0rpx 29rpx 0rpx rgba(231, 71, 68, 0.09);
  132. border-radius: 4rpx;
  133. margin: 20rpx auto;
  134. padding: 30rpx 40rpx 40rpx 90rpx;
  135. position: relative;
  136. image {
  137. position: absolute;
  138. top: 0;
  139. left: 26rpx;
  140. width: 45rpx;
  141. height: 60rpx;
  142. }
  143. .gg-tit {
  144. font-size: 24rpx;
  145. font-weight: 500;
  146. color: #999999;
  147. .tit {
  148. padding-bottom: 20rpx;
  149. font-size: 32rpx;
  150. font-weight: bold;
  151. color: #333333;
  152. }
  153. }
  154. .gg-btn {
  155. width: 125rpx;
  156. height: 46rpx;
  157. background: linear-gradient(60deg, #FF8F3B, #FF3106);
  158. border-radius: 23rpx;
  159. font-size: 24rpx;
  160. font-weight: 500;
  161. color: #FFFFFF;
  162. text-align: center;
  163. line-height: 45rpx;
  164. }
  165. }
  166. .pass {
  167. background: #999 !important;
  168. }
  169. </style>