secondPrice.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template name="second-price">
  2. <!-- 商品详情价格判断 -->
  3. <view class="wrap-main">
  4. <template v-if="!hasLogin">
  5. <view class="p-login grade tui-skeleton-fillet">
  6. <view class="floor-item-btn" v-if="product.detailTalkFlag !=2">
  7. <view class="btn" @click.stop="loginClick">{{ product.sold == 1 ? '已售二手商品不公开价格' : '登录查看价格' }}</view>
  8. </view>
  9. <template v-else>
  10. <text v-if="product.sold == 1">已售二手商品不公开价格</text>
  11. <text v-else><text class="txt sm">¥</text>价格详聊</text>
  12. </template>
  13. </view>
  14. </template>
  15. <template v-else>
  16. <view class="wrap-main-item" v-if="identity == 1">
  17. <view class="p-price tui-skeleton-fillet">
  18. <text class="txt sm">¥</text>
  19. <text class="txt big">{{product.price | NumFormat}}</text>
  20. </view>
  21. </view>
  22. <view class="wrap-main-item" v-else>
  23. <view class="p-price tui-skeleton-fillet">
  24. <text class="txt big" v-if="product.detailTalkFlag==2">
  25. <text v-if="product.sold == 1">已售二手商品不公开价格</text>
  26. <text v-else><text class="txt sm">¥</text>价格详聊</text>
  27. </text>
  28. <text class="txt big" v-else>
  29. <text v-if="product.sold == 1">已售二手商品不公开价格</text>
  30. <text v-else><text class="txt sm">¥</text>{{product.price | NumFormat}}</text>
  31. </text>
  32. </view>
  33. </view>
  34. </template>
  35. </view>
  36. </template>
  37. <script>
  38. import { mapState,mapMutations } from 'vuex'
  39. export default{
  40. name:'second-price',
  41. props:{
  42. product:{
  43. type:Object,
  44. },
  45. },
  46. data() {
  47. return{
  48. }
  49. },
  50. filters: {
  51. NumFormat:function(text) {//处理金额
  52. return Number(text).toFixed(2);
  53. },
  54. },
  55. created() {
  56. console.log(this.product)
  57. },
  58. computed: {
  59. ...mapState(['hasLogin','isWxAuthorize','identity'])
  60. },
  61. methods:{
  62. loginClick(){
  63. // 友盟埋点二手商品详情登录查看价格
  64. if(process.env.NODE_ENV != 'development'){
  65. this.$uma.trackEvent('Um_Event_SecondListLoginSubmit', {
  66. Um_Key_ProductId: `${this.product.productId}`,
  67. Um_Key_PageName: '二手详情登录查看价格',
  68. Um_Key_SourcePage: '二手商品详情',
  69. })
  70. }
  71. this.$api.navigateTo('/pages/login/login')
  72. },
  73. },
  74. }
  75. </script>
  76. <style lang="scss">
  77. </style>