cm-order-invalid-modal.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. props: {
  24. goodsList: {
  25. type: Array,
  26. default: () => []
  27. },
  28. visible: {
  29. type: Boolean,
  30. default: false
  31. }
  32. },
  33. methods: {
  34. handleClick(type) {
  35. this.$emit('confirm', { index: type })
  36. }
  37. }
  38. }
  39. </script>
  40. <style lang="scss" scoped>
  41. .tui-modal {
  42. .goods-list {
  43. margin-bottom: 30rpx;
  44. .title {
  45. width: 100%;
  46. height: auto;
  47. font-size: 30rpx;
  48. text-align: justify;
  49. color: #333333;
  50. line-height: 1.6;
  51. margin-bottom: 30rpx;
  52. }
  53. .goods-list-scroll {
  54. width: 100%;
  55. max-height: 350rpx;
  56. .goods-section {
  57. width: 100%;
  58. display: flex;
  59. justify-content: space-between;
  60. align-items: center;
  61. margin-top: 24rpx;
  62. &:first-child{
  63. margin-top: 0;
  64. }
  65. .goods-cover {
  66. display: block;
  67. width: 86rpx;
  68. height: 86rpx;
  69. border-radius: 6rpx;
  70. border: 1px solid #e1e1e1;
  71. box-sizing: border-box;
  72. }
  73. .goods-title {
  74. flex: 1;
  75. height: 86rpx;
  76. margin-left: 18rpx;
  77. line-height: 1.6;
  78. font-size: 26rpx;
  79. color: #666666;
  80. text-overflow: ellipsis;
  81. text-align: justify;
  82. overflow: hidden;
  83. display: -webkit-box;
  84. -webkit-line-clamp: 2;
  85. line-clamp: 2;
  86. -webkit-box-orient: vertical;
  87. }
  88. }
  89. }
  90. }
  91. .tui-modal-button {
  92. width: 100%;
  93. height: 72rpx;
  94. display: flex;
  95. .modal-button {
  96. width: 200rpx;
  97. height: 72rpx;
  98. line-height: 72rpx;
  99. border-radius: 36rpx;
  100. box-sizing: border-box;
  101. &.cancel {
  102. border: 1px solid #b2b2b2;
  103. background: #ffffff;
  104. color: #333333;
  105. }
  106. &.confirm {
  107. background: $btn-confirm;
  108. color: #ffffff;
  109. }
  110. }
  111. }
  112. }
  113. </style>