chore: 使用常量来处理首页的路由页面路径

This commit is contained in:
2026-01-07 15:40:13 +08:00
parent b10fcf02d4
commit 6f01b3c1c6
39 changed files with 57 additions and 56 deletions

View File

@@ -71,7 +71,7 @@
this.$store.commit('setMemberInfo', '');
this.$store.commit('setMemberInfo', '');
this.$store.dispatch('emptyCart');
this.$util.redirectTo('/pages/index/index');
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
}
}
});

View File

@@ -40,7 +40,7 @@
this.$store.commit('setToken', '');
this.$store.commit('setMemberInfo', '');
this.$store.dispatch('emptyCart');
this.$util.redirectTo('/pages/index/index');
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
}
}
}

View File

@@ -60,7 +60,7 @@
</view>
</view>
<view v-if="!list.length && showEmpty" class="margin-top cart-empty" :fixed="false">
<ns-empty :isIndex="true" :emptyBtn="{url: '/pages/index/index',text: '去逛逛'}" text="暂无优惠券"></ns-empty>
<ns-empty :isIndex="true" :emptyBtn="{url: $util.INDEX_PAGE_URL,text: '去逛逛'}" text="暂无优惠券"></ns-empty>
</view>
</block>
</mescroll-uni>
@@ -93,7 +93,7 @@ export default {
duration: 2000
});
setTimeout(() => {
this.$util.redirectTo('/pages/index/index');
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
}, 2000);
}
},1000);

View File

@@ -1,8 +1,9 @@
export default {
methods: {
// 跳转至登录页
toLogin() {
this.$refs.login.open();
toLogin(url) {
console.log('跳转至登录页', {url, currentRoute: this.$util.getCurrentRoute()});
this.$refs.login.open(url ?? this.$util.getCurrentRoute());
}
}
}

View File

@@ -51,7 +51,7 @@ export default {
this.$refs.rulePopup.close();
},
copyUrl() {
let text = this.$config.h5Domain + '/pages/index/index';
let text = this.$config.h5Domain + this.$util.INDEX_PAGE_URL;
if (this.memberInf && this.memberInfo.member_id) text += '?source_member=' + this.memberInfo.member_id;
this.$util.copy(text, () => {
this.closeSharePopup();
@@ -76,7 +76,7 @@ export default {
this.$api.sendRequest({
url: "/memberrecommend/api/memberrecommend/poster",
data: {
page: '/pages/index/index',
page: this.$util.INDEX_PAGE_URL,
qrcode_param: JSON.stringify(qrcode_param)
},
success: res => {

View File

@@ -33,7 +33,7 @@ export default {
duration: 2000
});
setTimeout(() => {
this.$util.redirectTo('/pages/index/index');
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
}, 2000);
}
},1000);