代码格式优化,去除多余的引入
This commit is contained in:
+31
-31
@@ -10,11 +10,11 @@
|
||||
</view>
|
||||
<view class="input-view" @click="toSearchPage">
|
||||
<uv-input shape="circle"
|
||||
placeholderStyle='color:#999999;font-size:28rpx'
|
||||
placeholder="请输入课程名"
|
||||
placeholderStyle='color:#999999;font-size:28rpx'
|
||||
placeholder="请输入课程名"
|
||||
suffixIcon="search"
|
||||
:customStyle="customStyle"
|
||||
:suffixIconStyle="suffixIconStyle"
|
||||
:suffixIconStyle="suffixIconStyle"
|
||||
:readonly="true">
|
||||
</uv-input>
|
||||
</view>
|
||||
@@ -46,19 +46,19 @@
|
||||
</view>
|
||||
</view>
|
||||
<uv-scroll-list class="tags-view" :indicator="false">
|
||||
<uv-tags text="全部"
|
||||
shape="circle"
|
||||
plain
|
||||
class="tags-item"
|
||||
size="mini"
|
||||
<uv-tags text="全部"
|
||||
shape="circle"
|
||||
plain
|
||||
class="tags-item"
|
||||
size="mini"
|
||||
:type="activeTag.length === 0?'primary':'info'"
|
||||
@click="chooseTag({value:''})"
|
||||
></uv-tags>
|
||||
<uv-tags :text="item.label"
|
||||
v-for="item in tagsList"
|
||||
:key="item.value"
|
||||
shape="circle"
|
||||
plain
|
||||
<uv-tags :text="item.label"
|
||||
v-for="item in tagsList"
|
||||
:key="item.value"
|
||||
shape="circle"
|
||||
plain
|
||||
:type="activeTag.includes(item.value)?'primary':'info'"
|
||||
@click="chooseTag(item)"
|
||||
class="tags-item" size="mini"
|
||||
@@ -66,7 +66,7 @@
|
||||
</uv-scroll-list>
|
||||
<view class="course-list">
|
||||
<view class="left-type-list" v-if="'全部' === activeTab">
|
||||
<view
|
||||
<view
|
||||
v-for="item in courseTypeList"
|
||||
:key="item.value"
|
||||
:class="['type-item',activeCourseType == item.value ?'is-active':'']"
|
||||
@@ -76,7 +76,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="left-type-list" v-if="'生产线'===activeTab">
|
||||
<view
|
||||
<view
|
||||
v-for="item in coursePrdlineList"
|
||||
:key="item.value"
|
||||
:class="['type-item', activePrdlineType == item.value ?'is-active':'']"
|
||||
@@ -86,13 +86,13 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-course-list">
|
||||
<view
|
||||
class="type-list"
|
||||
v-for="item in courseListTreeShow"
|
||||
<view
|
||||
class="type-list"
|
||||
v-for="item in courseListTreeShow"
|
||||
:key="item.value"
|
||||
>
|
||||
<view
|
||||
class="type-title"
|
||||
<view
|
||||
class="type-title"
|
||||
v-if="item.courseList.length > 0 && showTypeName"
|
||||
>
|
||||
<!-- v-if="itemT.courseList.length>0 && " -->
|
||||
@@ -100,7 +100,7 @@
|
||||
{{item.label}}
|
||||
</view>
|
||||
<CourseItem v-for="itemC in item.courseList" :key="itemC.crsNum" :itemInfo="itemC" :activeTag="activeTag" @clickItem="toCourseDetail(itemC)"/>
|
||||
<view
|
||||
<view
|
||||
class="type-list"
|
||||
v-for="itemT in item.children"
|
||||
:key="itemT.value"
|
||||
@@ -141,7 +141,7 @@ import { onShow } from "@dcloudio/uni-app"
|
||||
paddingTop: "5px",
|
||||
paddingBottom: "5px",
|
||||
border: "none"
|
||||
}
|
||||
}
|
||||
const suffixIconStyle = {
|
||||
color: "#2c8ef2",
|
||||
fontSize: "40rpx"
|
||||
@@ -164,16 +164,16 @@ import { onShow } from "@dcloudio/uni-app"
|
||||
const courseTypeList = ref([])
|
||||
const coursePrdlineList = ref([])
|
||||
const tagsTree = ref([])
|
||||
|
||||
|
||||
const showFilterList = ref(false)
|
||||
const {
|
||||
statusBarHeight
|
||||
} = uni.getWindowInfo()
|
||||
|
||||
|
||||
const pageTopPadding = computed(() => statusBarHeight + 'px')
|
||||
|
||||
|
||||
const activeTagPop = ref([])
|
||||
|
||||
|
||||
const chooseTagPop = (item) => {
|
||||
if(!item.value){
|
||||
activeTagPop.value = []
|
||||
@@ -210,7 +210,7 @@ import { onShow } from "@dcloudio/uni-app"
|
||||
}
|
||||
const showTypeName = computed(()=>{
|
||||
return (activeTab.value === '全部' && activeCourseType.value === '') || (activeTab.value === '生产线' && activePrdlineType.value === '')
|
||||
})
|
||||
})
|
||||
const tagsList = computed(()=>{
|
||||
let _arr = []
|
||||
tagsTree.value.forEach(t=>{
|
||||
@@ -221,7 +221,7 @@ import { onShow } from "@dcloudio/uni-app"
|
||||
let _reqListN = _arr.filter(t=>t.required === "N")
|
||||
return _reqList.concat(_reqListN)
|
||||
})
|
||||
|
||||
|
||||
const courseListBase = ref([])
|
||||
const courseList = computed(()=>{
|
||||
if(activeTag.value.length > 0 && !!activeTag.value[0]){
|
||||
@@ -244,10 +244,10 @@ import { onShow } from "@dcloudio/uni-app"
|
||||
})
|
||||
// 整理树形
|
||||
const courseListTree = computed(()=>{
|
||||
let _arr = activeTab.value === '全部'? courseTypeList.value
|
||||
let _arr = activeTab.value === '全部'? courseTypeList.value
|
||||
: activeTab.value === '生产线'? coursePrdlineList.value: []
|
||||
let _idKey = activeTab.value === '全部'? 'tagId': 'prdLineId'
|
||||
|
||||
|
||||
let _tree = _arr.map(t=>{
|
||||
let _children = t.children||[]
|
||||
return {
|
||||
@@ -397,7 +397,7 @@ import { onShow } from "@dcloudio/uni-app"
|
||||
}
|
||||
}
|
||||
.input-view{
|
||||
|
||||
|
||||
}
|
||||
.tabs-view{
|
||||
background: #ffffff;
|
||||
|
||||
Reference in New Issue
Block a user