|
@@ -35,9 +35,10 @@
|
|
|
<div class="input-ward fl">
|
|
<div class="input-ward fl">
|
|
|
¥
|
|
¥
|
|
|
<input
|
|
<input
|
|
|
- @focus="$emit('changeFocusType', 'payPrice')"
|
|
|
|
|
|
|
+ @focus="$emit('changeFocusType', 'allPrice')"
|
|
|
placeholder="请输入金额"
|
|
placeholder="请输入金额"
|
|
|
- v-model="from.payPrice"
|
|
|
|
|
|
|
+ @input="$emit('checkValue', from.allPrice)"
|
|
|
|
|
+ v-model="from.allPrice"
|
|
|
v-int
|
|
v-int
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
@@ -48,31 +49,38 @@
|
|
|
<input
|
|
<input
|
|
|
type="text"
|
|
type="text"
|
|
|
v-model="from.discount"
|
|
v-model="from.discount"
|
|
|
|
|
+ v-int
|
|
|
|
|
+ @input="$emit('checkValue', from.discount)"
|
|
|
@focus="$emit('changeFocusType', 'discount')"
|
|
@focus="$emit('changeFocusType', 'discount')"
|
|
|
/>
|
|
/>
|
|
|
- <span class="text-21f">({{ from.discount * getRules }}积分)</span>
|
|
|
|
|
|
|
+ <span class="mr1">元</span>
|
|
|
|
|
+ <span class="text-21f">({{ morePointsValue }}积分)</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="integral-box c48">
|
|
<div class="integral-box c48">
|
|
|
<div>
|
|
<div>
|
|
|
- 可用积分:{{ userInfo.pointsValue }}积分({{
|
|
|
|
|
- (userInfo.pointsValue / getRules) | formatPrice
|
|
|
|
|
|
|
+ 可用积分:{{ memberInfo.pointsValue }}积分({{
|
|
|
|
|
+ (memberInfo.pointsValue / getRules) | formatPrice
|
|
|
}}元)
|
|
}}元)
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
- 抵扣积分:100积分({{
|
|
|
|
|
- (userInfo.pointsValue / getRules) | formatPrice
|
|
|
|
|
|
|
+ 抵扣积分:{{ deductionIntegral }}积分({{
|
|
|
|
|
+ (deductionIntegral / getRules) | formatPrice
|
|
|
}}元)
|
|
}}元)
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
- 积分补差:100积分({{
|
|
|
|
|
- (userInfo.pointsValue / getRules) | formatPrice
|
|
|
|
|
|
|
+ 积分补差:{{ paidPointsValue }}积分({{
|
|
|
|
|
+ (paidPointsValue / getRules) | formatPrice
|
|
|
}}元)
|
|
}}元)
|
|
|
</div>
|
|
</div>
|
|
|
<div class="line"></div>
|
|
<div class="line"></div>
|
|
|
<div class="c48">
|
|
<div class="c48">
|
|
|
- 优惠金额:<span class="discount-money">¥100.00</span>
|
|
|
|
|
|
|
+ 优惠金额:<span class="discount-money"
|
|
|
|
|
+ >¥{{ (deductionIntegral / getRules) | formatPrice }}</span
|
|
|
|
|
+ >
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="c48">
|
|
|
|
|
+ 实付金额:<span class="money">¥{{ payPrice | formatPrice }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="c48">实付金额:<span class="money">¥2243.00</span></div>
|
|
|
|
|
<div class="fl c48">
|
|
<div class="fl c48">
|
|
|
支付方式:
|
|
支付方式:
|
|
|
<div
|
|
<div
|
|
@@ -88,7 +96,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="btn">
|
|
<div class="btn">
|
|
|
- <el-button type="danger">立即收款</el-button>
|
|
|
|
|
|
|
+ <el-button type="danger" @click="handelPay">立即收款</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</container>
|
|
</container>
|
|
@@ -114,7 +122,7 @@ export default {
|
|
|
type: {
|
|
type: {
|
|
|
type: [Number, String],
|
|
type: [Number, String],
|
|
|
},
|
|
},
|
|
|
- userInfo: {
|
|
|
|
|
|
|
+ memberInfo: {
|
|
|
type: Object,
|
|
type: Object,
|
|
|
default: () => {
|
|
default: () => {
|
|
|
return {};
|
|
return {};
|
|
@@ -133,7 +141,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
lebel: "现金支付",
|
|
lebel: "现金支付",
|
|
|
- value: 4,
|
|
|
|
|
|
|
+ value: 3,
|
|
|
src: require("../../../assets/images/icon_cash.png"),
|
|
src: require("../../../assets/images/icon_cash.png"),
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
@@ -144,6 +152,47 @@ export default {
|
|
|
mounted() {},
|
|
mounted() {},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ handelPay() {
|
|
|
|
|
+ if (this.list.length == 0) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: "请选择至少一个商品",
|
|
|
|
|
+ type: "warning",
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!this.memberInfo.userId) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: "请先扫描会员信息",
|
|
|
|
|
+ type: "warning",
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.from.userId = this.memberInfo.userId;
|
|
|
|
|
+ if (this.active == 1) {
|
|
|
|
|
+ this.from.orderStatus = 0;
|
|
|
|
|
+ this.from.payStatus = 0;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.from.orderStatus = 1;
|
|
|
|
|
+ this.from.payStatus = 2;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.from.payType = this.active;
|
|
|
|
|
+ this.from.payPrice = this.payPrice;
|
|
|
|
|
+ this.from.deductionIntegral = this.deductionIntegral;
|
|
|
|
|
+ this.from.deductionMoney = (
|
|
|
|
|
+ this.deductionIntegral / this.getRules
|
|
|
|
|
+ ).toFixed(2);
|
|
|
|
|
+ this.from.integralRule = this.getRules;
|
|
|
|
|
+ this.from.goodsList = this.list.map((e) => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ goodsId: e.goodsId,
|
|
|
|
|
+ goodsPrice: e.standPrice,
|
|
|
|
|
+ goodsReceived: e.specialPrice,
|
|
|
|
|
+ specialPrice: e.specialPrice,
|
|
|
|
|
+ payStatus: this.from.payStatus,
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+ this.$emit("pay");
|
|
|
|
|
+ },
|
|
|
del(index) {
|
|
del(index) {
|
|
|
this.list.splice(index, 1);
|
|
this.list.splice(index, 1);
|
|
|
},
|
|
},
|
|
@@ -151,17 +200,29 @@ export default {
|
|
|
this.$emit("update:type", type);
|
|
this.$emit("update:type", type);
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
- watch: {
|
|
|
|
|
- list: {
|
|
|
|
|
- handler(val) {
|
|
|
|
|
- // console.log(val);
|
|
|
|
|
- },
|
|
|
|
|
- immediate: true,
|
|
|
|
|
- deep: true,
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
computed: {
|
|
computed: {
|
|
|
...mapGetters(["getRules"]),
|
|
...mapGetters(["getRules"]),
|
|
|
|
|
+ payPrice() {
|
|
|
|
|
+ return (
|
|
|
|
|
+ this.from.allPrice -
|
|
|
|
|
+ this.from.discount +
|
|
|
|
|
+ this.paidPointsValue / this.getRules
|
|
|
|
|
+ ).toFixed(2);
|
|
|
|
|
+ },
|
|
|
|
|
+ deductionIntegral() {
|
|
|
|
|
+ return this.memberInfo.pointsValue > this.morePointsValue
|
|
|
|
|
+ ? this.morePointsValue
|
|
|
|
|
+ : this.memberInfo.pointsValue;
|
|
|
|
|
+ },
|
|
|
|
|
+ paidPointsValue() {
|
|
|
|
|
+ return this.morePointsValue - this.deductionIntegral;
|
|
|
|
|
+ },
|
|
|
|
|
+ paidPrice() {
|
|
|
|
|
+ return this.formatPrice(this.paidPointsValue / this.getRules);
|
|
|
|
|
+ },
|
|
|
|
|
+ morePointsValue() {
|
|
|
|
|
+ return this.from.discount * this.getRules;
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
@@ -249,6 +310,11 @@ export default {
|
|
|
margin-bottom: 18px;
|
|
margin-bottom: 18px;
|
|
|
.mr {
|
|
.mr {
|
|
|
margin: 0 8px 0 12px;
|
|
margin: 0 8px 0 12px;
|
|
|
|
|
+ color: #666666;
|
|
|
|
|
+ }
|
|
|
|
|
+ .mr1 {
|
|
|
|
|
+ margin-left: 8px;
|
|
|
|
|
+ color: #666666;
|
|
|
}
|
|
}
|
|
|
.discount-text {
|
|
.discount-text {
|
|
|
color: #000;
|
|
color: #000;
|
|
@@ -261,7 +327,6 @@ export default {
|
|
|
height: 36px;
|
|
height: 36px;
|
|
|
padding: 0 10px;
|
|
padding: 0 10px;
|
|
|
border-radius: 6px;
|
|
border-radius: 6px;
|
|
|
- color: #eb5757;
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.integral-box {
|
|
.integral-box {
|