|
@@ -40,13 +40,13 @@
|
|
<view class="item-head">
|
|
<view class="item-head">
|
|
<view class="flex align_center">
|
|
<view class="flex align_center">
|
|
<view class="price-txt">¥<text>{{item.priceStr[0]}}</text>.{{item.priceStr[1]}}</view>
|
|
<view class="price-txt">¥<text>{{item.priceStr[0]}}</text>.{{item.priceStr[1]}}</view>
|
|
- <view class="flex align_center rebate-tag" v-if="item.promoType=='BUY_PROD_GIVE_VALID'">
|
|
|
|
|
|
+ <view class="flex align_center rebate-tag" v-if="item.promoProductType=='TICKET_PRODUCT'">
|
|
返<text>{{item.resultValue}}</text>元
|
|
返<text>{{item.resultValue}}</text>元
|
|
</view>
|
|
</view>
|
|
- <view class="flex align_center rebate-tag" v-if="item.promoType=='BUY_PROD_GIVE_PROD'">
|
|
|
|
|
|
+ <view class="flex align_center rebate-tag" v-if="item.promoProductType=='REGULAR_PRODUCT'">
|
|
买{{item.conditionValue}}赠{{item.resultValue}}
|
|
买{{item.conditionValue}}赠{{item.resultValue}}
|
|
</view>
|
|
</view>
|
|
- <view class="flex align_center tejia-tag" v-if="item.promoType=='PROMO_PROD'">
|
|
|
|
|
|
+ <view class="flex align_center tejia-tag" v-if="item.promoProductType=='SPECIAL_PRODUCT_DISCOUNT'||item.promoProductType=='SPECIAL_PRODUCT_STRAIGHT_DOWN'">
|
|
特价<text>¥{{item.priceOrig}}</text>
|
|
特价<text>¥{{item.priceOrig}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -57,27 +57,27 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 赠品 -->
|
|
<!-- 赠品 -->
|
|
- <view class="item-list flex gift-box" v-if="item.giftQty">
|
|
|
|
|
|
+ <view class="item-list flex gift-box" v-if="item.giftObj">
|
|
<view style="height: 120rpx;width: 120rpx;margin-left: 40rpx;">
|
|
<view style="height: 120rpx;width: 120rpx;margin-left: 40rpx;">
|
|
- <u-image :src="item.product.images+'?x-oss-process=image/resize,p_50'" border-radius="16" width="120" height="120" bg-color="#EBEBEB" ></u-image>
|
|
|
|
|
|
+ <u-image :src="item.giftObj.product.images+'?x-oss-process=image/resize,p_50'" border-radius="16" width="120" height="120" bg-color="#EBEBEB" ></u-image>
|
|
</view>
|
|
</view>
|
|
<view>
|
|
<view>
|
|
<view class="item-name flex align_center ellipsis-one">
|
|
<view class="item-name flex align_center ellipsis-one">
|
|
<view class="flex align_center rebate-tag">
|
|
<view class="flex align_center rebate-tag">
|
|
赠品
|
|
赠品
|
|
</view>
|
|
</view>
|
|
- <text>{{item.product.productName}}</text>
|
|
|
|
|
|
+ <text>{{item.giftObj.product.productName}}</text>
|
|
</view>
|
|
</view>
|
|
- <view class="item-nums ellipsis-one" v-if="item.product&&item.product.origCode">
|
|
|
|
- <text style="color: #666;">{{item.product.origCode}}</text>
|
|
|
|
|
|
+ <view class="item-nums ellipsis-one" v-if="item.giftObj.product&&item.giftObj.product.origCode">
|
|
|
|
+ <text style="color: #666;">{{item.giftObj.product.origCode}}</text>
|
|
</view>
|
|
</view>
|
|
- <view class="item-nums ellipsis-one" v-if="item.product&&item.product.code">
|
|
|
|
- <text>{{item.product.code}}</text>
|
|
|
|
|
|
+ <view class="item-nums ellipsis-one" v-if="item.giftObj.product&&item.giftObj.product.code">
|
|
|
|
+ <text>{{item.giftObj.product.code}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="item-head">
|
|
<view class="item-head">
|
|
<view class="flex align_center"></view>
|
|
<view class="flex align_center"></view>
|
|
<view>
|
|
<view>
|
|
- X <text class="cText">{{item.giftQty}}</text>{{item.product&&item.product.unit||''}}
|
|
|
|
|
|
+ X <text class="cText">{{item.giftObj.qty}}</text>{{item.giftObj.product&&item.giftObj.product.unit||''}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -208,20 +208,14 @@
|
|
purchaseQueryDetailPage({purchaseSn: this.purchaseSn,pageNo:this.pageNo,pageSize:this.pageSize}).then(res => {
|
|
purchaseQueryDetailPage({purchaseSn: this.purchaseSn,pageNo:this.pageNo,pageSize:this.pageSize}).then(res => {
|
|
if(res.status == 200){
|
|
if(res.status == 200){
|
|
this.partList = res.data ? res.data.list : []
|
|
this.partList = res.data ? res.data.list : []
|
|
|
|
+ // 是否有赠品
|
|
|
|
+ const giftList = this.partList.filter(item => item.promoProductType == 'GIFT_PRODUCT')
|
|
|
|
+ // 正品
|
|
|
|
+ this.partList = this.partList.filter(item => item.promoProductType !== 'GIFT_PRODUCT')
|
|
this.partList.map(item=>{
|
|
this.partList.map(item=>{
|
|
- const a = item.shopPromoProduct
|
|
|
|
- if(a){
|
|
|
|
- item.promoType = a.promoType
|
|
|
|
- item.resultValue = a.resultValue
|
|
|
|
- item.conditionValue = a.conditionValue
|
|
|
|
- item.discountType = a.discountType
|
|
|
|
- item.promoProductSn = a.promoProductSn
|
|
|
|
- item.promoSn = a.promoSn
|
|
|
|
- // 满赠数量
|
|
|
|
- item.giftQty = item.promoType=='BUY_PROD_GIVE_PROD' ? Math.floor(item.qty / item.conditionValue)*item.resultValue : 0
|
|
|
|
- }
|
|
|
|
|
|
+ // 关联赠品
|
|
|
|
+ item.giftObj = giftList.find(gift => gift.purchaseDetailParentSn == item.purchaseDetailSn)
|
|
item.priceStr = Number(item.price).toFixed(2).toString().split('.')
|
|
item.priceStr = Number(item.price).toFixed(2).toString().split('.')
|
|
- delete item.shopPromoProduct
|
|
|
|
})
|
|
})
|
|
this.total = res.data ? res.data.count : 0
|
|
this.total = res.data ? res.data.count : 0
|
|
}
|
|
}
|