无ISBN:识图上传/作者出版社下拉/开本下拉(21种)/书号字段/图书分类与ISBN一致
This commit is contained in:
parent
3002979ff2
commit
949670c0a4
@ -263,6 +263,11 @@
|
|||||||
<text class="search-text">搜</text>
|
<text class="search-text">搜</text>
|
||||||
</view>
|
</view>
|
||||||
</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>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -293,14 +298,26 @@
|
|||||||
<view class="field-label">
|
<view class="field-label">
|
||||||
<text class="label-text">作者</text>
|
<text class="label-text">作者</text>
|
||||||
</view>
|
</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>
|
||||||
|
|
||||||
<view class="form-section">
|
<view class="form-section">
|
||||||
<view class="field-label">
|
<view class="field-label">
|
||||||
<text class="label-text">出版社</text>
|
<text class="label-text">出版社</text>
|
||||||
</view>
|
</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>
|
||||||
|
|
||||||
<view class="form-section">
|
<view class="form-section">
|
||||||
@ -320,6 +337,13 @@
|
|||||||
</view>
|
</view>
|
||||||
</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="form-section">
|
||||||
<view class="field-label">
|
<view class="field-label">
|
||||||
<text class="label-text">ISBN</text>
|
<text class="label-text">ISBN</text>
|
||||||
@ -341,7 +365,13 @@
|
|||||||
<view class="field-label">
|
<view class="field-label">
|
||||||
<text class="label-text">开本</text>
|
<text class="label-text">开本</text>
|
||||||
</view>
|
</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>
|
||||||
|
|
||||||
<view class="form-section">
|
<view class="form-section">
|
||||||
@ -834,6 +864,7 @@ export default {
|
|||||||
noIsbnOriginalPrice: '',
|
noIsbnOriginalPrice: '',
|
||||||
noIsbnWordCount: '',
|
noIsbnWordCount: '',
|
||||||
noIsbnIsbn: '',
|
noIsbnIsbn: '',
|
||||||
|
noIsbnUnifyIsbn: '',
|
||||||
noIsbnSelectedCondition: '六品',
|
noIsbnSelectedCondition: '六品',
|
||||||
noIsbnPrice: '',
|
noIsbnPrice: '',
|
||||||
noIsbnStock: 1,
|
noIsbnStock: 1,
|
||||||
@ -841,6 +872,16 @@ export default {
|
|||||||
noIsbnSelectedArea: '',
|
noIsbnSelectedArea: '',
|
||||||
noIsbnWarehouseData: null,
|
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 - 市场竞争/在售
|
// 无ISBN - 市场竞争/在售
|
||||||
noIsbnMarketData: { onSale: 0, old: 0, new: 0, sold: 0 },
|
noIsbnMarketData: { onSale: 0, old: 0, new: 0, sold: 0 },
|
||||||
noIsbnProductList: [],
|
noIsbnProductList: [],
|
||||||
@ -1547,6 +1588,9 @@ export default {
|
|||||||
searchFacet(keyword, { phpsessid, dataType: 1 })
|
searchFacet(keyword, { phpsessid, dataType: 1 })
|
||||||
]).then(([productsData, onSaleFacet, soldFacet]) => {
|
]).then(([productsData, onSaleFacet, soldFacet]) => {
|
||||||
this.noIsbnLoading = false
|
this.noIsbnLoading = false
|
||||||
|
// 收集作者和出版社选项
|
||||||
|
const authorSet = new Set()
|
||||||
|
const publisherSet = new Set()
|
||||||
if (productsData && productsData.total > 0) {
|
if (productsData && productsData.total > 0) {
|
||||||
const list = (productsData.list || []).slice(0, 12)
|
const list = (productsData.list || []).slice(0, 12)
|
||||||
this.noIsbnProductList = list.map(item => {
|
this.noIsbnProductList = list.map(item => {
|
||||||
@ -1565,6 +1609,9 @@ export default {
|
|||||||
shippingFee = parseFloat(item.shippingFee) || 0
|
shippingFee = parseFloat(item.shippingFee) || 0
|
||||||
}
|
}
|
||||||
const totalPrice = Number((cleanPrice + shippingFee).toFixed(2))
|
const totalPrice = Number((cleanPrice + shippingFee).toFixed(2))
|
||||||
|
// 提取作者和出版社
|
||||||
|
if (item.author) authorSet.add(item.author.trim())
|
||||||
|
if (item.shopName) publisherSet.add(item.shopName.trim())
|
||||||
return {
|
return {
|
||||||
image: item.imgBigUrl || '',
|
image: item.imgBigUrl || '',
|
||||||
totalPrice: totalPrice,
|
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 = {
|
this.noIsbnMarketData = {
|
||||||
onSale: onSaleFacet ? onSaleFacet.totalFound : (productsData ? productsData.total : 0),
|
onSale: onSaleFacet ? onSaleFacet.totalFound : (productsData ? productsData.total : 0),
|
||||||
old: onSaleFacet ? onSaleFacet.oldCount : 0,
|
old: onSaleFacet ? onSaleFacet.oldCount : 0,
|
||||||
@ -1620,6 +1670,7 @@ export default {
|
|||||||
'✍️ 作者:' + (this.noIsbnAuthor || '-'),
|
'✍️ 作者:' + (this.noIsbnAuthor || '-'),
|
||||||
'🏢 出版社:' + (this.noIsbnPublisher || '-'),
|
'🏢 出版社:' + (this.noIsbnPublisher || '-'),
|
||||||
'🏷️ 定价:' + (this.noIsbnOriginalPrice || '-'),
|
'🏷️ 定价:' + (this.noIsbnOriginalPrice || '-'),
|
||||||
|
'📖 ISBN:' + (this.noIsbnIsbn || this.noIsbnUnifyIsbn || '-'),
|
||||||
'📅 印刷时间:' + (this.noIsbnPrintTime || '-'),
|
'📅 印刷时间:' + (this.noIsbnPrintTime || '-'),
|
||||||
'💰 价格:' + (this.noIsbnPrice || '-'),
|
'💰 价格:' + (this.noIsbnPrice || '-'),
|
||||||
'📊 库存:' + (this.noIsbnStock ?? '-'),
|
'📊 库存:' + (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() {
|
handleLogin() {
|
||||||
if (!this.loginAccount) {
|
if (!this.loginAccount) {
|
||||||
@ -1916,6 +2006,12 @@ export default {
|
|||||||
border-color: #409eff;
|
border-color: #409eff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 下拉内联框:右侧直角与▼按钮衔接 */
|
||||||
|
.dropdown-wrapper .form-input {
|
||||||
|
border-radius: 8rpx 0 0 8rpx;
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
/* ========== 选择器 ========== */
|
/* ========== 选择器 ========== */
|
||||||
.picker-box {
|
.picker-box {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
@ -2464,6 +2560,58 @@ export default {
|
|||||||
transition: transform 0.2s;
|
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 {
|
.submit-text {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user