secondPrice.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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">登录查看价格</view>
  8. </view>
  9. <template v-else>
  10. <text class="p-no">¥</text>
  11. <text class="txt big" >详聊</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" v-if="product.detailTalkFlag==2">详聊</text>
  20. <text class="txt big" v-else>{{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 sm">¥</text>
  26. <text class="txt big">{{product.price | NumFormat}}</text>
  27. </view>
  28. </view>
  29. </template>
  30. </view>
  31. </template>
  32. <script>
  33. import { mapState,mapMutations } from 'vuex'
  34. export default{
  35. name:'second-price',
  36. props:{
  37. product:{
  38. type:Object,
  39. },
  40. },
  41. data() {
  42. return{
  43. }
  44. },
  45. filters: {
  46. NumFormat:function(text) {//处理金额
  47. return Number(text).toFixed(2);
  48. },
  49. },
  50. created() {
  51. console.log(this.product)
  52. },
  53. computed: {
  54. ...mapState(['hasLogin','isWxAuthorize','identity'])
  55. },
  56. methods:{
  57. loginClick(){
  58. this.$api.navigateTo('/pages/login/login')
  59. },
  60. },
  61. }
  62. </script>
  63. <style lang="scss">
  64. </style>