From fc9bd6378d3bfbde6d5c71535757a3d44de8d8ff Mon Sep 17 00:00:00 2001
From: zhaojs <349234519@qq.com>
Date: 星期四, 20 七月 2023 15:18:06 +0800
Subject: [PATCH] Merge branch 'feature/1.1.4开发' into develop

---
 uniapp/pages/goods/goodsDetail.vue |  251 +++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 199 insertions(+), 52 deletions(-)

diff --git a/uniapp/pages/goods/goodsDetail.vue b/uniapp/pages/goods/goodsDetail.vue
index 65d6aa6..48d87d0 100644
--- a/uniapp/pages/goods/goodsDetail.vue
+++ b/uniapp/pages/goods/goodsDetail.vue
@@ -28,8 +28,8 @@
         <view class="pagetopBar-container colCen">
           <view class="topbarbox"></view>
         </view>
-        <view class="currentbox rowCenCen" v-if="optionsInfo.imageList || pageInfo.showImgs">
-          <view>{{currentIndex+1}}/{{pageType=='jd'?optionsInfo.imgs.length:pageInfo.showImgs.length}}</view>
+        <view class="currentbox rowCenCen" v-if="pageInfo.imgs&&pageInfo.imgs.length>0">
+          <view>{{currentIndex+1}}/{{pageInfo.imgs.length}}</view>
         </view>
       </view>
     </view>
@@ -75,25 +75,26 @@
         </view>
       </view>
       <view class="vip-info-container rowCenBet" v-if="!showtar || platform!='iOS'">
-        <view class="left-info" v-if="user.level != 3">
-          鐜板湪鍗囩骇鎴愪负{{pageInfo.topLevelName}},绔嬪嵆璧歿{pageInfo.topFanli}}鍏�
-        </view>
-        <view class="left-info" v-else>
-          鎮ㄥ凡缁忔槸鏈�楂樼瓑绾�,蹇幓閭�璇峰ソ鍙嬭禋浣i噾鍚�!
-        </view>
+	
+			<view class="left-info" v-if="user.level != 3">
+			  鐜板湪鍗囩骇鎴愪负{{pageInfo.topLevelName}},绔嬪嵆璧歿{pageInfo.topFanli}}鍏�
+			</view>
+			<view class="left-info" v-else>
+			  鎮ㄥ凡缁忔槸鏈�楂樼瓑绾�,蹇幓閭�璇峰ソ鍙嬭禋浣i噾鍚�!
+			</view>
 
-        <view class="rt-btn rowCenCen" @tap="golevelRules()" v-if="user.level != 3">
-          <image class="vipimg" src="../../static/images/goods/vip.png" mode="aspectFill"></image>
-          <view class="level-txt">
-            绔嬪嵆鍗囩骇
-          </view>
-        </view>
-        <view class="rt-btn rowCenCen" @tap="golevelRules()" v-else>
-          <image class="vipimg" src="../../static/images/goods/vip.png" mode="aspectFill"></image>
-          <view class="level-txt">
-            绔嬪嵆鏌ョ湅
-          </view>
-        </view>
+			<view class="rt-btn rowCenCen" @tap="golevelRules()" v-if="user.level != 3">
+			  <image class="vipimg" src="../../static/images/goods/vip.png" mode="aspectFill"></image>
+			  <view class="level-txt">
+				绔嬪嵆鍗囩骇
+			  </view>
+			</view>
+			<view class="rt-btn rowCenCen" @tap="golevelRules()" v-else>
+			  <image class="vipimg" src="../../static/images/goods/vip.png" mode="aspectFill"></image>
+			  <view class="level-txt">
+				绔嬪嵆鏌ョ湅
+			  </view>
+		 </view>
       </view>
       <view class="quanWrap" v-if="optionsInfo.couponPrice>0 || pageInfo.couponPrice>0">
         <image src="../../static/images/goods/qbg.png" mode='aspectFit' class="quanBg"></image>
@@ -186,10 +187,7 @@
           <image class="detailpic" :src="items" mode="widthFix"></image>
         </block>
       </view>
-        
     </view>
-
-
     <view class="bottombox">
     </view>
     <view class="footerWrap rowSta">
@@ -214,8 +212,10 @@
             </view>
           </view>
         </view>
+		
+	
 
-        <view class="right-container rowCen borderBox">
+       <!-- <view class="right-container rowCen borderBox" v-if="!showtar || platform!='iOS'">
           <view class="leftsharebox btnbox colCenCen" @tap="goPath()">
             <view class="priceText">
               锟{optionsInfo.fanli}}
