优惠前价格取整
This commit is contained in:
@@ -198,16 +198,14 @@ export default {
|
||||
// uni.setStorageSync("customer_info", ["39207", "zh-CN"]);
|
||||
// this.$i18n.locale = "en";
|
||||
// uni.setStorageSync("heXiaoData", {
|
||||
// totalMoney: +this.form_data.money.value,
|
||||
// totalMoney: Math.round(+this.form_data.money.value),
|
||||
// userNum: this.form_data.num_dine,
|
||||
// dTicket: 0, // 优惠券抵扣
|
||||
// dIntegral: 0, // 积分抵扣
|
||||
// dMoney: 0, // 抵扣后金额
|
||||
// coupon: [], // 选中的优惠券
|
||||
// });
|
||||
// this.gotoWhere(
|
||||
// `/pages/verification/stepOne?money=${this.form_data.money.value}&num_dine=${this.form_data.num_dine}`
|
||||
// );
|
||||
// this.gotoWhere(`/pages/verification/stepOne`);
|
||||
// return;
|
||||
// 允许从相机和相册扫码
|
||||
if (parseInt(this.form_data.money.value) < 0) return;
|
||||
@@ -218,7 +216,7 @@ export default {
|
||||
console.log(customer_info);
|
||||
uni.setStorageSync("customer_info", customer_info);
|
||||
uni.setStorageSync("heXiaoData", {
|
||||
totalMoney: +this.form_data.money.value,
|
||||
totalMoney: Math.round(+this.form_data.money.value),
|
||||
userNum: this.form_data.num_dine,
|
||||
dTicket: 0, // 优惠券抵扣
|
||||
dIntegral: 0, // 积分抵扣
|
||||
@@ -227,9 +225,7 @@ export default {
|
||||
});
|
||||
// 修改默认语言
|
||||
this.$i18n.locale = customer_info[1];
|
||||
this.gotoWhere(
|
||||
`/pages/verification/stepOne?money=${this.form_data.money.value}&num_dine=${this.form_data.num_dine}`
|
||||
);
|
||||
this.gotoWhere(`/pages/verification/stepOne`);
|
||||
},
|
||||
});
|
||||
},
|
||||
|
@@ -4,7 +4,9 @@
|
||||
<view class="public_box all_money flex">
|
||||
<view class="title">実際支払い金額</view>
|
||||
<!-- <view class="content">¥{{ all_price | changeMoney }}</view> -->
|
||||
<view class="content">¥{{ newData.dMoney || newData.totalMoney }}</view>
|
||||
<view class="content"
|
||||
>¥{{ newData.dMoney || newData.totalMoney | changeMoney }}</view
|
||||
>
|
||||
</view>
|
||||
<!-- <view class="step_three_txt">認証明細/{{ $t('核销明细') }}</view> -->
|
||||
<view class="public_box fun_box">
|
||||
@@ -24,7 +26,7 @@
|
||||
<!-- <view class="right_l">
|
||||
</view> -->
|
||||
<view class="right_r flex_ac">
|
||||
<view class="txt">¥{{ axios_data.money | changeMoney }}</view>
|
||||
<view class="txt">¥{{ newData.totalMoney | changeMoney }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -35,7 +37,7 @@
|
||||
class="right flex_abs"
|
||||
@tap="
|
||||
gotoWhere(
|
||||
`/pages/verification/selectCoupon?money=${form_data.money.value}`
|
||||
`/pages/verification/selectCoupon?money=${newData.totalMoney}`
|
||||
)
|
||||
"
|
||||
>
|
||||
@@ -76,11 +78,7 @@
|
||||
<view class="left">ポイント利用</view>
|
||||
<view
|
||||
class="right flex_abs"
|
||||
@tap="
|
||||
gotoWhere(
|
||||
`/pages/verification/selectIntegral?money=${use_con_price * 1}`
|
||||
)
|
||||
"
|
||||
@tap="gotoWhere(`/pages/verification/selectIntegral`)"
|
||||
>
|
||||
<!-- <view class="right_l">
|
||||
</view> -->
|
||||
@@ -100,15 +98,11 @@
|
||||
<!-- <view class="right_l">
|
||||
</view> -->
|
||||
<view class="right_r flex_ac">
|
||||
<view class="txt">{{ axios_data.num_dine }}</view>
|
||||
<view class="txt">{{ newData.userNum }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="step_three_txt" style="color:#007AD7;margin-top: 60rpx;">※{{ $t('请让商家输入验证码并提交') }}</view>
|
||||
<view class="public_box shop_code_box" :class="{ 'active': form_data.code.value }">
|
||||
<view class="content"><input v-model="form_data.code.value" :password="true" :placeholder="`店舗ID:${axios_data.id}の認証コードを入力してください。`" placeholder-style="font-weight: 600;color:#8A8A8A;" @keyboardheightchange="keyboardheightchange" /></view>
|
||||
</view> -->
|
||||
<view class="next_btn_box">
|
||||
<view
|
||||
class="next_btn flex_abc"
|
||||
@@ -161,15 +155,6 @@ export default {
|
||||
money: "",
|
||||
num_dine: "", // 人数
|
||||
},
|
||||
form_data: {
|
||||
money: {
|
||||
value: "",
|
||||
tips_key: "",
|
||||
process_type: 2,
|
||||
},
|
||||
num_dine: "", // 人数
|
||||
},
|
||||
ver_coupon: {},
|
||||
mb_flag: false,
|
||||
tenantId: "",
|
||||
|
||||
@@ -178,20 +163,13 @@ export default {
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
let { money, num_dine } = options;
|
||||
this.form_data.money.value = money;
|
||||
this.form_data.num_dine = num_dine;
|
||||
this.newData = uni.getStorageSync("heXiaoData");
|
||||
|
||||
this.axios_data.id = uni.getStorageSync("store_obj").id;
|
||||
this.axios_data.storeName = uni.getStorageSync("store_obj").shop_name;
|
||||
this.axios_data.money = this.form_data.money.value;
|
||||
this.axios_data.num_dine = this.form_data.num_dine;
|
||||
|
||||
console.log("this.axios_data.num_dine", num_dine);
|
||||
|
||||
this.tenantId = uni.getStorageSync("customer_info")[0];
|
||||
this.getListFn(this.axios_data.id, this.tenantId);
|
||||
|
||||
this.newData = uni.getStorageSync("heXiaoData");
|
||||
},
|
||||
onUnload() {
|
||||
this.clearStore();
|
||||
@@ -201,36 +179,8 @@ export default {
|
||||
this.customer_info = uni.getStorageSync("customer_info");
|
||||
},
|
||||
computed: {
|
||||
all_price() {
|
||||
let price = this.use_con_price;
|
||||
price = price - this.axios_data.point - this.ver_coupon.couponValue;
|
||||
return price > 0 ? price : 0;
|
||||
},
|
||||
use_con_price() {
|
||||
let price = this.form_data.money.value;
|
||||
if (!this.ver_coupon.couponValue) {
|
||||
return price;
|
||||
}
|
||||
},
|
||||
last_btn_flag() {
|
||||
console.log(this.form_data);
|
||||
this.formDataRuleHandler();
|
||||
let tips_key = "";
|
||||
// 获取不同步骤的错误提示信息
|
||||
for (var key in this.form_data) {
|
||||
if (
|
||||
this.form_data[key].process_type === this.plan &&
|
||||
this.form_data[key].tips_key
|
||||
) {
|
||||
tips_key = this.form_data[key].tips_key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (tips_key) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
@@ -249,55 +199,16 @@ export default {
|
||||
}
|
||||
},
|
||||
clearStore() {
|
||||
// uni.removeStorageSync("ver_coupon");
|
||||
// uni.removeStorageSync("use_point");
|
||||
uni.removeStorageSync("heXiaoData");
|
||||
},
|
||||
// input 失去焦点 检测事件
|
||||
blurChecked(key_code) {
|
||||
if (key_code == "people" && this.form_data[key_code].value < 1) {
|
||||
this.form_data[key_code].value = 1;
|
||||
}
|
||||
},
|
||||
// 表单验证
|
||||
formDataRuleHandler() {
|
||||
let flag = true;
|
||||
let str = "";
|
||||
for (let key in this.form_data) {
|
||||
if (this.form_data[key].process_type === this.plan) {
|
||||
if (this.rule[key]) {
|
||||
this.form_data[key].tips_key = this.rule[key](
|
||||
this.form_data[key].value
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async verificationApi() {
|
||||
// let params = {
|
||||
// couponId: this.ver_coupon.couponId
|
||||
// ? this.ver_coupon.couponId
|
||||
// : this.ver_coupon.id,
|
||||
// customerId: uni.getStorageSync("customer_info")[0],
|
||||
// // diningNumber: this.form_data.people.value,
|
||||
// // discountAmount: this.ver_coupon.couponValue,
|
||||
// discountType: 2,
|
||||
// point: this.axios_data.point,
|
||||
// // securityCode: this.form_data.code.value,
|
||||
// spendAmount: this.form_data.money.value * 100,
|
||||
// storeId: this.axios_data.id,
|
||||
// tenantId: this.tenantId,
|
||||
// imei: uni.getStorageSync("store_obj").imei,
|
||||
// diningNumber: +this.form_data.num_dine,
|
||||
// };
|
||||
|
||||
// 处理优惠券为JSON格式
|
||||
this.newData.coupon = JSON.stringify(this.newData.coupon);
|
||||
let params = {
|
||||
type: 2,
|
||||
shop_id: this.axios_data.id,
|
||||
user_id: this.tenantId,
|
||||
number_of_people: +this.form_data.num_dine,
|
||||
number_of_people: +this.newData.userNum,
|
||||
amount_receivable: this.newData.totalMoney,
|
||||
coupon: this.newData.coupon,
|
||||
points: this.newData.dIntegral,
|
||||
|
Reference in New Issue
Block a user