panhui il y a 3 ans
Parent
commit
22aef5bcf7
3 fichiers modifiés avec 50 ajouts et 11 suppressions
  1. 13 6
      src/components/auction/deposit.vue
  2. 4 3
      src/views/auction/Detail.vue
  3. 33 2
      src/views/auction/Offer.vue

+ 13 - 6
src/components/auction/deposit.vue

@@ -122,7 +122,8 @@ export default {
             timer: null,
             showPwdDialog: false,
             showKeyboard: false,
-            tradeCode: ''
+            tradeCode: '',
+            money: 0
         };
     },
     mounted() {
@@ -215,7 +216,8 @@ export default {
         onAdd() {
             this.$router.push('/mineAddress?page=submit&chooseId=' + this.addressInfo.id);
         },
-        init() {
+        init(money = 0) {
+            this.money = money;
             this.time = this.getTime(this.info.endTime);
             this.show = true;
         },
@@ -315,7 +317,12 @@ export default {
             });
         },
         createOrder() {
-            let form = { userId: this.$store.state.userInfo.id, auctionId: this.info.id, type: 'DEPOSIT' };
+            let form = {
+                userId: this.$store.state.userInfo.id,
+                auctionId: this.info.id,
+                type: 'DEPOSIT',
+                amount: this.money
+            };
             if (!this.isNFT) {
                 form.addressId = this.addressInfo.id;
             }
@@ -453,7 +460,7 @@ export default {
                                 tradeCode: this.tradeCode
                             })
                             .then(res => {
-                                this.$toast.success('支付成功');
+                                this.$toast.success('出价成功');
                                 setTimeout(() => {
                                     setTimeout(() => {
                                         this.$emit('refreash');
@@ -467,7 +474,7 @@ export default {
                     }
                 });
             } else {
-                this.$toast.success('支付成功');
+                this.$toast.success('出价成功');
                 setTimeout(() => {
                     this.$emit('refreash');
                 }, 1000);
@@ -582,7 +589,7 @@ export default {
                         }
                     });
                 } else {
-                    this.$toast.success('支付成功');
+                    this.$toast.success('出价成功');
                     setTimeout(() => {
                         this.$emit('refreash');
                     }, 1000);

+ 4 - 3
src/views/auction/Detail.vue

@@ -434,9 +434,10 @@ export default {
             });
         },
         goDeposit() {
-            this.checkLogin().then(() => {
-                this.$refs.deposit.init();
-            });
+            this.goCreated();
+            // this.checkLogin().then(() => {
+            //     this.$refs.deposit.init();
+            // });
         },
         goCreated() {
             this.$router.push('/auctionOffer?auctionId=' + this.auctionId);

+ 33 - 2
src/views/auction/Offer.vue

@@ -42,19 +42,32 @@
                 <div class="empty" v-if="records.length === 0">暂无数据</div>
             </div>
         </div>
+
+        <auction-deposit
+            @showRule="$refs.rule.show = true"
+            ref="deposit"
+            :info="info"
+            @changePopup="changePopup"
+            @refreash="onRefresh"
+        ></auction-deposit>
+
+        <auction-rule ref="rule" @changePopup="changePopup"></auction-rule>
     </div>
 </template>
 
 <script>
 import auction from '../../mixins/auction';
 import auctionInfo from '../../components/auction/info.vue';
+import AuctionDeposit from '../../components/auction/deposit.vue';
+import AuctionRule from '../../components/auction/rule.vue';
 export default {
     data() {
         return {
             auctionId: 0,
             info: {},
             recordInfo: {},
-            records: []
+            records: [],
+            showPopup: false
         };
     },
     computed: {
@@ -66,7 +79,9 @@ export default {
         }
     },
     components: {
-        auctionInfo
+        auctionInfo,
+        AuctionDeposit,
+        AuctionRule
     },
     mounted() {
         if (this.$route.query.auctionId) {
@@ -130,6 +145,10 @@ export default {
             });
         },
         submit() {
+            if (!this.recordInfo.payDeposit) {
+                this.goDeposit();
+                return;
+            }
             this.$toast.loading({
                 message: '加载中...',
                 forbidClick: true
@@ -151,6 +170,18 @@ export default {
                         this.$toast(e.error);
                     }
                 });
+        },
+        changePopup(flag = false) {
+            this.showPopup = flag;
+        },
+        onRefresh() {
+            this.$router.back();
+        },
+        goDeposit() {
+            // this.goCreated();
+            this.checkLogin().then(() => {
+                this.$refs.deposit.init(this.value);
+            });
         }
     }
 };