@@ -225,14 +225,39 @@
             </view>
           </view>
           <view class="rightbackbox btnbox colCenCen" @tap="getCouponUrl()">
-            <view class="priceText">
+			  <view v-if="frompage=='freebuy'" class="priceText">
+				  锟{optionsInfo.actualPrice}}
+			  </view>
+            <view v-else class="priceText">
               锟{optionsInfo.fanli}}
             </view>
             <view class="texttips">
               璐拱杩�
             </view>
           </view>
-        </view>
+        </view> -->
+		
+		<view class="right-container rowCen borderBox">
+		  <view class="leftsharebox btnbox colCenCen" style="background: #ffb030;" @tap="goPath()">
+		    <view class="priceText">
+		      锟{optionsInfo.fanli}}
+		    </view>
+		    <view class="texttips">
+		      鍒嗕韩璧�
+		    </view>
+		  </view>
+		  <view class="rightbackbox btnbox colCenCen" style="background: #fe0350;" @tap="getCouponUrl()">
+			  <view v-if="frompage=='freebuy'" class="priceText">
+				  锟{optionsInfo.actualPrice}}
+			  </view>
+		    <view v-else class="priceText">
+		      锟{optionsInfo.fanli}}
+		    </view>
+		    <view class="texttips">
+		      璐拱杩�
+		    </view>
+		  </view>
+		</view>
       </view>
     </view>
     <!-- taobao -->
@@ -253,6 +278,12 @@
     <u-popup v-model="inviterShow" mode="center" border-radius="32" v-if="inviterShow" :mask-close-able='true'>
       <inviter-model ref='invitermodel' @rewrite='rewriteCode' @setInvite='setCodebtn'></inviter-model>
     </u-popup>
+	<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>
+	</uni-popup>
   </view>
 </template>
 
@@ -263,6 +294,7 @@
   import pddEmpower from '../../components/pddempower.vue'
   import inviteCodeModel from '../../components/inviteCode.vue'
   import inviterModel from '../../components/inviterModel.vue'
+   
   export default {
     components: {
       empowerModel,
@@ -295,7 +327,10 @@
         showtar: false,
         platform: '',
         inviteCodeShow: false,
-        inviterShow: false
+        inviterShow: false,
+		frompage:'',
+		isshowpdd:false,
+		beforePddAuth:false,
       };
     },
     onPageScroll(e) {
@@ -305,25 +340,59 @@
       if (this.memberId) {
         this.updataUser()
       }
+	  
+	  if(!getApp().globalData.hasinit)
+	  {
+	  	getApp().getAppInfo();
+	  }
+	  if(!getApp().globalData.hasbcinit)
+	  {
+		  getApp().bcInit();
+	  }
     },
+	 onReady(){
+		 if(this.isshowpdd)
+		 {
+			this.$refs.popup_pddtip.open();
+		 }
+	},
     onLoad(options) {
       this.appinfo = utils.getCacheSync('appInfo')
       // #ifdef APP-PLUS
       this.showtar = getApp().globalData.ifwt == 1 ? false : true;
       this.platform = plus.os.name
       // #endif
+	  if(options.frompage)
+	  {
+		  this.frompage=options.frompage;
+	  }
       if (options.id) {
         this.optionsInfo.goodsId = options.id
         this.pageType = this.optionsInfo.sourceType ? this.optionsInfo.sourceType : 'tb';
         this.faction = this.optionsInfo.faction ? this.optionsInfo.faction : 't';
       } else {
-        this.optionsInfo = JSON.parse(options.info);
-        this.pageInfo = JSON.parse(options.info);
+		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)
+		}
+		else
+		{
+			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';
           if (this.pageType == 'jd') this.faction = 'j';
-          if (this.pageType == 'pdd') this.faction = 'p';
+          if (this.pageType == 'pdd') 
+		  {
+			  this.faction = 'p';
+			 
+		  }
           if (this.pageType == 'wph') this.faction = 'w';
 		   if (this.pageType == 'dy') this.faction = 'd';
         } else {
@@ -338,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 = ''
       }
@@ -351,26 +426,39 @@
         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') {
 
       } else if (this.pageType == 'wph') {
 
       }
