|
@@ -1,111 +1,88 @@
|
|
|
<template name="cm-price">
|
|
|
<!-- 商品详情价格判断 -->
|
|
|
<view class="wrap-main">
|
|
|
- <view class="" v-if="userIdentity == 1">
|
|
|
- <view class="wrap-main-price">
|
|
|
- <view class="p-main" v-if="product.ladderPriceFlag == '0' || product.actStatus == 1">
|
|
|
- <view class="p-active" v-if="product.actStatus == 1">
|
|
|
- <image class="icon-active" :src="iconActive" mode="" ></image>
|
|
|
- </view>
|
|
|
- <view class="p-price tui-skeleton-fillet">
|
|
|
- <text class="txt sm">¥</text>
|
|
|
- <text class="txt big">{{retailPrice}}</text>
|
|
|
- <text class="txt big">{{smallMoney== '0'?'.00':smallMoney}}</text>
|
|
|
+ <template v-if="!hasLogin">
|
|
|
+ <view class="p-login grade tui-skeleton-fillet">
|
|
|
+ <text class="p-no">¥</text>
|
|
|
+ <uni-stars :stars="parseInt(product.price1Grade)" :font-size='36' :width-info="180"></uni-stars>
|
|
|
+ <view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
|
|
|
+ </view>
|
|
|
+ <view class="wrap-main-act">
|
|
|
+ <view v-if="product.actStatus==1" class="floor-item-act">
|
|
|
+ <view v-if="product.promotions.type == 1 && product.promotions.mode==1" class="floor-tags" @click.stop="click">
|
|
|
+ {{product.promotions.name}}<text v-if="hasLogin">:¥{{ product.price | NumFormat }}</text>
|
|
|
</view>
|
|
|
- <view class="p-price-none" v-if="product.actStatus == 1">¥{{product.price1.toFixed(2)}}</view>
|
|
|
- <view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
|
|
|
+ <view v-else class="floor-tags" @click.stop="click">{{product.promotions.name}}</view>
|
|
|
</view>
|
|
|
- <view class="wrap-ladder" v-else>
|
|
|
- <view class="ladder-main tui-skeleton-fillet">
|
|
|
- <view class="ladder-left">
|
|
|
- <view class="ladder-b">起订量:</view>
|
|
|
- <view class="ladder-b">价格:</view>
|
|
|
- </view>
|
|
|
- <view class="ladder-right">
|
|
|
- <view class="ladder-li" v-for="(ladder,index) in ladderPriceList" :key="index">
|
|
|
- <view class="ladder-a">{{ladder.buyNumRangeShow}}</view>
|
|
|
- <view class="ladder-a">¥{{ladder.buyPrice.toFixed(2)}}</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <view v-if="product.actStatus ==0 && product.ladderPriceFlag==1" class="floor-item-act">
|
|
|
+ <view class="floor-tags" @click.stop="click">阶梯价格</view>
|
|
|
+ </view>
|
|
|
+ <view class="floor-item-btn">
|
|
|
+ <view class="btn" @click.stop="loginClick">登录查看价格</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="" v-if="userIdentity == 4">
|
|
|
- <view class="wrap-main-pricenone" v-if="product.price1TextFlag == '1'">
|
|
|
- <text>未公开价格</text>
|
|
|
- </view>
|
|
|
- <view class="wrap-main-pricenone" v-if="product.price1TextFlag == '2'">
|
|
|
- <text class="wrap-main-text">价格仅会员可见</text>
|
|
|
- <text class="wrap-main-none" @click.stop="goUpgradeApply">去升级会员查看价格<text class="iconfont icon-xiayibu" style="font-size: 22rpx;margin: 0 6rpx;"></text></text>
|
|
|
</view>
|
|
|
- <view class="wrap-main-price" v-if="product.price1TextFlag == '0'">
|
|
|
- <view class="p-main" v-if="product.ladderPriceFlag == '0' || product.actStatus == 1">
|
|
|
- <view class="p-active" v-if="product.actStatus == 1">
|
|
|
- <image class="icon-active" :src="iconActive" mode="" ></image>
|
|
|
- </view>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <view v-if="userIdentity == 1" class="wrap-main-price">
|
|
|
+ <view class="p-main">
|
|
|
<view class="p-price tui-skeleton-fillet">
|
|
|
<text class="txt sm">¥</text>
|
|
|
- <text class="txt big">{{retailPrice}}</text>
|
|
|
- <text class="txt big">{{smallMoney== '0'?'.00':smallMoney}}</text>
|
|
|
+ <text class="txt big">{{retailPrice | NumFormat}}</text>
|
|
|
</view>
|
|
|
- <view class="p-price-none" v-if="product.actStatus == 1">¥{{product.price1.toFixed(2)}}</view>
|
|
|
<view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view v-if="userIdentity == 4">
|
|
|
+ <view v-if="product.price1TextFlag == '1'" class="wrap-main-pricenone">
|
|
|
+ <text class="wrap-main-text">¥未公开价格</text>
|
|
|
</view>
|
|
|
- <view class="wrap-ladder" v-else>
|
|
|
- <view class="ladder-main tui-skeleton-fillet">
|
|
|
- <view class="ladder-left">
|
|
|
- <view class="ladder-b">起订量:</view>
|
|
|
- <view class="ladder-b">价格:</view>
|
|
|
- </view>
|
|
|
- <view class="ladder-right">
|
|
|
- <view class="ladder-li" v-for="(ladder,index) in ladderPriceList" :key="index">
|
|
|
- <view class="ladder-a">{{ladder.buyNumRangeShow}}</view>
|
|
|
- <view class="ladder-a">¥{{ladder.buyPrice.toFixed(2)}}</view>
|
|
|
- </view>
|
|
|
+ <view v-if="product.price1TextFlag == '2'" class="wrap-main-pricenone">
|
|
|
+ <text class="wrap-main-text">¥价格仅会员可见</text>
|
|
|
+ </view>
|
|
|
+ <view v-if="product.price1TextFlag == '0'" class="wrap-main-price">
|
|
|
+ <view class="p-main">
|
|
|
+ <view class="p-price tui-skeleton-fillet">
|
|
|
+ <text class="txt sm">¥</text>
|
|
|
+ <text class="txt big">{{retailPrice | NumFormat}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="" v-if="userIdentity == 2">
|
|
|
- <view class="wrap-main-pricenone" v-if="product.price1TextFlag == 1">
|
|
|
- <text>未公开价格</text>
|
|
|
+ </view>
|
|
|
+ <view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
|
|
|
</view>
|
|
|
- <view class="wrap-main-price" v-else>
|
|
|
- <view class="p-main" v-if="product.ladderPriceFlag == '0' || product.actStatus == 1">
|
|
|
- <view class="p-active" v-if="product.actStatus == 1">
|
|
|
- <image class="icon-active" :src="iconActive" mode="" ></image>
|
|
|
- </view>
|
|
|
- <view class="p-price tui-skeleton-fillet">
|
|
|
- <text class="txt sm">¥</text>
|
|
|
- <text class="txt big">{{retailPrice}}</text>
|
|
|
- <text class="txt big">{{smallMoney== '0'?'.00':smallMoney}}</text>
|
|
|
- </view>
|
|
|
- <view class="p-price-none" v-if="product.actStatus == 1">¥{{product.price1.toFixed(2)}}</view>
|
|
|
- <view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
|
|
|
+ <view v-if="userIdentity == 2">
|
|
|
+ <view v-if="product.price1TextFlag == '1'" class="wrap-main-pricenone">
|
|
|
+ <text class="wrap-main-text">¥未公开价格</text>
|
|
|
</view>
|
|
|
- <view class="wrap-ladder" v-else>
|
|
|
- <view class="ladder-main tui-skeleton-fillet">
|
|
|
- <view class="ladder-left">
|
|
|
- <view class="ladder-b">起订量:</view>
|
|
|
- <view class="ladder-b">价格:</view>
|
|
|
- </view>
|
|
|
- <view class="ladder-right">
|
|
|
- <view class="ladder-li" v-for="(ladder,index) in ladderPriceList" :key="index">
|
|
|
- <view class="ladder-a">{{ladder.buyNumRangeShow}}</view>
|
|
|
- <view class="ladder-a">¥{{ladder.buyPrice.toFixed(2)}}</view>
|
|
|
- </view>
|
|
|
+ <view v-else class="wrap-main-price">
|
|
|
+ <view class="p-main">
|
|
|
+ <view class="p-price tui-skeleton-fillet">
|
|
|
+ <text class="txt sm">¥</text>
|
|
|
+ <text class="txt big">{{retailPrice | NumFormat}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ </view>
|
|
|
+ <view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
|
|
|
+ </view>
|
|
|
+ <view class="wrap-main-act">
|
|
|
+ <view v-if="product.actStatus==1" class="floor-item-act">
|
|
|
+ <view v-if="product.promotions.type == 1 && product.promotions.mode==1" class="floor-tags" @click.stop="click">
|
|
|
+ {{product.promotions.name}}<text v-if="hasLogin">:¥{{ product.price | NumFormat }}</text>
|
|
|
+ </view>
|
|
|
+ <view v-else class="floor-tags" @click.stop="click">{{product.promotions.name}}</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <view v-if="product.actStatus ==0 && product.ladderPriceFlag==1" class="floor-item-act">
|
|
|
+ <view class="floor-tags" @click.stop="click">阶梯价格</view>
|
|
|
+ </view>
|
|
|
+ <view v-if="userIdentity == 4" class="floor-item-btn">
|
|
|
+ <view class="btn" @click.stop="goUpgradeApply">去升级会员查看价格</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import iconActive from '@/static/temp/icon-active.png'
|
|
|
+ import { mapState,mapMutations } from 'vuex'
|
|
|
export default{
|
|
|
name:'cm-price',
|
|
|
props:{
|
|
@@ -122,9 +99,6 @@
|
|
|
retailPrice:{
|
|
|
type:String,
|
|
|
},
|
|
|
- smallMoney:{
|
|
|
- type:String,
|
|
|
- },
|
|
|
minBuyNumber:{
|
|
|
type: Number,
|
|
|
default: 1
|
|
@@ -132,19 +106,27 @@
|
|
|
},
|
|
|
data() {
|
|
|
return{
|
|
|
- iconActive:iconActive
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
+ filters: {
|
|
|
+ NumFormat:function(text) {//处理金额
|
|
|
+ return Number(text).toFixed(2);
|
|
|
+ },
|
|
|
+ },
|
|
|
created() {
|
|
|
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['hasLogin','isWxAuthorize'])
|
|
|
},
|
|
|
methods:{
|
|
|
goUpgradeApply(){
|
|
|
this.$api.navigateTo('/pages/login/apply')
|
|
|
},
|
|
|
- toFixedFn(text){//处理小数点后两位数
|
|
|
- return Number(text).toFixed(2);
|
|
|
- },
|
|
|
+ loginClick(){
|
|
|
+ this.$api.navigateTo('/pages/login/login')
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
}
|