Browse Source

数字资源-api

master
xuhuajiao 2 years ago
parent
commit
0cf349ac58
  1. 2
      src/main.js
  2. 21
      src/views/digitalResource.vue

2
src/main.js

@ -19,7 +19,7 @@ import axios from 'axios'
Vue.prototype.$axios = axios
// 馆代码 1201为东西湖馆代码 / 本地测试用FTZN
Vue.prototype.libcode = '1201'
Vue.prototype.libcode = 'FTZN'
// 引入echart
import echarts from 'echarts'

21
src/views/digitalResource.vue

@ -7,11 +7,10 @@
<h2>数字资源</h2>
</div>
<div class="main">
<!-- <div v-for="item in srcList" :key="item" class="book-rack"> -->
<div v-for="(item,index) in srcList" :key="index" class="main-item">
<img :src="item.bgImg">
<div v-for="(item,index) in srcList" :key="index" class="main-item" @click="jump(item.nrsUrl)">
<img :src="'data:image/png;base64,' + item.nrsImages">
<div class="title">
{{ item.title }}
{{ item.nrsTitle }}
</div>
</div>
</div>
@ -20,7 +19,7 @@
</template>
<script>
import data1 from './data1.json'
import { initNumberResoures } from '@/api/bookshelf'
export default {
name: 'DigitalResource',
components: {
@ -31,7 +30,17 @@ export default {
}
},
created() {
this.srcList = data1.srcList
this.getResoures()
},
methods: {
getResoures() {
initNumberResoures({ libcode: this.libcode }).then(data => {
this.srcList = data
})
},
jump(url) {
window.location.href = url
}
}
}
</script>

Loading…
Cancel
Save