contact.js 941 Bytes
import {
  getBindtapData
} from '../../utils/util';

let app = getApp();
Page({
  data: {
    authorizeVisible: false,
    contactInfo: {}
  },
  onShareAppMessage() {},
  showAuth() {
    this.setData({
      authorizeVisible: true
    })
  },
  onLoad(options) {
    this.initData();
  },
  initData() {
    this.queryContact();
  },
  // 去联系我们表单页面
  onContactUserTableHandler() {
    app.router.push({
      path: "contactTable"
    })
  },
  // 打电话
  onMakePhoneCallHandler(evt) {
    let phoneNumber = getBindtapData(evt);
    wx.makePhoneCall({
      phoneNumber: phoneNumber
    })
  },
  // 联系我们
  queryContact() {
    return new Promise((resolve, reject) => {
      app.post({
        url: app.api.contact,
        sid: false
      }).then((result) => {
        this.setData({
          contactInfo: result
        })
        console.log("result:", result);
      })
      resolve();
    });
  }
})