creativeExpert.vue 4.8 KB

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