|
|
@@ -11,25 +11,39 @@
|
|
|
<div class="flex1"></div>
|
|
|
<div class="datas">
|
|
|
<div class="data">
|
|
|
- <div class="val">
|
|
|
- <small>{{ $t('balance.symbol') }}</small>
|
|
|
+ <div class="val" v-if="!notStock">
|
|
|
+ <span>{{ $t('balance.symbol') }}</span>
|
|
|
<span>{{ info.currentPrice }}</span>
|
|
|
</div>
|
|
|
+ <div class="val" v-else>
|
|
|
+ <span>***</span>
|
|
|
+ </div>
|
|
|
<div class="name">{{ $t('product.priceNow') }}</div>
|
|
|
</div>
|
|
|
<div class="data">
|
|
|
- <div class="val">{{ riseRatePercent }}%</div>
|
|
|
+ <div class="val" v-if="!notStock">{{ riseRatePercent }}%</div>
|
|
|
+ <div class="val" v-else>
|
|
|
+ <span>***</span>
|
|
|
+ </div>
|
|
|
<div class="name">{{ $t('product.dailyEarning') }}</div>
|
|
|
</div>
|
|
|
<div class="data">
|
|
|
- <div class="val">
|
|
|
- <small>{{ $t('balance.symbol') }}</small>
|
|
|
+ <div class="val" v-if="!notStock">
|
|
|
+ <span>{{ $t('balance.symbol') }}</span>
|
|
|
<span>{{ nextPrice || 0 }}</span>
|
|
|
</div>
|
|
|
+ <div class="val" v-else>
|
|
|
+ <span>***</span>
|
|
|
+ </div>
|
|
|
<div class="name">{{ $t('product.tomorrowBuy') }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div class="not" v-if="notStock">
|
|
|
+ <img src="@/assets/not-ava.png" alt="" />
|
|
|
+ <span>{{ $t('common.notAvailable') }}...</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -38,6 +52,7 @@ import { computed } from 'vue'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import { useSystemStore } from '../stores/system'
|
|
|
import { accAdd, accMul } from '../plugins/calc'
|
|
|
+import toast from '@/utils/toast'
|
|
|
|
|
|
const props = defineProps({
|
|
|
info: {
|
|
|
@@ -49,6 +64,10 @@ const props = defineProps({
|
|
|
list: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
+ },
|
|
|
+ stopOfficial: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
}
|
|
|
})
|
|
|
const category = computed(() => {
|
|
|
@@ -61,13 +80,21 @@ const width = computed(() => {
|
|
|
return props.list ? 104 : 78
|
|
|
})
|
|
|
|
|
|
+const notStock = computed(() => {
|
|
|
+ return props.stopOfficial && props.info.sales === 0
|
|
|
+})
|
|
|
+
|
|
|
const goDetail = () => {
|
|
|
- router.push({
|
|
|
- path: '/productDetail',
|
|
|
- query: {
|
|
|
- id: props.info.id
|
|
|
- }
|
|
|
- })
|
|
|
+ if (notStock.value) {
|
|
|
+ toast(this.$t('common.notAvailable') + '...')
|
|
|
+ } else {
|
|
|
+ router.push({
|
|
|
+ path: '/productDetail',
|
|
|
+ query: {
|
|
|
+ id: props.info.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const riseRatePercent = computed(() => {
|
|
|
@@ -89,6 +116,31 @@ const nextPrice = computed(() => {
|
|
|
.van-image {
|
|
|
flex-shrink: 0;
|
|
|
}
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.not {
|
|
|
+ .f();
|
|
|
+ background-color: #ffe6b8;
|
|
|
+ height: 20px;
|
|
|
+ padding: 2px 6px;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ z-index: 20;
|
|
|
+ border-radius: 8px 0 8px 0;
|
|
|
+ img {
|
|
|
+ width: 12px;
|
|
|
+ height: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ span {
|
|
|
+ font-size: 10px;
|
|
|
+ line-height: 15px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: rgba(194, 136, 0, 1);
|
|
|
+ margin-left: 5px;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.content {
|
|
|
@@ -110,7 +162,7 @@ const nextPrice = computed(() => {
|
|
|
margin-top: 4px;
|
|
|
.badge {
|
|
|
font-size: 10px;
|
|
|
- color: #9f8dff;
|
|
|
+ color: #c085ff;
|
|
|
// background: #2d2d56;
|
|
|
line-height: 16px;
|
|
|
border-radius: 2px;
|
|
|
@@ -173,9 +225,9 @@ const nextPrice = computed(() => {
|
|
|
}
|
|
|
.badges {
|
|
|
.badge {
|
|
|
- color: #9b68d2;
|
|
|
+ color: #c085ff;
|
|
|
font-weight: bold;
|
|
|
- border: 0.5px solid #9b68d2;
|
|
|
+ border: 0.5px solid #c085ff;
|
|
|
|
|
|
&:nth-child(2) {
|
|
|
color: #39f3bb;
|