1
0

app-goods-flash-sale.vue 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <view class="f-flash">
  3. <view class="f-con cross-center" :class="theme !== 'a' ? theme + '-m-back-p ' + theme : ''"
  4. :style="{backgroundImage: theme === 'a' ? `url(${flash_sale.cover})` : ''}" @click="navigator">
  5. <view class="f-sign" :class="theme + '-m-back ' + theme">限时抢购</view>
  6. <view class="f-title">
  7. {{flash_sale.discount_type == 2 ? '减': ''}}
  8. {{flash_sale.min_discount}}
  9. {{flash_sale.discount_type == 2 ? '元' : '折'}}&nbsp;&nbsp;
  10. {{flash_sale.time_status == 1 ? flash_sale.start_at : flash_sale.end_at}}
  11. {{flash_sale.time_status == 1 ? '开始' : '结束'}}
  12. </view>
  13. <view class="f-text" :class="theme + '-m-text ' + theme">
  14. 点我去{{flash_sale.time_status == 1 ? '加' : '抢'}}购
  15. </view>
  16. <image class="f-icon" src="/static/image/icon/flash-sale.gif"></image>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. name: "app-goods-flash-sale",
  23. props: {
  24. flash_sale: {
  25. type: Object,
  26. default() {
  27. return {
  28. time_status: 1,
  29. start_at: '',
  30. end_at: '',
  31. min_discount: ''
  32. }
  33. }
  34. },
  35. theme: String
  36. },
  37. methods: {
  38. navigator() {
  39. uni.navigateTo({
  40. url: this.flash_sale.url
  41. })
  42. }
  43. }
  44. }
  45. </script>
  46. <style scoped lang="scss">
  47. .f-flash {
  48. padding: 16upx 24upx;
  49. background-color: #ffffff;
  50. }
  51. .f-con {
  52. width: 702upx;
  53. height: 88upx;
  54. position: relative;
  55. background-repeat: no-repeat;
  56. background-size: 100% 100%;
  57. border-radius: 16upx;
  58. }
  59. .f-back {
  60. width: 100%;
  61. height: 100%;
  62. position: absolute;
  63. }
  64. .f-sign {
  65. height: 34upx;
  66. width: 100upx;
  67. font-size: 20upx;
  68. color: #fff;
  69. text-align: center;
  70. line-height: 34upx;
  71. border-radius: 17upx;
  72. margin:0 20upx;
  73. }
  74. .f-title {
  75. font-size: 26upx;
  76. color: #353535;
  77. }
  78. .f-icon {
  79. width: 54upx;
  80. height: 63upx;
  81. position: absolute;
  82. right: 22upx;
  83. }
  84. .f-text {
  85. font-size: 26upx;
  86. position: absolute;
  87. right: 80upx;
  88. font-weight: bold;
  89. }
  90. </style>