nieyuge 2 years ago
parent
commit
3226298a22
2 changed files with 41 additions and 16 deletions
  1. 39 14
      components/MobileBuyNft.vue
  2. 2 2
      pages/nft/index.vue

+ 39 - 14
components/MobileBuyNft.vue

@@ -52,24 +52,43 @@
                 <template v-if="data.salePlans">
                     <div v-for="(item, index) in data.salePlans" :key="index">
                         <template v-if="item.itemCount == 1">
-                            <div
-                                class="btn"
-                                :class="{ disable: !((data.perUserBuyLimit - data.userBuyCount) >= 1 && (data.itemTotalCount - data.itemSoldCount) >= 1) }"
-                                @click="goBuy(((data.perUserBuyLimit - data.userBuyCount) >= 1 && (data.itemTotalCount - data.itemSoldCount) >= 1))">
-                                <div class="l">BUY {{item.itemCount}}</div>
-                                <FontZoom width="220">
-                                    <img class="icon" :src="item.currencyInfo.iconPath" /> {{ item.price }} {{ item.currencyInfo.tokenSymbol }} (${{item.usdPrice}})
-                                </FontZoom>
-                            </div>
+                            <template v-if="purchaseStatus !== 0">
+                                <div
+                                    class="btn"
+                                    :class="{ disable: !((data.perUserBuyLimit - data.userBuyCount) >= 1 && (data.itemTotalCount - data.itemSoldCount) >= 1) }"
+                                    @click="goBuy(((data.perUserBuyLimit - data.userBuyCount) >= 1 && (data.itemTotalCount - data.itemSoldCount) >= 1))">
+                                    <div class="l">BUY {{item.itemCount}}</div>
+                                    <FontZoom width="220">
+                                        <img class="icon" :src="item.currencyInfo.iconPath" /> {{ item.price }} {{ item.currencyInfo.tokenSymbol }} (${{item.usdPrice}})
+                                    </FontZoom>
+                                </div>
+                            </template>
+                            <template v-else>
+                                <div
+                                    class="btn disable">
+                                    <div class="l">BUY {{item.itemCount}}</div>
+                                    <FontZoom width="220">
+                                        <img class="icon" :src="item.currencyInfo.iconPath" /> {{ item.price }} {{ item.currencyInfo.tokenSymbol }} (${{item.usdPrice}})
+                                    </FontZoom>
+                                </div>
+                            </template>
                         </template>
                     </div>
                 </template>
                 <template v-else>
-                    <div
-                        class="btn"
-                        @click="goBuy()">
-                        BUY 1
-                    </div>
+                    <template v-if="purchaseStatus !== 0">
+                        <div
+                            class="btn"
+                            @click="goBuy()">
+                            BUY 1
+                        </div>
+                    </template>
+                    <template v-else>
+                        <div
+                            class="btn disable">
+                            BUY 1
+                        </div>
+                    </template>
                 </template>
                 <div class="sale">
                     <div class="l">SOLD: {{ data.itemSoldCount || 0 }}/{{ data.itemTotalCount }}</div>
@@ -120,6 +139,12 @@ export default {
             loginLayer: false,
         }
     },
+    props: {
+        purchaseStatus: {
+            type: Number,
+            default: 0
+        }
+    },
     created() {
         this.getSaleInfo()
         // report

+ 2 - 2
pages/nft/index.vue

@@ -5,8 +5,8 @@
 		</template>
 		<template v-else>
 			<template v-if="isMobile">
-				<MobileLandPage v-if="isSwipe" :prizePicPath="detail.pageImagePath" :playType="PlayType.NFT" :prize="detail.nftProjectName" :useFul="detail.purchaseStatus === 1" :nftProjectId="detail.nftProjectId"> </MobileLandPage>
-				<mobileBuyNft v-else></mobileBuyNft>
+				<MobileLandPage v-if="isSwipe" :prizePicPath="detail.pageImagePath" :playType="PlayType.NFT" :prize="detail.nftProjectName" :useFul="detail.purchaseStatus === 1" :nftProjectId="detail.nftProjectId"></MobileLandPage>
+				<mobileBuyNft :purchaseStatus="detail.purchaseStatus" v-else></mobileBuyNft>
 			</template>
 			<template v-else>
 				<div class="logo">