zhaojs
2023-07-18 0e1bce71603c5cbb92b3fe6387c87430528d18a9
uniapp/pages/goods/goodsDetail.vue
@@ -329,7 +329,8 @@
        inviteCodeShow: false,
        inviterShow: false,
      frompage:'',
      isshowpdd:false
      isshowpdd:false,
      beforePddAuth:false,
      };
    },
    onPageScroll(e) {
@@ -406,6 +407,12 @@
        } else {
          this.memberId = ''
        }
      console.log(this.user);
      if(this.user.pdd_authority_ios==1||this.user.pdd_authority_android==1)
      {
         this.beforePddAuth=true;
      }
      console.log(this.beforePddAuth);
      } catch (e) {
        this.memberId = ''
      }
@@ -419,10 +426,10 @@
        this.pageInfo.showImgs.push(a)
        this.getrecommend()
      } else if (this.pageType == 'pdd') {
        if(this.optionsInfo.predictPromotionRate==0)
        /* if(this.optionsInfo.predictPromotionRate==0)
        {//比价订单
           this.remindModel=true;
        }
        } */
      } else if (this.pageType == 'jd') {
@@ -445,6 +452,7 @@
     },
      getPageInfo(e) {
        var that = this;
      console.log(this.faction)
        if (this.faction == 'j') {
          this.$u.api.getJdsDetail({
            goodsId: this.optionsInfo.goodsId,
@@ -472,14 +480,7 @@
            this.optionsInfo = res
          }).catch(function(err) {})
        } else if (this.faction == 'p') {
          var that = this;
          this.$u.api.getPddDetail({
            goods_sign: this.optionsInfo.goods_sign
          }).then(e => {
            var res = e.data;
            that.pageInfo = res;
         that.optionsInfo.imgs = that.pageInfo.imgs;
          })
         this.getPddGoodsDetail(this.optionsInfo.goods_sign);
        } else if (this.faction == 'w') {
          var that = this;
          this.$u.api.getWphGoodsDetail({
@@ -508,17 +509,28 @@
         })
        }
      },
     getPddGoodsDetail(goods_sign)
     {
        var that = this;
        this.$u.api.getPddDetail({
          goods_sign: goods_sign
        }).then(e => {
          var res = e.data;
          that.pageInfo = res;
         console.log(res);
           that.optionsInfo.imgs = that.pageInfo.imgs;
         if(res.predictPromotionRate==0)
         {//比价订单
            this.remindModel=true;
         }
        })
     },
      goDetails(info) {
        info.searchSource = 1
        uni.navigateTo({
          url: './goodsDetail?info=' + encodeURIComponent(JSON.stringify(info))
        })
      },
      getrecommend() {
        var that = this;
        this.$u.api.getSimilerGoods({
@@ -618,8 +630,14 @@
      updataUser() {
        var that = this;
        this.$u.api.getUserInfo({}).then(e => {
        console.log(e)
          utils.setCache('userInfo', e.data.userinfo)
          that.user = e.data.userinfo;
        if(that.pageType == 'pdd'&&!that.beforePddAuth&&(e.data.userinfo.pdd_authority_ios == 1||e.data.userinfo.pdd_authority_android == 1))
        {//重新查询商品详情
         console.log('重新查询pdd商品');
           that.getPddGoodsDetail(that.optionsInfo.goods_sign);0
        }
        }).catch(function(err) {})
      },