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