|
|
@ -54,12 +54,11 @@ |
|
|
</view> |
|
|
</view> |
|
|
<view> |
|
|
<view> |
|
|
<text class="info-item-title">所在馆</text> |
|
|
<text class="info-item-title">所在馆</text> |
|
|
<!-- item.orglib || '葛店经济技术开发区图书馆' --> |
|
|
|
|
|
<text>葛店经济技术开发区图书馆</text> |
|
|
|
|
|
|
|
|
<text>{{ getLibraryName(item.orglib) }}</text> |
|
|
</view> |
|
|
</view> |
|
|
<view> |
|
|
<view> |
|
|
<text class="info-item-title">当前馆藏地</text> |
|
|
<text class="info-item-title">当前馆藏地</text> |
|
|
<text>{{ item.orglocal || '葛店图书馆' }}</text> |
|
|
|
|
|
|
|
|
<text>{{ getLocationName(item.orglocal) }}</text> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -97,7 +96,7 @@ |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { FetchInitScreenSetting } from '@/api/user'; |
|
|
import { FetchInitScreenSetting } from '@/api/user'; |
|
|
import { FetchFindbookByQuery } from '@/api/book'; |
|
|
|
|
|
|
|
|
import { FetchFindbookByQuery, FetchDictionaryTree } from '@/api/book'; |
|
|
import config from '@/utils/config'; |
|
|
import config from '@/utils/config'; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
@ -111,6 +110,9 @@ export default { |
|
|
fromRecommend: false, |
|
|
fromRecommend: false, |
|
|
bookInfo: {}, |
|
|
bookInfo: {}, |
|
|
holdingsData: [], |
|
|
holdingsData: [], |
|
|
|
|
|
dictionaryTree: {}, |
|
|
|
|
|
libraryMap: {}, |
|
|
|
|
|
locationMap: {} |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onLoad(options) { |
|
|
onLoad(options) { |
|
|
@ -129,6 +131,7 @@ export default { |
|
|
this.bookrecno = options.bookrecno || ""; |
|
|
this.bookrecno = options.bookrecno || ""; |
|
|
this.fromRecommend = false; |
|
|
this.fromRecommend = false; |
|
|
this.getOpacUrl(); |
|
|
this.getOpacUrl(); |
|
|
|
|
|
this.getDictionaryTree(); |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
// 在馆数量 |
|
|
// 在馆数量 |
|
|
@ -150,6 +153,38 @@ export default { |
|
|
onImgError(e) { |
|
|
onImgError(e) { |
|
|
e.target.src = "/static/images/default-book.png"; |
|
|
e.target.src = "/static/images/default-book.png"; |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 获取字典项 - 馆代码 |
|
|
|
|
|
async getDictionaryTree() { |
|
|
|
|
|
try { |
|
|
|
|
|
const res = await FetchDictionaryTree(); |
|
|
|
|
|
console.log('dictionaryTree',res); |
|
|
|
|
|
const data = res.data || []; |
|
|
|
|
|
|
|
|
|
|
|
// 1. 找到分馆字典项 |
|
|
|
|
|
const fgItem = data.find(item => item.dictionaryCode === 'FG' && item.dictionaryName === '分馆'); |
|
|
|
|
|
if (fgItem && fgItem.childDictionarys) { |
|
|
|
|
|
// 建立分馆映射:dictionaryCode -> dictionaryName |
|
|
|
|
|
this.libraryMap = {}; |
|
|
|
|
|
fgItem.childDictionarys.forEach(child => { |
|
|
|
|
|
this.libraryMap[child.dictionaryCode] = child.dictionaryName; |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 2. 找到馆藏地点字典项 |
|
|
|
|
|
const gcdItem = data.find(item => item.dictionaryCode === 'GCD' && item.dictionaryName === '馆藏地点'); |
|
|
|
|
|
if (gcdItem && gcdItem.childDictionarys) { |
|
|
|
|
|
// 建立馆藏地点映射:dictionaryCode -> dictionaryName |
|
|
|
|
|
this.locationMap = {}; |
|
|
|
|
|
gcdItem.childDictionarys.forEach(child => { |
|
|
|
|
|
this.locationMap[child.dictionaryCode] = child.dictionaryName; |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.dictionaryTree = data; |
|
|
|
|
|
} catch (err) { |
|
|
|
|
|
console.error('获取字典树失败', err); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
// 获取配置 |
|
|
// 获取配置 |
|
|
async getOpacUrl() { |
|
|
async getOpacUrl() { |
|
|
try { |
|
|
try { |
|
|
@ -204,6 +239,18 @@ export default { |
|
|
return map[state] || '未知'; |
|
|
return map[state] || '未知'; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 获取所在馆名称 |
|
|
|
|
|
getLibraryName(orglib) { |
|
|
|
|
|
if (!orglib) return '葛店经济技术开发区图书馆'; |
|
|
|
|
|
return this.libraryMap[orglib] || orglib || '葛店经济技术开发区图书馆'; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 获取馆藏地名称 |
|
|
|
|
|
getLocationName(orglocal) { |
|
|
|
|
|
if (!orglocal) return '葛店图书馆'; |
|
|
|
|
|
return this.locationMap[orglocal] || orglocal || '葛店图书馆'; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// 收藏 |
|
|
// 收藏 |
|
|
checkCollectStatus() { |
|
|
checkCollectStatus() { |
|
|
const list = uni.getStorageSync('collectList') || []; |
|
|
const list = uni.getStorageSync('collectList') || []; |
|
|
@ -312,7 +359,10 @@ export default { |
|
|
padding: 10px; |
|
|
padding: 10px; |
|
|
margin-bottom: 10px; |
|
|
margin-bottom: 10px; |
|
|
border: 1px solid #eee; |
|
|
border: 1px solid #eee; |
|
|
|
|
|
|
|
|
|
|
|
border-radius: 10px; |
|
|
|
|
|
&:last-child { |
|
|
|
|
|
margin-bottom: 0; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
.store-info-item view { |
|
|
.store-info-item view { |
|
|
display: flex; |
|
|
display: flex; |
|
|
|