help.js 718 B

123456789101112131415161718192021222324252627282930313233
  1. import Config from "../../model/config";
  2. import Api from "../../model/api";
  3. import {getEventParam, toast} from "../../utils/utils";
  4. Page({
  5. data: {
  6. activeName: 0,
  7. info: {}
  8. },
  9. async onLoad(options) {
  10. const res = await Api.getHelpInfo(Config.APP_ID, true)
  11. this.setData({
  12. info: res.data
  13. })
  14. },
  15. onChange(e) {
  16. this.setData({
  17. activeName: getEventParam(e),
  18. });
  19. },
  20. async callPhone(e) {
  21. try {
  22. await wx.makePhoneCall({
  23. phoneNumber: this.data.info.appTelephone
  24. })
  25. } catch (e) {
  26. console.log(e)
  27. toast("拨打电话失败")
  28. }
  29. }
  30. })