panhui 2 tahun lalu
induk
melakukan
6dabcd5abf

+ 9 - 2
src/components/OrderItem.vue

@@ -161,7 +161,14 @@ export default {
         ...mapState(useUserStore, ['user']),
         ...mapState(useSystemStore, ['platformCommission', 'saleBatches']),
         riseRate() {
-            return this.saleBatches.find(item => item.id == this.info.batchId)?.riseRate || 0
+            let info = this.saleBatches.find(item => item.saleBatch.id == this.info.batchId)
+            let _back = null
+            if (info) {
+                _back = info.extensions.find(item => {
+                    return item.minPrice <= this.info.totalPrice && this.info.totalPrice <= item.maxPrice
+                })
+            }
+            return _back?.riseRate || 0
         },
         riseRatePercent() {
             return this.riseRate * 100
@@ -429,7 +436,7 @@ export default {
         },
         delegate() {
             this.$http.get('/saleBatch/get/' + this.info.batchId).then(res => {
-                this.batchInfo = res
+                this.batchInfo = res.saleBatch
                 this.show = true
             })
         },

+ 2 - 2
src/components/ProductItem.vue

@@ -23,13 +23,13 @@
                     </div>
                     <div class="name">{{ $t('product.priceNow') }}</div>
                 </div>
-                <div class="data">
+                <!-- <div class="data">
                     <div class="val" v-if="!noSale">{{ riseRatePercent }}%</div>
                     <div class="val" v-else>
                         <span>***</span>
                     </div>
                     <div class="name">{{ $t('product.dailyEarning') }}</div>
-                </div>
+                </div> -->
                 <div class="data">
                     <div class="val" v-if="!noSale">
                         <span>{{ $t('balance.symbol') }}</span>

+ 1 - 1
src/components/ProductItemSmall.vue

@@ -8,7 +8,7 @@
             <div class="text1 van-ellipsis">{{ getLocaleString(info.name) }}</div>
             <div class="badges">
                 <div class="badge">{{ category.name }}</div>
-                <div class="badge">{{ riseRatePercent }}%&nbsp;{{ $t('product.riseDesc') }}</div>
+                <!-- <div class="badge">{{ riseRatePercent }}%&nbsp;{{ $t('product.riseDesc') }}</div> -->
                 <!-- <div class="badge">{{ $t('product.tag') }}</div> -->
             </div>
             <div class="datas">

+ 2 - 2
src/locales/en.json

@@ -259,13 +259,13 @@
         "walletPay": "Wallet payment"
     },
     "product": {
-        "dailyEarning": "Daily Income",
+        "dailyEarning": "Income",
         "detail": "Product Details",
         "hot": "IN FULL SWING!",
         "nowPrice": "Current",
         "owner": "Current Holder",
         "priceNow": "Current",
-        "riseDesc": "Daily Income",
+        "riseDesc": "Income",
         "search": "Search",
         "searchNo": "No products were found~",
         "searchPla": "Enter search keywords",

+ 1 - 1
src/views/HomePage.vue

@@ -253,7 +253,7 @@ const saleBatches = ref([])
 const batchInfo = ref({})
 const batchId = ref(0)
 function getSaleBatch() {
-    return http.get('sysConfig/get/home_session').then(res => {
+    return http.get('sysConfig/get/home_batch_id').then(res => {
         if (res.value === '0') {
             return http.post('saleBatch/all', {}, { body: 'json' }).then(res => {
                 saleBatches.value = res.content.map(item => {

+ 9 - 1
src/views/OrderDetailPage.vue

@@ -200,7 +200,15 @@ export default {
         ...mapState(useUserStore, ['user']),
         ...mapState(useSystemStore, ['saleBatches', 'getSysConfigs']),
         riseRate() {
-            return this.saleBatches.find(item => item.id == this.orderInfo.batchId)?.riseRate || 0
+            // return this.saleBatches.find(item => item.id == this.orderInfo.batchId)?.riseRate || 0
+            let info = this.saleBatches.find(item => item.saleBatch.id == this.info.batchId)
+            let _back = null
+            if (info) {
+                _back = info.extensions.find(item => {
+                    return item.minPrice <= this.info.totalPrice && this.info.totalPrice <= item.maxPrice
+                })
+            }
+            return _back?.riseRate || 0
         },
         riseRatePercent() {
             return this.riseRate * 100

+ 17 - 2
src/views/ProductDetailPage.vue

@@ -179,11 +179,26 @@ onMounted(() => {
 })
 
 const riseRate = computed(() => {
-    return useSystemStore().saleBatches.find(item => item.id == info.value.batchId)?.riseRate || 0
+    let _info = useSystemStore().saleBatches.find(item => item.saleBatch.id == info.value.batchId)
+    let _back = null
+    if (_info) {
+        _back = _info.extensions.find(item => {
+            return item.minPrice <= info.value.currentPrice && info.value.currentPrice <= item.maxPrice
+        })
+    }
+    // return useSystemStore().saleBatches.find(item => item.id == info.value.batchId)?.riseRate || 0
+    return _back?.riseRate || 0
 })
 
 const riseRatePercent = computed(() => {
-    return useSystemStore().saleBatches.find(item => item.id == info.value.batchId)?.riseRate * 100 || 0
+    let _info = useSystemStore().saleBatches.find(item => item.saleBatch.id == info.value.batchId)
+    let _back = null
+    if (_info) {
+        _back = _info.extensions.find(item => {
+            return item.minPrice <= info.value.currentPrice && info.value.currentPrice <= item.maxPrice
+        })
+    }
+    return _back?.riseRate * 100 || 0
 })
 
 const nextPrice = computed(() => {