|
@@ -178,23 +178,35 @@ export default {
|
|
|
loginMethods() {
|
|
loginMethods() {
|
|
|
this.showLoading();
|
|
this.showLoading();
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
- this.getStore().then(res => {
|
|
|
|
|
- console.log(res);
|
|
|
|
|
- this.storeInfo = res;
|
|
|
|
|
- this.getData();
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.offsetTop = this.systemInfo.statusBarHeight + 44;
|
|
|
|
|
- if (!this.fixedTop) {
|
|
|
|
|
- wx.createSelectorQuery()
|
|
|
|
|
- .select('#top')
|
|
|
|
|
- .boundingClientRect(rect => {
|
|
|
|
|
- this.fixedTop = rect.height - 44 + 5;
|
|
|
|
|
- console.log(this.fixedTop);
|
|
|
|
|
- })
|
|
|
|
|
- .exec();
|
|
|
|
|
- }
|
|
|
|
|
- }, 1000);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.getStore()
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ this.storeInfo = res;
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.offsetTop = this.systemInfo.statusBarHeight + 44;
|
|
|
|
|
+ if (!this.fixedTop) {
|
|
|
|
|
+ wx.createSelectorQuery()
|
|
|
|
|
+ .select('#top')
|
|
|
|
|
+ .boundingClientRect(rect => {
|
|
|
|
|
+ this.fixedTop = rect.height - 44 + 5;
|
|
|
|
|
+ console.log(this.fixedTop);
|
|
|
|
|
+ })
|
|
|
|
|
+ .exec();
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 1000);
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(e => {
|
|
|
|
|
+ this.hideLoading();
|
|
|
|
|
+ wx.showModal({
|
|
|
|
|
+ content: '无店铺信息',
|
|
|
|
|
+ showCancel: false,
|
|
|
|
|
+ confirmColor: this.$colors.prim,
|
|
|
|
|
+ success: res => {
|
|
|
|
|
+ this.navigateBack();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
getStore() {
|
|
getStore() {
|
|
|
// console.log(this.userStoreInfo);
|
|
// console.log(this.userStoreInfo);
|
|
@@ -207,15 +219,24 @@ export default {
|
|
|
return this.getStoreById(this.$mp.options.id);
|
|
return this.getStoreById(this.$mp.options.id);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- return this.$store.dispatch('getUserStore').then(res => {
|
|
|
|
|
- if (res.id.toString() === this.$mp.options.id || !this.$mp.options.id) {
|
|
|
|
|
- this.isMineShop = true;
|
|
|
|
|
- return Promise.resolve(res);
|
|
|
|
|
- } else {
|
|
|
|
|
- this.isMineShop = false;
|
|
|
|
|
- return this.getStoreById(this.$mp.options.id);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ return this.$store
|
|
|
|
|
+ .dispatch('getUserStore')
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ if (res.id.toString() === this.$mp.options.id || !this.$mp.options.id) {
|
|
|
|
|
+ this.isMineShop = true;
|
|
|
|
|
+ return Promise.resolve(res);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return Promise.reject();
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(e => {
|
|
|
|
|
+ if (!this.$mp.options.id) {
|
|
|
|
|
+ return Promise.reject();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.isMineShop = false;
|
|
|
|
|
+ return this.getStoreById(this.$mp.options.id);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
getStoreById(id) {
|
|
getStoreById(id) {
|