index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <view>
  3. <view class="cartList" :class="cartData.iScart?'on':''">
  4. <view class="title acea-row row-between-wrapper">
  5. <view class="name">{{$t(`已选商品`)}}</view>
  6. <view class="del acea-row row-middle" @click="subDel">
  7. <view class="iconfont icon-shanchu1"></view>{{$t(`清空`)}}
  8. </view>
  9. </view>
  10. <view class="list">
  11. <view class="item acea-row row-between-wrapper" v-for="(item,index) in cartData.cartList" :key="index">
  12. <view class="pictrue">
  13. <image v-if="item.productInfo.attrInfo" :src='item.productInfo.attrInfo.image'></image>
  14. <image v-else :src='item.productInfo.image'></image>
  15. <view class="mantle" v-if="!item.status || !item.attrStatus"></view>
  16. </view>
  17. <view class="txtPic">
  18. <view class="name line2" :class="(item.attrStatus && item.status)?'':'on'">
  19. {{item.productInfo.store_name}}</view>
  20. <view v-if="item.attrStatus && item.status">
  21. <view class="info" v-if="item.productInfo.attrInfo">{{item.productInfo.attrInfo.suk}}</view>
  22. <view class="bottom acea-row row-between-wrapper">
  23. <view class="money">{{$t(`¥`)}}<text class="num">{{item.truePrice}}</text></view>
  24. <view class="cartNum acea-row row-middle">
  25. <view class="reduce iconfont icon-jianhao1" @click="leaveCart(index)"></view>
  26. <view class="num">{{item.cart_num}}</view>
  27. <view class="plus iconfont icon-jiahao1" @click="joinCart(index)"></view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="noBnt" v-else-if="!item.attrStatus">{{$t(`已售罄`)}}</view>
  32. <view class="noBnt" v-else-if="!item.status">{{$t(`已下架`)}}</view>
  33. <view class="delTxt acea-row row-right" v-if="!item.status || !item.attrStatus"><text
  34. @click="oneDel(item.id,index)">{{$t(`删除`)}}</text></view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="mask" v-if="cartData.iScart" @click="closeList"></view>
  40. </view>
  41. </template>
  42. <script>
  43. export default {
  44. props: {
  45. cartData: {
  46. type: Object,
  47. default: () => {}
  48. }
  49. },
  50. data() {
  51. return {};
  52. },
  53. mounted() {},
  54. methods: {
  55. closeList() {
  56. this.$emit('closeList', false);
  57. },
  58. leaveCart(index) {
  59. this.$emit('ChangeCartNumDan', false, index);
  60. },
  61. joinCart(index) {
  62. this.$emit('ChangeCartNumDan', true, index);
  63. },
  64. subDel() {
  65. this.$emit('ChangeSubDel');
  66. },
  67. oneDel(id, index) {
  68. this.$emit('ChangeOneDel', id, index);
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss">
  74. .mask {
  75. z-index: 99;
  76. }
  77. .cartList {
  78. position: fixed;
  79. left: 0;
  80. bottom: 0;
  81. width: 100%;
  82. background-color: #fff;
  83. z-index: 100;
  84. padding: 0 30rpx 100rpx 30rpx;
  85. box-sizing: border-box;
  86. border-radius: 16rpx 16rpx 0 0;
  87. transform: translate3d(0, 100%, 0);
  88. transition: all .3s cubic-bezier(.25, .5, .5, .9);
  89. &.on {
  90. transform: translate3d(0, 0, 0);
  91. }
  92. .title {
  93. height: 108rpx;
  94. .name {
  95. font-size: 28rpx;
  96. color: #282828;
  97. font-weight: bold;
  98. }
  99. .del {
  100. font-size: 26rpx;
  101. color: var(--view-theme);
  102. .iconfont {
  103. margin-right: 5rpx;
  104. font-size: 34rpx;
  105. }
  106. }
  107. }
  108. .list {
  109. max-height: 720rpx;
  110. overflow-x: hidden;
  111. overflow-y: auto;
  112. .item {
  113. margin-bottom: 40rpx;
  114. .pictrue {
  115. width: 176rpx;
  116. height: 176rpx;
  117. border-radius: 16rpx;
  118. position: relative;
  119. image {
  120. width: 100%;
  121. height: 100%;
  122. border-radius: 16rpx;
  123. }
  124. .mantle {
  125. position: absolute;
  126. top: 0;
  127. left: 0;
  128. width: 100%;
  129. height: 100%;
  130. background: rgba(255, 255, 255, 0.65);
  131. border-radius: 16rpx;
  132. }
  133. }
  134. .txtPic {
  135. width: 486rpx;
  136. .name {
  137. font-size: 28rpx;
  138. color: #282828;
  139. &.on {
  140. color: #A3A3A3;
  141. }
  142. }
  143. .noBnt {
  144. width: 126rpx;
  145. height: 44rpx;
  146. background: rgba(242, 242, 242, 1);
  147. border-radius: 22rpx;
  148. text-align: center;
  149. line-height: 44rpx;
  150. font-size: 24rpx;
  151. color: #A3A3A3;
  152. margin-top: 10rpx;
  153. }
  154. .delTxt {
  155. margin-top: 48rpx;
  156. font-size: 24rpx;
  157. color: #E93323;
  158. text {
  159. width: 70rpx;
  160. height: 50rpx;
  161. text-align: center;
  162. line-height: 50rpx;
  163. }
  164. }
  165. .info {
  166. font-size: 23rpx;
  167. color: #989898;
  168. margin-top: 5rpx;
  169. }
  170. .bottom {
  171. margin-top: 11rpx;
  172. .money {
  173. font-weight: bold;
  174. font-size: 26rpx;
  175. color: var(--view-priceColor);
  176. .num {
  177. font-size: 34rpx;
  178. }
  179. }
  180. .cartNum {
  181. font-weight: bold;
  182. .num {
  183. font-size: 34rpx;
  184. color: #282828;
  185. width: 120rpx;
  186. text-align: center;
  187. }
  188. .reduce {
  189. color: #282828;
  190. font-size: 24rpx;
  191. width: 60rpx;
  192. height: 60rpx;
  193. text-align: center;
  194. line-height: 60rpx;
  195. }
  196. .plus {
  197. color: #282828;
  198. font-size: 24rpx;
  199. width: 60rpx;
  200. height: 60rpx;
  201. text-align: center;
  202. line-height: 60rpx;
  203. }
  204. }
  205. }
  206. }
  207. }
  208. }
  209. }
  210. </style>