修复:我的课程标签树打开不重置问题
This commit is contained in:
@@ -381,6 +381,39 @@ export async function getIosPayment(transactionId : string, productId : string,
|
|||||||
* 我的课程
|
* 我的课程
|
||||||
* @param page 当前页码
|
* @param page 当前页码
|
||||||
* @param limit 每页数量
|
* @param limit 每页数量
|
||||||
|
* @param title 课程名称
|
||||||
|
* @param medicalId 商品id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
export async function getUserCourseBuyList(page : number, limit : number, title : string, medicalId: string) {
|
||||||
|
const res = await mainClient.request<IApiResponse>({
|
||||||
|
url: 'medical/course/getUserCourseBuy',
|
||||||
|
method: 'POST',
|
||||||
|
data: { page, limit, title, medicalId }
|
||||||
|
})
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 正在学习
|
||||||
|
* @param page 当前页码
|
||||||
|
* @param limit 每页数量
|
||||||
|
* @param userId 用户id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
export async function getUserCourseStudyingList(page : number, limit : number, userId : string) {
|
||||||
|
const res = await mainClient.request<IApiResponse>({
|
||||||
|
url: 'medical/course/getUserCourseStudying',
|
||||||
|
method: 'POST',
|
||||||
|
data: { page, limit, userId }
|
||||||
|
})
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已过期
|
||||||
|
* @param page 当前页码
|
||||||
|
* @param limit 每页数量
|
||||||
* @param userId 用户id
|
* @param userId 用户id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
"name" : "吴门国际",
|
"name" : "吴门国际",
|
||||||
"appid" : "__UNI__1250B39",
|
"appid" : "__UNI__1250B39",
|
||||||
"description" : "吴门国际",
|
"description" : "吴门国际",
|
||||||
"versionName" : "1.1.10",
|
"versionName" : "1.1.11",
|
||||||
"versionCode" : 1110,
|
"versionCode" : 1111,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
|||||||
@@ -11,10 +11,11 @@
|
|||||||
<wd-tab :title="`${item.name}`" :name="item.id">
|
<wd-tab :title="`${item.name}`" :name="item.id">
|
||||||
<view v-if="item.id === 0">
|
<view v-if="item.id === 0">
|
||||||
<wd-search v-model="title" placeholder-right placeholder="请输入课程名称" cancel-txt="搜索" @search="search"
|
<wd-search v-model="title" placeholder-right placeholder="请输入课程名称" cancel-txt="搜索" @search="search"
|
||||||
@cancel="search" light style="margin-top: 10rpx;" />
|
@cancel="search" @clear="search" light style="margin-top: 10rpx;"/>
|
||||||
<view class="courses-row">
|
<view class="courses-row">
|
||||||
<view class="courses-category">{{ !tagData ? '已显示全部课程' : `已选择分类:${tagName}`}}
|
<view class="courses-category">{{ !tagData ? '已显示全部课程' : `已选择分类:${tagName}`}}
|
||||||
<wd-button size="small" type="warning" style="margin-left: 20rpx;" v-if="tagData" @click="clear">清除</wd-button>
|
<wd-button size="small" type="warning" style="margin-left: 20rpx;" v-if="tagData"
|
||||||
|
@click="clear">清除</wd-button>
|
||||||
</view>
|
</view>
|
||||||
<view class="courses-category" @click="openwindow">
|
<view class="courses-category" @click="openwindow">
|
||||||
<wd-icon name="app" size="36rpx" color="#2979ff"></wd-icon>
|
<wd-icon name="app" size="36rpx" color="#2979ff"></wd-icon>
|
||||||
@@ -33,15 +34,20 @@
|
|||||||
<view class="introduction" v-html="item.content"></view>
|
<view class="introduction" v-html="item.content"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="row-button">
|
<view class="row-button">
|
||||||
<wd-button plain size="small" class="button"
|
<view @click.stop="onPageJump('/pages/course/details/course',item.id)" v-if="tab !==2">
|
||||||
@click.stop="onPageJump('/pages/course/details/course',item.id)" v-if="tab !==2">去学习</wd-button>
|
<wd-button plain size="small" class="button">去学习</wd-button>
|
||||||
<view v-if="tab !==2">
|
</view>
|
||||||
<wd-button type="warning" size="small" plain class="button" @click.stop="joinStudy(item.id)"
|
<view v-if="tab !==2">
|
||||||
v-if="item.isStudying === 0">加入在学习</wd-button>
|
<view v-if="item.isStudying === 0" @click.stop="joinStudy(item.id)">
|
||||||
<wd-button type="warning" size="small" class="button" @click.stop="cancelStudy(item.id)"
|
<wd-button type="warning" size="small" plain class="button">加入在学习</wd-button>
|
||||||
v-else>取消在学习</wd-button>
|
</view>
|
||||||
|
<view @click.stop="cancelStudy(item.id)" v-else>
|
||||||
|
<wd-button type="warning" size="small" class="button">取消在学习</wd-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view @click.stop="renewal(item.catalogueId)" v-else>
|
||||||
|
<wd-button size="small" class="button">续费课程</wd-button>
|
||||||
</view>
|
</view>
|
||||||
<wd-button size="small" class="button" @click.stop="renewal(item.catalogueId)" v-else>续费课程</wd-button>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -54,9 +60,11 @@
|
|||||||
@confirm="handleGoodsConfirm" @close="closeGoodsSelector" />
|
@confirm="handleGoodsConfirm" @close="closeGoodsSelector" />
|
||||||
<!-- 搜索分类弹窗 -->
|
<!-- 搜索分类弹窗 -->
|
||||||
<wd-popup v-model="showState" position="right" custom-style="border-radius: 0px !important;width: 70%;">
|
<wd-popup v-model="showState" position="right" custom-style="border-radius: 0px !important;width: 70%;">
|
||||||
<wd-button @click="collapse?.toggleAll(true)">测试</wd-button>
|
<view class="popup-image">
|
||||||
|
<image src="@/static/logo.png"></image>
|
||||||
|
</view>
|
||||||
<view class="_text">请选择课程分类</view>
|
<view class="_text">请选择课程分类</view>
|
||||||
<wd-collapse ref="collapse" v-model="levelOne" accordion v-for="item in labelTree" :key="item.id"
|
<wd-collapse ref="collapseRef" v-model="levelOne" accordion v-for="item in labelTree" :key="item.id"
|
||||||
:title="item.title" :name="item.name">
|
:title="item.title" :name="item.name">
|
||||||
<wd-collapse-item :title="item?.title" :name="item?.title" custom-body-style="padding:0">
|
<wd-collapse-item :title="item?.title" :name="item?.title" custom-body-style="padding:0">
|
||||||
<view v-for="itm in item?.children" :key="itm?.id" class="content-text" @click.stop="gettagId1(itm)">
|
<view v-for="itm in item?.children" :key="itm?.id" class="content-text" @click.stop="gettagId1(itm)">
|
||||||
@@ -67,7 +75,6 @@
|
|||||||
<wd-button class="_r" size="small" plain v-for="i in it?.children" :key="i?.id"
|
<wd-button class="_r" size="small" plain v-for="i in it?.children" :key="i?.id"
|
||||||
@click.stop="gettagId3(i)">{{i?.title}}</wd-button>
|
@click.stop="gettagId3(i)">{{i?.title}}</wd-button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</wd-collapse-item>
|
</wd-collapse-item>
|
||||||
@@ -77,8 +84,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import { onShow } from '@dcloudio/uni-app'
|
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { courseApi } from '@/api/modules/course'
|
import { courseApi } from '@/api/modules/course'
|
||||||
import { useUserStore } from '@/stores/user'
|
import { useUserStore } from '@/stores/user'
|
||||||
@@ -91,9 +97,6 @@
|
|||||||
delUserCourseStudyingList,
|
delUserCourseStudyingList,
|
||||||
getCourseMedicalTreeList
|
getCourseMedicalTreeList
|
||||||
} from '@/api/modules/user'
|
} from '@/api/modules/user'
|
||||||
import type { CollapseInstance } from '@/uni_modules/wot-design-uni/components/wd-collapse/types'
|
|
||||||
|
|
||||||
const collapse = ref<CollapseInstance>()
|
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
@@ -132,8 +135,8 @@
|
|||||||
pageNoData.value = pageNo ?? pageNoData.value
|
pageNoData.value = pageNo ?? pageNoData.value
|
||||||
pageSizeData.value = pageSize ?? pageSizeData.value
|
pageSizeData.value = pageSize ?? pageSizeData.value
|
||||||
const targetApi = apiMap[tab.value];
|
const targetApi = apiMap[tab.value];
|
||||||
console.log(tagData, 'tagData');
|
|
||||||
try {
|
try {
|
||||||
|
// 只有我的课程才传搜索框内容
|
||||||
const res = await targetApi(pageNoData.value, pageSizeData.value, tab.value === 0 ? title.value : userStore.id, tagData?.value.id ?? '')
|
const res = await targetApi(pageNoData.value, pageSizeData.value, tab.value === 0 ? title.value : userStore.id, tagData?.value.id ?? '')
|
||||||
paging.value.complete(tab.value === 0 ? res.courseList.records : res.courseList)
|
paging.value.complete(tab.value === 0 ? res.courseList.records : res.courseList)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -151,7 +154,7 @@
|
|||||||
const switchTab = (e) => {
|
const switchTab = (e) => {
|
||||||
tab.value = e.index
|
tab.value = e.index
|
||||||
bookList.value = []
|
bookList.value = []
|
||||||
tagData.value = {}
|
tagData.value = ''
|
||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,7 +227,10 @@
|
|||||||
/**
|
/**
|
||||||
* 打开商品分类弹窗
|
* 打开商品分类弹窗
|
||||||
*/
|
*/
|
||||||
const openwindow = () => showState.value = true
|
const openwindow = () => {
|
||||||
|
levelOne.value = ''
|
||||||
|
showState.value = true
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取标签树
|
* 获取标签树
|
||||||
@@ -258,17 +264,17 @@
|
|||||||
* 公共方法
|
* 公共方法
|
||||||
*/
|
*/
|
||||||
const publicMethod = (item : { title ?: any }) => {
|
const publicMethod = (item : { title ?: any }) => {
|
||||||
console.log(item,'item');
|
console.log(item, 'item');
|
||||||
tagName.value = item.title
|
tagName.value = item.title
|
||||||
tagData.value = item
|
tagData.value = item
|
||||||
showState.value = false
|
showState.value = false
|
||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清除按钮
|
* 清除按钮
|
||||||
*/
|
*/
|
||||||
const clear = () =>{
|
const clear = () => {
|
||||||
tagData.value = ''
|
tagData.value = ''
|
||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
@@ -279,7 +285,7 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onShow(() => {
|
onMounted(() => {
|
||||||
getTreeList()
|
getTreeList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
@@ -298,7 +304,7 @@
|
|||||||
.courses-category {
|
.courses-category {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
font-size: 26rpx;
|
||||||
text {
|
text {
|
||||||
color: #2979ff;
|
color: #2979ff;
|
||||||
margin-left: 4rpx;
|
margin-left: 4rpx;
|
||||||
@@ -309,10 +315,10 @@
|
|||||||
.myCourse-data {
|
.myCourse-data {
|
||||||
margin: 20rpx;
|
margin: 20rpx;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
border-radius: 10rpx;
|
border-radius: 20rpx;
|
||||||
box-shadow: 0px 0px 10px 0px #a7bbe4;
|
box-shadow: 0px 0px 10px 0px #a7bbe4;
|
||||||
display: flex;
|
display: flex;
|
||||||
//border: 1px solid #2979ff;
|
// border: 1px solid #2979ff;
|
||||||
|
|
||||||
.myCourse-data-image {
|
.myCourse-data-image {
|
||||||
display: block;
|
display: block;
|
||||||
@@ -357,6 +363,7 @@
|
|||||||
.row-button {
|
.row-button {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row-reverse;
|
flex-direction: row-reverse;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
@@ -366,10 +373,20 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.popup-image {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 60rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 360rpx;
|
||||||
|
height: 360rpx
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
._text {
|
._text {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 30px 0;
|
padding: 20rpx 0 60rpx 0;
|
||||||
margin-top: 130rpx;
|
|
||||||
color: #888;
|
color: #888;
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user