index.vue 4.9 KB

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