无ISBN:识图上传/作者出版社下拉/开本下拉(21种)/书号字段/图书分类与ISBN一致

This commit is contained in:
97694732@qq.com 2026-06-04 10:02:31 +08:00
parent 3002979ff2
commit 949670c0a4

View File

@ -263,6 +263,11 @@
<text class="search-text"></text>
</view>
</view>
<view class="inline-field" style="flex:none;margin-left:10rpx;">
<view class="scan-btn" @click="chooseImageNoIsbn">
<text class="scan-icon">📷</text>
</view>
</view>
</view>
</view>
@ -293,14 +298,26 @@
<view class="field-label">
<text class="label-text">作者</text>
</view>
<input class="form-input" v-model="noIsbnAuthor" placeholder="请输入作者" />
<view class="dropdown-wrapper">
<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 class="dropdown-item" v-for="(item, idx) in noIsbnAuthorOptions" :key="idx" @click="selectNoIsbnAuthor(item)">{{ item }}</view>
</view>
</view>
</view>
<view class="form-section">
<view class="field-label">
<text class="label-text">出版社</text>
</view>
<input class="form-input" v-model="noIsbnPublisher" placeholder="请输入出版社" />
<view class="dropdown-wrapper">
<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 class="dropdown-item" v-for="(item, idx) in noIsbnPublisherOptions" :key="idx" @click="selectNoIsbnPublisher(item)">{{ item }}</view>
</view>
</view>
</view>
<view class="form-section">
@ -320,6 +337,13 @@
</view>
</view>
<view class="form-section">
<view class="field-label">
<text class="label-text">书号</text>
</view>
<input class="form-input" v-model="noIsbnUnifyIsbn" placeholder="请输入统一书号" />
</view>
<view class="form-section">
<view class="field-label">
<text class="label-text">ISBN</text>
@ -341,7 +365,13 @@
<view class="field-label">
<text class="label-text">开本</text>
</view>
<input class="form-input" v-model="noIsbnFormat" placeholder="请输入开本" />
<view class="dropdown-wrapper">
<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 class="dropdown-item" v-for="(item, idx) in noIsbnFormatOptions" :key="idx" @click="selectNoIsbnFormat(item)">{{ item }}</view>
</view>
</view>
</view>
<view class="form-section">
@ -834,6 +864,7 @@ export default {
noIsbnOriginalPrice: '',
noIsbnWordCount: '',
noIsbnIsbn: '',
noIsbnUnifyIsbn: '',
noIsbnSelectedCondition: '六品',
noIsbnPrice: '',
noIsbnStock: 1,
@ -841,6 +872,16 @@ export default {
noIsbnSelectedArea: '',
noIsbnWarehouseData: null,
// ISBN -
noIsbnAuthorOptions: [],
noIsbnAuthorDropdownVisible: false,
noIsbnPublisherOptions: [],
noIsbnPublisherDropdownVisible: false,
noIsbnFormatDropdownVisible: false,
// ISBN
noIsbnFormatOptions: ['2', '4', '6', '8', '12', '16', '18', '20', '24', '32', '36', '40', '42', '48', '50', '60', '64', '72', '大16', '大32', '其他'],
// ISBN - /
noIsbnMarketData: { onSale: 0, old: 0, new: 0, sold: 0 },
noIsbnProductList: [],
@ -1547,6 +1588,9 @@ export default {
searchFacet(keyword, { phpsessid, dataType: 1 })
]).then(([productsData, onSaleFacet, soldFacet]) => {
this.noIsbnLoading = false
//
const authorSet = new Set()
const publisherSet = new Set()
if (productsData && productsData.total > 0) {
const list = (productsData.list || []).slice(0, 12)
this.noIsbnProductList = list.map(item => {
@ -1565,6 +1609,9 @@ export default {
shippingFee = parseFloat(item.shippingFee) || 0
}
const totalPrice = Number((cleanPrice + shippingFee).toFixed(2))
//
if (item.author) authorSet.add(item.author.trim())
if (item.shopName) publisherSet.add(item.shopName.trim())
return {
image: item.imgBigUrl || '',
totalPrice: totalPrice,
@ -1579,6 +1626,9 @@ export default {
}
})
}
//
this.noIsbnAuthorOptions = Array.from(authorSet).filter(Boolean).slice(0, 10)
this.noIsbnPublisherOptions = Array.from(publisherSet).filter(Boolean).slice(0, 10)
this.noIsbnMarketData = {
onSale: onSaleFacet ? onSaleFacet.totalFound : (productsData ? productsData.total : 0),
old: onSaleFacet ? onSaleFacet.oldCount : 0,
@ -1620,6 +1670,7 @@ export default {
'✍️ 作者:' + (this.noIsbnAuthor || '-'),
'🏢 出版社:' + (this.noIsbnPublisher || '-'),
'🏷️ 定价:' + (this.noIsbnOriginalPrice || '-'),
'📖 ISBN' + (this.noIsbnIsbn || this.noIsbnUnifyIsbn || '-'),
'📅 印刷时间:' + (this.noIsbnPrintTime || '-'),
'💰 价格:' + (this.noIsbnPrice || '-'),
'📊 库存:' + (this.noIsbnStock ?? '-'),
@ -1645,6 +1696,45 @@ export default {
})
},
// ISBN -
chooseImageNoIsbn() {
uni.showToast({ title: '请拍照或选择图片', icon: 'none' })
uni.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: (res) => {
const tempFiles = res.tempFilePaths
if (tempFiles && tempFiles.length > 0) {
//
this.noIsbnPhotoList = this.noIsbnPhotoList.concat(tempFiles)
if (this.noIsbnPhotoList.length > 9) {
this.noIsbnPhotoList = this.noIsbnPhotoList.slice(0, 9)
}
uni.showToast({ title: '已添加识图图片', icon: 'success' })
}
}
})
},
// ISBN -
selectNoIsbnAuthor(item) {
this.noIsbnAuthor = item
this.noIsbnAuthorDropdownVisible = false
},
// ISBN -
selectNoIsbnPublisher(item) {
this.noIsbnPublisher = item
this.noIsbnPublisherDropdownVisible = false
},
// ISBN -
selectNoIsbnFormat(item) {
this.noIsbnFormat = item
this.noIsbnFormatDropdownVisible = false
},
// -
handleLogin() {
if (!this.loginAccount) {
@ -1916,6 +2006,12 @@ export default {
border-color: #409eff;
}
/* 下拉内联框:右侧直角与▼按钮衔接 */
.dropdown-wrapper .form-input {
border-radius: 8rpx 0 0 8rpx;
border-right: none;
}
/* ========== 选择器 ========== */
.picker-box {
background-color: #ffffff;
@ -2464,6 +2560,58 @@ export default {
transition: transform 0.2s;
}
/* ========== 下拉列表(作者/出版社/开本) ========== */
.dropdown-wrapper {
position: relative;
display: flex;
align-items: center;
flex: 1;
}
.dropdown-btn {
width: 60rpx;
height: 76rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 24rpx;
color: #909399;
background-color: #f5f7fa;
border: 2rpx solid #dcdfe6;
border-left: none;
border-radius: 0 8rpx 8rpx 0;
flex-shrink: 0;
}
.dropdown-list {
position: absolute;
top: 100%;
left: 0;
right: 0;
z-index: 100;
background: #ffffff;
border: 2rpx solid #dcdfe6;
border-radius: 8rpx;
max-height: 300rpx;
overflow-y: auto;
box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.1);
}
.dropdown-item {
padding: 20rpx 24rpx;
font-size: 28rpx;
color: #303133;
border-bottom: 1rpx solid #f2f2f2;
}
.dropdown-item:last-child {
border-bottom: none;
}
.dropdown-item:active {
background-color: #f5f7fa;
}
.submit-text {
color: #ffffff;
font-size: 32rpx;