优化店务小程序店铺设置和表单体验
This commit is contained in:
@@ -598,6 +598,7 @@ Page({
|
||||
},
|
||||
customerOptions: [],
|
||||
customerDropdownVisible: false,
|
||||
customerNameFocused: false,
|
||||
customerLoading: false,
|
||||
customerError: '',
|
||||
products: [],
|
||||
@@ -651,6 +652,9 @@ Page({
|
||||
}
|
||||
this.loadOptions()
|
||||
this.searchCustomers()
|
||||
wx.nextTick(() => {
|
||||
this.setData({ customerNameFocused: true })
|
||||
})
|
||||
},
|
||||
|
||||
async loadOptions() {
|
||||
@@ -745,7 +749,10 @@ Page({
|
||||
|
||||
onCustomerFocus(event) {
|
||||
const field = event.currentTarget.dataset.field
|
||||
this.setData({ customerDropdownVisible: true })
|
||||
this.setData({
|
||||
customerDropdownVisible: true,
|
||||
customerNameFocused: field === 'customerName'
|
||||
})
|
||||
this.searchCustomers(field)
|
||||
},
|
||||
|
||||
@@ -794,7 +801,10 @@ Page({
|
||||
|
||||
hideCustomerDropdown() {
|
||||
setTimeout(() => {
|
||||
this.setData({ customerDropdownVisible: false })
|
||||
this.setData({
|
||||
customerDropdownVisible: false,
|
||||
customerNameFocused: false
|
||||
})
|
||||
}, 180)
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user