formIdCollectRequest.js
817 Bytes
import Promise from '../vendors/es6-promise';
import api from '../common/api.js';
import { getYHStorageSync } from '../utils/util';
function postFormId(formId,position) {
let app = getApp();
let that = this;
//如果没有uid,不上报,否则接口报500
if (!app.getUid()||formId.length===0) return
if(!position) position=''
let formIdParams = {
uid: app.getUid(),
openId: app.globalData.openID ? app.globalData.openID : getYHStorageSync('openID', 'goodsDetail'),
miniapp_type: app.globalData.miniapp_type,
formId: formId,
position,
method: 'wechat.formId.add',
}
// console.log('formidParam:', formIdParams)
api.get({data: formIdParams})
.then((data) => {
// console.log('responsedata', data)
})
.catch(error => {
})
}
export {
postFormId,
}