panhui 4 лет назад
Родитель
Сommit
0e239ca88a

+ 2 - 2
src/mixins/auctionOrder.js

@@ -13,8 +13,8 @@ export default {
             ],
             paymentTypeOptions: [
                 { label: '保证金', value: 'DEPOSIT' },
-                { label: '成交金', value: 'PURCHASE_PRICE' },
-                { label: '一口价', value: 'FIXED_PRICE' }
+                { label: '成交金', value: 'PURCHASE_PRICE', text: '你已竞价成功' },
+                { label: '一口价', value: 'FIXED_PRICE', text: '一口价支付' }
             ],
             statusOptions: [
                 { label: '未支付', value: 'NOT_PAID' },

+ 0 - 5
src/mixins/common.js

@@ -177,14 +177,9 @@ export default {
             }
         },
         getLabelName(val = '', list = [], key = 'label') {
-            console.log(list);
-            console.log(val);
             let info = list.find(item => {
                 return item.value === val;
             });
-
-            console.log(info);
-
             return info ? info[key] : '';
         },
         scrollRefreash() {

+ 6 - 2
src/views/auction/Detail.vue

@@ -125,7 +125,11 @@
                 </div>
                 <div
                     class="btn-list not"
-                    v-else-if="info.status === 'PURCHASED' || info.status === 'FIXED_PRICE_PURCHASED'"
+                    v-else-if="
+                        info.status === 'PURCHASED' ||
+                        info.status === 'FIXED_PRICE_PURCHASED' ||
+                        info.status === 'FINISH'
+                    "
                 >
                     <van-button disabled block round>竞拍结束</van-button>
                 </div>
@@ -205,7 +209,7 @@ export default {
         const [timeDown, toggleTime] = useToggle(false);
         const countDown = useCountDown({
             onFinish: () => {
-                toggleTime(true);
+                toggleTime();
             }
         });
 

+ 7 - 2
src/views/auction/Home.vue

@@ -35,7 +35,11 @@
                 :to="{ path: '/auctionList', query: { status: 'ONGOING', pageName: '随时拍' } }"
                 text="随时拍"
             />
-            <van-grid-item :icon="require('../../assets/suishi.png')" text="一口价" />
+            <van-grid-item
+                :icon="require('../../assets/suishi.png')"
+                :to="{ path: '/auctionList', query: { hasFixedPrice: false, pageName: '一口价' } }"
+                text="一口价"
+            />
             <van-grid-item
                 :icon="require('../../assets/shuzi.png')"
                 :to="{ path: '/auctionList', query: { auctionType: 'NFT', pageName: '数字艺术' } }"
@@ -120,7 +124,8 @@ export default {
         beforeData() {
             return {
                 query: {
-                    auctionType: this.auctionType
+                    auctionType: this.auctionType,
+                    status: 'NOTSTARTED,ONGOING'
                 }
             };
         },

+ 8 - 2
src/views/auction/List.vue

@@ -122,7 +122,8 @@ export default {
             banners: [],
             swiperRef: null,
             pageName: '',
-            status: ''
+            status: '',
+            hasFixedPrice: ''
         };
     },
     computed: {
@@ -162,6 +163,10 @@ export default {
             this.status = this.$route.query.status;
         }
 
+        if (this.$route.query.hasFixedPrice === 'false' || this.$route.query.hasFixedPrice === false) {
+            this.hasFixedPrice = false;
+        }
+
         if (this.$route.query.pageName) {
             this.pageName = this.$route.query.pageName;
         }
@@ -200,7 +205,8 @@ export default {
                 query: {
                     auctionType: this.auctionType,
                     del: false,
-                    status: this.status
+                    status: this.status,
+                    hasFixedPrice: this.hasFixedPrice
                 },
                 sort: this.sort === 'id,desc' ? this.sortOptions[this.title] || sort : sort
             };

+ 100 - 21
src/views/auction/Submit.vue

@@ -1,6 +1,10 @@
 <template>
     <div class="submit">
-        <van-notice-bar :text="getLabelName(paymentType, paymentTypeOptions)" background="#FF7F1F" color="#fff" />
+        <van-notice-bar
+            :text="getLabelName(paymentType, paymentTypeOptions, 'text')"
+            background="#FF7F1F"
+            color="#fff"
+        />
         <div class="address" v-if="!isNFT">
             <div class="van-address-item van-contact-card" @click="onAdd">
                 <div class="van-cell van-cell--borderless">
@@ -18,17 +22,18 @@
             </div>
         </div>
         <div class="assets">
-            <div class="assets-product">
+            <div class="assets-product" :class="{ isEnd: isEnd }">
                 <van-image width="80" height="80" radius="6" :src="getImg(changeImgs(info.pic))" fit="cover" />
                 <div class="assets-info">
                     <div class="text1">{{ info.name }}</div>
                     <div class="flex1"></div>
 
                     <div class="text2">
-                        <div class="time">
+                        <div class="time" v-if="!isEnd">
                             <img src="../../assets/info_icon_time.png" alt="" />
-                            <span>距结束:<van-count-down :time="time" format="HH 小时 mm 分 ss 秒" /></span>
+                            <span>{{ timeText }}:<van-count-down :time="time" format="HH 小时 mm 分 ss 秒" /></span>
                         </div>
+                        <div class="time" v-else>{{ timeText }}</div>
                     </div>
                     <!-- <div class="text2" v-if="info.category">类型:{{ info.category }}</div>
                     <div class="text2" v-if="info.number">编号:{{ info.number }}</div> -->
@@ -38,8 +43,8 @@
 
         <div class="text-list">
             <div class="text-info">
-                <span class="text1">一口价</span>
-                <span class="text2">¥{{ info.fixedPrice }}</span>
+                <span class="text1">{{ getLabelName(paymentType, paymentTypeOptions) }}</span>
+                <span class="text2">¥{{ preMoney }}</span>
             </div>
 
             <div class="text-info">
@@ -50,6 +55,20 @@
                 <span class="text1">实际支付</span>
                 <span class="text2 prim">¥{{ money }}</span>
             </div>
+
+            <div class="text-cell">
+                <div class="text-top">
+                    <span class="text1">保证金</span>
+                    <span class="text2 warn">¥{{ info.deposit }}</span>
+                </div>
+                <div class="sub">
+                    竞拍成功支付后,送拍机构主动关闭交易,系统会在72小时内释放保证金;若竞拍成功未支付,保证金将不会释放
+                </div>
+            </div>
+            <div class="text-info">
+                <span class="text1">保证金状态</span>
+                <span class="text2">正常</span>
+            </div>
         </div>
 
         <div class="pay" v-if="!$store.state.review">
@@ -89,10 +108,11 @@ let inWeixin = /micromessenger/i.test(navigator.userAgent);
 let inApp = /#cordova#/i.test(navigator.userAgent);
 let inIos = /iPhone|iPad|iPod/i.test(navigator.userAgent);
 import auctionOrder from '../../mixins/auctionOrder';
+import auction from '../../mixins/auction';
 export default {
     name: 'activitySubmit',
     inject: ['setKeeps'],
-    mixins: [asset, imgInfo, auctionOrder],
+    mixins: [asset, imgInfo, auctionOrder, auction],
     data() {
         return {
             addressInfo: {},
@@ -129,14 +149,22 @@ export default {
             timer: null,
             info: {},
             time: '',
-            payMentType: 'FIXED_PRICE'
+            paymentType: 'FIXED_PRICE',
+            recordInfo: {}
         };
     },
     computed: {
+        preMoney() {
+            if (this.paymentType === 'PURCHASE_PRICE') {
+                return this.info.purchasePrice || 0;
+            } else {
+                return this.info.fixedPrice || 0;
+            }
+        },
         money() {
             let money = 0;
-            if (this.info.fixedPrice) {
-                money = this.accAdd(this.info.fixedPrice, money);
+            if (this.preMoney) {
+                money = this.accAdd(this.preMoney, money);
             }
             if (this.gas) {
                 money = this.accAdd(money, this.gas);
@@ -162,8 +190,9 @@ export default {
         }
     },
     mounted() {
-        if (this.$route.query.payMentType) {
-            this.payMentType = this.$route.query.payMentType;
+        console.log(this.$route.query.paymentType);
+        if (this.$route.query.paymentType) {
+            this.paymentType = this.$route.query.paymentType;
         }
         this.emitter.on('updateChoose', info => {
             // console.log(id);
@@ -177,6 +206,9 @@ export default {
         });
         if (this.$route.query.auctionId) {
             this.auctionId = this.$route.query.auctionId;
+            this.$http.get('/auctionRecord/hasPayDeposit?auctionId=' + this.auctionId).then(res => {
+                this.recordInfo = res;
+            });
             this.$http.get('/auctionActivity/get/' + this.auctionId).then(res => {
                 this.info = res;
                 this.time = this.getTime(res.endTime);
@@ -292,21 +324,33 @@ export default {
             let form = {
                 userId: this.$store.state.userInfo.id,
                 auctionId: this.auctionId,
-                type: this.payMentType
+                type: this.paymentType
             };
 
             if (!this.isNFT) {
                 form.addressId = this.addressInfo.id;
             }
 
-            return this.$http
-                .post('/auctionOrder/createFixPrice', form)
-                .then(res => {
-                    return Promise.resolve(res);
-                })
-                .catch(e => {
-                    return Promise.reject(e);
-                });
+            if (this.paymentType === 'PURCHASE_PRICE') {
+                form.auctionRecordId = this.recordInfo.id;
+                return this.$http
+                    .post('/auctionOrder/create', form)
+                    .then(res => {
+                        return Promise.resolve(res);
+                    })
+                    .catch(e => {
+                        return Promise.reject(e);
+                    });
+            } else {
+                return this.$http
+                    .post('/auctionOrder/createFixPrice', form)
+                    .then(res => {
+                        return Promise.resolve(res);
+                    })
+                    .catch(e => {
+                        return Promise.reject(e);
+                    });
+            }
         },
         submit() {
             if (!this.payType) {
@@ -519,6 +563,16 @@ export default {
     &:last-child {
         margin-bottom: 0;
     }
+
+    &.isEnd {
+        .text2 {
+            .time {
+                font-size: 12px;
+                color: #939599;
+                background-color: #f2f4f5;
+            }
+        }
+    }
 }
 
 .pay-item {
@@ -576,6 +630,7 @@ export default {
             font-size: 14px;
             color: @text3;
             line-height: 20px;
+            margin-bottom: 2px;
             word-break: keep-all;
         }
 
@@ -625,6 +680,30 @@ export default {
     border-top: 1px solid #f5f7fa;
 }
 
+.text-cell {
+    padding: 12px 0 10px;
+    border-top: 1px solid #f5f7fa;
+    .text-top {
+        .flex();
+        font-size: 14px;
+        color: #000000;
+        line-height: 24px;
+        justify-content: space-between;
+        .text2 {
+            font-weight: bold;
+        }
+        .warn {
+            color: #ff7f1f;
+        }
+    }
+    .sub {
+        font-size: 12px;
+        color: #ff7f1f;
+        line-height: 17px;
+        margin-top: 4px;
+    }
+}
+
 .van-notice-bar {
     height: 28px;
     /deep/.van-notice-bar__wrap {

+ 9 - 8
src/views/order/AuctionOrders.vue

@@ -90,7 +90,7 @@ export default {
                     name: '已完成'
                 }
             ],
-            url: '/auctionOrder/all'
+            url: '/auctionRecord/recordInfos'
         };
     },
     mounted() {
@@ -102,13 +102,14 @@ export default {
         beforeData() {
             return {
                 query: {
-                    userId: this.$store.state.userInfo.id,
-                    paymentType: this.paymentType,
-                    // status: this.status,
-                    // type: this.type,
-                    hide: false,
-                    del: false
-                }
+                    userId: this.$store.state.userInfo.id
+                    // type: this.paymentType,
+                    // // status: this.status,
+                    // // type: this.type,
+                    // hide: false,
+                    // del: false
+                },
+                sort: 'id,desc'
             };
         },
         delFn() {