|
@@ -15,13 +15,13 @@
|
|
|
<view class="dljt-detail-box">
|
|
|
<view class="dljt-editor-box">
|
|
|
<view class="dljt-classify-box">
|
|
|
- <view class="classify-item" v-for="item in data.list" :key="item.title" @click="handleSelect(item)">{{item.title}}</view>
|
|
|
+ <view class="classify-item" :class="{active: data.activeId == item.id}" v-for="item in data.list" :key="item.title" @click="handleSelect(item)">{{item.title}}</view>
|
|
|
</view>
|
|
|
<!-- 富文本 -->
|
|
|
<MtaMpHtml class="dljt-editor-box" :content="data.activeData.content" ></MtaMpHtml>
|
|
|
|
|
|
<!-- 链接 -->
|
|
|
- <view class="dljt-link-box">
|
|
|
+ <view class="dljt-link-box" v-if="isHasLink(data.activeData.link)">
|
|
|
<view class="link-item-box" v-for="cItem in data.activeData.link">
|
|
|
<icon></icon>
|
|
|
<a :href="cItem.url">{{cItem.name}}</a>
|
|
@@ -29,7 +29,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- table -->
|
|
|
- <view class="dljt-table-box">
|
|
|
+ <view class="dljt-table-box" v-if="isHasLink(data.activeData.ziliao)">
|
|
|
<view class="table-th-row">
|
|
|
<view style="width: 15%">序号</view>
|
|
|
<view style="width: 60%">资料名称</view>
|
|
@@ -67,7 +67,7 @@
|
|
|
const data = reactive({
|
|
|
list: null,
|
|
|
activeId: null,
|
|
|
- activeData: null
|
|
|
+ activeData: {}
|
|
|
})
|
|
|
|
|
|
onLoad(() => {
|
|
@@ -84,12 +84,32 @@
|
|
|
|
|
|
function handleSelect(item) {
|
|
|
data.activeId = item.id;
|
|
|
+ httpApi.getCommonZSJYZhuanyeInfo({id: data.activeId}).then(res => {
|
|
|
+ data.activeData = res.data;
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
function handleDownFile(ccite) {
|
|
|
window.location.href = ccite.url;
|
|
|
}
|
|
|
|
|
|
+ function isHasLink(list) {
|
|
|
+ if (!list) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (list.length>1) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (list.length == 0 ) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (list.length == 1 && list[0].name && list[0].url) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
function pageInit() {
|
|
|
httpApi.getCommonZSJYShengxueList({page:data.page,size:data.size}).then(res => {
|