order-invalid-modal.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <!-- 再次购买部分商品失效弹窗 -->
  3. <tui-modal :show="visible" @cancel="$emit('cancel')" :custom="true">
  4. <view class="tui-modal">
  5. <view class="goods-list">
  6. <view class="title">以下商品已失效,不能进行购买;是否先将其他商品加入购物车?</view>
  7. <scroll-view scroll-y class="goods-list-scroll">
  8. <view class="goods-section" v-for="(goods, index) in goodsList" :key="index">
  9. <image :src="goods.productImage" class="goods-cover"></image>
  10. <view class="goods-title">{{ goods.name }}</view>
  11. </view>
  12. </scroll-view>
  13. </view>
  14. <view class="tui-modal-button">
  15. <button class="modal-button cancel" @click="handleClick(0)">我再想想</button>
  16. <button class="modal-button confirm" @click="handleClick(1)">加入购物车</button>
  17. </view>
  18. </view>
  19. </tui-modal>
  20. </template>
  21. <script>
  22. export default {
  23. name: 'order-invalid-modal',
  24. props: {
  25. goodsList: {
  26. type: Array,
  27. default: () => []
  28. },
  29. visible: {
  30. type: Boolean,
  31. default: false
  32. }
  33. },
  34. methods: {
  35. handleClick(type) {
  36. this.$emit('confirm', { index: type })
  37. }
  38. }
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. .tui-modal {
  43. .goods-list {
  44. margin-bottom: 30rpx;
  45. .title {
  46. width: 100%;
  47. height: auto;
  48. font-size: 30rpx;
  49. text-align: justify;
  50. color: #333333;
  51. line-height: 1.6;
  52. margin-bottom: 30rpx;
  53. }
  54. .goods-list-scroll {
  55. width: 100%;
  56. max-height: 350rpx;
  57. .goods-section {
  58. width: 100%;
  59. display: flex;
  60. justify-content: space-between;
  61. align-items: center;
  62. margin-top: 24rpx;
  63. &:first-child{
  64. margin-top: 0;
  65. }
  66. .goods-cover {
  67. display: block;
  68. width: 86rpx;
  69. height: 86rpx;
  70. border-radius: 6rpx;
  71. border: 1px solid #e1e1e1;
  72. box-sizing: border-box;
  73. }
  74. .goods-title {
  75. flex: 1;
  76. height: 86rpx;
  77. margin-left: 18rpx;
  78. line-height: 1.6;
  79. font-size: 26rpx;
  80. color: #666666;
  81. text-overflow: ellipsis;
  82. text-align: justify;
  83. overflow: hidden;
  84. display: -webkit-box;
  85. -webkit-line-clamp: 2;
  86. line-clamp: 2;
  87. -webkit-box-orient: vertical;
  88. }
  89. }
  90. }
  91. }
  92. .tui-modal-button {
  93. width: 100%;
  94. height: 72rpx;
  95. display: flex;
  96. .modal-button {
  97. width: 200rpx;
  98. height: 72rpx;
  99. line-height: 72rpx;
  100. border-radius: 36rpx;
  101. box-sizing: border-box;
  102. &.cancel {
  103. border: 1px solid #b2b2b2;
  104. background: #ffffff;
  105. color: #333333;
  106. }
  107. &.confirm {
  108. background: linear-gradient(270deg, #f83c6c 0%, #fc32b4 100%);
  109. color: #ffffff;
  110. }
  111. }
  112. }
  113. }
  114. </style>