|
@@ -63,103 +63,114 @@
|
|
|
></view>
|
|
|
</view>
|
|
|
<view class="pros-img" @click.stop="navToListPage(pros.productId)"
|
|
|
- ><image :src="pros.image ? pros.image : ''" alt=""
|
|
|
- /><view class="pros-type" v-if="pros.productType == 2">医疗器械</view>
|
|
|
+ ><image :src="pros.image ? pros.image : ''" alt="" /><view
|
|
|
+ class="pros-type"
|
|
|
+ v-if="pros.productType == 2"
|
|
|
+ >医疗器械</view
|
|
|
+ >
|
|
|
</view>
|
|
|
<view class="pros-product">
|
|
|
<view class="producttitle" @click.stop="navToListPage(pros.productId)">{{
|
|
|
pros.name
|
|
|
}}</view>
|
|
|
<view class="productspec">规格:{{ pros.unit ? pros.unit : '' }}</view>
|
|
|
- <view class="productprice">
|
|
|
- <!--使用过滤器对总价改变-->
|
|
|
- <view
|
|
|
- class="price"
|
|
|
- :class="
|
|
|
- PromotionsFormat(pros.promotions) ||
|
|
|
- (pros.svipProductFlag == 1 && vipFlag == 1)
|
|
|
- ? 'disabled'
|
|
|
- : ''
|
|
|
- "
|
|
|
- >
|
|
|
- <text>¥</text>
|
|
|
- {{
|
|
|
- (PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
|
|
|
- ? pros.originalPrice
|
|
|
- : pros.price) | NumFormat
|
|
|
- }}
|
|
|
- </view>
|
|
|
- <view
|
|
|
- class="count"
|
|
|
- v-if="pros.validFlag == 2"
|
|
|
- :class="[isshowDelbtn ? 'none' : 'show']"
|
|
|
- >
|
|
|
- <text class="count-tips" v-if="pros.number < pros.min"
|
|
|
- >起订量:{{ pros.min }}</text
|
|
|
- >
|
|
|
- <text class="count-tips step" v-if="pros.isStep"
|
|
|
- >购买量必须为起订量的整数倍</text
|
|
|
- >
|
|
|
- <view class="number-box">
|
|
|
- <view
|
|
|
- class="iconfont icon-jianhao"
|
|
|
- @click="changeCountSub(item, pros)"
|
|
|
- ></view>
|
|
|
- <input
|
|
|
- class="btn-input"
|
|
|
- type="number"
|
|
|
- maxlength="4"
|
|
|
- v-model="pros.number"
|
|
|
- @blur="changeNnmber($event, item, pros)"
|
|
|
- @focus="changeInput(pros)"
|
|
|
- />
|
|
|
- <view
|
|
|
- class="iconfont icon-jiahao"
|
|
|
- @click="changeCountAdd(item, pros)"
|
|
|
- ></view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="floor-item-act">
|
|
|
- <template v-if="pros.actStatus == 1 && pros.promotions">
|
|
|
+ <template v-if="pros.stock> 0">
|
|
|
+ <view class="cart-sku-temp" @click.stop="handleShouUnitPopup(pros)">
|
|
|
+ <view class="cart-sku-text">重新选择商品规格</view>
|
|
|
+ <view class="cart-sku-btn">重选</view>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <view class="productprice">
|
|
|
+ <!--使用过滤器对总价改变-->
|
|
|
<view
|
|
|
- v-if="PromotionsFormat(pros.promotions)"
|
|
|
- class="floor-tags"
|
|
|
- @click.stop="clickPopupShow(pros, 1)"
|
|
|
+ class="price"
|
|
|
+ :class="
|
|
|
+ PromotionsFormat(pros.promotions) ||
|
|
|
+ (pros.svipProductFlag == 1 && vipFlag == 1)
|
|
|
+ ? 'disabled'
|
|
|
+ : ''
|
|
|
+ "
|
|
|
>
|
|
|
- {{ pros.promotions.name }}
|
|
|
- <text
|
|
|
- v-if="pros.promotions != null && pros.promotions.type != 3"
|
|
|
- >
|
|
|
- :¥{{
|
|
|
- pros.promotions == null
|
|
|
- ? '0.00'
|
|
|
- : pros.promotions.touchPrice | NumFormat
|
|
|
- }}
|
|
|
- </text>
|
|
|
+ <text>¥</text>
|
|
|
+ {{
|
|
|
+ (PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
|
|
|
+ ? pros.originalPrice
|
|
|
+ : pros.price) | NumFormat
|
|
|
+ }}
|
|
|
</view>
|
|
|
<view
|
|
|
- v-else-if="pros.promotions.type != 3"
|
|
|
- class="floor-tags"
|
|
|
- @click.stop="clickPopupShow(pros, 2)"
|
|
|
- >
|
|
|
- {{ pros.promotions.name }}
|
|
|
- </view>
|
|
|
- </template>
|
|
|
- <template v-if="pros.actStatus == null && pros.ladderFlag == 1">
|
|
|
- <view class="floor-tags" @click.stop="clickPopupShow(pros, 2)"
|
|
|
- >阶梯价格</view
|
|
|
+ class="count"
|
|
|
+ v-if="pros.validFlag == 2"
|
|
|
+ :class="[isshowDelbtn ? 'none' : 'show']"
|
|
|
>
|
|
|
- </template>
|
|
|
- <template v-if="pros.svipProductFlag == 1">
|
|
|
- <view class="svip-tags">
|
|
|
- <view class="tags" :class="{ none: vipFlag != 1 }">SVIP</view>
|
|
|
- <view class="price" v-if="isShowVipFlag(pros)">{{
|
|
|
- pros.svipPriceTag
|
|
|
- }}</view>
|
|
|
+ <text class="count-tips" v-if="pros.number < pros.min"
|
|
|
+ >起订量:{{ pros.min }}</text
|
|
|
+ >
|
|
|
+ <text class="count-tips step" v-if="pros.isStep"
|
|
|
+ >购买量必须为起订量的整数倍</text
|
|
|
+ >
|
|
|
+ <view class="number-box">
|
|
|
+ <view
|
|
|
+ class="iconfont icon-jianhao"
|
|
|
+ @click="changeCountSub(item, pros)"
|
|
|
+ ></view>
|
|
|
+ <input
|
|
|
+ class="btn-input"
|
|
|
+ type="number"
|
|
|
+ maxlength="4"
|
|
|
+ v-model="pros.number"
|
|
|
+ @blur="changeNnmber($event, item, pros)"
|
|
|
+ @focus="changeInput(pros)"
|
|
|
+ />
|
|
|
+ <view
|
|
|
+ class="iconfont icon-jiahao"
|
|
|
+ @click="changeCountAdd(item, pros)"
|
|
|
+ ></view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- </template>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
+ <view class="floor-item-act">
|
|
|
+ <template v-if="pros.actStatus == 1 && pros.promotions">
|
|
|
+ <view
|
|
|
+ v-if="PromotionsFormat(pros.promotions)"
|
|
|
+ class="floor-tags"
|
|
|
+ @click.stop="clickPopupShow(pros, 1)"
|
|
|
+ >
|
|
|
+ {{ pros.promotions.name }}
|
|
|
+ <text
|
|
|
+ v-if="pros.promotions != null && pros.promotions.type != 3"
|
|
|
+ >
|
|
|
+ :¥{{
|
|
|
+ pros.promotions == null
|
|
|
+ ? '0.00'
|
|
|
+ : pros.promotions.touchPrice | NumFormat
|
|
|
+ }}
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ <view
|
|
|
+ v-else-if="pros.promotions.type != 3"
|
|
|
+ class="floor-tags"
|
|
|
+ @click.stop="clickPopupShow(pros, 2)"
|
|
|
+ >
|
|
|
+ {{ pros.promotions.name }}
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ <template v-if="pros.actStatus == null && pros.ladderFlag == 1">
|
|
|
+ <view class="floor-tags" @click.stop="clickPopupShow(pros, 2)"
|
|
|
+ >阶梯价格</view
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ <template v-if="pros.svipProductFlag == 1">
|
|
|
+ <view class="svip-tags">
|
|
|
+ <view class="tags" :class="{ none: vipFlag != 1 }">SVIP</view>
|
|
|
+ <view class="price" v-if="isShowVipFlag(pros)">{{
|
|
|
+ pros.svipPriceTag
|
|
|
+ }}</view>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -302,6 +313,13 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <!-- 选择规格弹窗 -->
|
|
|
+ <cm-unit-popup
|
|
|
+ v-if="popupShow2"
|
|
|
+ :popupShow="popupShow2"
|
|
|
+ :product="handlePros"
|
|
|
+ @btnConfirm="handleBtnConfirm"
|
|
|
+ ></cm-unit-popup>
|
|
|
<!-- 促销活动弹窗 -->
|
|
|
<activi-popup :product="handlerPros" :popupShow="popupShow"></activi-popup>
|
|
|
<!-- 透明模态层 -->
|
|
@@ -351,8 +369,12 @@
|
|
|
<view class="list-cell-type">
|
|
|
<view class="list-cell-tags">
|
|
|
<template v-if="coupon.moneyCouponFlag == 1">
|
|
|
- <text class="tags" v-if="coupon.moneyCouponType == 1">意向{{ coupon.couponType | TypeFormat }}</text>
|
|
|
- <text class="tags" v-else>定向{{ coupon.couponType | TypeFormat }}</text>
|
|
|
+ <text class="tags" v-if="coupon.moneyCouponType == 1"
|
|
|
+ >意向{{ coupon.couponType | TypeFormat }}</text
|
|
|
+ >
|
|
|
+ <text class="tags" v-else
|
|
|
+ >定向{{ coupon.couponType | TypeFormat }}</text
|
|
|
+ >
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<text class="tags">{{ coupon.couponType | TypeFormat }}</text>
|
|
@@ -388,22 +410,22 @@
|
|
|
<view class="icon-used">
|
|
|
<template v-if="coupon.couponBtnType == 0">
|
|
|
<template v-if="coupon.couponPayWay == 2">
|
|
|
- <view class="icon-used-text">{{ coupon.moneyCouponPrice }}采美豆</view>
|
|
|
+ <view class="icon-used-text"
|
|
|
+ >{{ coupon.moneyCouponPrice }}采美豆</view
|
|
|
+ >
|
|
|
<view
|
|
|
class="icon-used-btn receive"
|
|
|
@click="toDeductCoupon(coupon)"
|
|
|
>抵扣</view
|
|
|
>
|
|
|
- </template>
|
|
|
+ </template>
|
|
|
<template v-else-if="coupon.couponPayWay == 1">
|
|
|
<view class="icon-used-text">购买</view>
|
|
|
- <view
|
|
|
- class="icon-used-btn receive"
|
|
|
- @click="toPayCoupon(coupon)"
|
|
|
+ <view class="icon-used-btn receive" @click="toPayCoupon(coupon)"
|
|
|
>¥{{ coupon.moneyCouponPrice }}</view
|
|
|
>
|
|
|
</template>
|
|
|
- <template v-else>
|
|
|
+ <template v-else>
|
|
|
<view
|
|
|
class="icon-used-btn receive"
|
|
|
@click="receiveCoupon(coupon)"
|
|
@@ -486,6 +508,7 @@ import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
|
|
|
import tuiNomore from '@/components/tui-components/nomore/nomore'
|
|
|
import activiPopup from '@/components/cm-module/productDetails/cm-activipopu'
|
|
|
import couponTabs from '@/components/cm-module/coupon/tui-tabs.vue'
|
|
|
+import cmUnitPopup from './cm-unit-popup.vue'
|
|
|
import modalLayer from '@/components/modal-layer'
|
|
|
import payMixins from '@/mixins/payMixins.js'
|
|
|
import { mapState, mapMutations } from 'vuex'
|
|
@@ -502,6 +525,7 @@ export default {
|
|
|
tuiNomore,
|
|
|
activiPopup,
|
|
|
couponTabs,
|
|
|
+ cmUnitPopup,
|
|
|
modalLayer
|
|
|
},
|
|
|
data() {
|
|
@@ -547,10 +571,11 @@ export default {
|
|
|
pageSize: 10,
|
|
|
pageNum: 1,
|
|
|
submitIds: [],
|
|
|
- checkenProsList:[],
|
|
|
+ checkenProsList: [],
|
|
|
popupShow: false,
|
|
|
popupShow0: false,
|
|
|
popupShow1: false,
|
|
|
+ popupShow2: false,
|
|
|
currentTab: 1,
|
|
|
navbar: [{ name: '未领取', num: 0 }, { name: '已领取', num: 0 }],
|
|
|
couponParam: {
|
|
@@ -579,6 +604,7 @@ export default {
|
|
|
plain: false
|
|
|
}
|
|
|
],
|
|
|
+ handlePros:{}
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -849,27 +875,30 @@ export default {
|
|
|
this.goodsList.map((item, index) => {
|
|
|
//计算店铺满减后店铺合计
|
|
|
if (item.promotions && item.promotions.mode == 2) {
|
|
|
- let prosPrice = 0 // 店铺价格合计
|
|
|
+ let prosPrice = 0 // 店铺价格合计
|
|
|
let prosDiscountNum = 0 // 店铺促销叠加次数
|
|
|
let totalOriginalPrice = 0 //店铺原价合计
|
|
|
item.cartList.forEach(pros => {
|
|
|
prosPrice += pros.price * pros.number
|
|
|
totalOriginalPrice += pros.originalPrice * pros.number
|
|
|
})
|
|
|
- if(item.promotions.discount == 1){// 支持促销叠加条件的店铺满减 执行
|
|
|
- prosDiscountNum = parseInt(prosPrice/item.promotions.touchPrice) // 店铺满减促销叠加次数 = 店铺合计价格/满减促销价格
|
|
|
- console.log('店铺满减促销叠加通道叠加次数',`${prosDiscountNum}次`)
|
|
|
- if (prosPrice >= item.promotions.touchPrice) {// 满足店铺满减条件下执行
|
|
|
- item.totalPrice = prosPrice - item.promotions.reducedPrice*prosDiscountNum
|
|
|
- item.reducedPrice = item.promotions.reducedPrice*prosDiscountNum
|
|
|
+ if (item.promotions.discount == 1) {
|
|
|
+ // 支持促销叠加条件的店铺满减 执行
|
|
|
+ prosDiscountNum = parseInt(prosPrice / item.promotions.touchPrice) // 店铺满减促销叠加次数 = 店铺合计价格/满减促销价格
|
|
|
+ console.log('店铺满减促销叠加通道叠加次数', `${prosDiscountNum}次`)
|
|
|
+ if (prosPrice >= item.promotions.touchPrice) {
|
|
|
+ // 满足店铺满减条件下执行
|
|
|
+ item.totalPrice = prosPrice - item.promotions.reducedPrice * prosDiscountNum
|
|
|
+ item.reducedPrice = item.promotions.reducedPrice * prosDiscountNum
|
|
|
item.totalOriginalPrice = totalOriginalPrice
|
|
|
} else {
|
|
|
item.reducedPrice = 0 //统计合计价格
|
|
|
item.totalPrice = prosPrice
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
console.log('店铺满减促销非叠加通道')
|
|
|
- if (prosPrice >= item.promotions.touchPrice) {// 满足店铺满减条件下执行
|
|
|
+ if (prosPrice >= item.promotions.touchPrice) {
|
|
|
+ // 满足店铺满减条件下执行
|
|
|
item.totalPrice = prosPrice - item.promotions.reducedPrice
|
|
|
item.reducedPrice = item.promotions.reducedPrice
|
|
|
item.totalOriginalPrice = totalOriginalPrice
|
|
@@ -888,15 +917,15 @@ export default {
|
|
|
let _price = pros.price * pros.number
|
|
|
_totalOriginalPrice += _price
|
|
|
if (pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2) {
|
|
|
- if(pros.promotions.discount == 1){
|
|
|
- discountNum = parseInt(_price/pros.promotions.touchPrice)
|
|
|
- console.log('单品满减促销叠加通道叠加次数',`${discountNum}次`)
|
|
|
+ if (pros.promotions.discount == 1) {
|
|
|
+ discountNum = parseInt(_price / pros.promotions.touchPrice)
|
|
|
+ console.log('单品满减促销叠加通道叠加次数', `${discountNum}次`)
|
|
|
if (_price >= pros.promotions.touchPrice) {
|
|
|
- _price = _price - pros.promotions.reducedPrice*discountNum
|
|
|
- _reducedPrice += pros.promotions.reducedPrice*discountNum
|
|
|
+ _price = _price - pros.promotions.reducedPrice * discountNum
|
|
|
+ _reducedPrice += pros.promotions.reducedPrice * discountNum
|
|
|
}
|
|
|
_totalPrice += _price
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
console.log('单品满减非促销叠加通道')
|
|
|
if (_price >= pros.promotions.touchPrice) {
|
|
|
_price = _price - pros.promotions.reducedPrice
|
|
@@ -932,27 +961,27 @@ export default {
|
|
|
if (pros.isChecked) {
|
|
|
supplierPrice += pros.price * pros.number
|
|
|
svipReducedPrice += item.svipReducedPrice
|
|
|
- if( pros.svipProductFlag == 1 ){
|
|
|
+ if (pros.svipProductFlag == 1) {
|
|
|
totalAmount += item.originalPrice
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
item.totalprice = supplierPrice
|
|
|
totalAmount += item.totalprice
|
|
|
}
|
|
|
// 单品满减
|
|
|
if (pros.promotions && pros.promotions.type * 1 === 1 && pros.promotions.mode * 1 === 2) {
|
|
|
let _price = pros.price * pros.number
|
|
|
- if(pros.promotions.discount == 1){
|
|
|
- let discountNum = parseInt(_price/pros.promotions.touchPrice)
|
|
|
- console.log('单品满减促销叠加通道叠加次数',`${discountNum}次`)
|
|
|
+ if (pros.promotions.discount == 1) {
|
|
|
+ let discountNum = parseInt(_price / pros.promotions.touchPrice)
|
|
|
+ console.log('单品满减促销叠加通道叠加次数', `${discountNum}次`)
|
|
|
// 单品满减-重新计算供应商总价/满减金额
|
|
|
- if ( _price >= pros.promotions.touchPrice) {
|
|
|
- supplierPrice -= pros.promotions.reducedPrice*discountNum
|
|
|
- supplierReducedPrice += pros.promotions.reducedPrice*discountNum
|
|
|
+ if (_price >= pros.promotions.touchPrice) {
|
|
|
+ supplierPrice -= pros.promotions.reducedPrice * discountNum
|
|
|
+ supplierReducedPrice += pros.promotions.reducedPrice * discountNum
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
console.log(' 单品满减非促销叠加通道')
|
|
|
// 单品满减-重新计算供应商总价/满减金额
|
|
|
- if ( _price >= pros.promotions.touchPrice) {
|
|
|
+ if (_price >= pros.promotions.touchPrice) {
|
|
|
supplierPrice -= pros.promotions.reducedPrice
|
|
|
supplierReducedPrice += pros.promotions.reducedPrice
|
|
|
}
|
|
@@ -962,14 +991,15 @@ export default {
|
|
|
})
|
|
|
// 店铺满减
|
|
|
if (item.promotions && item.promotions.mode * 1 === 2) {
|
|
|
- if(item.promotions.discount == 1){// 支持促销叠加条件的店铺满减 执行
|
|
|
- let prosDiscountNum = parseInt(supplierPrice/item.promotions.touchPrice) // 店铺满减促销叠加次数 = 店铺合计价格/满减促销价格
|
|
|
- console.log('店铺满减促销叠加通道叠加次数',`${prosDiscountNum}次`)
|
|
|
+ if (item.promotions.discount == 1) {
|
|
|
+ // 支持促销叠加条件的店铺满减 执行
|
|
|
+ let prosDiscountNum = parseInt(supplierPrice / item.promotions.touchPrice) // 店铺满减促销叠加次数 = 店铺合计价格/满减促销价格
|
|
|
+ console.log('店铺满减促销叠加通道叠加次数', `${prosDiscountNum}次`)
|
|
|
if (supplierPrice >= item.promotions.touchPrice) {
|
|
|
- supplierPrice -= item.promotions.reducedPrice*prosDiscountNum
|
|
|
- supplierReducedPrice += item.promotions.reducedPrice*prosDiscountNum
|
|
|
+ supplierPrice -= item.promotions.reducedPrice * prosDiscountNum
|
|
|
+ supplierReducedPrice += item.promotions.reducedPrice * prosDiscountNum
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
console.log('店铺满减非促销叠加通道')
|
|
|
// 店铺满减-计算供应商总价/满减金额
|
|
|
if (supplierPrice >= item.promotions.touchPrice) {
|
|
@@ -995,20 +1025,21 @@ export default {
|
|
|
promotions.productList.forEach(pros => {
|
|
|
collecTotal += this.collecTotalPrice(pros)
|
|
|
})
|
|
|
- if(promotions.discount == 1){// 支持凑单满减促销叠加条件的执行
|
|
|
- collecDiscountNum += parseInt(collecTotal/promotions.touchPrice) // 凑单满减促销叠加次数 = 凑单商品合计价格/凑单满减促销价格
|
|
|
- console.log('凑单促销满减叠加通道叠加次数',`${collecDiscountNum}次`)
|
|
|
+ if (promotions.discount == 1) {
|
|
|
+ // 支持凑单满减促销叠加条件的执行
|
|
|
+ collecDiscountNum += parseInt(collecTotal / promotions.touchPrice) // 凑单满减促销叠加次数 = 凑单商品合计价格/凑单满减促销价格
|
|
|
+ console.log('凑单促销满减叠加通道叠加次数', `${collecDiscountNum}次`)
|
|
|
if (collecTotal >= promotions.touchPrice) {
|
|
|
- totalPrice -= promotions.reducedPrice*collecDiscountNum
|
|
|
- reducedPrice += promotions.reducedPrice*collecDiscountNum
|
|
|
+ totalPrice -= promotions.reducedPrice * collecDiscountNum
|
|
|
+ reducedPrice += promotions.reducedPrice * collecDiscountNum
|
|
|
}
|
|
|
- }else{
|
|
|
- console.log('凑单促销满减非叠加通道')
|
|
|
+ } else {
|
|
|
+ console.log('凑单促销满减非叠加通道')
|
|
|
if (collecTotal >= promotions.touchPrice) {
|
|
|
totalPrice -= promotions.reducedPrice
|
|
|
reducedPrice += promotions.reducedPrice
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
// 最后勾选的超级会员优惠价
|
|
@@ -1033,16 +1064,17 @@ export default {
|
|
|
this.couponPrice = 0
|
|
|
}
|
|
|
}
|
|
|
- // 最终优惠金额 = 促销优惠金额 + 优惠券优惠金额 + 超级会员优惠金额
|
|
|
+ // 最终优惠金额 = 促销优惠金额 + 优惠券优惠金额 + 超级会员优惠金额
|
|
|
this.totalDiscountAmount = this.reducedPrice + this.couponPrice + this.svipReducedPrice
|
|
|
console.log('最终优惠金额', `${this.totalDiscountAmount}元`)
|
|
|
// 控制显示优惠明细
|
|
|
this.isDiscount = this.totalDiscountAmount > 0 ? true : false
|
|
|
},
|
|
|
- collecTotalPrice(pros){// 凑单满减计算勾选的凑单商品总价
|
|
|
- let price
|
|
|
+ collecTotalPrice(pros) {
|
|
|
+ // 凑单满减计算勾选的凑单商品总价
|
|
|
+ let price
|
|
|
this.checkenProsList.find(el => {
|
|
|
- if(pros.productId == el.productId ){
|
|
|
+ if (pros.productId == el.productId) {
|
|
|
price = el.number * el.price
|
|
|
}
|
|
|
})
|
|
@@ -1261,7 +1293,9 @@ export default {
|
|
|
Um_Key_SourcePage: '底部菜单购物车'
|
|
|
})
|
|
|
}
|
|
|
- this.$api.navigateTo(`/pages/user/order/create-order?type=2&data=${JSON.stringify({ data: cartPramsData })}`)
|
|
|
+ this.$api.navigateTo(
|
|
|
+ `/pages/user/order/create-order?type=2&data=${JSON.stringify({ data: cartPramsData })}`
|
|
|
+ )
|
|
|
}
|
|
|
},
|
|
|
showDelManager() {
|
|
@@ -1381,8 +1415,9 @@ export default {
|
|
|
url: '/pages/tabBar/home/index'
|
|
|
})
|
|
|
},
|
|
|
- goSuppile(shop) {//跳转店铺
|
|
|
- if(shop.shopType === 2){
|
|
|
+ goSuppile(shop) {
|
|
|
+ //跳转店铺
|
|
|
+ if (shop.shopType === 2) {
|
|
|
return
|
|
|
}
|
|
|
this.$api.navigateTo(`/pages/supplier/user/my-shop?shopId=${shop.shopId}`)
|
|
@@ -1477,7 +1512,7 @@ export default {
|
|
|
this.$uma.trackEvent('Um_Event_cartCouponReceive', {
|
|
|
Um_Key_PageName: '机构购物车',
|
|
|
Um_Key_EvenName: '领取优惠券',
|
|
|
- Um_Key_CouponId: `${coupon.couponId}`,
|
|
|
+ Um_Key_CouponId: `${coupon.couponId}`
|
|
|
})
|
|
|
}
|
|
|
this.ProductService.ReceiveCoupon({
|
|
@@ -1503,7 +1538,7 @@ export default {
|
|
|
this.$uma.trackEvent('Um_Event_userCouponCollectionBuy', {
|
|
|
Um_Key_PageName: '领券中心',
|
|
|
Um_Key_EvenName: '抵扣优惠券',
|
|
|
- Um_Key_CouponId: `${coupon.couponId}`,
|
|
|
+ Um_Key_CouponId: `${coupon.couponId}`
|
|
|
})
|
|
|
}
|
|
|
if (this.hasLogin) {
|
|
@@ -1516,71 +1551,79 @@ export default {
|
|
|
this.$api.navigateTo('/pages/login/login')
|
|
|
}
|
|
|
},
|
|
|
- WeChatPayCouponBeans(coupon){
|
|
|
+ WeChatPayCouponBeans(coupon) {
|
|
|
// 采美豆抵扣优惠券
|
|
|
this.PayService.WeChatPayCouponBeans({
|
|
|
source: 1, //领取渠道 1 小程序 2 网站
|
|
|
userId: this.couponParam.userId,
|
|
|
couponId: coupon.couponId
|
|
|
})
|
|
|
- .then(response => {
|
|
|
- this.$util.msg('抵扣成功', 1500)
|
|
|
- setTimeout(() => {
|
|
|
- this.currentTab = 1
|
|
|
- this.couponParam.status = 2
|
|
|
- this.queryPopupCoupons()
|
|
|
- }, 1500)
|
|
|
- })
|
|
|
- .catch(error => {
|
|
|
- this.$util.msg(error.msg, 2000)
|
|
|
- })
|
|
|
+ .then(response => {
|
|
|
+ this.$util.msg('抵扣成功', 1500)
|
|
|
+ setTimeout(() => {
|
|
|
+ this.currentTab = 1
|
|
|
+ this.couponParam.status = 2
|
|
|
+ this.queryPopupCoupons()
|
|
|
+ }, 1500)
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ this.$util.msg(error.msg, 2000)
|
|
|
+ })
|
|
|
},
|
|
|
- toPayCoupon(coupon){
|
|
|
+ toPayCoupon(coupon) {
|
|
|
// 点击购买优惠券,友盟埋点收集购买优惠券
|
|
|
if (process.env.NODE_ENV != 'development') {
|
|
|
this.$uma.trackEvent('Um_Event_cartCouponBuy', {
|
|
|
Um_Key_PageName: '机构购物车',
|
|
|
Um_Key_EvenName: '购买优惠券',
|
|
|
- Um_Key_CouponId: `${coupon.couponId}`,
|
|
|
+ Um_Key_CouponId: `${coupon.couponId}`
|
|
|
})
|
|
|
}
|
|
|
this.createCouponRecord(coupon)
|
|
|
},
|
|
|
- createCouponRecord(coupon){
|
|
|
+ createCouponRecord(coupon) {
|
|
|
// 生成购买优惠券记录Id
|
|
|
this.PayService.WeChatCouponRecord({
|
|
|
userId: this.userId,
|
|
|
couponId: coupon.couponId
|
|
|
})
|
|
|
- .then(response => {
|
|
|
- this.MiniWxPayFor(coupon,response.data.couponRecordId)
|
|
|
- })
|
|
|
- .catch(error => {
|
|
|
- if(error.code == -1){//个人机构不能购买
|
|
|
- this.contentModalText ='该优惠券仅限医美机构购买,请升级为医美机构后再次购买。'
|
|
|
- this.modal = true
|
|
|
-
|
|
|
- }else if(error.code == -2){//会员机构不是医美机构不能购买
|
|
|
- this.$util.msg('该优惠券仅限医美机构购买', 2000)
|
|
|
- }
|
|
|
- })
|
|
|
+ .then(response => {
|
|
|
+ this.MiniWxPayFor(coupon, response.data.couponRecordId)
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ if (error.code == -1) {
|
|
|
+ //个人机构不能购买
|
|
|
+ this.contentModalText = '该优惠券仅限医美机构购买,请升级为医美机构后再次购买。'
|
|
|
+ this.modal = true
|
|
|
+ } else if (error.code == -2) {
|
|
|
+ //会员机构不是医美机构不能购买
|
|
|
+ this.$util.msg('该优惠券仅限医美机构购买', 2000)
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- async MiniWxPayFor(coupon,couponRecordId){
|
|
|
+ async MiniWxPayFor(coupon, couponRecordId) {
|
|
|
const wechatcode = await authorize.getCode('weixin')
|
|
|
const params = {
|
|
|
userId: this.userId,
|
|
|
couponId: coupon.couponId,
|
|
|
- couponRecordId:couponRecordId,
|
|
|
- payType:'XCX',
|
|
|
+ couponRecordId: couponRecordId,
|
|
|
+ payType: 'XCX',
|
|
|
code: wechatcode,
|
|
|
source: 1 //支付来源 1 小程序 2 WWW
|
|
|
}
|
|
|
- this.weChatMiniCouponWxPay(params,'Um_Event_cartCouponPay','机构购物车','线上支付优惠券',coupon.couponId,this.userId)
|
|
|
+ this.weChatMiniCouponWxPay(
|
|
|
+ params,
|
|
|
+ 'Um_Event_cartCouponPay',
|
|
|
+ '机构购物车',
|
|
|
+ '线上支付优惠券',
|
|
|
+ coupon.couponId,
|
|
|
+ this.userId
|
|
|
+ )
|
|
|
},
|
|
|
- hideMobel(){
|
|
|
+ hideMobel() {
|
|
|
this.modal = false
|
|
|
},
|
|
|
- handleClick(e){
|
|
|
+ handleClick(e) {
|
|
|
//个人机构跳转升级页面
|
|
|
if (e.index == 1) {
|
|
|
this.$api.navigateTo('/pages/login/apply')
|
|
@@ -1596,7 +1639,7 @@ export default {
|
|
|
this.$uma.trackEvent('Um_Event_cartCouponButton', {
|
|
|
Um_Key_PageName: '机构购物车',
|
|
|
Um_Key_EvenName: '点击领券按钮',
|
|
|
- Um_Key_userId: `${this.userId}`,
|
|
|
+ Um_Key_userId: `${this.userId}`
|
|
|
})
|
|
|
}
|
|
|
this.currentTab = 0
|
|
@@ -1610,6 +1653,10 @@ export default {
|
|
|
break
|
|
|
}
|
|
|
},
|
|
|
+ handleShouUnitPopup(pros){// 规格弹窗
|
|
|
+ this.popupShow2 = true
|
|
|
+ this.handlePros = pros
|
|
|
+ },
|
|
|
hidePopup(index) {
|
|
|
// 隐藏popup弹窗
|
|
|
switch (index) {
|
|
@@ -1817,16 +1864,16 @@ page {
|
|
|
height: 100%;
|
|
|
border-radius: 10rpx;
|
|
|
}
|
|
|
- .pros-type{
|
|
|
+ .pros-type {
|
|
|
width: 64rpx;
|
|
|
height: 64rpx;
|
|
|
text-align: justify;
|
|
|
box-sizing: border-box;
|
|
|
padding: 10rpx;
|
|
|
border-radius: 0 0 8rpx 8rpx;
|
|
|
- background-color: #33CCBF;
|
|
|
+ background-color: #33ccbf;
|
|
|
font-size: $font-size-22;
|
|
|
- color: #FFFFFF;
|
|
|
+ color: #ffffff;
|
|
|
line-height: 25rpx;
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
@@ -1926,6 +1973,29 @@ page {
|
|
|
color: #999999;
|
|
|
font-size: $font-size-26;
|
|
|
}
|
|
|
+ .cart-sku-temp{
|
|
|
+ width: 100%;
|
|
|
+ height: 48rpx;
|
|
|
+ margin: 30rpx 0 0 0;
|
|
|
+ .cart-sku-text{
|
|
|
+ font-size: 28rpx;
|
|
|
+ line-height: 48rpx;
|
|
|
+ color: #666666;
|
|
|
+ float: left;
|
|
|
+ }
|
|
|
+ .cart-sku-btn{
|
|
|
+ padding: 0 16rpx;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 40rpx;
|
|
|
+ font-size: 24rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border: 1px solid #e15616;
|
|
|
+ color: #e15616;
|
|
|
+ float: left;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ margin-left: 16rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
.productprice {
|
|
|
width: 100%;
|
|
|
height: 48rpx;
|