移除本地生活商品返回上一页刷新页面的问题

This commit is contained in:
wangxiaowei 2024-12-02 17:38:42 +08:00
parent 84ac4f467e
commit 60d6528485
2 changed files with 17 additions and 9 deletions

@ -432,9 +432,9 @@
});
}
},
onUnload() {
uni.$emit('refresh_local_shop_list', true)
},
// onUnload() {
// uni.$emit('refresh_local_shop_list', true)
// },
computed: {
btnText() {
if (this.state == 1) {

@ -2,7 +2,8 @@
<view>
<tabs :current="active" @change="changeShow" bar-width="60" :is-scroll="false" :num="20">
<tab v-for="(item, index) in menu" :key="index" :name="item.name" :num="item.num">
<shop-list :order-type="item.type" :lstore-id="lstore_id" :i="index" :index="active" @setGoodsStateNum="setGoodsStateNum"></shop-list>
<shop-list :order-type="item.type" :lstore-id="lstore_id" :scroll-to="scrollTo" :i="index" :index="active"
@setGoodsStateNum="setGoodsStateNum"></shop-list>
</tab>
</tabs>
</view>
@ -12,7 +13,7 @@
import shopList from './components/shop-list.vue'
export default {
components: {
shopList,
shopList,
},
data() {
return {
@ -34,16 +35,24 @@
type: 4,
num: 0
}],
lstore_id: 0
lstore_id: 0,
scrollTo: 0
};
},
onLoad(options) {
this.lstore_id = options?.lstore_id
this.changeShow(0);
},
onShow() {
if (uni.getStorageSync('mescrollScrollTop')) {
this.scrollTo = uni.getStorageSync('mescrollScrollTop')
console.log('getStorageSync=', uni.getStorageSync('mescrollScrollTop'))
}
},
methods: {
changeShow(index) {
if(index != -1) {
if (index != -1) {
this.$nextTick(() => {
this.active = index
})
@ -57,7 +66,6 @@
}
};
</script>
<style lang="scss" scoped>
</style>