|
10 | 10 | <u-swiper v-else :list="goodsDetail.pics" keyName="pic" indicator circular height="750rpx"> |
11 | 11 | </u-swiper> |
12 | 12 | <view class="price-share"> |
13 | | - <view class="price-score"> |
| 13 | + <view v-if="curKanjiaprogress" class="price-score price-score2"> |
| 14 | + <view class="item"> |
| 15 | + <text>¥</text>{{ curKanjiaprogress.kanjiaInfo.curPrice }} |
| 16 | + </view> |
| 17 | + <view class="item original"> |
| 18 | + <text>¥</text>{{ curGoodsKanjia.originalPrice }} |
| 19 | + </view> |
| 20 | + </view> |
| 21 | + <view v-else class="price-score price-score2"> |
14 | 22 | <view v-if="goodsDetail.basicInfo.minPrice" class="item"> |
15 | 23 | <text>¥</text>{{goodsDetail.basicInfo.minPrice}} |
16 | 24 | </view> |
|
51 | 59 | {{goodsDetail.basicInfo.commission}}元 现金奖励 |
52 | 60 | </view> |
53 | 61 | </view> |
54 | | - <u-cell-group v-if="curGoodsKanjia" title="砍价设置"> |
55 | | - <u-cell title="数量" :value="curGoodsKanjia.number + '份'"></u-cell> |
56 | | - <u-cell title="已售" :value="curGoodsKanjia.numberBuy + '份'"></u-cell> |
57 | | - <u-cell title="原价" :value="curGoodsKanjia.originalPrice"></u-cell> |
58 | | - <u-cell title="底价" :value="curGoodsKanjia.minPrice"></u-cell> |
59 | | - <u-cell title="截止" :value="curGoodsKanjia.dateEnd"></u-cell> |
60 | | - </u-cell-group> |
| 62 | + |
| 63 | + <block v-if="curGoodsKanjia"> |
| 64 | + <u-gap height="20rpx" bgColor="#eee"></u-gap> |
| 65 | + <view class="label-title"> |
| 66 | + <view class="icon"></view>商品砍价设置 |
| 67 | + </view> |
| 68 | + <u-cell-group> |
| 69 | + <u-cell title="数量" :value="curGoodsKanjia.number + '份'"></u-cell> |
| 70 | + <u-cell title="已售" :value="curGoodsKanjia.numberBuy + '份'"></u-cell> |
| 71 | + <u-cell title="原价" :value="curGoodsKanjia.originalPrice"></u-cell> |
| 72 | + <u-cell title="底价" :value="curGoodsKanjia.minPrice"></u-cell> |
| 73 | + <u-cell title="截止" :value="curGoodsKanjia.dateEnd"></u-cell> |
| 74 | + </u-cell-group> |
| 75 | + </block> |
| 76 | + <block v-if="curKanjiaprogress"> |
| 77 | + <u-gap height="20rpx" bgColor="#eee"></u-gap> |
| 78 | + <view class="label-title"> |
| 79 | + <view class="icon"></view>当前砍价状态 |
| 80 | + </view> |
| 81 | + <u-cell-group> |
| 82 | + <u-cell title="帮砍人数" :value="curKanjiaprogress.kanjiaInfo.helpNumber"></u-cell> |
| 83 | + <u-cell title="状态" :value="curKanjiaprogress.kanjiaInfo.statusStr"></u-cell> |
| 84 | + <u-cell title="参与时间" :value="curKanjiaprogress.kanjiaInfo.dateAdd"></u-cell> |
| 85 | + </u-cell-group> |
| 86 | + </block> |
61 | 87 | <view v-if="curKanjiaprogress && curKanjiaprogress.kanjiaInfo.uid != uid" class="curKanjiaJoin"> |
62 | 88 | 帮<text>{{curKanjiaprogress.joiner.nick}}</text> 砍价吧! |
63 | 89 | </view> |
64 | 90 | <view v-if="curGoodsKanjia && curKanjiaprogress" class="curKanjiaprogress"> |
65 | | - <u-line-progress :percentage="100 * (curGoodsKanjia.originalPrice - curKanjiaprogress.kanjiaInfo.curPrice) / (curGoodsKanjia.originalPrice - curGoodsKanjia.minPrice)" activeColor="#ff0000"></u-line-progress> |
| 91 | + <u-line-progress |
| 92 | + :percentage="100 * (curGoodsKanjia.originalPrice - curKanjiaprogress.kanjiaInfo.curPrice) / (curGoodsKanjia.originalPrice - curGoodsKanjia.minPrice)" |
| 93 | + activeColor="#ff0000"></u-line-progress> |
| 94 | + <view class="curKanjiaprogress-bar">// 砍价完成进度 //</view> |
| 95 | + </view> |
| 96 | + |
| 97 | + <block v-if="curKanjiaprogress && curKanjiaprogress.helps && curKanjiaprogress.helps.length>0"> |
| 98 | + <u-gap height="20rpx" bgColor="#eee"></u-gap> |
| 99 | + <view class="label-title"> |
| 100 | + <view class="icon"></view>好友助力明细 |
| 101 | + </view> |
| 102 | + <view class="kjlj" v-for="(item,index) in curKanjiaprogress.helps" :key="index"> |
| 103 | + <image class="kjlj-l" :src="item.avatarUrl" mode="aspectFill" /> |
| 104 | + <u-cell class="kjlj-r" :label="item.nick + ' ' + item.dateAdd + '帮砍'" size="large"> |
| 105 | + <view slot="title" class="price-score"> |
| 106 | + <view class="item"><text>¥</text>{{ item.cutPrice }}</view> |
| 107 | + </view> |
| 108 | + </u-cell> |
| 109 | + </view> |
| 110 | + </block> |
| 111 | + |
| 112 | + <u-gap height="20rpx" bgColor="#eee"></u-gap> |
| 113 | + <view class="label-title"> |
| 114 | + <view class="icon"></view>详细介绍 |
66 | 115 | </view> |
67 | 116 | <view id="content"> |
68 | | - <u-divider text="详细介绍"></u-divider> |
69 | 117 | <view class="content"> |
70 | 118 | <view v-if="wxintroduction"> |
71 | 119 | <u-image v-for="(item,index) in wxintroduction" :src="item" mode="widthFix" width="750rpx" |
|
109 | 157 | </view> |
110 | 158 | </view> |
111 | 159 | </scroll-view> |
112 | | - <view v-if="curGoodsKanjia && (!curKanjiaprogress || curKanjiaprogress.kanjiaInfo.uid != uid)" |
113 | | - class="bottom-btns"> |
114 | | - <view class="btn"> |
115 | | - <u-button text="我要砍价" shape="circle" color="linear-gradient(90deg, #ff6034, #ee0a24, #ff6034)" |
116 | | - @click="joinKanjia"></u-button> |
| 160 | + <view v-if="curGoodsKanjia"> |
| 161 | + <view v-if="curKanjiaprogress && curKanjiaprogress.kanjiaInfo.uid == uid" class="bottom-btns"> |
| 162 | + <!-- #ifdef MP-WEIXIN || MP-BAIDU --> |
| 163 | + <view class="icon-btn"> |
| 164 | + <u-icon name="chat" size="48rpx"></u-icon> |
| 165 | + <text>客服</text> |
| 166 | + <button open-type='contact' :send-message-title="goodsDetail.basicInfo.name" |
| 167 | + :send-message-img="goodsDetail.basicInfo.pic" |
| 168 | + :send-message-path="'/pages/goods/detail?id='+goodsDetail.basicInfo.id" |
| 169 | + show-message-card></button> |
| 170 | + </view> |
| 171 | + <!-- #endif --> |
| 172 | + <view class="icon-btn" @click="addFav"> |
| 173 | + <u-icon :name="faved ? 'heart-fill' : 'heart'" size="48rpx"></u-icon> |
| 174 | + <text>收藏</text> |
| 175 | + </view> |
| 176 | + <view class="btn"> |
| 177 | + <u-button class="half-l" text="邀请好友助力" shape="circle" |
| 178 | + color="linear-gradient(90deg,#ffd01e, #ff8917)" open-type='share'> |
| 179 | + </u-button> |
| 180 | + </view> |
| 181 | + <view class="btn"> |
| 182 | + <u-button class="half-r" text="用现价购买" shape="circle" |
| 183 | + color="linear-gradient(90deg, #ff6034, #ee0a24)" @click="kanjiabuy"> |
| 184 | + </u-button> |
| 185 | + </view> |
| 186 | + </view> |
| 187 | + <view v-else-if="curKanjiaprogress && curKanjiaprogress.kanjiaInfo.uid != uid" class="bottom-btns"> |
| 188 | + <view class="icon-btn"> |
| 189 | + <u-icon name="share" size="48rpx"></u-icon> |
| 190 | + <text>邀请</text> |
| 191 | + <button open-type='share'></button> |
| 192 | + </view> |
| 193 | + <view class="btn"> |
| 194 | + <u-button class="half-l" :text="myHelpDetail ? '您已助力' : '帮忙砍一刀'" shape="circle" |
| 195 | + :disabled="myHelpDetail ? true : false" color="linear-gradient(90deg,#ffd01e, #ff8917)" |
| 196 | + @click="helpKanjia"> |
| 197 | + </u-button> |
| 198 | + </view> |
| 199 | + <view class="btn"> |
| 200 | + <u-button class="half-r" text="我也要参与" shape="circle" |
| 201 | + color="linear-gradient(90deg, #ff6034, #ee0a24)" @click="joinKanjia"> |
| 202 | + </u-button> |
| 203 | + </view> |
| 204 | + </view> |
| 205 | + <view v-else class="bottom-btns"> |
| 206 | + <!-- #ifdef MP-WEIXIN || MP-BAIDU --> |
| 207 | + <view class="icon-btn"> |
| 208 | + <u-icon name="chat" size="48rpx"></u-icon> |
| 209 | + <text>客服</text> |
| 210 | + <button open-type='contact' :send-message-title="goodsDetail.basicInfo.name" |
| 211 | + :send-message-img="goodsDetail.basicInfo.pic" |
| 212 | + :send-message-path="'/pages/goods/detail?id='+goodsDetail.basicInfo.id" |
| 213 | + show-message-card></button> |
| 214 | + </view> |
| 215 | + <!-- #endif --> |
| 216 | + <view class="icon-btn" @click="addFav"> |
| 217 | + <u-icon :name="faved ? 'heart-fill' : 'heart'" size="48rpx"></u-icon> |
| 218 | + <text>收藏</text> |
| 219 | + </view> |
| 220 | + <view class="btn"> |
| 221 | + <u-button class="half-l" text="发起砍价" shape="circle" |
| 222 | + color="linear-gradient(90deg,#ffd01e, #ff8917)" @click="joinKanjia"> |
| 223 | + </u-button> |
| 224 | + </view> |
| 225 | + <view class="btn"> |
| 226 | + <u-button class="half-r" text="原价购买" shape="circle" |
| 227 | + color="linear-gradient(90deg, #ff6034, #ee0a24)" @click="_showGoodsPop"> |
| 228 | + </u-button> |
| 229 | + </view> |
117 | 230 | </view> |
118 | 231 | </view> |
119 | 232 | <view v-else class="bottom-btns"> |
|
154 | 267 | </view> |
155 | 268 | </view> |
156 | 269 | </view> |
157 | | - <goods-pop :show="showGoodsPop" :goodsDetail="goodsDetail" @close="showGoodsPop = false"></goods-pop> |
| 270 | + <goods-pop :show="showGoodsPop" :goodsDetail="goodsDetail" :kjid="kjid" @close="showGoodsPop = false"></goods-pop> |
158 | 271 | <!-- <u-modal :show="showhaibao" :title="title" > |
159 | 272 | <view class="slot-content"> |
160 | 273 | <hch-poster v-if="showhaibao" ref="hchPoster" @cancel="handleCancel" :posterData.sync="posterData" @previewImage='previewImage' /> |
|
205 | 318 | curGoodsKanjia: undefined, |
206 | 319 | curKanjiaprogress: undefined, |
207 | 320 | myHelpDetail: undefined, |
| 321 | + kjid: undefined |
208 | 322 | } |
209 | 323 | }, |
210 | 324 | onLoad(e) { |
|
425 | 539 | // 弹出商品购买弹窗 |
426 | 540 | async _showGoodsPop() { |
427 | 541 | this.showGoodsPop = true |
| 542 | + this.kjid = null |
| 543 | + }, |
| 544 | + kanjiabuy() { |
| 545 | + // 砍价用现在的价格购买 |
| 546 | + this.goodsDetail.basicInfo.minPrice = this.curKanjiaprogress.kanjiaInfo.curPrice |
| 547 | + this.kjid = this.curGoodsKanjia.id |
| 548 | + this.showGoodsPop = true |
428 | 549 | }, |
429 | 550 | scrolltolower() { |
430 | 551 | this.page += 1 |
|
581 | 702 | const res = await this.$wxapi.kanjiaDetail(this.curGoodsKanjia.id, kjJoinUid) |
582 | 703 | if (res.code == 0) { |
583 | 704 | this.curKanjiaprogress = res.data |
| 705 | + this.kanjiaHelpDetail() |
584 | 706 | } |
585 | 707 | }, |
586 | 708 | async joinKanjia() { |
|
593 | 715 | }) |
594 | 716 | const res = await this.$wxapi.kanjiaJoin(this.token, this.curGoodsKanjia.id) |
595 | 717 | uni.hideLoading() |
| 718 | + if (res.code == 2000) { |
| 719 | + getApp().autoLogin(true) |
| 720 | + return |
| 721 | + } |
596 | 722 | if (res.code == 0) { |
597 | 723 | this.$u.vuex('kjJoinUid', this.uid) |
598 | 724 | this.myHelpDetail = null |
|
604 | 730 | }) |
605 | 731 | } |
606 | 732 | }, |
| 733 | + async helpKanjia() { |
| 734 | + console.log(this.curGoodsKanjia); |
| 735 | + console.log(this.token); |
| 736 | + const res = await this.$wxapi.kanjiaHelp(this.token, this.curGoodsKanjia.id, this.curKanjiaprogress |
| 737 | + .kanjiaInfo.uid, '') |
| 738 | + if (res.code != 0) { |
| 739 | + uni.showToast({ |
| 740 | + title: res.msg, |
| 741 | + icon: 'none' |
| 742 | + }) |
| 743 | + return; |
| 744 | + } |
| 745 | + this.myHelpDetail = res.data |
| 746 | + uni.showModal({ |
| 747 | + title: '成功', |
| 748 | + content: '成功帮TA砍掉 ' + res.data.cutPrice + ' 元', |
| 749 | + showCancel: false, |
| 750 | + confirmText: '知道了' |
| 751 | + }) |
| 752 | + this.kanjiaSet() |
| 753 | + }, |
| 754 | + async kanjiaHelpDetail() { |
| 755 | + console.log(this.curGoodsKanjia); |
| 756 | + console.log(this.token); |
| 757 | + const res = await this.$wxapi.kanjiaHelpDetail(this.token, this.curGoodsKanjia.id, this |
| 758 | + .curKanjiaprogress.kanjiaInfo.uid) |
| 759 | + if (res.code == 0) { |
| 760 | + this.myHelpDetail = res.data |
| 761 | + } |
| 762 | + }, |
607 | 763 | } |
608 | 764 | } |
609 | 765 | </script> |
|
775 | 931 |
|
776 | 932 | .goods-title { |
777 | 933 | padding: 0 32rpx; |
| 934 | +
|
| 935 | + text { |
| 936 | + font-weight: bold; |
| 937 | + font-size: 34rpx; |
| 938 | + } |
778 | 939 | } |
| 940 | +
|
779 | 941 | .curKanjiaJoin { |
780 | 942 | padding: 32rpx; |
781 | 943 | font-size: 28rpx; |
| 944 | +
|
782 | 945 | text { |
783 | 946 | color: #e64340; |
784 | 947 | font-weight: bold; |
785 | 948 | padding: 0 8rpx; |
786 | 949 | font-size: 32rpx; |
787 | 950 | } |
788 | 951 | } |
| 952 | +
|
789 | 953 | .curKanjiaprogress { |
790 | 954 | padding: 32rpx; |
791 | 955 | } |
| 956 | +
|
| 957 | + .price-score2 { |
| 958 | + .item { |
| 959 | + font-size: 64rpx; |
| 960 | + } |
| 961 | + } |
| 962 | +
|
| 963 | + .curKanjiaprogress-bar { |
| 964 | + text-align: center; |
| 965 | + font-size: 20rpx; |
| 966 | + color: #999; |
| 967 | + margin-top: 20rpx; |
| 968 | + } |
| 969 | + .kjlj { |
| 970 | + display: flex; |
| 971 | + background-color: #ffffff; |
| 972 | + padding: 0 32rpx; |
| 973 | + align-items: center; |
| 974 | + .kjlj-l { |
| 975 | + width: 88rpx; |
| 976 | + height: 88rpx; |
| 977 | + border-radius: 50%; |
| 978 | + flex-shrink: 0; |
| 979 | + } |
| 980 | + .kjlj-r { |
| 981 | + flex: 1; |
| 982 | + } |
| 983 | + } |
792 | 984 | </style> |
0 commit comments