From 0e1bce71603c5cbb92b3fe6387c87430528d18a9 Mon Sep 17 00:00:00 2001
From: zhaojs <349234519@qq.com>
Date: 星期二, 18 七月 2023 16:14:45 +0800
Subject: [PATCH] no message

---
 uniapp/pages/goods/goodsDetail.vue |   84 +++++++++++++++++++++++++++++-------------
 1 files changed, 58 insertions(+), 26 deletions(-)

diff --git a/uniapp/pages/goods/goodsDetail.vue b/uniapp/pages/goods/goodsDetail.vue
index 4d4953b..48d87d0 100644
--- a/uniapp/pages/goods/goodsDetail.vue
+++ b/uniapp/pages/goods/goodsDetail.vue
@@ -281,7 +281,7 @@
 	<uni-popup ref="popup_pddtip" type="center">
 		<view class="pdd_pop_contant">
 			<view class="pdd_pop_title">姣斾环璁㈠崟</view>
-			<view class="pdd_pop_text">鏈鑷喘娑夊強姣斾环琛屼负锛岃嚜璐敹鐩婁负0锛屽缓璁厛鏀惰棌璇ュ晢鍝侊紝2灏忔椂鍊欓�氳繃澶ц繑瀹榓pp璐拱锛屽彲姝e父鑾峰彇瀵瑰簲鏀剁泭銆�</view>
+			<view class="pdd_pop_text">鏈鑷喘娑夊強姣斾环琛屼负锛岃嚜璐敹鐩婁负0锛屽缓璁厛鏀惰棌璇ュ晢鍝侊紝2灏忔椂鍚庨�氳繃澶ц繑瀹榓pp璐拱锛屽彲姝e父鑾峰彇瀵瑰簲鏀剁泭銆�</view>
 		</view>
 	</uni-popup>
   </view>
@@ -329,7 +329,8 @@
         inviteCodeShow: false,
         inviterShow: false,
 		frompage:'',
-		isshowpdd:false
+		isshowpdd:false,
+		beforePddAuth:false,
       };
     },
     onPageScroll(e) {
@@ -373,6 +374,7 @@
 		console.log(options);
 		if(options.sourcefrom)
 		{
+			console.log(decodeURIComponent(options.info));
 			this.optionsInfo = JSON.parse(decodeURIComponent(options.info));
 			this.pageInfo = JSON.parse(decodeURIComponent(options.info));
 			console.log(this.optionsInfo)
@@ -382,7 +384,6 @@
 			this.optionsInfo = JSON.parse(options.info);
 			this.pageInfo = JSON.parse(options.info);
 		}
-        
         this.pageType = this.optionsInfo.sourceType;
         if (!this.optionsInfo.faction) {
           if (this.pageType == 'tb' || this.pageType == 'tm' || this.pageType == 'tmshop') this.faction = 't';
@@ -390,10 +391,7 @@
           if (this.pageType == 'pdd') 
 		  {
 			  this.faction = 'p';
-			  if(options.proform&&options.proform=="clipboard")
-			  {//鏉ヨ嚜鍓创鏉�
-				  this.isshowpdd=true;
-			  }
+			 
 		  }
           if (this.pageType == 'wph') this.faction = 'w';
 		   if (this.pageType == 'dy') this.faction = 'd';
@@ -409,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 = ''
       }
@@ -422,6 +426,10 @@
         this.pageInfo.showImgs.push(a)
         this.getrecommend()
       } else if (this.pageType == 'pdd') {
+		  /* if(this.optionsInfo.predictPromotionRate==0)
+		  {//姣斾环璁㈠崟
+			  this.remindModel=true;
+		  } */
 
       } else if (this.pageType == 'jd') {
 
@@ -438,18 +446,19 @@
         this.empowerModel = false
         this.pddempowerModel = false
       },
+	  closeremind()
+	  {
+		  this.remindModel=false;
+	  },
       getPageInfo(e) {
         var that = this;
+		console.log(this.faction)
         if (this.faction == 'j') {
-			var loinf={
-            goodsId: this.optionsInfo.goodsId,
-            goods: JSON.stringify(this.optionsInfo)
-          }
-			console.log(loinf)
           this.$u.api.getJdsDetail({
             goodsId: this.optionsInfo.goodsId,
             goods: JSON.stringify(this.optionsInfo)
           }).then(e => {
+			  console.log(e)
             var res = e.data.detailPics;
             this.JdDetails = that.JdDetails.concat(res)
             that.$forceUpdate()
@@ -471,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({
@@ -507,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({
@@ -617,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) {})
       },
 
@@ -697,7 +716,20 @@
       },
 
       getJDsrc() {
-        var that = this;
+		  var that = this;
+		  console.log(this.frompage);
+		  console.log(that.optionsInfo.goodsId);
+		  if(this.frompage=='freebuy')
+		  {//0鍏冭喘鐨勮褰曞晢鍝乮d
+		  	this.$u.api.updateFirstFreeBrowse({
+		  		goodsid:that.optionsInfo.goodsId,
+		  		new_goodsId:that.optionsInfo.goodsId,
+		  	    plateform:'jd'
+		  	}).then(e=>{
+		  		
+		  	});
+		  }
+        
         this.$u.api.getPrivilegeLink({
           goodsId: this.optionsInfo.goodsId,
           type: 1

--
Gitblit v1.9.3