main.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view class="shop-item row" @click="triggerGoDetail">
  3. <view class="layout-shop-image relative overflow">
  4. <v-image :src="item.image" class="screen_all"></v-image>
  5. </view>
  6. <view class="flex-all-1 flex shop-item-content overflow">
  7. <view class="shop-item-title line-2"
  8. :class="[periods>0?'line-1':'line-2',periods>0?'shop-item-title-1':'']"
  9. >{{item.title || ''}}</view>
  10. <view v-if="periods>0" class="shop-item-label center">周期购</view>
  11. <view class="flex-all-1"></view>
  12. <view class="row aCenter">
  13. <view class="flex-all-1 row aCenter">
  14. <text class="shop-price-group"><text class="shop-price-em">¥</text><text>{{item.price || ''}}</text></text>
  15. <text v-if="periods>0" class="row aCenter shop-periods shop-close-container">
  16. <text class="iconfont-close iconfont shop-close"></text>
  17. <text>{{ periods }}期</text>
  18. </text>
  19. </view>
  20. <text v-if="number" class="row aCenter shop-close-container">
  21. <text class="iconfont-close iconfont shop-close"></text>
  22. <text>{{ item.number || 1 }}</text>
  23. </text>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import vImage from '@/components/v-image/main.vue';
  30. import { mapState } from 'vuex';
  31. import props from './props';
  32. import shop from '@/utils/controls/shop';
  33. export default {
  34. name: "layout-ui-shop-item",
  35. computed:{
  36. ...mapState(['config'])
  37. },
  38. props,
  39. components:{
  40. vImage
  41. },
  42. methods:{
  43. triggerGoDetail(){
  44. if (this.goDetail) {
  45. return shop.goShopDetail(this.item);
  46. }
  47. }
  48. }
  49. }
  50. </script>
  51. <style scoped lang="scss" src="./style.scss"></style>