uni-grade.vue 780 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view class="grade" :style="{marginTop:margin+'rpx'}">
  3. <text class="grade-text">¥</text>
  4. <image :src="staticUrl + 'icon-grade'+grade+'@2x.png'" mode=""></image>
  5. </view>
  6. </template>
  7. <script>
  8. export default{
  9. name:"grade",
  10. props:{
  11. grade:{ //等级
  12. type: Number,
  13. },
  14. margin:{
  15. type:Number,
  16. default:12
  17. }
  18. },
  19. data() {
  20. return {
  21. staticUrl:this.global.staticUrl
  22. };
  23. },
  24. created() {
  25. },
  26. methods:{
  27. }
  28. }
  29. </script>
  30. <style lang="scss">
  31. .grade{
  32. width: 200rpx;
  33. height: 36rpx;
  34. float: left;
  35. .grade-text{
  36. display: inline-block;
  37. float: left;
  38. line-height: 36rpx;
  39. font-size: 24rpx;
  40. color: #666;
  41. }
  42. image{
  43. width: 118rpx;
  44. height: 36rpx;
  45. display: inline-block;
  46. float: left;
  47. }
  48. }
  49. </style>