yuanyuan 3 лет назад
Родитель
Сommit
b3752a8590
1 измененных файлов с 79 добавлено и 39 удалено
  1. 79 39
      src/views/user/ShoppingCart.vue

+ 79 - 39
src/views/user/ShoppingCart.vue

@@ -65,13 +65,16 @@
                         @click="settle(index)"
                     >
                         <img :src="item.check ? select : unchecked" alt="" class="box-list_con_check" />
-                        <van-image
-                            width="80"
-                            height="80"
-                            :src="getImg(changeImgs(item.picFile))"
-                            fit="contain"
-                            radius="8"
-                        />
+                        <div class="cart_img">
+                            <van-image
+                                width="80"
+                                height="80"
+                                :src="getImg(changeImgs(item.picFile))"
+                                fit="contain"
+                                radius="8"
+                            />
+                            <div class="cart_img_tip" v-if="item.inPaying == true">支付中</div>
+                        </div>
                         <div v-if="item.type == 'DOMAIN'" class="box-list_con_right">
                             <div class="box-list_con_right_top">
                                 <img
@@ -278,6 +281,9 @@ export default {
             if (this.active == 'SELLOUT' && !this.showDelete) {
                 return;
             }
+            // if (this.collectionList[index].inPaying || this.collectionList[index].enabled == false) {
+            //     return;
+            // }
             this.collectionList[index].check = !this.collectionList[index].check;
             let newCollectionList = this.collectionList.filter(item => item.check == true);
             this.collectionListSelected = newCollectionList;
@@ -311,46 +317,60 @@ export default {
                 return;
             } else {
                 let newEnabled = '';
+                let newEnableds = '';
                 newEnabled = [...this.collectionListSelected].find(item => {
                     return item.enabled == false;
                 });
+                newEnableds = [...this.collectionListSelected].find(item => {
+                    return item.inPaying == true;
+                });
                 this.collectionListSelected.forEach(item => {
-                    if (newEnabled) {
+                    if (newEnableds) {
                         Dialog.confirm({
-                            title: '有藏品已售罄,无法购买!',
-                            confirmButtonText: '一键删除',
-                            cancelButtonText: '再想想',
-                            confirmButtonColor: '#FF4F50',
-                            cancelButtonColor: '#626366'
+                            title: '有未支付藏品,无法购买!',
+                            confirmButtonText: '确定',
+                            confirmButtonColor: '#FF4F50'
                         })
-                            .then(() => {
-                                this.collectionListSelected.forEach(item => {
-                                    if (item.enabled == true) {
-                                        item.check = false;
-                                        this.checkAllStatus = false;
-                                    }
-                                });
-                                this.collectionListSelected = this.collectionListSelected.filter(
-                                    item => item.enabled == false
-                                );
-                                this.totalSettlement = this.collectionListSelected.length;
-                                this.price = 0;
-                                this.del();
-                            })
+                            .then(() => {})
                             .catch(() => {});
                     } else {
-                        let cartIds = [];
-                        this.collectionListSelected.forEach(item => {
-                            cartIds.push(Number(item.collectionId));
-                        });
-                        cartIds = cartIds.join(',');
-                        this.$router.push({
-                            path: '/shoppingCartSubmit',
-                            query: {
-                                id: cartIds,
-                                priceSum: this.price
-                            }
-                        });
+                        if (newEnabled) {
+                            Dialog.confirm({
+                                title: '有藏品已售罄,无法购买!',
+                                confirmButtonText: '一键删除',
+                                cancelButtonText: '再想想',
+                                confirmButtonColor: '#FF4F50',
+                                cancelButtonColor: '#626366'
+                            })
+                                .then(() => {
+                                    this.collectionListSelected.forEach(item => {
+                                        if (item.enabled == true) {
+                                            item.check = false;
+                                            this.checkAllStatus = false;
+                                        }
+                                    });
+                                    this.collectionListSelected = this.collectionListSelected.filter(
+                                        item => item.enabled == false
+                                    );
+                                    this.totalSettlement = this.collectionListSelected.length;
+                                    this.price = 0;
+                                    this.del();
+                                })
+                                .catch(() => {});
+                        } else {
+                            let cartIds = [];
+                            this.collectionListSelected.forEach(item => {
+                                cartIds.push(Number(item.collectionId));
+                            });
+                            cartIds = cartIds.join(',');
+                            this.$router.push({
+                                path: '/shoppingCartSubmit',
+                                query: {
+                                    id: cartIds,
+                                    priceSum: this.price
+                                }
+                            });
+                        }
                     }
                 });
             }
@@ -497,6 +517,26 @@ export default {
         background-repeat: no-repeat;
     }
 }
+.cart_img {
+    width: 80px;
+    height: 80px;
+    position: relative;
+    .cart_img_tip {
+        background: rgba(0, 0, 0, 0.5);
+        border-radius: 12px;
+        backdrop-filter: blur(1px);
+        width: 56px;
+        height: 20px;
+        font-size: 12px;
+        text-align: center;
+        color: #ffffff;
+        line-height: 20px;
+        position: absolute;
+        left: 50%;
+        top: 50%;
+        transform: translate(-50%, -50%);
+    }
+}
 /deep/ .van-dialog__header {
     padding-top: 24px !important;
 }