mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-31 23:10:45 +00:00
fix: 后台分类切换
This commit is contained in:
parent
399d1e4c78
commit
6d5d2e9378
@ -40,11 +40,9 @@
|
||||
}
|
||||
},
|
||||
onLoad() {},
|
||||
onReady() {
|
||||
this.getCategoryVersion()
|
||||
},
|
||||
onReady() {},
|
||||
onShow() {
|
||||
|
||||
this.getCategoryVersion()
|
||||
},
|
||||
methods: {
|
||||
getCategoryVersion() {
|
||||
@ -58,7 +56,6 @@
|
||||
}
|
||||
this.classStyle();
|
||||
})
|
||||
|
||||
},
|
||||
jumpIndex() {
|
||||
if (this.is_diy) {}
|
||||
|
||||
@ -112,7 +112,7 @@
|
||||
cartNum: state => state.indexData.cartNum
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
mounted() {
|
||||
console.log(this.version)
|
||||
let that = this
|
||||
// #ifdef H5
|
||||
@ -127,6 +127,13 @@
|
||||
this.activeRouter = '/' + curRoute
|
||||
this.getAllCategory();
|
||||
},
|
||||
watch: {
|
||||
isNew(newVal) {
|
||||
if (newVal) {
|
||||
this.getAllCategory();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getNav() {
|
||||
getNavigation().then(res => {
|
||||
@ -179,9 +186,9 @@
|
||||
this.$set(this, 'lock', true);
|
||||
},
|
||||
getAllCategory: function() {
|
||||
let that = this;
|
||||
console.log(this.version,'1',uni.getStorageSync('CAT_VERSION'))
|
||||
if (this.version !== uni.getStorageSync('CAT_VERSION')) {
|
||||
let that = this;
|
||||
console.log(this.version, '1', uni.getStorageSync('CAT_VERSION'))
|
||||
if (this.isNew || !uni.getStorageSync('CAT1_DATA')) {
|
||||
getCategoryList().then(res => {
|
||||
uni.setStorageSync('CAT1_DATA', res.data)
|
||||
that.productList = res.data;
|
||||
|
||||
@ -115,6 +115,13 @@
|
||||
default: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isNew(newVal) {
|
||||
if (newVal) {
|
||||
this.getAllCategory();
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: mapGetters(['isLogin', 'uid']),
|
||||
components: {
|
||||
productWindow,
|
||||
@ -631,7 +638,7 @@
|
||||
},
|
||||
getAllCategory: function() {
|
||||
let that = this;
|
||||
if (this.isNew) {
|
||||
if (this.isNew || !uni.getStorageSync('CAT2_DATA')) {
|
||||
getCategoryList().then(res => {
|
||||
uni.setStorageSync('CAT2_DATA', res.data)
|
||||
let data = res.data;
|
||||
|
||||
@ -119,6 +119,13 @@
|
||||
default: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isNew(newVal) {
|
||||
if (newVal) {
|
||||
this.getAllCategory();
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
categoryList: [],
|
||||
@ -667,7 +674,7 @@
|
||||
},
|
||||
getAllCategory: function() {
|
||||
let that = this;
|
||||
if (this.isNew) {
|
||||
if (this.isNew || !uni.getStorageSync('CAT3_DATA')) {
|
||||
getCategoryList().then(res => {
|
||||
let data = res.data;
|
||||
uni.setStorageSync('CAT3_DATA', data)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user