产线转运
This commit is contained in:
@@ -98,10 +98,11 @@
|
||||
},
|
||||
// 使用 onShow 确保每次进入页面(包括从后台切回)都能读取最新的缓存值
|
||||
onShow() {
|
||||
this._getRegion()
|
||||
this.loadSelectedValue();
|
||||
},
|
||||
created () {
|
||||
this._getRegion()
|
||||
// console.log(2)
|
||||
},
|
||||
methods: {
|
||||
async _getRegion () {
|
||||
|
||||
@@ -96,8 +96,13 @@
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
created () {
|
||||
// 使用 onShow 确保每次进入页面(包括从后台切回)都能读取最新的缓存值
|
||||
onShow() {
|
||||
this._getRegion()
|
||||
this.loadSelectedValue();
|
||||
},
|
||||
created () {
|
||||
// console.log(2)
|
||||
},
|
||||
methods: {
|
||||
async _getRegion () {
|
||||
@@ -105,7 +110,6 @@
|
||||
let res = await getRegion()
|
||||
if (res) {
|
||||
this.options2 = res
|
||||
this.index2 = res[4].value
|
||||
} else {
|
||||
this.options2 =[]
|
||||
}
|
||||
@@ -113,11 +117,22 @@
|
||||
this.options2 = []
|
||||
}
|
||||
},
|
||||
// 从缓存加载选中的值
|
||||
loadSelectedValue() {
|
||||
if (uni.getStorageSync('selectedSiteType2')) {
|
||||
this.index = uni.getStorageSync('selectedSiteType2')
|
||||
}
|
||||
if (uni.getStorageSync('selectedMbqy2')) {
|
||||
this.index2 = uni.getStorageSync('selectedMbqy2')
|
||||
}
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
uni.setStorageSync('selectedSiteType2', e)
|
||||
},
|
||||
selectChange2 (e) {
|
||||
this.index2 = e
|
||||
uni.setStorageSync('selectedMbqy2', e)
|
||||
},
|
||||
clearUp () {
|
||||
this.val1 = ''
|
||||
|
||||
Reference in New Issue
Block a user