getPoints.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <template>
  2. <view class="content">
  3. <view class="now-vip">
  4. <view class="top-vip">
  5. <view>当前等级</view>
  6. <view>爱心积分</view>
  7. </view>
  8. <view class="top-num">
  9. <view :class="{'num-dj': userInfo.level == 0}">
  10. <image class="icon-vip" v-for="i in userInfo.level" src="../../static/images/vip.png"></image>
  11. </view>
  12. <view v-if="userInfo.level !== 4 ">{{ userInfo.all_integral }}/{{ userInfo.next_integral }}</view>
  13. <view v-if="userInfo.level == 4">{{ userInfo.all_integral }}/{{ userInfo.all_integral }}</view>
  14. </view>
  15. <view class="line-progress">
  16. <u-line-progress active-color="#E62129" :percent="percent" :show-percent="false" :height="14"></u-line-progress>
  17. </view>
  18. <view class="vip-icon">
  19. <view>
  20. <image v-for="i in userInfo.level" class="icon-vip" src="../../static/images/vip.png"></image>
  21. </view>
  22. <view v-if="userInfo.level !== 4">
  23. <image v-for="i in userInfo.level + 1" class="icon-vip" src="../../static/images/vip.png"></image>
  24. </view>
  25. <view v-if="userInfo.level == 4">
  26. <image v-for="i in userInfo.level" class="icon-vip" src="../../static/images/vip.png"></image>
  27. </view>
  28. </view>
  29. </view>
  30. <!-- 成长体系 -->
  31. <view class="cztx-box">
  32. <view class="cztx-tit">成长体系</view>
  33. <view class="cztx-vip-box">
  34. <view class="experience-box">
  35. <view class="exper1">
  36. <view class="line-exper1" :class="{'line-sel': userInfo.level > 0 }"></view>
  37. <image class="exper1-img" src="../../static/images/v1.png"></image>
  38. </view>
  39. <view class="exper2">
  40. <view class="exper-text">孝心新贵</view>
  41. <view class="line-exper2" :class="{'line-sel': userInfo.level > 1 }"></view>
  42. <image class="exper2-img" src="../../static/images/v2.png"></image>
  43. </view>
  44. <view class="exper3">
  45. <view class="exper-text">乐善好施</view>
  46. <view class="line-exper3" :class="{'line-sel': userInfo.level > 2 }"></view>
  47. <image class="exper3-img" src="../../static/images/v3.png"></image>
  48. </view>
  49. <view class="exper4">
  50. <view class="exper-text">爱心巨匠</view>
  51. <view class="line-exper4" :class="{'line-sel': userInfo.level > 3 }"></view>
  52. <image class="exper4-img" src="../../static/images/v4.png"></image>
  53. </view>
  54. </view>
  55. <view class="cztx-experience">您可以通过更多公益行为来获得经验值</view>
  56. </view>
  57. </view>
  58. <!-- 如何获得爱心积分 -->
  59. <!-- <view class="love-box">
  60. <view class="love-tit">如何获得爱心积分?</view>
  61. <view class="love-text">下列操作可以帮助你获得爱心积分:</view>
  62. <view class="love-frame">
  63. <u-table>
  64. <u-tr class="frame-tit">
  65. <u-th class="frame-tit">操作</u-th>
  66. <u-th class="frame-tit">获得积分</u-th>
  67. </u-tr>
  68. <u-tr class='frame-tr'>
  69. <u-td class='frame-td'>首次登录</u-td>
  70. <u-td class='frame-td'>100</u-td>
  71. </u-tr>
  72. <u-tr class='frame-tr'>
  73. <u-td class='frame-td'>帮扶1次</u-td>
  74. <u-td class='frame-td'>10</u-td>
  75. </u-tr>
  76. <u-tr class='frame-tr'>
  77. <u-td class='frame-td'>分享1次</u-td>
  78. <u-td class='frame-td'>5(每日上限15)</u-td>
  79. </u-tr>
  80. <u-tr class='frame-tr'>
  81. <u-td class='frame-td'>在线满5分钟</u-td>
  82. <u-td class='frame-td'>5(每日上限20)</u-td>
  83. </u-tr>
  84. <u-tr class='frame-tr'>
  85. <u-td class='frame-td'>连续签到满1次</u-td>
  86. <u-td class='frame-td'>1(每日递增,最高7)</u-td>
  87. </u-tr>
  88. </u-table>
  89. </view>
  90. </view> -->
  91. </view>
  92. </template>
  93. <script>
  94. import { mapState } from 'vuex';
  95. export default {
  96. data() {
  97. return {
  98. percent:'',
  99. }
  100. },
  101. onLoad() {
  102. this.loadData();
  103. },
  104. computed: {
  105. ...mapState('user', ['userInfo']),
  106. },
  107. methods: {
  108. loadData() {
  109. let obj = this;
  110. if (obj.userInfo.level == 4) {
  111. obj.percent = 100;
  112. } else {
  113. obj.percent = (obj.userInfo.all_integral / obj.userInfo.next_integral) * 100;
  114. }
  115. obj.percent = parseInt(obj.percent);
  116. console.log(obj.percent,obj.userInfo);
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss">
  122. page {
  123. height: 100%;
  124. background: #FFFFFF;
  125. }
  126. .content {
  127. padding: 80rpx 60rpx 80rpx;
  128. .now-vip {
  129. .top-vip {
  130. display: flex;
  131. align-items: center;
  132. justify-content: space-around;
  133. font-size: $font-base;
  134. font-family: PingFang SC;
  135. font-weight: 500;
  136. color: #666666;
  137. line-height: 1;
  138. }
  139. .top-num {
  140. display: flex;
  141. align-items: center;
  142. justify-content: space-around;
  143. font-size: 36rpx;
  144. font-family: PingFang SC;
  145. font-weight: 500;
  146. color: #222222;
  147. line-height: 1;
  148. margin-top: 22rpx;
  149. .num-dj {
  150. visibility: hidden;
  151. }
  152. .icon-vip {
  153. width: 37rpx;
  154. height: 32rpx;
  155. margin-left: 5rpx;
  156. }
  157. }
  158. .line-progress {
  159. padding: 30rpx 54rpx 24rpx;
  160. }
  161. .vip-icon {
  162. display: flex;
  163. align-items: center;
  164. justify-content: space-between;
  165. .icon-vip {
  166. width: 37rpx;
  167. height: 32rpx;
  168. margin-left: 5rpx;
  169. }
  170. }
  171. }
  172. .cztx-box {
  173. margin-top: 90rpx;
  174. .cztx-tit {
  175. font-size: 36rpx;
  176. font-family: PingFang SC;
  177. font-weight: 500;
  178. color: #222222;
  179. }
  180. .cztx-vip-box {
  181. .experience-box {
  182. display: flex;
  183. align-items: flex-end;
  184. justify-content: space-around;
  185. padding: 14rpx 40rpx 0 60rpx;
  186. .exper-text {
  187. font-size: $font-sm;
  188. font-family: PingFang SC;
  189. font-weight: 500;
  190. color: #222222;
  191. margin-bottom: 30rpx;
  192. }
  193. .exper1 {
  194. display: flex;
  195. flex-direction: column;
  196. align-items: center;
  197. .line-exper1 {
  198. width: 14rpx;
  199. height: 26rpx;
  200. background: #EDEDED;
  201. border-radius: 7rpx 7rpx 0px 0px;
  202. margin-bottom: 24rpx;
  203. }
  204. .exper1-img {
  205. width: 30rpx;
  206. height: 26rpx;
  207. }
  208. }
  209. .exper2 {
  210. display: flex;
  211. flex-direction: column;
  212. align-items: center;
  213. .line-exper2 {
  214. width: 14rpx;
  215. height: 104rpx;
  216. background: #EDEDED;
  217. border-radius: 7rpx 7rpx 0px 0px;
  218. margin-bottom: 24rpx;
  219. }
  220. .exper2-img {
  221. width: 50rpx;
  222. height: 32rpx;
  223. }
  224. }
  225. .exper3 {
  226. display: flex;
  227. flex-direction: column;
  228. align-items: center;
  229. .line-exper3 {
  230. width: 14rpx;
  231. height: 182rpx;
  232. background: #EDEDED;
  233. border-radius: 7rpx 7rpx 0px 0px;
  234. margin-bottom: 24rpx;
  235. }
  236. .exper3-img {
  237. width: 68rpx;
  238. height: 32rpx;
  239. }
  240. }
  241. .exper4 {
  242. display: flex;
  243. flex-direction: column;
  244. align-items: center;
  245. .line-exper4 {
  246. width: 14rpx;
  247. height: 260rpx;
  248. background: #EDEDED;
  249. border-radius: 7rpx 7rpx 0px 0px;
  250. margin-bottom: 24rpx;
  251. }
  252. .exper4-img {
  253. width: 87rpx;
  254. height: 32rpx;
  255. }
  256. }
  257. .line-sel {
  258. background: #E62129 !important;
  259. }
  260. }
  261. .cztx-experience {
  262. margin-top: 50rpx;
  263. text-align: center;
  264. font-size: $font-sm;
  265. font-family: PingFang SC;
  266. font-weight: 500;
  267. color: #222222;
  268. }
  269. }
  270. }
  271. .love-box {
  272. margin-top: 96rpx;
  273. line-height: 1;
  274. .love-tit {
  275. font-size: 36rpx;
  276. font-family: PingFang SC;
  277. font-weight: 500;
  278. color: #222222;
  279. }
  280. .love-text {
  281. font-size: $font-base;
  282. font-family: PingFang SC;
  283. font-weight: 500;
  284. color: #222222;
  285. margin: 21rpx 0 35rpx;
  286. }
  287. .love-frame {
  288. width: 100%;
  289. border-radius: 12rpx;
  290. // border: 1px solid rgba(155,155,155,.3);
  291. .frame-tit {
  292. border-radius: 12rpx 12rpx 0 0;
  293. height: 84rpx;
  294. }
  295. .frame-tr{
  296. height: 84rpx;
  297. .frame-td{
  298. font-size: 28rpx;
  299. font-weight: 500;
  300. color: #222222;
  301. }
  302. }
  303. }
  304. }
  305. }
  306. </style>