const $ = global; new $.Page({ data: { amount: 1, unitPrice: 599 }, minusAmount() { if (this.data.amount > 1) { this.setData({ amount: this.data.amount - 1 }); } }, addAmount() { this.setData({ amount: this.data.amount + 1 }); }, toPay() { const { name, phone, address, amount } = this.data; if (!name || !phone || !address || !amount) { return $.wx.showToast({ title: '请把信息填写完整' }); } if (!this._isPhone(phone)) { return $.wx.showToast({ title: '请输入正确的手机号码' }); } $.wx.showToast({ title: '微信支付尚未接入' }); } });