123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415 |
- <template name="cm-price">
- <!-- 商品详情价格判断 -->
- <view class="wrap-main">
- <template v-if="!hasLogin">
- <view class="p-login grade tui-skeleton-fillet">
- <text class="p-no">¥</text>
- <uni-grader :grade="Number(product.price1Grade)"></uni-grader>
- <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="clickPopupShow()">
- {{product.promotions.name}}<text v-if="hasLogin">:¥{{ product.price | NumFormat }}</text>
- </view>
- <view v-else class="floor-tags" @click.stop="clickPopupShow()">{{product.promotions.name}}</view>
- </view>
- <view v-if="product.actStatus ==0 && product.ladderPriceFlag === 1" class="floor-item-act">
- <view class="floor-tags" @click.stop="clickPopupShow()">阶梯价格</view>
- </view>
- <view class="floor-item-btn">
- <view class="btn" @click.stop="loginClick">登录查看价格</view>
- </view>
- </view>
- </template>
- <template v-else>
- <!-- 协销 -->
- <template v-if="userIdentity == 1">
- <view class="wrap-main-item">
- <view class="p-price tui-skeleton-fillet" :class="PromotionsFormat(product.promotions) ? 'none' : ''">
- <text class="txt sm">¥</text>
- <text class="txt big">{{ (PromotionsFormat(product.promotions) ? product.price1 : product.retailPrice) | NumFormat }}</text>
- </view>
- <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="clickPopupShow(1)">
- {{product.promotions.name}}<text v-if="hasLogin">:¥{{ product.promotions == null ? '0.00' : product.promotions.touchPrice | NumFormat }}</text>
- </view>
- <view v-else class="floor-tags" @click.stop="clickPopupShow()">{{product.promotions.name}}</view>
- </view>
- <view v-if="product.actStatus == 0 && product.ladderPriceFlag == 1" class="floor-item-act">
- <view class="floor-tags" @click.stop="clickPopupShow()">阶梯价格</view>
- </view>
- </view>
- </template>
- <!-- 会员机构 -->
- <template v-if="userIdentity == 2">
- <view class="wrap-main-item">
- <view v-if="product.price1TextFlag == '1'" class="wrap-main-text">¥未公开价格</view>
- <view v-else class="p-price tui-skeleton-fillet" :class="PromotionsFormat(product.promotions) ? 'none' : ''">
- <text class="txt sm">¥</text>
- <text class="txt big">{{ (PromotionsFormat(product.promotions) ? product.price1 : product.retailPrice) | NumFormat }}</text>
- </view>
- <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="clickPopupShow(1)">
- {{product.promotions.name}}<text v-if="hasLogin && product.price1TextFlag != '1'">:¥{{ product.promotions == null ? '0.00' : product.promotions.touchPrice | NumFormat }}</text>
- </view>
- <view v-else class="floor-tags" @click.stop="clickPopupShow()">{{product.promotions.name}}</view>
- </view>
- <view v-if="product.actStatus ==0 && product.ladderPriceFlag == 1" class="floor-item-act">
- <view class="floor-tags" @click.stop="clickPopupShow()">阶梯价格</view>
- </view>
- </view>
- </template>
- <!-- 供应商 -->
- <template v-if="userIdentity == 3">
- <template v-if="product.shopID === shopID">
- <view class="wrap-main-item">
- <view v-if="product.price1TextFlag == '1'" class="wrap-main-text">¥未公开价格</view>
- <view v-else class="p-price tui-skeleton-fillet" :class="PromotionsFormat(product.promotions) ? 'none' : ''">
- <text class="txt sm">¥</text>
- <text class="txt big">{{ (PromotionsFormat(product.promotions) ? product.price1 : product.retailPrice) | NumFormat }}</text>
- </view>
- <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="clickPopupShow(1)">
- {{product.promotions.name}}<text v-if="hasLogin && product.price1TextFlag != '1'">:¥{{ product.promotions == null ? '0.00' : product.promotions.touchPrice | NumFormat }}</text>
- </view>
- <view v-else class="floor-tags" @click.stop="clickPopupShow()">{{product.promotions.name}}</view>
- </view>
- <view v-if="product.actStatus ==0 && product.ladderPriceFlag == 1" class="floor-item-act">
- <view class="floor-tags" @click.stop="clickPopupShow()">阶梯价格</view>
- </view>
- </view>
- </template>
- <template v-else>
- <view class="p-login grade tui-skeleton-fillet">
- <text class="p-no">¥</text>
- <uni-grader :grade="Number(product.price1Grade)"></uni-grader>
- </view>
- </template>
- </template>
- <!-- 普通机构 -->
- <template v-if="userIdentity == 4">
- <template v-if="product.price1TextFlag == '1'">
- <text class="wrap-main-text">¥未公开价格</text>
- </template>
- <template v-if="product.price1TextFlag == '2'">
- <text class="wrap-main-text">¥价格仅会员可见</text>
- <view class="floor-item-btn">
- <view class="btn" @click.stop="goUpgradeApply">升级会员查看价格</view>
- </view>
- </template>
- <template v-if="product.price1TextFlag == '0'">
- <view class="wrap-main-item">
- <view class="p-price tui-skeleton-fillet" :class="PromotionsFormat(product.promotions) ? 'none' : ''">
- <text class="txt sm">¥</text>
- <text class="txt big">{{ (PromotionsFormat(product.promotions) ? product.price1 : product.retailPrice) | NumFormat }}</text>
- </view>
- <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="clickPopupShow(1)">
- {{product.promotions.name}}<text v-if="hasLogin && product.price1TextFlag != '1'">:¥{{ product.promotions == null ? '0.00' : product.promotions.touchPrice | NumFormat }}</text>
- </view>
- <view v-else class="floor-tags" @click.stop="clickPopupShow()">{{product.promotions.name}}</view>
- </view>
- <view v-if="product.actStatus ==0 && product.ladderPriceFlag == 1" class="floor-item-act">
- <view class="floor-tags" @click.stop="clickPopupShow()">阶梯价格</view>
- </view>
- </view>
- </template>
- </template>
- <!--促销活动弹窗提示-->
- <tui-bottom-popup :radius="true" :show="popupShow" @close="hidePopup()">
- <view class="tui-popup-box clearfix">
- <template v-if="product.actStatus == 0 && product.ladderPriceFlag == 1">
- <view class="tui-scrollview-box">
- <view class="ladder-main clearfix">
- <view class="ladder-item">
- <view class="ladder-item-td">起订量</view>
- <view class="ladder-item-td">价格</view>
- </view>
- <view class="ladder-item" v-for="(ladd, index) in product.ladderPriceList" :key="index">
- <view class="ladder-item-td">{{ ladd.buyNumRangeShow }}</view>
- <view class="ladder-item-td">{{ ladd.buyPrice | NumFormat }}</view>
- </view>
- </view>
- </view>
- </template>
- <template v-else>
- <view class="tui-scrollview-box">
- <view class="box-text">
- <text>促销时间:</text>
- <text class="txt" v-if="product.promotions.status == 1">不限时</text>
- <text class="txt" v-else>{{ product.promotions.beginTime }} ~ {{ product.promotions.endTime }}</text>
- </view>
- <view class="box-title" v-show="product.promotions.mode ==2">
- <text>购买{{ product.promotions.name }}商品,满</text>
- <text class="txt">¥{{ product.promotions == null ? '0.00' : product.promotions.touchPrice | NumFormat }}</text>减
- <text class="txt">¥{{ product.promotions == null ? '0.00' : product.promotions.reducedPrice | NumFormat }}</text>
- </view>
- <view class="box-title" v-show="product.promotions.mode==3">
- <text>购买{{ product.promotions.name }}商品,满</text>
- <text class="txt">¥{{ product.promotions == null ? '0.00' : product.promotions.touchPrice | NumFormat }}</text>赠送商品
- </view>
- <view class="box-product" v-show="product.promotions.mode==3">
- <view class="box-product-main" v-for="(item, index) in product.promotions.giftList" :key="index">
- <view class="image"><image :src="item.image" mode="widthFix"></image></view>
- <view class="info">
- <view class="name">{{ item.name }}</view>
- <view class="num">X{{ item.number }}</view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
- <view class="tui-flex-1">
- <view class="tui-button" v-if="product.promotions.type == 2" @click="goGoodActiveFn(product.promotions.id)">更多凑单商品</view>
- <view class="tui-button" v-else @click="hidePopup()">了解</view>
- </view>
- </view>
- </view>
- </tui-bottom-popup>
- </template>
- </view>
- </template>
- <script>
- import { mapState,mapMutations } from 'vuex'
- import uniGrader from '@/components/uni-grade/uni-grade.vue'
- export default{
- name:'cm-price',
- components:{
- uniGrader
- },
- props:{
- product:{
- type:Object,
- },
- userIdentity: {
- type: Number,
- default: 2
- },
- shopID: {
- type: Number,
- default: 2
- },
- ladderPriceList:{
- type: Array,
- },
- promotions:{
- type:Object,
- }
- },
- data() {
- return{
- popupShow:false,
- promotionsType:0,
- isIphoneX:this.$store.state.isIphoneX,
- }
- },
- filters: {
- NumFormat:function(text) {//处理金额
- return Number(text).toFixed(2);
- },
- },
- created() {
-
- },
- computed: {
- ...mapState(['hasLogin','isWxAuthorize'])
- },
- methods:{
- clickPopupShow(type){
- this.popupShow = true
- this.promotionsType = type
- },
- hidePopup(){
- this.popupShow = false
- },
- PromotionsFormat(promo){//促销活动类型数据处理
- if(promo!=null){
- if(promo.type == 1 && promo.mode == 1){
- return true
- }else{
- return false
- }
- }
- return false
- },
- goUpgradeApply(){
- this.$api.navigateTo('/pages/login/apply')
- },
- loginClick(){
- this.$api.navigateTo('/pages/login/login')
- },
- goGoodActiveFn(id){
- this.$parent.popupShow = false
- this.$api.navigateTo('/pages/goods/goods-active?id='+id)
- }
- },
-
- }
- </script>
- <style lang="scss">
- .tui-flex-1 {
- flex: 1;
- }
- .tui-popup-box {
- position: relative;
- box-sizing: border-box;
- min-height: 220rpx;
- padding:24rpx 24rpx 0 24rpx;
- }
- .tui-scrollview-box{
- width: 100%;
- height: auto;
- float: left;
- box-sizing: border-box;
- .ladder-main{
- width: 100%;
- min-height: 240rpx;
- border: 1px solid rgba(225,86,22,0.3);
- border-radius: 10rpx;
- .ladder-item{
- width: 100%;
- height: 80rpx;
- float: left;
- border-bottom: 1px solid rgba(225,86,22,0.3);
- &:nth-child(1){
- .ladder-item-td{
- color: #333333;
- }
- }
- &:last-child{
- border-bottom: none;
- }
- .ladder-item-td{
- width:50%;
- text-align: center;
- line-height: 80rpx;
- font-size: $font-size-24;
- color: $color-system;
- box-sizing: border-box;
- float: left;
- &:nth-child(1){
- border-right: 1px solid rgba(225,86,22,0.3);
- }
- }
- }
- }
- .box-title{
- font-size: $font-size-26;
- color: $text-color;
- text-align: left;
- line-height: 56rpx;
- .txt{
- color: $color-system;
- margin: 0 8rpx;
- }
- }
- .box-text{
- font-size: $font-size-26;
- color: $text-color;
- text-align: left;
- line-height: 56rpx;
- .txt{
- color: $color-system;
- }
- }
- .box-product{
- width: 100%;
- height: auto;
- margin-top: 20rpx;
- .title{
- font-size: $font-size-24;
- color: $text-color;
- text-align: left;
- line-height: 54rpx;
- }
- .box-product-main{
- width: 100%;
- height: 136rpx;
- float: left;
- margin: 10rpx 0;
- .image{
- width: 134rpx;
- height: 134rpx;
- border: 1px solid #EBEBEB;
- float: left;
- image{
- width: 100%;
- height: 100%;
- display: block;
- }
- }
- .info{
- width: 540rpx;
- height: 134rpx;
- float: left;
- margin-left: 16rpx;
- position: relative;
- .name{
- width: 100%;
- float: left;
- line-height: 40rpx;
- font-size: $font-size-28;
- color: $text-color;
- -o-text-overflow: ellipsis;
- text-overflow: ellipsis;
- display: -webkit-box;
- word-break: break-all;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- overflow: hidden;
- }
- .num{
- width: 100%;
- height: 44rpx;
- font-size: $font-size-24;
- color: $text-color;
- text-align: left;
- line-height: 44rpx;
- position: absolute;
- bottom: 0;
- left: 0;
- }
- }
- }
- }
- }
-
- .tui-popup-btn {
- width: 100%;
- height: auto;
- float: left;
- margin-top: 24rpx;
- .tui-button{
- width: 100%;
- height: 88rpx;
- background: $btn-confirm;
- line-height: 88rpx;
- text-align: center;
- color: #FFFFFF;
- font-size: $font-size-28;
- border-radius: 44rpx;
- }
- }
- </style>
|