You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

209 lines
4.7 KiB

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