index.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. Page({
  2. data: {
  3. selectedIndex: 0,
  4. agreementVisible: false,
  5. rechargeId: '',
  6. rechargeOptions: [
  7. { amount: '10万币', price: 10000 },
  8. { amount: '20万币', price: 20000 },
  9. { amount: '50万币', price: 50000 },
  10. { amount: '100万币', price: 100000 },
  11. { amount: '200万币', price: 200000 },
  12. { amount: '500万币', price: 500000 },
  13. { amount: '1000万币', price: 1000000 },
  14. { amount: '2000万币', price: 2000000 },
  15. { amount: '5000万币', price: 5000000 },
  16. ],
  17. },
  18. selectOption(e) {
  19. const index = e.currentTarget.dataset.index
  20. this.setData({ selectedIndex: index })
  21. },
  22. handleIdInput(e) {
  23. this.setData({
  24. rechargeId: e.detail.value,
  25. })
  26. },
  27. handleLogin() {
  28. wx.showToast({
  29. title: 'ID不正确',
  30. icon: 'none',
  31. })
  32. },
  33. showAgreement() {
  34. this.setData({ agreementVisible: true })
  35. },
  36. hideAgreement() {
  37. this.setData({ agreementVisible: false })
  38. },
  39. openAgreementLink() {
  40. wx.navigateTo({
  41. url: '/pages/webview/index',
  42. })
  43. },
  44. })