formId-collect.js 662 Bytes
import dataUtils from './data-utils.js'
import api from './api.js'

export default {
  postFormId(params) {
    let uid = dataUtils.getUid();
    if (!uid || params.formId.length === 0) return
    let openID = dataUtils.getGlobalDataByKey('openID')
    let formIdParams = {
      uid,
      openId: openID,
      miniapp_type: dataUtils.getConfig().mini_app_type,
      formId: params.formId,
      position: params.position || '',
      method: 'wechat.formId.add',
      ...params
    }
    api.get({ data: formIdParams })
      .then((data) => {
        console.log('responsedata', data)
      })
      .catch(error => {
      })
  }
}