更新:增加课程“复读”功能

This commit is contained in:
2025-12-08 18:05:45 +08:00
parent b671e8d76c
commit c3b84946fb
12 changed files with 268 additions and 225 deletions

View File

@@ -91,22 +91,29 @@ const orderType = computed(() => {
* 页面加载
*/
onLoad(async (options: any) => {
if (options.goods) {
try {
try {
if (options.isRelearn == 1) {
uni.$on('selectedGoods', async (data: IOrderGoods) => {
// 获取用户信息
await getUserInfo()
// 处理商品数据
console.log('监听到传入的商品数据:', data)
goodsList.value = [ data ]
})
} else if (options.goods) {
// 获取用户信息
await getUserInfo()
// 根据商品ID获取商品详细信息
goodsIds.value = options.goods || ''
isRelearn.value = options.isRelearn == '1'
getGoodsList()
} catch (error) {
console.error('解析商品数据失败:', error)
uni.showToast({
title: '商品数据错误',
icon: 'none'
})
}
} catch (error) {
console.error('解析商品数据失败:', error)
uni.showToast({
title: '商品数据错误',
icon: 'none'
})
}
})
</script>

View File

@@ -56,10 +56,10 @@ const orderType = ref<string>('')
/**
* 页面加载
*/
onLoad(async () => {
onLoad(() => {
try {
// 获取商品列表
await uni.$on('selectedGoods', async (data: IOrderGoods) => {
uni.$on('selectedGoods', async (data: IOrderGoods) => {
// 获取用户信息
await getUserInfo()