fix:品相切换时不弹窗不刷新分类,只搜在售商品
This commit is contained in:
parent
95b99e2453
commit
5941e78d71
@ -1258,9 +1258,9 @@ export default {
|
||||
|
||||
watch: {
|
||||
noIsbnSelectedCondition() {
|
||||
// 品相变化时重新搜索在售商品(无ISBN页)
|
||||
// 品相变化时重新搜索在售商品(无ISBN页),不弹窗不刷新分类
|
||||
if (this.noIsbnBookName && this.isLoggedIn) {
|
||||
this.searchNoIsbn()
|
||||
this.searchNoIsbn(true)
|
||||
}
|
||||
},
|
||||
selectedCondition() {
|
||||
@ -3035,7 +3035,7 @@ export default {
|
||||
},
|
||||
|
||||
// 无ISBN - 书名搜索(使用与ISBN相同的kongfz接口)
|
||||
searchNoIsbn() {
|
||||
searchNoIsbn(skipPopup) {
|
||||
if (!this.isLoggedIn) {
|
||||
uni.showToast({ title: '请先登录孔网账号', icon: 'none' })
|
||||
return
|
||||
@ -3044,19 +3044,23 @@ export default {
|
||||
uni.showToast({ title: '请输入书名', icon: 'none' })
|
||||
return
|
||||
}
|
||||
// 点击搜索时重新获取作者、出版社、分类
|
||||
// 点击搜索时重新获取作者、出版社、分类(品相切换时不需要)
|
||||
if (!skipPopup) {
|
||||
this.fetchNoIsbnBookData()
|
||||
}
|
||||
// 先查询PSI系统已有图书
|
||||
this.searchNoIsbnBook(function(hasData) {
|
||||
if (!hasData) {
|
||||
// 无匹配数据,走孔网搜索
|
||||
this.searchNoIsbnKongfz()
|
||||
}
|
||||
}.bind(this))
|
||||
}.bind(this), skipPopup)
|
||||
},
|
||||
|
||||
// 无ISBN - 查询PSI系统已有图书(getNoIsbnBook),有数据则弹窗选择
|
||||
searchNoIsbnBook(callback) {
|
||||
// @param {Function} callback 回调函数
|
||||
// @param {boolean} skipPopup 是否跳过弹窗(品相切换时不弹窗)
|
||||
searchNoIsbnBook(callback, skipPopup) {
|
||||
var ts = String(Math.floor(Date.now() / 1000))
|
||||
var token = uni.getStorageSync('token') || ''
|
||||
var params = {
|
||||
@ -3094,7 +3098,7 @@ export default {
|
||||
console.log('【getNoIsbnBook】响应:', res.statusCode, res.data)
|
||||
if (res.statusCode === 200 && res.data && res.data.code === 200) {
|
||||
var list = (res.data.data && res.data.data.list) || []
|
||||
if (list.length > 0) {
|
||||
if (list.length > 0 && !skipPopup) {
|
||||
// 使用自定义弹窗
|
||||
that.noIsbnBookList = list
|
||||
that.noIsbnBookPopupVisible = true
|
||||
|
||||
Loading…
Reference in New Issue
Block a user