Commit 7e154eec authored by spc's avatar spc

fixed

parent 20c78a42
......@@ -356,9 +356,12 @@ export default {
this.checkUserStatus();
// 页面返回时刷新商品详情接口
// 根据 initOptions 中的参数判断使用哪个接口刷新
// 如果 initOptions 中有 activityId 和 sessionKey,使用秒杀接口;否则使用普通接口
if (this.initOptions) {
if (this.isSeckill && this.initOptions.activityId && this.initOptions.sessionKey) {
// 秒杀商品刷新
// 检查 initOptions 中是否有秒杀参数
if (this.initOptions.activityId && this.initOptions.sessionKey) {
// 秒杀商品刷新:使用 initOptions 中的秒杀参数
const seckillParams = {
gid: this.initOptions.appGoodsId || this.initOptions.gid || this.initOptions.id || this.initOptions.goodsId || '',
activityId: this.initOptions.activityId,
......@@ -366,8 +369,10 @@ export default {
};
if (seckillParams.gid && seckillParams.activityId && seckillParams.sessionKey) {
this.fetchSeckillDetail(seckillParams);
return;
}
}
} else if (!this.isSeckill) {
// 普通商品刷新
const apiParams = {
gid: this.initOptions.gid || this.initOptions.id || this.initOptions.goodsId || ''
......@@ -376,7 +381,6 @@ export default {
this.fetchGoodsDetail(apiParams);
}
}
}
},
methods: {
// 返回上一页
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment