binding-list.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view>
  3. <view v-if="((propData || null) != null)" class="plugins-binding-container">
  4. <!-- 组合搭配 -->
  5. <block v-if="((propData.binding_list || null) != null)">
  6. <block v-for="(bv, bi) in propData.binding_list" :key="bi">
  7. <view v-if="((bv.goods || null) != null) && bv.goods.length > 0" class="plugins-binding-list padding-horizontal-main border-radius-main oh spacing-mb">
  8. <view class="spacing-nav-title oh">
  9. <text class="text-wrapper">{{bv.title}}</text>
  10. <view v-if="(bv.estimate_discount_price || 0) != 0" class="estimate-discount-price fr">
  11. <text class="discount-icon cr-white text-size-xs">节省</text>
  12. <text class="cr-green text-size-lg va-m">{{propCurrencySymbol}}{{bv.estimate_discount_price}}</text>
  13. </view>
  14. </view>
  15. <view class="left-content fl">
  16. <component-goods-list :propData="{style_type: 2, goods_list: bv.goods, multiple_items: 2}" :propLabel="propLabel" :propCurrencySymbol="propCurrencySymbol" :propIsAutoPlay="(propData.config.is_auto_play || 0) == 1"></component-goods-list>
  17. </view>
  18. <view class="right-content fr bs-bb padding-left-main tc">
  19. <button type="default" size="mini" class="bg-main br-main cr-white text-size-xs round" :data-value="'/pages/plugins/binding/detail/detail?id='+bv.id" @tap="url_event">{{bv.buy_button_text}}</button>
  20. <view class="sales-price margin-top-sm">{{propCurrencySymbol}}{{bv.estimate_price}}</view>
  21. <view v-if="(bv.estimate_original_price || 0) != 0" class="original-price margin-top-sm">{{propCurrencySymbol}}{{bv.estimate_original_price}}</view>
  22. </view>
  23. </view>
  24. </block>
  25. </block>
  26. <!-- 商品关联 -->
  27. <view v-if="((propData.relevant_data || null) != null)">
  28. <component-goods-list :propData="{title: propData.relevant_data.name, style_type: 2, goods_list: propData.relevant_data.data}" :propLabel="propLabel" :propCurrencySymbol="propCurrencySymbol" :propIsAutoPlay="(propData.config.is_auto_play_relevant || 0) == 1"></component-goods-list>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. const app = getApp();
  35. import componentGoodsList from "../goods-list/goods-list";
  36. export default {
  37. data() {
  38. return {};
  39. },
  40. components: {
  41. componentGoodsList
  42. },
  43. props: {
  44. propCurrencySymbol: {
  45. type: String,
  46. default: app.globalData.data.currency_symbol
  47. },
  48. propData: {
  49. type: [Array,Object],
  50. default: []
  51. },
  52. propLabel: {
  53. type: [Array,Object,String],
  54. default: null
  55. }
  56. },
  57. methods: {
  58. // url事件
  59. url_event(e) {
  60. app.globalData.url_event(e);
  61. }
  62. }
  63. };
  64. </script>
  65. <style>
  66. .plugins-binding-list {
  67. background: linear-gradient(to right, rgb(255 235 220), rgb(241 235 255));
  68. }
  69. .plugins-binding-list .left-content {
  70. width: 65%;
  71. }
  72. .plugins-binding-list .right-content {
  73. width: 35%;
  74. padding-top: 100rpx;
  75. }
  76. .plugins-binding-list .estimate-discount-price .discount-icon {
  77. border-top-right-radius: 30rpx;
  78. border-bottom-left-radius: 30rpx;
  79. background-image: linear-gradient(45deg,#a3f9a3,#248828,#8bc34a,#d2374c,#9c27b0);
  80. background-size: 400%;
  81. animation: gradient 5s ease infinite;
  82. padding: 0 16rpx;
  83. }
  84. @keyframes gradient {
  85. 0% {
  86. background-position: 0% 50%;
  87. }
  88. 50% {
  89. background-position: 100% 50%;
  90. }
  91. 100% {
  92. background-position: 0% 50%;
  93. }
  94. }
  95. </style>