+	  else if(this.pageType=='dy')
+	  {
+		  //this.optionsInfo.imgs=[]
+	  }
     },
     methods: {
       closeMdl() {
         this.empowerModel = false
         this.pddempowerModel = false
       },
+	  closeremind()
+	  {
+		  this.remindModel=false;
+	  },
       getPageInfo(e) {
         var that = this;
+		console.log(this.faction)
         if (this.faction == 'j') {
           this.$u.api.getJdsDetail({
             goodsId: this.optionsInfo.goodsId,
             goods: JSON.stringify(this.optionsInfo)
           }).then(e => {
-            console.log(e);
+			  console.log(e)
             var res = e.data.detailPics;
             this.JdDetails = that.JdDetails.concat(res)
             that.$forceUpdate()
@@ -380,29 +468,19 @@
           this.$u.api.getGoodsDetail({
             goodsId: this.optionsInfo.goodsId
           }).then(e => {
-            console.log(e)
             if (e.code != 0) return that.$alert(e.msg)
             var res = e.data.info;
             this.pageInfo = res
             this.pageInfo.showImgs = []
-            console.log(this.pageInfo)
             this.pageInfo.imgs.map(items => {
               var a = {}
               a.url = items
               this.pageInfo.showImgs.push(a)
             })
             this.optionsInfo = res
-            console.log(this.pageInfo);
           }).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({
@@ -416,13 +494,14 @@
               a.url = items
               this.pageInfo.showImgs.push(a)
             })
-            console.log(this.pageInfo);
           })
         }else if(this.faction == 'd'){
+			console.log(this.optionsInfo.goodsId);
 			var that = this;
 			this.$u.api.getDyGoodsDetail({
 			  goodsId: this.optionsInfo.goodsId
 			}).then(e => {
+				console.log(e);
 			  var res = e.data.info;
 			  this.pageInfo = res
 			  that.optionsInfo.imgs = that.pageInfo.imgs;
@@ -430,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({
@@ -538,12 +628,16 @@
       },
       
       updataUser() {
-        console.log('鏇存柊')
         var that = this;
         this.$u.api.getUserInfo({}).then(e => {
+		  console.log(e)
           utils.setCache('userInfo', e.data.userinfo)
           that.user = e.data.userinfo;
-          console.log(that.user)
+		  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) {})
       },
 
@@ -554,9 +648,21 @@
           type: 0
         }).then(e => {
           if (e.code != 0) return that.$alert(e.msg)
+		  if(that.frompage=='freebuy')
+		  {//0鍏冭喘鐨勮褰曞晢鍝乮d
+		    console.log(e.data.info.itemId);
+		  	this.$u.api.updateFirstFreeBrowse({
+		  		goodsid:that.optionsInfo.goodsId,
+		  		new_goodsId:e.data.info.itemId,
+				plateform:'tb'
+		  	}).then(e=>{
+		  		
+		  	});
+		  }
           var res = e.data.info;
           var tburl = res.shortUrl
           // #ifdef APP-PLUS
+		 
           if (plus.runtime.isApplicationExist({
               pname: 'com.taobao.taobao',
               action: 'taobao://'
@@ -610,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
@@ -670,6 +789,16 @@
 	    }).then(e => {
 	      var res = e.data.info;
 		  console.log(res)
+		  if(that.frompage=='freebuy')
+		  {//0鍏冭喘鐨勮褰曞晢鍝乮d
+		  	this.$u.api.updateFirstFreeBrowse({
+		  		goodsid:that.optionsInfo.goodsId,
+		  		new_goodsId:that.optionsInfo.goodsId,
+				plateform:'dy'
+		  	}).then(e=>{
+		  		
+		  	});
+		  }
 	      // #ifdef APP-PLUS
 	      plus.runtime.openURL(res.dy_deeplink, e => {
 	        uni.navigateTo({
@@ -783,6 +912,24 @@
   }
 </style>
 <style lang="scss" scoped>
+	.pdd_pop_contant{
+		background-color: rgb(255, 255, 255);
+		    padding: 40rpx;
+		    width: 80%;
+			margin:0 auto;
+		    border-radius: 20rpx;
+		.pdd_pop_title
+		{
+			text-align: center;
+			margin-bottom: 30rpx;
+			font-size: 18px;
+		}
+		.pdd_pop_text
+		{
+			margin-bottom: 30rpx;
+			color: #868080;
+		}
+	}
   .container {
     .flexbox {
       position: fixed;
@@ -954,7 +1101,7 @@
         border-radius: 5rpx;
         padding: 0 20rpx;
         margin-bottom: 20rpx;
-
+		
         .left-info {
           font-size: 24rpx;
           font-weight: 500;

--
Gitblit v1.9.3