小说小程序前端代码仓库(小程序)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
812 B

  1. <template>
  2. <view class="book-status"
  3. :class="statusClass">
  4. {{ statusText }}
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. props : ['status'],
  10. computed: {
  11. statusClass() {
  12. const statusMap = {
  13. '0': 'ongoing',
  14. '1': 'completed'
  15. };
  16. return statusMap[this.status] || 'ongoing';
  17. },
  18. statusText() {
  19. const textMap = {
  20. // '0': '新建',
  21. '0': '连载中',
  22. '1': '已完结'
  23. };
  24. return textMap[this.status] || '连载中';
  25. },
  26. },
  27. data() {
  28. return {
  29. }
  30. },
  31. methods: {
  32. }
  33. }
  34. </script>
  35. <style scoped lang="scss">
  36. .book-status {
  37. font-size: 20rpx;
  38. color: #67C23A;
  39. background-color: rgba(103, 194, 58, 0.1);
  40. border-radius: 20rpx;
  41. padding: 4rpx 12rpx;
  42. &.ongoing{
  43. color: #ffa502;
  44. background-color: #ffa50223;
  45. }
  46. }
  47. </style>