cm-price.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template name="cm-price">
  2. <!-- 商品详情价格判断 -->
  3. <view class="wrap-main">
  4. <template v-if="!hasLogin">
  5. <view class="p-login grade tui-skeleton-fillet">
  6. <text class="p-no">¥</text>
  7. <uni-stars :stars="parseInt(product.price1Grade)" :font-size='36' :width-info="180"></uni-stars>
  8. <view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
  9. </view>
  10. <view class="wrap-main-act">
  11. <view v-if="product.actStatus==1" class="floor-item-act">
  12. <view v-if="product.promotions.type == 1 && product.promotions.mode==1" class="floor-tags" @click.stop="click">
  13. {{product.promotions.name}}<text v-if="hasLogin">:¥{{ product.price | NumFormat }}</text>
  14. </view>
  15. <view v-else class="floor-tags" @click.stop="click">{{product.promotions.name}}</view>
  16. </view>
  17. <view v-if="product.actStatus ==0 && product.ladderPriceFlag==1" class="floor-item-act">
  18. <view class="floor-tags" @click.stop="click">阶梯价格</view>
  19. </view>
  20. <view class="floor-item-btn">
  21. <view class="btn" @click.stop="loginClick">登录查看价格</view>
  22. </view>
  23. </view>
  24. </template>
  25. <template v-else>
  26. <view v-if="userIdentity == 1" class="wrap-main-price">
  27. <view class="p-main">
  28. <view class="p-price tui-skeleton-fillet">
  29. <text class="txt sm">¥</text>
  30. <text class="txt big">{{retailPrice | NumFormat}}</text>
  31. </view>
  32. <view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
  33. </view>
  34. </view>
  35. <view v-if="userIdentity == 4">
  36. <view v-if="product.price1TextFlag == '1'" class="wrap-main-pricenone">
  37. <text class="wrap-main-text">¥未公开价格</text>
  38. </view>
  39. <view v-if="product.price1TextFlag == '2'" class="wrap-main-pricenone">
  40. <text class="wrap-main-text">¥价格仅会员可见</text>
  41. </view>
  42. <view v-if="product.price1TextFlag == '0'" class="wrap-main-price">
  43. <view class="p-main">
  44. <view class="p-price tui-skeleton-fillet">
  45. <text class="txt sm">¥</text>
  46. <text class="txt big">{{retailPrice | NumFormat}}</text>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
  51. </view>
  52. <view v-if="userIdentity == 2">
  53. <view v-if="product.price1TextFlag == '1'" class="wrap-main-pricenone">
  54. <text class="wrap-main-text">¥未公开价格</text>
  55. </view>
  56. <view v-else class="wrap-main-price">
  57. <view class="p-main">
  58. <view class="p-price tui-skeleton-fillet">
  59. <text class="txt sm">¥</text>
  60. <text class="txt big">{{retailPrice | NumFormat}}</text>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
  65. </view>
  66. <view class="wrap-main-act">
  67. <view v-if="product.actStatus==1" class="floor-item-act">
  68. <view v-if="product.promotions.type == 1 && product.promotions.mode==1" class="floor-tags" @click.stop="click">
  69. {{product.promotions.name}}<text v-if="hasLogin">:¥{{ product.price | NumFormat }}</text>
  70. </view>
  71. <view v-else class="floor-tags" @click.stop="click">{{product.promotions.name}}</view>
  72. </view>
  73. <view v-if="product.actStatus ==0 && product.ladderPriceFlag==1" class="floor-item-act">
  74. <view class="floor-tags" @click.stop="click">阶梯价格</view>
  75. </view>
  76. <view v-if="userIdentity == 4" class="floor-item-btn">
  77. <view class="btn" @click.stop="goUpgradeApply">去升级会员查看价格</view>
  78. </view>
  79. </view>
  80. </template>
  81. </view>
  82. </template>
  83. <script>
  84. import { mapState,mapMutations } from 'vuex'
  85. export default{
  86. name:'cm-price',
  87. props:{
  88. product:{
  89. type:Object,
  90. },
  91. userIdentity: {
  92. type: Number,
  93. default: 2
  94. },
  95. ladderPriceList:{
  96. type: Array,
  97. },
  98. retailPrice:{
  99. type:String,
  100. },
  101. minBuyNumber:{
  102. type: Number,
  103. default: 1
  104. }
  105. },
  106. data() {
  107. return{
  108. }
  109. },
  110. filters: {
  111. NumFormat:function(text) {//处理金额
  112. return Number(text).toFixed(2);
  113. },
  114. },
  115. created() {
  116. },
  117. computed: {
  118. ...mapState(['hasLogin','isWxAuthorize'])
  119. },
  120. methods:{
  121. goUpgradeApply(){
  122. this.$api.navigateTo('/pages/login/apply')
  123. },
  124. loginClick(){
  125. this.$api.navigateTo('/pages/login/login')
  126. }
  127. },
  128. }
  129. </script>
  130. <style lang="scss">
  131. </style>