Commit 4337de9b81328693f752a2e3db660e9dda47ec7c

Authored by zhiyangdu
1 parent 38e945e5

商品详情跳转商品页面刷新

src/pages/goodDetails/goodDetails.vue
... ... @@ -123,7 +123,7 @@ export default {
123 123 goodsInfo: null,
124 124 backs: null, // 后退按钮组
125 125 pointsToast_control: false,
126   - isExchange: false, // 是否已经兑换
  126 + isExchange: false // 是否已经兑换
127 127 }
128 128 },
129 129 //部件
... ... @@ -164,12 +164,14 @@ export default {
164 164 }
165 165 },
166 166 toLinkPointsMall () {
167   - this.$router.push({
168   - path: '/pointsMall',
169   - query: {
170   - uid: this.getStore("uid")
171   - }
172   - })
  167 + // 调用back返回上一页
  168 + this.back();
  169 + // this.$router.push({
  170 + // path: '/pointsMall',
  171 + // query: {
  172 + // uid: this.getStore("uid")
  173 + // }
  174 + // })
173 175 },
174 176 /**
175 177 * 后退
... ... @@ -196,18 +198,20 @@ export default {
196 198 toDetail (item) {
197 199 if (this.isCNLive.value) {
198 200 // 跳转封装
199   - if (typeof this.$parent.gotoDetail === 'function') {
  201 + // if (typeof this.$parent.gotoDetail === 'function') {
200 202  
201   - // 设置跳转参数
202   - let params = {
203   - type: '5',
204   - to: window.location.origin + '/html/select_good/1/#/goodDetails?goodsId=' + item.id,
205   - shop_type: ''
206   - };
  203 + // // 设置跳转参数
  204 + // let params = {
  205 + // type: '5',
  206 + // to: window.location.origin + '/html/select_good/1/#/goodDetails?goodsId=' + item.id,
  207 + // shop_type: ''
  208 + // };
207 209  
208   - // 页面跳转
209   - this.$parent.gotoDetail(params);
210   - }
  210 + // // 页面跳转
  211 + // this.$parent.gotoDetail(params);
  212 + // }
  213 + // 调用接刷新当前页面数据
  214 + this.getGoodsInfo(item.id)
211 215 } else {
212 216 this.$parent.callApp();
213 217 }
... ... @@ -333,6 +337,9 @@ export default {
333 337 this.pointsToast_control = true;
334 338 // 礼品兑换弹框派发
335 339 this.$refs.itemsInfo.getItemInfo(this.goodsInfo, params.id)
  340 + } else {
  341 + // 调用back返回事件到积分商城首页
  342 + this.back();
336 343 }
337 344 },
338 345 /**
... ... @@ -355,12 +362,12 @@ export default {
355 362 /**
356 363 * 积分商品详情页页面接口
357 364 */
358   - getGoodsInfo () {
  365 + getGoodsInfo (goodsId) {
359 366 // 加载中提示
360 367 Indicator.open("加载中...");
361 368 // 获取证书请求接口
362 369 this.http("/Api/" + this.getApiVersion().LuckDraw + "/integralGoodsInfo", {
363   - id: this.$route.query.goodsId // 商品ID
  370 + id: goodsId // 商品ID
364 371 }, this.getGoodsInfoCallback, {
365 372 method: "POST"
366 373 });
... ... @@ -414,8 +421,12 @@ export default {
414 421 created () {
415 422 // 设置标题
416 423 this.$set(this, "title", "积分商品详情页");
417   - // 获取商品信息
418   - this.getGoodsInfo();
  424 + // 获取商品ID
  425 + let goodsId = this.$route.query.goodsId;
  426 + if (goodsId) {
  427 + // 获取商品信息
  428 + this.getGoodsInfo(goodsId);
  429 + }
419 430 // ios从url获取安卓localStorage
420 431 if (this.isiPhone.value) {
421 432 this.pointsToast_control = this.$route.query.pointsToast_control;
... ...