CellTip.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view class="">
  3. <view class="position" v-if="cellType=='1'">
  4. <text class="tag"></text>
  5. <text class="titles" v-text="title"></text>
  6. <slot></slot>
  7. </view>
  8. <view class="list-cell" v-if="cellType=='2'">
  9. <text class="list-cell-span" >
  10. <text v-text="title"></text>
  11. <text class="num" v-if="num<=99" v-text="num"></text>
  12. <text class="num" v-if="num>99">99+</text>
  13. </text>
  14. <slot></slot>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. name: "CellTip",
  21. props:{
  22. title:{
  23. type:String,
  24. default:''
  25. },
  26. num:{
  27. type:[String, Number],
  28. default:''
  29. },
  30. cellType:{
  31. type:[String, Number],
  32. default:'1'
  33. }
  34. },
  35. data() {
  36. return {
  37. };
  38. }
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. .position {
  43. position: relative;
  44. padding: 20rpx;
  45. display: flex;
  46. align-items: center;
  47. background-color: $page-tip-bg;
  48. font-size: $uni-font-size-base;
  49. color: $uni-text-color;
  50. .tag {
  51. display: inline-block;
  52. background-color: $j-primary-border-green;
  53. width: 6rpx;
  54. height: 30rpx;
  55. }
  56. .titles {
  57. font-size: $uni-font-size-lg;
  58. font-weight: bold;
  59. margin-left: 20rpx;
  60. }
  61. }
  62. .list-cell{
  63. position: relative;
  64. padding: 0 20rpx;
  65. background-color: #FFFFFF;
  66. font-size: $uni-font-size-base;
  67. color: $uni-text-regular-color;
  68. .list-cell-span{
  69. padding: 0 20rpx;
  70. position: relative;
  71. display: inline-block;
  72. height: 76rpx;
  73. line-height: 76rpx;
  74. border-bottom: 1px solid $j-primary-border-green;
  75. }
  76. .num{
  77. padding: 0 8rpx;
  78. height: 40rpx;
  79. line-height: 40rpx;
  80. position: absolute;
  81. top: 8rpx;
  82. right: -50rpx;
  83. display: inline-block;
  84. transform: scale(0.7);
  85. color: #FFFFFF;
  86. background-color: $uni-color-error;
  87. border-radius: 20rpx;
  88. text-align: center;
  89. }
  90. }
  91. </style>