Compare commits

..

4 Commits

View File

@ -223,7 +223,7 @@
</view> <!-- /tab-panel ISBN -->
<!-- 无ISBN上传内容 -->
<view class="tab-panel" v-show="swiperIndex === 1">
<view class="tab-panel" v-show="swiperIndex === 1" @click="closeAllNoIsbnDropdowns">
<view class="tab-content">
<scroll-view class="content-scroll" scroll-y="true">
@ -309,7 +309,7 @@
<view class="dropdown-wrapper" style="flex:1;">
<input class="form-input" v-model="noIsbnAuthor" placeholder="作者" style="flex:1;" />
<view class="dropdown-btn" @click.stop="noIsbnAuthorDropdownVisible = !noIsbnAuthorDropdownVisible"></view>
<view v-if="noIsbnAuthorDropdownVisible && noIsbnAuthorOptions.length > 0" class="dropdown-list">
<view v-if="noIsbnAuthorDropdownVisible && noIsbnAuthorOptions.length > 0" class="dropdown-list" @click.stop>
<view class="dropdown-item" v-for="(item, idx) in noIsbnAuthorOptions" :key="idx" @click="selectNoIsbnAuthor(item)">{{ item }}</view>
</view>
</view>
@ -318,7 +318,7 @@
<view class="dropdown-wrapper" style="flex:1;">
<input class="form-input" v-model="noIsbnPublisher" placeholder="出版社" style="flex:1;" />
<view class="dropdown-btn" @click.stop="noIsbnPublisherDropdownVisible = !noIsbnPublisherDropdownVisible"></view>
<view v-if="noIsbnPublisherDropdownVisible && noIsbnPublisherOptions.length > 0" class="dropdown-list">
<view v-if="noIsbnPublisherDropdownVisible && noIsbnPublisherOptions.length > 0" class="dropdown-list" @click.stop>
<view class="dropdown-item" v-for="(item, idx) in noIsbnPublisherOptions" :key="idx" @click="selectNoIsbnPublisher(item)">{{ item.showName || item }}{{ item.showValue ? '' + item.showValue + '' : '' }}</view>
</view>
</view>
@ -372,9 +372,11 @@
<view class="inline-fields" style="flex:1;align-items:stretch;">
<view class="inline-field" style="flex:1;">
<picker @change="onNoIsbnCategoryChange" :value="noIsbnCategoryIndex" :range="noIsbnCategoryNames">
<view class="category-select" style="height:100%;">
<view class="category-select">
<text class="category-value">{{ noIsbnCategoryNames[noIsbnCategoryIndex] || '请选择分类' }}</text>
<text class="picker-arrow"></text>
<view class="dropdown-btn" style="height:100%;">
<text style="font-size:20rpx;color:#909399;"></text>
</view>
</view>
</picker>
</view>
@ -382,7 +384,7 @@
<view class="dropdown-wrapper" style="flex:1;">
<input class="form-input" v-model="noIsbnBinding" placeholder="装订" style="flex:1;" />
<view class="dropdown-btn" @click.stop="noIsbnBindingDropdownVisible = !noIsbnBindingDropdownVisible"></view>
<view v-if="noIsbnBindingDropdownVisible" class="dropdown-list">
<view v-if="noIsbnBindingDropdownVisible" class="dropdown-list" @click.stop>
<view class="dropdown-item" v-for="(item, idx) in noIsbnBindingOptions" :key="idx" @click="selectNoIsbnBinding(item)">{{ item }}</view>
</view>
</view>
@ -400,7 +402,7 @@
<view class="dropdown-wrapper" style="flex:1;">
<input class="form-input" v-model="noIsbnFormat" placeholder="开本" style="flex:1;" />
<view class="dropdown-btn" @click.stop="noIsbnFormatDropdownVisible = !noIsbnFormatDropdownVisible"></view>
<view v-if="noIsbnFormatDropdownVisible" class="dropdown-list">
<view v-if="noIsbnFormatDropdownVisible" class="dropdown-list" @click.stop>
<view class="dropdown-item" v-for="(item, idx) in noIsbnFormatOptions" :key="idx" @click="selectNoIsbnFormat(item)">{{ item }}</view>
</view>
</view>
@ -1963,7 +1965,8 @@ export default {
this.noIsbnCategoryIndex = index
var item = this.noIsbnCategoryList[index]
this.noIsbnSelectedCategoryValue = item ? item.value : ''
//
// //()+
this.fetchNoIsbnBookData()
this.debouncedReSearch()
},
@ -1975,6 +1978,14 @@ export default {
}, 300)
},
//
closeAllNoIsbnDropdowns() {
this.noIsbnAuthorDropdownVisible = false
this.noIsbnPublisherDropdownVisible = false
this.noIsbnFormatDropdownVisible = false
this.noIsbnBindingDropdownVisible = false
},
// -
onNoIsbnPrintTimeColumnChange(e) {
const { column, value } = e.detail
@ -2399,6 +2410,12 @@ export default {
this.noIsbnBinding = ''
this.noIsbnProductList = []
this.noIsbnMarketData = { onSale: 0, old: 0, new: 0, sold: 0 }
//
this.noIsbnCategoryList = []
this.noIsbnCategoryNames = ['请输入书名后自动获取分类']
this.noIsbnCategoryIndex = 0
this.noIsbnSelectedCategoryValue = ''
this.noIsbnWordCount = ''
} catch (e) {
uni.hideLoading()
console.error('【syncBook】失败:', e)
@ -3474,54 +3491,20 @@ export default {
selectNoIsbnAuthor(item) {
this.noIsbnAuthor = typeof item === 'string' ? item : (item.showName || '')
this.noIsbnAuthorDropdownVisible = false
// +
this.fetchNoIsbnPressesByAuthor(this.noIsbnAuthor)
// //()+
this.fetchNoIsbnBookData()
this.debouncedReSearch()
},
//
async fetchNoIsbnPressesByAuthor(author) {
var bookName = (this.noIsbnBookName || '').trim()
if (!bookName || !author) return
try {
var pressList = await searchPresses(bookName, {
phpsessid: this.kongfzToken || '',
author: author
})
if (pressList.length > 0) {
this.noIsbnPublisherOptions = pressList.slice(0, 20)
}
} catch (e) {
console.error('按作者获取出版社失败:', e)
}
},
// ISBN -
selectNoIsbnPublisher(item) {
this.noIsbnPublisher = typeof item === 'string' ? item : (item.showName || '')
this.noIsbnPublisherDropdownVisible = false
// +
this.fetchNoIsbnAuthorsByPublisher(this.noIsbnPublisher)
// //()+
this.fetchNoIsbnBookData()
this.debouncedReSearch()
},
//
async fetchNoIsbnAuthorsByPublisher(publisher) {
var bookName = (this.noIsbnBookName || '').trim()
if (!bookName || !publisher) return
try {
var authorList = await searchAuthors(bookName, {
phpsessid: this.kongfzToken || '',
publisher: publisher
})
if (authorList.length > 0) {
this.noIsbnAuthorOptions = authorList.map(function(item) { return item.showName }).slice(0, 20)
}
} catch (e) {
console.error('按出版社获取作者失败:', e)
}
},
// ISBN -
selectNoIsbnFormat(item) {
this.noIsbnFormat = item
@ -4682,20 +4665,39 @@ picker {
.category-select {
background-color: #ffffff;
border: 2rpx solid #dcdfe6;
border-radius: 8rpx;
border-right: none;
border-radius: 8rpx 0 0 8rpx;
height: 76rpx;
padding: 0 16rpx;
padding: 0 0 0 16rpx;
font-size: 28rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
display: flex !important;
align-items: stretch;
overflow: hidden;
}
.category-value {
font-size: 28rpx;
color: #606266;
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: 76rpx;
}
.category-select .dropdown-btn {
border: none !important;
border-left: 2rpx solid #dcdfe6 !important;
border-radius: 0 8rpx 8rpx 0;
height: 100%;
width: 60rpx;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
background: #f5f7fa;
margin: 0;
}
/* ========== 仓库弹窗 ========== */