|
@@ -112,7 +112,7 @@
|
|
|
cartNum: state => state.indexData.cartNum
|
|
cartNum: state => state.indexData.cartNum
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- mounted() {
|
|
|
|
|
|
|
+ mounted() {
|
|
|
console.log(this.version)
|
|
console.log(this.version)
|
|
|
let that = this
|
|
let that = this
|
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
@@ -127,6 +127,13 @@
|
|
|
this.activeRouter = '/' + curRoute
|
|
this.activeRouter = '/' + curRoute
|
|
|
this.getAllCategory();
|
|
this.getAllCategory();
|
|
|
},
|
|
},
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ isNew(newVal) {
|
|
|
|
|
+ if (newVal) {
|
|
|
|
|
+ this.getAllCategory();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
getNav() {
|
|
getNav() {
|
|
|
getNavigation().then(res => {
|
|
getNavigation().then(res => {
|
|
@@ -179,9 +186,9 @@
|
|
|
this.$set(this, 'lock', true);
|
|
this.$set(this, 'lock', true);
|
|
|
},
|
|
},
|
|
|
getAllCategory: function() {
|
|
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 => {
|
|
getCategoryList().then(res => {
|
|
|
uni.setStorageSync('CAT1_DATA', res.data)
|
|
uni.setStorageSync('CAT1_DATA', res.data)
|
|
|
that.productList = res.data;
|
|
that.productList = res.data;
|