无ISBN:印刷时间改为年/月滚动选择器 格式YYYY/MM

This commit is contained in:
97694732@qq.com 2026-06-04 14:39:46 +08:00
parent b52d5ca884
commit ea9b060d28

View File

@ -324,7 +324,11 @@
<view class="field-label">
<text class="label-text">印刷时间</text>
</view>
<input class="form-input" v-model="noIsbnPrintTime" placeholder="请输入印刷时间" />
<picker mode="multiSelector" :range="noIsbnPrintTimeColumns" @columnchange="onNoIsbnPrintTimeColumnChange" @change="onNoIsbnPrintTimeChange" :value="noIsbnPrintTimeIndexes">
<view class="form-input picker-value-text">
<text>{{ noIsbnPrintTime || '选择年/月' }}</text>
</view>
</picker>
</view>
<view class="form-section">
@ -818,6 +822,7 @@ export default {
// ISBN
noIsbnPrintTime: '',
noIsbnPrintTimeIndexes: [0, 0],
noIsbnBookName: '',
noIsbnAuthor: '',
noIsbnPublisher: '',
@ -1068,6 +1073,19 @@ export default {
for (let i = 2; i <= 12; i++) arr.push(i)
return arr
},
noIsbnYearOptions() {
const arr = []
for (let i = 1960; i <= 2035; i++) arr.push(String(i))
return arr
},
noIsbnMonthOptions() {
const arr = []
for (let i = 1; i <= 12; i++) arr.push(String(i).padStart(2, '0'))
return arr
},
noIsbnPrintTimeColumns() {
return [this.noIsbnYearOptions, this.noIsbnMonthOptions]
},
filteredLocationList() {
if (!this.popupLocationSearch) return this.popupLocationList
const kw = this.popupLocationSearch.toLowerCase()
@ -1622,6 +1640,23 @@ export default {
this.updateNoIsbnSelectedCategoryId()
},
// -
onNoIsbnPrintTimeColumnChange(e) {
const { column, value } = e.detail
this.noIsbnPrintTimeIndexes[column] = value
},
// -
onNoIsbnPrintTimeChange(e) {
const values = e.detail.value
this.noIsbnPrintTimeIndexes = [...values]
const year = this.noIsbnYearOptions[values[0]]
const month = this.noIsbnMonthOptions[values[1]]
if (year && month) {
this.noIsbnPrintTime = year + '/' + month
}
},
//
previewProductImage(index) {
const urls = this.productList.map(item => item.image).filter(Boolean)
@ -2292,6 +2327,16 @@ export default {
color: #c0c4cc;
}
/* 印刷时间选择器:和表单输入框一致 */
.picker-value-text {
display: flex;
align-items: center;
font-size: 28rpx;
color: #606266;
width: 100%;
height: 100%;
}
/* ========== ISBN 输入 ========== */
.isbn-input-box {
display: flex;