|
|
@@ -94,29 +94,51 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- jump(item) {
|
|
|
+ async jump(item) {
|
|
|
// 需要先报名
|
|
|
if (item.name === '团餐活动') {
|
|
|
- this.$http.post('/groupmeal/gmMerchantApplicationRecord/isApply', {}).then(res => {
|
|
|
- if (!res.data.result) {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/groupMeal/goods/index'
|
|
|
- });
|
|
|
- } else {
|
|
|
- let status = res.data.result.status;
|
|
|
- if (status == 1) {
|
|
|
+ try {
|
|
|
+ // 获取门店状态
|
|
|
+ const res1 = await this.$http.get('/groupmeal/gmMerchant/queryByMerchantId?merchantId=' + uni
|
|
|
+ .getStorageSync('login_user_info').merchantId);
|
|
|
+ const isOpen = res1.data.result;
|
|
|
+ // 门店是否关闭
|
|
|
+ if (isOpen) {
|
|
|
+ // 检查报名状态
|
|
|
+ const res2 = await this.$http.post('/groupmeal/gmMerchantApplicationRecord/isApply', {});
|
|
|
+ if (!res2.data.result) {
|
|
|
uni.navigateTo({
|
|
|
- url: item.path
|
|
|
+ url: '/pages/groupMeal/goods/index'
|
|
|
});
|
|
|
} else {
|
|
|
- this.modalText.content = status == 2 ? '很抱歉,您没有通过平台审核,如有疑问请联系平台客服。' :
|
|
|
- '团餐活动报名审核中,请耐心等待';
|
|
|
- this.$refs.myModal.onOpen();
|
|
|
+ let status = res2.data.result.status;
|
|
|
+ if (status == 1) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: item.path
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.modalText.content = status == 2 ?
|
|
|
+ '很抱歉,您没有通过平台审核,如有疑问请联系平台客服。' :
|
|
|
+ '团餐活动报名审核中,请耐心等待';
|
|
|
+ this.$refs.myModal.onOpen();
|
|
|
+ }
|
|
|
}
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '团餐活动已关闭'
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
+ } catch (error) {
|
|
|
+ console.error('跳转出错:', error);
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '网络错误,请重试'
|
|
|
+ });
|
|
|
+ }
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
if (!item.path) return;
|
|
|
uni.navigateTo({
|
|
|
url: item.path
|