diff --git a/components/cu-keyboard/cu-keyboard.vue b/components/cu-keyboard/cu-keyboard.vue deleted file mode 100644 index 8601054..0000000 --- a/components/cu-keyboard/cu-keyboard.vue +++ /dev/null @@ -1,308 +0,0 @@ - - - - - \ No newline at end of file diff --git a/components/cu-keyboard/exmple.vue b/components/cu-keyboard/exmple.vue deleted file mode 100644 index 7de20ae..0000000 --- a/components/cu-keyboard/exmple.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - - - diff --git a/components/popups/index.vue b/components/popups/index.vue new file mode 100644 index 0000000..b733be3 --- /dev/null +++ b/components/popups/index.vue @@ -0,0 +1,151 @@ + + + + + \ No newline at end of file diff --git a/pages/order_details/stay.vue b/pages/order_details/stay.vue index 28595ba..d8dce24 100644 --- a/pages/order_details/stay.vue +++ b/pages/order_details/stay.vue @@ -209,7 +209,8 @@ 取消订单 - 立即付款 + 立即付款 + - + {{mer_name||''}} - - - 订单金额 - + - + @@ -65,6 +63,7 @@ @authColse="authColse" @onLoadFun="onLoadFun"> --> + @@ -83,9 +82,11 @@ import { Toast } from "../../libs/uniApi"; + import popups from "@/components/popups/index.vue"; export default { components: { authorize, + popups }, computed: { ...mapGetters(['isLogin']), @@ -120,7 +121,7 @@ mer_id: '', tips: '暂未登陆~', changeTxt: '展开', - isOpen: true, + isOpen: false, keyBoardShow: false, mer_name: '' } @@ -130,8 +131,8 @@ that = this; this.mer_id = opt.mer_id; }, + onShow() { - this.getProductInfoByMerid(this.mer_id); if (!this.isLogin) { Cache.set("login_back_url_weixin", "/" + getCurrentPages()[0].route + "?mer_id=" + this.mer_id); this.isAuto = true; @@ -146,12 +147,42 @@ this.checkForm.cart_id = []; this.getProductInfoByMerid(this.mer_id); } - }, methods: { - test(){ - this.$refs.pop.open() - }, + // 打开键盘 + handleOpenKeyboard() { + if (!this.isLogin) { + Cache.set("login_back_url_weixin", "/" + getCurrentPages()[0].route + "?mer_id=" + this.mer_id); + this.isAuto = true; + this.isShowAuth = true; + if (this.isWeixin) { + this.tips = '加载中...'; + this.$nextTick(() => { + this.$refs.authRef.toWecahtAuth(); + }) + } + } else { + this.$refs.popups.handleOpen(); + } + }, + + // 键盘回调 + handleConfirm(e) { + if (!e) return; + this.cartForm.total_amount = e; + this.submitOrder(); + }, + + // 清空 + handleClear() { + this.cartForm.total_amount = ''; + }, + + // 输入数字 + handleChange(e) { + this.cartForm.total_amount = e; + }, + validateDecimal(event) { let val = (that.cartForm.total_amount.match(/^\d*(\.?\d{0,2})/g)[0]) || '' that.$nextTick(() => { @@ -237,12 +268,12 @@ }, getProductInfoByMerid(merid, money) { - // if (!that.cartForm.total_amount) return; + console.log(123123); getProductInfo({ mer_id: that.mer_id, money: that.cartForm.total_amount }).then(res => { - console.log(res); + console.log(res); if (!that.cartForm.total_amount) { this.mer_name = res.data.merchant; } else { @@ -316,7 +347,7 @@