修复:开发测试问题修改

This commit is contained in:
2025-11-28 10:48:41 +08:00
parent 435a23f995
commit 85ca0c7a28
19 changed files with 144 additions and 146 deletions

View File

@@ -114,31 +114,6 @@
@confirm="handlePurchase"
@close="closePurchasePopup"
/>
<!-- <wd-popup v-model="purchaseVisible" position="bottom">
<view class="purchase-popup">
<view class="book-info-mini">
<image :src="bookInfo.images" mode="aspectFill" />
<view class="info">
<text class="name">{{ bookInfo.name }}</text>
<text v-if="bookInfo.priceData" class="price">
$ {{ bookInfo.priceData.dictValue }} NZD
</text>
</view>
</view>
<view class="spec-section">
<text class="spec-title">{{ $t('bookDetails.list') }}</text>
<view class="spec-item active">
<text>{{ bookInfo.name }}</text>
<text v-if="bookInfo.priceData" class="spec-price">
${{ bookInfo.priceData.dictValue }} NZD
</text>
</view>
</view>
<wd-button type="primary" block @click="handlePurchase">
{{ $t('bookDetails.buy') }}
</wd-button>
</view>
</wd-popup> -->
</view>
</template>

View File

@@ -162,10 +162,7 @@
>
<image :src="item.images" />
<text class="book-text">{{ item.name }}</text>
<text class="book-price">{{ item.minPrice }} {{ t('global.coin') }}</text>
<text v-if="formatStats(item)" class="book-flag">{{
formatStats(item)
}}</text>
<BookPrice :data="item" class="book-price-container" />
</view>
</view>
<text v-else class="zanwu" style="padding: 100rpx 0">{{ $t('global.dataNull') }}</text>
@@ -177,9 +174,9 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { onShow } from '@dcloudio/uni-app'
import { useI18n } from 'vue-i18n'
import { homeApi } from '@/api/modules/book_home'
import { getNotchHeight } from '@/utils/system'
import BookPrice from '@/components/book/BookPrice.vue'
import type {
IBook,
IBookWithStats,
@@ -187,8 +184,6 @@ import type {
IVipInfo
} from '@/types/book'
const { t } = useI18n()
// 状态定义
const showMyBooks = ref(false)
const showActivity = ref(false)
@@ -320,43 +315,6 @@ const getBooksByLabel = async (
}
}
/**
* 格式化价格
*/
const formatPrice = (book: IBookWithStats): string => {
// 已购买不显示价格
if (book.isBuy) return ''
// VIP用户且图书为VIP专享
if (vipInfo.value?.id && book.isVip === '2') {
const price = book.sysDictData?.dictValue
return price ? `$ ${price} NZD` : ''
}
// 普通用户
if (!vipInfo.value?.id) {
const price = book.sysDictData?.dictValue
return price ? `$ ${price} NZD` : ''
}
return ''
}
/**
* 格式化统计信息
*/
const formatStats = (book: IBookWithStats): string => {
if (book.readCount && book.readCount > 0) {
return `${book.readCount}${t('bookHome.readingCount')}`
}
if (book.buyCount && book.buyCount > 0) {
return `${book.buyCount}${t('bookHome.purchased')}`
}
return ''
}
/**
* 处理搜索点击
*/
@@ -388,8 +346,8 @@ const handleBookClick = (bookId: number) => {
* 处理更多按钮点击
*/
const handleMoreClick = () => {
uni.switchTab({
url: '/pages/book/index'
uni.navigateTo({
url: '/pages/user/myBook/index'
})
}
@@ -779,21 +737,9 @@ onShow(() => {
overflow: hidden;
}
.book-price {
position: absolute;
font-size: 28rpx;
color: #ff4703;
left: 30rpx;
bottom: 20rpx;
}
.book-flag {
display: block;
font-size: 26rpx;
color: #999;
position: absolute;
right: 6%;
bottom: 20rpx;
.book-price-container {
width: 80%;
margin: 15rpx auto 0;
}
}
}

View File

@@ -381,7 +381,7 @@ async function prevChapter() {
playChapter(chapterList.value[currentChapterIndex.value])
} else {
uni.showToast({
title: t('listen.earlier'),
title: t('listen.isFirst'),
icon: 'none'
})
}
@@ -412,7 +412,7 @@ async function nextChapter() {
playChapter(chapterList.value[currentChapterIndex.value])
} else {
uni.showToast({
title: t('listen.behind'),
title: t('listen.isLast'),
icon: 'none'
})
}

View File

@@ -606,7 +606,7 @@ function changeReadMode(mode: 'scroll' | 'page') {
const bookLanguages = ref([])
const currentLanguage = ref('')
onMounted(() => {
currentLanguage.value = uni.getStorageSync('currentBookLanguage') || ''
currentLanguage.value = uni.getStorageSync('currentBookLanguage') || '中文'
console.log('currentLanguage', currentLanguage.value)
})
const getBookLanguages = async () => {

View File

@@ -130,6 +130,15 @@
<text>
本课程一经购买暂不支持退款敬请谅解
</text>
<view style="color: red; font-weight: bold"> : </view>
<view>
1.手机pad电脑均为可登陆电子设备均有唯一标识码一个用户名仅允许在一个手机或一个ipad或一个电脑登陆请根据您的使用习惯自行选择<br />
2.如若申请变更登陆设备请联系客服<br />
客服电话:13110039505;022-24142321<br />
客服微信号:yilujiankangkefu<br />
3.如因违反上述使用规定...概不退款本公司保留追究用户相关法律责任的权利<br />
4.点击同意按钮即表示您同意遵守以上条款
</view>
</view>
<view class="protocol-actions">
<wd-button type="info" plain @click="showProtocol = false">不同意</wd-button>
@@ -156,7 +165,7 @@
<script setup lang="ts">
import { ref, computed } from 'vue'
import { onLoad, onPageScroll, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
import { onLoad, onPageScroll, onPullDownRefresh, onReachBottom, onShow } from '@dcloudio/uni-app'
import { useCourseStore } from '@/stores/course'
import { useUserStore } from '@/stores/user'
import { courseApi } from '@/api/modules/course'
@@ -252,6 +261,12 @@ const vipTip = computed(() => {
*/
onLoad(async (options: any) => {
courseId.value = parseInt(options.id)
})
/**
* 页面显示
*/
onShow(async () => {
await loadPageData()
})
@@ -809,7 +824,7 @@ onReachBottom(() => {
}
.protocol-content {
max-height: 500rpx;
max-height: 60vh;
overflow-y: auto;
font-size: 26rpx;
line-height: 1.8;

View File

@@ -48,7 +48,7 @@
<view
class="fourBox"
style="padding: 0; padding-bottom: 8rpx"
v-if="sbuMedicalTagsList && sbuMedicalTagsList.length > 0"
v-if="sbuMedicalTagsList?.length > 0"
>
<view
class="childrenBox fourIcon flexbox"
@@ -257,6 +257,7 @@ const handleFirstLevelClick = (item: string) => {
* 获取课程分类数据
*/
const getMedicalTags = async () => {
sbuMedicalTagsList.value = []
const res = await courseSubjectClassificationApi.getCourseMedicalTree()
if (res && res.code === 0) {
if (res.labels && res.labels.length > 0) {
@@ -268,8 +269,6 @@ const getMedicalTags = async () => {
// 非终极分类,显示子分类
if (selectedTag.children && selectedTag.children.length > 0) {
sbuMedicalTagsList.value = selectedTag.children
} else {
sbuMedicalTagsList.value = []
}
}
}

View File

@@ -1,25 +0,0 @@
<template>
<view class="container">
<view class="title bg-[transparent] text-center text-[#000]">这是一个等待开发的首页</view>
<view class="title bg-[blue] text-center text-[#fff]">这是一个等待开发的首页</view>
<view class="description bg-[red]">首页的内容是在线课程</view>
</view>
</template>
<script setup lang="ts">
</script>
<style>
.title {
font-size: 16px;
font-weight: bold;
margin-bottom: 15px;
}
.description {
font-size: 14px;
opacity: 0.6;
margin-bottom: 15px;
}
</style>

View File

@@ -4,7 +4,7 @@
<nav-bar :title="$t('order.confirmTitle')" />
<!-- 确认订单组件 -->
<Confirm :goodsList="goodsList" :userInfo="userInfo">
<Confirm :goodsList="goodsList" :userInfo="userInfo" :orderType="orderType">
<template #goodsList>
<!-- 商品列表内容 -->
<view
@@ -49,7 +49,7 @@
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { ref, computed } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { orderApi } from '@/api/modules/order'
import type { IOrderGoods } from '@/types/order'
@@ -79,6 +79,14 @@ const getGoodsList = async () => {
}
}
// 复读
const isRelearn = ref<boolean>(false)
// 订单类型
const orderType = computed(() => {
return isRelearn.value ? 'relearn' : 'order'
})
/**
* 页面加载
*/
@@ -90,6 +98,7 @@ onLoad(async (options: any) => {
// 根据商品ID获取商品详细信息
goodsIds.value = options.goods || ''
isRelearn.value = options.isRelearn == '1'
getGoodsList()
} catch (error) {
console.error('解析商品数据失败:', error)

View File

@@ -26,6 +26,7 @@
<ProductInfo v-if="order.orderType === 'order'" :data="order.productList" :type="order.orderType" />
<ProductInfo v-if="order.orderType === 'abroadBook'" :data="order.bookEntity" :type="order.orderType" />
<ProductInfo v-if="order.orderType === 'vip'" :data="order.vipBuyConfigEntity" :type="order.orderType" />
<ProductInfo v-if="order.orderType === 'abroadVip'" :data="order.ebookvipBuyConfig" :type="order.orderType" />
<!-- 三种订单类型商品信息 end -->
<view class="order-item-total-price">实付款{{ order.orderMoney }} {{ t('global.coin') }}</view>

View File

@@ -73,15 +73,6 @@ const getVipList = async () => {
vipList.value = res.lableList || []
}
// 选择套餐
const selectPackage = (vip: any) => {
// 这里可以添加跳转到订单确认页面的逻辑
uni.showToast({
title: `已选择: ${vip.title}`,
icon: 'none'
})
}
// 处理购买
const handlePurchase = (vip: any) => {
const selectedGoods = {