Feat(订单):使用积分逻辑调整
This commit is contained in:
@@ -3423,7 +3423,7 @@ page {
|
|||||||
|
|
||||||
.order-details .wrapper .item .conter {
|
.order-details .wrapper .item .conter {
|
||||||
color: #868686;
|
color: #868686;
|
||||||
width: 5*100rpx;
|
width: 4.5*100rpx;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,24 @@
|
|||||||
<view class="money">-¥{{ force2Decimal(orderPrice.deductionPrice) }}</view>
|
<view class="money">-¥{{ force2Decimal(orderPrice.deductionPrice) }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="coupon-cell">
|
||||||
|
<view class="flex jc-between ai-center">
|
||||||
|
<view class="title">积分抵扣:</view>
|
||||||
|
<view class="flex ai-center">
|
||||||
|
<u-switch
|
||||||
|
v-model="usePointsCheck"
|
||||||
|
size="20"
|
||||||
|
@change="usePointsCheckChange"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="usePointsCheck" class="flex jc-between ai-center points-cell">
|
||||||
|
<view>积分:{{ orderPrice.usedPoints }}</view>
|
||||||
|
<view class="flex ai-center">
|
||||||
|
-¥{{ force2Decimal(orderPrice.deductionPrice) }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="coupon-cell flex jc-between ai-center" @click="changeCoupons">
|
<view class="coupon-cell flex jc-between ai-center" @click="changeCoupons">
|
||||||
<view class="title">优惠券:</view>
|
<view class="title">优惠券:</view>
|
||||||
<view class="flex ai-center">
|
<view class="flex ai-center">
|
||||||
@@ -204,23 +221,27 @@
|
|||||||
<view class="footer acea-row row-between-wrapper" style="height: 80rpx;">
|
<view class="footer acea-row row-between-wrapper" style="height: 80rpx;">
|
||||||
<view style="margin-left: 30rpx;">
|
<view style="margin-left: 30rpx;">
|
||||||
<text style="color: #000000;font-size: 24rpx;font-weight: bold;">合计:</text>
|
<text style="color: #000000;font-size: 24rpx;font-weight: bold;">合计:</text>
|
||||||
<text class="" style="color: #FF564A;font-size: 28rpx;font-weight: bold;">¥{{
|
<text class="" style="color: #FF564A;font-size: 28rpx;font-weight: bold;">
|
||||||
force2Decimal(orderPrice.payPrice)
|
¥{{ force2Decimal(orderPrice.payPrice) }}
|
||||||
}}
|
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="settlement acea-row row-middle row-center" @click="subscribePay">立即结算</view>
|
<view class="settlement acea-row row-middle row-center" @click="subscribePay">立即结算</view>
|
||||||
</view>
|
</view>
|
||||||
<AddressWindow
|
<AddressWindow
|
||||||
@checked="changeAddress"
|
v-model="showAddress"
|
||||||
@redirect="addressRedirect"
|
ref="mychild"
|
||||||
v-model="showAddress"
|
:checked="addressInfo.id"
|
||||||
:checked="addressInfo.id"
|
@checked="changeAddress"
|
||||||
ref="mychild"
|
@redirect="addressRedirect"
|
||||||
></AddressWindow>
|
/>
|
||||||
|
<passkeyborad
|
||||||
<passkeyborad :money="orderPrice.payPrice" showMoney :show="isShowPayPwdPop" ref='payPwdPop' @close="pwdPopClose"
|
ref='payPwdPop'
|
||||||
@finish="pwdPopFinish"></passkeyborad>
|
showMoney
|
||||||
|
:money="orderPrice.payPrice"
|
||||||
|
:show="isShowPayPwdPop"
|
||||||
|
@close="pwdPopClose"
|
||||||
|
@finish="pwdPopFinish"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -288,7 +309,15 @@ export default {
|
|||||||
},
|
},
|
||||||
couponId: uni.getStorageSync('couponId') || 0,
|
couponId: uni.getStorageSync('couponId') || 0,
|
||||||
couponIndex: -1,
|
couponIndex: -1,
|
||||||
show: false
|
show: false,
|
||||||
|
// 是否使用积分开关
|
||||||
|
usePointsCheck: false,
|
||||||
|
// 要使用的积分数量(传0为不使用积分,目前需求是默认使用最大可使用的积分,所以只要传大于0的数值都会变为自动使用最大可用积分)
|
||||||
|
usePointsNumber: 0,
|
||||||
|
// 订单是否可以使用积分
|
||||||
|
canUsePoints: false,
|
||||||
|
// 订单最大可使用积分数量
|
||||||
|
maxPoints: 0
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: mapGetters(["userInfo", "storeItems"]),
|
computed: mapGetters(["userInfo", "storeItems"]),
|
||||||
@@ -344,13 +373,17 @@ export default {
|
|||||||
force2Decimal(value) {
|
force2Decimal(value) {
|
||||||
return this.$force2Decimal(value);
|
return this.$force2Decimal(value);
|
||||||
},
|
},
|
||||||
|
usePointsCheckChange(e) {
|
||||||
|
this.computedPrice()
|
||||||
|
},
|
||||||
|
// 计算订单金额
|
||||||
computedPrice(f) {
|
computedPrice(f) {
|
||||||
console.log(f)
|
|
||||||
let shipping_type = this.shipping_type;
|
let shipping_type = this.shipping_type;
|
||||||
postOrderComputed(this.orderGroupInfo.orderKey, {
|
postOrderComputed(this.orderGroupInfo.orderKey, {
|
||||||
addressId: this.addressInfo.id,
|
addressId: this.addressInfo.id,
|
||||||
useIntegral: this.useIntegral ? 1 : 0,
|
useIntegral: this.useIntegral ? 1 : 0,
|
||||||
couponId: this.couponId || 0,
|
couponId: this.couponId || 0,
|
||||||
|
usePoints: this.usePointsCheck ? 1 : 0,
|
||||||
shipping_type: parseInt(shipping_type) + 1
|
shipping_type: parseInt(shipping_type) + 1
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
@@ -363,6 +396,11 @@ export default {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.orderPrice = data.result;
|
this.orderPrice = data.result;
|
||||||
|
if (this.usePointsCheck) {
|
||||||
|
this.usePointsNumber = data.result.usedPoints
|
||||||
|
} else {
|
||||||
|
this.usePointsNumber = 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -391,6 +429,16 @@ export default {
|
|||||||
item.checked = false
|
item.checked = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
uni.removeStorageSync('couponId')
|
||||||
|
} else {
|
||||||
|
uni.removeStorageSync('couponId')
|
||||||
|
}
|
||||||
|
_this.canUsePoints = data.canUsePoints
|
||||||
|
_this.maxPoints = data.maxPoints
|
||||||
|
// 如果允许使用积分,则默认开启
|
||||||
|
if (data.canUsePoints) {
|
||||||
|
_this.usePointsCheck = true
|
||||||
|
_this.usePointsNumber = data.maxPoints
|
||||||
}
|
}
|
||||||
_this.addressInfo = data.addressInfo || {}
|
_this.addressInfo = data.addressInfo || {}
|
||||||
_this.systemStore = data.systemStore || {}
|
_this.systemStore = data.systemStore || {}
|
||||||
@@ -534,6 +582,7 @@ export default {
|
|||||||
addressId: this.addressInfo.id,
|
addressId: this.addressInfo.id,
|
||||||
useIntegral: this.useIntegral ? 1 : 0,
|
useIntegral: this.useIntegral ? 1 : 0,
|
||||||
couponId: this.couponId || 0,
|
couponId: this.couponId || 0,
|
||||||
|
usePoints: this.usePointsNumber || 0,
|
||||||
payType: this.active,
|
payType: this.active,
|
||||||
pinkId: this.pinkId,
|
pinkId: this.pinkId,
|
||||||
seckillId: this.orderGroupInfo.seckill_id,
|
seckillId: this.orderGroupInfo.seckill_id,
|
||||||
@@ -826,4 +875,8 @@ export default {
|
|||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
|
.points-cell {
|
||||||
|
padding: 20rpx 0 0 0;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -68,6 +68,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="lottery">
|
<view v-else class="lottery">
|
||||||
|
<image :src="webUrl + '/points-lottery.png'" class="img" />
|
||||||
<view class="one-t title">
|
<view class="one-t title">
|
||||||
{{ item.title }}
|
{{ item.title }}
|
||||||
</view>
|
</view>
|
||||||
@@ -312,9 +313,16 @@ export default {
|
|||||||
}
|
}
|
||||||
.lottery {
|
.lottery {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
|
.img {
|
||||||
|
display: block;
|
||||||
|
width: 62rpx;
|
||||||
|
height: 62rpx;
|
||||||
|
margin: 0 20rpx 0 0;
|
||||||
|
}
|
||||||
.title {
|
.title {
|
||||||
width: calc(100% - 160rpx);
|
flex: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.number {
|
.number {
|
||||||
|
|||||||
Reference in New Issue
Block a user