creativeExpert.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <view class="creative-expert-page">
  3. <div class="navbar">
  4. <view class="navbar-left">
  5. <image @click="goBack()" class="back" src="../../static/vip/hy_icon_jiantou.png"></image>
  6. </view>
  7. <view class="navbar-center">
  8. 创意达人值说明
  9. </view>
  10. <view class="navbar-right">
  11. </view>
  12. </div>
  13. <view class="progress-box">
  14. <view class="progress-box-title">
  15. 我的当前等级
  16. </view>
  17. <view class="progress-box-level">
  18. <image v-if="myinfo.my_level || myinfo.my_level == 0"
  19. :src="`../../static/icon/level_${myinfo.my_level}.png`" class="level-icon" />
  20. </view>
  21. <view class="progress-box-title" style="text-align: center;">
  22. 升级到下个等级还需{{ myinfo.level_remaining }}点经验
  23. </view>
  24. <view class="progress-box-level-progress">
  25. <view class="progress-bg">
  26. <view class="progress-bar" :style="{ width: myinfo.level_progress + '%' }"></view>
  27. </view>
  28. </view>
  29. <view class="progress-box-vip">
  30. <view>
  31. Lv{{ myinfo.my_level }}
  32. </view>
  33. <image v-if="myinfo.is_vip || true" src="../../static/me/creativeExpert _vip.png" mode="widthFix"
  34. class="creativeExpert_vip" />
  35. <view>
  36. Lv{{ myinfo.my_level + 1 }}
  37. </view>
  38. </view>
  39. </view>
  40. <image src="../../static/me/creativeExpert-text.png" mode="widthFix" class="creativeExpert-text" />
  41. </view>
  42. </template>
  43. <script>
  44. export default {
  45. data() {
  46. return {
  47. myinfo: {
  48. level_remaining: 0,
  49. level_total: 0,
  50. level_progress: 0
  51. },
  52. grade: [[0, 99], [100, 799], [800, 1999], [2000, 3999], [4000, 8999], [9000, 9999999]]
  53. }
  54. },
  55. onLoad() {
  56. this.getData()
  57. },
  58. methods: {
  59. getData() {
  60. uni.request({
  61. url: this.$apiHost + "/User/getinfo",
  62. data: {
  63. uuid: getApp().globalData.uuid,
  64. skey: getApp().globalData.skey,
  65. },
  66. header: {
  67. "content-type": "application/json",
  68. sign: getApp().globalData.headerSign,
  69. },
  70. success: (res) => {
  71. if (res.data) {
  72. // this.myinfo = res.data;
  73. let level_data = this.grade[res.data.my_level]
  74. this.myinfo.is_vip = res.data.is_vip
  75. this.myinfo.my_level = res.data.my_level
  76. this.myinfo.level_remaining = level_data[1] - res.data.num_jinyan
  77. this.myinfo.level_total = level_data[1] - level_data[0]
  78. this.myinfo.level_progress = ((res.data.num_jinyan - level_data[0]) / this.myinfo.level_total).toFixed(4) * 100
  79. }
  80. },
  81. complete: (com) => {
  82. },
  83. fail: (e) => {
  84. console.log("----e:", e);
  85. },
  86. });
  87. }
  88. }
  89. }
  90. </script>
  91. <style scoped lang="scss">
  92. .creative-expert-page {
  93. background: url('../../static/me/creativeExpert_top_bg.png') top center / 100% auto no-repeat #1f1f1f;
  94. min-height: 100vh;
  95. color: #fff;
  96. padding: 0 28rpx;
  97. width: 100vw;
  98. box-sizing: border-box;
  99. .navbar {
  100. width: calc(100vw - 60rpx);
  101. height: 100rpx;
  102. display: flex;
  103. justify-content: space-between;
  104. align-items: center;
  105. padding: 0;
  106. z-index: 99;
  107. padding-top: var(--status-bar-height);
  108. .navbar-center {
  109. font-size: 36rpx;
  110. font-weight: bold;
  111. color: #fff;
  112. }
  113. // z-index: 99;
  114. // padding-top: var(--status-bar-height);
  115. .navbar-left {
  116. width: 50rpx;
  117. display: flex;
  118. align-items: center;
  119. justify-content: space-between;
  120. .back {
  121. width: 32rpx;
  122. height: 32rpx;
  123. opacity: 0.9;
  124. }
  125. }
  126. .navbar-right {
  127. width: 50rpx;
  128. height: 20rpx;
  129. display: flex;
  130. align-items: center;
  131. justify-content: space-between;
  132. }
  133. }
  134. .progress-box {
  135. height: 350rpx;
  136. width: 100%;
  137. padding: 0 18rpx;
  138. padding-top: 42rpx;
  139. padding-bottom: 26rpx;
  140. display: flex;
  141. align-items: center;
  142. justify-content: center;
  143. flex-direction: column;
  144. .progress-box-title {
  145. width: 100%;
  146. }
  147. .creativeExpert_vip {
  148. width: 234rpx;
  149. height: 52rpx;
  150. }
  151. .progress-box-level-progress {
  152. padding: 28rpx 22rpx 18rpx 22rpx;
  153. width: 100%;
  154. }
  155. .progress-bg {
  156. width: 100%;
  157. height: 10rpx;
  158. background: rgba(255, 255, 255, 0.3);
  159. border-radius: 86rpx;
  160. .progress-bar {
  161. height: 10rpx;
  162. background: #ACF934;
  163. border-radius: 86rpx;
  164. transition: width 0.6s ease-in-out;
  165. }
  166. }
  167. .progress-box-vip {
  168. display: flex;
  169. align-items: flex-start;
  170. justify-content: space-between;
  171. width: 100%;
  172. padding: 0 22rpx;
  173. font-size: 24rpx;
  174. color: #ACF934;
  175. }
  176. }
  177. .progress-box-level {
  178. padding-top: 28rpx;
  179. padding-bottom: 56rpx;
  180. }
  181. .level-icon {
  182. width: 180rpx;
  183. height: 80rpx;
  184. }
  185. .creativeExpert-text {
  186. width: 100%;
  187. }
  188. }
  189. </style>