From 5392d3a2fce0b99280113f3afa6b5147514451bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=A3=8A?= <468619417@qq.com> Date: Thu, 8 Jun 2023 17:07:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=89=8D=E4=BB=B7=E6=A0=BC?= =?UTF-8?q?=E5=8F=96=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.vue | 12 ++-- pages/verification/stepOne.vue | 111 ++++----------------------------- 2 files changed, 15 insertions(+), 108 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index b04eac6..ba4856a 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -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`); }, }); }, diff --git a/pages/verification/stepOne.vue b/pages/verification/stepOne.vue index f0ce5e2..c4f3820 100644 --- a/pages/verification/stepOne.vue +++ b/pages/verification/stepOne.vue @@ -4,7 +4,9 @@ 実際支払い金額 - ¥{{ newData.dMoney || newData.totalMoney }} + ¥{{ newData.dMoney || newData.totalMoney | changeMoney }} @@ -24,7 +26,7 @@ - ¥{{ axios_data.money | changeMoney }} + ¥{{ newData.totalMoney | changeMoney }} @@ -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 @@ ポイント利用 @@ -100,15 +98,11 @@ - {{ axios_data.num_dine }} + {{ newData.userNum }} - 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,