Browse Source

ip更换/详情修改

master
xuhuajiao 1 year ago
parent
commit
1c896572df
  1. 4
      .env.production
  2. 15
      src/views/bookRackList.vue
  3. 15
      src/views/index.vue
  4. 15
      src/views/module/homeListItem.vue

4
.env.production

@ -2,8 +2,8 @@ ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置 # 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http # 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
# VUE_APP_BASE_API = 'https://openapitest.aiyxlib.com'
# VUE_APP_BASE_API = 'http://192.168.99.107:7070' # VUE_APP_BASE_API = 'http://192.168.99.107:7070'
VUE_APP_BASE_API = 'http://172.16.0.23:8080'
VUE_APP_BASE_API = 'http://172.22.0.23:8080'
# VUE_APP_BASE_API = 'http://127.0.0.1:8080'
# 如果接口是 http 形式, wss 需要改为 ws # 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'ws://192.168.99.107:7071' VUE_APP_WS_API = 'ws://192.168.99.107:7071'

15
src/views/bookRackList.vue

@ -90,8 +90,21 @@ export default {
isbn: itemData.isbn.replace(/\-/g, '') isbn: itemData.isbn.replace(/\-/g, '')
} }
getBookDetailsByISBN(params).then(res => { getBookDetailsByISBN(params).then(res => {
this.$refs.detailDom.bookData = res
this.$refs.detailDom.dialogVisible = true this.$refs.detailDom.dialogVisible = true
if (res) {
this.$refs.detailDom.bookData = res
} else {
this.$refs.detailDom.bookData = {
srcUrl: itemData.bookAuthor,
bookName: itemData.bookName,
bookAuthor: itemData.bookAuthor ? itemData.bookAuthor : '暂无信息',
gist: '暂无简介',
Publish: '暂无信息',
places: [
{ shelfName: '' }
]
}
}
}) })
}, },
// //

15
src/views/index.vue

@ -147,9 +147,11 @@ export default {
this.rightShelfMsg = res.rightShelf.sortMsg this.rightShelfMsg = res.rightShelf.sortMsg
Promise.all(this.initBookData(res.bookList.splice(0, 1))).then((res) => { Promise.all(this.initBookData(res.bookList.splice(0, 1))).then((res) => {
this.rackList = res this.rackList = res
console.log('rackList', this.rackList)
}) })
Promise.all(this.initBookData(res.bookList.splice(-2))).then((res) => { Promise.all(this.initBookData(res.bookList.splice(-2))).then((res) => {
this.otherList = res this.otherList = res
console.log('otherList', this.otherList)
}) })
}) })
}, },
@ -157,19 +159,20 @@ export default {
initBookData(bookList) { initBookData(bookList) {
return bookList.map(async(item, index) => { return bookList.map(async(item, index) => {
const newItem = { const newItem = {
cover: item.srcUrl,
ranking: item.bookUID, ranking: item.bookUID,
nbName: item.bookName, nbName: item.bookName,
isOtherBook: index !== 0, isOtherBook: index !== 0,
nbAuthor: item.bookAuthor,
nbAuthor: item.bookAuthor ? item.bookAuthor : '',
isNewBook: false, isNewBook: false,
num: item.heat ? item.heat : '0', num: item.heat ? item.heat : '0',
isbn: item.isbn isbn: item.isbn
} }
const params = {
isbn: item.isbn
}
const res = await FetchCoverByISBN(params)
newItem.cover = window.URL.createObjectURL(res)
// const params = {
// isbn: item.isbn
// }
// const res = await FetchCoverByISBN(params)
// newItem.cover = window.URL.createObjectURL(res)
return newItem return newItem
}) })
} }

15
src/views/module/homeListItem.vue

@ -71,8 +71,21 @@ export default {
isbn: this.listData[index].isbn.replace(/\-/g, '') isbn: this.listData[index].isbn.replace(/\-/g, '')
} }
getBookDetailsByISBN(params).then(res => { getBookDetailsByISBN(params).then(res => {
this.$refs.detailDom.bookData = res
this.$refs.detailDom.dialogVisible = true this.$refs.detailDom.dialogVisible = true
if (res) {
this.$refs.detailDom.bookData = res
} else {
this.$refs.detailDom.bookData = {
srcUrl: this.listData[index].cover,
bookName: this.listData[index].nbName,
bookAuthor: this.listData[index].nbAuthor ? this.listData[index].nbAuthor : '暂无信息',
gist: '暂无简介',
Publish: '暂无信息',
places: [
{ shelfName: '' }
]
}
}
}) })
} }
} }

Loading…
Cancel
Save