secondPrice.vue 2.2 KB

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