家政小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 898B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. const $ = global;
  2. new $.Page({
  3. data: {
  4. amount: 1,
  5. unitPrice: 599
  6. },
  7. minusAmount() {
  8. if (this.data.amount > 1) {
  9. this.setData({
  10. amount: this.data.amount - 1
  11. });
  12. }
  13. },
  14. addAmount() {
  15. this.setData({
  16. amount: this.data.amount + 1
  17. });
  18. },
  19. toPay() {
  20. const {
  21. name,
  22. phone,
  23. address,
  24. amount
  25. } = this.data;
  26. if (!name || !phone || !address || !amount) {
  27. return $.wx.showToast({
  28. title: '请把信息填写完整'
  29. });
  30. }
  31. if (!this._isPhone(phone)) {
  32. return $.wx.showToast({
  33. title: '请输入正确的手机号码'
  34. });
  35. }
  36. $.wx.showToast({
  37. title: '微信支付尚未接入'
  38. });
  39. }
  40. });