cm-price.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template name="cm-price">
  2. <!-- 商品详情价格判断 -->
  3. <view class="wrap-main">
  4. <view class="" v-if="userIdentity == 1">
  5. <view class="wrap-main-price">
  6. <view class="p-main" v-if="product.ladderPriceFlag == '0' || product.actStatus == 1">
  7. <view class="p-active" v-if="product.actStatus == 1">
  8. <image class="icon-active" :src="iconActive" mode="" ></image>
  9. </view>
  10. <view class="p-price tui-skeleton-fillet">
  11. <text class="txt sm">¥</text>
  12. <text class="txt big">{{retailPrice}}</text>
  13. <text class="txt big">{{smallMoney== '0'?'.00':smallMoney}}</text>
  14. </view>
  15. <view class="p-price-none" v-if="product.actStatus == 1">¥{{product.price1.toFixed(2)}}</view>
  16. <view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
  17. </view>
  18. <view class="wrap-ladder" v-else>
  19. <view class="ladder-main tui-skeleton-fillet">
  20. <view class="ladder-left">
  21. <view class="ladder-b">起订量:</view>
  22. <view class="ladder-b">价格:</view>
  23. </view>
  24. <view class="ladder-right">
  25. <view class="ladder-li" v-for="(ladder,index) in ladderPriceList" :key="index">
  26. <view class="ladder-a">{{ladder.buyNumRangeShow}}</view>
  27. <view class="ladder-a">¥{{ladder.buyPrice.toFixed(2)}}</view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="" v-if="userIdentity == 4">
  35. <view class="wrap-main-pricenone" v-if="product.price1TextFlag == '1'">
  36. <text>未公开价格</text>
  37. </view>
  38. <view class="wrap-main-pricenone" v-if="product.price1TextFlag == '2'">
  39. <text class="wrap-main-text">价格仅会员可见</text>
  40. <text class="wrap-main-none" @click.stop="goUpgradeApply">去升级会员查看价格<text class="iconfont icon-xiayibu" style="font-size: 22rpx;margin: 0 6rpx;"></text></text>
  41. </view>
  42. <view class="wrap-main-price" v-if="product.price1TextFlag == '0'">
  43. <view class="p-main" v-if="product.ladderPriceFlag == '0' || product.actStatus == 1">
  44. <view class="p-active" v-if="product.actStatus == 1">
  45. <image class="icon-active" :src="iconActive" mode="" ></image>
  46. </view>
  47. <view class="p-price tui-skeleton-fillet">
  48. <text class="txt sm">¥</text>
  49. <text class="txt big">{{retailPrice}}</text>
  50. <text class="txt big">{{smallMoney== '0'?'.00':smallMoney}}</text>
  51. </view>
  52. <view class="p-price-none" v-if="product.actStatus == 1">¥{{product.price1.toFixed(2)}}</view>
  53. <view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
  54. </view>
  55. <view class="wrap-ladder" v-else>
  56. <view class="ladder-main tui-skeleton-fillet">
  57. <view class="ladder-left">
  58. <view class="ladder-b">起订量:</view>
  59. <view class="ladder-b">价格:</view>
  60. </view>
  61. <view class="ladder-right">
  62. <view class="ladder-li" v-for="(ladder,index) in ladderPriceList" :key="index">
  63. <view class="ladder-a">{{ladder.buyNumRangeShow}}</view>
  64. <view class="ladder-a">¥{{ladder.buyPrice.toFixed(2)}}</view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="" v-if="userIdentity == 2">
  72. <view class="wrap-main-pricenone" v-if="product.price1TextFlag == 1">
  73. <text>未公开价格</text>
  74. </view>
  75. <view class="wrap-main-price" v-else>
  76. <view class="p-main" v-if="product.ladderPriceFlag == '0' || product.actStatus == 1">
  77. <view class="p-active" v-if="product.actStatus == 1">
  78. <image class="icon-active" :src="iconActive" mode="" ></image>
  79. </view>
  80. <view class="p-price tui-skeleton-fillet">
  81. <text class="txt sm">¥</text>
  82. <text class="txt big">{{retailPrice}}</text>
  83. <text class="txt big">{{smallMoney== '0'?'.00':smallMoney}}</text>
  84. </view>
  85. <view class="p-price-none" v-if="product.actStatus == 1">¥{{product.price1.toFixed(2)}}</view>
  86. <view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
  87. </view>
  88. <view class="wrap-ladder" v-else>
  89. <view class="ladder-main tui-skeleton-fillet">
  90. <view class="ladder-left">
  91. <view class="ladder-b">起订量:</view>
  92. <view class="ladder-b">价格:</view>
  93. </view>
  94. <view class="ladder-right">
  95. <view class="ladder-li" v-for="(ladder,index) in ladderPriceList" :key="index">
  96. <view class="ladder-a">{{ladder.buyNumRangeShow}}</view>
  97. <view class="ladder-a">¥{{ladder.buyPrice.toFixed(2)}}</view>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </template>
  106. <script>
  107. import iconActive from '@/static/temp/icon-active.png'
  108. export default{
  109. name:'cm-price',
  110. props:{
  111. product:{
  112. type:Object,
  113. },
  114. userIdentity: {
  115. type: Number,
  116. default: 2
  117. },
  118. ladderPriceList:{
  119. type: Array,
  120. },
  121. retailPrice:{
  122. type:String,
  123. },
  124. smallMoney:{
  125. type:String,
  126. },
  127. minBuyNumber:{
  128. type: Number,
  129. default: 1
  130. }
  131. },
  132. data() {
  133. return{
  134. iconActive:iconActive
  135. }
  136. },
  137. created() {
  138. },
  139. methods:{
  140. goUpgradeApply(){
  141. this.$api.navigateTo('/pages/login/apply')
  142. },
  143. toFixedFn(text){//处理小数点后两位数
  144. return Number(text).toFixed(2);
  145. },
  146. },
  147. }
  148. </script>
  149. <style lang="scss">
  150. </style>