From 0677977e7ea584e39b2bcc0087012f216744f72a Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期二, 27 六月 2023 14:49:32 +0800 Subject: [PATCH] no message --- uniapp/pages/goods/goodsDetail.vue | 69 ++++++++++++++++++++++++++++------ 1 files changed, 57 insertions(+), 12 deletions(-) diff --git a/uniapp/pages/goods/goodsDetail.vue b/uniapp/pages/goods/goodsDetail.vue index 8e89504..0508d8b 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> @@ -225,7 +225,10 @@ </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"> @@ -263,6 +266,7 @@ import pddEmpower from '../../components/pddempower.vue' import inviteCodeModel from '../../components/inviteCode.vue' import inviterModel from '../../components/inviterModel.vue' + export default { components: { empowerModel, @@ -296,6 +300,7 @@ platform: '', inviteCodeShow: false, inviterShow: false, + frompage:'', }; }, onPageScroll(e) { @@ -305,6 +310,15 @@ if (this.memberId) { this.updataUser() } + + if(!getApp().globalData.hasinit) + { + getApp().getAppInfo(); + } + if(!getApp().globalData.hasbcinit) + { + getApp().bcInit(); + } }, onLoad(options) { this.appinfo = utils.getCacheSync('appInfo') @@ -312,13 +326,28 @@ 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) + { + 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'; @@ -357,6 +386,10 @@ } else if (this.pageType == 'wph') { } + else if(this.pageType=='dy') + { + //this.optionsInfo.imgs=[] + } }, methods: { closeMdl() { @@ -366,11 +399,15 @@ getPageInfo(e) { var that = this; 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() @@ -380,19 +417,16 @@ 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; @@ -416,13 +450,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; @@ -501,6 +536,7 @@ console.log(this.pageType) if (this.pageType == 'tb' || this.pageType == 'tmshop' || this.pageType == 'tm') { if (this.user.tb_account) { + this.getTbsrc() } else { this.empowerModel = true @@ -538,12 +574,10 @@ }, updataUser() { - console.log('鏇存柊') var that = this; this.$u.api.getUserInfo({}).then(e => { utils.setCache('userInfo', e.data.userinfo) that.user = e.data.userinfo; - console.log(that.user) }).catch(function(err) {}) }, @@ -554,9 +588,20 @@ 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 + }).then(e=>{ + + }); + } var res = e.data.info; var tburl = res.shortUrl // #ifdef APP-PLUS + if (plus.runtime.isApplicationExist({ pname: 'com.taobao.taobao', action: 'taobao://' -- Gitblit v1.9.3