Revert "无ISBN:书号非978一律678ISBN/售价自动填入/版权页比价/去重提交按钮/去价格建议条"
This reverts commit 1c2eaa3d7b.
This commit is contained in:
parent
1c2eaa3d7b
commit
8db03e7238
@ -286,6 +286,9 @@
|
|||||||
<input class="form-input" v-model="noIsbnStock" type="number" placeholder="库存" style="flex:1;" />
|
<input class="form-input" v-model="noIsbnStock" type="number" placeholder="库存" style="flex:1;" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="noIsbnProductList.length > 0 && calculatedNoIsbnPrice > 0" class="price-suggest-hint" @click="noIsbnPrice = String(calculatedNoIsbnPrice)">
|
||||||
|
<text class="hint-text">系统建议售价 <text class="hint-value">¥{{ calculatedNoIsbnPrice }}</text>(点击填入)</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- ===== 图书详情 ===== -->
|
<!-- ===== 图书详情 ===== -->
|
||||||
@ -418,13 +421,8 @@
|
|||||||
|
|
||||||
<!-- ===== 在售商品 ===== -->
|
<!-- ===== 在售商品 ===== -->
|
||||||
<view class="form-section" v-if="noIsbnProductList.length > 0">
|
<view class="form-section" v-if="noIsbnProductList.length > 0">
|
||||||
<view class="section-header-row">
|
<view class="section-title">
|
||||||
<view class="section-title">
|
<text class="title-text">在售商品</text>
|
||||||
<text class="title-text">在售商品</text>
|
|
||||||
</view>
|
|
||||||
<view class="copyright-btn" @click="searchNoIsbnCopyright">
|
|
||||||
<text class="copyright-btn-text">版权页比价</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="loading-box" v-if="noIsbnLoading">
|
<view class="loading-box" v-if="noIsbnLoading">
|
||||||
<view class="loading-spinner"></view>
|
<view class="loading-spinner"></view>
|
||||||
@ -465,6 +463,13 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- ===== 确认上传 ===== -->
|
||||||
|
<view class="submit-area">
|
||||||
|
<view class="submit-btn" @click="submitNoIsbnUpload" :class="{ disabled: noIsbnSubmitting }">
|
||||||
|
<text class="submit-btn-text">确认上传</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="bottom-placeholder"></view>
|
<view class="bottom-placeholder"></view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
@ -857,6 +862,7 @@ export default {
|
|||||||
noIsbnProductList: [],
|
noIsbnProductList: [],
|
||||||
noIsbnHistoryList: [],
|
noIsbnHistoryList: [],
|
||||||
noIsbnLoading: false,
|
noIsbnLoading: false,
|
||||||
|
noIsbnSubmitting: false,
|
||||||
noIsbnDetailExpanded: false,
|
noIsbnDetailExpanded: false,
|
||||||
|
|
||||||
// 筛选
|
// 筛选
|
||||||
@ -1625,56 +1631,42 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ISBN与售价不能为空
|
||||||
|
if (!this.isbn) {
|
||||||
|
uni.showToast({ title: 'ISBN不能为空', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.price) {
|
||||||
|
uni.showToast({ title: '售价不能为空', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确认弹窗
|
||||||
const warehouseName = warehouseData.warehouseName || warehouseData.name || ''
|
const warehouseName = warehouseData.warehouseName || warehouseData.name || ''
|
||||||
const locCode = warehouseData.locationCode || warehouseData.code || ''
|
const locCode = warehouseData.locationCode || warehouseData.code || ''
|
||||||
const locationText = warehouseName + (locCode ? ' - ' + locCode : '')
|
const locationText = warehouseName + (locCode ? ' - ' + locCode : '')
|
||||||
|
const isbn = this.isbn || '-'
|
||||||
|
const bookName = this.bookName || '-'
|
||||||
|
const price = this.price || '-'
|
||||||
|
const stock = this.stock ?? '-'
|
||||||
|
const author = this.author || '-'
|
||||||
|
const publisher = this.publisher || '-'
|
||||||
|
const fixPrice = this.fixPrice || '-'
|
||||||
|
const printTime = this.printTime || '-'
|
||||||
|
const photoCount = this.photoList.length
|
||||||
|
|
||||||
let contentLines
|
const contentLines = [
|
||||||
if (this.currentTab === 'isbn') {
|
'📦 货区:' + locationText,
|
||||||
// ISBN页
|
'📖 ISBN:' + isbn,
|
||||||
if (!this.isbn) {
|
'📕 书名:' + bookName,
|
||||||
uni.showToast({ title: 'ISBN不能为空', icon: 'none' })
|
'💰 价格:' + price,
|
||||||
return
|
'📊 库存:' + stock,
|
||||||
}
|
'✍️ 作者:' + author,
|
||||||
if (!this.price) {
|
'🏢 出版社:' + publisher,
|
||||||
uni.showToast({ title: '售价不能为空', icon: 'none' })
|
'🏷️ 定价:' + fixPrice,
|
||||||
return
|
'📅 印刷时间:' + printTime,
|
||||||
}
|
'📷 图片:' + photoCount + '张'
|
||||||
contentLines = [
|
]
|
||||||
'📦 货区:' + locationText,
|
|
||||||
'📖 ISBN:' + (this.isbn || '-'),
|
|
||||||
'📕 书名:' + (this.bookName || '-'),
|
|
||||||
'💰 价格:' + (this.price || '-'),
|
|
||||||
'📊 库存:' + (this.stock ?? '-'),
|
|
||||||
'✍️ 作者:' + (this.author || '-'),
|
|
||||||
'🏢 出版社:' + (this.publisher || '-'),
|
|
||||||
'🏷️ 定价:' + (this.fixPrice || '-'),
|
|
||||||
'📅 印刷时间:' + (this.printTime || '-'),
|
|
||||||
'📷 图片:' + this.photoList.length + '张'
|
|
||||||
]
|
|
||||||
} else {
|
|
||||||
// 无ISBN页
|
|
||||||
if (!this.noIsbnPrice) {
|
|
||||||
uni.showToast({ title: '售价不能为空', icon: 'none' })
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!this.noIsbnBookName) {
|
|
||||||
uni.showToast({ title: '书名不能为空', icon: 'none' })
|
|
||||||
return
|
|
||||||
}
|
|
||||||
contentLines = [
|
|
||||||
'📦 货区:' + locationText,
|
|
||||||
'📕 书名:' + (this.noIsbnBookName || '-'),
|
|
||||||
'✍️ 作者:' + (this.noIsbnAuthor || '-'),
|
|
||||||
'🏢 出版社:' + (this.noIsbnPublisher || '-'),
|
|
||||||
'🏷️ 定价:' + (this.noIsbnOriginalPrice || '-'),
|
|
||||||
'📖 ISBN:' + (this.noIsbnIsbn || this.noIsbnUnifyIsbn || '-'),
|
|
||||||
'📅 印刷时间:' + (this.noIsbnPrintTime || '-'),
|
|
||||||
'💰 价格:' + (this.noIsbnPrice || '-'),
|
|
||||||
'📊 库存:' + (this.noIsbnStock ?? '-'),
|
|
||||||
'📷 图片:' + this.noIsbnPhotoList.length + '张'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '确认上传',
|
title: '确认上传',
|
||||||
@ -1698,6 +1690,7 @@ export default {
|
|||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
this.isSubmitting = false
|
this.isSubmitting = false
|
||||||
uni.showToast({ title: '上传成功', icon: 'success' })
|
uni.showToast({ title: '上传成功', icon: 'success' })
|
||||||
|
// 清空表单待后续对接真实API
|
||||||
}, 1500)
|
}, 1500)
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1762,12 +1755,6 @@ export default {
|
|||||||
// 填充下拉选项
|
// 填充下拉选项
|
||||||
this.noIsbnAuthorOptions = Array.from(authorSet).filter(Boolean).slice(0, 10)
|
this.noIsbnAuthorOptions = Array.from(authorSet).filter(Boolean).slice(0, 10)
|
||||||
this.noIsbnPublisherOptions = Array.from(publisherSet).filter(Boolean).slice(0, 10)
|
this.noIsbnPublisherOptions = Array.from(publisherSet).filter(Boolean).slice(0, 10)
|
||||||
// 自动计算并填入售价
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (this.calculatedNoIsbnPrice > 0) {
|
|
||||||
this.noIsbnPrice = String(this.calculatedNoIsbnPrice)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.error('无ISBN搜索失败:', err)
|
console.error('无ISBN搜索失败:', err)
|
||||||
this.noIsbnLoading = false
|
this.noIsbnLoading = false
|
||||||
@ -1775,70 +1762,57 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 无ISBN - 版权页比价(带作者+出版社精确搜索)
|
// 无ISBN - 确认上传
|
||||||
searchNoIsbnCopyright() {
|
submitNoIsbnUpload() {
|
||||||
if (!this.isLoggedIn) {
|
if (this.noIsbnSubmitting) return
|
||||||
uni.showToast({ title: '请先登录孔网账号', icon: 'none' })
|
|
||||||
|
const warehouseData = this.currentTab === 'no-isbn' ? this.noIsbnWarehouseData : null
|
||||||
|
if (!warehouseData) {
|
||||||
|
uni.showToast({ title: '请选择货区', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.noIsbnPrice) {
|
||||||
|
uni.showToast({ title: '售价不能为空', icon: 'none' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!this.noIsbnBookName) {
|
if (!this.noIsbnBookName) {
|
||||||
uni.showToast({ title: '请输入书名', icon: 'none' })
|
uni.showToast({ title: '书名不能为空', icon: 'none' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.noIsbnLoading = true
|
|
||||||
this.noIsbnProductList = []
|
const warehouseName = warehouseData.warehouseName || warehouseData.name || ''
|
||||||
const phpsessid = this.kongfzToken || uni.getStorageSync('kongfz_phpsessid') || ''
|
const locCode = warehouseData.locationCode || warehouseData.code || ''
|
||||||
const keyword = this.noIsbnBookName
|
const locationText = warehouseName + (locCode ? ' - ' + locCode : '')
|
||||||
searchProducts(keyword, {
|
|
||||||
phpsessid,
|
const contentLines = [
|
||||||
sortType: '7',
|
'📦 货区:' + locationText,
|
||||||
quality: this.noIsbnConditionValue,
|
'📕 书名:' + (this.noIsbnBookName || '-'),
|
||||||
publisher: this.noIsbnPublisher,
|
'✍️ 作者:' + (this.noIsbnAuthor || '-'),
|
||||||
author: this.noIsbnAuthor
|
'🏢 出版社:' + (this.noIsbnPublisher || '-'),
|
||||||
}).then((productsData) => {
|
'🏷️ 定价:' + (this.noIsbnOriginalPrice || '-'),
|
||||||
this.noIsbnLoading = false
|
'📖 ISBN:' + (this.noIsbnIsbn || this.noIsbnUnifyIsbn || '-'),
|
||||||
if (productsData && productsData.total > 0) {
|
'📅 印刷时间:' + (this.noIsbnPrintTime || '-'),
|
||||||
const list = (productsData.list || []).slice(0, 12)
|
'💰 价格:' + (this.noIsbnPrice || '-'),
|
||||||
this.noIsbnProductList = list.map(item => {
|
'📊 库存:' + (this.noIsbnStock ?? '-'),
|
||||||
const cleanPrice = parseFloat((item.priceText || '0').replace(/[^\d.]/g, ''))
|
'📷 图片:' + this.noIsbnPhotoList.length + '张'
|
||||||
let shippingFee = 0
|
]
|
||||||
if (item.postage) {
|
|
||||||
if (typeof item.postage === 'number' || typeof item.postage === 'string') {
|
uni.showModal({
|
||||||
shippingFee = parseFloat(item.postage) || 0
|
title: '确认上传',
|
||||||
} else if (item.postage.shippingList && item.postage.shippingList.length > 0) {
|
content: contentLines.join('\n'),
|
||||||
shippingFee = parseFloat(item.postage.shippingList[0].shippingFee || 0)
|
confirmText: '确认上传',
|
||||||
} else if (item.postage.shippingFee) {
|
cancelText: '取消',
|
||||||
shippingFee = parseFloat(item.postage.shippingFee || 0)
|
success: (res) => {
|
||||||
}
|
if (res.confirm) {
|
||||||
}
|
this.noIsbnSubmitting = true
|
||||||
if (shippingFee === 0 && item.shippingFee) {
|
uni.showLoading({ title: '上传中...' })
|
||||||
shippingFee = parseFloat(item.shippingFee) || 0
|
setTimeout(() => {
|
||||||
}
|
uni.hideLoading()
|
||||||
const totalPrice = Number((cleanPrice + shippingFee).toFixed(2))
|
this.noIsbnSubmitting = false
|
||||||
return {
|
uni.showToast({ title: '上传成功', icon: 'success' })
|
||||||
image: item.imgBigUrl || '',
|
}, 1500)
|
||||||
totalPrice: totalPrice,
|
}
|
||||||
bookPrice: cleanPrice,
|
|
||||||
shippingFee: shippingFee,
|
|
||||||
condition: item.qualityText || '',
|
|
||||||
shopName: item.shopName || '',
|
|
||||||
bookName: item.title || '',
|
|
||||||
author: item.author || '',
|
|
||||||
pubDate: item.pubDateText || '',
|
|
||||||
bookId: item.id || ''
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// 自动计算并填入售价
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (this.calculatedNoIsbnPrice > 0) {
|
|
||||||
this.noIsbnPrice = String(this.calculatedNoIsbnPrice)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
|
||||||
console.error('版权比价失败:', err)
|
|
||||||
this.noIsbnLoading = false
|
|
||||||
uni.showToast({ title: '比价失败', icon: 'none' })
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1909,19 +1883,23 @@ export default {
|
|||||||
this.noIsbnFormat = this.noIsbnFormatOptions.includes(fmt) ? fmt : fmt + '开'
|
this.noIsbnFormat = this.noIsbnFormatOptions.includes(fmt) ? fmt : fmt + '开'
|
||||||
}
|
}
|
||||||
if (texts.ISBN && /^\d/.test(texts.ISBN)) {
|
if (texts.ISBN && /^\d/.test(texts.ISBN)) {
|
||||||
|
// ISBN有值则直接填入
|
||||||
this.noIsbnIsbn = texts.ISBN
|
this.noIsbnIsbn = texts.ISBN
|
||||||
this.noIsbnUnifyIsbn = ''
|
this.noIsbnUnifyIsbn = ''
|
||||||
}
|
}
|
||||||
if (texts.书号) {
|
if (texts.书号) {
|
||||||
const bookCode = texts.书号.replace(/\D/g, '')
|
const bookCode = texts.书号.replace(/\D/g, '')
|
||||||
if (bookCode.length === 13 && bookCode.startsWith('978')) {
|
if (bookCode.length === 13 && bookCode.startsWith('978')) {
|
||||||
// 978开头的13位数字 → 填入ISBN,书号清空
|
// 978开头的13位数字 → 填入ISBN
|
||||||
this.noIsbnIsbn = bookCode
|
this.noIsbnIsbn = bookCode
|
||||||
this.noIsbnUnifyIsbn = ''
|
this.noIsbnUnifyIsbn = ''
|
||||||
} else {
|
} else if (bookCode.length === 13) {
|
||||||
// 其他情况 → 书号保留原值,ISBN生成678开头13位数字
|
// 非978的13位数字 → 填入书号,ISBN随机生成678开头
|
||||||
this.noIsbnUnifyIsbn = texts.书号
|
this.noIsbnUnifyIsbn = bookCode
|
||||||
this.noIsbnIsbn = '678' + String(Date.now()).slice(-10)
|
this.noIsbnIsbn = '678' + String(Date.now()).slice(-10)
|
||||||
|
} else {
|
||||||
|
// 其他情况 → 直接填入书号
|
||||||
|
this.noIsbnUnifyIsbn = texts.书号
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (texts.字数) this.noIsbnWordCount = this.processNoIsbnWordage(texts.字数)
|
if (texts.字数) this.noIsbnWordCount = this.processNoIsbnWordage(texts.字数)
|
||||||
@ -2351,20 +2329,23 @@ export default {
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== 版权页比价按钮 ========== */
|
/* ========== 价格建议提示 ========== */
|
||||||
.copyright-btn {
|
.price-suggest-hint {
|
||||||
padding: 8rpx 16rpx;
|
margin-top: 10rpx;
|
||||||
background-color: #409eff;
|
padding: 12rpx 16rpx;
|
||||||
border-radius: 6rpx;
|
background-color: #f0f9eb;
|
||||||
display: flex;
|
border-radius: 8rpx;
|
||||||
align-items: center;
|
border: 2rpx solid #e1f3d8;
|
||||||
justify-content: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.copyright-btn-text {
|
.price-suggest-hint .hint-text {
|
||||||
font-size: 24rpx;
|
font-size: 26rpx;
|
||||||
color: #ffffff;
|
color: #67c23a;
|
||||||
font-weight: 500;
|
}
|
||||||
|
|
||||||
|
.price-suggest-hint .hint-value {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== 扫描/搜索按钮 ========== */
|
/* ========== 扫描/搜索按钮 ========== */
|
||||||
@ -2787,6 +2768,11 @@ export default {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.submit-area {
|
||||||
|
margin-top: 30rpx;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.submit-btn.disabled {
|
.submit-btn.disabled {
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
@ -2872,6 +2858,12 @@ export default {
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.submit-btn-text {
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
/* ========== 筛选弹窗 ========== */
|
/* ========== 筛选弹窗 ========== */
|
||||||
.filter-popup {
|
.filter-popup {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|||||||
@ -190,7 +190,7 @@ export function fetchItems(token, params = {}, onProgress) {
|
|||||||
* list中每项: {id, title, author, press, priceText, imgBigUrl, shopName, qualityText, pubDateText, postage}
|
* list中每项: {id, title, author, press, priceText, imgBigUrl, shopName, qualityText, pubDateText, postage}
|
||||||
*/
|
*/
|
||||||
export function searchProducts(keyword, options = {}) {
|
export function searchProducts(keyword, options = {}) {
|
||||||
const { phpsessid = '', page = 1, sortType = '', quality = '', publisher = '', author = '' } = options
|
const { phpsessid = '', page = 1, sortType = '', quality = '' } = options
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const reqData = {
|
const reqData = {
|
||||||
dataType: 0,
|
dataType: 0,
|
||||||
@ -208,12 +208,6 @@ export function searchProducts(keyword, options = {}) {
|
|||||||
reqData.quaSelect = '2'
|
reqData.quaSelect = '2'
|
||||||
actionPaths.push('quality')
|
actionPaths.push('quality')
|
||||||
}
|
}
|
||||||
if (publisher) {
|
|
||||||
reqData.press = publisher
|
|
||||||
}
|
|
||||||
if (author) {
|
|
||||||
reqData.author = author
|
|
||||||
}
|
|
||||||
if (actionPaths.length > 0) {
|
if (actionPaths.length > 0) {
|
||||||
reqData.actionPath = actionPaths.join(',')
|
reqData.actionPath = actionPaths.join(',')
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user