修复:开发测试问题修改
This commit is contained in:
49
components/book/BookPrice.vue
Normal file
49
components/book/BookPrice.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<view class="book-price-container">
|
||||
<view v-if="data.isBuy" class="book-flag">已购买</view>
|
||||
<view v-else-if="data.isVip == '0'" class="book-flag">免费</view>
|
||||
<view v-else-if="userHasVip && data.isVip == '1'" class="book-price">VIP免费</view>
|
||||
<view v-else class="book-price">{{ item.minPrice }} {{ $t('global.coin') }}</view>
|
||||
<view>
|
||||
<text v-if="data.readCount" class="book-flag">{{ `${data.readCount}${$t('bookHome.readingCount')}` }}</text>
|
||||
<text v-else-if="data.buyCount" class="book-flag">{{ `${data.buyCount}${$t('bookHome.purchased')}` }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue'
|
||||
import type { IBook } from '@/types/book'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
// 检查用户是否为VIP
|
||||
const userHasVip = computed(() => userStore.userInfo?.userEbookVip?.length > 0)
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object as () => IBook,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.book-price-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.book-price {
|
||||
font-size: 28rpx;
|
||||
color: #ff4703;
|
||||
}
|
||||
|
||||
.book-flag {
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -14,13 +14,13 @@
|
||||
<text v-else>
|
||||
课程有效期截止到:{{ catalogue.endTime }}
|
||||
</text>
|
||||
<wd-button
|
||||
<!-- <wd-button
|
||||
v-if="catalogue.startTime"
|
||||
size="small"
|
||||
@click="handleRenew"
|
||||
>
|
||||
续费
|
||||
</wd-button>
|
||||
</wd-button> -->
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<!-- 积分输入 -->
|
||||
<view v-if="allowPointPay && userInfo?.jf > 0" class="points-input-section">
|
||||
<text class="points-label">
|
||||
{{ $t('order.maxPoints', { max: pointsUsableMax }) }}
|
||||
{{ $t('order.maxPoints').replace('max', pointsUsableMax) }}
|
||||
</text>
|
||||
<view class="points-input-box">
|
||||
<input
|
||||
@@ -136,16 +136,16 @@ const userStore = useUserStore()
|
||||
interface Props {
|
||||
goodsList: IGoods[],
|
||||
userInfo: object,
|
||||
allowPointPay: boolean,
|
||||
orderType: string,
|
||||
backStep: number // 购买完成后返回几层页面
|
||||
allowPointPay?: boolean,
|
||||
orderType?: string,
|
||||
backStep?: number // 购买完成后返回几层页面
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
goodsList: () => [],
|
||||
userInfo: () => ({}),
|
||||
allowPointPay: () => false,
|
||||
orderType: () => '',
|
||||
backStep: () => 1
|
||||
allowPointPay: true,
|
||||
orderType: 'order',
|
||||
backStep: 1
|
||||
})
|
||||
|
||||
// 订单备注
|
||||
|
||||
@@ -33,6 +33,8 @@ const productImg = computed(() => {
|
||||
return props.data?.images || ''
|
||||
case 'vip':
|
||||
return '/static/vip.png'
|
||||
case 'abroadVip':
|
||||
return '/static/vip.png'
|
||||
case 'point':
|
||||
return '/static/jifen.png'
|
||||
default:
|
||||
@@ -47,6 +49,8 @@ const title = computed(() => {
|
||||
return props.data?.name || ''
|
||||
case 'vip':
|
||||
return props.data?.title + '<text style="color: #ff4703; font-weight: bold;">(' + props.data?.year + '年)</text>' || ''
|
||||
case 'abroadVip':
|
||||
return '电子书VIP' + props.data?.title + '<text style="color: #ff4703; font-weight: bold;">(' + props.data?.days + '天)</text>' || ''
|
||||
case 'point':
|
||||
return ''
|
||||
default:
|
||||
@@ -61,6 +65,8 @@ const price = computed(() => {
|
||||
return props.data?.abroadPrice || 0
|
||||
case 'vip':
|
||||
return props.data?.fee || 0
|
||||
case 'abroadVip':
|
||||
return props.data?.money || 0
|
||||
case 'point':
|
||||
return ''
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user