Răsfoiți Sursa

Merge branch 'dev' of http://git.izouma.com/xiongzhu/raex_front into dev

panhui 3 ani în urmă
părinte
comite
84c971400b

+ 5 - 5
src/views/asset/Consignment.vue

@@ -166,11 +166,11 @@ export default {
             this.$http.post('/asset/getServicecharge?id=' + this.$route.query.id).then(res => {
                 this.serviceCharge = res;
             });
-            // if (res.category === '元域名') {
-            //     this.$http.get('/sysConfig/get/domain_service_charge,domain_price').then(res => {
-            //         this.minPrice = Number(res.domain_price.value);
-            //     });
-            // }
+            if (res.category === '元域名') {
+                this.$http.get('/sysConfig/get/domain_service_charge,domain_price').then(res => {
+                    this.minPrice = Number(res.domain_price.value);
+                });
+            }
         });
     },
     methods: {

+ 3 - 3
src/views/user/ShoppingCart.vue

@@ -316,6 +316,7 @@ export default {
                         this.collectionListSelected.forEach(item => {
                             cartIds.push(Number(item.collectionId));
                         });
+                        cartIds = cartIds.join(',');
                         this.$router.push({
                             path: '/shoppingCartSubmit',
                             query: {
@@ -611,11 +612,10 @@ export default {
                     }
 
                     .box-list_con_right_top_title_time {
-                        max-width: 114px;
                         height: 17px;
-                        background: #1e1e1e;
+                        // background: #1e1e1e;
                         border-radius: 2px;
-                        text-align: center;
+                        // text-align: center;
                         font-size: 10px;
                         font-weight: 400;
                         color: #939599;

+ 62 - 15
src/views/user/ShoppingCartSubmit.vue

@@ -79,7 +79,8 @@ export default {
             gas: 1,
             collectionList: [],
             collectionIds: '',
-            price: 0
+            price: 0,
+            collectionIdList: []
         };
     },
     computed: {
@@ -91,26 +92,72 @@ export default {
             if (window.cordova && window.cordova.platformId === 'ios' && this.$store.state.review) {
                 this.gas = 0;
             }
-            this.price = Number(this.$route.query.priceSum) + Number(this.gas) * this.$route.query.id.length;
             return Promise.resolve();
         });
         if (this.$route.query.id) {
-            let collectionIdList = this.$route.query.id;
-            if (collectionIdList.length == 7) {
-                this.$http.get('/collection/get/' + collectionIdList).then(res => {
-                    this.collectionList.push(res);
-                });
-            } else {
-                this.collectionIds = collectionIdList.join(',');
-                collectionIdList.forEach(item => {
-                    this.$http.get('/collection/get/' + item).then(res => {
-                        this.collectionList.push(res);
-                    });
-                });
-            }
+            this.collectionIdLis = this.$route.query.id.split(',');
+            // collectionIdList.forEach(item => {
+            //     this.$http.get('/collection/get/' + item).then(res => {
+            //         this.collectionList.push(res);
+            //     });
+            // });
+            this.getCollectionList(0, [], this.collectionIdLis);
         }
     },
     methods: {
+        getCollectionList(index, list, allList) {
+            console.log('gagagfasfa');
+            if (index >= allList.length) {
+                this.collectionList = list;
+                console.log('cgcgvcg', this.collectionList.length, this.$route.query.id.length);
+                this.collectionList.forEach(item => {
+                    this.price += Number(item.price);
+                });
+                this.price = Number(this.price) + Number(this.gas) * this.collectionList.length;
+                if (parseInt(this.price.toString()) != parseFloat(this.price.toString())) {
+                    this.price = this.price.toFixed(2);
+                }
+                if (this.collectionList.length == 0) {
+                    this.$dialog
+                        .alert({
+                            title: '提示',
+                            message: '订单存在已售罄的藏品'
+                        })
+                        .then(res => {
+                            this.$router.back();
+                        });
+                } else if (this.collectionList.length < this.collectionIdLis.length) {
+                    this.$dialog
+                        .alert({
+                            title: '提示',
+                            message: '订单存在已售罄的藏品,已重新刷新订单列表'
+                        })
+                        .then(res => {
+                            let newList = [];
+                            this.collectionList.forEach(item => {
+                                newList.push(item.id);
+                            });
+                            this.collectionIds = newList.join(',');
+                        });
+                } else if (this.collectionList.length == this.collectionIdLis.length) {
+                    let newList = [];
+                    this.collectionList.forEach(item => {
+                        newList.push(item.id);
+                    });
+                    this.collectionIds = newList.join(',');
+                }
+                return;
+            }
+            this.$http
+                .get('/collection/get/' + allList[index])
+                .then(res => {
+                    list.push(res);
+                    this.getCollectionList(index + 1, list, allList);
+                })
+                .catch(() => {
+                    this.getCollectionList(index + 1, list, allList);
+                });
+        },
         getOrder(next = false) {
             this.$http.get('/order/get/' + this.id).then(res => {
                 this.info = res;