cm-unit-price.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template name="cm-price">
  2. <!-- 商品详情价格判断 -->
  3. <view class="sku-price-main">
  4. <view class="sku-price-viw">
  5. <!-- 价格等级和权限 -->
  6. <template v-if="!hasLogin">
  7. <!-- 游客 -->
  8. <view class="sku-price-text">
  9. <uni-grader :grade="Number(skuProduct.priceGrade)"></uni-grader>
  10. </view>
  11. </template>
  12. <template v-else>
  13. <!-- 资质机构 -->
  14. <view class="sku-price-text"> ¥{{ skuProduct.price | NumFormat }} </view>
  15. </template>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import { mapState, mapMutations } from 'vuex'
  21. import uniGrader from '@/components/uni-grade/uni-grade.vue'
  22. export default {
  23. name: 'cm-unit-price',
  24. components: {
  25. uniGrader
  26. },
  27. props: {
  28. skuProduct: {
  29. type: Object,
  30. default: {}
  31. }
  32. },
  33. data() {
  34. return {
  35. }
  36. },
  37. filters: {
  38. NumFormat(value) {
  39. //处理金额
  40. return Number(value).toFixed(2)
  41. }
  42. },
  43. created() {
  44. },
  45. computed: {
  46. ...mapState(['hasLogin', 'clubType'])
  47. },
  48. methods: {
  49. }
  50. }
  51. </script>
  52. <style lang="scss">
  53. .sku-price-main {
  54. width: 100%;
  55. height: 100%;
  56. .sku-price-viw {
  57. width: 100%;
  58. height: 40rpx;
  59. margin-bottom: 24rpx;
  60. .sku-price-text {
  61. font-size: 28rpx;
  62. line-height: 40rpx;
  63. color: #f94b4b;
  64. font-weight: bold;
  65. .sku-price-l {
  66. float: left;
  67. font-weight: normal;
  68. }
  69. &.none {
  70. text-decoration: line-through;
  71. color: #999999;
  72. font-weight: normal;
  73. }
  74. }
  75. }
  76. .sku-price-vip {
  77. width: 100%;
  78. height: 40rpx;
  79. }
  80. }
  81. </style>