Commit 7e154eec authored by spc's avatar spc

fixed

parent 20c78a42
...@@ -356,9 +356,12 @@ export default { ...@@ -356,9 +356,12 @@ export default {
this.checkUserStatus(); this.checkUserStatus();
// 页面返回时刷新商品详情接口 // 页面返回时刷新商品详情接口
// 根据 initOptions 中的参数判断使用哪个接口刷新
// 如果 initOptions 中有 activityId 和 sessionKey,使用秒杀接口;否则使用普通接口
if (this.initOptions) { if (this.initOptions) {
if (this.isSeckill && this.initOptions.activityId && this.initOptions.sessionKey) { // 检查 initOptions 中是否有秒杀参数
// 秒杀商品刷新 if (this.initOptions.activityId && this.initOptions.sessionKey) {
// 秒杀商品刷新:使用 initOptions 中的秒杀参数
const seckillParams = { const seckillParams = {
gid: this.initOptions.appGoodsId || this.initOptions.gid || this.initOptions.id || this.initOptions.goodsId || '', gid: this.initOptions.appGoodsId || this.initOptions.gid || this.initOptions.id || this.initOptions.goodsId || '',
activityId: this.initOptions.activityId, activityId: this.initOptions.activityId,
...@@ -366,8 +369,10 @@ export default { ...@@ -366,8 +369,10 @@ export default {
}; };
if (seckillParams.gid && seckillParams.activityId && seckillParams.sessionKey) { if (seckillParams.gid && seckillParams.activityId && seckillParams.sessionKey) {
this.fetchSeckillDetail(seckillParams); this.fetchSeckillDetail(seckillParams);
return;
}
} }
} else if (!this.isSeckill) {
// 普通商品刷新 // 普通商品刷新
const apiParams = { const apiParams = {
gid: this.initOptions.gid || this.initOptions.id || this.initOptions.goodsId || '' gid: this.initOptions.gid || this.initOptions.id || this.initOptions.goodsId || ''
...@@ -376,7 +381,6 @@ export default { ...@@ -376,7 +381,6 @@ export default {
this.fetchGoodsDetail(apiParams); this.fetchGoodsDetail(apiParams);
} }
} }
}
}, },
methods: { 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